From 477221bc6d42764831c55797b8ee287207953115 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期一, 18 十二月 2023 15:20:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
bin/clean.bat | 12 ++++++
bin/run.bat | 14 +++++++
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java | 2
bin/package.bat | 12 ++++++
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/QueueHandler.java | 33 +++++++++++++++-
5 files changed, 70 insertions(+), 3 deletions(-)
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 a17c4b9..7db19e7 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
@@ -1269,7 +1269,7 @@
try {
String cameraId = guideDataDto.getCameraId();
if (!IsEnableGuide(cameraId)) {
- log.info("鐩告満:" + cameraId + "鏈紑鍚姤璀﹀紩瀵煎姛鑳�");
+ log.debug("鐩告満:" + cameraId + "鏈紑鍚姤璀﹀紩瀵煎姛鑳�");
return;
}
GuideTask guideTask = new GuideTask();
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 be359b1..1ca7cc7 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
@@ -14,14 +14,18 @@
import com.ruoyi.alarm.radar.service.IArdAlarmRadarPumpService;
import com.ruoyi.alarm.tube.domain.ArdAlarmTube;
import com.ruoyi.alarm.tube.service.IArdAlarmTubeService;
+import com.ruoyi.common.constant.CacheConstants;
+import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.device.camera.domain.ArdCameras;
import com.ruoyi.device.camera.domain.CameraCmd;
import com.ruoyi.device.camera.service.ICameraSdkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
+import javax.annotation.Resource;
import java.time.Duration;
import java.time.Instant;
import java.util.HashMap;
@@ -37,6 +41,9 @@
@Slf4j(topic = "guideQueue")
@Component
public class QueueHandler {
+ @Resource
+ private RedisCache redisCache;
+
/**
* 寮曞浠诲姟鍏ラ槦
* 鍒樿嫃涔�
@@ -46,7 +53,7 @@
/*閫氳繃鐩告満ID鑾峰彇寮曞闃熷垪锛屽苟灏嗗紩瀵间换鍔″姞鍏ラ槦鍒�*/
PriorityBlockingQueue<GuideTask> guideTaskQueue = GuidePriorityQueue.cameraQueueMap.get(cameraId);
if (StringUtils.isNull(guideTaskQueue)) {
- log.info("鐩告満鏈櫥褰�,娌℃湁闃熷垪,鏃犳硶鍏ラ槦寮曞");
+ log.debug("鐩告満鏈櫥褰�,娌℃湁闃熷垪,鏃犳硶鍏ラ槦寮曞");
return;
}
log.debug("鏂颁换鍔″叆闃�:" + task.getAlarmId());
@@ -100,6 +107,9 @@
public void processTask(GuideTask guideTask) {
try {
+ if (!IsEnableGuide(guideTask.getCameraId())) {
+ return;
+ }
String url = "";
CameraCmd cmd = new CameraCmd();
cmd.setCameraId(guideTask.getCameraId());
@@ -144,8 +154,11 @@
Instant currentTime = Instant.now();
long elapsedSeconds = Duration.between(startTime, currentTime).getSeconds();
if (elapsedSeconds >= 30) {
- recordFlag = false;
+ recordFlag = false;//杈惧埌30绉掑綍鍍忓仠姝�
url = cameraSdkService.recordStopToMinio(cmd);//鍋滄褰曞儚杩斿洖url
+ }
+ if (!IsEnableGuide(guideTask.getCameraId())) {
+ recordFlag = false;//鐩告満鍏抽棴寮曞褰曞儚鍋滄
}
//鍒ゆ柇闃熷垪涓涓�鏉℃暟鎹殑浼樺厛绾ф槸鍚﹀ぇ浜庡綋鍓嶆暟鎹殑浼樺厛绾�
PriorityBlockingQueue<GuideTask> guideTasks = GuidePriorityQueue.cameraQueueMap.get(guideTask.getCameraId());
@@ -207,4 +220,20 @@
log.info("绾跨▼浠诲姟寮傚父:" + ex.getMessage());
}
}
+
+ /**
+ * 鍏夌數鏄惁寮�鍚姤璀﹀紩瀵煎姛鑳�
+ * 鍒樿嫃涔�
+ * 2023/7/7 14:03
+ */
+ private Boolean IsEnableGuide(String cameraId) {
+ boolean enabled = false;
+ ArdCameras ardCameras = redisCache.getCacheObject(CacheConstants.CAMERA_LIST_KEY + cameraId);
+ if (ardCameras != null) {
+ if (ardCameras.getCamAlarmGuideEnable().equals(1)) {
+ enabled = true;
+ }
+ }
+ return enabled;
+ }
}
\ No newline at end of file
diff --git a/bin/clean.bat b/bin/clean.bat
new file mode 100644
index 0000000..24c0974
--- /dev/null
+++ b/bin/clean.bat
@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [信息] 清理工程target生成路径。
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+call mvn clean
+
+pause
\ No newline at end of file
diff --git a/bin/package.bat b/bin/package.bat
new file mode 100644
index 0000000..c693ec0
--- /dev/null
+++ b/bin/package.bat
@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [信息] 打包Web工程,生成war/jar包文件。
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+call mvn clean package -Dmaven.test.skip=true
+
+pause
\ No newline at end of file
diff --git a/bin/run.bat b/bin/run.bat
new file mode 100644
index 0000000..08a1c92
--- /dev/null
+++ b/bin/run.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [信息] 使用Jar命令运行Web工程。
+echo.
+
+cd %~dp0
+cd ../ruoyi-admin
+
+set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -Dloader.path="jarLib/" -jar %JAVA_OPTS% ruoyi-admin.jar
+
+cd bin
+pause
\ No newline at end of file
--
Gitblit v1.9.3