Browse Source

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

develop
wangsixiang 12 months ago
parent
commit
a9c64250aa
  1. 17
      zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java
  2. 8
      zc-business/src/main/java/com/zc/business/enums/EventSource.java
  3. 75
      zc-business/src/main/java/com/zc/business/enums/EventSubclass.java
  4. 5
      zc-business/src/main/java/com/zc/business/enums/ValueConverter.java
  5. 73
      zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java
  6. 23
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java
  7. 156
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  8. 14
      zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

17
zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java

@ -517,7 +517,11 @@ public class DcDeviceController extends BaseController {
resultArray.add(result); resultArray.add(result);
AjaxResult ajaxResult = (AjaxResult) result.get("result"); AjaxResult ajaxResult = (AjaxResult) result.get("result");
if (!Objects.equals(String.valueOf(ajaxResult.get("code")), "200")) { if (!Objects.equals(String.valueOf(ajaxResult.get("code")), "200")) {
return AjaxResult.error(200,"500"); if (Objects.equals(device.getString("deviceType"), "15")) {
return AjaxResult.error(200, "500");
} else {
return AjaxResult.error();
}
} }
} }
} }
@ -529,9 +533,16 @@ public class DcDeviceController extends BaseController {
}); });
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("device", device.getString("id")); result.put("device", device.getString("id"));
result.put("functionId",functionId); result.put("functionId", functionId);
if (device.getInteger("deviceType").equals(DeviceTypeConstants.ROAD_SECTION_VOICE_BROADCASTING)) { if (device.getInteger("deviceType").equals(DeviceTypeConstants.ROAD_SECTION_VOICE_BROADCASTING)) {
result.put("result", broadcastController.nearCamListDistance(jsonObject)); JSONObject value = broadcastController.nearCamListDistance(jsonObject);
AjaxResult ajaxResult = new AjaxResult();
value.keySet().forEach(item -> {
ajaxResult.put(item, value.getString(item));
});
ajaxResult.put("code", 200);
result.put("result", ajaxResult);
} else { } else {
result.put("result", getAjaxResult(iotDeviceId, functionId, params)); result.put("result", getAjaxResult(iotDeviceId, functionId, params));
} }

8
zc-business/src/main/java/com/zc/business/enums/EventSource.java

