From 8cb8a874db01acd1113cfeb5c2c5bf7e9555ff65 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期六, 21 十月 2023 15:26:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PushTask.java | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PushTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PushTask.java
index b9d9170..559f8cd 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PushTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/PushTask.java
@@ -9,11 +9,14 @@
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 com.ruoyi.device.hiksdk.common.GlobalVariable;
import com.ruoyi.device.hiksdk.service.IHikClientService;
import com.ruoyi.utils.websocket.util.WebSocketUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
import java.util.*;
import static com.ruoyi.utils.websocket.util.WebSocketUtils.ONLINE_USER_SESSIONS;
@@ -28,6 +31,12 @@
@Slf4j
public class PushTask {
+ @Resource
+ RedisCache redisCache;
+ @Resource
+ ICameraSdkService cameraSdkService;
+ @Resource
+ IGlobalAlarmService globalAlarmService;
/**
* @鎻忚堪 瀹氭椂鎺ㄩ�佹墍鏈夋姤璀︾殑鐐逛綅鏁伴噺
* @鍙傛暟 []
@@ -38,7 +47,6 @@
*/
public void globalAlarmCountPush() {
try {
- IGlobalAlarmService globalAlarmService = SpringUtils.getBean(IGlobalAlarmService.class);
Map<String, Object> stringIntegerMap = globalAlarmService.selectAlarmLogsCount();
if (ONLINE_USER_SESSIONS.size() > 0) {
WebSocketUtils.sendMessageAll(stringIntegerMap);
@@ -59,8 +67,6 @@
*/
public void ptzPush() {
try {
- RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
- IHikClientService hikClientService = SpringUtils.getBean(IHikClientService.class);
List<Map<String, Object>> list = new ArrayList<>();
List<Object> Objects = redisCache.getListKey(CacheConstants.CAMERA_LIST_KEY);
if (Objects.size() > 0) {
@@ -70,7 +76,6 @@
{
continue;
}
- //鎺ㄩ�佸ぇ鍏夌數
if(!"1".equals(camera.getGdtype()))
{
continue;
@@ -80,12 +85,12 @@
cmd.setChanNo(1);
cmd.setOperator(camera.getOperatorId());
//鎺ㄩ�佸湪绾跨殑鐩告満
- boolean onLine = hikClientService.isOnLine(cmd);
+ boolean onLine = cameraSdkService.isOnLine(cmd);
if(!onLine)
{
continue;
}
- Map<String, Object> ptz = hikClientService.getGisInfo(cmd);
+ Map<String, Object> ptz = cameraSdkService.getGisInfo(cmd);
if (StringUtils.isNull(ptz)) {
continue;
}
--
Gitblit v1.9.3