From ba1e219d97e123b91657dc424f13a2fdeaa85d21 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: Mon, 21 Aug 2023 13:37:01 +0800
Subject: [PATCH] 修改兴趣点列表井号模糊查询

---
 ard-work/src/main/java/com/ruoyi/inspect/service/impl/InspectionTaskManager.java |   25 ++++---------------------
 1 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/ard-work/src/main/java/com/ruoyi/inspect/service/impl/InspectionTaskManager.java b/ard-work/src/main/java/com/ruoyi/inspect/service/impl/InspectionTaskManager.java
index f427cfd..d440ac7 100644
--- a/ard-work/src/main/java/com/ruoyi/inspect/service/impl/InspectionTaskManager.java
+++ b/ard-work/src/main/java/com/ruoyi/inspect/service/impl/InspectionTaskManager.java
@@ -1,14 +1,11 @@
 package com.ruoyi.inspect.service.impl;
 
-import com.ruoyi.constant.Global;
 import com.ruoyi.device.camera.domain.CameraCmd;
 import com.ruoyi.device.hiksdk.common.GlobalVariable;
 import com.ruoyi.device.hiksdk.service.IHikClientService;
-import com.ruoyi.device.hiksdk.service.impl.HikClientServiceImpl;
 import com.ruoyi.inspect.domain.ArdVideoInspectTask;
 import com.ruoyi.inspect.mapper.ArdVideoInspectTaskMapper;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -50,12 +47,8 @@
             log.info("手动巡检任务已启动:" + taskId);
             return;
         }
-//        /*每次启动任务清空任务当前步骤信息*/
+        /*每次启动任务清空任务当前步骤信息*/
         ArdVideoInspectTask ardVideoInspectTask = ardVideoInspectTaskMapper.selectArdVideoInspectTaskById(taskId);
-//        ardVideoInspectTask.setCurrentStepId("");
-//        ardVideoInspectTask.setCurrentStepStartTime("");
-//        ardVideoInspectTaskMapper.updateArdVideoInspectTask(ardVideoInspectTask);
-
         String cameraId = ardVideoInspectTask.getCameraId();
         /*将当前相机的所有任务当前时间置空*/
         ardVideoInspectTask=new ArdVideoInspectTask();
@@ -65,11 +58,6 @@
             for (ArdVideoInspectTask VideoInspectTask : ardVideoInspectTasks) {
                 VideoInspectTask.setCurrentStepStartTime("");
                 ardVideoInspectTaskMapper.updateArdVideoInspectTaskWithCurrentSetpInfo(VideoInspectTask);
-                /*清楚任务录像记录*/
-                if(Global.task_record.contains(VideoInspectTask.getId()))
-                {
-                    Global.task_record.remove(VideoInspectTask.getId());
-                }
             }
         }
         /*开启任务*/
@@ -84,24 +72,19 @@
         ArdVideoInspectTask ardVideoInspectTask = ardVideoInspectTaskMapper.selectArdVideoInspectTaskById(taskId);
         /*将关联的相机录像关闭*/
         String cameraId = ardVideoInspectTask.getCameraId();
-        Integer userId = GlobalVariable.loginMap.get(cameraId);//获取当前相机的登录ID
-        if( GlobalVariable.user_real_Map.containsKey(userId))
+        if( GlobalVariable.previewMap.containsKey(cameraId))
         {   //当前相机正在录像,则停止录像
             CameraCmd cmd = new CameraCmd();
             cmd.setCameraId(ardVideoInspectTask.getCameraId());
             cmd.setChannelNum(ardVideoInspectTask.getChannel());
-            cmd.setEnable(false);//停止录像
-            cmd.setUploadMinio(false);
-            hikClientService.recordToMinio(cmd);
-            GlobalVariable.user_real_Map.remove(userId);
+            hikClientService.recordStopNotToMinio(cmd);
+            GlobalVariable.previewMap.remove(cameraId);
         }
-
         /*停止任务*/
         InspectionTask task = taskMap.get(taskId);
         if (task != null) {
             task.stop();
             taskMap.remove(taskId);
-            Global.task_record.remove(taskId);
             log.info("手动巡检任务已停止:" + taskId);
             /*将任务步骤信息清空*/
             ardVideoInspectTask.setCurrentStepId("");

--
Gitblit v1.9.3