bugfix: 修复行政区划分组、业务分组、虚拟目录下通道为空时被误认为设备的问题

pull/1234/head
xiaoQQya 2023-12-30 14:15:58 +08:00
parent b0de0be3ea
commit 4a00bcea98
1 changed files with 5 additions and 1 deletions

View File

@ -222,7 +222,6 @@ public class XmlUtil {
deviceChannel.setName(channelId);
}
if(channelId.length() <= 8) {
deviceChannel.setHasAudio(false);
CivilCodePo parentCode = civilCodeFileConf.getParentCode(channelId);
if (parentCode != null) {
deviceChannel.setParentId(parentCode.getCode());
@ -230,6 +229,8 @@ public class XmlUtil {
}else {
logger.warn("[xml解析] 无法确定行政区划{}的上级行政区划", channelId);
}
deviceChannel.setParental(1);
deviceChannel.setHasAudio(false);
deviceChannel.setStatus(true);
return deviceChannel;
}else {
@ -289,6 +290,7 @@ public class XmlUtil {
if (!ObjectUtils.isEmpty(address)) {
deviceChannel.setAddress(address);
}
deviceChannel.setParental(1);
deviceChannel.setStatus(true);
if (!ObjectUtils.isEmpty(registerWay)) {
try {
@ -304,6 +306,7 @@ public class XmlUtil {
case 215:
// 业务分组
deviceChannel.setStatus(true);
deviceChannel.setParental(1);
if (!ObjectUtils.isEmpty(parentID)) {
if (!parentID.trim().equalsIgnoreCase(device.getDeviceId())) {
deviceChannel.setParentId(parentID);
@ -318,6 +321,7 @@ public class XmlUtil {
case 216:
// 虚拟组织
deviceChannel.setStatus(true);
deviceChannel.setParental(1);
if (!ObjectUtils.isEmpty(businessGroupID)) {
deviceChannel.setBusinessGroupId(businessGroupID);
}