From bb48b5088674558970535f96949229678cfb1507 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Tue, 25 Jun 2024 10:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E6=8E=A7-=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E8=BF=94=E5=9B=9E=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF=20=E4=BF=AE=E6=94=B9=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=8E=A7=E5=88=B6=E8=AE=B0=E5=BD=95=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E5=88=B0=E5=85=AC=E4=BC=97=E6=9C=8D=E5=8A=A1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaces/OperationLogAspect.java | 2 +- .../impl/DcEmergencyPlansServiceImpl.java | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index d4071155..c43f1417 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -269,7 +269,7 @@ public class OperationLogAspect { dcPublishManage.setPublishChannels(7); } - dcPublishManage.setContentDetails(String.valueOf(pointArgs)); + dcPublishManage.setContentDetails(JSON.toJSONString(pointArgs)); dcPublishManageService.insertDcPublishManage(dcPublishManage); } } 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 dca0f978..d73d9177 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 @@ -767,6 +767,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { try { // 根据不通设备类型,执行不通的功能操作 invokedFunction( + dcExecuteAction.getDeviceType(), id, dcEventAnDcEmergencyPlans.getOperationType(), dcDevices, @@ -820,11 +821,29 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { /** * 根据不通设备类型,执行不通的功能操作 */ - public void invokedFunction(String eventId, + public void invokedFunction(int deviceType, + String eventId, Integer operationType, List dcDevices, JSONObject otherConfig, JSONArray resultArray) { + // 获取设备类型名称 + String deviceTypeName = Arrays.stream(DeviceTypeEnum.values()) + .filter(deviceTypeEnum -> deviceTypeEnum.getCode() == deviceType) + .findFirst() + .map(DeviceTypeEnum::getInfo) + .orElse("类型异常"); + + if (dcDevices.size() == 0) { + JSONObject result = new JSONObject(); + JSONObject errorResult = new JSONObject(); + errorResult.put("code",500); + errorResult.put("msg","操作失败"); + result.put("deviceName", deviceTypeName); + result.put("content", "未找到相关设备"); + result.put("result", errorResult); + resultArray.add(result); + } for (DcDevice device : dcDevices) {