From cb009050ce19125eff5047a4fa2688f112ca2b3d Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Thu, 6 Jun 2024 17:39:35 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=9B=91=E6=8E=A7=E6=8C=87=E6=A0=87=E5=89=8D?= =?UTF-8?q?=E5=A4=A9=E6=98=A8=E5=A4=A9=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zc/business/controller/DcMetricsController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcMetricsController.java b/zc-business/src/main/java/com/zc/business/controller/DcMetricsController.java index 9185c987..bbc75610 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcMetricsController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcMetricsController.java @@ -148,7 +148,7 @@ public class DcMetricsController { // 如果昨天或前天的数据为空,则返回错误信息 if (yesterdayData == null || beforeYesterdayData == null) { - return AjaxResult.error("暂无数据"); + return AjaxResult.success(null); } // 将数据放入列表并返回 From eb052468b5635d638fd15af4409f537a2e93047c Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Thu, 6 Jun 2024 18:16:34 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=A2=84=E6=A1=88=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E3=80=81=E4=BA=8B=E4=BB=B6=E5=AD=90=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/business/DcEmergencyPlansMapper.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zc-business/src/main/resources/mapper/business/DcEmergencyPlansMapper.xml b/zc-business/src/main/resources/mapper/business/DcEmergencyPlansMapper.xml index bb15469d..d18eb453 100644 --- a/zc-business/src/main/resources/mapper/business/DcEmergencyPlansMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEmergencyPlansMapper.xml @@ -116,6 +116,9 @@ and plan_name like concat('%', #{planName}, '%') and event_type = #{eventType} + + and trigger_mechanism =#{triggerMechanism} + order by t1.id desc From ec775d9da18696a79a16c3b9aa5ac1aa69ad3478 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 6 Jun 2024 18:42:49 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=80=9A=E8=A1=8C=E5=BF=AB=E6=8A=A5?= =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=8F=A3=E8=BD=A6=E6=B5=81=E9=87=8F=20?= =?UTF-8?q?=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/controller/WordController.java | 69 ++++++++++++++++--- 1 file changed, 60 insertions(+), 9 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/WordController.java b/zc-business/src/main/java/com/zc/business/controller/WordController.java index 76929ef0..5a24c460 100644 --- a/zc-business/src/main/java/com/zc/business/controller/WordController.java +++ b/zc-business/src/main/java/com/zc/business/controller/WordController.java @@ -2,8 +2,11 @@ package com.zc.business.controller; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.core.domain.AjaxResult; +import com.zc.business.domain.DcTollStationStatisticsData; import com.zc.business.domain.DcTrafficSectionData; +import com.zc.business.enums.TrafficDataPeriodTypeEnum; import com.zc.business.mapper.DcTrafficIncidentsMapper; +import com.zc.business.service.IDcTollStationStatisticsDataService; import com.zc.business.utils.PoiUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -45,6 +48,9 @@ public class WordController { @Autowired private DcTrafficIncidentsMapper dcTrafficIncidentsMapper; + @Autowired + private IDcTollStationStatisticsDataService dcTollStationStatisticsDataService; + @PostMapping("/trafficSituationReport") @ApiOperation("导出通行情况快报") @@ -506,15 +512,60 @@ public class WordController { List> trafficFlowList = new ArrayList<>(); - Map trafficFlow = new HashMap<>(); - trafficFlow.put("label","入口"); - trafficFlow.put("num","0"); - trafficFlowList.add(trafficFlow); - - trafficFlow = new HashMap<>(); - trafficFlow.put("label","出口"); - trafficFlow.put("num","0"); - trafficFlowList.add(trafficFlow); + + DcTollStationStatisticsData dcTollStationStatisticsData = new DcTollStationStatisticsData(); + dcTollStationStatisticsData.setPeriodType(TrafficDataPeriodTypeEnum.DAY); + + Calendar startCalendar = Calendar.getInstance(); + startCalendar.set(Calendar.HOUR_OF_DAY, 0); + startCalendar.set(Calendar.MINUTE, 0); + startCalendar.set(Calendar.SECOND, 0); + startCalendar.set(Calendar.MILLISECOND, 0); + Date startTime = startCalendar.getTime(); + dcTollStationStatisticsData.setStartTime(startTime); + + Calendar endCalendar = Calendar.getInstance(); + endCalendar.set(Calendar.HOUR_OF_DAY, 23); + endCalendar.set(Calendar.MINUTE, 59); + endCalendar.set(Calendar.SECOND, 59); + endCalendar.set(Calendar.MILLISECOND, 999); + Date emdTime = endCalendar.getTime(); + dcTollStationStatisticsData.setEndTime(emdTime); + + List statisticsDataList = dcTollStationStatisticsDataService.tollStationData(dcTollStationStatisticsData); + if (statisticsDataList != null && statisticsDataList.size() > 0){ + + Integer entrance = 0; //入口 + Integer export = 0; //出口 + for (DcTollStationStatisticsData tollStationStatisticsData : statisticsDataList) { + if (tollStationStatisticsData.getAccessType() == 1){ + entrance = entrance + tollStationStatisticsData.getTrafficVolume(); + } else if (tollStationStatisticsData.getAccessType() == 2){ + export = export + tollStationStatisticsData.getTrafficVolume(); + } + } + + Map trafficFlow = new HashMap<>(); + trafficFlow.put("label", "入口"); + trafficFlow.put("num", entrance); + trafficFlowList.add(trafficFlow); + + trafficFlow = new HashMap<>(); + trafficFlow.put("label", "出口"); + trafficFlow.put("num", export); + trafficFlowList.add(trafficFlow); + + } else { + Map trafficFlow = new HashMap<>(); + trafficFlow.put("label", "入口"); + trafficFlow.put("num", "0"); + trafficFlowList.add(trafficFlow); + + trafficFlow = new HashMap<>(); + trafficFlow.put("label", "出口"); + trafficFlow.put("num", "0"); + trafficFlowList.add(trafficFlow); + } if (trafficFlowList != null && trafficFlowList.size() > 0) { From 8321d64987d51ebe4400c474103c507b4beaa6f5 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 6 Jun 2024 18:59:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEventController.java | 14 +++++++++ .../com/zc/business/mapper/DcEventMapper.java | 2 ++ .../zc/business/mapper/DcWarningMapper.java | 2 ++ .../zc/business/service/IDcEventService.java | 10 +++++++ .../service/impl/DcEventServiceImpl.java | 29 +++++++++++++++++++ .../mapper/business/DcEventMapper.xml | 3 ++ .../mapper/business/DcWarningMapper.xml | 3 ++ 7 files changed, 63 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java index 3b6d1218..14b32b58 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java @@ -227,4 +227,18 @@ public class DcEventController extends BaseController public AjaxResult getLinkEvent(@ApiParam(name = "eventId", value = "事件id", required = true) @PathVariable("eventId") String eventId){ return dcEventService.getLinkEvent(eventId); } + + /** + * @Description 获取事件数量 + * + * @author liuwenge + * @date 2024/6/6 18:45 + * @param type + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @ApiOperation("获取事件数量") + @GetMapping( "/getCountNum/{type}") + public AjaxResult getCountNum(@ApiParam(name = "type", value = "类型 1:告警 2:待确认 3:处置中", required = true) @PathVariable("type") String type){ + return dcEventService.getCountNum(type); + } } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java index 63ed43a8..324da21a 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java @@ -121,6 +121,8 @@ public interface DcEventMapper extends BaseMapper int selectClearInfo(String eventId); List dispatchRecordEventList(DcEvent dcEvent); + + Long selectEventNumByStatus(@Param("status") String status); } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java index fa39632b..ac585d4e 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java @@ -150,4 +150,6 @@ public interface DcWarningMapper public String organizationName(Long id); //事件id查询调度记录id public HashMap selectDispatchId(@Param("eventId")String eventId); + + Long selectWarningNum(); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcEventService.java b/zc-business/src/main/java/com/zc/business/service/IDcEventService.java index 8d5d5933..6e2943eb 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcEventService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcEventService.java @@ -139,4 +139,14 @@ public interface IDcEventService AjaxResult getLinkEvent(String eventId); List dispatchRecordEventList(DcEvent dcEvent); + + /** + * @Description 获取事件数量 + * + * @author liuwenge + * @date 2024/6/6 18:45 + * @param type 类型 1:告警 2:待确认 3:处置中 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + AjaxResult getCountNum(String type); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index 2dada580..b50c21a4 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -1924,4 +1924,33 @@ public class DcEventServiceImpl extends ServiceImpl impl } + /** + * @Description 获取事件数量 + * + * @author liuwenge + * @date 2024/6/6 18:45 + * @param type 类型 1:告警 2:待确认 3:处置中 + * @return com.ruoyi.common.core.domain.AjaxResult + */ + @Override + public AjaxResult getCountNum(String type){ + if (StringUtils.isEmpty(type)){ + return AjaxResult.error("类型不能为空"); + } + + Long num = 0L; + //告警 + if (type.equals("1")){ + num = dcWarningMapper.selectWarningNum(); + } else if (type.equals("2")){ + num = dcEventMapper.selectEventNumByStatus("0"); + } else if (type.equals("3")){ + num = dcEventMapper.selectEventNumByStatus("1"); + } + + return AjaxResult.success(num); + } + + + } diff --git a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml index 38faaef3..f88c5b12 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventMapper.xml @@ -850,4 +850,7 @@ + \ No newline at end of file diff --git a/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml index 4bfb8a26..7992b584 100644 --- a/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml @@ -433,5 +433,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +