From d0e059d50ef4addf7d557bad992eed4136abb0a4 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Fri, 26 Apr 2024 17:23:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=AF=A6=E6=83=85,=E6=95=B4=E6=94=B9=E6=84=9F=E7=9F=A5?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=BD=AC=E4=BA=A4=E9=80=9A=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E7=9A=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcPublishManageController.java | 15 +++++++++++- .../mapper/DcPublishManageMapper.java | 3 ++- .../service/IDcPublishManageService.java | 3 ++- .../impl/DcPublishManageServiceImpl.java | 5 ++++ .../service/impl/DcWarningServiceImpl.java | 10 ++++---- .../business/service/impl/MsmServiceImpl.java | 12 ++++------ .../mapper/business/DcPublishManageMapper.xml | 23 ++++++++++++++----- 7 files changed, 50 insertions(+), 21 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java b/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java index 8a3160fe..94908506 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcPublishManageController.java +++ b/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 javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -45,7 +47,18 @@ public class DcPublishManageController extends BaseController List list = dcPublishManageService.selectDcPublishManageList(dcPublishManage); 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)); + } /** * 导出信息发布管理记录列表 */ diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java index 86eca8f0..07853632 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcPublishManageMapper.java @@ -28,7 +28,8 @@ public interface DcPublishManageMapper * @return 信息发布管理记录集合 */ List selectDcPublishManageList(DcPublishManage dcPublishManage); - + //查询某个事件的全部发布记录 + List selectEventDcPublishManageList(DcPublishManage dcPublishManage); /** * 新增信息发布管理记录 * diff --git a/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java b/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java index c7567d45..e2d48f76 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcPublishManageService.java @@ -26,7 +26,8 @@ public interface IDcPublishManageService * @return 信息发布管理记录集合 */ List selectDcPublishManageList(DcPublishManage dcPublishManage); - + //查询某个事件的全部发布记录 + List selectEventDcPublishManageList(DcPublishManage dcPublishManage); /** * 新增信息发布管理记录 * diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java index e562dee8..9541ae3e 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcPublishManageServiceImpl.java +++ b/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); } + @Override + public List selectEventDcPublishManageList(DcPublishManage dcPublishManage) { + return dcPublishManageMapper.selectEventDcPublishManageList(dcPublishManage); + } + /** * 新增信息发布管理记录 * diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java index 960a56c1..f547da0e 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java +++ b/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.setDeptId(dcWarning.getDeptId());//部门 dcEvent.setOccurrenceTime(dcWarning.getWarningTime());//预警时间 + Integer warningType = dcWarning.getWarningType();//事件主类 if (dcWarning.getWarningLevel()!=null) { dcEvent.setEventLevel(dcWarning.getWarningLevel().longValue());//事件等级 } if (dcWarning.getWarningSource()!=null) { dcEvent.setEventSource((long) ValueConverter.convertValueSource(dcWarning.getWarningSource()));//事件来源 } - if (dcWarning.getWarningType()!=null) { + if (warningType!=null) { dcEvent.setEventType((long) ValueConverter.convertValueHost(dcWarning.getWarningType()));//事件主类 } - if (dcWarning.getWarningSubclass()!=null&&StringUtils.isBlank(dcWarning.getWarningSubclass())&&dcWarning.getWarningType()!=7&& - dcWarning.getWarningType()!=10) { + if (dcWarning.getWarningSubclass()!=null&&warningType!=7&& warningType!=10) { dcEvent.setEventSubclass(ValueConverter.convertValueSon(dcWarning.getWarningSubclass()));//事件子类(7与10不转) } - if (dcWarning.getWarningSubclass()!=null&&StringUtils.isBlank(dcWarning.getWarningSubclass())&&(dcWarning.getWarningType()==7|| - dcWarning.getWarningType()==10)){ + if (dcWarning.getWarningSubclass()!=null&&(warningType==7|| warningType==10)){ dcEvent.setEventSubclass(dcWarning.getWarningSubclass());//事件子类(7与10主类对应的子类直接set) } dcEvent.setOccurrenceTime(dcWarning.getWarningTime());//发生时间 @@ -495,6 +494,7 @@ public class DcWarningServiceImpl implements IDcWarningService dcEvent.setEventState(Long.valueOf(1));//状态为处理中 dcEvent.setCreateTime(DateUtils.getNowDate());//创建时间 dcEvent.setUserId(SecurityUtils.getUserId());//处置人员 + dcEvent.setRoadId(1L);//高速公路(济菏高速) int insertDcEvent = dcEventService.insertDcEventWarning(dcEvent); if (insertDcEvent==0){ return AjaxResult.error("操作失败"); diff --git a/zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java index 825e6c9b..6cda816c 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/MsmServiceImpl.java @@ -232,8 +232,8 @@ public class MsmServiceImpl implements IMsmService { ArrayList array = (ArrayList) map.get("type"); Boolean send = null; Integer data = null; - String weiXin = "微信推送失败"; // 初始化为成功状态 - String message = "短信推送失败"; // 初始化为失败状态 + String weiXin = ""; // 初始化为成功状态 + String message = ""; // 初始化为失败状态 for (String type : array) { if ("1".equals(type)) { //短信 if (map == null || StringUtils.isBlank(map.get("phone").toString())) { @@ -246,6 +246,7 @@ public class MsmServiceImpl implements IMsmService { dcPublishManage.setPublishStatus(1);//发布成功 }else { dcPublishManage.setPublishStatus(2);//发布失败 + message = "短信推送失败"; } dcPublishManage.setPublishChannels(1);//发布渠道类型:短信 dcPublishManageMapper.insertDcPublishManage(dcPublishManage);//加入推送记录 @@ -259,6 +260,7 @@ public class MsmServiceImpl implements IMsmService { dcPublishManage.setPublishStatus(1);//发布成功 }else { dcPublishManage.setPublishStatus(2);//发布失败 + weiXin = "微信推送失败"; } dcPublishManage.setPublishChannels(2);//发布渠道类型:微信公众号 dcPublishManageMapper.insertDcPublishManage(dcPublishManage);//加入推送记录 @@ -272,10 +274,6 @@ public class MsmServiceImpl implements IMsmService { String context = "出行信息发布:" + content; dcEventProcess.setContext(context); dcEventProcessService.insertDcEventProcess(dcEventProcess); - if ("短信推送成功".equals(message) && "微信推送成功".equals(weiXin)) { - return AjaxResult.success(message + "," + weiXin); - } else { - return AjaxResult.error(message + "," + weiXin); - } + return AjaxResult.success(message + weiXin); } } \ No newline at end of file diff --git a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml index d7559a6d..37833f47 100644 --- a/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPublishManageMapper.xml @@ -35,19 +35,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 + + + insert into dc_publish_manage From 34d2384b1a775f4cfe8075d40ac06b52c0283f4c Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Fri, 26 Apr 2024 18:13:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=A9=E6=B0=94?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E8=BF=94=E5=9B=9E=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/controller/WeatherForecastController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java index fc8ffaae..8f167ab7 100644 --- a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java +++ b/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()); 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")); } else { @@ -179,6 +179,7 @@ public class WeatherForecastController extends BaseController { if (jsonResult.getInteger("code") == 200) { jsonObject.put("name",dcRegion.getRegionName()); + jsonResult.put("name",dcRegion.getRegionName()); if (Objects.equals(redisKey, weather.getString("WEATHERFACTS"))) { jsonObject.put(redisKey + dcRegion.getId(), extracted(jsonResult, "now"));