From 072e84db195ab3399c8bd8b9baaa69c3efab9171 Mon Sep 17 00:00:00 2001 From: bradyxu Date: Sat, 18 Jun 2022 10:40:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(SIP):=20=E4=BF=AE=E5=A4=8D=E6=B5=B7?= =?UTF-8?q?=E5=BA=B7NVR=E6=97=A0parentId=E5=AF=BC=E8=87=B4=E5=88=86?= =?UTF-8?q?=E5=B1=8F=E7=9B=91=E6=8E=A7=E6=B2=A1=E5=8A=9E=E6=B3=95=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于海康NVR通道信息中不带NVR的ID作为parentId。导致通道信息parentId缺失, 在通道信息中判断device信息中的DeviceId如果为NVR的话,将NVR的deviceId设置为通道的parentId --- src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java | 2 ++ 1 file changed, 2 insertions(+) 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 c44001a4..5ada1e4d 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 @@ -255,6 +255,8 @@ public class XmlUtil { }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 如果上级设备编号是NVR则直接将NVR的编号设置给通道的上级编号 + deviceChannel.setParentId(device.getDeviceId()); }else if (deviceChannel.getCivilCode() != null) { // 设备, 无parentId的20位是使用CivilCode表示上级的设备, // 注:215 业务分组是需要有parentId的