Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
王兴琳 7 months ago
parent
commit
1f2d66dbb3
  1. 5
      zc-business/src/main/java/com/zc/business/enums/ValueConverter.java
  2. 128
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  3. 14
      zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

5
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<String, String> mapping = getEventLabel();
return mapping.getOrDefault(inputValue, inputValue);
return mapping.getOrDefault(inputValue, "");
}
//测试

128
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -1079,6 +1079,112 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> 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("待确认");
@ -1151,7 +1257,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> 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())) {
@ -1161,7 +1269,8 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> 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())) {
@ -1290,17 +1399,6 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> 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("晴");
@ -1391,7 +1489,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
}
}
String label = ValueConverter.eventLabel(result.getRightPath());
context = context + label + "修改为:" + result.getRight() + ",";
if (StringUtils.isNotEmpty(label)){
context = context + label + "修改为:" + result.getRight() + ",";
}
}
}

14
zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

@ -186,7 +186,7 @@
ifNull(t2.buses,0) buses,
ifNull(t2.tankers,0) tankers
from dc_event t1
left join dc_event_vehicle_accident t2 on t1.id = t2.id
left join dc_event_accident t2 on t1.id = t2.id
where t1.event_type = '1' and t1.direction = #{direction}
<if test="type != null and type == '1'.toString">
and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(#{startTime},'%Y%m%d')
@ -326,13 +326,13 @@
where
t1.event_type = '1' and t1.direction = #{direction}
<if test="type != null and type == '1'.toString">
and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 DAY),'%Y%m%d')
and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 YEAR),'%Y%m%d')
</if>
<if test="type != null and type == '2'.toString">
and DATE_FORMAT(t1.start_time,'%Y%m') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 MONTH),'%Y%m')
and DATE_FORMAT(t1.start_time,'%Y%m') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 YEAR),'%Y%m')
</if>
<if test="type != null and type == '3'.toString">
and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 QUARTER)) and QUARTER(t1.start_time) = QUARTER(DATE_SUB(#{startTime},INTERVAL 1 QUARTER))
and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR)) and QUARTER(t1.start_time) = QUARTER(#{startTime})
</if>
<if test="type != null and type == '4'.toString">
and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR))
@ -384,13 +384,13 @@
from dc_event
where event_type = '1' and direction = #{direction}
<if test="type != null and type == '1'.toString">
and DATE_FORMAT(start_time,'%Y%m%d') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 DAY),'%Y%m%d')
and DATE_FORMAT(start_time,'%Y%m%d') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 YEAR),'%Y%m%d')
</if>
<if test="type != null and type == '2'.toString">
and DATE_FORMAT(start_time,'%Y%m') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 MONTH),'%Y%m')
and DATE_FORMAT(start_time,'%Y%m') = DATE_FORMAT(DATE_SUB(#{startTime},INTERVAL 1 YEAR),'%Y%m')
</if>
<if test="type != null and type == '3'.toString">
and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 QUARTER)) and QUARTER(start_time) = QUARTER(DATE_SUB(#{startTime},INTERVAL 1 QUARTER))
and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR)) and QUARTER(start_time) = QUARTER(#{startTime})
</if>
<if test="type != null and type == '4'.toString">
and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR))

Loading…
Cancel
Save