支持生成国标ID

结构优化
648540858 2023-11-10 16:03:47 +08:00
parent fed353c645
commit e96b39935d
11 changed files with 464 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.common.CommonGbChannel;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.Gb28181CodeType;
import com.genersoft.iot.vmp.service.bean.*;
import com.github.pagehelper.PageInfo;
import java.util.ArrayList;
@ -52,4 +53,11 @@ public interface ICommonGbChannelService {
PageInfo<CommonGbChannel> queryChannelList(String query, int page, int count);
String getRandomCode(Gb28181CodeType type);
List<IndustryCodeType> getIndustryCodeList();
List<DeviceType> getDeviceTypeList();
List<NetworkIdentificationType> getNetworkIdentificationTypeList();
}

View File

@ -0,0 +1,58 @@
package com.genersoft.iot.vmp.service.bean;
import org.jetbrains.annotations.NotNull;
public class DeviceType implements Comparable<DeviceType>{
/**
*
*/
private String name;
/**
*
*/
private String code;
/**
*
*/
private String ownerName;
public static DeviceType getInstance(DeviceTypeEnum typeEnum) {
DeviceType deviceType = new DeviceType();
deviceType.setName(typeEnum.getName());
deviceType.setCode(typeEnum.getCode());
deviceType.setOwnerName(typeEnum.getOwnerName());
return deviceType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getOwnerName() {
return ownerName;
}
public void setOwnerName(String ownerName) {
this.ownerName = ownerName;
}
@Override
public int compareTo(@NotNull DeviceType deviceType) {
return Integer.compare(Integer.parseInt(this.code), Integer.parseInt(deviceType.getCode()));
}
}

View File

@ -0,0 +1,98 @@
package com.genersoft.iot.vmp.service.bean;
/**
*
*/
public enum DeviceTypeEnum {
DVR("111", "DVR编码", "前端主设备"),
VIDEO_SERVER("112", "视频服务器编码", "前端主设备"),
ENCODER("113", "编码器编码", "前端主设备"),
DECODER("114", "解码器编码", "前端主设备"),
VIDEO_SWITCHING_MATRIX("115", "视频切换矩阵编码", "前端主设备"),
AUDIO_SWITCHING_MATRIX("116", "音频切换矩阵编码", "前端主设备"),
ALARM_CONTROLLER("117", "报警控制器编码", "前端主设备"),
NVR("118", "网络视频录像机NVR编码", "前端主设备"),
RESERVE("119", "预留", "前端主设备"),
ONLINE_VIDEO_IMAGE_INFORMATION_ACQUISITION_SYSTEM("120", "在线视频图像信息采集系统编码", "前端主设备"),
VIDEO_CHECKPOINT("121", "视频卡口编码", "前端主设备"),
MULTI_CAMERA_DEVICE("122", "多目设备编码", "前端主设备"),
PARKING_LOT_ENTRANCE_AND_EXIT_CONTROL_EQUIPMENT("123", "停车场出入口控制设备编码", "前端主设备"),
PERSONNEL_ACCESS_CONTROL_EQUIPMENT("124", "人员出入口控制设备编码", "前端主设备"),
SECURITY_INSPECTION_EQUIPMENT("125", "安检设备编码", "前端主设备"),
HVR("130", "混合硬盘录像机HVR编码", "前端主设备"),
CAMERA("131", "摄像机编码", "前端外围设备"),
IPC("132", "网络摄像机IPC/在线视频图像信息采集设备编码", "前端外围设备"),
MONITOR("133", "显示器编码", "前端外围设备"),
ALARM_INPUT_DEVICE("134", "报警输入设备编码(如红外、烟感、门禁等报警设备)", "前端外围设备"),
ALARM_OUTPUT_DEVICE("135", "报警输出设备编码(如警灯、警铃等设备)", "前端外围设备"),
VOICE_INPUT_DEVICE("136", "语音输入设备编码", "前端外围设备"),
VOICE_OUTPUT_DEVICE("137", "语音输出设备", "前端外围设备"),
MOBILE_TRANSMISSION_EQUIPMENT("138", "移动传输设备编码", "前端外围设备"),
OTHER_PERIPHERAL_DEVICES("139", "其他外围设备编码", "前端外围设备"),
ALARM_OUTPUT_DEVICE2("140", "报警输出设备编码(如继电器或触发器控制的设备)", "前端外围设备"),
BARRIER_GATE("141", "道闸(控制车辆通行)", "前端外围设备"),
SMART_DOOR("142", "智能门(控制人员通行)", "前端外围设备"),
VOUCHER_RECOGNITION_UNIT("143", "凭证识别单元", "前端外围设备"),
CENTRAL_SIGNALING_CONTROL_SERVER("200", "中心信令控制服务器编码", "平台设备"),
WEB_APPLICATION_SERVER("201", "Web应用服务器编码", "平台设备"),
PROXY_SERVER("203", "代理服务器编码", "平台设备"),
SECURITY_SERVER("204", "安全服务器编码", "平台设备"),
ALARM_SERVER("205", "报警服务器编码", "平台设备"),
DATABASE_SERVER("206", "数据库服务器编码", "平台设备"),
GIS_SERVER("207", "GIS服务器编码", "平台设备"),
MANAGER_SERVER("208", "管理服务器编码", "平台设备"),
ACCESS_GATEWAY("209", "接入网关编码", "平台设备"),
MEDIA_STORAGE_SERVER("210", "媒体存储服务器编码", "平台设备"),
SIGNALING_SECURITY_ROUTING_GATEWAY("211", "信令安全路由网关编码", "平台设备"),
BUSINESS_GROUP("215", "业务分组编码", "平台设备"),
VIRTUAL_ORGANIZATION("216", "虚拟组织编码", "平台设备"),
CENTRAL_USER("300", "中心用户", "中心用户"),
END_USER("400", "终端用户", "终端用户"),
VIDEO_IMAGE_INFORMATION_SYNTHESIS("500", "视频图像信息综合应用平台", "平台外接服务器"),
VIDEO_IMAGE_INFORMATION_OPERATION_AND_MAINTENANCE_MANAGEMENT("501", "视频图像信息运维管理平台", "平台外接服务器"),
VIDEO_IMAGE_ANALYSIS("502", "视频图像分析系统", "平台外接服务器"),
VIDEO_IMAGE_INFORMATION_DATABASE("503", "视频图像信息数据库", "平台外接服务器"),
VIDEO_IMAGE_ANALYSIS_EQUIPMENT("505", "视频图像分析设备", "平台外接服务器"),
;
/**
*
*/
private final String name;
/**
*
*/
private String code;
/**
*
*/
private String ownerName;
DeviceTypeEnum(String code, String name, String ownerName) {
this.name = name;
this.code = code;
this.ownerName = ownerName;
}
public String getName() {
return name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getOwnerName() {
return ownerName;
}
public void setOwnerName(String ownerName) {
this.ownerName = ownerName;
}
}

View File

@ -0,0 +1,59 @@
package com.genersoft.iot.vmp.service.bean;
import org.jetbrains.annotations.NotNull;
public class IndustryCodeType implements Comparable<IndustryCodeType>{
/**
*
*/
private String name;
/**
*
*/
private String code;
/**
*
*/
private String notes;
public static IndustryCodeType getInstance(IndustryCodeTypeEnum typeEnum) {
IndustryCodeType industryCodeType = new IndustryCodeType();
industryCodeType.setName(typeEnum.getName());
industryCodeType.setCode(typeEnum.getCode());
industryCodeType.setNotes(typeEnum.getNotes());
return industryCodeType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
@Override
public int compareTo(@NotNull IndustryCodeType industryCodeType) {
return Integer.compare(Integer.parseInt(this.code), Integer.parseInt(industryCodeType.getCode()));
}
}

View File

@ -0,0 +1,74 @@
package com.genersoft.iot.vmp.service.bean;
/**
*
*/
public enum IndustryCodeTypeEnum {
SOCIAL_SECURITY_ROAD("00", "社会治安路面接入", "包括城市路面、商业街、公共区域、重点区域"),
SOCIAL_SECURITY_COMMUNITY("01", "社会治安社区接入", "包括社区、楼宇、网吧等"),
SOCIAL_SECURITY__INTERNAL("02", "社会治安内部接入 ", "包括公安办公楼、留置室等"),
SOCIAL_SECURITY_OTHER("03", "社会治安其他接入", ""),
TRAFFIC_ROAD("04", "交通路面接入 ", "包括城市主要干道、国道、高速交通状况监视"),
TRAFFIC_BAYONET("05", "交通卡口接入", "包括交叉路口、“电子警察”、关口、收费站等"),
TRAFFIC_INTERNAL("06", "交通内部接入", "包括交管办公楼等"),
TRAFFIC_OTHER("07", "交通其他接入", ""),
CITY_MANAGEMENT("08", "城市管理接入", ""),
HEALTH_ENVIRONMENTAL_PROTECTION("09", "卫生环保接入", ""),
COMMODITY_INSPECTION_CUSTOMHOUSE("10", "商检海关接入", ""),
EDUCATION_SECTOR("11", "教育部门接入", ""),
CIVIL_AVIATION("12", "民航接入", ""),
RAILWAY("13", "铁路接入", ""),
SHIPPING("14", "航运接入", ""),
AGRICULTURE_FORESTRY_ANIMAL_HUSBANDRY_FISHING("40", "农、林、牧、渔业接入", ""),
MINING("41", "采矿业接入", ""),
MANUFACTURING_INDUSTRY("42", "制造业接入", ""),
ELECTRICITY_HEAT_GAS_AND_WATER_PRODUCTION_AND_SUPPLY("43", "电力、热力、燃气及水生产和供应业接入", ""),
CONSTRUCTION("44", "建筑业接入", ""),
WHOLESALE_AND_RETAIL("45", "批发和零售业接入", ""),
;
/**
*
*/
private String name;
/**
*
*/
private String code;
/**
*
*/
private String notes;
IndustryCodeTypeEnum(String code, String name, String notes) {
this.name = name;
this.code = code;
this.notes = notes;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
}

View File

@ -0,0 +1,45 @@
package com.genersoft.iot.vmp.service.bean;
import org.jetbrains.annotations.NotNull;
public class NetworkIdentificationType implements Comparable<NetworkIdentificationType>{
/**
*
*/
private String name;
/**
*
*/
private String code;
public static NetworkIdentificationType getInstance(NetworkIdentificationTypeEnum typeEnum) {
NetworkIdentificationType industryCodeType = new NetworkIdentificationType();
industryCodeType.setName(typeEnum.getName());
industryCodeType.setCode(typeEnum.getCode());
return industryCodeType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
@Override
public int compareTo(@NotNull NetworkIdentificationType networkIdentificationType) {
return Integer.compare(Integer.parseInt(this.code), Integer.parseInt(networkIdentificationType.getCode()));
}
}

View File

@ -0,0 +1,51 @@
package com.genersoft.iot.vmp.service.bean;
/**
*
*/
public enum NetworkIdentificationTypeEnum {
PUBLIC_SECURITY_VIDEO_TRANSMISSION_NETWORK("0", "公安视频传输网"),
PUBLIC_SECURITY_VIDEO_TRANSMISSION_NETWORK2("1", "公安视频传输网"),
INDUSTRY_SPECIFIC_NETWORK("2", "行业专网"),
POLITICAL_AND_LEGAL_INFORMATION_NETWORK("3", "政法信息网"),
PUBLIC_SECURITY_MOBILE_INFORMATION_NETWORK("4", "公安移动信息网"),
PUBLIC_SECURITY_INFORMATION_NETWORK("5", "公安信息网"),
ELECTRONIC_GOVERNMENT_EXTRANET("6", "电子政务外网"),
PUBLIC_NETWORKS_SUCH_AS_THE_INTERNET("7", "互联网等公共网络"),
Dedicated_Line("8", "专线"),
RESERVE("9", "预留"),
;
/**
*
*/
private String name;
/**
*
*/
private String code;
NetworkIdentificationTypeEnum(String code, String name) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}

View File

@ -2,12 +2,13 @@ package com.genersoft.iot.vmp.service.bean;
import com.genersoft.iot.vmp.utils.DateUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import org.jetbrains.annotations.NotNull;
/**
*
*/
@Schema(description = "区域")
public class Region {
public class Region implements Comparable<Region>{
/**
* ID
*/
@ -101,4 +102,9 @@ public class Region {
public void setCommonRegionUpdateTime(String commonRegionUpdateTime) {
this.commonRegionUpdateTime = commonRegionUpdateTime;
}
@Override
public int compareTo(@NotNull Region region) {
return Integer.compare(Integer.parseInt(this.commonRegionDeviceId), Integer.parseInt(region.getCommonRegionDeviceId()));
}
}

View File

@ -8,9 +8,7 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.Gb28181CodeType;
import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
import com.genersoft.iot.vmp.service.ICommonGbChannelService;
import com.genersoft.iot.vmp.service.bean.Group;
import com.genersoft.iot.vmp.service.bean.CommonGbChannelType;
import com.genersoft.iot.vmp.service.bean.Region;
import com.genersoft.iot.vmp.service.bean.*;
import com.genersoft.iot.vmp.storager.dao.CommonGbChannelMapper;
import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
import com.genersoft.iot.vmp.storager.dao.GroupMapper;
@ -20,6 +18,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.assertj.core.util.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -627,4 +626,37 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
return "";
}
@Override
public List<IndustryCodeType> getIndustryCodeList() {
IndustryCodeTypeEnum[] values = IndustryCodeTypeEnum.values();
List<IndustryCodeType> result = new ArrayList<>(values.length);
for (IndustryCodeTypeEnum value : values) {
result.add(IndustryCodeType.getInstance(value));
}
Collections.sort(result);
return result;
}
@Override
public List<DeviceType> getDeviceTypeList() {
DeviceTypeEnum[] values = DeviceTypeEnum.values();
List<DeviceType> result = new ArrayList<>(values.length);
for (DeviceTypeEnum value : values) {
result.add(DeviceType.getInstance(value));
}
Collections.sort(result);
return result;
}
@Override
public List<NetworkIdentificationType> getNetworkIdentificationTypeList() {
NetworkIdentificationTypeEnum[] values = NetworkIdentificationTypeEnum.values();
List<NetworkIdentificationType> result = new ArrayList<>(values.length);
for (NetworkIdentificationTypeEnum value : values) {
result.add(NetworkIdentificationType.getInstance(value));
}
Collections.sort(result);
return result;
}
}

View File

@ -16,6 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
@ -96,6 +98,8 @@ public class RegionServiceImpl implements IRegionService {
@Override
public List<Region> getAllChild(String parent) {
return civilCodeFileConf.getAllChild(parent);
List<Region> allChild = civilCodeFileConf.getAllChild(parent);
Collections.sort(allChild);
return allChild;
}
}

View File

@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.vmanager.channel;
import com.genersoft.iot.vmp.common.CommonGbChannel;
import com.genersoft.iot.vmp.gb28181.bean.Gb28181CodeType;
import com.genersoft.iot.vmp.service.ICommonGbChannelService;
import com.genersoft.iot.vmp.service.bean.*;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import io.swagger.v3.oas.annotations.Operation;
@ -120,5 +121,28 @@ public class CommonChannelController {
return commonGbChannelService.getRandomCode(type);
}
@Operation(summary = "获取行业编码列表")
@ResponseBody
@GetMapping("/industry/list")
public List<IndustryCodeType> getIndustryCodeList(){
return commonGbChannelService.getIndustryCodeList();
}
@Operation(summary = "获取编码列表")
@ResponseBody
@GetMapping("/type/list")
public List<DeviceType> getDeviceTypeList(){
return commonGbChannelService.getDeviceTypeList();
}
@Operation(summary = "获取编码列表")
@ResponseBody
@GetMapping("/network/identification/list")
public List<NetworkIdentificationType> getNetworkIdentificationTypeList(){
return commonGbChannelService.getNetworkIdentificationTypeList();
}
}