From a42dda2bd3cc1cf8c20cc61e7ad9211eadecbaf3 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 24 二月 2022 16:55:06 +0800
Subject: [PATCH] 规范数据库,添加必要约束,优化通道批量导入功能

---
 src/main/java/com/genersoft/iot/vmp/gb28181/event/DeviceOffLineDetector.java |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/event/DeviceOffLineDetector.java b/src/main/java/com/genersoft/iot/vmp/gb28181/event/DeviceOffLineDetector.java
index 437e7de..ea2fa6c 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/event/DeviceOffLineDetector.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/event/DeviceOffLineDetector.java
@@ -1,5 +1,6 @@
 package com.genersoft.iot.vmp.gb28181.event;
 
+import com.genersoft.iot.vmp.conf.UserSetup;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -7,8 +8,8 @@
 import com.genersoft.iot.vmp.utils.redis.RedisUtil;
 
 /**    
- * @Description:璁惧绂诲湪绾跨姸鎬佹娴嬪櫒锛岀敤浜庢娴嬭澶囩姸鎬�
- * @author: songww
+ * @description:璁惧绂诲湪绾跨姸鎬佹娴嬪櫒锛岀敤浜庢娴嬭澶囩姸鎬�
+ * @author: swwheihei
  * @date:   2020骞�5鏈�13鏃� 涓嬪崍2:40:29     
  */
 @Component
@@ -16,9 +17,12 @@
 
 	@Autowired
     private RedisUtil redis;
+
+	@Autowired
+    private UserSetup userSetup;
 	
 	public boolean isOnline(String deviceId) {
-		String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + deviceId;
+		String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + userSetup.getServerId() + "_" + deviceId;
 		return redis.hasKey(key);
 	}
 }

--
Gitblit v1.8.0