From 66e1705ee76b2c72ed09fdf747e5d5253b8155bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Wed, 17 Jul 2024 14:44:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=A9=E6=B0=94?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/handler/DeviceMessageHandler.java | 15 +++------------ .../service/impl/DcWarningServiceImpl.java | 12 ++++++++++-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java index 1af9467f..dfc2fef7 100644 --- a/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java +++ b/zc-business/src/main/java/com/zc/business/message/device/handler/DeviceMessageHandler.java @@ -616,7 +616,6 @@ public class DeviceMessageHandler { } String content = direction + stakeMark + precipitationType; - Map contentMap = new HashMap<>(); JSONObject object = new JSONObject(); object.put("meteorologicalDetectorData", meteorologicalDetectorData); @@ -641,13 +640,10 @@ public class DeviceMessageHandler { if (direction.equals(UniversalEnum.DIRECTION_OF_JINAN.getValue())) { dcWarning.setDirection(UniversalEnum.THREE.getValue()); } - contentMap.put("content", content); - contentMap.put("event", dcWarning); - - WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap); dcWarningService.insertDcWarning(dcWarning); + //待确认数量 dcEventService.getCountNum(); } @@ -664,10 +660,7 @@ public class DeviceMessageHandler { } String content = direction + stakeMark + precipitationType; - Map contentMap = new HashMap<>(); - contentMap.put("content", content); - contentMap.put("event", meteorologicalDetectorData); - WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap); + JSONObject object = new JSONObject(); object.put("meteorologicalDetectorData", meteorologicalDetectorData); String string = object.toString(); @@ -691,9 +684,7 @@ public class DeviceMessageHandler { } dcWarningService.insertDcWarning(dcWarning); - contentMap.put("content", content); - contentMap.put("event", dcWarning); - WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap); + //待确认数量 dcEventService.getCountNum(); 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 1a8c08b9..4433214c 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 @@ -242,9 +242,17 @@ public class DcWarningServiceImpl implements IDcWarningService break; } } - String content= direction+UniversalEnum.BLANK_SPACE.getValue() + dcWarning.getStakeMark()+UniversalEnum.BLANK_SPACE.getValue()+HAPPEN+EventSubclass+EVENT ; Map contentMap = new HashMap<>(); - contentMap.put("content",content); + + if (dcWarning.getWarningSource() == 7) { + String remark = dcWarning.getRemark(); + String[] split = remark.split(" "); + String s = split[split.length - 1]; + contentMap.put("content",s); + }else { + String content= direction+UniversalEnum.BLANK_SPACE.getValue() + dcWarning.getStakeMark()+UniversalEnum.BLANK_SPACE.getValue()+HAPPEN+EventSubclass+EVENT ; + contentMap.put("content",content); + } contentMap.put("event",dcWarning); WebSocketService.broadcast(WebSocketEvent.WARNING, contentMap); //推送事件消息 0不是感知事件 dcEventService.getCountNum(); From 79f6ccf97ea9fce486f0844e91b410f1ef0a86f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Wed, 17 Jul 2024 15:43:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BA=A4=E9=80=9A=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/domain/ComprehensiveIndexQuery.java | 2 ++ .../DcGantryMetricsStatisticsDataMapper.xml | 16 ++++++++++------ .../business/DcGantryStatisticsDataMapper.xml | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java b/zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java index 7e7620a2..c0ef7b69 100644 --- a/zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java +++ b/zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java @@ -34,4 +34,6 @@ public class ComprehensiveIndexQuery { private Integer crowdingRate; private Integer periodType; private String startDate; + private String endDate; + } diff --git a/zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml b/zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml index 985a7ce4..1cc1f5ea 100644 --- a/zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml @@ -199,18 +199,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ON ps.facility_code = dgsd.gantry_code AND - YEAR(dgsd.statistical_date) = #{startDate} + YEAR(dgsd.statistical_date) = #{startDate} AND - DATE_FORMAT(dgsd.statistical_date, '%Y-%m') = #{startDate} + DATE_FORMAT(dgsd.statistical_date, '%Y-%m') = #{startDate} AND - - DATE(dgsd.statistical_date) = DATE(#{startDate}) + + dgsd.statistical_date BETWEEN DATE(#{startDate}) and DATE(#{endDate}) AND + + + DATE(dgsd.statistical_date) = DATE(#{startDate}) AND - DATE(dgsd.statistical_date) = DATE(#{startDate}) + DATE(dgsd.statistical_date) = DATE(#{startDate}) AND - AND dgsd.period_type = #{periodType} + + dgsd.period_type = #{periodType} ORDER BY dgsd.statistical_date DESC diff --git a/zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml b/zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml index b4c8a6e1..03a98a3a 100644 --- a/zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml @@ -328,7 +328,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" JOIN dc_gantry_statistics_data AS dgsd ON ps.facility_code = dgsd.gantry_code - AND DATE(dgsd.statistical_date) BETWEEN #{startDate} AND #{endDate} + + AND DATE(dgsd.statistical_date) BETWEEN #{startDate} AND #{endDate} + AND dgsd.period_type = #{periodType}