From 0f509049928733e49cd530d91f6463317e0c00ee Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 20 四月 2023 10:26:42 +0800
Subject: [PATCH] 支持设备/通道状态变化时发送redis通知

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
index 56fa187..f9f8fc2 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
@@ -108,6 +108,11 @@
 							if (updateChannelOnlineList.size() > 300) {
 								executeSaveForOnline();
 							}
+							if (userSetting.getDeviceStatusNotify()) {
+								// 鍙戦�乺edis娑堟伅
+								redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), channel.getChannelId(), true);
+							}
+
 							break;
 						case CatalogEvent.OFF :
 							// 绂荤嚎
@@ -116,6 +121,10 @@
 								updateChannelOfflineList.add(channel);
 								if (updateChannelOfflineList.size() > 300) {
 									executeSaveForOffline();
+								}
+								if (userSetting.getDeviceStatusNotify()) {
+									// 鍙戦�乺edis娑堟伅
+									redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), channel.getChannelId(), false);
 								}
 							}else {
 								logger.info("[鏀跺埌閫氶亾绂荤嚎閫氱煡] 浣嗘槸骞冲彴宸查厤缃嫆缁濇娑堟伅锛屾潵鑷澶�: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
@@ -129,6 +138,10 @@
 								if (updateChannelOfflineList.size() > 300) {
 									executeSaveForOffline();
 								}
+								if (userSetting.getDeviceStatusNotify()) {
+									// 鍙戦�乺edis娑堟伅
+									redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), channel.getChannelId(), false);
+								}
 							}else {
 								logger.info("[鏀跺埌閫氶亾瑙嗛涓㈠け閫氱煡] 浣嗘槸骞冲彴宸查厤缃嫆缁濇娑堟伅锛屾潵鑷澶�: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
 							}
@@ -141,6 +154,10 @@
 								if (updateChannelOfflineList.size() > 300) {
 									executeSaveForOffline();
 								}
+								if (userSetting.getDeviceStatusNotify()) {
+									// 鍙戦�乺edis娑堟伅
+									redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), channel.getChannelId(), false);
+								}
 							}else {
 								logger.info("[鏀跺埌閫氶亾瑙嗛鏁呴殰閫氱煡] 浣嗘槸骞冲彴宸查厤缃嫆缁濇娑堟伅锛屾潵鑷澶�: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
 							}

--
Gitblit v1.8.0