From 6b4a4baa1048b1ed148580802ab06a78bbbd3db7 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期六, 09 十二月 2023 14:14:11 +0800
Subject: [PATCH] 报警引导增加优先井配置ptz引导
---
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarMove.java | 3
ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml | 20 ++
ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java | 67 ++----
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideTask.java | 4
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarPump.java | 64 +++++-
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueTaskExecutor.java | 15 +
ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/service/impl/HikvisionSDK.java | 5
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideDataDto.java | 27 +++
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java | 214 +++++++++++++++--------
ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWell.java | 11 +
ruoyi-admin/src/main/resources/logback.xml | 36 ++--
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuidePTZ.java | 23 ++
ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java | 37 +++
ard-work/src/main/java/com/ruoyi/alarm/radar/domain/ArdAlarmRadarFire.java | 3
ard-work/src/main/java/com/ruoyi/alarm/steal/service/impl/IStealElecAlarmServiceImpl.java | 2
15 files changed, 367 insertions(+), 164 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideDataDto.java b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideDataDto.java
new file mode 100644
index 0000000..fa24638
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuideDataDto.java
@@ -0,0 +1,27 @@
+package com.ruoyi.alarm.global.domain;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * @Description: 寮曞鏁版嵁瀹炰綋
+ * @ClassName: GuideDataDto
+ * @Author: 鍒樿嫃涔�
+ * @Date: 2023骞�12鏈�09鏃�11:37:58
+ **/
+@Data
+@Accessors(chain = true)
+public class GuideDataDto {
+ String radarId;
+ String name;
+ String cameraId;
+ String alarmId;
+ String alarmType;
+ Date receiveTime;
+ Integer num;
+ Integer recordSn;
+ double[] targetPosition;
+ GuidePTZ guidePTZ;
+}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuidePTZ.java b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuidePTZ.java
new file mode 100644
index 0000000..064825f
--- /dev/null
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GuidePTZ.java
@@ -0,0 +1,23 @@
+package com.ruoyi.alarm.global.domain;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description:
+ * @ClassName: GuidePTZ
+ * @Author: 鍒樿嫃涔�
+ * @Date: 2023骞�12鏈�09鏃�10:13:28
+ **/
+@Data
+@Accessors(chain = true)
+public class GuidePTZ {
+ /** 寮曞P鍊� */
+ private Double P;
+
+ /** 寮曞T鍊� */
+ private Double T;
+
+ /** 寮曞Z鍊� */
+ private Double Z;
+}
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 bf1ac65..5b65e69 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
@@ -53,4 +53,8 @@
* 寮曞鐩爣缁忕含搴�
*/
double[] targetPosition;
+
+ /** 寮曞PTZ鍊� */
+ private GuidePTZ guidePTZ;
+
}
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 1d710a9..588c3f5 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
@@ -11,10 +11,7 @@
import com.ruoyi.alarm.digitization3.mapper.ArdAlarmDigitization3Mapper;
import com.ruoyi.alarm.external.domain.ArdAlarmExternal;
import com.ruoyi.alarm.external.mapper.ArdAlarmExternalMapper;
-import com.ruoyi.alarm.global.domain.GlobalAlarmCondition;
-import com.ruoyi.alarm.global.domain.GlobalAlarmData;
-import com.ruoyi.alarm.global.domain.GuidePriorityQueue;
-import com.ruoyi.alarm.global.domain.GuideTask;
+import com.ruoyi.alarm.global.domain.*;
import com.ruoyi.alarm.global.service.IGlobalAlarmService;
import com.ruoyi.alarm.radar.domain.*;
import com.ruoyi.alarm.radar.mapper.ArdAlarmRadarFireMapper;
@@ -35,13 +32,11 @@
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper;
import com.ruoyi.common.constant.CacheConstants;
-import com.ruoyi.common.core.domain.entity.SysConfig;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.ConfigUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.device.camera.domain.CameraCmd;
import com.ruoyi.device.external.domain.ArdEquipExternal;
import com.ruoyi.device.external.mapper.ArdEquipExternalMapper;
import com.ruoyi.device.radar.mapper.ArdEquipRadarMapper;
@@ -54,14 +49,12 @@
import com.ruoyi.utils.tube.GeoPoint;
import com.ruoyi.utils.tube.TubeTools;
import lombok.extern.slf4j.Slf4j;
-import org.gavaghan.geodesy.GlobalCoordinates;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
-import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -73,7 +66,7 @@
* @Version: 1.0
**/
@Service
-@Slf4j(topic = "mqtt")
+@Slf4j(topic = "alarm")
public class GlobalAlarmServiceImpl implements IGlobalAlarmService {
//region 渚濊禆娉ㄥ叆
@Resource
@@ -1039,9 +1032,17 @@
return;
}
double[] coordinate = new double[]{longitude, latitude};
- String nearbyCameraId = getNearbyCamera(new double[]{ardAlarmTube.getLongitude(), ardAlarmTube.getLatitude()});
- if (StringUtils.isNotEmpty(nearbyCameraId)) {
- messagesEnqueued(nearbyCameraId, ardAlarmTube.getId(), "sys_tube_leak", ardAlarmTube.getCreateTime(), 1, 1, coordinate);
+ String cameraId = getCameraByNear(new double[]{ardAlarmTube.getLongitude(), ardAlarmTube.getLatitude()});
+ if (StringUtils.isNotEmpty(cameraId)) {
+ GuideDataDto guideDataDto = new GuideDataDto()
+ .setAlarmId(cameraId)
+ .setAlarmId(ardAlarmTube.getId())
+ .setAlarmType("sys_tube_leak")
+ .setReceiveTime(ardAlarmTube.getCreateTime())
+ .setNum(1)
+ .setRecordSn(1)
+ .setTargetPosition(coordinate);
+ messagesEnqueued(guideDataDto);
}
//endregion
}
@@ -1061,7 +1062,7 @@
case "radar":
//region 澶勭悊闆疯揪鎶ヨ
String mergeTime = ConfigUtils.getConfigValue("radarMergeTime");
- Integer radarMergeTime= mergeTime==null||"".equals(mergeTime)?10:Integer.valueOf(mergeTime);
+ Integer radarMergeTime = mergeTime == null || "".equals(mergeTime) ? 10 : Integer.valueOf(mergeTime);
RadarAlarmData radarAlarmData = JSONObject.parseObject(message, RadarAlarmData.class);
List<ArdAlarmRadar> ardAlarmRadars = radarAlarmData.getArdAlarmRadars();
for (ArdAlarmRadar ardAlarmRadar : ardAlarmRadars) {
@@ -1069,13 +1070,16 @@
String radarId = radarAlarmData.getRadarId();
String alarmpointName = ardAlarmRadar.getName();//鍏磋叮鐐瑰悕绉�
ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(alarmpointName);
- if(well==null)
- {
+ if (well == null) {
return;
}
+ Double guideP = well.getGuideP();
+ Double guideT = well.getGuideT();
+ Double guideZ = well.getGuideZ();
Double longitude = well.getLongitude();
Double latitude = well.getLatitude();
String targetId = ardAlarmRadar.getTargetId();
+ GuidePTZ guidePTZ = new GuidePTZ();
switch (ardAlarmRadar.getAlarmType()) {
case "杩愬姩鐩爣妫�娴�":
ArdAlarmRadarMove ardAlarmRadarMove = new ArdAlarmRadarMove();
@@ -1089,6 +1093,11 @@
ardAlarmRadarMove.setLatitude(latitude);
ardAlarmRadarMove.setUpdateTime(radarAlarmData.getAlarmTime());
ardAlarmRadarMove.setRadarId(radarId);
+
+ guidePTZ.setP(guideP);
+ guidePTZ.setT(guideT);
+ guidePTZ.setZ(guideZ);
+ ardAlarmRadarMove.setGuidePTZ(guidePTZ);
Date alarmTime = ardAlarmRadarMove.getAlarmTime();
//鑾峰彇褰撳墠鍏磋叮鐐瑰綋鍓嶉浄杈剧殑涓婁竴鏉℃暟鎹�
ArdAlarmRadarMove lastMoveData = ardAlarmRadarMoveMapper.selectArdAlarmRadarLastData(ardAlarmRadarMove.getName());
@@ -1101,7 +1110,7 @@
//鍚﹀垯姣斿鏇存柊鏃堕棿
Date lastUpdateTime = lastMoveData.getUpdateTime();
Date lastGuideTime = lastMoveData.getGuideTime();
- long secDatePoor = DateUtils.getSecDatePoor(alarmTime,lastUpdateTime);
+ long secDatePoor = DateUtils.getSecDatePoor(alarmTime, lastUpdateTime);
if (secDatePoor <= radarMergeTime) {
//灏忎簬10绉掔殑鏂版暟鎹紝鏇存柊涓婁竴鏉�
ArdAlarmRadarMove updateData = new ArdAlarmRadarMove();
@@ -1109,9 +1118,8 @@
updateData.setUpdateTime(alarmTime);
//鍒ゆ柇寮曞鏃堕棿瓒呰繃5鍒嗛挓鍐嶆寮曞
- long secDatePoorGuide = DateUtils.getSecDatePoor(alarmTime,lastGuideTime);
- if(secDatePoorGuide>=300)
- {
+ long secDatePoorGuide = DateUtils.getSecDatePoor(alarmTime, lastGuideTime);
+ if (secDatePoorGuide >= 300) {
updateData.setGuideTime(alarmTime);
radarMoveGuide(ardAlarmRadarMove);//寮曞
}
@@ -1142,6 +1150,10 @@
ardAlarmRadarFire.setAlarmType("鐑簮妫�娴�");
ardAlarmRadarFire.setLongitude(longitude);
ardAlarmRadarFire.setLatitude(latitude);
+ guidePTZ.setP(guideP);
+ guidePTZ.setT(guideT);
+ guidePTZ.setZ(guideZ);
+ ardAlarmRadarFire.setGuidePTZ(guidePTZ);
ardAlarmRadarFire.setRadarId(radarId);
ardAlarmRadarFire.setUpdateTime(radarAlarmData.getAlarmTime());
//
@@ -1155,9 +1167,8 @@
} else {
//鍚﹀垯姣斿鏇存柊鏃堕棿
Date lastUpdateTime = lastFireData.getUpdateTime();
-
Date lastGuideTime = lastFireData.getGuideTime();
- long secDatePoor = DateUtils.getSecDatePoor(alarmTime,lastUpdateTime);
+ long secDatePoor = DateUtils.getSecDatePoor(alarmTime, lastUpdateTime);
if (secDatePoor <= radarMergeTime) {
//灏忎簬10绉掔殑鏂版暟鎹紝鏇存柊涓婁竴鏉�
ArdAlarmRadarFire updateData = new ArdAlarmRadarFire();
@@ -1165,9 +1176,8 @@
updateData.setUpdateTime(alarmTime);
//鍒ゆ柇寮曞鏃堕棿瓒呰繃5鍒嗛挓鍐嶆寮曞
- long secDatePoorGuide = DateUtils.getSecDatePoor(alarmTime,lastGuideTime);
- if(secDatePoorGuide>=300)
- {
+ long secDatePoorGuide = DateUtils.getSecDatePoor(alarmTime, lastGuideTime);
+ if (secDatePoorGuide >= 300) {
updateData.setGuideTime(alarmTime);
radarFireGuide(ardAlarmRadarFire);//寮曞
}
@@ -1191,11 +1201,12 @@
ardAlarmRadarPump.setAlarmType("闆疯揪鎶芥补鏈哄仠鏈�");
ardAlarmRadarPump.setUpdateTime(radarAlarmData.getAlarmTime());
alarmTime = ardAlarmRadarPump.getAlarmTime();
- ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(alarmpointName);
- if (StringUtils.isNotNull(ardAlarmpointsWell)) {
- ardAlarmRadarPump.setLongitude(ardAlarmpointsWell.getLongitude());
- ardAlarmRadarPump.setLatitude(ardAlarmpointsWell.getLatitude());
- }
+ ardAlarmRadarPump.setLongitude(well.getLongitude());
+ ardAlarmRadarPump.setLatitude(well.getLatitude());
+ guidePTZ.setP(guideP);
+ guidePTZ.setT(guideT);
+ guidePTZ.setZ(guideZ);
+ ardAlarmRadarPump.setGuidePTZ(guidePTZ);
//
ArdAlarmRadarPump lastPumpData = ardAlarmRadarPumpMapper.selectArdAlarmRadarLastData(ardAlarmRadarPump.getName());
if (lastPumpData == null) {
@@ -1207,16 +1218,15 @@
//鍚﹀垯姣斿鏇存柊鏃堕棿
Date lastUpdateTime = lastPumpData.getUpdateTime();
Date lastGuideTime = lastPumpData.getGuideTime();
- long secDatePoor = DateUtils.getSecDatePoor(alarmTime,lastUpdateTime);
+ long secDatePoor = DateUtils.getSecDatePoor(alarmTime, lastUpdateTime);
if (secDatePoor <= radarMergeTime) {
//灏忎簬10绉掔殑鏂版暟鎹紝鏇存柊涓婁竴鏉�
ArdAlarmRadarPump updateData = new ArdAlarmRadarPump();
updateData.setId(lastPumpData.getId());
updateData.setUpdateTime(alarmTime);
//鍒ゆ柇寮曞鏃堕棿瓒呰繃5鍒嗛挓鍐嶆寮曞
- long secDatePoorGuide = DateUtils.getSecDatePoor(alarmTime,lastGuideTime);
- if(secDatePoorGuide>=300)
- {
+ long secDatePoorGuide = DateUtils.getSecDatePoor(alarmTime, lastGuideTime);
+ if (secDatePoorGuide >= 300) {
radarPumpGuide(ardAlarmRadarPump);//寮曞
updateData.setGuideTime(alarmTime);
}
@@ -1240,10 +1250,10 @@
ardAlarmExternal.setCreateTime(new Date());//鎺ユ敹鏃堕棿
//澶栬仈闃插尯鍚嶇О灏辨槸鍏磋叮鐐癸紝鏌ュ叴瓒g偣鍧愭爣
String defenseName = ardAlarmExternal.getDefenseName();
- ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(defenseName);
- if (StringUtils.isNotNull(ardAlarmpointsWell)) {
- ardAlarmExternal.setLongitude(ardAlarmpointsWell.getLongitude());
- ardAlarmExternal.setLatitude(ardAlarmpointsWell.getLatitude());
+ ArdAlarmpointsWell well = ardAlarmpointsWellMapper.selectArdAlarmpointsWellByWellId(defenseName);
+ if (StringUtils.isNotNull(well)) {
+ ardAlarmExternal.setLongitude(well.getLongitude());
+ ardAlarmExternal.setLatitude(well.getLatitude());
}
int aae = ardAlarmExternalMapper.insertArdAlarmExternal(ardAlarmExternal);
if (aae > 0) {
@@ -1252,10 +1262,23 @@
if (StringUtils.isNull(ardAlarmExternal.getLongitude()) || StringUtils.isNull(ardAlarmExternal.getLatitude())) {
return;
}
- double[] guideCoordinate = new double[]{ardAlarmExternal.getLongitude(), ardAlarmExternal.getLatitude()};//寮曞鍧愭爣
- String nearbyCameraId = getNearbyCamera(guideCoordinate);//鏈�杩戠浉鏈篒D
- if (StringUtils.isNotEmpty(nearbyCameraId)) {
- messagesEnqueued(nearbyCameraId, ardAlarmExternal.getId(), "sys_external", ardAlarmExternal.getCreateTime(), 1, 1, guideCoordinate);
+ double[] coordinate = new double[]{ardAlarmExternal.getLongitude(), ardAlarmExternal.getLatitude()};//寮曞鍧愭爣
+ GuidePTZ guidePTZ = new GuidePTZ()
+ .setP(well.getGuideP())
+ .setT(well.getGuideT())
+ .setZ(well.getGuideZ());
+ String cameraId = getCameraByNear(coordinate);//鏈�杩戠浉鏈篒D
+ if (StringUtils.isNotEmpty(cameraId)) {
+ GuideDataDto guideDataDto = new GuideDataDto()
+ .setAlarmId(cameraId)
+ .setAlarmId(ardAlarmExternal.getId())
+ .setAlarmType("sys_external")
+ .setReceiveTime(ardAlarmExternal.getCreateTime())
+ .setNum(1)
+ .setRecordSn(1)
+ .setTargetPosition(coordinate)
+ .setGuidePTZ(guidePTZ);
+ messagesEnqueued(guideDataDto);
}
//endregion
}
@@ -1283,10 +1306,18 @@
if (StringUtils.isNull(ardAlarmAccess.getLongitude()) || StringUtils.isNull(ardAlarmAccess.getLatitude())) {
return;
}
- double[] guideCoordinate = new double[]{ardAlarmAccess.getLongitude(), ardAlarmAccess.getLatitude()};//寮曞鍧愭爣
- String nearbyCameraId = getNearbyCamera(guideCoordinate);//鏈�杩戠浉鏈篒D
- if (StringUtils.isNotEmpty(nearbyCameraId)) {
- messagesEnqueued(nearbyCameraId, ardAlarmAccess.getId(), "sys_access_control", ardAlarmAccess.getCreateTime(), 1, 1, guideCoordinate);
+ double[] coordinate = new double[]{ardAlarmAccess.getLongitude(), ardAlarmAccess.getLatitude()};//寮曞鍧愭爣
+ String cameraId = getCameraByNear(coordinate);//鏈�杩戠浉鏈篒D
+ if (StringUtils.isNotEmpty(cameraId)) {
+ GuideDataDto guideDataDto = new GuideDataDto()
+ .setAlarmId(cameraId)
+ .setAlarmId(ardAlarmAccess.getId())
+ .setAlarmType("sys_external")
+ .setReceiveTime(ardAlarmAccess.getCreateTime())
+ .setNum(1)
+ .setRecordSn(1)
+ .setTargetPosition(coordinate);
+ messagesEnqueued(guideDataDto);
}
//endregion
}
@@ -1345,8 +1376,10 @@
* recordSn 褰曞儚瀛樺偍浣嶇疆 1-recordUrl1 2-recordUrl2
* targetPosition 鎶ヨ鐐逛綅缃潗鏍�
*/
- private void messagesEnqueued(String cameraId, String alarmId, String alarmType, Date receiveTime, Integer num, Integer recordSn, double[] targetPosition) {
+ private void messagesEnqueued(GuideDataDto guideDataDto) {
try {
+ String cameraId = guideDataDto.getCameraId();
+ String alarmType = guideDataDto.getAlarmType();
if (!IsEnableGuide(cameraId)) {
log.info("鐩告満:" + cameraId + "鏈紑鍚姤璀﹀紩瀵煎姛鑳�");
return;
@@ -1356,43 +1389,43 @@
//鐩告満ID
guideTask.setCameraId(cameraId);
//鎶ヨ绫诲瀷
- String aType = "";
switch (alarmType) {
case "杩愬姩鐩爣妫�娴�":
- aType = "sys_radar_move";
+ alarmType = "sys_radar_move";
break;
case "鐑簮妫�娴�":
- aType = "sys_radar_fire";
+ alarmType = "sys_radar_fire";
break;
case "闆疯揪鎶芥补鏈哄仠鏈�":
- aType = "sys_radar_pump";
- break;
- default:
- aType = alarmType;
+ alarmType = "sys_radar_pump";
break;
}
- guideTask.setAlarmType(aType);
+ guideTask.setAlarmType(alarmType);
//閫氶亾(閫氳繃鏃ュ鏃堕棿鐮斿垽)
String dayNightTime = redisCache.getCacheObject("sys_config:dayNightTime");
Integer channel = ArdTool.getChannelBydayNightTime(dayNightTime);
guideTask.setChanNum(channel);
//鎶ヨID
- guideTask.setAlarmId(alarmId);
+ guideTask.setAlarmId(guideDataDto.getAlarmId());
//鎺ユ敹鏃堕棿
- guideTask.setReceiveTime(fmt.format(receiveTime));
+ guideTask.setReceiveTime(fmt.format(guideDataDto.getReceiveTime()));
//鎶ヨ浼樺厛绾�(閫氳繃浼樺厛绾у瓧鍏�)
- String priority = DictUtils.getDictValue("cameras_priority", aType);
+ String priority = DictUtils.getDictValue("cameras_priority", alarmType);
if (StringUtils.isEmpty(priority)) {
log.debug("鏈尮閰嶅埌浼樺厛绾�,璇锋鏌ヤ紭鍏堢骇瀛楀吀閰嶇疆");
return;
}
guideTask.setPriority(Integer.valueOf(priority));
//鎶ヨ娆℃暟
- guideTask.setNum(num);
+ guideTask.setNum(guideDataDto.getNum());
//褰曞儚瀛樺偍浣嶇疆
- guideTask.setRecordSn(recordSn);
+ guideTask.setRecordSn(guideDataDto.getRecordSn());
//鐩爣缁忕含搴�
- guideTask.setTargetPosition(targetPosition);
+ guideTask.setTargetPosition(guideDataDto.getTargetPosition());
+ //鐩爣PTZ
+ if (guideDataDto.getGuidePTZ() != null) {
+ guideTask.setGuidePTZ(guideDataDto.getGuidePTZ());
+ }
//娑堟伅鍏ラ槦
queueManager.addTaskToQueue(cameraId, guideTask);
//鎵撳嵃闃熷垪
@@ -1421,7 +1454,7 @@
/**
* 鑾峰彇闄勮繎寮�鍚姤璀﹀紩瀵煎姛鑳藉厜鐢�
*/
- private String getNearbyCamera(double[] targetPosition) {
+ private String getCameraByNear(double[] targetPosition) {
String minDistanceCameraId = "";
try {
//鑾峰彇鎵�鏈夊ぇ鍏夌數
@@ -1459,16 +1492,17 @@
return minDistanceCameraId;
}
- //闆疯揪鑾峰彇鐩告満寮曞鍏ラ槦
- private void radarGuideToQueue(String alarmId, String radarId, String name, String alarmType, Date createTime, double[] coordinate) {
- int index = name.indexOf("(");
- String alarmpointName = name.substring(0, index);
+ //鑾峰彇鐩告満寮曞鍏ラ槦
+ private void getCameraGuideToQueue(GuideDataDto guideDataDto) {
+ int index = guideDataDto.getName().indexOf("(");
+ String alarmpointName = guideDataDto.getName().substring(0, index);
//鑾峰彇闆疯揪鎵�鍦ㄥ涓婄殑澶у厜鐢�
- ArdCameras cameraWithTower = ardEquipRadarMapper.getCameraByRadar(radarId);
+ ArdCameras cameraWithTower = ardEquipRadarMapper.getCameraByRadar(guideDataDto.getRadarId());
if (StringUtils.isNotNull(cameraWithTower)) {
log.debug("鑾峰彇鍒伴浄杈惧涓婄殑鍏夌數:" + cameraWithTower.getId());
//濡傛灉闆疯揪濉斾笂鏈夊厜鐢�
- messagesEnqueued(cameraWithTower.getId(), alarmId, alarmType, createTime, 1, 1, coordinate);
+ guideDataDto.setCameraId(cameraWithTower.getId());
+ messagesEnqueued(guideDataDto);
} else {
log.debug("鏈幏鍙栧埌闆疯揪濉斾笂鐨勫厜鐢�,鏃犳硶寮曞");
}
@@ -1479,13 +1513,16 @@
if (cameraId.equals(cameraWithTower.getId())) {
return;
}
- log.info("鑾峰彇鍒版姤璀︾偣鍏宠仈鐨勫厜鐢�:" + cameraId);
+ log.debug("鑾峰彇鍒版姤璀︾偣鍏宠仈鐨勫厜鐢�:" + cameraId);
//濡傛灉鎶ヨ鐐瑰叧鑱斾簡鍏夌數
- messagesEnqueued(cameraId, alarmId, alarmType, createTime, 1, 2, coordinate);
+ guideDataDto.setCameraId(cameraId);
+ guideDataDto.setRecordSn(2);//鍏磋叮鐐瑰厜鐢靛紩瀵煎綍鍍忓瓨鍌ㄧ浜屼釜璺緞
+ messagesEnqueued(guideDataDto);
} else {
log.debug("鏈幏鍙栧埌鎶ヨ鐐瑰叧鑱旂殑鍏夌數,鏃犳硶寮曞");
}
}
+
//闆疯揪绉诲姩寮曞
private void radarMoveGuide(ArdAlarmRadarMove ardAlarmRadarMove) {
log.debug("闆疯揪绉诲姩寮�濮嬪紩瀵�");
@@ -1495,8 +1532,19 @@
}
double[] coordinate = new double[]{ardAlarmRadarMove.getLongitude(), ardAlarmRadarMove.getLatitude()};//鎶ヨ鍧愭爣
//寮曞鍏ラ槦
- radarGuideToQueue(ardAlarmRadarMove.getId(), ardAlarmRadarMove.getRadarId(), ardAlarmRadarMove.getName(), ardAlarmRadarMove.getAlarmType(), ardAlarmRadarMove.getCreateTime(), coordinate);//鏇存柊
+ GuideDataDto guideDataDto = new GuideDataDto()
+ .setRadarId( ardAlarmRadarMove.getRadarId())
+ .setName(ardAlarmRadarMove.getName())
+ .setAlarmId(ardAlarmRadarMove.getId())
+ .setAlarmType(ardAlarmRadarMove.getAlarmType())
+ .setReceiveTime(ardAlarmRadarMove.getCreateTime())
+ .setNum(1)
+ .setRecordSn(1)
+ .setTargetPosition(coordinate)
+ .setGuidePTZ(ardAlarmRadarMove.getGuidePTZ());
+ getCameraGuideToQueue(guideDataDto);//鑾峰彇鐩告満鍏ラ槦
}
+
//闆疯揪闃茬伀寮曞
private void radarFireGuide(ArdAlarmRadarFire ardAlarmRadarFire) {
log.debug("闆疯揪闃茬伀寮�濮嬪紩瀵�");
@@ -1506,8 +1554,19 @@
}
double[] coordinate = new double[]{ardAlarmRadarFire.getLongitude(), ardAlarmRadarFire.getLatitude()};//鎶ヨ鍧愭爣
//寮曞鍏ラ槦
- radarGuideToQueue(ardAlarmRadarFire.getId(), ardAlarmRadarFire.getRadarId(), ardAlarmRadarFire.getName(), ardAlarmRadarFire.getAlarmType(), ardAlarmRadarFire.getCreateTime(), coordinate);//鏇存柊
+ GuideDataDto guideDataDto = new GuideDataDto()
+ .setRadarId( ardAlarmRadarFire.getRadarId())
+ .setName(ardAlarmRadarFire.getName())
+ .setAlarmId(ardAlarmRadarFire.getId())
+ .setAlarmType(ardAlarmRadarFire.getAlarmType())
+ .setReceiveTime(ardAlarmRadarFire.getCreateTime())
+ .setNum(1)
+ .setRecordSn(1)
+ .setTargetPosition(coordinate)
+ .setGuidePTZ(ardAlarmRadarFire.getGuidePTZ());
+ getCameraGuideToQueue(guideDataDto);//鑾峰彇鐩告満鍏ラ槦
}
+
//闆疯揪鎶芥补鏈哄仠鏈哄紩瀵�
private void radarPumpGuide(ArdAlarmRadarPump ardAlarmRadarPump) {
log.debug("闆疯揪鎶芥补鏈哄仠鏈哄紑濮嬪紩瀵�");
@@ -1518,7 +1577,16 @@
}
double[] coordinate = new double[]{ardAlarmRadarPump.getLongitude(), ardAlarmRadarPump.getLatitude()};//鎶ヨ鍧愭爣
//寮曞鍏ラ槦
- radarGuideToQueue(ardAlarmRadarPump.getId(), ardAlarmRadarPump.getRadarId(), ardAlarmRadarPump.getName(), ardAlarmRadarPump.getAlarmType(), ardAlarmRadarPump.getCreateTime(), coordinate);//鏇存柊
+ GuideDataDto guideDataDto = new GuideDataDto()
+ .setRadarId( ardAlarmRadarPump.getRadarId())
+ .setName(ardAlarmRadarPump.getName())
+ .setAlarmId(ardAlarmRadarPump.getId())
+ .setAlarmType(ardAlarmRadarPump.getAlarmType())
+ .setReceiveTime(ardAlarmRadarPump.getCreateTime())
+ .setNum(1)
+ .setRecordSn(1)
+ .setTargetPosition(coordinate)
+ .setGuidePTZ(ardAlarmRadarPump.getGuidePTZ());
+ getCameraGuideToQueue(guideDataDto);//鑾峰彇鐩告満鍏ラ槦
}
-
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueTaskExecutor.java b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueTaskExecutor.java
index fd48181..9b45bf5 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueTaskExecutor.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueTaskExecutor.java
@@ -20,6 +20,8 @@
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.Map;
/**
* @ClassName QueueTaskExecutor
@@ -57,6 +59,11 @@
cmd.setOperator(guideTask.getAlarmType());
cmd.setExpired(30);
cmd.setRecordBucketName("record");
+ Map<String, Double> ptzMap = new HashMap<>();
+ ptzMap.put("p", guideTask.getGuidePTZ().getP());
+ ptzMap.put("t", guideTask.getGuidePTZ().getT());
+ ptzMap.put("z", guideTask.getGuidePTZ().getZ());
+ cmd.setPtzMap(ptzMap);
if (guideTask.getRecordSn().equals(1)) {
cmd.setRecordObjectName("alarm_" + guideTask.getAlarmId() + "_1");
} else {
@@ -64,7 +71,13 @@
}
log.debug("寮�濮嬪紩瀵�");
- boolean guideRes = cameraSdkService.guideTargetPosition(cmd);
+ boolean guideRes = false;
+ if (cmd.getPtzMap().get("p") != null) {
+ //p鍊煎瓨鍦� 浼樺厛寮曞ptz
+ guideRes = cameraSdkService.setPtz(cmd);
+ } else {
+ guideRes = cameraSdkService.guideTargetPosition(cmd);
+ }
if (guideRes) {
log.debug("寮曞鎴愬姛");
cameraSdkService.controlLock(cmd);//涓婇攣
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 661231e..a3bac6a 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
@@ -2,6 +2,7 @@
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.alarm.global.domain.GuidePTZ;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -85,6 +86,8 @@
*/
private String radarId;
+ /** 寮曞PTZ鍊� */
+ private GuidePTZ guidePTZ;
}
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 c86db63..e8eac9d 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
@@ -2,6 +2,7 @@
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.alarm.global.domain.GuidePTZ;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -85,5 +86,7 @@
private String RadarId;
+ /** 寮曞PTZ鍊� */
+ private GuidePTZ guidePTZ;
}
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 453adc6..82af9b6 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
@@ -1,7 +1,9 @@
package com.ruoyi.alarm.radar.domain;
import java.util.Date;
+
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.alarm.global.domain.GuidePTZ;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -10,63 +12,88 @@
/**
* 闆疯揪鎶芥补鏈哄仠鏈烘姤璀﹀璞� ard_alarm_radar_pump
- *
+ *
* @author ard
* @date 2023-09-02
*/
@Data
-public class ArdAlarmRadarPump extends BaseEntity
-{
+public class ArdAlarmRadarPump extends BaseEntity {
private static final long serialVersionUID = 1L;
- /** 璁板綍ID */
+ /**
+ * 璁板綍ID
+ */
private String id;
- /** 鍏磋叮鐐瑰悕绉� */
+ /**
+ * 鍏磋叮鐐瑰悕绉�
+ */
@Excel(name = "鍏磋叮鐐瑰悕绉�")
private String name;
- /** 鐩爣ID */
+ /**
+ * 鐩爣ID
+ */
@Excel(name = "鐩爣ID")
private String targetId;
- /** 鎶ヨ绫诲瀷 */
+ /**
+ * 鎶ヨ绫诲瀷
+ */
@Excel(name = "鎶ヨ绫诲瀷")
private String alarmType;
- /** 鎶ヨ鏃堕棿 */
+ /**
+ * 鎶ヨ鏃堕棿
+ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "鎶ヨ鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date alarmTime;
- /** 缁忓害 */
+ /**
+ * 缁忓害
+ */
@Excel(name = "缁忓害")
private Double longitude;
- /** 绾害 */
+ /**
+ * 绾害
+ */
@Excel(name = "绾害")
private Double latitude;
- /** 寮曞褰曞儚1 */
+ /**
+ * 寮曞褰曞儚1
+ */
@Excel(name = "寮曞褰曞儚1")
private String recordUrl1;
- /** 寮曞褰曞儚2 */
+ /**
+ * 寮曞褰曞儚2
+ */
@Excel(name = "寮曞褰曞儚2")
private String recordUrl2;
- /** 鏌ョ湅鏃堕棿 */
+ /**
+ * 鏌ョ湅鏃堕棿
+ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "鏌ョ湅鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date viewTime;
- /** 鐢ㄦ埛ID */
+ /**
+ * 鐢ㄦ埛ID
+ */
@Excel(name = "鐢ㄦ埛ID")
private String userId;
- /** 閮ㄩ棬ID */
+ /**
+ * 閮ㄩ棬ID
+ */
@Excel(name = "閮ㄩ棬ID")
private Long deptId;
- /** 寮曞鏃堕棿 */
+ /**
+ * 寮曞鏃堕棿
+ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "寮曞鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date guideTime;
@@ -84,4 +111,9 @@
* 闆疯揪ID
*/
private String radarId;
+ /**
+ * 寮曞PTZ鍊�
+ */
+ private GuidePTZ guidePTZ;
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/steal/service/impl/IStealElecAlarmServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarm/steal/service/impl/IStealElecAlarmServiceImpl.java
index 183cc2b..62c0189 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/steal/service/impl/IStealElecAlarmServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/steal/service/impl/IStealElecAlarmServiceImpl.java
@@ -25,7 +25,7 @@
* @Date 2022/12/26 16:34
* @Version 1.0
*/
-@Slf4j(topic = "stealAlarm")
+@Slf4j(topic = "alarm")
@Service
public class IStealElecAlarmServiceImpl implements IStealElecAlarmService {
@Resource
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWell.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWell.java
index b9be340..46dc005 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWell.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/domain/ArdAlarmpointsWell.java
@@ -101,6 +101,17 @@
/** 鍏宠仈鐩告満ID */
private String cameraId;
+ /** 寮曞P鍊� */
+ private Double guideP;
+
+ /** 寮曞T鍊� */
+ private Double guideT;
+
+ /** 寮曞Z鍊� */
+ private Double guideZ;
+
@TableField(exist = false)
private String type;
+
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java b/ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java
index 3ca1966..fa639b2 100644
--- a/ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/inspect/service/impl/ArdVideoInspectTaskServiceImpl.java
@@ -1,6 +1,7 @@
package com.ruoyi.inspect.service.impl;
import java.util.*;
+
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper;
import com.ruoyi.common.utils.DateUtils;
@@ -21,6 +22,7 @@
import com.ruoyi.inspect.mapper.ArdVideoInspectTaskMapper;
import com.ruoyi.inspect.domain.ArdVideoInspectTask;
import com.ruoyi.inspect.service.IArdVideoInspectTaskService;
+
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
@@ -440,9 +442,8 @@
targetPositon[2] = ardAlarmpointsWell.getAltitude();
/*鑾峰彇鐩告満鍧愭爣*/
ArdCameras cameras = ardCamerasMapper.selectArdCamerasById(cameraId);
- if(StringUtils.isNull(cameras))
- {
- log.debug("鎵句笉鍒扮浉鏈�:"+cameraId);
+ if (StringUtils.isNull(cameras)) {
+ log.debug("鎵句笉鍒扮浉鏈�:" + cameraId);
return;
}
double[] cameraPositon = new double[3];
@@ -456,7 +457,17 @@
cmd.setTargetPosition(targetPositon);
cmd.setOperator("sys_patrol_inspect");
cmd.setExpired(step.getRecordingTime() * 60);
- boolean setTargetPosition = cameraSdkService.guideTargetPosition(cmd);
+ Map<String, Double> ptzMap = new HashMap<>();
+ ptzMap.put("p", ardAlarmpointsWell.getGuideP());
+ ptzMap.put("t", ardAlarmpointsWell.getGuideT());
+ ptzMap.put("z", ardAlarmpointsWell.getGuideZ());
+ cmd.setPtzMap(ptzMap);
+ boolean setTargetPosition;
+ if (cmd.getPtzMap().get("p") != null) {
+ setTargetPosition = cameraSdkService.setPtz(cmd);
+ } else {
+ setTargetPosition = cameraSdkService.guideTargetPosition(cmd);
+ }
if (setTargetPosition) {
/*鎺у埗鐩告満宸℃鎴愬姛锛屽紑濮嬪綍鍍�*/
cameraSdkService.recordStart(cmd);
@@ -498,9 +509,8 @@
targetPositon[2] = ardAlarmpointsWell.getAltitude();
/*鑾峰彇鐩告満鍧愭爣*/
ArdCameras cameras = ardCamerasMapper.selectArdCamerasById(cameraId);
- if(StringUtils.isNull(cameras))
- {
- log.debug("鎵句笉鍒扮浉鏈�:"+cameraId);
+ if (StringUtils.isNull(cameras)) {
+ log.debug("鎵句笉鍒扮浉鏈�:" + cameraId);
return;
}
double[] cameraPositon = new double[3];
@@ -514,7 +524,17 @@
cmd.setTargetPosition(targetPositon);
cmd.setOperator("sys_patrol_inspect");
cmd.setExpired(step.getRecordingTime() * 60);
- boolean setTargetPosition = cameraSdkService.guideTargetPosition(cmd);
+ Map<String, Double> ptzMap = new HashMap<>();
+ ptzMap.put("p", ardAlarmpointsWell.getGuideP());
+ ptzMap.put("t", ardAlarmpointsWell.getGuideT());
+ ptzMap.put("z", ardAlarmpointsWell.getGuideZ());
+ cmd.setPtzMap(ptzMap);
+ boolean setTargetPosition;
+ if (cmd.getPtzMap().get("p") != null) {
+ setTargetPosition = cameraSdkService.setPtz(cmd);
+ } else {
+ setTargetPosition = cameraSdkService.guideTargetPosition(cmd);
+ }
if (!setTargetPosition) {
/*鎺у埗澶辫触,褰撳墠姝ラ鍚姩鏃堕棿缃畁ull*/
ardVideoInspectTask.setCurrentStepStartTime("");
@@ -649,6 +669,7 @@
/**
* 鑾峰彇鐩告満鐨勭┖闂叉椂娈�
+ *
* @param cameraId
* @return
*/
diff --git a/ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/service/impl/HikvisionSDK.java b/ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/service/impl/HikvisionSDK.java
index 7c36f42..8c89a46 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/service/impl/HikvisionSDK.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/sdk/hiksdk/service/impl/HikvisionSDK.java
@@ -176,6 +176,7 @@
@Async("loginExecutor")
public void asyncLogin(ArdCameras camera) {
try {
+ Thread.sleep(100);
// 鍒濆鍖�
if (!hCNetSDK.NET_DVR_Init()) {
log.error("SDK鍒濆鍖栧け璐�");
@@ -214,7 +215,7 @@
//鍚屾鐧诲綍
int lUserID = hCNetSDK.NET_DVR_Login_V40(m_strLoginInfo, m_strDeviceInfo);
if (lUserID < 0) {
- log.debug("Login Failed [ " + camera.getIp() + ":" + camera.getPort() + " ],閿欒鐮侊細" + hCNetSDK.NET_DVR_GetLastError());
+ log.debug("Login Failed 銆� " + camera.getIp() + ":" + camera.getPort() + " 銆�,Error Code锛�" + hCNetSDK.NET_DVR_GetLastError());
camera.setChanNum(0);
camera.setLoginId(-1);
camera.setState("0");
@@ -224,7 +225,7 @@
return;
}
- log.debug("Login Success [ " + camera.getIp() + ":" + camera.getPort() + " ]");
+ log.debug("Login Success 銆� " + camera.getIp() + ":" + camera.getPort() + " 銆�");
if (fExceptionCallBack == null) {
fExceptionCallBack = new ExceptionCallBack();//寮傚父鍥炶皟
//璁剧疆寮傚父鍥炶皟鍑芥暟(鍙湪鍥炶皟鍑芥暟涓幏鍙栬澶囦笂涓嬬嚎鐘舵�佺瓑)
diff --git a/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml b/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml
index 3e5dea9..7b997d0 100644
--- a/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml
@@ -29,6 +29,9 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="cameraId" column="camera_id"/>
+ <result property="guideP" column="guide_p"/>
+ <result property="guideT" column="guide_t"/>
+ <result property="guideZ" column="guide_z"/>
</resultMap>
<resultMap type="ArdAlarmpointsWell" id="wellResult">
@@ -61,7 +64,10 @@
c.create_time,
c.update_by,
c.update_time,
- c.camera_id
+ c.camera_id,
+ c.guide_p,
+ c.guide_t,
+ c.guide_z
from ard_alarmpoints_well c
left join sys_dept d on d.dept_id = c.dept_id
left join sys_user u on u.user_id = c.user_id
@@ -127,6 +133,9 @@
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="cameraId != null">camera_id,</if>
+ <if test="guideP != null">guide_p,</if>
+ <if test="guideT != null">guide_t,</if>
+ <if test="guideZ != null">guide_z,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@@ -153,6 +162,9 @@
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="cameraId != null">#{cameraId},</if>
+ <if test="guideP != null">#{guideP},</if>
+ <if test="guideT != null">#{guideT},</if>
+ <if test="guideZ != null">#{guideZ},</if>
</trim>
</insert>
@@ -182,6 +194,9 @@
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="cameraId != null">camera_id = #{cameraId},</if>
+ <if test="guideP != null">guide_p = #{guideP},</if>
+ <if test="guideT != null">guide_t = #{guideT},</if>
+ <if test="guideZ != null">guide_z = #{guideZ},</if>
</trim>
where id = #{id}
</update>
@@ -211,6 +226,9 @@
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="cameraId != null">camera_id = #{cameraId},</if>
+ <if test="guideP != null">guide_p = #{guideP},</if>
+ <if test="guideT != null">guide_t = #{guideT},</if>
+ <if test="guideZ != null">guide_z = #{guideZ},</if>
</trim>
where well_id = #{wellId}
</update>
diff --git a/ruoyi-admin/src/main/resources/logback.xml b/ruoyi-admin/src/main/resources/logback.xml
index 08c2b1c..2e58b01 100644
--- a/ruoyi-admin/src/main/resources/logback.xml
+++ b/ruoyi-admin/src/main/resources/logback.xml
@@ -133,19 +133,6 @@
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
- <!--鐩楃數鎶ヨ鏃ュ織杈撳嚭-->
- <appender name="stealAlarm" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${log.path}/stealAlarm.log</file>
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!--鎸夊ぉ鍥炴粴daily-->
- <fileNamePattern>${log.path}/stealAlarm.%d{yyyy-MM-dd}.log</fileNamePattern>
- <!--鏃ュ織鏈�澶х殑鍘嗗彶60澶�-->
- <maxHistory>60</maxHistory>
- </rollingPolicy>
- <encoder>
- <pattern>${log.pattern}</pattern>
- </encoder>
- </appender>
<!--websocket鎶ヨ鏃ュ織杈撳嚭-->
<appender name="websocket" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/websocket.log</file>
@@ -263,6 +250,19 @@
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
+ <!--鎶ヨ鏃ュ織杈撳嚭-->
+ <appender name="alarm" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.path}/alarm.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <!--鎸夊ぉ鍥炴粴daily-->
+ <fileNamePattern>${log.path}/alarm.%d{yyyy-MM-dd}.log</fileNamePattern>
+ <!--鏃ュ織鏈�澶х殑鍘嗗彶60澶�-->
+ <maxHistory>60</maxHistory>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${log.pattern}</pattern>
+ </encoder>
+ </appender>
<!-- 绯荤粺妯″潡鏃ュ織绾у埆鎺у埗 -->
<logger name="com.ruoyi" level="info"/>
<!-- Spring鏃ュ織绾у埆鎺у埗 -->
@@ -332,12 +332,12 @@
<logger name="guideQueue" level="INFO">
<appender-ref ref="guideQueue"/>
</logger>
- <!--stealAlarm鏃ュ織-->
- <logger name="stealAlarm" level="INFO">
- <appender-ref ref="stealAlarm"/>
- </logger>
- <!--stealAlarm鏃ュ織-->
+ <!--websocket鏃ュ織-->
<logger name="websocket" level="INFO">
<appender-ref ref="websocket"/>
</logger>
+ <!--alarm鏃ュ織-->
+ <logger name="alarm" level="INFO">
+ <appender-ref ref="alarm"/>
+ </logger>
</configuration>
\ No newline at end of file
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
index ff2b1b7..3d1650f 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
@@ -9,22 +9,17 @@
/**
* 瀹夊叏鏈嶅姟宸ュ叿绫�
- *
+ *
* @author ruoyi
*/
-public class SecurityUtils
-{
+public class SecurityUtils {
/**
* 鐢ㄦ埛ID
**/
- public static String getUserId()
- {
- try
- {
+ public static String getUserId() {
+ try {
return getLoginUser().getUserId();
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
throw new ServiceException("鑾峰彇鐢ㄦ埛ID寮傚父", HttpStatus.UNAUTHORIZED);
}
}
@@ -32,29 +27,21 @@
/**
* 鑾峰彇閮ㄩ棬ID
**/
- public static Long getDeptId()
- {
- try
- {
+ public static Long getDeptId() {
+ try {
return getLoginUser().getDeptId();
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
throw new ServiceException("鑾峰彇閮ㄩ棬ID寮傚父", HttpStatus.UNAUTHORIZED);
}
}
-
+
/**
* 鑾峰彇鐢ㄦ埛璐︽埛
**/
- public static String getUsername()
- {
- try
- {
+ public static String getUsername() {
+ try {
return getLoginUser().getUsername();
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
throw new ServiceException("鑾峰彇鐢ㄦ埛璐︽埛寮傚父", HttpStatus.UNAUTHORIZED);
}
}
@@ -62,14 +49,10 @@
/**
* 鑾峰彇鐢ㄦ埛
**/
- public static LoginUser getLoginUser()
- {
- try
- {
+ public static LoginUser getLoginUser() {
+ try {
return (LoginUser) getAuthentication().getPrincipal();
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
throw new ServiceException("鑾峰彇鐢ㄦ埛淇℃伅寮傚父", HttpStatus.UNAUTHORIZED);
}
}
@@ -77,9 +60,8 @@
/**
* 鑾峰彇Authentication
*/
- public static Authentication getAuthentication()
- {
- Authentication authentication= SecurityContextHolder.getContext().getAuthentication();
+ public static Authentication getAuthentication() {
+ Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
return authentication;
}
@@ -89,8 +71,7 @@
* @param password 瀵嗙爜
* @return 鍔犲瘑瀛楃涓�
*/
- public static String encryptPassword(String password)
- {
+ public static String encryptPassword(String password) {
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
return passwordEncoder.encode(password);
}
@@ -98,25 +79,23 @@
/**
* 鍒ゆ柇瀵嗙爜鏄惁鐩稿悓
*
- * @param rawPassword 鐪熷疄瀵嗙爜
+ * @param rawPassword 鐪熷疄瀵嗙爜
* @param encodedPassword 鍔犲瘑鍚庡瓧绗�
* @return 缁撴灉
*/
- public static boolean matchesPassword(String rawPassword, String encodedPassword)
- {
+ public static boolean matchesPassword(String rawPassword, String encodedPassword) {
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
return passwordEncoder.matches(rawPassword, encodedPassword);
}
/**
* 鏄惁涓虹鐞嗗憳
- *
+ *
* @param userId 鐢ㄦ埛ID
* @return 缁撴灉
*/
- public static boolean isAdmin(String userId)
- {
- boolean k= userId != null && userId.equals("1");
+ public static boolean isAdmin(String userId) {
+ boolean k = userId != null && userId.equals("1");
return k;
}
}
--
Gitblit v1.9.3