@ -5,7 +5,13 @@ package com.zc.business.enums;
*/ */
//事件来源枚举 //事件来源枚举
public enum EventSource { public enum EventSource {
VIDEO_AI(1, "视频AI"); VIDEO(1, "96656"),
TRAFFIC_POLICE(2,"交警转接"),
ROAD_PATROL(3,"道路巡查"),
VIDEO_INSPECTION(4,"视频巡查"),
VIDEO_AI(5,"视频AI"),
ONE_CLICK_RESCUE(6,"一键救援"),
REST(7,"其他");
private final Integer code; private final Integer code;
private final String description; private final String description;

75
zc-business/src/main/java/com/zc/business/enums/EventSubclass.java

@ -0,0 +1,75 @@
package com.zc.business.enums;
/**
*
*/
public enum EventSubclass {
REAR_END ("1-1","追尾"),
TURN_ON_ONE_S_SIDE ("1-2","侧翻"),
CRASH_INTO_THE_BARRIER ("1-3","撞护栏"),
NATURE ("1-4","自燃"),
OTHER_ACCIDENTS ("1-5","其他事故"),
VEHICLE_FAULT ("2-1","车辆故障"),
THE_MAIN_LINE_IS_CLOSED_AND_RESTRICTED ("3-1","主线封闭和限行"),
TOLL_BOOTHS_ARE_CLOSED_AND_RESTRICTED ("3-2","收费站封闭和限行"),
THE_INTERCHANGE_IS_CLOSED_AND_RESTRICTED ("3-3","立交封闭和限行"),
THE_SERVICE_AREA_IS_CLOSED_AND_RESTRICTED ("3-4","服务区封闭和限行"),
ROAD_CONGESTION ("4-1","道路拥堵"),
INTERCHANGE_CONGESTION ("4-2","立交拥堵"),
TOLL_BOOTHS_ARE_CONGESTED ("4-3","收费站拥堵"),
SERVICE_AREA_CONGESTION ("4-4","服务区拥堵"),
PEDESTRIAN ("5-1","行人"),
NON_MOTOR_VEHICLE ("5-2","非机动车"),
MOTORCYCLE("5-3","摩托车"),
ELSE ("5-4","其他"),
SMOKE ("6-1","烟雾"),
FALLEN_TREE ("6-2","倒伏树木"),
OUTFALL ("6-3","撒落物"),
ZOON ("6-4","动物"),
OTHER ("6-5","其他"),
ROAD_MAINTENANCE_CONSTRUCTION ("7-1","道路养护施工"),
TOLL_STATION_MAINTENANCE_AND_CONSTRUCTION ("7-2","收费站养护施工"),
MAINTENANCE_CONSTRUCTION_OF_SERVICE_AREA ("7-3","服务区养护施工"),
MAINTENANCE_AND_CONSTRUCTION_OF_INTERCHANGE_RAMP ("7-4","枢纽立交匝道养护施工"),
LOCAL_ROAD_MAINTENANCE_CONSTRUCTION ("7-5","地方道路养护施工"),
ROAD_ENGINEERING_CONSTRUCTION ("7-6","道路工程建设施工"),
TOLL_STATION_CONSTRUCTION ("7-7","收费站工程建设施工"),
SERVICE_AREA_PROJECT_CONSTRUCTION ("7-8","服务区工程建设施工"),
JUNCTION_INTERCHANGE_RAMP_PROJECT_CONSTRUCTION ("7-9","枢纽立交匝道工程建设施工"),
LOCAL_ROAD_ENGINEERING_CONSTRUCTION ("7-10", "地方道路工程建设施工"),
SUSPEND_BUSINESS ("8-1","封闭、暂停营业"),
SHUTDOWN_OF_CRITICAL_FACILITIES ("8-2","重要设施停用"),
OTHERS_IN_THE_SERVICE_AREA_ARE_ABNORMAL ("8-3","服务区其他异常"),
CAMERA ("9-1","摄像机"),
GUARDRAIL ("9-2","护栏"),
ISOLATING_GRID ("9-3","隔离栅"),
INTEL_BOARD ("9-4","情报板"),
ANTI_GLARE_PLATE ("9-5","防炫板"),
REST1 ("9-6","其他"),
THE_RAIN ("10-1", "雨"),
SNOW ("10-2", "雪"),
THE_FOG ("10-3", "雾"),
GALE ("10-4", "大风"),
LOW_TEMPERATURE_COLD_WAVE ("10-5", "低温寒潮"),
SNOW_ON_PAVEMENT ("10-6", "路面积雪"),
ICY_ROAD ("10-7", "路面结冰"),
ROAD_WATER ("10-8", "路面积水"),
RESTS ("10-9", "其他"),
OTHER_EVENTS ("11-1", "其他事件");
private final String code;
private final String description;
EventSubclass(String code, String description) {
this.code = code;
this.description = description;
}
public String getCode()
{
return code;
}
public String getDescription() {
return description;
}
}

5
zc-business/src/main/java/com/zc/business/enums/ValueConverter.java

@ -125,6 +125,7 @@ public class ValueConverter {
eventLabel.put("estimatedEndTime","预计解除时间"); eventLabel.put("estimatedEndTime","预计解除时间");
eventLabel.put("eventLevel","事件等级"); eventLabel.put("eventLevel","事件等级");
// eventLabel.put("eventType","事件类型"); // eventLabel.put("eventType","事件类型");
eventLabel.put("eventSubclass","事件子类");
eventLabel.put("eventCause","事件原因"); eventLabel.put("eventCause","事件原因");
eventLabel.put("description","描述"); eventLabel.put("description","描述");
eventLabel.put("eventState","状态"); eventLabel.put("eventState","状态");
@ -210,7 +211,7 @@ public class ValueConverter {
eventLabel.put("dcEventVehicleAccident.seriousInjuries","重伤(人)"); eventLabel.put("dcEventVehicleAccident.seriousInjuries","重伤(人)");
eventLabel.put("dcEventVehicleAccident.fatalities","死亡(人)"); eventLabel.put("dcEventVehicleAccident.fatalities","死亡(人)");
eventLabel.put("dcEventVehicleAccident.isPrivate","私密事件"); eventLabel.put("dcEventVehicleAccident.isPrivate","私密事件");
eventLabel.put("dcEventVehicleAccident.facilityId","设施id"); eventLabel.put("dcEventVehicleAccident.facilityId","地点");
eventLabel.put("dcEventVehicleAccident.rampId","匝道"); eventLabel.put("dcEventVehicleAccident.rampId","匝道");
eventLabel.put("dcEventVehicleAccident.location","地点"); eventLabel.put("dcEventVehicleAccident.location","地点");
eventLabel.put("dcEventTrafficControl.controlType","管制分类"); eventLabel.put("dcEventTrafficControl.controlType","管制分类");
@ -279,7 +280,7 @@ public class ValueConverter {
} }
public static String eventLabel(String inputValue) { public static String eventLabel(String inputValue) {
Map<String, String> mapping = getEventLabel(); Map<String, String> mapping = getEventLabel();
return mapping.getOrDefault(inputValue, inputValue); return mapping.getOrDefault(inputValue, "");
} }
//测试 //测试

73
zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java

@ -17,7 +17,6 @@ import com.zc.business.domain.DcOperLog;
import com.zc.business.domain.DcPublishManage; import com.zc.business.domain.DcPublishManage;
import com.zc.business.service.IDcDeviceService; import com.zc.business.service.IDcDeviceService;
import com.zc.business.service.IDcOperLogService; import com.zc.business.service.IDcOperLogService;
import com.zc.business.service.IDcPublishInfoService;
import com.zc.business.service.IDcPublishManageService; import com.zc.business.service.IDcPublishManageService;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
@ -27,6 +26,7 @@ import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Aspect @Aspect
@Component @Component
@ -162,7 +162,7 @@ public class OperationLogAspect {
} else { } else {
pointArg = (JSONObject) JSON.toJSON(pointArgs[0]); pointArg = (JSONObject) JSON.toJSON(pointArgs[0]);
} }
String contentDetails = "";
JSONArray devices = pointArg.getJSONArray("devices"); JSONArray devices = pointArg.getJSONArray("devices");
JSONArray functions = pointArg.getJSONArray("functions"); JSONArray functions = pointArg.getJSONArray("functions");
@ -205,6 +205,19 @@ public class OperationLogAspect {
if (i1 < functions.size() - 1) { if (i1 < functions.size() - 1) {
remark.append("、"); remark.append("、");
} }
if (Objects.equals(function.getString("functionId"), "13")&&Objects.equals(deviceType,"2")){
JSONArray parameters = function.getJSONObject("params").getJSONArray("parameters");
List<String> content = parameters.stream().map(item->((JSONObject)item).getString("CONTENT")).collect(Collectors.toList());
contentDetails = content.toString().replace("[", "").replace("]", "");
}
if (Objects.equals(deviceType,"5")){
contentDetails = function.getJSONObject("params").getString("text");
}
} }
if (i < (devices.size() - 1)) { if (i < (devices.size() - 1)) {
@ -262,7 +275,7 @@ public class OperationLogAspect {
dcPublishManage.setPublishChannels(7); dcPublishManage.setPublishChannels(7);
} }
dcPublishManage.setContentDetails(remark.toString()); dcPublishManage.setContentDetails(contentDetails);
dcPublishManageService.insertDcPublishManage(dcPublishManage); dcPublishManageService.insertDcPublishManage(dcPublishManage);
} }
@ -312,33 +325,33 @@ public class OperationLogAspect {
dcOperLogService.save(operLog); dcOperLogService.save(operLog);
if ((Objects.equals(deviceType, "2") || Objects.equals(deviceType, "5")) && Objects.nonNull(operLog.getId())) { //if ((Objects.equals(deviceType, "2") || Objects.equals(deviceType, "5")) && Objects.nonNull(operLog.getId())) {
DcPublishManage dcPublishManage = new DcPublishManage(); // DcPublishManage dcPublishManage = new DcPublishManage();
//
if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200")) { // if (Objects.equals(state, "0") && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), "200")) {
dcPublishManage.setPublishStatus(1);//发布状态1-成功2-失败 // dcPublishManage.setPublishStatus(1);//发布状态1-成功2-失败
} else { // } else {
dcPublishManage.setPublishStatus(2);//发布状态1-成功2-失败 // dcPublishManage.setPublishStatus(2);//发布状态1-成功2-失败
} // }
//
if (loginUser != null) { // if (loginUser != null) {
dcPublishManage.setPublisher(loginUser.getUsername());//发布人 // dcPublishManage.setPublisher(loginUser.getUsername());//发布人
} else { // } else {
dcPublishManage.setPublisher("系统定时调用");//发布人 // dcPublishManage.setPublisher("系统定时调用");//发布人
} // }
dcPublishManage.setPublishTime(new Date());//发布时间 // dcPublishManage.setPublishTime(new Date());//发布时间
dcPublishManage.setCreateTime(new Date());//创建时间 // dcPublishManage.setCreateTime(new Date());//创建时间
//
dcPublishManage.setLogId(Long.valueOf(operLog.getId()));//发布的如果的情报板传对应id // dcPublishManage.setLogId(Long.valueOf(operLog.getId()));//发布的如果的情报板传对应id
if (Objects.equals(deviceType, "2")) { // if (Objects.equals(deviceType, "2")) {
dcPublishManage.setPublishChannels(4); // dcPublishManage.setPublishChannels(4);
} else { // } else {
dcPublishManage.setPublishChannels(7); // dcPublishManage.setPublishChannels(7);
} // }
//
dcPublishManage.setContentDetails(remark.toString()); // dcPublishManage.setContentDetails(remark.toString());
dcPublishManageService.insertDcPublishManage(dcPublishManage); // dcPublishManageService.insertDcPublishManage(dcPublishManage);
} //}
} }
} }

