From d60452560e37305e62f8cdd6cc08c6b3d3430a10 Mon Sep 17 00:00:00 2001
From: WuPeng <wp@zafu.edu.cn>
Date: 星期日, 27 十一月 2022 10:28:42 +0800
Subject: [PATCH] 弃用废弃方法toJavaObject,改用to方法,消除编译警告。

---
 src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java |    8 ++++++--
 1 files changed, 6 insertions(+), 2 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 1198c26..35d563d 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
@@ -1,7 +1,7 @@
 package com.genersoft.iot.vmp.gb28181.utils;
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
 import com.genersoft.iot.vmp.gb28181.bean.Device;
 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
 import com.genersoft.iot.vmp.gb28181.bean.TreeType;
@@ -298,6 +298,10 @@
             }else {
                 deviceChannel.setParentId(parentId);
             }
+            // 鍏煎璁惧閫氶亾淇℃伅涓嚜宸变负鑷繁鐖惰妭鐐圭殑鎯呭喌
+            if (deviceChannel.getParentId().equals(deviceChannel.getChannelId())) {
+                deviceChannel.setParentId(null);
+            }
         }
         deviceChannel.setBusinessGroupId(businessGroupID);
         if (channelType.equals(ChannelType.BusinessGroup) || channelType.equals(ChannelType.VirtualOrganization)) {

--
Gitblit v1.8.0