From 3e0efd10d0dbd63b7fb942d4111af553974e4e11 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" Date: Mon, 24 Jun 2024 14:51:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=8E=A7=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E5=85=AC=E4=BC=97=E6=9C=8D=E5=8A=A1=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E8=AE=B0=E5=BD=95=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DcEmergencyPlansServiceImpl.java | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 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 f951dba4..dca0f978 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 @@ -74,6 +74,9 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { @Resource private ISysDeptService iSysDeptService; + @Resource + private IDcPublishManageService dcPublishManageService; + /** * 查询事件预案 @@ -764,6 +767,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { try { // 根据不通设备类型,执行不通的功能操作 invokedFunction( + id, dcEventAnDcEmergencyPlans.getOperationType(), dcDevices, otherConfig, @@ -816,7 +820,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { /** * 根据不通设备类型,执行不通的功能操作 */ - public void invokedFunction(Integer operationType, + public void invokedFunction(String eventId, + Integer operationType, List dcDevices, JSONObject otherConfig, JSONArray resultArray) { @@ -983,7 +988,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { result.put("deviceName", device.getDeviceName()); result.put("content", params.get("text")); - processingDeviceParameters("A1", functionList, props); + processingDeviceParameters("A1", functionList, params); JSONObject returnResult = broadcastController.nearCamListDistance(params); result.put("result", returnResult); @@ -1035,7 +1040,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { } proDevice.put("functions", functionList); propsList.add(proDevice); - insertEquipmentControlRecordTable(device, propsList, resultArray, status, remark.toString()); + insertEquipmentControlRecordTable(device, propsList, resultArray, status, remark.toString(),eventId); } catch (HttpException | IOException e) { log.error(e.toString()); throw new RuntimeException(e); @@ -1148,11 +1153,13 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { /** * 设备控制记录表插入 */ + @Transactional(rollbackFor = Exception.class) public void insertEquipmentControlRecordTable(DcDevice dcDevice, List>>> propsList, JSONArray resultList, Integer status, - String remark) { + String remark, + String eventId) { DcOperLog dcOperLog = new DcOperLog(); List deviceIds = new ArrayList<>(); @@ -1177,6 +1184,32 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { dcOperLog.setOperTime(new Date()); dcOperLog.setRemark(remark); iDcOperLogService.addDcOperLog(dcOperLog); + // 插入公众服务统计记录表 + if (Objects.equals(dcDevice.getDeviceType(), "2") || Objects.equals(dcDevice.getDeviceType(), "5")) { + DcPublishManage dcPublishManage = new DcPublishManage(); + if (Objects.equals(status, 0)) { + dcPublishManage.setPublishStatus(1);//发布状态1-成功2-失败 + } else { + dcPublishManage.setPublishStatus(2);//发布状态1-成功2-失败 + } + dcPublishManage.setEventId(eventId); + dcPublishManage.setPublisher(loginUser.getUsername());//发布人 + + dcPublishManage.setPublishTime(new Date());//发布时间 + dcPublishManage.setCreateTime(new Date());//创建时间 + + if (StringUtils.isNotEmpty(dcOperLog.getId())) { + dcPublishManage.setLogId(Long.valueOf(dcOperLog.getId()));//发布的如果的情报板传对应id + } + if (Objects.equals(dcDevice.getDeviceType(), "2")) { + dcPublishManage.setPublishChannels(4); + } else { + dcPublishManage.setPublishChannels(7); + } + dcPublishManage.setContentDetails(JSON.toJSONString(propsList)); + dcPublishManageService.insertDcPublishManage(dcPublishManage); + } + }