23
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -1051,23 +1051,17 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
public int updateDcEmergencyPlans(DcEmergencyPlans dcEmergencyPlans) { public int updateDcEmergencyPlans(DcEmergencyPlans dcEmergencyPlans) {
dcEmergencyPlans.setUpdateTime(DateUtils.getNowDate()); dcEmergencyPlans.setUpdateTime(DateUtils.getNowDate());
List<DcExecuteAction> dcExecuteActionList = dataProcessing(dcEmergencyPlans); List<DcExecuteAction> dcExecuteActionList = dataProcessing(dcEmergencyPlans);
// 修改事件预案表数据
dcEmergencyPlansMapper.updateDcEmergencyPlans(dcEmergencyPlans);
// 修改执行操作表数据 // 修改执行操作表数据
dcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setUpdateTime(DateUtils.getNowDate())); dcExecuteActionList.stream()
// 过滤出删除掉的操作
String dcExecuteActionId = dcExecuteActionList.stream()
.filter(dcExecuteAction -> dcExecuteAction.getId() != null) .filter(dcExecuteAction -> dcExecuteAction.getId() != null)
.map(DcExecuteAction::getEmergencyPlansId) .forEach(dcExecuteAction -> dcExecuteAction.setUpdateTime(DateUtils.getNowDate()));
.map(String::valueOf) // 过滤出删除掉的操作
.findFirst()
.orElse(null);
List<String> ids = dcExecuteActionList.stream() List<String> ids = dcExecuteActionList.stream()
.filter(dcExecuteAction -> dcExecuteAction.getId() != null) .filter(dcExecuteAction -> dcExecuteAction.getId() != null)
.map(DcExecuteAction::getId) .map(DcExecuteAction::getId)
.collect(Collectors.toList()); .collect(Collectors.toList());
// 查询出事件预案关联的操作 // 查询出事件预案关联的操作
List<String> dcExecuteActionIdList = dcExecuteActionService.selectDcExecuteActionByEmergencyPlansId(dcExecuteActionId); List<String> dcExecuteActionIdList = dcExecuteActionService.selectDcExecuteActionByEmergencyPlansId(dcEmergencyPlans.getId().toString());
List<String> commonIds = new ArrayList<>(ids); List<String> commonIds = new ArrayList<>(ids);
commonIds.retainAll(dcExecuteActionIdList); commonIds.retainAll(dcExecuteActionIdList);
@ -1087,8 +1081,15 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
insertDcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setCreateTime(DateUtils.getNowDate())); insertDcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setCreateTime(DateUtils.getNowDate()));
dcExecuteActionService.insertDcExecuteActionBatch(insertDcExecuteActionList); dcExecuteActionService.insertDcExecuteActionBatch(insertDcExecuteActionList);
} }
List<DcExecuteAction> updateDcExecuteAction = dcExecuteActionList.stream()
.filter(dcExecuteAction -> dcExecuteAction.getId() != null)
.collect(Collectors.toList());
if (updateDcExecuteAction.size() > 0) {
dcExecuteActionService.updateDcExecuteActionBatch(updateDcExecuteAction);
}
return dcExecuteActionService.updateDcExecuteActionBatch(dcExecuteActionList); // 修改事件预案表数据
return dcEmergencyPlansMapper.updateDcEmergencyPlans(dcEmergencyPlans);
} }
/** /**

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

@ -11,9 +11,7 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDeptService;
import com.zc.business.domain.*; import com.zc.business.domain.*;
import com.zc.business.enums.EventSubclassEnum; import com.zc.business.enums.*;
import com.zc.business.enums.EventTypeEnum;
import com.zc.business.enums.ValueConverter;
import com.zc.business.mapper.*; import com.zc.business.mapper.*;
import com.zc.business.service.IDcEventProcessService; import com.zc.business.service.IDcEventProcessService;
import com.zc.business.service.IDcEventService; import com.zc.business.service.IDcEventService;
@ -667,20 +665,34 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
*/ */
@Override @Override
public int updateDcEvent(DcEvent dcEvent) { public int updateDcEvent(DcEvent dcEvent) {
/* //事件类型校验 /*
//事件类型校验
for (EventTypeEnum value : EventTypeEnum.values()) { for (EventTypeEnum value : EventTypeEnum.values()) {
if (dcEvent.getEventType().toString()==value.getInfo()){ if (dcEvent.getEventType().toString().equals(value.getInfo())){
dcEvent.setEventType(Long.valueOf(value.getCode())); dcEvent.setEventType(Long.valueOf(value.getCode()));
} }
} }
*/
// 事件子类校验 // 事件子类校验
for (EventSubclassEnum value : EventSubclassEnum.values()) { for (EventSubclass value : EventSubclass.values()) {
if (value.getInfo().equals(dcEvent.getEventSubclass())){ if (value.getDescription().equals(dcEvent.getEventSubclass())){
dcEvent.setEventSubclass(value.getCode()); dcEvent.setEventSubclass(value.getCode());
} }
} }
//事件来源校验*/ /*//事件来源校验
for (EventSource value : EventSource.values()) {
if (value.getDescription().equals(dcEvent.getEventSource())){
dcEvent.setEventSource(Long.valueOf(value.getCode()));
}
}*/
//事件方向
if (dcEvent.getDirection().equals("菏泽方向")){
dcEvent.setDirection("1");
} if (dcEvent.getDirection().equals("济南方向")){
dcEvent.setDirection("3");
}
DcEvent oldEvent = selectEventSubclassById(dcEvent.getId()); DcEvent oldEvent = selectEventSubclassById(dcEvent.getId());
dcEvent.setUpdateTime(DateUtils.getNowDate()); dcEvent.setUpdateTime(DateUtils.getNowDate());
@ -1067,6 +1079,112 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
} else if ("3".equals(result.getRight())) { } else if ("3".equals(result.getRight())) {
result.setRight("下行"); 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())) { } else if ("eventState".equals(result.getRightPath())) {
if ("0".equals(result.getRight())) { if ("0".equals(result.getRight())) {
result.setRight("待确认"); result.setRight("待确认");
@ -1139,7 +1257,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
} else if ("2".equals(result.getRight())) { } else if ("2".equals(result.getRight())) {
result.setRight("紧急"); 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())) { if ("1".equals(result.getRight())) {
result.setRight("高速主线"); result.setRight("高速主线");
} else if ("2".equals(result.getRight())) { } else if ("2".equals(result.getRight())) {
@ -1149,7 +1269,8 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
} else if ("4".equals(result.getRight())) { } else if ("4".equals(result.getRight())) {
result.setRight("收费站"); 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())) { if ("1".equals(result.getRight())) {
result.setRight("晴"); result.setRight("晴");
} else if ("2".equals(result.getRight())) { } else if ("2".equals(result.getRight())) {
@ -1278,17 +1399,6 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
} else if ("9".equals(result.getRight())) { } else if ("9".equals(result.getRight())) {
result.setRight("出口匝道"); 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())) { } else if ("dcEventTrafficCongestion.weatherCondition".equals(result.getRightPath())) {
if ("1".equals(result.getRight())) { if ("1".equals(result.getRight())) {
result.setRight("晴"); result.setRight("晴");
@ -1379,7 +1489,9 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
} }
} }
String label = ValueConverter.eventLabel(result.getRightPath()); 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.buses,0) buses,
ifNull(t2.tankers,0) tankers ifNull(t2.tankers,0) tankers
from dc_event t1 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} where t1.event_type = '1' and t1.direction = #{direction}
<if test="type != null and type == '1'.toString"> <if test="type != null and type == '1'.toString">
and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(#{startTime},'%Y%m%d') and DATE_FORMAT(t1.start_time,'%Y%m%d') = DATE_FORMAT(#{startTime},'%Y%m%d')
@ -326,13 +326,13 @@
where where
t1.event_type = '1' and t1.direction = #{direction} t1.event_type = '1' and t1.direction = #{direction}
<if test="type != null and type == '1'.toString"> <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>
<if test="type != null and type == '2'.toString"> <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>
<if test="type != null and type == '3'.toString"> <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>
<if test="type != null and type == '4'.toString"> <if test="type != null and type == '4'.toString">
and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR)) and YEAR(t1.start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR))
@ -384,13 +384,13 @@
from dc_event from dc_event
where event_type = '1' and direction = #{direction} where event_type = '1' and direction = #{direction}
<if test="type != null and type == '1'.toString"> <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>
<if test="type != null and type == '2'.toString"> <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>
<if test="type != null and type == '3'.toString"> <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>
<if test="type != null and type == '4'.toString"> <if test="type != null and type == '4'.toString">
and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR)) and YEAR(start_time) = YEAR(DATE_SUB(#{startTime},INTERVAL 1 YEAR))

Loading…
Cancel
Save