Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
王兴琳 7 months ago
parent
commit
924b9dbfe0
  1. 15
      zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java
  2. 3
      zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java
  3. 3
      zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java
  4. 3
      zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java
  5. 5
      zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java
  6. 10
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java
  7. 12
      zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java
  8. 23
      zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml

15
zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java

@ -2,6 +2,8 @@ package com.zc.business.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -45,7 +47,18 @@ public class DcPublishManageController extends BaseController
List<DcPublishManage> list = dcPublishManageService.selectDcPublishManageList(dcPublishManage); List<DcPublishManage> list = dcPublishManageService.selectDcPublishManageList(dcPublishManage);
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询事件发布详情传参事件id
*/
@PreAuthorize("@ss.hasPermi('business:manage:list')")
@GetMapping("/listEvent")
public AjaxResult listEvent(DcPublishManage dcPublishManage)
{
if (dcPublishManage.getEventId()==null|| StringUtils.isBlank(dcPublishManage.getEventId())){
return AjaxResult.error("参数错误");
}
return AjaxResult.success(dcPublishManageService.selectEventDcPublishManageList(dcPublishManage));
}
/** /**
* 导出信息发布管理记录列表 * 导出信息发布管理记录列表
*/ */

3
zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java

@ -104,7 +104,7 @@ public class WeatherForecastController extends BaseController {
JSONObject jsonResult = JSONObject.parseObject(response.body().string()); JSONObject jsonResult = JSONObject.parseObject(response.body().string());
if (jsonResult.getInteger("code") == 200) { if (jsonResult.getInteger("code") == 200) {
jsonObject.put("name",dcRegion.getRegionName()); jsonResult.put("name",dcRegion.getRegionName());
jsonObject.put(weather.getString("METEOROLOGICALEARLYWARNING") + dcRegion.getId(), extracted(jsonResult,"warning")); jsonObject.put(weather.getString("METEOROLOGICALEARLYWARNING") + dcRegion.getId(), extracted(jsonResult,"warning"));
} else { } else {
@ -179,6 +179,7 @@ public class WeatherForecastController extends BaseController {
if (jsonResult.getInteger("code") == 200) { if (jsonResult.getInteger("code") == 200) {
jsonObject.put("name",dcRegion.getRegionName()); jsonObject.put("name",dcRegion.getRegionName());
jsonResult.put("name",dcRegion.getRegionName());
if (Objects.equals(redisKey, weather.getString("WEATHERFACTS"))) { if (Objects.equals(redisKey, weather.getString("WEATHERFACTS"))) {
jsonObject.put(redisKey + dcRegion.getId(), extracted(jsonResult, "now")); jsonObject.put(redisKey + dcRegion.getId(), extracted(jsonResult, "now"));

3
zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java

@ -28,7 +28,8 @@ public interface DcPublishManageMapper
* @return 信息发布管理记录集合 * @return 信息发布管理记录集合
*/ */
List<DcPublishManage> selectDcPublishManageList(DcPublishManage dcPublishManage); List<DcPublishManage> selectDcPublishManageList(DcPublishManage dcPublishManage);
//查询某个事件的全部发布记录
List<DcPublishManage> selectEventDcPublishManageList(DcPublishManage dcPublishManage);
/** /**
* 新增信息发布管理记录 * 新增信息发布管理记录
* *

3
zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java

@ -26,7 +26,8 @@ public interface IDcPublishManageService
* @return 信息发布管理记录集合 * @return 信息发布管理记录集合
*/ */
List<DcPublishManage> selectDcPublishManageList(DcPublishManage dcPublishManage); List<DcPublishManage> selectDcPublishManageList(DcPublishManage dcPublishManage);
//查询某个事件的全部发布记录
List<DcPublishManage> selectEventDcPublishManageList(DcPublishManage dcPublishManage);
/** /**
* 新增信息发布管理记录 * 新增信息发布管理记录
* *

5
zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java

@ -56,6 +56,11 @@ public class DcPublishManageServiceImpl implements IDcPublishManageService
return dcPublishManageMapper.selectDcPublishManageList(dcPublishManage); return dcPublishManageMapper.selectDcPublishManageList(dcPublishManage);
} }
@Override
public List<DcPublishManage> selectEventDcPublishManageList(DcPublishManage dcPublishManage) {
return dcPublishManageMapper.selectEventDcPublishManageList(dcPublishManage);
}
/** /**
* 新增信息发布管理记录 * 新增信息发布管理记录
* *

10
zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

@ -468,21 +468,20 @@ public class DcWarningServiceImpl implements IDcWarningService
dcEvent.setDirection(dcWarning.getDirection());//方向 dcEvent.setDirection(dcWarning.getDirection());//方向
dcEvent.setDeptId(dcWarning.getDeptId());//部门 dcEvent.setDeptId(dcWarning.getDeptId());//部门
dcEvent.setOccurrenceTime(dcWarning.getWarningTime());//预警时间 dcEvent.setOccurrenceTime(dcWarning.getWarningTime());//预警时间
Integer warningType = dcWarning.getWarningType();//事件主类
if (dcWarning.getWarningLevel()!=null) { if (dcWarning.getWarningLevel()!=null) {
dcEvent.setEventLevel(dcWarning.getWarningLevel().longValue());//事件等级 dcEvent.setEventLevel(dcWarning.getWarningLevel().longValue());//事件等级
} }
if (dcWarning.getWarningSource()!=null) { if (dcWarning.getWarningSource()!=null) {
dcEvent.setEventSource((long) ValueConverter.convertValueSource(dcWarning.getWarningSource()));//事件来源 dcEvent.setEventSource((long) ValueConverter.convertValueSource(dcWarning.getWarningSource()));//事件来源
} }
if (dcWarning.getWarningType()!=null) { if (warningType!=null) {
dcEvent.setEventType((long) ValueConverter.convertValueHost(dcWarning.getWarningType()));//事件主类 dcEvent.setEventType((long) ValueConverter.convertValueHost(dcWarning.getWarningType()));//事件主类
} }
if (dcWarning.getWarningSubclass()!=null&&StringUtils.isBlank(dcWarning.getWarningSubclass())&&dcWarning.getWarningType()!=7&& if (dcWarning.getWarningSubclass()!=null&&warningType!=7&& warningType!=10) {
dcWarning.getWarningType()!=10) {
dcEvent.setEventSubclass(ValueConverter.convertValueSon(dcWarning.getWarningSubclass()));//事件子类(7与10不转) dcEvent.setEventSubclass(ValueConverter.convertValueSon(dcWarning.getWarningSubclass()));//事件子类(7与10不转)
} }
if (dcWarning.getWarningSubclass()!=null&&StringUtils.isBlank(dcWarning.getWarningSubclass())&&(dcWarning.getWarningType()==7|| if (dcWarning.getWarningSubclass()!=null&&(warningType==7|| warningType==10)){
dcWarning.getWarningType()==10)){
dcEvent.setEventSubclass(dcWarning.getWarningSubclass());//事件子类(7与10主类对应的子类直接set) dcEvent.setEventSubclass(dcWarning.getWarningSubclass());//事件子类(7与10主类对应的子类直接set)
} }
dcEvent.setOccurrenceTime(dcWarning.getWarningTime());//发生时间 dcEvent.setOccurrenceTime(dcWarning.getWarningTime());//发生时间
@ -495,6 +494,7 @@ public class DcWarningServiceImpl implements IDcWarningService
dcEvent.setEventState(Long.valueOf(1));//状态为处理中 dcEvent.setEventState(Long.valueOf(1));//状态为处理中
dcEvent.setCreateTime(DateUtils.getNowDate());//创建时间 dcEvent.setCreateTime(DateUtils.getNowDate());//创建时间
dcEvent.setUserId(SecurityUtils.getUserId());//处置人员 dcEvent.setUserId(SecurityUtils.getUserId());//处置人员
dcEvent.setRoadId(1L);//高速公路(济菏高速)
int insertDcEvent = dcEventService.insertDcEventWarning(dcEvent); int insertDcEvent = dcEventService.insertDcEventWarning(dcEvent);
if (insertDcEvent==0){ if (insertDcEvent==0){
return AjaxResult.error("操作失败"); return AjaxResult.error("操作失败");

12
zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java

@ -232,8 +232,8 @@ public class MsmServiceImpl implements IMsmService {
ArrayList<String> array = (ArrayList<String>) map.get("type"); ArrayList<String> array = (ArrayList<String>) map.get("type");
Boolean send = null; Boolean send = null;
Integer data = null; Integer data = null;
String weiXin = "微信推送失败"; // 初始化为成功状态 String weiXin = ""; // 初始化为成功状态
String message = "短信推送失败"; // 初始化为失败状态 String message = ""; // 初始化为失败状态
for (String type : array) { for (String type : array) {
if ("1".equals(type)) { //短信 if ("1".equals(type)) { //短信
if (map == null || StringUtils.isBlank(map.get("phone").toString())) { if (map == null || StringUtils.isBlank(map.get("phone").toString())) {
@ -246,6 +246,7 @@ public class MsmServiceImpl implements IMsmService {
dcPublishManage.setPublishStatus(1);//发布成功 dcPublishManage.setPublishStatus(1);//发布成功
}else { }else {
dcPublishManage.setPublishStatus(2);//发布失败 dcPublishManage.setPublishStatus(2);//发布失败
message = "短信推送失败";
} }
dcPublishManage.setPublishChannels(1);//发布渠道类型:短信 dcPublishManage.setPublishChannels(1);//发布渠道类型:短信
dcPublishManageMapper.insertDcPublishManage(dcPublishManage);//加入推送记录 dcPublishManageMapper.insertDcPublishManage(dcPublishManage);//加入推送记录
@ -259,6 +260,7 @@ public class MsmServiceImpl implements IMsmService {
dcPublishManage.setPublishStatus(1);//发布成功 dcPublishManage.setPublishStatus(1);//发布成功
}else { }else {
dcPublishManage.setPublishStatus(2);//发布失败 dcPublishManage.setPublishStatus(2);//发布失败
weiXin = "微信推送失败";
} }
dcPublishManage.setPublishChannels(2);//发布渠道类型:微信公众号 dcPublishManage.setPublishChannels(2);//发布渠道类型:微信公众号
dcPublishManageMapper.insertDcPublishManage(dcPublishManage);//加入推送记录 dcPublishManageMapper.insertDcPublishManage(dcPublishManage);//加入推送记录
@ -272,10 +274,6 @@ public class MsmServiceImpl implements IMsmService {
String context = "出行信息发布:" + content; String context = "出行信息发布:" + content;
dcEventProcess.setContext(context); dcEventProcess.setContext(context);
dcEventProcessService.insertDcEventProcess(dcEventProcess); dcEventProcessService.insertDcEventProcess(dcEventProcess);
if ("短信推送成功".equals(message) && "微信推送成功".equals(weiXin)) { return AjaxResult.success(message + weiXin);
return AjaxResult.success(message + "," + weiXin);
} else {
return AjaxResult.error(message + "," + weiXin);
}
} }
} }

23
zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml

@ -35,19 +35,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDcPublishManageVo"> <sql id="selectDcPublishManageVo">
select facility.facility_name, select
manage.id, manage.event_id, manage.publish_channels_id,
manage.title , manage.create_time,
manage.publish_status,event.create_time eventTime,event.direction,event.stake_mark,
event.event_type,event.event_subclass,event.event_state
from dc_publish_manage as manage
LEFT JOIN dc_event as event on event.id=manage.event_id
LEFT JOIN dc_event_traffic_control as traffic on event.id=traffic.id
LEFT JOIN dc_facility as facility ON traffic.facility_id=facility.id
</sql>
<select id="selectEventDcPublishManageList" resultType="com.zc.business.domain.DcPublishManage">
select facility.facility_name,event.event_state,manage.publish_time, manage.create_time,
manage.id, manage.event_id, manage.publish_channels_id, manage.id, manage.event_id, manage.publish_channels_id,
manage.title, manage.publish_channels , manage.publisher, manage.title, manage.publish_channels , manage.publisher,
manage.publish_time, manage.create_time,
manage.publish_status, manage.content_details, manage.remark, manage.publish_status, manage.content_details, manage.remark,
event.create_time eventTime,event.direction,event.stake_mark, event.create_time eventTime
event.event_type,event.event_subclass,event.event_state
from dc_publish_manage as manage from dc_publish_manage as manage
LEFT JOIN dc_event as event on event.id=manage.event_id LEFT JOIN dc_event as event on event.id=manage.event_id
LEFT JOIN dc_event_traffic_control as traffic on event.id=traffic.id LEFT JOIN dc_event_traffic_control as traffic on event.id=traffic.id
LEFT JOIN dc_facility as facility ON traffic.facility_id=facility.id LEFT JOIN dc_facility as facility ON traffic.facility_id=facility.id
</sql> where manage.event_id=#{eventId}
</select>
<select id="selectDcPublishManageList" parameterType="DcPublishManage" resultMap="DcPublishManageResult"> <select id="selectDcPublishManageList" parameterType="DcPublishManage" resultMap="DcPublishManageResult">
<include refid="selectDcPublishManageVo"/> <include refid="selectDcPublishManageVo"/>
<where> <where>
@ -66,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+CAST(SUBSTRING_INDEX(event.stake_mark, '+', -1) AS UNSIGNED)&lt;=#{endStakeMark} +CAST(SUBSTRING_INDEX(event.stake_mark, '+', -1) AS UNSIGNED)&lt;=#{endStakeMark}
</if> </if>
</where> </where>
GROUP BY manage.event_id
</select> </select>
<select id="selectDcPublishManageById" parameterType="Long" resultMap="DcPublishManageResult"> <select id="selectDcPublishManageById" parameterType="Long" resultMap="DcPublishManageResult">
@ -89,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<insert id="insertDcPublishManage" parameterType="DcPublishManage" useGeneratedKeys="true" keyProperty="id"> <insert id="insertDcPublishManage" parameterType="DcPublishManage" useGeneratedKeys="true" keyProperty="id">
insert into dc_publish_manage insert into dc_publish_manage
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save