From f5fcc79a2c7e6379a73b14ba4e366ad1654e9475 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期日, 03 七月 2022 07:40:54 +0800
Subject: [PATCH] 优化国标树型展示

---
 src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
index 5ada1e4..0d34c00 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
@@ -249,23 +249,26 @@
             }else {
                 deviceChannel.setParentId(parentId);
             }
-        }else {
-            if (deviceChannel.getChannelId().length() <= 10) { // 姝ゆ椂涓鸿鏀垮尯鍒�, 涓婁笅绾ц鏀垮尯鍒掍娇鐢―eviceId鍏宠仈
-                deviceChannel.setParentId(deviceChannel.getChannelId().substring(0, deviceChannel.getChannelId().length() - 2));
-            }else if (deviceChannel.getChannelId().length() == 20) {
-                if (Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216) { // 铏氭嫙缁勭粐
-                    deviceChannel.setParentId(businessGroupID);
-                }else if (Integer.parseInt(device.getDeviceId().substring(10, 13) )== 118) {//NVR 濡傛灉涓婄骇璁惧缂栧彿鏄疦VR鍒欑洿鎺ュ皢NVR鐨勭紪鍙疯缃粰閫氶亾鐨勪笂绾х紪鍙�
-                    deviceChannel.setParentId(device.getDeviceId());
-                }else if (deviceChannel.getCivilCode() != null) {
-                    // 璁惧锛� 鏃爌arentId鐨�20浣嶆槸浣跨敤CivilCode琛ㄧず涓婄骇鐨勮澶囷紝
-                    // 娉細215 涓氬姟鍒嗙粍鏄渶瑕佹湁parentId鐨�
-                    deviceChannel.setParentId(deviceChannel.getCivilCode());
-                }
-            }else {
-                deviceChannel.setParentId(deviceChannel.getDeviceId());
-            }
         }
+        deviceChannel.setBusinessGroupId(businessGroupID);
+
+//        else {
+//            if (deviceChannel.getChannelId().length() <= 10) { // 姝ゆ椂涓鸿鏀垮尯鍒�, 涓婁笅绾ц鏀垮尯鍒掍娇鐢―eviceId鍏宠仈
+//                deviceChannel.setParentId(deviceChannel.getChannelId().substring(0, deviceChannel.getChannelId().length() - 2));
+//            }else if (deviceChannel.getChannelId().length() == 20) {
+//                if (Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216) { // 铏氭嫙缁勭粐
+//                    deviceChannel.setBusinessGroupId(businessGroupID);
+//                }else if (Integer.parseInt(device.getDeviceId().substring(10, 13) )== 118) {//NVR 濡傛灉涓婄骇璁惧缂栧彿鏄疦VR鍒欑洿鎺ュ皢NVR鐨勭紪鍙疯缃粰閫氶亾鐨勪笂绾х紪鍙�
+//                    deviceChannel.setParentId(device.getDeviceId());
+//                }else if (deviceChannel.getCivilCode() != null) {
+//                    // 璁惧锛� 鏃爌arentId鐨�20浣嶆槸浣跨敤CivilCode琛ㄧず涓婄骇鐨勮澶囷紝
+//                    // 娉細215 涓氬姟鍒嗙粍鏄渶瑕佹湁parentId鐨�
+//                    deviceChannel.setParentId(deviceChannel.getCivilCode());
+//                }
+//            }else {
+//                deviceChannel.setParentId(deviceChannel.getDeviceId());
+//            }
+//        }
 
         if (XmlUtil.getText(itemDevice, "SafetyWay") == null
                 || XmlUtil.getText(itemDevice, "SafetyWay") == "") {

--
Gitblit v1.8.0