From dcaa8e3713ff79bc07ab731b6246d3c6b515757b Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Thu, 28 Apr 2022 09:47:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=B9Parental=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/utils/XmlUtil.java | 14 ++++++++++++-- 1 file changed, 12 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 1a879968..57831df3 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 @@ -206,8 +206,18 @@ public class XmlUtil { deviceChannel.setAddress(XmlUtil.getText(itemDevice, "Address")); String businessGroupID = XmlUtil.getText(itemDevice, "BusinessGroupID"); if (XmlUtil.getText(itemDevice, "Parental") == null - || XmlUtil.getText(itemDevice, "Parental") == "") { - deviceChannel.setParental(0); + || XmlUtil.getText(itemDevice, "Parental").equals("")) { + if (deviceChannel.getChannelId().length() <= 10 + || (deviceChannel.getChannelId().length() == 20 && ( + Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 215 + || Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216 + ) + ) + ) { + deviceChannel.setParental(1); + }else { + deviceChannel.setParental(0); + } } else { deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental"))); }