临时提交
This commit is contained in:
@@ -218,7 +218,6 @@ public class CommonGBChannel {
|
||||
private String updateTime;
|
||||
|
||||
|
||||
|
||||
public String encode(){
|
||||
return encode(null);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "国标通道关联分组表ID")
|
||||
public class CommonGBChannelWitchGroupChannelId extends CommonGBChannel {
|
||||
|
||||
private int groupChannelId;
|
||||
|
||||
}
|
||||
48
src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbCode.java
Normal file
48
src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbCode.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 国标编码对象
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "国标编码对象")
|
||||
public class GbCode {
|
||||
|
||||
@Schema(description = "中心编码,由监控中心所在地的行政区划代码确定,符合GB/T2260—2007的要求")
|
||||
private String civilCode;
|
||||
|
||||
@Schema(description = "行业编码")
|
||||
private String industryCode;
|
||||
|
||||
@Schema(description = "类型编码")
|
||||
private String typeCode;
|
||||
|
||||
@Schema(description = "网络标识")
|
||||
private String netCode;
|
||||
|
||||
@Schema(description = "序号")
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 解析国标编号
|
||||
*/
|
||||
public static GbCode decode(String code){
|
||||
if (code == null || code.trim().length() != 20) {
|
||||
return null;
|
||||
}
|
||||
code = code.trim();
|
||||
GbCode gbCode = new GbCode();
|
||||
gbCode.setCivilCode(code.substring(0, 8));
|
||||
gbCode.setIndustryCode(code.substring(9, 10));
|
||||
gbCode.setTypeCode(code.substring(11, 13));
|
||||
gbCode.setNetCode(code.substring(14, 15));
|
||||
gbCode.setSn(code.substring(15, 20));
|
||||
return gbCode;
|
||||
}
|
||||
|
||||
public String ecode(){
|
||||
return civilCode + industryCode + typeCode + netCode + sn;
|
||||
}
|
||||
}
|
||||
59
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Group.java
Normal file
59
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Group.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* 业务分组
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "业务分组")
|
||||
public class Group implements Comparable<Group>{
|
||||
/**
|
||||
* 数据库自增ID
|
||||
*/
|
||||
@Schema(description = "数据库自增ID")
|
||||
private int id;
|
||||
|
||||
/**
|
||||
* 区域国标编号
|
||||
*/
|
||||
@Schema(description = "区域国标编号")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@Schema(description = "区域名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 父区域国标ID
|
||||
*/
|
||||
@Schema(description = "父区域国标ID")
|
||||
private String parentDeviceId;
|
||||
|
||||
/**
|
||||
* 所属的业务分组国标编号
|
||||
*/
|
||||
@Schema(description = "所属的业务分组国标编号")
|
||||
private String businessGroup;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private String updateTime;
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull Group region) {
|
||||
return Integer.compare(Integer.parseInt(this.deviceId), Integer.parseInt(region.getDeviceId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 业务分组
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "业务分组树")
|
||||
public class GroupTree {
|
||||
|
||||
/**
|
||||
* 数据库Id
|
||||
*/
|
||||
@Schema(description = "数据库Id")
|
||||
private int dbId;
|
||||
|
||||
/**
|
||||
* 区域国标编号
|
||||
*/
|
||||
@Schema(description = "区域国标编号")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
@Schema(description = "区域名称")
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 父区域国标ID
|
||||
*/
|
||||
@Schema(description = "父区域国标ID")
|
||||
private String parentDeviceId;
|
||||
|
||||
@Schema(description = "是否有子节点")
|
||||
private boolean isLeaf;
|
||||
|
||||
@Schema(description = "类型, 行政区划:0 摄像头: 1")
|
||||
private int type;
|
||||
|
||||
|
||||
|
||||
public static GroupTree getInstance(Region region) {
|
||||
GroupTree regionTree = new GroupTree();
|
||||
regionTree.setId(region.getDeviceId());
|
||||
regionTree.setLabel(region.getName());
|
||||
regionTree.setParentDeviceId(region.getParentDeviceId());
|
||||
regionTree.setType(0);
|
||||
if (region.getDeviceId().length() < 8) {
|
||||
regionTree.setLeaf(false);
|
||||
}else {
|
||||
regionTree.setLeaf(true);
|
||||
}
|
||||
return regionTree;
|
||||
}
|
||||
|
||||
public static GroupTree getInstance(CommonGBChannel channel) {
|
||||
GroupTree regionTree = new GroupTree();
|
||||
regionTree.setId(channel.getGbDeviceId());
|
||||
regionTree.setLabel(channel.getGbName());
|
||||
regionTree.setParentDeviceId(channel.getGbCivilCode());
|
||||
regionTree.setType(1);
|
||||
regionTree.setLeaf(true);
|
||||
return regionTree;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user