From e96b39935d9f8116149886e21827f3f5cc4525f9 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 10 Nov 2023 16:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=94=9F=E6=88=90=E5=9B=BD?= =?UTF-8?q?=E6=A0=87ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/service/ICommonGbChannelService.java | 8 ++ .../iot/vmp/service/bean/DeviceType.java | 58 +++++++++++ .../iot/vmp/service/bean/DeviceTypeEnum.java | 98 +++++++++++++++++++ .../vmp/service/bean/IndustryCodeType.java | 59 +++++++++++ .../service/bean/IndustryCodeTypeEnum.java | 74 ++++++++++++++ .../bean/NetworkIdentificationType.java | 45 +++++++++ .../bean/NetworkIdentificationTypeEnum.java | 51 ++++++++++ .../iot/vmp/service/bean/Region.java | 8 +- .../impl/CommonGbChannelServiceImpl.java | 38 ++++++- .../vmp/service/impl/RegionServiceImpl.java | 6 +- .../channel/CommonChannelController.java | 24 +++++ 11 files changed, 464 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/genersoft/iot/vmp/service/bean/DeviceType.java create mode 100644 src/main/java/com/genersoft/iot/vmp/service/bean/DeviceTypeEnum.java create mode 100644 src/main/java/com/genersoft/iot/vmp/service/bean/IndustryCodeType.java create mode 100644 src/main/java/com/genersoft/iot/vmp/service/bean/IndustryCodeTypeEnum.java create mode 100644 src/main/java/com/genersoft/iot/vmp/service/bean/NetworkIdentificationType.java create mode 100644 src/main/java/com/genersoft/iot/vmp/service/bean/NetworkIdentificationTypeEnum.java diff --git a/src/main/java/com/genersoft/iot/vmp/service/ICommonGbChannelService.java b/src/main/java/com/genersoft/iot/vmp/service/ICommonGbChannelService.java index 35d7f76b..5736bd39 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/ICommonGbChannelService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/ICommonGbChannelService.java @@ -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 queryChannelList(String query, int page, int count); String getRandomCode(Gb28181CodeType type); + + List getIndustryCodeList(); + + List getDeviceTypeList(); + + List getNetworkIdentificationTypeList(); + } diff --git a/src/main/java/com/genersoft/iot/vmp/service/bean/DeviceType.java b/src/main/java/com/genersoft/iot/vmp/service/bean/DeviceType.java new file mode 100644 index 00000000..cc4e1737 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/service/bean/DeviceType.java @@ -0,0 +1,58 @@ +package com.genersoft.iot.vmp.service.bean; + +import org.jetbrains.annotations.NotNull; + +public class DeviceType implements Comparable{ + + /** + * 编号 + */ + 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())); + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/service/bean/DeviceTypeEnum.java b/src/main/java/com/genersoft/iot/vmp/service/bean/DeviceTypeEnum.java new file mode 100644 index 00000000..af4d554b --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/service/bean/DeviceTypeEnum.java @@ -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; + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/service/bean/IndustryCodeType.java b/src/main/java/com/genersoft/iot/vmp/service/bean/IndustryCodeType.java new file mode 100644 index 00000000..ecd03e2d --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/service/bean/IndustryCodeType.java @@ -0,0 +1,59 @@ +package com.genersoft.iot.vmp.service.bean; + +import org.jetbrains.annotations.NotNull; + +public class IndustryCodeType implements Comparable{ + + /** + * 接入类型码 + */ + 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())); + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/service/bean/IndustryCodeTypeEnum.java b/src/main/java/com/genersoft/iot/vmp/service/bean/IndustryCodeTypeEnum.java new file mode 100644 index 00000000..5c330377 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/service/bean/IndustryCodeTypeEnum.java @@ -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; + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/service/bean/NetworkIdentificationType.java b/src/main/java/com/genersoft/iot/vmp/service/bean/NetworkIdentificationType.java new file mode 100644 index 00000000..509a65a4 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/service/bean/NetworkIdentificationType.java @@ -0,0 +1,45 @@ +package com.genersoft.iot.vmp.service.bean; + +import org.jetbrains.annotations.NotNull; + +public class NetworkIdentificationType implements Comparable{ + + /** + * 接入类型码 + */ + 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())); + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/service/bean/NetworkIdentificationTypeEnum.java b/src/main/java/com/genersoft/iot/vmp/service/bean/NetworkIdentificationTypeEnum.java new file mode 100644 index 00000000..754d327b --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/service/bean/NetworkIdentificationTypeEnum.java @@ -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; + } + +} diff --git a/src/main/java/com/genersoft/iot/vmp/service/bean/Region.java b/src/main/java/com/genersoft/iot/vmp/service/bean/Region.java index 9d636711..5ebab478 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/bean/Region.java +++ b/src/main/java/com/genersoft/iot/vmp/service/bean/Region.java @@ -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{ /** * 数据库自增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())); + } } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java index 2aa04349..432145b2 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/CommonGbChannelServiceImpl.java @@ -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 getIndustryCodeList() { + IndustryCodeTypeEnum[] values = IndustryCodeTypeEnum.values(); + List result = new ArrayList<>(values.length); + for (IndustryCodeTypeEnum value : values) { + result.add(IndustryCodeType.getInstance(value)); + } + Collections.sort(result); + return result; + } + + @Override + public List getDeviceTypeList() { + DeviceTypeEnum[] values = DeviceTypeEnum.values(); + List result = new ArrayList<>(values.length); + for (DeviceTypeEnum value : values) { + result.add(DeviceType.getInstance(value)); + } + Collections.sort(result); + return result; + } + + @Override + public List getNetworkIdentificationTypeList() { + NetworkIdentificationTypeEnum[] values = NetworkIdentificationTypeEnum.values(); + List result = new ArrayList<>(values.length); + for (NetworkIdentificationTypeEnum value : values) { + result.add(NetworkIdentificationType.getInstance(value)); + } + Collections.sort(result); + return result; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/RegionServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/RegionServiceImpl.java index 1b6bb3d3..d760d95b 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/RegionServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/RegionServiceImpl.java @@ -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 getAllChild(String parent) { - return civilCodeFileConf.getAllChild(parent); + List allChild = civilCodeFileConf.getAllChild(parent); + Collections.sort(allChild); + return allChild; } } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java index 65f3bf0a..8f5e0c27 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java @@ -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 getIndustryCodeList(){ + return commonGbChannelService.getIndustryCodeList(); + } + + @Operation(summary = "获取编码列表") + @ResponseBody + @GetMapping("/type/list") + public List getDeviceTypeList(){ + return commonGbChannelService.getDeviceTypeList(); + } + + @Operation(summary = "获取编码列表") + @ResponseBody + @GetMapping("/network/identification/list") + public List getNetworkIdentificationTypeList(){ + return commonGbChannelService.getNetworkIdentificationTypeList(); + } + + + }