|
|
@ -880,8 +880,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
|
|
|
|
// functions
|
|
|
|
List<Map<String, Object>> functionList = new ArrayList<>(); |
|
|
|
remark.append(device.getDeviceName()); |
|
|
|
remark.append(UniversalEnum.INVOKE.getValue()); |
|
|
|
try { |
|
|
|
if (device.getDeviceType().equals(DeviceTypeConstants.DRIVING_GUIDANCE.toString())) { |
|
|
|
// 行车诱导
|
|
|
@ -899,11 +897,23 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
props.put("startDisplayTime", startTime); |
|
|
|
props.put("endDisplayTime", endTime); |
|
|
|
result.put("content", "自动:" + stateName + ";时间范围:" + startTime + UniversalEnum.SHORT_BAR.getValue() + endTime); |
|
|
|
remark.append("时间自动控制模式:"); |
|
|
|
remark.append(startTime); |
|
|
|
remark.append("-"); |
|
|
|
remark.append(endTime); |
|
|
|
} else if (controlModel.equals(UniversalEnum.ZERO_ZERO.getValue())) { |
|
|
|
result.put("content", "手动:" + stateName); |
|
|
|
remark.append("远程手动控制模式"); |
|
|
|
} else { |
|
|
|
result.put("content", "万年历:" + stateName); |
|
|
|
remark.append("万年历自动控制模式"); |
|
|
|
} |
|
|
|
remark.append(":"); |
|
|
|
remark.append("上行:"); |
|
|
|
remark.append(otherConfig.get("name").toString()); |
|
|
|
remark.append(","); |
|
|
|
remark.append("下行:"); |
|
|
|
remark.append(otherConfig.get("name").toString()); |
|
|
|
result.put("device", device.getId()); |
|
|
|
result.put("deviceName", device.getDeviceName()); |
|
|
|
result.put("deviceType", device.getDeviceType()); |
|
|
@ -918,7 +928,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
} else { |
|
|
|
status = UniversalEnum.ONE.getNumber(); |
|
|
|
} |
|
|
|
remark.append(UniversalEnum.DEVICE_CONTROL_MODE.getValue()); |
|
|
|
result.put("result", ajaxResult); |
|
|
|
dcOperLog.add(result); |
|
|
|
resultArray.add(result); |
|
|
@ -956,11 +965,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
jsonObject.get("dcDeviceId").toString().equals(device.getId().toString())) |
|
|
|
.findFirst() |
|
|
|
.orElse(null); |
|
|
|
remark.append(UniversalEnum.FILE_NAME_SENDING.getValue()); |
|
|
|
remark.append("、"); |
|
|
|
remark.append(UniversalEnum.FILE_SENDING.getValue()); |
|
|
|
remark.append("、"); |
|
|
|
remark.append(UniversalEnum.SPECIFIES_THE_LIST_THAT_CURRENTLY_NEEDS_TO_BE_PLAYED.getValue()); |
|
|
|
if (foundContent == null) { |
|
|
|
// 说明没有匹配到设备
|
|
|
|
JSONObject errorResult = new JSONObject(); |
|
|
@ -975,10 +979,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
resultArray.add(result); |
|
|
|
dcOperLog.add(result); |
|
|
|
status = UniversalEnum.ONE.getNumber(); |
|
|
|
remark.append(errorResult.get("content")); |
|
|
|
} else { |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("dcInfoBoardTemplate", foundContent); |
|
|
|
status = boardReleaseProcess(props, iotDeviceId, jsonObject, device, resultArray, functionList, dcOperLog); |
|
|
|
status = boardReleaseProcess(props, iotDeviceId, jsonObject, device, resultArray, functionList, dcOperLog, remark); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -1010,6 +1015,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
errorResult.put("result",resu); |
|
|
|
dcOperLog.add(errorResult); |
|
|
|
resultArray.add(errorResult); |
|
|
|
remark.append(errorResult.get("content")); |
|
|
|
}else { |
|
|
|
if (StringUtils.isEmpty(foundContent.getString("content"))) { |
|
|
|
params.put("text", UniversalEnum.WELCOME_TO_SHANDONG_EXPRESSWAY.getValue()); |
|
|
@ -1028,8 +1034,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
result.put("deviceName", device.getDeviceName()); |
|
|
|
result.put("deviceType", device.getDeviceType()); |
|
|
|
result.put("content", params.get("text")); |
|
|
|
|
|
|
|
remark.append(UniversalEnum.RELEASE_VOICE_BROADCAST.getValue()); |
|
|
|
remark.append(result.get("content")); |
|
|
|
|
|
|
|
processingDeviceParameters(UniversalEnum.A_ONE.getValue(), functionList, params); |
|
|
|
|
|
|
@ -1049,17 +1054,27 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
|
|
|
|
} else if (device.getDeviceType().equals(DeviceTypeConstants.LASER_FATIGUE_AWAKENING.toString())) { |
|
|
|
// 激光疲劳唤醒
|
|
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
|
map.put(UniversalEnum.SET.getValue(), otherConfig.get("operationType").toString()); |
|
|
|
|
|
|
|
// 查看当前设备控制的状态
|
|
|
|
JSONObject mdJSONObject = (JSONObject) JSON.toJSON(dcDeviceController.getDeviceLatestProperty(iotDeviceId, "MD").get("data")); |
|
|
|
String mdValue = mdJSONObject.containsKey("value")? mdJSONObject.getString("value") : null; |
|
|
|
|
|
|
|
JSONObject tmJSONObject = (JSONObject) JSON.toJSON(dcDeviceController.getDeviceLatestProperty(iotDeviceId, "TM").get("data")); |
|
|
|
String tmValue = tmJSONObject.containsKey("value")? tmJSONObject.getString("value") : null; |
|
|
|
|
|
|
|
JSONObject resultTime = new JSONObject(); |
|
|
|
resultTime.put("device", device.getId()); |
|
|
|
resultTime.put("deviceName", device.getDeviceName()); |
|
|
|
resultTime.put("deviceType", device.getDeviceType()); |
|
|
|
|
|
|
|
remark.append(UniversalEnum.MODE_SETTING_COMMAND.getValue()); |
|
|
|
remark.append("、"); |
|
|
|
remark.append(UniversalEnum.WORK_TIME_SETTING_COMMAND.getValue()); |
|
|
|
remark.append(otherConfig.get("name").toString()); |
|
|
|
remark.append(","); |
|
|
|
remark.append(otherConfig.get("operationDuration")); |
|
|
|
remark.append(UniversalEnum.MINUTES.getValue()); |
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
|
map.put(UniversalEnum.SET.getValue(), otherConfig.get("operationType").toString()); |
|
|
|
// 调用设备参数存储格式
|
|
|
|
processingDeviceParameters(UniversalEnum.SETMD.getValue(), functionList, map); |
|
|
|
|
|
|
|
AjaxResult ajaxResultState = dcDeviceController.getAjaxResult(iotDeviceId, UniversalEnum.SETMD.getValue(), map); |
|
|
@ -1074,6 +1089,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_SETTM; |
|
|
|
resultTime.put("content", "状态:" + name + ";操作时长" + otherConfig.get("operationDuration") + UniversalEnum.MINUTES.getValue()); |
|
|
|
|
|
|
|
// 调用设备参数存储格式
|
|
|
|
processingDeviceParameters(functionId, functionList, propsTime); |
|
|
|
|
|
|
|
AjaxResult ajaxResult = dcDeviceController.getAjaxResult(iotDeviceId, functionId, propsTime); |
|
|
@ -1085,6 +1101,15 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
status = UniversalEnum.ZERO.getNumber(); |
|
|
|
} else { |
|
|
|
status = UniversalEnum.ONE.getNumber(); |
|
|
|
// 模拟事务,回滚设备当前的使用状态
|
|
|
|
if (!ajaxResultState.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber()) && mdValue != null) { |
|
|
|
map.put(UniversalEnum.SET.getValue(), mdValue); |
|
|
|
dcDeviceController.getAjaxResult(iotDeviceId, UniversalEnum.SETMD.getValue(), map); |
|
|
|
} |
|
|
|
if (!ajaxResult.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber()) && tmValue != null) { |
|
|
|
propsTime.put(UniversalEnum.SET.getValue(), UniversalEnum.SETTM.getValue() + tmValue); |
|
|
|
dcDeviceController.getAjaxResult(iotDeviceId, DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_SETTM, propsTime); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -1098,7 +1123,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
|
|
|
|
} catch (HttpException | IOException e) { |
|
|
|
log.error(e.toString()); |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -1126,7 +1150,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
DcDevice device, |
|
|
|
JSONArray resultArray, |
|
|
|
List<Map<String, Object>> functionList, |
|
|
|
JSONArray dcOperLog |
|
|
|
JSONArray dcOperLog, |
|
|
|
StringBuilder remark |
|
|
|
) throws HttpException, IOException { |
|
|
|
String functionId = UniversalEnum.EMPTY_STRING.getValue(); |
|
|
|
Integer status = UniversalEnum.ZERO.getNumber(); |
|
|
@ -1138,13 +1163,14 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
props.put("size", UniversalEnum.SIXTY_FIVE_THOUSAND_FIVE_HUNDRED_THIRTY_FIVE.getValue()); |
|
|
|
|
|
|
|
processingDeviceParameters(functionId, functionList, props); |
|
|
|
|
|
|
|
AjaxResult ajaxResult11 = dcDeviceController.getAjaxResult(iotDeviceId, functionId, props); |
|
|
|
dcOperLog.add(getDcOperLog(device,ajaxResult11)); |
|
|
|
// 13功能码执行参数构造
|
|
|
|
DcInfoBoardTemplate dcInfoBoardTemplate = JSON.parseObject( |
|
|
|
JSON.toJSONString(otherConfig.get("dcInfoBoardTemplate")), |
|
|
|
DcInfoBoardTemplate.class); |
|
|
|
remark.append(dcInfoBoardTemplate.getContent()); |
|
|
|
AjaxResult ajaxResult11 = dcDeviceController.getAjaxResult(iotDeviceId, functionId, props); |
|
|
|
dcOperLog.add(getDcOperLog(device,ajaxResult11)); |
|
|
|
// 13功能码执行参数构造
|
|
|
|
|
|
|
|
HashMap<String, Object> props11 = new HashMap<>(); |
|
|
|
functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_13; |
|
|
|
List<Map<String, String>> list = new ArrayList<>(); |
|
|
|