From 57c673aa3e83677bcf5d30b4b45d06bae6609db8 Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: 星期四, 08 八月 2024 16:14:40 +0800
Subject: [PATCH] 优化:获取会话
---
ard-work/src/main/java/com/ruoyi/device/camera/service/impl/CameraSdkServiceImpl.java | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/CameraSdkServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/CameraSdkServiceImpl.java
index eb62b1c..0209056 100644
--- a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/CameraSdkServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/CameraSdkServiceImpl.java
@@ -25,8 +25,10 @@
import com.ruoyi.utils.sdk.common.GlobalVariable;
import com.ruoyi.utils.tools.ArdTool;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
+import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -41,7 +43,7 @@
* @Date: 2023骞�10鏈�16鏃�15:21:01
**/
@Service
-@Slf4j(topic = "SDK")
+@Slf4j(topic = "sdk")
public class CameraSdkServiceImpl implements ICameraSdkService, ApplicationRunner {
@Resource
private IArdCamerasService ardCamerasService;
@@ -64,10 +66,10 @@
@Override
public void run(ApplicationArguments args) {
try {
+ log.info("鍒濆鍖栫櫥褰曠浉鏈哄紑濮�");
+ ardCamerasService.resetCameraLoginId();
List<ArdCameras> ardCameras = ardCamerasService.selectArdCamerasListNoDataScope(new ArdCameras());
- for (ArdCameras camera : ardCameras) {
- asyncLogin(camera);
- }
+ ardCameras.stream().forEach(ardCamera -> asyncLogin(ardCamera));
} catch (Exception ex) {
log.error("鍒濆鍖栫櫥褰曠浉鏈哄紓甯革細" + ex.getMessage());
}
@@ -586,17 +588,17 @@
case 1:
if (ardWellGuideCamera.getP1() != null) {
ptzMap = new HashMap<>();
- ptzMap.put("p" , ardWellGuideCamera.getP1());
- ptzMap.put("t" , ardWellGuideCamera.getT1());
- ptzMap.put("z" , ardWellGuideCamera.getZ1());
+ ptzMap.put("p", ardWellGuideCamera.getP1());
+ ptzMap.put("t", ardWellGuideCamera.getT1());
+ ptzMap.put("z", ardWellGuideCamera.getZ1());
}
break;
case 2:
if (ardWellGuideCamera.getP2() != null) {
ptzMap = new HashMap<>();
- ptzMap.put("p" , ardWellGuideCamera.getP2());
- ptzMap.put("t" , ardWellGuideCamera.getT2());
- ptzMap.put("z" , ardWellGuideCamera.getZ2());
+ ptzMap.put("p", ardWellGuideCamera.getP2());
+ ptzMap.put("t", ardWellGuideCamera.getT2());
+ ptzMap.put("z", ardWellGuideCamera.getZ2());
}
break;
@@ -624,9 +626,9 @@
}
//鎸変簳鍧愭爣寮�濮嬪紩瀵�
if (!guideTargetPosition(cmd).get("code").equals(200)) {
- return AjaxResult.warn("浜曞潗鏍囧紩瀵煎け璐�" , "cameraId:" + cameraId);
+ return AjaxResult.warn("浜曞潗鏍囧紩瀵煎け璐�", "cameraId:" + cameraId);
}
- return AjaxResult.success("浜曞潗鏍囧紩瀵兼垚鍔�" , "cameraId:" + cameraId);
+ return AjaxResult.success("浜曞潗鏍囧紩瀵兼垚鍔�", "cameraId:" + cameraId);
}
--
Gitblit v1.9.3