From 18a9f86a0af4863f1ec19b53d88ed2bcd46e37a7 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 18 十二月 2023 09:59:06 +0800 Subject: [PATCH] Merge pull request #1209 from DavidSche/fix-1208 --- src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java old mode 100644 new mode 100755 index 732a87a..38cdf7c --- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java @@ -42,7 +42,7 @@ catalogData.setSn(sn); catalogData.setTotal(total); catalogData.setDevice(device); - catalogData.setChannelList(Collections.synchronizedList(new ArrayList<>())); + catalogData.setChannelList(deviceChannelList); catalogData.setStatus(CatalogData.CatalogDataStatus.runIng); catalogData.setLastTime(Instant.now()); data.put(deviceId, catalogData); @@ -109,12 +109,18 @@ for (String deviceId : keys) { CatalogData catalogData = data.get(deviceId); - if ( catalogData.getLastTime().isBefore(instantBefore5S)) { // 瓒呰繃浜旂鏀朵笉鍒版秷鎭换鍔¤秴鏃讹紝 鍙洿鏂拌繖涓�閮ㄥ垎鏁版嵁 + if ( catalogData.getLastTime().isBefore(instantBefore5S)) { + // 瓒呰繃浜旂鏀朵笉鍒版秷鎭换鍔¤秴鏃讹紝 鍙洿鏂拌繖涓�閮ㄥ垎鏁版嵁, 鏀跺埌鏁版嵁涓庡0鏄庣殑鎬绘暟涓�鑷达紝鍒欓噸缃�氶亾鏁版嵁锛屾暟鎹笉鍏ㄥ垯鍙鏀跺埌鐨勬暟鎹仛鏇存柊鎿嶄綔 if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.runIng)) { - storager.resetChannels(catalogData.getDevice().getDeviceId(), catalogData.getChannelList()); + if (catalogData.getTotal() == catalogData.getChannelList().size()) { + storager.resetChannels(catalogData.getDevice().getDeviceId(), catalogData.getChannelList()); + }else { + storager.updateChannels(catalogData.getDevice().getDeviceId(), catalogData.getChannelList()); + } + String errorMsg = "鏇存柊鎴愬姛锛屽叡" + catalogData.getTotal() + "鏉★紝宸叉洿鏂�" + catalogData.getChannelList().size() + "鏉�"; + catalogData.setErrorMsg(errorMsg); if (catalogData.getTotal() != catalogData.getChannelList().size()) { - String errorMsg = "鏇存柊鎴愬姛锛屽叡" + catalogData.getTotal() + "鏉★紝宸叉洿鏂�" + catalogData.getChannelList().size() + "鏉�"; - catalogData.setErrorMsg(errorMsg); + } }else if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.ready)) { String errorMsg = "鍚屾澶辫触锛岀瓑寰呭洖澶嶈秴鏃�"; -- Gitblit v1.8.0