From f911f720666f340bcdca69863e42bce5b372cd4c Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期五, 08 三月 2024 12:56:19 +0800
Subject: [PATCH] 增加报警引导成功websocket通知前端标识:70000
---
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java | 4 ++++
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java | 9 ++++++++-
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java | 15 +++++++++++++++
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java | 5 ++++-
ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java | 8 ++++++++
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java | 5 +++++
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java | 5 ++++-
7 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java
index 234adb7..ca81988 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java
@@ -45,4 +45,9 @@
* 寮曞鐩爣缁忕含搴�
*/
double[] targetPosition;
+
+ /**
+ * 浜曞彿
+ */
+ String wellId;
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
index ba87d51..2762f49 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
@@ -1086,6 +1086,7 @@
ardAlarmRadarMove.setLatitude(latitude);
ardAlarmRadarMove.setUpdateTime(radarAlarmData.getAlarmTime());
ardAlarmRadarMove.setRadarId(radarId);
+ ardAlarmRadarMove.setWellId(well.getWellId());
ardAlarmRadarMoveHandler(ardAlarmRadarMove);
break;
case "鐑簮妫�娴�":
@@ -1100,6 +1101,7 @@
ardAlarmRadarFire.setLatitude(latitude);
ardAlarmRadarFire.setRadarId(radarId);
ardAlarmRadarFire.setUpdateTime(radarAlarmData.getAlarmTime());
+ ardAlarmRadarFire.setWellId(well.getWellId());
ardAlarmRadarFireHandler(ardAlarmRadarFire);
break;
case "闆疯揪鎶芥补鏈哄仠鏈�":
@@ -1114,6 +1116,7 @@
ardAlarmRadarPump.setUpdateTime(radarAlarmData.getAlarmTime());
ardAlarmRadarPump.setLongitude(well.getLongitude());
ardAlarmRadarPump.setLatitude(well.getLatitude());
+ ardAlarmRadarPump.setWellId(well.getWellId());
ardAlarmRadarPumpHandler(ardAlarmRadarPump);
break;
}
@@ -1279,7 +1282,8 @@
return;
}
guideTask.setPriority(Integer.valueOf(priority));
- guideTask.setTargetPosition(guideDataDto.getTargetPosition());//寮曞浜旾D
+ guideTask.setTargetPosition(guideDataDto.getTargetPosition());//寮曞浜曞潗鏍�
+ guideTask.setWellId(guideDataDto.getWellId());//寮曞浜旾D
//娑堟伅鍏ラ槦
queueHandler.addTaskToQueue(cameraId, guideTask);
//鎵撳嵃闃熷垪
@@ -1379,6 +1383,7 @@
.setAlarmId(ardAlarmRadarMove.getId())
.setAlarmType(ardAlarmRadarMove.getAlarmType())
.setReceiveTime(ardAlarmRadarMove.getCreateTime())
+ .setWellId(ardAlarmRadarMove.getWellId())
.setTargetPosition(coordinate);
getCameraGuideToQueue(guideDataDto);//鑾峰彇鐩告満鍏ラ槦
}
@@ -1402,6 +1407,7 @@
.setAlarmId(ardAlarmRadarFire.getId())
.setAlarmType(ardAlarmRadarFire.getAlarmType())
.setReceiveTime(ardAlarmRadarFire.getCreateTime())
+ .setWellId(ardAlarmRadarFire.getWellId())
.setTargetPosition(coordinate);
getCameraGuideToQueue(guideDataDto);//鑾峰彇鐩告満鍏ラ槦
}
@@ -1426,6 +1432,7 @@
.setAlarmId(ardAlarmRadarPump.getId())
.setAlarmType(ardAlarmRadarPump.getAlarmType())
.setReceiveTime(ardAlarmRadarPump.getCreateTime())
+ .setWellId(ardAlarmRadarPump.getWellId())
.setTargetPosition(coordinate);
getCameraGuideToQueue(guideDataDto);//鑾峰彇鐩告満鍏ラ槦
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java
index 9d5fe47..afa6338 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java
@@ -1,5 +1,6 @@
package com.ruoyi.alarm.global.service.impl;
+import com.alibaba.fastjson.JSON;
import com.ruoyi.alarm.access.domain.ArdAlarmAccess;
import com.ruoyi.alarm.access.service.IArdAlarmAccessService;
import com.ruoyi.alarm.external.domain.ArdAlarmExternal;
@@ -23,6 +24,7 @@
import com.ruoyi.device.camera.domain.ArdCameras;
import com.ruoyi.device.camera.domain.CameraCmd;
import com.ruoyi.device.camera.service.ICameraSdkService;
+import com.ruoyi.utils.websocket.util.WebSocketUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
@@ -33,6 +35,8 @@
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.*;
+
+import static com.ruoyi.utils.websocket.util.WebSocketUtils.ONLINE_USER_SESSIONS;
/**
* @Description: 闃熷垪澶勭悊鍣�
@@ -108,6 +112,17 @@
boolean guideRes = cameraSdkService.guideTargetPosition(cmd);
if (guideRes) {
log.debug("寮曞鎴愬姛");
+ //region 閫氱煡鍓嶇
+ Map<String,Object> message = new HashMap<>();
+ Map<String,String> data = new HashMap<>();
+ data.put("cameraId",cmd.getCameraId());
+ data.put("chanNo",cmd.getChanNo().toString());
+ data.put("alarmType",cmd.getOperator());
+ data.put("alarmId", guideTask.getAlarmId());
+ data.put("wellId",guideTask.getWellId());
+ message.put("70000",data);
+ WebSocketUtils.sendMessageAll(message);
+ //endregion
cameraSdkService.controlLock(cmd);//涓婇攣
cameraSdkService.recordStart(cmd);//寮�濮嬪綍鍍�
recordFlag = true;
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java
index 0f96657..3a4031a 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java
@@ -79,5 +79,8 @@
* 闆疯揪ID
*/
private String radarId;
-
+ /**
+ * 浜曞彿
+ */
+ private String wellId;
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java
index 2b6e41b..436e982 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java
@@ -79,5 +79,9 @@
* 闆疯揪ID
*/
private String RadarId;
+ /**
+ * 浜曞彿
+ */
+ private String wellId;
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java
index ea173b0..889f128 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java
@@ -103,6 +103,9 @@
* 闆疯揪ID
*/
private String radarId;
-
+ /**
+ * 浜曞彿
+ */
+ private String wellId;
}
diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
index 97d071c..1b7b893 100644
--- a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
@@ -373,6 +373,14 @@
List<DeptAndCamerasDto> deptAndCamerasList = sysDepts.stream()
.map(sysDept -> {
List<ArdCameras> ardCameras = ardCamerasMapper.selectArdCamerasByDeptId(sysDept.getDeptId());
+ ardCameras.stream().forEach(ardCamera ->{
+ ArdChannel ardChannel = new ArdChannel();
+ ardChannel.setDeviceId(ardCamera.getId());
+ List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel);
+ if (ardChannels != null) {
+ ardCamera.setChannelList(ardChannels);
+ }
+ });
DeptAndCamerasDto deptAndCamerasDto = new DeptAndCamerasDto();
deptAndCamerasDto.setSysDept(sysDept);
deptAndCamerasDto.setArdCamerasList(ardCameras);
--
Gitblit v1.9.3