From 21263f3ae582afd034e54bbec3bd43be0aaa7569 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 24 May 2024 15:14:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=8B=E4=BB=B6=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E6=8E=A5=E5=8F=A3=E4=B8=AD=E7=9A=84=E8=A1=8C=E8=BD=A6?= =?UTF-8?q?=E8=AF=B1=E5=AF=BC=E5=92=8C=E6=BF=80=E5=85=89=E6=8D=A2=E7=96=B2?= =?UTF-8?q?=E5=8A=B3=E8=AE=BE=E5=A4=87=E6=8E=A7=E5=88=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DcEmergencyPlansServiceImpl.java | 47 ++++++------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java index 8bca9564..8fd2494e 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java +++ b/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 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 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);