From 3221e003897ef7c168cbb9fc995affa7631a29f9 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Fri, 15 Mar 2024 16:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=A1=AE=E8=AE=A4=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=BF=80=E5=85=89=E6=8D=A2=E7=96=B2=E5=8A=B3=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=93=8D=E6=8E=A7=20=E9=A2=84=E6=A1=88=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=92=8C=E9=99=8D=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DcEmergencyPlansServiceImpl.java | 29 ++++++++++++++----- .../business/DcEmergencyPlansMapper.xml | 6 ++++ 2 files changed, 28 insertions(+), 7 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 ff29c094..48a6c287 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 @@ -597,13 +597,11 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { if (controlModel.equals("1")) { props.put("mode", "00"); } else if (controlModel.equals("2")) { - Date date = new Date(); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - String format = dateFormat.format(date); - String[] times = otherConfig.get("time").toString().split("-"); + String startTime = otherConfig.get("startTime").toString(); + String endTime = otherConfig.get("endTime").toString(); props.put("mode", "01"); - props.put("startDisplayTime", format + " " + times[0]); - props.put("endDisplayTime", format + " " + times[1]); + props.put("startDisplayTime", startTime); + props.put("endDisplayTime", endTime); } else { props.put("mode", "02"); } @@ -704,7 +702,24 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { result.put("result", returnResult); resultArray.add(result); } - else { + else if (device.getDeviceType().equals(DeviceTypeConstants.LASER_FATIGUE_AWAKENING)) { + // 激光疲劳唤醒 + functionId = otherConfig.get("state").toString(); + + AjaxResult ajaxResultState = dcDeviceController.invokedFunction(iotDeviceId, functionId, new HashMap<>()); + // 将调用结果存入到 resultArray(操作结果) 中 + JSONObject result = new JSONObject(); + result.put("device", device.getId()); + result.put("result", ajaxResultState); + resultArray.add(result); + // 操作时长 + String operationDuration = "SETTM" + otherConfig.get("operationDuration").toString(); + AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, operationDuration, new HashMap<>()); + JSONObject resultTime = new JSONObject(); + resultTime.put("device", device.getId()); + resultTime.put("result", ajaxResult); + resultArray.add(resultTime); + } else { break; } diff --git a/zc-business/src/main/resources/mapper/business/DcEmergencyPlansMapper.xml b/zc-business/src/main/resources/mapper/business/DcEmergencyPlansMapper.xml index 63d9a33a..a1e7e6f5 100644 --- a/zc-business/src/main/resources/mapper/business/DcEmergencyPlansMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEmergencyPlansMapper.xml @@ -118,6 +118,12 @@ t1.control_command, t1.event_category from dc_emergency_plans t1 + + and plan_name like concat('%', #{planName}, '%') + and event_type = #{eventType} + and event_category = #{eventCategory} + + order by t1.id desc