perf(catlog): 优化同步通道时通道名称的处理
通道名称为空时,默认使用通道编码作为通道名称,避免级联时因通道名称为空导致上级接收通道失败pull/1219/head
parent
964d55431f
commit
ef58f29cfc
|
@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.math.NumberUtils;
|
import org.apache.commons.lang3.math.NumberUtils;
|
||||||
import org.dom4j.Attribute;
|
import org.dom4j.Attribute;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
|
@ -214,8 +215,11 @@ public class XmlUtil {
|
||||||
return deviceChannel;
|
return deviceChannel;
|
||||||
}
|
}
|
||||||
Element nameElement = itemDevice.element("Name");
|
Element nameElement = itemDevice.element("Name");
|
||||||
if (nameElement != null) {
|
// 当通道名称为空时,设置通道名称为通道编码,避免级联时因通道名称为空导致上级接收通道失败
|
||||||
|
if (nameElement != null && StringUtils.isNotBlank(nameElement.getText())) {
|
||||||
deviceChannel.setName(nameElement.getText());
|
deviceChannel.setName(nameElement.getText());
|
||||||
|
} else {
|
||||||
|
deviceChannel.setName(channelId);
|
||||||
}
|
}
|
||||||
if(channelId.length() <= 8) {
|
if(channelId.length() <= 8) {
|
||||||
deviceChannel.setHasAudio(false);
|
deviceChannel.setHasAudio(false);
|
||||||
|
|
Loading…
Reference in New Issue