From 1e5d15f21518cd25fe52096e82dc80390a18c9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Tue, 1 Apr 2025 17:06:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BF=80=E5=85=89=E7=96=B2=E5=8A=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/service/impl/DcEventServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java index 8f7e2f0c..7f81b72f 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java @@ -2025,6 +2025,10 @@ public class DcEventServiceImpl extends ServiceImpl impl 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"); @@ -2038,8 +2042,13 @@ public class DcEventServiceImpl extends ServiceImpl impl } } else if (deviceType == 10){ - //激光疲劳唤醒 - + //激光疲劳唤醒"recoverConfig": "{\"operationDuration\":1,\"operationType\":\"0\",\"name\":\"激光关闭\"}", + for (String deviceId : deviceList) { + HashMap 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){ //行车诱导