Commit 26c3ca6a2180e4b42bcf5bc109cc9a67934eaba2
1 parent
d4b05c11
对于虚拟目录中出现多级虚拟组织的情况进行处理
Showing
1 changed file
with
8 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
| ... | ... | @@ -211,6 +211,14 @@ public class XmlUtil { |
| 211 | 211 | deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental"))); |
| 212 | 212 | } |
| 213 | 213 | deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID")); |
| 214 | + String parentId = XmlUtil.getText(itemDevice, "ParentID"); | |
| 215 | + if (parentId.contains("/")) { | |
| 216 | + String lastParentId = parentId.substring(parentId.lastIndexOf("/")); | |
| 217 | + deviceChannel.setParentId(lastParentId); | |
| 218 | + }else { | |
| 219 | + deviceChannel.setParentId(parentId); | |
| 220 | + } | |
| 221 | + | |
| 214 | 222 | if (XmlUtil.getText(itemDevice, "SafetyWay") == null |
| 215 | 223 | || XmlUtil.getText(itemDevice, "SafetyWay") == "") { |
| 216 | 224 | deviceChannel.setSafetyWay(0); | ... | ... |