From 00c17a3a10a2856c847757e7021e60135b6ea894 Mon Sep 17 00:00:00 2001 From: zhangnaisong <2434969829@qq.com> Date: 星期六, 27 七月 2024 23:55:43 +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