From da7889bf67ec400c96c4a68e61f8b6b4fbeef585 Mon Sep 17 00:00:00 2001
From: lishuyuan <lishuyuan@inspur.com>
Date: 星期五, 27 十月 2023 11:15:30 +0800
Subject: [PATCH] bugfix:编辑国标设备时,若目录订阅周期本来不为0时不生效
---
src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java | 8 ++++----
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java | 16 +++++++++-------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java b/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java
index 39dff93..2ffbfe4 100755
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java
@@ -89,17 +89,17 @@
ResponseEvent event = (ResponseEvent) eventResult.event;
if (event.getResponse().getRawContent() != null) {
// 鎴愬姛
- logger.info("[鍙栨秷鐩綍璁㈤槄璁㈤槄]鎴愬姛锛� {}", device.getDeviceId());
+ logger.info("[鍙栨秷鐩綍璁㈤槄]鎴愬姛锛� {}", device.getDeviceId());
}else {
// 鎴愬姛
- logger.info("[鍙栨秷鐩綍璁㈤槄璁㈤槄]鎴愬姛锛� {}", device.getDeviceId());
+ logger.info("[鍙栨秷鐩綍璁㈤槄]鎴愬姛锛� {}", device.getDeviceId());
}
},eventResult -> {
// 澶辫触
- logger.warn("[鍙栨秷鐩綍璁㈤槄璁㈤槄]澶辫触锛屼俊浠ゅ彂閫佸け璐ワ細 {}-{} ", device.getDeviceId(), eventResult.msg);
+ logger.warn("[鍙栨秷鐩綍璁㈤槄]澶辫触锛屼俊浠ゅ彂閫佸け璐ワ細 {}-{} ", device.getDeviceId(), eventResult.msg);
});
} catch (InvalidArgumentException | SipException | ParseException e) {
- logger.error("[鍛戒护鍙戦�佸け璐 鍙栨秷鐩綍璁㈤槄璁㈤槄: {}", e.getMessage());
+ logger.error("[鍛戒护鍙戦�佸け璐 鍙栨秷鐩綍璁㈤槄: {}", e.getMessage());
}
}
}
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
index 0d99ecc..d70c270 100755
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
@@ -520,16 +520,18 @@
// 鐩綍璁㈤槄鐩稿叧鐨勪俊鎭�
- if (device.getSubscribeCycleForCatalog() > 0) {
- if (deviceInStore.getSubscribeCycleForCatalog() == 0 || deviceInStore.getSubscribeCycleForCatalog() != device.getSubscribeCycleForCatalog()) {
- deviceInStore.setSubscribeCycleForCatalog(device.getSubscribeCycleForCatalog());
+ if (deviceInStore.getSubscribeCycleForCatalog() != device.getSubscribeCycleForCatalog()) {
+ if (device.getSubscribeCycleForCatalog() > 0) {
+ // 鑻ュ凡寮�鍚闃咃紝浣嗚闃呭懆鏈熶笉鍚岋紝鍒欏厛鍙栨秷
+ if (deviceInStore.getSubscribeCycleForCatalog() != 0) {
+ removeCatalogSubscribe(deviceInStore);
+ }
// 寮�鍚闃�
- addCatalogSubscribe(deviceInStore);
- }
- }else if (device.getSubscribeCycleForCatalog() == 0) {
- if (deviceInStore.getSubscribeCycleForCatalog() != 0) {
deviceInStore.setSubscribeCycleForCatalog(device.getSubscribeCycleForCatalog());
+ addCatalogSubscribe(deviceInStore);
+ }else if (device.getSubscribeCycleForCatalog() == 0) {
// 鍙栨秷璁㈤槄
+ deviceInStore.setSubscribeCycleForCatalog(device.getSubscribeCycleForCatalog());
removeCatalogSubscribe(deviceInStore);
}
}
--
Gitblit v1.8.0