Browse Source

修改事件确认接口中的行车诱导和激光换疲劳设备控制代码

develop
Mr.Wang 9 months ago
parent
commit
21263f3ae5
  1. 47
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

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

@ -798,40 +798,28 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
if (device.getDeviceType().equals(DeviceTypeConstants.DRIVING_GUIDANCE.toString())) {
// 行车诱导
functionId = DeviceFunctionIdConstants.DRIVING_GUIDANCE;
// 控制模式 1-手动 2-自动 3-万年历
// 控制模式 00-手动 01-自动 02-万年历
String controlModel = otherConfig.get("controlModel").toString();
props.put("onWorkStatus", otherConfig.get("state").toString());
props.put("inWorkStatus", otherConfig.get("state").toString());
props.put("mode", controlModel);
JSONObject result = new JSONObject();
String state = "";
// 01常亮02流水03闪烁04关闭
if (otherConfig.get("state").toString().equals("01")) {
state = "常量";
} else if (otherConfig.get("state").toString().equals("02")) {
state = "流水";
} else if (otherConfig.get("state").toString().equals("03")) {
state = "闪烁";
}else {
state = "关闭";
}
String stateName = otherConfig.get("name").toString();
if (controlModel.equals("01")) {
String startTime = otherConfig.get("startTime").toString();
String endTime = otherConfig.get("endTime").toString();
props.put("mode", "01");
props.put("startDisplayTime", startTime);
props.put("endDisplayTime", endTime);
result.put("content","时间自动:"+state+";"+startTime+"-"+endTime);
result.put("content","自动:"+stateName+";时间范围:"+startTime+"-"+endTime);
} else if (controlModel.equals("00")) {
result.put("content","手动:"+state);
result.put("content","手动:"+stateName);
}else {
result.put("content","万年历:"+state);
result.put("content","万年历:"+stateName);
}
AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, props);
// 将调用结果存入到 resultArray(操作结果) 中
result.put("device", device.getId());
result.put("deviceName",device.getDeviceName());
AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, props);
// 将调用结果存入到 resultArray(操作结果) 中
result.put("result", ajaxResult);
resultArray.add(result);
@ -919,14 +907,13 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}
else if (device.getDeviceType().equals(DeviceTypeConstants.LASER_FATIGUE_AWAKENING.toString())) {
// 激光疲劳唤醒
functionId = otherConfig.get("state").toString();
AjaxResult ajaxResultState = dcDeviceController.invokedFunction(iotDeviceId, functionId, new HashMap<>());
JSONObject result = new JSONObject();
result.put("device", device.getId());
result.put("deviceName",device.getDeviceName());
result.put("result", ajaxResultState);
resultArray.add(result);
HashMap<String,Object> map = new HashMap<>();
map.put("SET",otherConfig.get("operationType").toString());
JSONObject resultTime = new JSONObject();
resultTime.put("device", device.getId());
resultTime.put("deviceName",device.getDeviceName());
AjaxResult ajaxResultState = dcDeviceController.invokedFunction(iotDeviceId, "SETMD", map);
resultTime.put("resultState", ajaxResultState);
// 操作时长
String operationDuration = "SETTM" + otherConfig.get("operationDuration").toString();
@ -934,12 +921,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
HashMap<String, Object> propsTime = new HashMap<>();
propsTime.put("SET", operationDuration);
functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_SETTM;
resultTime.put("content","状态:"+name+";操作时长"+otherConfig.get("operationDuration")+"分钟");
AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, propsTime);
JSONObject resultTime = new JSONObject();
resultTime.put("device", device.getId());
resultTime.put("deviceName",device.getDeviceName());
resultTime.put("content","状态:"+name+"操作时长"+otherConfig.get("operationDuration"));
resultTime.put("result", ajaxResult);
resultArray.add(resultTime);

Loading…
Cancel
Save