|
|
@ -1353,6 +1353,86 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl |
|
|
|
|
|
|
|
//事件状态已终止
|
|
|
|
if (state == UniversalEnum.THREE.getNumber()) { |
|
|
|
|
|
|
|
EventPlanAssoc eventPlanAssoc = new EventPlanAssoc(); |
|
|
|
eventPlanAssoc.setEventId(id); |
|
|
|
LambdaQueryWrapper<EventPlanAssoc> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
lambdaQueryWrapper.eq(EventPlanAssoc::getEventId,id); |
|
|
|
lambdaQueryWrapper.eq(EventPlanAssoc::getOperationType,"1"); |
|
|
|
List<EventPlanAssoc> eventPlanAssocs = eventPlanAssocMapper.selectList(lambdaQueryWrapper); |
|
|
|
if (eventPlanAssocs != null && eventPlanAssocs.size() > 0){ |
|
|
|
for (EventPlanAssoc planAssoc : eventPlanAssocs) { |
|
|
|
JSONArray control = JSONArray.parseArray(planAssoc.getControl()); |
|
|
|
for (Object o : control) { |
|
|
|
JSONObject controlItem = (JSONObject) o; |
|
|
|
// 判断是否有设备列表,如果没有则跳过当前循环
|
|
|
|
if (!controlItem.containsKey("deviceList") || controlItem.get("deviceList") == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
String[] deviceList = controlItem.getString("deviceList").split(","); |
|
|
|
JSONObject recoverConfig = controlItem.getJSONObject("recoverConfig"); |
|
|
|
int deviceType = controlItem.getIntValue("deviceType"); |
|
|
|
if (deviceType == 2){ |
|
|
|
//情报板 切换播放目录
|
|
|
|
for (String deviceId : deviceList) { |
|
|
|
HashMap<String, Object> props = new HashMap<>(); |
|
|
|
props.put("fileId", UniversalEnum.TEN.getValue()); |
|
|
|
String functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_1B; |
|
|
|
deviceController.getAjaxResult(deviceId, functionId, props); |
|
|
|
} |
|
|
|
|
|
|
|
} else if (deviceType == 10){ |
|
|
|
//激光疲劳唤醒"recoverConfig": "{\"operationDuration\":1,\"operationType\":\"0\",\"name\":\"激光关闭\"}",
|
|
|
|
for (String deviceId : deviceList) { |
|
|
|
//更改模式
|
|
|
|
HashMap<String, Object> props = new HashMap<>(); |
|
|
|
props.put(UniversalEnum.SET.getValue(), LaserMode.getCodeByName(recoverConfig.getString("name"))); |
|
|
|
String functionIdMode = UniversalEnum.SETMD.getValue(); |
|
|
|
deviceController.getAjaxResult(deviceId, functionIdMode, props); |
|
|
|
//更改时长
|
|
|
|
HashMap<String, Object> propsTime = new HashMap<>(); |
|
|
|
propsTime.put(UniversalEnum.SET.getValue(), recoverConfig.getString("operationDuration")); |
|
|
|
String functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_SETTM; |
|
|
|
deviceController.getAjaxResult(deviceId, functionId, propsTime); |
|
|
|
} |
|
|
|
} else if (deviceType == 12){ |
|
|
|
//行车诱导
|
|
|
|
for (String deviceId : deviceList) { |
|
|
|
String controlModelName = recoverConfig.getString("controlModelName");//模式
|
|
|
|
if ("手动模式".equals(controlModelName)) { |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("mode", "00"); |
|
|
|
params.put("onWorkStatus", recoverConfig.getString("state")); |
|
|
|
params.put("inWorkStatus", recoverConfig.getString("state")); |
|
|
|
String functionId = DeviceFunctionIdConstants.DRIVING_GUIDANCE; |
|
|
|
deviceController.getAjaxResult(deviceId, functionId,params); |
|
|
|
}else if ("万年历".equals(controlModelName)){ |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("onWorkStatus", recoverConfig.getString("state")); |
|
|
|
params.put("inWorkStatus", recoverConfig.getString("state")); |
|
|
|
deviceController.getAjaxResult(deviceId,"30",params); |
|
|
|
HashMap<String, Object> params2 = new HashMap<>(); |
|
|
|
params2.put("mode", "02"); |
|
|
|
String functionId = DeviceFunctionIdConstants.DRIVING_GUIDANCE; |
|
|
|
deviceController.getAjaxResult(deviceId, functionId,params2); |
|
|
|
}else { |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("onWorkStatus", recoverConfig.getString("state")); |
|
|
|
params.put("inWorkStatus", recoverConfig.getString("state")); |
|
|
|
deviceController.getAjaxResult(deviceId,"30",params); |
|
|
|
HashMap<String, Object> params2 = new HashMap<>(); |
|
|
|
params2.put("mode","01"); |
|
|
|
params2.put("startDisplayTime",recoverConfig.getString("startTime")); |
|
|
|
params2.put("endDisplayTime",recoverConfig.getString("endTime")); |
|
|
|
String functionId = DeviceFunctionIdConstants.DRIVING_GUIDANCE; |
|
|
|
deviceController.getAjaxResult(deviceId, functionId,params2); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return dcEventMapper.updateDcEventState(id, state); |
|
|
|
} |
|
|
|
|
|
|
|