Browse Source

对于虚拟目录中出现多级虚拟组织的情况进行处理

pull/451/head
648540858 3 years ago
parent
commit
26c3ca6a21
  1. 8
      src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java

8
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java

@ -211,6 +211,14 @@ public class XmlUtil {
deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental"))); deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental")));
} }
deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID")); deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID"));
String parentId = XmlUtil.getText(itemDevice, "ParentID");
if (parentId.contains("/")) {
String lastParentId = parentId.substring(parentId.lastIndexOf("/"));
deviceChannel.setParentId(lastParentId);
}else {
deviceChannel.setParentId(parentId);
}
if (XmlUtil.getText(itemDevice, "SafetyWay") == null if (XmlUtil.getText(itemDevice, "SafetyWay") == null
|| XmlUtil.getText(itemDevice, "SafetyWay") == "") { || XmlUtil.getText(itemDevice, "SafetyWay") == "") {
deviceChannel.setSafetyWay(0); deviceChannel.setSafetyWay(0);

Loading…
Cancel
Save