From cfedf1514719fb58952bc28122e0256a97750eb8 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Wed, 21 Aug 2024 15:12:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/service/impl/DcSdhsEventServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java index 2600d740..454a47cd 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java @@ -484,21 +484,28 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService { List> list = new ArrayList<>(); for (String stationName : stationSet) { Map map = new HashMap<>(); + Long allNum = 0L; map.put("stationName",stationName); if (closeStation.containsKey(stationName)){ map.put("close",closeStation.get(stationName)); + allNum += closeStation.get(stationName); } else { map.put("close",0); } if (restrictionStation.containsKey(stationName)){ map.put("restriction",restrictionStation.get(stationName)); + allNum += restrictionStation.get(stationName); } else { map.put("restriction",0); } + + map.put("allNum",allNum); list.add(map); } + //根据总数排序 + list = list.stream().sorted(Comparator.comparing(item -> Long.parseLong(((Map) item).get("allNum").toString())).reversed()).collect(Collectors.toList()); return AjaxResult.success(list); } From 6625d4b4b47e07cd56da114f09143df6cb79b96b Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Wed, 21 Aug 2024 15:24:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/controller/DcSdhsEventController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcSdhsEventController.java b/zc-business/src/main/java/com/zc/business/controller/DcSdhsEventController.java index 0ed2dc8f..c1b25ae2 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcSdhsEventController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcSdhsEventController.java @@ -92,12 +92,16 @@ public class DcSdhsEventController { PoiUtil.createHeading1(newDoc,"交通事件"); for (String trafficIncidentType : exportKey) { if ("1".equals(trafficIncidentType)){ + //事故多发路段 } else if ("2".equals(trafficIncidentType)){ + //事件类型分析 } else if ("3".equals(trafficIncidentType)){ + //事故车型分析 } else if ("4".equals(trafficIncidentType)){ + //事故时间分析 } else if ("5".equals(trafficIncidentType)){ //事故地市分布 @@ -133,13 +137,13 @@ public class DcSdhsEventController { } if (exportKey.contains("11") || exportKey.contains("12")){ - PoiUtil.createHeading1(newDoc,"交通量统计"); + PoiUtil.createHeading1(newDoc,"拥堵情况"); for (String trafficIncidentType : exportKey) { if ("11".equals(trafficIncidentType)){ //拥堵地点统计 } else if ("12".equals(trafficIncidentType)){ - //路段拥堵时长 + //路段平均拥堵时长 }