优化国标树型展示
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
/**
|
||||
* 国标类型编码,国标编码中11-13位为类型编码
|
||||
* 详见 附 录 D 编码规则 A
|
||||
* @author lin
|
||||
*/
|
||||
public class ChannelIdType {
|
||||
/**
|
||||
* 中心信令控制服务器编码
|
||||
*/
|
||||
public final static String CENTRAL_SIGNALING_CONTROL_SERVER = "200";
|
||||
|
||||
/**
|
||||
* 业务分组编码
|
||||
*/
|
||||
public final static String BUSINESS_GROUP = "215";
|
||||
|
||||
/**
|
||||
* 虚拟组织编码
|
||||
*/
|
||||
public final static String VIRTUAL_ORGANIZATION = "216";
|
||||
}
|
||||
@@ -138,6 +138,11 @@ public class Device {
|
||||
*/
|
||||
private String geoCoordSys;
|
||||
|
||||
/**
|
||||
* 树类型 国标规定了两种树的展现方式 行政区划:CivilCode 和业务分组:BusinessGroup
|
||||
*/
|
||||
private String treeType;
|
||||
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
@@ -338,4 +343,12 @@ public class Device {
|
||||
public void setGeoCoordSys(String geoCoordSys) {
|
||||
this.geoCoordSys = geoCoordSys;
|
||||
}
|
||||
|
||||
public String getTreeType() {
|
||||
return treeType;
|
||||
}
|
||||
|
||||
public void setTreeType(String treeType) {
|
||||
this.treeType = treeType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,6 +194,11 @@ public class DeviceChannel {
|
||||
*/
|
||||
private int channelType;
|
||||
|
||||
/**
|
||||
* 业务分组
|
||||
*/
|
||||
private String businessGroupId;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -506,4 +511,12 @@ public class DeviceChannel {
|
||||
public void setChannelType(int channelType) {
|
||||
this.channelType = channelType;
|
||||
}
|
||||
|
||||
public String getBusinessGroupId() {
|
||||
return businessGroupId;
|
||||
}
|
||||
|
||||
public void setBusinessGroupId(String businessGroupId) {
|
||||
this.businessGroupId = businessGroupId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +406,10 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
|
||||
if (parentPlatform == null) {
|
||||
return false;
|
||||
}
|
||||
logger.info("[发送 移动位置订阅] {}/{}->{},{}", parentPlatform.getServerGBId(), gpsMsgInfo.getId(), gpsMsgInfo.getLng(), gpsMsgInfo.getLat());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("[发送 移动位置订阅] {}/{}->{},{}", parentPlatform.getServerGBId(), gpsMsgInfo.getId(), gpsMsgInfo.getLng(), gpsMsgInfo.getLat());
|
||||
}
|
||||
|
||||
try {
|
||||
String characterSet = parentPlatform.getCharacterSet();
|
||||
StringBuffer deviceStatusXml = new StringBuffer(600);
|
||||
|
||||
@@ -141,6 +141,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
|
||||
device.setStreamMode("UDP");
|
||||
device.setCharset("GB2312");
|
||||
device.setGeoCoordSys("WGS84");
|
||||
device.setTreeType("CivilCode");
|
||||
device.setDeviceId(deviceId);
|
||||
}
|
||||
device.setIp(received);
|
||||
|
||||
@@ -249,23 +249,26 @@ public class XmlUtil {
|
||||
}else {
|
||||
deviceChannel.setParentId(parentId);
|
||||
}
|
||||
}else {
|
||||
if (deviceChannel.getChannelId().length() <= 10) { // 此时为行政区划, 上下级行政区划使用DeviceId关联
|
||||
deviceChannel.setParentId(deviceChannel.getChannelId().substring(0, deviceChannel.getChannelId().length() - 2));
|
||||
}else if (deviceChannel.getChannelId().length() == 20) {
|
||||
if (Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216) { // 虚拟组织
|
||||
deviceChannel.setParentId(businessGroupID);
|
||||
}else if (Integer.parseInt(device.getDeviceId().substring(10, 13) )== 118) {//NVR 如果上级设备编号是NVR则直接将NVR的编号设置给通道的上级编号
|
||||
deviceChannel.setParentId(device.getDeviceId());
|
||||
}else if (deviceChannel.getCivilCode() != null) {
|
||||
// 设备, 无parentId的20位是使用CivilCode表示上级的设备,
|
||||
// 注:215 业务分组是需要有parentId的
|
||||
deviceChannel.setParentId(deviceChannel.getCivilCode());
|
||||
}
|
||||
}else {
|
||||
deviceChannel.setParentId(deviceChannel.getDeviceId());
|
||||
}
|
||||
}
|
||||
deviceChannel.setBusinessGroupId(businessGroupID);
|
||||
|
||||
// else {
|
||||
// if (deviceChannel.getChannelId().length() <= 10) { // 此时为行政区划, 上下级行政区划使用DeviceId关联
|
||||
// deviceChannel.setParentId(deviceChannel.getChannelId().substring(0, deviceChannel.getChannelId().length() - 2));
|
||||
// }else if (deviceChannel.getChannelId().length() == 20) {
|
||||
// if (Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216) { // 虚拟组织
|
||||
// deviceChannel.setBusinessGroupId(businessGroupID);
|
||||
// }else if (Integer.parseInt(device.getDeviceId().substring(10, 13) )== 118) {//NVR 如果上级设备编号是NVR则直接将NVR的编号设置给通道的上级编号
|
||||
// deviceChannel.setParentId(device.getDeviceId());
|
||||
// }else if (deviceChannel.getCivilCode() != null) {
|
||||
// // 设备, 无parentId的20位是使用CivilCode表示上级的设备,
|
||||
// // 注:215 业务分组是需要有parentId的
|
||||
// deviceChannel.setParentId(deviceChannel.getCivilCode());
|
||||
// }
|
||||
// }else {
|
||||
// deviceChannel.setParentId(deviceChannel.getDeviceId());
|
||||
// }
|
||||
// }
|
||||
|
||||
if (XmlUtil.getText(itemDevice, "SafetyWay") == null
|
||||
|| XmlUtil.getText(itemDevice, "SafetyWay") == "") {
|
||||
|
||||
Reference in New Issue
Block a user