临时提交
parent
2c7dfa03a8
commit
324fef2908
|
@ -1,5 +1,6 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.bean;
|
package com.genersoft.iot.vmp.gb28181.bean;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -202,5 +203,19 @@ public class CommonGBChannel {
|
||||||
@Schema(description = "关联的拉流代理Id(流来源是拉流代理时有效)")
|
@Schema(description = "关联的拉流代理Id(流来源是拉流代理时有效)")
|
||||||
private Integer streamProxyId;
|
private Integer streamProxyId;
|
||||||
|
|
||||||
|
public String encode(CatalogEvent event){
|
||||||
|
String content;
|
||||||
|
if (event.getType().equals(CatalogEvent.DEL)
|
||||||
|
|| event.getType().equals(CatalogEvent.DEFECT)
|
||||||
|
|| event.getType().equals(CatalogEvent.VLOST)) {
|
||||||
|
content = "<Item>\n" +
|
||||||
|
"<DeviceID>" + this.getGbDeviceId() + "</DeviceID>\n" +
|
||||||
|
"<Event>" + event + "</Event>\r\n" +
|
||||||
|
"</Item>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,4 +230,6 @@ public class DeviceChannel extends CommonGBChannel {
|
||||||
deviceChannel.setDeviceId(deviceElement.getText());
|
deviceChannel.setDeviceId(deviceElement.getText());
|
||||||
return deviceChannel;
|
return deviceChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,19 +223,19 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
|
||||||
}
|
}
|
||||||
catalogXml.append("<Item>\r\n");
|
catalogXml.append("<Item>\r\n");
|
||||||
// 行政区划分组只需要这两项就可以
|
// 行政区划分组只需要这两项就可以
|
||||||
catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n");
|
catalogXml.append("<DeviceID>" + channel.getGbDeviceId() + "</DeviceID>\r\n");
|
||||||
catalogXml.append("<Name>" + channel.getName() + "</Name>\r\n");
|
catalogXml.append("<Name>" + channel.getName() + "</Name>\r\n");
|
||||||
if (channel.getChannelId().length() <= 8) {
|
if (channel.getGbDeviceId().length() <= 8) {
|
||||||
catalogXml.append("</Item>\r\n");
|
catalogXml.append("</Item>\r\n");
|
||||||
continue;
|
continue;
|
||||||
}else {
|
}else {
|
||||||
if (channel.getChannelId().length() != 20) {
|
if (channel.getGbDeviceId().length() != 20) {
|
||||||
catalogXml.append("</Item>\r\n");
|
catalogXml.append("</Item>\r\n");
|
||||||
logger.warn("[编号长度异常] {} 长度错误,请使用20位长度的国标编号,当前长度:{}", channel.getChannelId(), channel.getChannelId().length());
|
logger.warn("[编号长度异常] {} 长度错误,请使用20位长度的国标编号,当前长度:{}", channel.getGbDeviceId(), channel.getChannelId().length());
|
||||||
catalogXml.append("</Item>\r\n");
|
catalogXml.append("</Item>\r\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
switch (Integer.parseInt(channel.getChannelId().substring(10, 13))){
|
switch (Integer.parseInt(channel.getGbDeviceId().substring(10, 13))){
|
||||||
case 200:
|
case 200:
|
||||||
// catalogXml.append("<Manufacturer>三永华通</Manufacturer>\r\n");
|
// catalogXml.append("<Manufacturer>三永华通</Manufacturer>\r\n");
|
||||||
// GitUtil gitUtil = SpringBeanFactory.getBean("gitUtil");
|
// GitUtil gitUtil = SpringBeanFactory.getBean("gitUtil");
|
||||||
|
@ -271,8 +271,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// 通道项
|
// 通道项
|
||||||
if (channel.getManufacture() != null) {
|
if (channel.getManufacturer() != null) {
|
||||||
catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n");
|
catalogXml.append("<Manufacturer>" + channel.getManufacturer() + "</Manufacturer>\r\n");
|
||||||
}else {
|
}else {
|
||||||
catalogXml.append("<Manufacturer></Manufacturer>\r\n");
|
catalogXml.append("<Manufacturer></Manufacturer>\r\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue