From 33e8a31f8dca65e83f2a23cb2447b5c715843da4 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Tue, 14 May 2024 11:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E4=BF=AE=E6=94=B9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=AF=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/enums/ValueConverter.java | 5 +- .../service/impl/DcEventServiceImpl.java | 128 ++++++++++++++++-- 2 files changed, 117 insertions(+), 16 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/enums/ValueConverter.java b/zc-business/src/main/java/com/zc/business/enums/ValueConverter.java index 5af2c2d5..8778d92e 100644 --- a/zc-business/src/main/java/com/zc/business/enums/ValueConverter.java +++ b/zc-business/src/main/java/com/zc/business/enums/ValueConverter.java @@ -125,6 +125,7 @@ public class ValueConverter { eventLabel.put("estimatedEndTime","预计解除时间"); eventLabel.put("eventLevel","事件等级"); // eventLabel.put("eventType","事件类型"); + eventLabel.put("eventSubclass","事件子类"); eventLabel.put("eventCause","事件原因"); eventLabel.put("description","描述"); eventLabel.put("eventState","状态"); @@ -210,7 +211,7 @@ public class ValueConverter { eventLabel.put("dcEventVehicleAccident.seriousInjuries","重伤(人)"); eventLabel.put("dcEventVehicleAccident.fatalities","死亡(人)"); eventLabel.put("dcEventVehicleAccident.isPrivate","私密事件"); - eventLabel.put("dcEventVehicleAccident.facilityId","设施id"); + eventLabel.put("dcEventVehicleAccident.facilityId","地点"); eventLabel.put("dcEventVehicleAccident.rampId","匝道"); eventLabel.put("dcEventVehicleAccident.location","地点"); eventLabel.put("dcEventTrafficControl.controlType","管制分类"); @@ -279,7 +280,7 @@ public class ValueConverter { } public static String eventLabel(String inputValue) { Map mapping = getEventLabel(); - return mapping.getOrDefault(inputValue, inputValue); + return mapping.getOrDefault(inputValue, ""); } //测试 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 485979da..1dc0d0cf 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 @@ -1067,6 +1067,112 @@ public class DcEventServiceImpl extends ServiceImpl impl } else if ("3".equals(result.getRight())) { result.setRight("下行"); } + } else if ("eventSubclass".equals(result.getRightPath())) { + if ("1-1".equals(result.getRight())) { + result.setRight("追尾"); + } else if ("1-2".equals(result.getRight())) { + result.setRight("侧翻"); + } else if ("1-3".equals(result.getRight())) { + result.setRight("撞护栏"); + } else if ("1-4".equals(result.getRight())) { + result.setRight("自燃"); + } else if ("1-5".equals(result.getRight())) { + result.setRight("其他事故"); + } else if ("2-1".equals(result.getRight())) { + result.setRight("车辆故障"); + } else if ("3-1".equals(result.getRight())) { + result.setRight("主线封闭和限行"); + } else if ("3-2".equals(result.getRight())) { + result.setRight("收费站封闭和限行"); + } else if ("3-3".equals(result.getRight())) { + result.setRight("立交封闭和限行"); + } else if ("3-4".equals(result.getRight())) { + result.setRight("服务区封闭和限行"); + } else if ("4-1".equals(result.getRight())) { + result.setRight("道路拥堵"); + } else if ("4-2".equals(result.getRight())) { + result.setRight("立交拥堵"); + } else if ("4-3".equals(result.getRight())) { + result.setRight("收费站拥堵"); + } else if ("4-4".equals(result.getRight())) { + result.setRight("服务区拥堵"); + } else if ("5-1".equals(result.getRight())) { + result.setRight("行人"); + } else if ("5-2".equals(result.getRight())) { + result.setRight("非机动车"); + } else if ("5-3".equals(result.getRight())) { + result.setRight("摩托车"); + } else if ("5-4".equals(result.getRight())) { + result.setRight("其他"); + } else if ("6-1".equals(result.getRight())) { + result.setRight("烟雾"); + } else if ("6-2".equals(result.getRight())) { + result.setRight("倒伏树木"); + } else if ("6-3".equals(result.getRight())) { + result.setRight("撒落物"); + } else if ("6-4".equals(result.getRight())) { + result.setRight("动物"); + } else if ("6-5".equals(result.getRight())) { + result.setRight("其他"); + } else if ("7-1".equals(result.getRight())) { + result.setRight("道路养护施工"); + } else if ("7-2".equals(result.getRight())) { + result.setRight("收费站养护施工"); + } else if ("7-3".equals(result.getRight())) { + result.setRight("服务区养护施工"); + } else if ("7-4".equals(result.getRight())) { + result.setRight("枢纽立交匝道养护施工"); + } else if ("7-5".equals(result.getRight())) { + result.setRight("地方道路养护施工"); + } else if ("7-6".equals(result.getRight())) { + result.setRight("道路工程建设施工"); + } else if ("7-7".equals(result.getRight())) { + result.setRight("收费站工程建设施工"); + } else if ("7-8".equals(result.getRight())) { + result.setRight("服务区工程建设施工"); + } else if ("7-9".equals(result.getRight())) { + result.setRight("枢纽立交匝道工程建设施工"); + } else if ("7-10".equals(result.getRight())) { + result.setRight("地方道路工程建设施工"); + } else if ("8-1".equals(result.getRight())) { + result.setRight("封闭、暂停营业"); + } else if ("8-2".equals(result.getRight())) { + result.setRight("重要设施停用"); + } else if ("8-3".equals(result.getRight())) { + result.setRight("服务区其他异常"); + } else if ("9-1".equals(result.getRight())) { + result.setRight("摄像机"); + } else if ("9-2".equals(result.getRight())) { + result.setRight("护栏"); + } else if ("9-3".equals(result.getRight())) { + result.setRight("隔离栅"); + } else if ("9-4".equals(result.getRight())) { + result.setRight("情报板"); + } else if ("9-5".equals(result.getRight())) { + result.setRight("防炫板"); + } else if ("9-6".equals(result.getRight())) { + result.setRight("其他"); + } else if ("10-1".equals(result.getRight())) { + result.setRight("雨"); + } else if ("10-2".equals(result.getRight())) { + result.setRight("雪"); + } else if ("10-3".equals(result.getRight())) { + result.setRight("雾"); + } else if ("10-4".equals(result.getRight())) { + result.setRight("大风"); + } else if ("10-5".equals(result.getRight())) { + result.setRight("低温寒潮"); + } else if ("10-6".equals(result.getRight())) { + result.setRight("路面积雪"); + } else if ("10-7".equals(result.getRight())) { + result.setRight("路面结冰"); + } else if ("10-8".equals(result.getRight())) { + result.setRight("路面积水"); + } else if ("10-9".equals(result.getRight())) { + result.setRight("其他"); + } else if ("11-1".equals(result.getRight())) { + result.setRight("其他事件"); + } } else if ("eventState".equals(result.getRightPath())) { if ("0".equals(result.getRight())) { result.setRight("待确认"); @@ -1139,7 +1245,9 @@ public class DcEventServiceImpl extends ServiceImpl impl } else if ("2".equals(result.getRight())) { result.setRight("紧急"); } - } else if ("dcEventAccident.locationType".equals(result.getRightPath())) { + } else if ("dcEventAccident.locationType".equals(result.getRightPath()) + || "dcEventTrafficCongestion.locationType".equals(result.getRightPath()) + || "dcEventVehicleAccident.locationType".equals(result.getRightPath())) { if ("1".equals(result.getRight())) { result.setRight("高速主线"); } else if ("2".equals(result.getRight())) { @@ -1149,7 +1257,8 @@ public class DcEventServiceImpl extends ServiceImpl impl } else if ("4".equals(result.getRight())) { result.setRight("收费站"); } - } else if ("dcEventAccident.weatherCondition".equals(result.getRightPath())) { + } else if ("dcEventAccident.weatherCondition".equals(result.getRightPath()) + || "dcEventVehicleAccident.weatherCondition".equals(result.getRightPath())) { if ("1".equals(result.getRight())) { result.setRight("晴"); } else if ("2".equals(result.getRight())) { @@ -1278,17 +1387,6 @@ public class DcEventServiceImpl extends ServiceImpl impl } else if ("9".equals(result.getRight())) { result.setRight("出口匝道"); } - } else if ("dcEventTrafficCongestion.locationType".equals(result.getRightPath()) - || "dcEventVehicleAccident.locationType".equals(result.getRightPath())) { - if ("1".equals(result.getRight())) { - result.setRight("高速主线"); - } else if ("2".equals(result.getRight())) { - result.setRight("服务区"); - } else if ("3".equals(result.getRight())) { - result.setRight("立交桥"); - } else if ("4".equals(result.getRight())) { - result.setRight("收费站"); - } } else if ("dcEventTrafficCongestion.weatherCondition".equals(result.getRightPath())) { if ("1".equals(result.getRight())) { result.setRight("晴"); @@ -1379,7 +1477,9 @@ public class DcEventServiceImpl extends ServiceImpl impl } } String label = ValueConverter.eventLabel(result.getRightPath()); - context = context + label + "修改为:" + result.getRight() + ","; + if (StringUtils.isNotEmpty(label)){ + context = context + label + "修改为:" + result.getRight() + ","; + } } }