From 26cd7dbaf9394ff26f5229b18cfdb72c203a6bc3 Mon Sep 17 00:00:00 2001
From: gaofw189 <gaofw189@chinatelecom.cn>
Date: 星期二, 10 一月 2023 15:55:56 +0800
Subject: [PATCH] 修复WVP作为下级平台接收DeviceStatus指令固定响应的问题

---
 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