From 3496700a5ba18be8ca0590a79e21a867782d1ea9 Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Mon, 01 Jun 2026 16:56:57 +0800
Subject: [PATCH] 优化
---
ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/impl/ArdChannelServiceImpl.java | 19
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IMediaServerService.java | 16
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/impl/GbChannelServiceImpl.java | 68 ++
ard-modules/ard-modules-work/pom.xml | 4
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/IGbChannelService.java | 32 +
ard-modules/pom.xml | 1
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/impl/GbDeviceServiceImpl.java | 57 +
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ZlmStreamService.java | 107 +++
ard-api/ard-api-gb28181/src/main/java/com/ard/gb28181/api/domain/GbDeviceDTO.java | 51 +
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/ZlmRecordPlanServiceImpl.java | 20
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/IGbDeviceService.java | 28
ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/mapper/ArdChannelMapper.java | 1
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/DevicePlayServiceImpl.java | 2
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/domain/GbChannel.java | 58 ++
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/domain/StreamChannel.java | 60 ++
ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/api/ArdChannelApiController.java | 9
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServerServiceImpl.java | 275 ++++----
ard-modules/ard-modules-gb28181/src/main/resources/mapper/gb28181/GbDeviceMapper.xml | 118 ++++
ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/IArdChannelService.java | 1
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/controller/ZlmController.java | 102 +-
/dev/null | 147 -----
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/SourcePlayServiceImpl.java | 2
ard-api/pom.xml | 1
ard-modules/ard-modules-gb28181/src/main/resources/mapper/gb28181/GbChannelMapper.xml | 140 ++++
ard-modules/ard-modules-work/src/main/java/com/ard/work/websocket/config/PTZWebSocketInitializer.java | 24
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IDevicePlayService.java | 2
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ISourcePlayService.java | 2
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/api/Gb28181ApiController.java | 177 ------
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/mapper/GbChannelMapper.java | 38 +
ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServiceImpl.java | 14
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/mapper/GbDeviceMapper.java | 29 +
ard-api/ard-api-gb28181/src/main/java/com/ard/gb28181/api/domain/GbChannelDTO.java | 54 +
ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/domain/GbDevice.java | 55 +
ard-modules/ard-modules-zlm/pom.xml | 5
34 files changed, 1,137 insertions(+), 582 deletions(-)
diff --git a/ard-api/ard-api-gb28181/src/main/java/com/ard/gb28181/api/domain/GbChannelDTO.java b/ard-api/ard-api-gb28181/src/main/java/com/ard/gb28181/api/domain/GbChannelDTO.java
new file mode 100644
index 0000000..168ceff
--- /dev/null
+++ b/ard-api/ard-api-gb28181/src/main/java/com/ard/gb28181/api/domain/GbChannelDTO.java
@@ -0,0 +1,54 @@
+package com.ard.gb28181.api.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 国标通道 DTO(播放用)
+ *
+ * @author 刘苏义
+ * @date 2026-05-30
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GbChannelDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /** 主键ID */
+ private Long id;
+
+ /** 父设备国标编码 */
+ private String gbDeviceId;
+
+ /** 国标通道编码 */
+ private String gbChannelId;
+
+ /** 通道名称 */
+ private String channelName;
+
+ /** 流标识(用于ZLM) */
+ private String deviceCode;
+
+ /** 数据流传输模式 */
+ private String streamMode;
+
+ /** 开启mp4录制 */
+ private String enableMp4;
+
+ /** 流状态 */
+ private String streamStatus;
+
+ /** 流媒体服务ID */
+ private String mediaServerId;
+
+ /** stream key */
+ private String streamKey;
+
+ /** 截图路径 */
+ private String snap;
+}
diff --git a/ard-api/ard-api-gb28181/src/main/java/com/ard/gb28181/api/domain/GbDeviceDTO.java b/ard-api/ard-api-gb28181/src/main/java/com/ard/gb28181/api/domain/GbDeviceDTO.java
new file mode 100644
index 0000000..0b12775
--- /dev/null
+++ b/ard-api/ard-api-gb28181/src/main/java/com/ard/gb28181/api/domain/GbDeviceDTO.java
@@ -0,0 +1,51 @@
+package com.ard.gb28181.api.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 国标设备 DTO(设备列表展示用)
+ *
+ * @author 刘苏义
+ * @date 2026-05-30
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GbDeviceDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /** 主键ID */
+ private Long id;
+
+ /** 国标设备编码 */
+ private String gbDeviceId;
+
+ /** 设备名称 */
+ private String deviceName;
+
+ /** 设备编码 */
+ private String deviceCode;
+
+ /** 设备IP地址 */
+ private String ip;
+
+ /** 设备端口 */
+ private Integer port;
+
+ /** 设备厂商 */
+ private String manufacturer;
+
+ /** 设备型号 */
+ private String model;
+
+ /** 固件版本 */
+ private String firmware;
+
+ /** 在线状态 */
+ private Boolean onLine;
+}
diff --git a/ard-api/ard-api-qs/pom.xml b/ard-api/ard-api-qs/pom.xml
deleted file mode 100644
index 2c48858..0000000
--- a/ard-api/ard-api-qs/pom.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>com.ard</groupId>
- <artifactId>ard-api</artifactId>
- <version>3.6.8</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>ard-api-qs</artifactId>
-
- <description>
- ard-api-qs系统接口模块
- </description>
-
- <dependencies>
-
- <!-- Ard Common Core-->
- <dependency>
- <groupId>com.ard</groupId>
- <artifactId>ard-common-core</artifactId>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/RemoteQsDeviceService.java b/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/RemoteQsDeviceService.java
deleted file mode 100644
index d78d4c4..0000000
--- a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/RemoteQsDeviceService.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.ard.qs.api;
-
-import com.ard.common.core.constant.SecurityConstants;
-import com.ard.common.core.constant.ServiceNameConstants;
-import com.ard.common.core.domain.R;
-import com.ard.qs.api.domain.QsDevice;
-import com.ard.qs.api.factory.RemoteQsDeviceFallbackFactory;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * 视频监控设备 服务
- *
- * @FileName RemoteQsDeviceService
- * @Description
- * @Author fengcheng
- * @date 2026-03-28
- **/
-@FeignClient(contextId = "remoteQsDeviceService", value = ServiceNameConstants.QS_SERVICE, fallbackFactory = RemoteQsDeviceFallbackFactory.class)
-public interface RemoteQsDeviceService {
-
- /**
- * 查询视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @param source 请求来源
- * @return
- */
- @PostMapping("/api/device/allList")
- public R<List<QsDevice>> list(QsDevice qsDevice, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
-
- /**
- * 更新设备在线状态
- *
- * @param onlineDeviceSet 在线设备集合
- * @param deviceStatus 设备状态
- * @param inner 请求来源
- * @return
- */
- @PostMapping("/api/device/updateDeviceStatusList/{deviceStatus}")
- public R<Boolean> updateQsDeviceStatusList(@RequestBody Set<Long> onlineDeviceSet, @PathVariable String deviceStatus, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
-
- /**
- * 修改视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @param inner 请求来源
- * @return
- */
- @PutMapping("/api/device/updateQsDevice")
- public R<Boolean> updateQsDevice(@RequestBody QsDevice qsDevice, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
-
- /**
- * 移除视频监控设备
- *
- * @param ids 视频监控设备
- * @param inner 请求来源
- * @return
- */
- @PutMapping("/api/device/removeQsDevice/{ids}")
- public R<Boolean> removeQsDevice(@PathVariable String[] ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 根据流id获取视频监控设备
- *
- * @param stream 流id
- * @param inner 请求来源
- * @return
- */
- @GetMapping("/api/device/getQsDeviceStream/{stream}")
- R<QsDevice> getQsDeviceStream(@PathVariable String stream, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 获取视频监控设备详细信息
- *
- * @param id 设备id
- * @param inner 请求来源
- * @return
- */
- @GetMapping("/api/device/getQsDeviceInfo/{id}")
- R<QsDevice> getQsDeviceInfo(@PathVariable Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 设备状态任务
- *
- * @param inner 请求来源
- * @return
- */
- @GetMapping("/api/device/task")
- R<QsDevice> task(@RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 清理设备计划id
- *
- * @param planId 设备id
- * @param inner 请求来源
- */
- @GetMapping("/api/device/cleanRecordPlanId/{planId}")
- R<Void> cleanRecordPlanId(@PathVariable Long planId, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 根据设备id集合查询设备信息
- *
- * @param startDeviceIdList 设备id集合
- * @param inner 请求来源
- * @return
- */
- @GetMapping("/api/device/queryByIds/{startDeviceIdList}")
- R<List<QsDevice>> queryByIds(@PathVariable List<Long> startDeviceIdList, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 根据计划id查询设备数量
- *
- * @param planId 计划id
- * @param inner 请求来源
- * @return
- */
- @GetMapping("/api/device/countRecordPlanDevice/{planId}")
- R<Integer> countRecordPlanDevice(@PathVariable Long planId, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 新增视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @param inner 请求来源
- * @return
- */
- @PostMapping("/api/device/addQsDevice")
- public R<Boolean> addQsDevice(QsDevice qsDevice, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 根据 gbDeviceId 更新设备在线状态
- *
- * @param gbDeviceId 国标设备编号
- * @param deviceStatus 设备状态(ON/OFFLINE)
- * @param inner 请求来源
- * @return
- */
- @PostMapping("/api/device/updateDeviceStatusByGbDeviceId/{gbDeviceId}/{deviceStatus}")
- public R<Boolean> updateDeviceStatusByGbDeviceId(@PathVariable String gbDeviceId, @PathVariable String deviceStatus, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-
- /**
- * 根据 jtMobileNo 更新设备在线状态
- *
- * @param jtMobileNo 设备手机号
- * @param deviceStatus 设备状态(ON/OFFLINE)
- * @param inner 请求来源
- * @return
- */
- @PostMapping("/api/device/updateDeviceStatusByJtMobileNo/{jtMobileNo}/{deviceStatus}")
- public R<Boolean> updateDeviceStatusByJtMobileNo(@PathVariable String jtMobileNo, @PathVariable String deviceStatus, @RequestHeader(SecurityConstants.FROM_SOURCE) String inner);
-}
diff --git a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/common/CivilCodePo.java b/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/common/CivilCodePo.java
deleted file mode 100644
index dae12f6..0000000
--- a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/common/CivilCodePo.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.ard.qs.api.common;
-
-
-import org.springframework.util.ObjectUtils;
-
-public class CivilCodePo {
-
- private String code;
-
- private String name;
-
- private String parentCode;
-
- public static CivilCodePo getInstance(String[] infoArray) {
- CivilCodePo civilCodePo = new CivilCodePo();
- civilCodePo.setCode(infoArray[0]);
- civilCodePo.setName(infoArray[1]);
- if (!ObjectUtils.isEmpty(infoArray[2])) {
- civilCodePo.setParentCode(infoArray[2]);
- }
- return civilCodePo;
- }
-
- public String getCode() {
- return code;
- }
-
- public void setCode(String code) {
- this.code = code;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getParentCode() {
- return parentCode;
- }
-
- public void setParentCode(String parentCode) {
- this.parentCode = parentCode;
- }
-}
diff --git a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsDevice.java b/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsDevice.java
deleted file mode 100644
index 65019d2..0000000
--- a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsDevice.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package com.ard.qs.api.domain;
-
-import com.ard.common.core.web.domain.BaseEntity;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-
-/**
- * 视频监控设备对象 qs_device
- *
- * @author fengcheng
- * @date 2026-03-27
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-@AllArgsConstructor
-@NoArgsConstructor
-public class QsDevice extends BaseEntity
-{
- private static final long serialVersionUID = 1L;
-
- /** 主键ID */
- private Long id;
-
- /** 设备唯一标识 */
- private String deviceCode;
-
- /** 设备名称 */
- private String deviceName;
-
- /** IP地址 */
- private String ipAddress;
-
- /** 端口号 */
- private Integer port;
-
- /** 用户名 */
- private String userName;
-
- /** 密码 */
- private String password;
-
- /** 直播流接入类型(1=RTSP,2=RTMP,3=FLV,4=HLS,5=ONVIF,6=视频文件,7=海康SDK,8=海康ISUP,9=大华SDK,10=宇视SDK,11=天地伟业SDK,12=国标28181,13=PUSH,14=部标1078) */
- private String type;
-
- /** 设备类型(0=IPC, 1=NVR) */
- private Integer deviceType;
-
- /** 直播流地址 */
- private String liveAddress;
-
- /** 通道号 */
- private Integer channel;
-
- /** 报警通道号 */
- private Integer alarmChannelId;
-
- /** 状态(ENABLE/DEACTIVATE) */
- private String status;
-
- /** 码流类型(1=主码流,2=子码流,3=第三码流) */
- private String streamType;
-
- /** 经度 */
- private String longitude;
-
- /** 纬度 */
- private String latitude;
-
- /** 国标编码 */
- private String gbCode;
-
- /** 传输协议(UDP/TCP) */
- private String protocol;
-
- /** 设备状态(OFFLINE=离线,ON=在线) */
- private String deviceStatus;
-
- /** 上线类型(1=主动添加, 2=主动注册) */
- private String onlineType;
-
- /** 开启音频(0=关闭, 1=开启) */
- private String enableAudio;
-
- /** 开启mp4录制(0=关闭, 1=开启) */
- private String enableMp4;
-
- /** 流状态(0=停止,1=直播中) */
- private String streamStatus;
-
- /** 当前拉流使用的流媒体服务ID */
- private String mediaServerId;
-
- /** 拉流代理时zlm返回的key,用于停止拉流代理 */
- private String streamKey;
-
- /** 是否 无人观看时自动停用 */
- private String enableDisableNoneReader;
-
- /** 截图路径 */
- private String snap;
-
- /** flv 类型(ws/flv) */
- private String flvType;
-
- /** omvif 验证类型(1=WS-UsernameToken,2=Digest */
- private String onvifAuth;
-
- /** onvif 主机名 */
- private String onvifHostName;
-
- /** 录制计划id */
- private String recordPlanId;
-
- /** 国标-行政区域 */
- private String gbCivilCode;
-
- /** 国标-义务分组 */
- private String gbBusinessGroupId;
-
- /** 国标-父节点ID */
- private String gbParentId;
-
- /** 生产厂商 */
- private String manufacturer;
-
- /** 安装地址 */
- private String address;
-
- /**
- * 摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道
- */
- private Integer ptzType;
-
- /**
- * gb设备id
- */
- private String gbDeviceId;
-
- /**
- * gb通道id
- */
- private String gbChannelId;
-
- /**
- * 数据流传输模式
- * UDP:udp传输
- * TCP-ACTIVE:tcp主动模式
- * TCP-PASSIVE:tcp被动模式
- */
- private String streamMode;
-
- /** JT1078-手机号 */
- private String jtMobileNo;
-
- /** JT1078-车牌号 */
- private String jtPlateNo;
-
- /** JT1078-车牌颜色 */
- private String jtPlateColor;
-}
diff --git a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsGroup.java b/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsGroup.java
deleted file mode 100644
index 6559bb9..0000000
--- a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsGroup.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.ard.qs.api.domain;
-
-import com.ard.common.core.web.domain.BaseEntity;
-import jakarta.validation.constraints.NotNull;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 业务分组
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-public class QsGroup extends BaseEntity implements Comparable<QsGroup> {
- /**
- * 数据库自增ID
- */
- private int id;
-
- /**
- * 区域国标编号
- */
- private String deviceId;
-
- /**
- * 区域名称
- */
- private String name;
-
- /**
- * 父分组ID
- */
- private Integer parentId;
-
- /**
- * 父区域国标ID
- */
- private String parentDeviceId;
-
- /**
- * 所属的业务分组国标编号
- */
- private String businessGroup;
-
- /**
- * 行政区划
- */
- private String civilCode;
-
- /**
- * 别名
- */
- private String alias;
-
- @Override
- public int compareTo(@NotNull QsGroup region) {
- return Integer.compare(Integer.parseInt(this.deviceId), Integer.parseInt(region.getDeviceId()));
- }
-}
diff --git a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsRegion.java b/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsRegion.java
deleted file mode 100644
index 59b43ee..0000000
--- a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/domain/QsRegion.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.ard.qs.api.domain;
-
-import com.ard.common.core.utils.DateUtils;
-import com.ard.common.core.web.domain.BaseEntity;
-import jakarta.validation.constraints.NotNull;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 区域
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-public class QsRegion extends BaseEntity implements Comparable<QsRegion> {
- /**
- * 数据库自增ID
- */
- private int id;
-
- /**
- * 区域国标编号
- */
- private String deviceId;
-
- /**
- * 区域名称
- */
- private String name;
-
- /**
- * 父区域国标ID
- */
- private Integer parentId;
-
- /**
- * 父区域国标ID
- */
- private String parentDeviceId;
-
- @Override
- public int compareTo(@NotNull QsRegion qsRegion) {
- return Integer.compare(Integer.parseInt(this.deviceId), Integer.parseInt(qsRegion.getDeviceId()));
- }
-
- public static QsRegion getInstance(String commonRegionDeviceId, String commonRegionName, String commonRegionParentId) {
- QsRegion region = new QsRegion();
- region.setDeviceId(commonRegionDeviceId);
- region.setName(commonRegionName);
- region.setParentDeviceId(commonRegionParentId);
- region.setCreateTime(DateUtils.getNowDate());
- region.setUpdateTime(DateUtils.getNowDate());
- return region;
- }
-}
diff --git a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/factory/RemoteQsDeviceFallbackFactory.java b/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/factory/RemoteQsDeviceFallbackFactory.java
deleted file mode 100644
index 66cb59e..0000000
--- a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/factory/RemoteQsDeviceFallbackFactory.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package com.ard.qs.api.factory;
-
-import com.ard.common.core.domain.R;
-import com.ard.qs.api.RemoteQsDeviceService;
-import com.ard.qs.api.domain.QsDevice;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.cloud.openfeign.FallbackFactory;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * 视频监控设备服务降级处理
- *
- * @FileName RemoteQsDeviceFallbackFactory
- * @Description
- * @Author fengcheng
- * @date 2026-03-28
- **/
-@Component
-public class RemoteQsDeviceFallbackFactory implements FallbackFactory<RemoteQsDeviceService> {
-
- private static final Logger log = LoggerFactory.getLogger(RemoteQsDeviceFallbackFactory.class);
-
- @Override
- public RemoteQsDeviceService create(Throwable throwable) {
- log.error("视频监控设备服务调用失败:{}", throwable.getMessage());
-
- return new RemoteQsDeviceService() {
- @Override
- public R<List<QsDevice>> list(QsDevice qsDevice, String source) {
- return R.fail("查询视频监控设备失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Boolean> updateQsDeviceStatusList(Set<Long> onlineDeviceSet, String deviceStatus, String inner) {
- return R.fail("更新设备在线状态失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Boolean> updateQsDevice(QsDevice qsDevice, String inner) {
- return R.fail("修改视频监控设备失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Boolean> removeQsDevice(String[] ids, String inner) {
- return R.fail("移除视频监控设备失败:" + throwable.getMessage());
- }
-
- @Override
- public R<QsDevice> getQsDeviceStream(String stream, String inner) {
- return R.fail("根据流id获取视频监控设备失败:" + throwable.getMessage());
- }
-
-
- @Override
- public R<QsDevice> getQsDeviceInfo(Long id, String inner) {
- return R.fail("获取视频监控设备详细信息失败:" + throwable.getMessage());
- }
-
- @Override
- public R<QsDevice> task(String inner) {
- return R.fail("设备状态任务失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Void> cleanRecordPlanId(Long planId, String inner) {
- return R.fail("设备清理设备计划id失败:" + throwable.getMessage());
- }
-
- @Override
- public R<List<QsDevice>> queryByIds(List<Long> startDeviceIdList, String inner) {
- return R.fail("根据设备id集合查询设备信息失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Integer> countRecordPlanDevice(Long planId, String inner) {
- return R.fail("根据计划id查询设备数量失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Boolean> addQsDevice(QsDevice qsDevice, String inner) {
- return R.fail("新增视频监控设备失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Boolean> updateDeviceStatusByGbDeviceId(String gbDeviceId, String deviceStatus, String inner) {
- return R.fail("根据 gbDeviceId 更新设备在线状态失败:" + throwable.getMessage());
- }
-
- @Override
- public R<Boolean> updateDeviceStatusByJtMobileNo(String jtMobileNo, String deviceStatus, String inner) {
- return R.fail("根据 jtMobileNo 更新设备在线状态失败:" + throwable.getMessage());
- }
- };
- }
-}
diff --git a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/utils/CivilCodeUtil.java b/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/utils/CivilCodeUtil.java
deleted file mode 100644
index 2ccbc05..0000000
--- a/ard-api/ard-api-qs/src/main/java/com/ard/qs/api/utils/CivilCodeUtil.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package com.ard.qs.api.utils;
-
-import com.ard.qs.api.common.CivilCodePo;
-import com.ard.qs.api.domain.QsRegion;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.util.ObjectUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-@Slf4j
-public enum CivilCodeUtil {
-
- INSTANCE;
- // 用与消息的缓存
- private final Map<String, CivilCodePo> civilCodeMap = new ConcurrentHashMap<>();
-
- CivilCodeUtil() {
- }
-
- public void add(List<CivilCodePo> civilCodePoList) {
- if (!civilCodePoList.isEmpty()) {
- for (CivilCodePo civilCodePo : civilCodePoList) {
- civilCodeMap.put(civilCodePo.getCode(), civilCodePo);
- }
- }
- }
-
- public void add(CivilCodePo civilCodePo) {
- civilCodeMap.put(civilCodePo.getCode(), civilCodePo);
- }
-
- public CivilCodePo get(String code) {
- return civilCodeMap.get(code);
- }
-
- public CivilCodePo getParentCode(String code) {
- if (code.length() > 8) {
- return null;
- }
- if (code.length() == 8) {
- String parentCode = code.substring(0, 6);
- return civilCodeMap.get(parentCode);
- } else {
- CivilCodePo civilCodePo = civilCodeMap.get(code);
- if (civilCodePo == null) {
- return null;
- }
- String parentCode = civilCodePo.getParentCode();
- if (parentCode == null) {
- return null;
- }
- return civilCodeMap.get(parentCode);
- }
- }
-
- public CivilCodePo getCivilCodePo(String code) {
- if (code.length() > 8) {
- return null;
- } else {
- return civilCodeMap.get(code);
- }
- }
-
- public List<CivilCodePo> getAllParentCode(String civilCode) {
- List<CivilCodePo> civilCodePoList = new ArrayList<>();
- CivilCodePo parentCode = getParentCode(civilCode);
- if (parentCode != null) {
- civilCodePoList.add(parentCode);
- List<CivilCodePo> allParentCode = getAllParentCode(parentCode.getCode());
- if (!allParentCode.isEmpty()) {
- civilCodePoList.addAll(allParentCode);
- } else {
- return civilCodePoList;
- }
- }
- return civilCodePoList;
- }
-
- public boolean isEmpty() {
- return civilCodeMap.isEmpty();
- }
-
- public int size() {
- return civilCodeMap.size();
- }
-
- public List<QsRegion> getAllChild(String parent) {
- List<QsRegion> result = new ArrayList<>();
- for (String key : civilCodeMap.keySet()) {
- if (parent == null) {
- if (ObjectUtils.isEmpty(civilCodeMap.get(key).getParentCode().trim())) {
- result.add(QsRegion.getInstance(key, civilCodeMap.get(key).getName(), civilCodeMap.get(key).getParentCode()));
- }
- } else if (civilCodeMap.get(key).getParentCode().equals(parent)) {
- result.add(QsRegion.getInstance(key, civilCodeMap.get(key).getName(), civilCodeMap.get(key).getParentCode()));
- }
- }
- return result;
- }
-}
diff --git a/ard-api/ard-api-qs/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/ard-api/ard-api-qs/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
deleted file mode 100644
index b9b5b02..0000000
--- a/ard-api/ard-api-qs/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ /dev/null
@@ -1 +0,0 @@
-com.ard.qs.api.factory.RemoteQsDeviceFallbackFactory
\ No newline at end of file
diff --git a/ard-api/pom.xml b/ard-api/pom.xml
index f23b01f..61ecac3 100644
--- a/ard-api/pom.xml
+++ b/ard-api/pom.xml
@@ -13,7 +13,6 @@
<module>ard-api-work</module>
<module>ard-api-vtdu</module>
<module>ard-api-zlm</module>
- <module>ard-api-qs</module>
<module>ard-api-gb28181</module>
</modules>
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/api/Gb28181ApiController.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/api/Gb28181ApiController.java
index 2923efb..73a8020 100644
--- a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/api/Gb28181ApiController.java
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/api/Gb28181ApiController.java
@@ -809,181 +809,4 @@
dto.setSnap(c.getSnap());
return dto;
}
-
- /**
- * 一键迁移:将 Redis 中已注册的国标设备同步到 MySQL(供首次执行 SQL 后使用)
- */
- @Operation(summary = "迁移Redis国标设备到MySQL")
- @PostMapping("/migrateGbDevices")
- public R<String> migrateGbDevices() {
- List<Device> allDevices = deviceService.getAllDevices();
- int deviceCount = 0;
- int channelCount = 0;
-
- for (Device device : allDevices) {
- try {
- // 创建设备记录
- GbDevice existingDevice = gbDeviceService.selectGbDeviceByGbDeviceId(device.getDeviceId());
- if (existingDevice == null) {
- GbDevice gbDevice = new GbDevice();
- gbDevice.setGbDeviceId(device.getDeviceId());
- gbDevice.setDeviceName(StringUtils.hasText(device.getName()) ? device.getName() : device.getDeviceId());
- gbDevice.setDeviceCode(device.getDeviceId());
- gbDevice.setIp(device.getIp());
- gbDevice.setPort(device.getPort());
- gbDevice.setManufacturer(device.getManufacturer());
- gbDevice.setModel(device.getModel());
- gbDevice.setFirmware(device.getFirmware());
- gbDevice.setOnLine(device.isOnLine());
- gbDeviceService.insertGbDevice(gbDevice);
- deviceCount++;
- log.info("[迁移] 创建设备: {}", device.getDeviceId());
- }
-
- // 创建默认通道(设备自身)
- GbChannel existingDefaultChannel = gbChannelService.selectByGbDeviceIdAndGbChannelId(
- device.getDeviceId(), device.getDeviceId());
- if (existingDefaultChannel == null) {
- GbChannel gbChannel = new GbChannel();
- gbChannel.setGbDeviceId(device.getDeviceId());
- gbChannel.setGbChannelId(device.getDeviceId());
- gbChannel.setChannelName(StringUtils.hasText(device.getName()) ? device.getName() : device.getDeviceId());
- gbChannel.setDeviceCode(device.getDeviceId());
- gbChannel.setStreamMode(device.getStreamMode() != null ? device.getStreamMode() : "TCP-PASSIVE");
- gbChannel.setEnableMp4("0");
- gbChannelService.insertGbChannel(gbChannel);
- channelCount++;
- }
-
- // 创建所有通道
- List<DeviceChannel> channels = deviceService.getChannelsByDeviceId(device.getDeviceId());
- if (channels != null) {
- for (DeviceChannel channel : channels) {
- String channelId = channel.getDeviceId();
- if (channelId == null || channelId.length() <= 8) {
- continue;
- }
- if (channelId.length() == 20) {
- try {
- com.ard.gb28181.api.domain.GbCode gbCode = com.ard.gb28181.api.domain.GbCode.decode(channelId);
- if (gbCode != null && ("215".equals(gbCode.getTypeCode()) || "216".equals(gbCode.getTypeCode()))) {
- continue;
- }
- } catch (Exception ignored) {}
- }
- GbChannel existing = gbChannelService.selectByGbDeviceIdAndGbChannelId(device.getDeviceId(), channelId);
- if (existing == null) {
- GbChannel gbChannel = new GbChannel();
- gbChannel.setGbDeviceId(device.getDeviceId());
- gbChannel.setGbChannelId(channelId);
- gbChannel.setChannelName(StringUtils.hasText(channel.getName()) ? channel.getName() : channelId);
- gbChannel.setDeviceCode(channelId);
- gbChannel.setStreamMode(device.getStreamMode() != null ? device.getStreamMode() : "TCP-PASSIVE");
- gbChannel.setEnableMp4("0");
- gbChannelService.insertGbChannel(gbChannel);
- channelCount++;
- }
- }
- }
- } catch (Exception e) {
- log.error("[迁移] 处理设备失败: {}", device.getDeviceId(), e);
- }
- }
-
- return R.ok("迁移完成: 设备 " + deviceCount + " 条, 通道 " + channelCount + " 条");
- }
-
- /**
- * 从 Redis 同步通道数据到 MySQL,使 ard_gb_channel 与 Redis 一致
- */
- @Operation(summary = "从Redis同步通道到MySQL")
- @PostMapping("/syncGbChannelsFromRedis")
- public R<String> syncGbChannelsFromRedis() {
- List<Device> allDevices = deviceService.getAllRedisDevices();
- int createdCount = 0;
- int deletedCount = 0;
- int skippedCount = 0;
-
- for (Device device : allDevices) {
- try {
- String deviceId = device.getDeviceId();
- List<DeviceChannel> redisChannels = deviceService.getChannelsByDeviceId(deviceId);
- if (redisChannels == null) {
- redisChannels = new ArrayList<>();
- }
-
- Set<String> redisChannelIds = new HashSet<>();
- boolean hasRealSubChannel = false;
-
- for (DeviceChannel ch : redisChannels) {
- String channelId = ch.getDeviceId();
- if (channelId == null || channelId.length() <= 8) {
- continue;
- }
- if (channelId.length() == 20) {
- try {
- GbCode gbCode = GbCode.decode(channelId);
- if (gbCode != null && ("215".equals(gbCode.getTypeCode()) || "216".equals(gbCode.getTypeCode()))) {
- continue;
- }
- } catch (Exception ignored) {}
- }
- redisChannelIds.add(channelId);
- if (!channelId.equals(deviceId)) {
- hasRealSubChannel = true;
- }
-
- GbChannel existing = gbChannelService.selectByGbDeviceIdAndGbChannelId(deviceId, channelId);
- if (existing == null) {
- GbChannel gbChannel = new GbChannel();
- gbChannel.setGbDeviceId(deviceId);
- gbChannel.setGbChannelId(channelId);
- gbChannel.setChannelName(StringUtils.hasText(ch.getName()) ? ch.getName() : channelId);
- gbChannel.setDeviceCode(channelId);
- gbChannel.setStreamMode(device.getStreamMode() != null ? device.getStreamMode() : "TCP-PASSIVE");
- gbChannel.setEnableMp4("0");
- gbChannelService.insertGbChannel(gbChannel);
- createdCount++;
- log.info("[同步] 创建通道: deviceId={}, channelId={}", deviceId, channelId);
- } else if (StringUtils.hasText(ch.getName())
- && !ch.getName().equals(existing.getChannelName())) {
- existing.setChannelName(ch.getName());
- gbChannelService.updateGbChannel(existing);
- log.info("[同步] 更新通道名称: deviceId={}, channelId={}, {} -> {}",
- deviceId, channelId, existing.getChannelName(), ch.getName());
- }
- }
-
- List<GbChannel> mysqlChannels = gbChannelService.selectGbChannelByGbDeviceId(deviceId);
- for (GbChannel mysqlCh : mysqlChannels) {
- if (!redisChannelIds.contains(mysqlCh.getGbChannelId())) {
- if ("1".equals(mysqlCh.getStreamStatus())) {
- skippedCount++;
- continue;
- }
- gbChannelService.deleteGbChannelById(mysqlCh.getId());
- deletedCount++;
- }
- }
-
- if (hasRealSubChannel) {
- GbChannel defaultChannel = gbChannelService.selectByGbDeviceIdAndGbChannelId(deviceId, deviceId);
- if (defaultChannel != null && !redisChannelIds.contains(deviceId)) {
- if (!"1".equals(defaultChannel.getStreamStatus())) {
- gbChannelService.deleteGbChannelById(defaultChannel.getId());
- deletedCount++;
- } else {
- skippedCount++;
- }
- }
- }
-
- } catch (Exception e) {
- log.error("[同步] 处理设备失败: {}", device.getDeviceId(), e);
- }
- }
-
- return R.ok(String.format("同步完成: 创建 %d 条, 删除 %d 条, 跳过 %d 条(推流中)",
- createdCount, deletedCount, skippedCount));
- }
}
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/domain/GbChannel.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/domain/GbChannel.java
new file mode 100644
index 0000000..3485cbe
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/domain/GbChannel.java
@@ -0,0 +1,58 @@
+package com.ard.gb28181.domain;
+
+import com.ard.common.core.web.domain.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 国标设备通道对象 ard_gb_channel
+ * <p>
+ * 存储国标设备下的通道信息,用于播放。
+ * 一个 NVR 下的每个摄像头通道对应一条记录。
+ *
+ * @author 刘苏义
+ * @date 2026-05-30
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GbChannel extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /** 主键ID */
+ private Long id;
+
+ /** 父设备国标编码(关联 ard_gb_device.gb_device_id) */
+ private String gbDeviceId;
+
+ /** 国标通道编码 */
+ private String gbChannelId;
+
+ /** 通道名称 */
+ private String channelName;
+
+ /** 流标识(用于ZLM,默认等同gbChannelId) */
+ private String deviceCode;
+
+ /** 数据流传输模式(UDP/TCP-ACTIVE/TCP-PASSIVE) */
+ private String streamMode;
+
+ /** 开启mp4录制(0=关闭, 1=开启) */
+ private String enableMp4;
+
+ /** 流状态(0=停止, 1=直播中) */
+ private String streamStatus;
+
+ /** 当前拉流使用的流媒体服务ID */
+ private String mediaServerId;
+
+ /** 拉流时zlm返回的stream key */
+ private String streamKey;
+
+ /** 截图路径 */
+ private String snap;
+}
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/domain/GbDevice.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/domain/GbDevice.java
new file mode 100644
index 0000000..8fb5841
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/domain/GbDevice.java
@@ -0,0 +1,55 @@
+package com.ard.gb28181.domain;
+
+import com.ard.common.core.web.domain.BaseEntity;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+/**
+ * 国标设备对象 ard_gb_device
+ * <p>
+ * 存储国标设备的注册信息和业务展示数据。
+ * 一个 NVR/IPC 设备对应一条记录。
+ *
+ * @author 刘苏义
+ * @date 2026-05-30
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GbDevice extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /** 主键ID */
+ private Long id;
+
+ /** 国标设备编码(20位) */
+ private String gbDeviceId;
+
+ /** 设备名称(来自注册/设备信息查询) */
+ private String deviceName;
+
+ /** 设备编码(业务用) */
+ private String deviceCode;
+
+ /** 设备IP地址 */
+ private String ip;
+
+ /** 设备端口 */
+ private Integer port;
+
+ /** 设备厂商 */
+ private String manufacturer;
+
+ /** 设备型号 */
+ private String model;
+
+ /** 固件版本 */
+ private String firmware;
+
+ /** 在线状态(true=在线, false=离线) */
+ private Boolean onLine;
+}
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/mapper/GbChannelMapper.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/mapper/GbChannelMapper.java
new file mode 100644
index 0000000..f1cf290
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/mapper/GbChannelMapper.java
@@ -0,0 +1,38 @@
+package com.ard.gb28181.mapper;
+
+import com.ard.gb28181.domain.GbChannel;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 国标通道Mapper接口
+ *
+ * @author 刘苏义
+ * @date 2026-05-30
+ */
+@Mapper
+@Repository
+public interface GbChannelMapper {
+
+ GbChannel selectGbChannelById(Long id);
+
+ List<GbChannel> selectGbChannelByGbDeviceId(String gbDeviceId);
+
+ GbChannel selectByGbDeviceIdAndGbChannelId(@Param("gbDeviceId") String gbDeviceId,
+ @Param("gbChannelId") String gbChannelId);
+
+ List<GbChannel> selectGbChannelList(GbChannel gbChannel);
+
+ int insertGbChannel(GbChannel gbChannel);
+
+ int updateGbChannel(GbChannel gbChannel);
+
+ int updateGbChannelStream(GbChannel gbChannel);
+
+ int deleteGbChannelById(Long id);
+
+ int deleteGbChannelByIds(String[] ids);
+}
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/mapper/GbDeviceMapper.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/mapper/GbDeviceMapper.java
new file mode 100644
index 0000000..e5f8e8d
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/mapper/GbDeviceMapper.java
@@ -0,0 +1,29 @@
+package com.ard.gb28181.mapper;
+
+import com.ard.gb28181.domain.GbDevice;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 国标设备Mapper接口
+ */
+@Mapper
+@Repository
+public interface GbDeviceMapper {
+
+ GbDevice selectGbDeviceById(Long id);
+
+ GbDevice selectGbDeviceByGbDeviceId(String gbDeviceId);
+
+ List<GbDevice> selectGbDeviceList(GbDevice gbDevice);
+
+ int insertGbDevice(GbDevice gbDevice);
+
+ int updateGbDevice(GbDevice gbDevice);
+
+ int deleteGbDeviceById(Long id);
+
+ int deleteGbDeviceByIds(String[] ids);
+}
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/IGbChannelService.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/IGbChannelService.java
new file mode 100644
index 0000000..f1a6367
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/IGbChannelService.java
@@ -0,0 +1,32 @@
+package com.ard.gb28181.service;
+
+import com.ard.gb28181.domain.GbChannel;
+
+import java.util.List;
+
+/**
+ * 国标通道Service接口
+ *
+ * @author 刘苏义
+ * @date 2026-05-30
+ */
+public interface IGbChannelService {
+
+ GbChannel selectGbChannelById(Long id);
+
+ List<GbChannel> selectGbChannelByGbDeviceId(String gbDeviceId);
+
+ GbChannel selectByGbDeviceIdAndGbChannelId(String gbDeviceId, String gbChannelId);
+
+ List<GbChannel> selectGbChannelList(GbChannel gbChannel);
+
+ int insertGbChannel(GbChannel gbChannel);
+
+ int updateGbChannel(GbChannel gbChannel);
+
+ int updateGbChannelStream(GbChannel gbChannel);
+
+ int deleteGbChannelById(Long id);
+
+ int deleteGbChannelByIds(String[] ids);
+}
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/IGbDeviceService.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/IGbDeviceService.java
new file mode 100644
index 0000000..c693f2d
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/IGbDeviceService.java
@@ -0,0 +1,28 @@
+package com.ard.gb28181.service;
+
+import com.ard.gb28181.domain.GbDevice;
+
+import java.util.List;
+
+/**
+ * 国标设备Service接口
+ *
+ * @author 刘苏义
+ * @date 2026-05-30
+ */
+public interface IGbDeviceService {
+
+ GbDevice selectGbDeviceById(Long id);
+
+ GbDevice selectGbDeviceByGbDeviceId(String gbDeviceId);
+
+ List<GbDevice> selectGbDeviceList(GbDevice gbDevice);
+
+ int insertGbDevice(GbDevice gbDevice);
+
+ int updateGbDevice(GbDevice gbDevice);
+
+ int deleteGbDeviceById(Long id);
+
+ int deleteGbDeviceByIds(String[] ids);
+}
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/impl/GbChannelServiceImpl.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/impl/GbChannelServiceImpl.java
new file mode 100644
index 0000000..bcb6a64
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/impl/GbChannelServiceImpl.java
@@ -0,0 +1,68 @@
+package com.ard.gb28181.service.impl;
+
+import com.ard.gb28181.domain.GbChannel;
+import com.ard.gb28181.mapper.GbChannelMapper;
+import com.ard.gb28181.service.IGbChannelService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 国标通道Service实现
+ */
+@Service
+public class GbChannelServiceImpl implements IGbChannelService {
+
+ @Autowired
+ private GbChannelMapper gbChannelMapper;
+
+ @Override
+ public GbChannel selectGbChannelById(Long id) {
+ return gbChannelMapper.selectGbChannelById(id);
+ }
+
+ @Override
+ public List<GbChannel> selectGbChannelByGbDeviceId(String gbDeviceId) {
+ return gbChannelMapper.selectGbChannelByGbDeviceId(gbDeviceId);
+ }
+
+ @Override
+ public GbChannel selectByGbDeviceIdAndGbChannelId(String gbDeviceId, String gbChannelId) {
+ return gbChannelMapper.selectByGbDeviceIdAndGbChannelId(gbDeviceId, gbChannelId);
+ }
+
+ @Override
+ public List<GbChannel> selectGbChannelList(GbChannel gbChannel) {
+ return gbChannelMapper.selectGbChannelList(gbChannel);
+ }
+
+ @Override
+ public int insertGbChannel(GbChannel gbChannel) {
+ gbChannel.setCreateTime(new Date());
+ return gbChannelMapper.insertGbChannel(gbChannel);
+ }
+
+ @Override
+ public int updateGbChannel(GbChannel gbChannel) {
+ gbChannel.setUpdateTime(new Date());
+ return gbChannelMapper.updateGbChannel(gbChannel);
+ }
+
+ @Override
+ public int updateGbChannelStream(GbChannel gbChannel) {
+ gbChannel.setUpdateTime(new Date());
+ return gbChannelMapper.updateGbChannelStream(gbChannel);
+ }
+
+ @Override
+ public int deleteGbChannelById(Long id) {
+ return gbChannelMapper.deleteGbChannelById(id);
+ }
+
+ @Override
+ public int deleteGbChannelByIds(String[] ids) {
+ return gbChannelMapper.deleteGbChannelByIds(ids);
+ }
+}
diff --git a/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/impl/GbDeviceServiceImpl.java b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/impl/GbDeviceServiceImpl.java
new file mode 100644
index 0000000..a27afb8
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/java/com/ard/gb28181/service/impl/GbDeviceServiceImpl.java
@@ -0,0 +1,57 @@
+package com.ard.gb28181.service.impl;
+
+import com.ard.gb28181.domain.GbDevice;
+import com.ard.gb28181.mapper.GbDeviceMapper;
+import com.ard.gb28181.service.IGbDeviceService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 国标设备Service实现
+ */
+@Service
+public class GbDeviceServiceImpl implements IGbDeviceService {
+
+ @Autowired
+ private GbDeviceMapper gbDeviceMapper;
+
+ @Override
+ public GbDevice selectGbDeviceById(Long id) {
+ return gbDeviceMapper.selectGbDeviceById(id);
+ }
+
+ @Override
+ public GbDevice selectGbDeviceByGbDeviceId(String gbDeviceId) {
+ return gbDeviceMapper.selectGbDeviceByGbDeviceId(gbDeviceId);
+ }
+
+ @Override
+ public List<GbDevice> selectGbDeviceList(GbDevice gbDevice) {
+ return gbDeviceMapper.selectGbDeviceList(gbDevice);
+ }
+
+ @Override
+ public int insertGbDevice(GbDevice gbDevice) {
+ gbDevice.setCreateTime(new Date());
+ return gbDeviceMapper.insertGbDevice(gbDevice);
+ }
+
+ @Override
+ public int updateGbDevice(GbDevice gbDevice) {
+ gbDevice.setUpdateTime(new Date());
+ return gbDeviceMapper.updateGbDevice(gbDevice);
+ }
+
+ @Override
+ public int deleteGbDeviceById(Long id) {
+ return gbDeviceMapper.deleteGbDeviceById(id);
+ }
+
+ @Override
+ public int deleteGbDeviceByIds(String[] ids) {
+ return gbDeviceMapper.deleteGbDeviceByIds(ids);
+ }
+}
diff --git a/ard-modules/ard-modules-gb28181/src/main/resources/mapper/gb28181/GbChannelMapper.xml b/ard-modules/ard-modules-gb28181/src/main/resources/mapper/gb28181/GbChannelMapper.xml
new file mode 100644
index 0000000..27bcccd
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/resources/mapper/gb28181/GbChannelMapper.xml
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ard.gb28181.mapper.GbChannelMapper">
+
+ <resultMap type="com.ard.gb28181.domain.GbChannel" id="GbChannelResult">
+ <id property="id" column="id"/>
+ <result property="gbDeviceId" column="gb_device_id"/>
+ <result property="gbChannelId" column="gb_channel_id"/>
+ <result property="channelName" column="channel_name"/>
+ <result property="deviceCode" column="device_code"/>
+ <result property="streamMode" column="stream_mode"/>
+ <result property="enableMp4" column="enable_mp4"/>
+ <result property="streamStatus" column="stream_status"/>
+ <result property="mediaServerId" column="media_server_id"/>
+ <result property="streamKey" column="stream_key"/>
+ <result property="snap" column="snap"/>
+ <result property="createBy" column="create_by"/>
+ <result property="createTime" column="create_time"/>
+ <result property="updateBy" column="update_by"/>
+ <result property="updateTime" column="update_time"/>
+ <result property="remark" column="remark"/>
+ </resultMap>
+
+ <sql id="selectGbChannelVo">
+ select id, gb_device_id, gb_channel_id, channel_name, device_code, stream_mode, enable_mp4,
+ stream_status, media_server_id, stream_key, snap,
+ create_by, create_time, update_by, update_time, remark
+ from ard_gb_channel
+ </sql>
+
+ <select id="selectGbChannelById" parameterType="Long" resultMap="GbChannelResult">
+ <include refid="selectGbChannelVo"/> where id = #{id}
+ </select>
+
+ <select id="selectGbChannelByGbDeviceId" parameterType="String" resultMap="GbChannelResult">
+ <include refid="selectGbChannelVo"/> where gb_device_id = #{gbDeviceId}
+ order by id
+ </select>
+
+ <select id="selectByGbDeviceIdAndGbChannelId" resultMap="GbChannelResult">
+ <include refid="selectGbChannelVo"/>
+ where gb_device_id = #{gbDeviceId} and gb_channel_id = #{gbChannelId}
+ </select>
+
+ <select id="selectGbChannelList" parameterType="com.ard.gb28181.domain.GbChannel" resultMap="GbChannelResult">
+ <include refid="selectGbChannelVo"/>
+ <where>
+ <if test="gbDeviceId != null and gbDeviceId != ''">
+ and gb_device_id like concat('%', #{gbDeviceId}, '%')
+ </if>
+ <if test="gbChannelId != null and gbChannelId != ''">
+ and gb_channel_id like concat('%', #{gbChannelId}, '%')
+ </if>
+ <if test="channelName != null and channelName != ''">
+ and channel_name like concat('%', #{channelName}, '%')
+ </if>
+ </where>
+ </select>
+
+ <insert id="insertGbChannel" parameterType="com.ard.gb28181.domain.GbChannel" useGeneratedKeys="true" keyProperty="id">
+ insert into ard_gb_channel
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="gbDeviceId != null">gb_device_id,</if>
+ <if test="gbChannelId != null">gb_channel_id,</if>
+ <if test="channelName != null">channel_name,</if>
+ <if test="deviceCode != null">device_code,</if>
+ <if test="streamMode != null">stream_mode,</if>
+ <if test="enableMp4 != null">enable_mp4,</if>
+ <if test="streamStatus != null">stream_status,</if>
+ <if test="mediaServerId != null">media_server_id,</if>
+ <if test="streamKey != null">stream_key,</if>
+ <if test="snap != null">snap,</if>
+ <if test="createBy != null">create_by,</if>
+ <if test="createTime != null">create_time,</if>
+ <if test="updateBy != null">update_by,</if>
+ <if test="updateTime != null">update_time,</if>
+ <if test="remark != null">remark,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="gbDeviceId != null">#{gbDeviceId},</if>
+ <if test="gbChannelId != null">#{gbChannelId},</if>
+ <if test="channelName != null">#{channelName},</if>
+ <if test="deviceCode != null">#{deviceCode},</if>
+ <if test="streamMode != null">#{streamMode},</if>
+ <if test="enableMp4 != null">#{enableMp4},</if>
+ <if test="streamStatus != null">#{streamStatus},</if>
+ <if test="mediaServerId != null">#{mediaServerId},</if>
+ <if test="streamKey != null">#{streamKey},</if>
+ <if test="snap != null">#{snap},</if>
+ <if test="createBy != null">#{createBy},</if>
+ <if test="createTime != null">#{createTime},</if>
+ <if test="updateBy != null">#{updateBy},</if>
+ <if test="updateTime != null">#{updateTime},</if>
+ <if test="remark != null">#{remark},</if>
+ </trim>
+ </insert>
+
+ <update id="updateGbChannel" parameterType="com.ard.gb28181.domain.GbChannel">
+ update ard_gb_channel
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="channelName != null">channel_name = #{channelName},</if>
+ <if test="deviceCode != null">device_code = #{deviceCode},</if>
+ <if test="streamMode != null">stream_mode = #{streamMode},</if>
+ <if test="enableMp4 != null">enable_mp4 = #{enableMp4},</if>
+ <if test="streamStatus != null">stream_status = #{streamStatus},</if>
+ <if test="mediaServerId != null">media_server_id = #{mediaServerId},</if>
+ <if test="streamKey != null">stream_key = #{streamKey},</if>
+ <if test="snap != null">snap = #{snap},</if>
+ <if test="updateBy != null">update_by = #{updateBy},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
+ <if test="remark != null">remark = #{remark},</if>
+ </trim>
+ where id = #{id}
+ </update>
+
+ <update id="updateGbChannelStream">
+ update ard_gb_channel
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="streamStatus != null">stream_status = #{streamStatus},</if>
+ <if test="streamKey != null">stream_key = #{streamKey},</if>
+ <if test="mediaServerId != null">media_server_id = #{mediaServerId},</if>
+ <if test="snap != null">snap = #{snap},</if>
+ update_by = #{updateBy},
+ update_time = #{updateTime}
+ </trim>
+ where id = #{id}
+ </update>
+
+ <delete id="deleteGbChannelById" parameterType="Long">
+ delete from ard_gb_channel where id = #{id}
+ </delete>
+
+ <delete id="deleteGbChannelByIds" parameterType="String">
+ delete from ard_gb_channel where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">#{id}</foreach>
+ </delete>
+
+</mapper>
diff --git a/ard-modules/ard-modules-gb28181/src/main/resources/mapper/gb28181/GbDeviceMapper.xml b/ard-modules/ard-modules-gb28181/src/main/resources/mapper/gb28181/GbDeviceMapper.xml
new file mode 100644
index 0000000..34dc0e5
--- /dev/null
+++ b/ard-modules/ard-modules-gb28181/src/main/resources/mapper/gb28181/GbDeviceMapper.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ard.gb28181.mapper.GbDeviceMapper">
+
+ <resultMap type="com.ard.gb28181.domain.GbDevice" id="GbDeviceResult">
+ <id property="id" column="id"/>
+ <result property="gbDeviceId" column="gb_device_id"/>
+ <result property="deviceName" column="device_name"/>
+ <result property="deviceCode" column="device_code"/>
+ <result property="ip" column="ip"/>
+ <result property="port" column="port"/>
+ <result property="manufacturer" column="manufacturer"/>
+ <result property="model" column="model"/>
+ <result property="firmware" column="firmware"/>
+ <result property="onLine" column="online"/>
+ <result property="createBy" column="create_by"/>
+ <result property="createTime" column="create_time"/>
+ <result property="updateBy" column="update_by"/>
+ <result property="updateTime" column="update_time"/>
+ <result property="remark" column="remark"/>
+ </resultMap>
+
+ <sql id="selectGbDeviceVo">
+ select id, gb_device_id, device_name, device_code, ip, port,
+ manufacturer, model, firmware, online,
+ create_by, create_time, update_by, update_time, remark
+ from ard_gb_device
+ </sql>
+
+ <select id="selectGbDeviceById" parameterType="Long" resultMap="GbDeviceResult">
+ <include refid="selectGbDeviceVo"/> where id = #{id}
+ </select>
+
+ <select id="selectGbDeviceByGbDeviceId" parameterType="String" resultMap="GbDeviceResult">
+ <include refid="selectGbDeviceVo"/> where gb_device_id = #{gbDeviceId}
+ </select>
+
+ <select id="selectGbDeviceList" parameterType="com.ard.gb28181.domain.GbDevice" resultMap="GbDeviceResult">
+ <include refid="selectGbDeviceVo"/>
+ <where>
+ <if test="gbDeviceId != null and gbDeviceId != ''">
+ and gb_device_id like concat('%', #{gbDeviceId}, '%')
+ </if>
+ <if test="deviceName != null and deviceName != ''">
+ and device_name like concat('%', #{deviceName}, '%')
+ </if>
+ <if test="deviceCode != null and deviceCode != ''">
+ and device_code like concat('%', #{deviceCode}, '%')
+ </if>
+ </where>
+ </select>
+
+ <insert id="insertGbDevice" parameterType="com.ard.gb28181.domain.GbDevice" useGeneratedKeys="true" keyProperty="id">
+ insert into ard_gb_device
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="gbDeviceId != null">gb_device_id,</if>
+ <if test="deviceName != null">device_name,</if>
+ <if test="deviceCode != null">device_code,</if>
+ <if test="ip != null">ip,</if>
+ <if test="port != null">port,</if>
+ <if test="manufacturer != null">manufacturer,</if>
+ <if test="model != null">model,</if>
+ <if test="firmware != null">firmware,</if>
+ <if test="onLine != null">online,</if>
+ <if test="createBy != null">create_by,</if>
+ <if test="createTime != null">create_time,</if>
+ <if test="updateBy != null">update_by,</if>
+ <if test="updateTime != null">update_time,</if>
+ <if test="remark != null">remark,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="gbDeviceId != null">#{gbDeviceId},</if>
+ <if test="deviceName != null">#{deviceName},</if>
+ <if test="deviceCode != null">#{deviceCode},</if>
+ <if test="ip != null">#{ip},</if>
+ <if test="port != null">#{port},</if>
+ <if test="manufacturer != null">#{manufacturer},</if>
+ <if test="model != null">#{model},</if>
+ <if test="firmware != null">#{firmware},</if>
+ <if test="onLine != null">#{onLine},</if>
+ <if test="createBy != null">#{createBy},</if>
+ <if test="createTime != null">#{createTime},</if>
+ <if test="updateBy != null">#{updateBy},</if>
+ <if test="updateTime != null">#{updateTime},</if>
+ <if test="remark != null">#{remark},</if>
+ </trim>
+ </insert>
+
+ <update id="updateGbDevice" parameterType="com.ard.gb28181.domain.GbDevice">
+ update ard_gb_device
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="deviceName != null">device_name = #{deviceName},</if>
+ <if test="deviceCode != null">device_code = #{deviceCode},</if>
+ <if test="ip != null">ip = #{ip},</if>
+ <if test="port != null">port = #{port},</if>
+ <if test="manufacturer != null">manufacturer = #{manufacturer},</if>
+ <if test="model != null">model = #{model},</if>
+ <if test="firmware != null">firmware = #{firmware},</if>
+ <if test="onLine != null">online = #{onLine},</if>
+ <if test="updateBy != null">update_by = #{updateBy},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
+ <if test="remark != null">remark = #{remark},</if>
+ </trim>
+ where id = #{id}
+ </update>
+
+ <delete id="deleteGbDeviceById" parameterType="Long">
+ delete from ard_gb_device where id = #{id}
+ </delete>
+
+ <delete id="deleteGbDeviceByIds" parameterType="String">
+ delete from ard_gb_device where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">#{id}</foreach>
+ </delete>
+
+</mapper>
diff --git a/ard-modules/ard-modules-qs/pom.xml b/ard-modules/ard-modules-qs/pom.xml
deleted file mode 100644
index dbacc62..0000000
--- a/ard-modules/ard-modules-qs/pom.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>com.ard</groupId>
- <artifactId>ard-modules</artifactId>
- <version>3.6.8</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>ard-modules-qs</artifactId>
-
- <description>
- ard-modules-qs 泉视模块
- </description>
-
- <dependencies>
-
- <!-- SpringCloud Alibaba Nacos -->
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
- </dependency>
-
- <!-- SpringCloud Alibaba Nacos Config -->
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
- </dependency>
-
- <!-- SpringCloud Alibaba Sentinel -->
- <dependency>
- <groupId>com.alibaba.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
- </dependency>
-
- <!-- SpringBoot Actuator -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
-
- <!-- Apache Velocity -->
- <dependency>
- <groupId>org.apache.velocity</groupId>
- <artifactId>velocity-engine-core</artifactId>
- </dependency>
-
- <!-- Mysql Connector -->
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- </dependency>
-
- <!-- Ard Common Log -->
- <dependency>
- <groupId>com.ard</groupId>
- <artifactId>ard-common-log</artifactId>
- </dependency>
-
- <!-- Ard Common Swagger -->
- <dependency>
- <groupId>com.ard</groupId>
- <artifactId>ard-common-swagger</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>33.4.8-jre</version>
- </dependency>
-
- <!-- 获取系统信息 -->
- <dependency>
- <groupId>com.github.oshi</groupId>
- <artifactId>oshi-core</artifactId>
- <version>6.6.5</version>
- </dependency>
-
- <!--JavaCV相关依赖-->
- <dependency>
- <groupId>org.bytedeco</groupId>
- <artifactId>javacv</artifactId>
- <version>1.5.10</version>
- </dependency>
- <dependency>
- <groupId>org.bytedeco</groupId>
- <artifactId>ffmpeg</artifactId>
- <version>6.1.1-1.5.10</version>
- <classifier>windows-x86_64-gpl</classifier>
- </dependency>
- <dependency>
- <groupId>org.bytedeco</groupId>
- <artifactId>ffmpeg</artifactId>
- <version>6.1.1-1.5.10</version>
- <classifier>linux-x86_64-gpl</classifier>
- </dependency>
-
- <dependency>
- <groupId>com.ard</groupId>
- <artifactId>ard-api-qs</artifactId>
- </dependency>
- <!-- zlm接口 -->
- <dependency>
- <groupId>com.ard</groupId>
- <artifactId>ard-api-zlm</artifactId>
- </dependency>
- <dependency>
- <groupId>com.ard</groupId>
- <artifactId>ard-api-gb28181</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${project.artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/ArdQSApplication.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/ArdQSApplication.java
deleted file mode 100644
index 16e3c38..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/ArdQSApplication.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.ard.qs;
-
-
-import com.ard.common.security.annotation.EnableCustomConfig;
-import com.ard.common.security.annotation.EnableRyFeignClients;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.scheduling.annotation.EnableScheduling;
-
-/**
- * 泉视模块
- *
- * @author fengcheng
- */
-@EnableCustomConfig
-@EnableRyFeignClients
-@SpringBootApplication
-@EnableScheduling
-public class ArdQSApplication {
- public static void main(String[] args) {
- SpringApplication.run(ArdQSApplication.class, args);
- System.out.println("(♥◠‿◠)ノ゙ 泉视模块启动成功 ლ(´ڡ`ლ)゙ \n" +
- " ___ ___ \n" +
- " /\\ \\ /\\ \\ _____ \n" +
- " /::\\ \\ /::\\ \\ /::\\ \\ \n" +
- " /:/\\:\\ \\ /:/\\:\\__\\ /:/\\:\\ \\ \n" +
- " /:/ /::\\ \\ /:/ /:/ / /:/ \\:\\__\\ \n" +
- " /:/_/:/\\:\\__\\ /:/_/:/__/___ /:/__/ \\:|__| \n" +
- " \\:\\/:/ \\/__/ \\:\\/:::::/ / \\:\\ \\ /:/ / \n" +
- " \\::/__/ \\::/~~/~~~~ \\:\\ /:/ / \n" +
- " \\:\\ \\ \\:\\~~\\ \\:\\/:/ / \n" +
- " \\:\\__\\ \\:\\__\\ \\::/ / \n" +
- " \\/__/ \\/__/ \\/__/ \n");
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/api/QsDeviceApiController.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/api/QsDeviceApiController.java
deleted file mode 100644
index 4847b34..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/api/QsDeviceApiController.java
+++ /dev/null
@@ -1,176 +0,0 @@
-package com.ard.qs.api;
-
-import com.ard.common.core.domain.R;
-import com.ard.common.core.web.domain.AjaxResult;
-import com.ard.common.log.annotation.Log;
-import com.ard.common.log.enums.BusinessType;
-import com.ard.common.security.annotation.InnerAuth;
-import com.ard.qs.api.domain.QsDevice;
-import com.ard.qs.service.IQsDeviceService;
-import io.swagger.v3.oas.annotations.Operation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * 视频监控设备Controller
- *
- * @author fengcheng
- * @date 2026-03-27
- */
-@RestController
-@RequestMapping("/api/device")
-public class QsDeviceApiController {
- @Autowired
- private IQsDeviceService qsDeviceService;
-
- /**
- * 查询视频监控设备
- */
- @InnerAuth
- @PostMapping("/allList")
- public R<List<QsDevice>> list(@RequestBody QsDevice qsDevice) {
- List<QsDevice> list = qsDeviceService.selectQsDeviceList(qsDevice);
- return R.ok(list);
- }
-
- /**
- * 更新设备在线状态
- *
- * @param onlineDeviceSet 在线设备集合
- * @param deviceStatus 设备状态
- * @return
- */
- @InnerAuth
- @PostMapping("/updateDeviceStatusList/{deviceStatus}")
- public R<Boolean> updateQsDeviceStatusList(@RequestBody Set<Long> onlineDeviceSet, @PathVariable String deviceStatus) {
- Boolean b = qsDeviceService.updateQsDeviceStatusList(onlineDeviceSet, deviceStatus);
- return R.ok(b);
- }
-
-
- /**
- * 修改视频监控设备
- */
- @InnerAuth
- @PutMapping("/updateQsDevice")
- public R<Boolean> updateQsDevice(@RequestBody QsDevice qsDevice) {
- return qsDeviceService.editQsDevice(qsDevice) > 0 ? R.ok(true) : R.ok(false);
- }
-
- /**
- * 更具流id获取视频监控设备
- */
- @InnerAuth
- @GetMapping("/getQsDeviceStream/{stream}")
- public R<QsDevice> getQsDeviceStream(@PathVariable String stream) {
- return R.ok(qsDeviceService.getQsDeviceStream(stream));
- }
-
- /**
- * 获取视频监控设备详细信息
- */
- @InnerAuth
- @GetMapping("/getQsDeviceInfo/{id}")
- public R<QsDevice> getQsDeviceInfo(@PathVariable Long id) {
- return R.ok(qsDeviceService.selectQsDeviceById(id));
- }
-
- /**
- * 设备状态任务
- */
- @InnerAuth
- @GetMapping("/task")
- public R<Void> task() {
- qsDeviceService.task();
- return R.ok();
- }
-
- /**
- * 清理设备计划id
- *
- * @param planId 设备id
- * @return
- */
- @InnerAuth
- @GetMapping("/cleanRecordPlanId/{planId}")
- public R<Void> cleanRecordPlanId(@PathVariable Long planId) {
- qsDeviceService.cleanRecordPlanId(planId);
- return R.ok();
- }
-
- /**
- * 根据设备id集合查询设备信息
- *
- * @param startDeviceIdList 设备id集合
- * @return
- */
- @InnerAuth
- @GetMapping("/queryByIds/{startDeviceIdList}")
- public R<List<QsDevice>> queryByIds(@PathVariable List<Long> startDeviceIdList) {
- List<QsDevice> deviceList = qsDeviceService.queryByIds(startDeviceIdList);
- return R.ok(deviceList);
- }
-
- /**
- * 根据计划id查询设备数量
- *
- * @param planId 设备id
- * @return
- */
- @InnerAuth
- @GetMapping("/countRecordPlanDevice/{planId}")
- public R<Integer> countRecordPlanDevice(@PathVariable Long planId) {
- Integer i = qsDeviceService.countRecordPlanDevice(planId);
- return R.ok(i);
- }
-
- /**
- * 新增视频监控设备
- */
- @InnerAuth
- @PostMapping("/addQsDevice")
- public R<Boolean> addQsDevice(@RequestBody QsDevice qsDevice) {
- return qsDeviceService.addQsDevice(qsDevice) > 0 ? R.ok(true) : R.ok(false);
- }
-
- /**
- * 根据 gbDeviceId 更新设备在线状态
- *
- * @param gbDeviceId 国标设备编号
- * @param deviceStatus 设备状态
- * @return
- */
- @InnerAuth
- @PostMapping("/updateDeviceStatusByGbDeviceId/{gbDeviceId}/{deviceStatus}")
- public R<Boolean> updateDeviceStatusByGbDeviceId(@PathVariable String gbDeviceId, @PathVariable String deviceStatus) {
- Boolean result = qsDeviceService.updateDeviceStatusByGbDeviceId(gbDeviceId, deviceStatus);
- return R.ok(result);
- }
-
- /**
- * 根据 jtMobileNo 更新设备在线状态
- *
- * @param jtMobileNo 设备手机号
- * @param deviceStatus 设备状态
- * @return
- */
- @InnerAuth
- @PostMapping("/updateDeviceStatusByJtMobileNo/{jtMobileNo}/{deviceStatus}")
- public R<Boolean> updateDeviceStatusByJtMobileNo(@PathVariable String jtMobileNo, @PathVariable String deviceStatus) {
- Boolean result = qsDeviceService.updateDeviceStatusByJtMobileNo(jtMobileNo, deviceStatus);
- return R.ok(result);
- }
-
-
- /**
- * 删除视频监控设备
- */
- @InnerAuth
- @DeleteMapping("/removeQsDevice/{ids}")
- public R<Boolean> remove(@PathVariable Long[] ids) {
- return qsDeviceService.deleteQsDeviceByIds(ids) > 0 ? R.ok(true) : R.ok(false);
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/GbCode.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/GbCode.java
deleted file mode 100644
index 073f761..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/GbCode.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.ard.qs.common;
-
-import lombok.Data;
-
-/**
- * 国标编码对象
- */
-@Data
-public class GbCode {
-
- /**
- * 中心编码,由监控中心所在地的行政区划代码确定,符合GB/T2260—2007的要求
- */
- private String centerCode;
-
- /**
- * 行业编码
- */
- private String industryCode;
-
- /**
- * 类型编码
- */
- private String typeCode;
-
- /**
- * 网络标识
- */
- private String netCode;
-
- /**
- * 序号
- */
- 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.setCenterCode(code.substring(0, 8));
- gbCode.setIndustryCode(code.substring(8, 10));
- gbCode.setTypeCode(code.substring(10, 13));
- gbCode.setNetCode(code.substring(13, 14));
- gbCode.setSn(code.substring(14));
- return gbCode;
- }
-
- public String ecode() {
- return centerCode + industryCode + typeCode + netCode + sn;
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/SystemAllInfo.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/SystemAllInfo.java
deleted file mode 100644
index 644c29e..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/SystemAllInfo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.ard.qs.common;
-
-import java.util.List;
-
-public class SystemAllInfo {
-
- private List<Object> cpu;
- private List<Object> mem;
- private List<Object> net;
-
- private long netTotal;
-
- private Object disk;
-
- public List<Object> getCpu() {
- return cpu;
- }
-
- public void setCpu(List<Object> cpu) {
- this.cpu = cpu;
- }
-
- public List<Object> getMem() {
- return mem;
- }
-
- public void setMem(List<Object> mem) {
- this.mem = mem;
- }
-
- public List<Object> getNet() {
- return net;
- }
-
- public void setNet(List<Object> net) {
- this.net = net;
- }
-
- public Object getDisk() {
- return disk;
- }
-
- public void setDisk(Object disk) {
- this.disk = disk;
- }
-
- public long getNetTotal() {
- return netTotal;
- }
-
- public void setNetTotal(long netTotal) {
- this.netTotal = netTotal;
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/VideoManagerConstants.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/VideoManagerConstants.java
deleted file mode 100644
index a161e86..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/common/VideoManagerConstants.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.ard.qs.common;
-
-public class VideoManagerConstants {
-
- public static final String SYSTEM_INFO_CPU_PREFIX = "QS_SYSTEM_INFO_CPU";
-
- public static final String SYSTEM_INFO_MEM_PREFIX = "QS_SYSTEM_INFO_MEM";
-
- public static final String SYSTEM_INFO_NET_PREFIX = "QS_SYSTEM_INFO_NET";
-
- public static final String SYSTEM_INFO_DISK_PREFIX = "QS_SYSTEM_INFO_DISK";
-
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/config/CivilCodeFileConf.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/config/CivilCodeFileConf.java
deleted file mode 100644
index 87b6ce1..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/config/CivilCodeFileConf.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.ard.qs.config;
-
-import com.ard.qs.api.common.CivilCodePo;
-import com.ard.qs.api.utils.CivilCodeUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.util.ObjectUtils;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-
-/**
- * 启动时读取行政区划表
- */
-@Slf4j
-@Configuration
-@Order(value = 15)
-public class CivilCodeFileConf implements CommandLineRunner {
-
- /**
- * 行政区划信息文件,系统启动时会加载到系统里
- */
- private final String CIVILCODEFILE = "classpath:civilCode.csv";
-
- @Override
- public void run(String... args) throws Exception {
- if (ObjectUtils.isEmpty(CIVILCODEFILE)) {
- log.warn("[行政区划] 文件未设置,可能造成目录刷新结果不完整");
- return;
- }
- InputStream inputStream;
- if (CIVILCODEFILE.startsWith("classpath:")) {
- String filePath = CIVILCODEFILE.substring("classpath:".length());
- ClassPathResource civilCodeFile = new ClassPathResource(filePath);
- if (!civilCodeFile.exists()) {
- log.warn("[行政区划] 文件<{}>不存在,可能造成目录刷新结果不完整", civilCodeFile);
- return;
- }
- inputStream = civilCodeFile.getInputStream();
-
- } else {
- File civilCodeFile = new File(CIVILCODEFILE);
- if (!civilCodeFile.exists()) {
- log.warn("[行政区划] 文件<{}>不存在,可能造成目录刷新结果不完整", CIVILCODEFILE);
- return;
- }
- inputStream = Files.newInputStream(civilCodeFile.toPath());
- }
-
- BufferedReader inputStreamReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
- int index = -1;
- String line;
- while ((line = inputStreamReader.readLine()) != null) {
- index++;
- if (index == 0) {
- continue;
- }
- String[] infoArray = line.split(",");
- CivilCodePo civilCodePo = CivilCodePo.getInstance(infoArray);
- CivilCodeUtil.INSTANCE.add(civilCodePo);
- }
- inputStreamReader.close();
- inputStream.close();
- if (CivilCodeUtil.INSTANCE.isEmpty()) {
- log.warn("[行政区划] 文件内容为空,可能造成目录刷新结果不完整");
- } else {
- log.info("[行政区划] 加载成功,共加载数据{}条", CivilCodeUtil.INSTANCE.size());
- }
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/config/ThreadPoolTaskConfig.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/config/ThreadPoolTaskConfig.java
deleted file mode 100644
index 9199a83..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/config/ThreadPoolTaskConfig.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.ard.qs.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.annotation.Order;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.util.concurrent.ThreadPoolExecutor;
-
-/**
- * ThreadPoolTask 配置类
- * @author fengcheng
- */
-@Configuration
-@Order(1)
-@EnableAsync(proxyTargetClass = true)
-public class ThreadPoolTaskConfig {
-
- public static final int cpuNum = Runtime.getRuntime().availableProcessors();
-
- /**
- * 默认情况下,在创建了线程池后,线程池中的线程数为0,当有任务来之后,就会创建一个线程去执行任务,
- * 当线程池中的线程数目达到corePoolSize后,就会把到达的任务放到缓存队列当中;
- * 当队列满了,就继续创建线程,当线程数量大于等于maxPoolSize后,开始使用拒绝策略拒绝
- */
-
- /**
- * 核心线程数(默认线程数)
- */
- private static final int corePoolSize = Math.max(cpuNum * 2, 16);
- /**
- * 最大线程数
- */
- private static final int maxPoolSize = corePoolSize * 10;
- /**
- * 允许线程空闲时间(单位:默认为秒)
- */
- private static final int keepAliveTime = 30;
-
- /**
- * 缓冲队列大小
- */
- private static final int queueCapacity = 10000;
- /**
- * 线程池名前缀
- */
- private static final String threadNamePrefix = "async-";
-
-
- @Bean("taskExecutor") // bean的名称,默认为首字母小写的方法名
- public ThreadPoolTaskExecutor taskExecutor() {
- ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
- executor.setCorePoolSize(corePoolSize);
- executor.setMaxPoolSize(maxPoolSize);
- executor.setQueueCapacity(queueCapacity);
- executor.setKeepAliveSeconds(keepAliveTime);
- executor.setThreadNamePrefix(threadNamePrefix);
-
- // 线程池对拒绝任务的处理策略
- // CallerRunsPolicy:由调用线程(提交任务的线程)处理该任务
- executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
- // 初始化
- executor.initialize();
- return executor;
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsDeviceController.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsDeviceController.java
deleted file mode 100644
index f56527f..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsDeviceController.java
+++ /dev/null
@@ -1,393 +0,0 @@
-package com.ard.qs.controller;
-
-import com.ard.common.core.web.controller.BaseController;
-import com.ard.common.core.web.domain.AjaxResult;
-import com.ard.common.core.web.page.TableDataInfo;
-import com.ard.common.log.annotation.Log;
-import com.ard.common.log.enums.BusinessType;
-import com.ard.common.security.annotation.RequiresPermissions;
-import com.ard.common.security.utils.SecurityUtils;
-import com.ard.qs.api.domain.QsDevice;
-import com.ard.qs.domain.*;
-import com.ard.qs.service.IQsDeviceService;
-import com.ard.qs.utils.VideoSnapshotUtil;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.util.Assert;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 视频监控设备Controller
- *
- * @author fengcheng
- * @date 2026-03-27
- */
-@Slf4j
-@Tag(name = "视频监控设备")
-@RestController
-@RequestMapping("/device")
-public class QsDeviceController extends BaseController {
- @Autowired
- private IQsDeviceService qsDeviceService;
-
- /**
- * 查询视频监控设备列表
- */
- @Operation(summary = "查询视频监控设备列表")
- @GetMapping("/list")
- public TableDataInfo list(QsDevice qsDevice) {
- startPage();
- List<QsDevice> list = qsDeviceService.selectQsDeviceList(qsDevice);
- return getDataTable(list);
- }
-
- /**
- * 根据行政区域获取视频监控设备列表
- */
- @Operation(summary = "根据行政区域获取视频监控设备列表")
- @GetMapping("/queryListByCivilCode")
- public TableDataInfo queryListByCivilCode(QsDevice qsDevice) {
- startPage();
- List<QsDevice> list = qsDeviceService.queryListByCivilCode(qsDevice);
- return getDataTable(list);
- }
-
- /**
- * 获取视频监控设备详细信息
- */
- @Operation(summary = "获取视频监控设备详细信息")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id) {
- return success(qsDeviceService.selectQsDeviceById(id));
- }
-
- /**
- * 新增视频监控设备
- */
- @Operation(summary = "新增视频监控设备")
- @Log(title = "视频监控设备", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody QsDevice qsDevice) {
- return toAjax(qsDeviceService.insertQsDevice(qsDevice));
- }
-
- /**
- * 修改视频监控设备
- */
- @Operation(summary = "修改视频监控设备")
- @Log(title = "视频监控设备", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody QsDevice qsDevice) {
- return toAjax(qsDeviceService.updateQsDevice(qsDevice));
- }
-
- /**
- * 删除视频监控设备
- */
- @Operation(summary = "删除视频监控设备")
- @Log(title = "视频监控设备", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids) {
- return toAjax(qsDeviceService.deleteQsDeviceByIds(ids));
- }
-
- /**
- * 状态修改
- */
- @Operation(summary = "状态修改")
- @Log(title = "视频监控设备", businessType = BusinessType.UPDATE)
- @PutMapping("/changeStatus")
- public AjaxResult changeStatus(@RequestBody QsDevice qsDevice) {
- qsDevice.setUpdateBy(SecurityUtils.getUsername());
- return toAjax(qsDeviceService.updateQsDeviceStatus(qsDevice));
- }
-
- /**
- * 获取计划记录对应的视频监控设备
- */
- @GetMapping("/listPlanRecord")
- public TableDataInfo listPlanRecordQsDevice(QsDevice qsDevice) {
- startPage();
- List<QsDevice> list = qsDeviceService.listPlanRecordQsDevice(qsDevice);
- return getDataTable(list);
- }
-
- /**
- * 设备关联录制计划
- *
- * @param param
- * @return
- */
- @PostMapping("/link")
- public AjaxResult link(@RequestBody RecordPlanParam param) {
- if (param.getAllLink() != null) {
- if (param.getAllLink()) {
- qsDeviceService.linkAll(param.getPlanId());
- } else {
- qsDeviceService.cleanAll(param.getPlanId());
- }
- return success();
- }
-
- if (param.getDeviceIds() == null) {
- throw new RuntimeException("设备ID不可都为NULL");
- }
-
- qsDeviceService.link(param.getDeviceIds(), param.getPlanId());
-
- return success();
- }
-
-
- /**
- * 设备设置行政区划
- *
- * @param param
- */
- @Operation(summary = "设备设置行政区划")
- @PostMapping("/region/add")
- public AjaxResult addChannelToRegion(@RequestBody DeviceToRegionParam param) {
- Assert.notEmpty(param.getDeviceIds(), "设备ID不可为空");
- Assert.hasLength(param.getCivilCode(), "未添加行政区划");
- qsDeviceService.addDeviceToRegion(param.getCivilCode(), param.getDeviceIds());
- return success();
- }
-
- /**
- * 设备删除行政区划
- *
- * @param param
- */
- @Operation(summary = "设备删除行政区划")
- @PostMapping("/region/delete")
- public AjaxResult deleteDeviceToRegion(@RequestBody DeviceToRegionParam param) {
- Assert.isTrue(!param.getDeviceIds().isEmpty() || !ObjectUtils.isEmpty(param.getCivilCode()), "参数异常");
- qsDeviceService.deleteDeviceToRegion(param.getCivilCode(), param.getDeviceIds());
- return success();
- }
-
-
- /**
- * 存在行政区划但无法挂载的设备列表
- */
- @Operation(summary = "存在行政区划但无法挂载的设备列表")
- @GetMapping("/civilCode/unusual/list")
- public TableDataInfo queryListByCivilCodeForUnusual(QsDevice qsDevice) {
- startPage();
- List<QsDevice> list = qsDeviceService.queryListByCivilCodeForUnusual(qsDevice);
- return getDataTable(list);
- }
-
- /**
- * 清除存在行政区划但无法挂载的设备列表
- *
- * @param param
- */
- @Operation(summary = "清除存在行政区划但无法挂载的设备列表")
- @PostMapping("/civilCode/unusual/clear")
- public AjaxResult clearDeviceCivilCode(@RequestBody DeviceToRegionParam param) {
- qsDeviceService.clearDeviceCivilCode(param.getAll(), param.getDeviceIds());
- return success();
- }
-
- /**
- * 获取编码列表
- *
- * @return
- */
- @Operation(summary = "获取编码列表")
- @GetMapping("/network/identification/list")
- public AjaxResult getNetworkIdentificationTypeList() {
- List<NetworkIdentificationType> list = qsDeviceService.getNetworkIdentificationTypeList();
- return success(list);
- }
-
- /**
- * 获取编码列表
- *
- * @return
- */
- @Operation(summary = "获取编码列表")
- @GetMapping("/type/list")
- public AjaxResult getDeviceTypeList() {
- List<DeviceType> list = qsDeviceService.getDeviceTypeList();
- return success(list);
- }
-
- /**
- * 获取行业编码列表
- *
- * @return
- */
- @GetMapping("/industry/list")
- public AjaxResult getIndustryCodeList() {
- List<IndustryCodeType> list = qsDeviceService.getIndustryCodeList();
- return success(list);
- }
-
- /**
- * 获取关联业务分组设备列表
- */
- @GetMapping("/parent/list")
- public TableDataInfo queryListByParentId(QsDevice qsDevice) {
- startPage();
- List<QsDevice> list = qsDeviceService.queryListByParentId(qsDevice);
- return getDataTable(list);
- }
-
- /**
- * 设备设置业务分组
- *
- * @param param
- */
- @PostMapping("/group/add")
- public AjaxResult addChannelToGroup(@RequestBody DeviceToGroupParam param) {
- Assert.notEmpty(param.getDeviceIds(), "设备ID不可为空");
- Assert.hasLength(param.getParentId(), "未添加上级分组编号");
- Assert.hasLength(param.getBusinessGroup(), "未添加业务分组");
- qsDeviceService.addChannelToGroup(param.getParentId(), param.getBusinessGroup(), param.getDeviceIds());
- return success();
- }
-
- /**
- * 删除业务分组设备
- *
- * @param param
- */
- @PostMapping("/group/delete")
- public AjaxResult deleteDeviceToGroup(@RequestBody DeviceToGroupParam param) {
- Assert.isTrue(!param.getDeviceIds().isEmpty() || (!ObjectUtils.isEmpty(param.getParentId()) && !ObjectUtils.isEmpty(param.getBusinessGroup())), "参数异常");
- qsDeviceService.deleteDeviceToGroup(param.getParentId(), param.getBusinessGroup(), param.getDeviceIds());
- return success();
- }
-
- /**
- * 存在父节点编号但无法挂载的设备列表
- */
- @GetMapping("/parent/unusual/list")
- public TableDataInfo queryListByParentForUnusual(QsDevice qsDevice) {
- startPage();
- List<QsDevice> list = qsDeviceService.queryListByParentForUnusual(qsDevice);
- return getDataTable(list);
- }
-
- /**
- * 清除存在分组节点但无法挂载的设备列表
- *
- * @param param
- */
- @PostMapping("/parent/unusual/clear")
- public AjaxResult clearDeviceParent(@RequestBody DeviceToGroupParam param) {
- qsDeviceService.clearDeviceParent(param.getAll(), param.getDeviceIds());
- return success();
- }
-
- /**
- * 获取本地mp4截图
- */
- @RequiresPermissions("qs:device:edit")
- @Log(title = "视频监控设备", businessType = BusinessType.UPDATE)
- @PutMapping("/getVideoSnapshot/{id}")
- public AjaxResult getVideoSnapshot(@PathVariable("id") Long id) {
-
-
- return success();
- }
-
- /**
- * 开始云台控制
- *
- * @param id 设备id
- * @param direction 方向
- * @param controlSpeed 控制速度
- * @return 结果
- */
- @Log(title = "云台控制", businessType = BusinessType.OTHER)
- @GetMapping("/startPtz/{id}")
- public AjaxResult startPtz(@PathVariable Long id, @RequestParam String direction, @RequestParam Integer controlSpeed) {
- qsDeviceService.startPtz(id, direction, controlSpeed);
- return AjaxResult.success();
- }
-
- /**
- * 结束云台控制
- *
- * @param id 设备id
- * @param direction 方向
- * @param controlSpeed 控制速度
- * @return 结果
- */
- @Log(title = "云台控制", businessType = BusinessType.OTHER)
- @GetMapping("/endPtz/{id}")
- public AjaxResult endPtz(@PathVariable Long id, @RequestParam String direction, @RequestParam Integer controlSpeed) {
- qsDeviceService.endPtz(id, direction, controlSpeed);
- return AjaxResult.success();
- }
-
- /**
- * 获取预置点列表
- *
- * @param id 设备id
- * @param channelId 通道id
- * @return 预置点列表
- */
- @Log(title = "预置点控制", businessType = BusinessType.OTHER)
- @GetMapping("/preset/list/{id}")
- public AjaxResult getPresetList(@PathVariable Long id, @RequestParam(required = false) Integer channelId) {
- List<Preset> presetList = qsDeviceService.getPresetList(id, channelId);
- return AjaxResult.success(presetList);
- }
-
- /**
- * 设置预置点
- *
- * @param id 设备id
- * @param channelId 通道id
- * @param presetIndex 预置点索引
- * @param presetName 预置点名称
- * @return 结果
- */
- @Log(title = "预置点控制", businessType = BusinessType.OTHER)
- @GetMapping("/preset/set/{id}")
- public AjaxResult setPreset(@PathVariable Long id, @RequestParam(required = false) Integer channelId, @RequestParam Integer presetIndex, @RequestParam(required = false) String presetName) {
- qsDeviceService.setPreset(id, channelId, presetIndex, presetName);
- return AjaxResult.success();
- }
-
- /**
- * 调用预置点
- *
- * @param id 设备id
- * @param channelId 通道id
- * @param presetIndex 预置点索引
- * @param speed 速度
- * @return 结果
- */
- @Log(title = "预置点控制", businessType = BusinessType.OTHER)
- @GetMapping("/preset/goto/{id}")
- public AjaxResult gotoPreset(@PathVariable Long id, @RequestParam(required = false) Integer channelId, @RequestParam Integer presetIndex, @RequestParam(required = false) Integer speed) {
- qsDeviceService.gotoPreset(id, channelId, presetIndex, speed);
- return AjaxResult.success();
- }
-
- /**
- * 删除预置点
- *
- * @param id 设备id
- * @param channelId 通道id
- * @param presetIndex 预置点索引
- * @return 结果
- */
- @Log(title = "预置点控制", businessType = BusinessType.OTHER)
- @GetMapping("/preset/delete/{id}")
- public AjaxResult deletePreset(@PathVariable Long id, @RequestParam(required = false) Integer channelId, @RequestParam Integer presetIndex) {
- qsDeviceService.deletePreset(id, channelId, presetIndex);
- return AjaxResult.success();
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsGroupController.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsGroupController.java
deleted file mode 100644
index ad724ea..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsGroupController.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package com.ard.qs.controller;
-
-import com.ard.common.core.web.controller.BaseController;
-import com.ard.common.core.web.domain.AjaxResult;
-import com.ard.common.core.web.page.TableDataInfo;
-import com.ard.qs.api.domain.QsGroup;
-import com.ard.qs.domain.QsGroupTree;
-import com.ard.qs.service.IQsGroupService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.Assert;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 分组管理
- *
- * @FileName QsGroupController
- * @Description
- * @Author fengcheng
- * @date 2026-04-14
- **/
-@Slf4j
-@RestController
-@RequestMapping("/group")
-public class QsGroupController extends BaseController {
- @Autowired
- private IQsGroupService qsGroupService;
-
- /**
- * 添加分组
- *
- * @param group 分组信息
- */
- @PostMapping("/add")
- public AjaxResult add(@RequestBody QsGroup group) {
- qsGroupService.add(group);
- return success();
- }
-
- /**
- * 更新分组
- *
- * @param group 分组信息
- */
- @PostMapping("/update")
- public AjaxResult update(@RequestBody QsGroup group) {
- qsGroupService.update(group);
- return success();
- }
-
- /**
- * 删除分组
- *
- * @param id 分组id
- */
- @DeleteMapping("/delete/{id}")
- public AjaxResult delete(@PathVariable Integer id) {
- Assert.notNull(id, "分组id(deviceId)不需要存在");
- boolean result = qsGroupService.delete(id);
- if (!result) {
- throw new RuntimeException("移除失败");
- }
- return success();
- }
-
- /**
- * 查询分组节点
- *
- * @param query 要搜索的内容
- * @param parent 所属分组编号
- * @param hasDevice 是否查询设备
- * @return
- */
- @GetMapping("/tree/list")
- public AjaxResult queryForTree(@RequestParam(required = false) String query, @RequestParam(required = false) Integer parent, @RequestParam(required = false) Boolean hasDevice) {
- if (ObjectUtils.isEmpty(query)) {
- query = null;
- }
- List<QsGroupTree> list = qsGroupService.queryForTree(query, parent, hasDevice);
- return success(list);
- }
-
- /**
- * 查询分组节点设备
- *
- * @return
- */
- @GetMapping("/device/list")
- public AjaxResult queryForDevice() {
- List<QsGroupTree> list = qsGroupService.queryForDevice();
- return success(list);
- }
-
- /**
- * 查询分组
- *
- * @param query 要搜索的内容
- * @return
- */
- @GetMapping("/tree/query")
- public TableDataInfo queryTree(String query) {
- startPage();
- List<QsGroup> list = qsGroupService.queryList(query);
- return getDataTable(list);
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsRegionController.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsRegionController.java
deleted file mode 100644
index 169227e..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsRegionController.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package com.ard.qs.controller;
-
-import com.ard.common.core.web.controller.BaseController;
-import com.ard.common.core.web.domain.AjaxResult;
-import com.ard.common.core.web.page.TableDataInfo;
-import com.ard.common.log.annotation.Log;
-import com.ard.common.log.enums.BusinessType;
-import com.ard.qs.api.domain.QsRegion;
-import com.ard.qs.domain.QsRegionTree;
-import com.ard.qs.service.IQsRegionService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.Assert;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 区域管理
- *
- * @FileName QsRegionController
- * @Description
- * @Author fengcheng
- * @date 2026-04-13
- **/
-@Slf4j
-@RestController
-@RequestMapping("/region")
-public class QsRegionController extends BaseController {
-
- @Autowired
- private IQsRegionService qsRegionService;
-
- /**
- * 添加区域
- *
- * @param region 区域信息
- */
- @Log(title = "区域管理", businessType = BusinessType.INSERT)
- @PostMapping("/add")
- public AjaxResult add(@RequestBody QsRegion region) {
- qsRegionService.add(region);
- return AjaxResult.success();
- }
-
- /**
- * 更新区域
- *
- * @param region
- */
- @Log(title = "区域管理", businessType = BusinessType.UPDATE)
- @PostMapping("/update")
- public AjaxResult update(@RequestBody QsRegion region) {
- qsRegionService.update(region);
- return AjaxResult.success();
- }
-
- /**
- * 删除区域
- *
- * @param id 区域ID
- */
- @Log(title = "区域管理", businessType = BusinessType.DELETE)
- @DeleteMapping("/delete/{id}")
- public AjaxResult delete(@PathVariable Integer id) {
- Assert.notNull(id, "区域ID需要存在");
- boolean result = qsRegionService.deleteByDeviceId(id);
- if (!result) {
- throw new RuntimeException("移除失败");
- }
- return AjaxResult.success();
- }
-
- /**
- * 查询区域节点
- *
- * @param parent 所属行政区划编号
- * @param hasDevice 是否查询设备
- * @return
- */
- @GetMapping("/tree/list")
- public AjaxResult queryForTree(@RequestParam(required = false) Integer parent, @RequestParam(required = false) Boolean hasDevice) {
- List<QsRegionTree> list = qsRegionService.queryForTree(parent, hasDevice);
- return success(list);
- }
-
- /**
- * 查询区域节点设备
- *
- * @return
- */
- @GetMapping("/device/list")
- public AjaxResult queryForDevice() {
- List<QsRegionTree> list = qsRegionService.queryForDevice();
- return success(list);
- }
-
- /**
- * 查询区域
- *
- * @param query 要搜索的内容
- * @return
- */
-
- @GetMapping("/tree/query")
- public TableDataInfo queryTree(Integer pageNum, Integer pageSize, String query) {
- startPage();
- List<QsRegion> list = qsRegionService.queryList(pageNum, pageSize, query);
- return getDataTable(list);
- }
-
- /**
- * 获取所属的行政区划下的行政区划
- *
- * @param parent 所属的行政区划
- * @return
- */
- @GetMapping("/base/child/list")
- public AjaxResult getAllChild(@RequestParam(required = false) String parent) {
- if (ObjectUtils.isEmpty(parent)) {
- parent = null;
- }
- List<QsRegion> list = qsRegionService.getAllChild(parent);
- return success(list);
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsServerController.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsServerController.java
deleted file mode 100644
index cce962e..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/controller/QsServerController.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.ard.qs.controller;
-
-import com.ard.common.core.web.controller.BaseController;
-import com.ard.common.core.web.domain.AjaxResult;
-import com.ard.qs.common.SystemAllInfo;
-import com.ard.qs.domain.DeviceStats;
-import com.ard.qs.service.IQsDeviceService;
-import com.ard.qs.service.IRedisCatchStorageService;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 服务控制
- *
- * @FileName QsServerController
- * @Description
- * @Author fengcheng
- * @date 2026-04-15
- **/
-@Tag(name = "服务控制")
-@Slf4j
-@RestController
-@RequestMapping("/server")
-public class QsServerController extends BaseController {
-
- @Autowired
- private IRedisCatchStorageService redisCatchStorageService;
-
- @Autowired
- private IQsDeviceService qsDeviceService;
-
- /**
- * 获取系统信息
- *
- * @return
- */
- @Operation(summary = "获取系统信息")
- @GetMapping(value = "/system/info")
- public AjaxResult getSystemInfo() {
- SystemAllInfo systemAllInfo = redisCatchStorageService.getSystemInfo();
- return success(systemAllInfo);
- }
-
- /**
- * 获取设备统计信息
- *
- * @return
- */
- @Operation(summary = "获取设备统计信息")
- @GetMapping(value = "/system/deviceStatist")
- public AjaxResult getDeviceStatistics() {
- DeviceStats deviceStats = qsDeviceService.getDeviceStatistics();
- return success(deviceStats);
- }
-
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceStats.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceStats.java
deleted file mode 100644
index a0d0e6f..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceStats.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.ard.qs.domain;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-@Data
-public class DeviceStats implements Serializable {
- private Integer totalDeviceCount;
- private Integer totalOnlineCount;
- private Integer totalOfflineCount;
- private Integer enableCount;
- private Integer deactivateCount;
- private Integer rtspCount;
- private Integer rtmpCount;
- private Integer flvCount;
- private Integer hlsCount;
- private Integer onvifCount;
- private Integer fileCount;
- private Integer hikSdkCount;
- private Integer hikIsupCount;
- private Integer dahuaSdkCount;
- private Integer gb28181Count;
- private Integer jt1078Count;
- private Integer pushCount;
-}
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceToGroupParam.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceToGroupParam.java
deleted file mode 100644
index 3847499..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceToGroupParam.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.ard.qs.domain;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class DeviceToGroupParam {
-
- private String parentId;
- private String businessGroup;
- private List<Long> deviceIds;
- private Boolean all;
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceToRegionParam.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceToRegionParam.java
deleted file mode 100644
index 8ccec56..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceToRegionParam.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.ard.qs.domain;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * 提交行政区划关联多个设备的参数
- */
-@Data
-public class DeviceToRegionParam {
-
- /**
- * 行政区划编号
- */
- private String civilCode;
-
- /**
- * 选择的设备, 和all参数二选一
- */
- private List<Long> deviceIds;
-
- /**
- * 所有通道, 和channelIds参数二选一
- */
- private Boolean all;
-
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceType.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceType.java
deleted file mode 100644
index 050f3c6..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.ard.qs.domain;
-
-import jakarta.validation.constraints.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()));
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceTypeEnum.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceTypeEnum.java
deleted file mode 100644
index 27e6292..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/DeviceTypeEnum.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package com.ard.qs.domain;
-
-/**
- * 收录行业编码
- */
-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/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/IndustryCodeType.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/IndustryCodeType.java
deleted file mode 100644
index 416bea0..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/IndustryCodeType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.ard.qs.domain;
-
-import jakarta.validation.constraints.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()));
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/IndustryCodeTypeEnum.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/IndustryCodeTypeEnum.java
deleted file mode 100644
index b8dcbf2..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/IndustryCodeTypeEnum.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.ard.qs.domain;
-
-import lombok.Getter;
-
-/**
- * 收录行业编码
- */
-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", "批发和零售业接入", ""),
- ;
-
- /**
- * 接入类型码
- */
- @Getter
- private String name;
-
- /**
- * 名称
- */
- @Getter
- private String code;
-
- /**
- * 备注
- */
- @Getter
- private String notes;
-
- IndustryCodeTypeEnum(String code, String name, String notes) {
- this.name = name;
- this.code = code;
- this.notes = notes;
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/NetworkIdentificationType.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/NetworkIdentificationType.java
deleted file mode 100644
index e0d719b..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/NetworkIdentificationType.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.ard.qs.domain;
-
-import jakarta.validation.constraints.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()));
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/NetworkIdentificationTypeEnum.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/NetworkIdentificationTypeEnum.java
deleted file mode 100644
index 21630d7..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/NetworkIdentificationTypeEnum.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.ard.qs.domain;
-
-/**
- * 收录行业编码
- */
-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/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/Preset.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/Preset.java
deleted file mode 100644
index eae5e3c..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/Preset.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.ard.qs.domain;
-
-public class Preset {
- private Integer index;
- private String name;
-
- public Preset() {
- }
-
- public Preset(Integer index, String name) {
- this.index = index;
- this.name = name;
- }
-
- public Integer getIndex() {
- return index;
- }
-
- public void setIndex(Integer index) {
- this.index = index;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/QsGroupTree.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/QsGroupTree.java
deleted file mode 100644
index f51ba33..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/QsGroupTree.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.ard.qs.domain;
-
-import com.ard.qs.api.domain.QsGroup;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 业务分组树
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-public class QsGroupTree extends QsGroup {
-
- /**
- * 树节点ID
- */
- private String treeId;
-
- /**
- * 是否有子节点
- */
- private boolean isLeaf;
-
- /**
- * 类型, 行政区划:0 摄像头: 1
- */
- private int type;
-
- /** 直播流接入类型(1=RTSP,2=RTMP,3=FLV,4=HLS,5=ONVIF,6=视频文件,7=海康SDK,8=海康ISUP,9=大华SDK,10=宇视SDK,11=天地伟业SDK,12=国标28181,13=PUSH,14=部标1078) */
- private int streamType;
-
- /**
- * 设备状态(OFFLINE=离线,ON=在线)
- */
- private String status;
-
- /**
- * 经度 WGS-84坐标系
- */
- private Double longitude;
-
- /**
- * 纬度 WGS-84坐标系
- */
- private Double latitude;
-
- /**
- * 设备厂商
- */
- private String manufacturer;
-
- /**
- * 安装地址
- */
- private String address;
-
- /**
- * 摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道
- */
- private Integer ptzType;
-
- /**
- * ip地址
- */
- private String ipAddress;
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/QsRegionTree.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/QsRegionTree.java
deleted file mode 100644
index aacee6f..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/QsRegionTree.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.ard.qs.domain;
-
-import com.ard.qs.api.domain.QsRegion;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 区域树
- */
-@EqualsAndHashCode(callSuper = true)
-@Data
-public class QsRegionTree extends QsRegion {
-
- /**
- * 树节点ID
- */
- private String treeId;
-
- /**
- * 是否有子节点
- */
- private boolean isLeaf;
-
- /**
- * 类型, 行政区划:0 摄像头: 1
- */
- private int type;
-
- /** 直播流接入类型(1=RTSP,2=RTMP,3=FLV,4=HLS,5=ONVIF,6=视频文件,7=海康SDK,8=海康ISUP,9=大华SDK,10=宇视SDK,11=天地伟业SDK,12=国标28181,13=PUSH,14=部标1078) */
- private int streamType;
-
- /**
- * 设备状态(OFFLINE=离线,ON=在线)
- */
- private String status;
-
- /**
- * 经度 WGS-84坐标系
- */
- private Double longitude;
-
- /**
- * 纬度 WGS-84坐标系
- */
- private Double latitude;
-
- /**
- * 设备厂商
- */
- private String manufacturer;
-
- /**
- * 安装地址
- */
- private String address;
-
- /**
- * 摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道
- */
- private Integer ptzType;
-
- /**
- * ip地址
- */
- private String ipAddress;
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/RecordPlanParam.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/RecordPlanParam.java
deleted file mode 100644
index 6d0da52..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/domain/RecordPlanParam.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.ard.qs.domain;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * 录制计划-添加/编辑参数
- */
-@Data
-public class RecordPlanParam {
-
- /**
- * 关联的设备ID,会为设备下的所有通道关联此录制计划,channelId存在是此项不生效,
- */
- private List<Long> deviceIds;
-
- /**
- * 全部关联/全部取消关联
- */
- private Boolean allLink;
-
- /**
- * 录制计划ID, ID为空是删除关联的计划
- */
- private Long planId;
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsDeviceMapper.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsDeviceMapper.java
deleted file mode 100644
index eae1ba5..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsDeviceMapper.java
+++ /dev/null
@@ -1,348 +0,0 @@
-package com.ard.qs.mapper;
-
-import com.ard.qs.api.domain.QsDevice;
-import com.ard.qs.api.domain.QsGroup;
-import com.ard.qs.api.domain.QsRegion;
-import com.ard.qs.domain.*;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * 视频监控设备Mapper接口
- *
- * @author fengcheng
- * @date 2026-03-27
- */
-public interface QsDeviceMapper {
- /**
- * 查询视频监控设备
- *
- * @param id 视频监控设备主键
- * @return 视频监控设备
- */
- public QsDevice selectQsDeviceById(Long id);
-
- /**
- * 查询视频监控设备列表
- *
- * @param qsDevice 视频监控设备
- * @return 视频监控设备集合
- */
- public List<QsDevice> selectQsDeviceList(QsDevice qsDevice);
-
- /**
- * 新增视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return 结果
- */
- public int insertQsDevice(QsDevice qsDevice);
-
- /**
- * 修改视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return 结果
- */
- public int updateQsDevice(QsDevice qsDevice);
-
- /**
- * 删除视频监控设备
- *
- * @param id 视频监控设备主键
- * @return 结果
- */
- public int deleteQsDeviceById(Long id);
-
- /**
- * 批量删除视频监控设备
- *
- * @param ids 需要删除的数据主键集合
- * @return 结果
- */
- public int deleteQsDeviceByIds(Long[] ids);
-
- /**
- * 状态修改
- *
- * @param id 视频监控设备主键
- * @param status 状态
- * @return
- */
- int updateQsDeviceStatus(@Param("id") Long id, @Param("status") String status);
-
- /**
- * 更新设备在线状态
- *
- * @param onlineDeviceSet 在线设备集合
- * @param deviceStatus 设备状态
- * @return
- */
- Boolean updateQsDeviceStatusList(@Param("list") Set<Long> onlineDeviceSet, @Param("deviceStatus") String deviceStatus);
-
- /**
- * 更具流id获取视频监控设备
- *
- * @param stream 流id
- * @return
- */
- QsDevice getQsDeviceStream(String stream);
-
- /**
- * 修改所有设备播状态离线和设备状态离线
- */
- void updateAllQsDevicesToOffline();
-
- /**
- * 获取所有视频监控设备流地址
- *
- * @return
- */
- List<QsDevice> fetchAllQsDeviceStreamUrls();
-
- /**
- * 更新所有视频监控设备流地址
- *
- * @param newQsDeviceList
- */
- void updateAllQsDeviceStreamUrls(List<QsDevice> newQsDeviceList);
-
- /**
- * 获取计划记录对应的视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return
- */
- List<QsDevice> listPlanRecordQsDevice(QsDevice qsDevice);
-
- /**
- * 录制计划关联所有设备
- *
- * @param planId
- */
- void linkAll(Long planId);
-
- /**
- * 录制计划取消关联所有设备
- *
- * @param planId
- */
- void cleanAll(Long planId);
-
- /**
- * 设备关联录制计划
- *
- * @param deviceIds
- * @param planId
- */
- void link(@Param("deviceIds") List<Long> deviceIds, @Param("planId") Long planId);
-
- /**
- * 清理设备计划id
- *
- * @param planId 设备id
- */
- void cleanRecordPlanId(Long planId);
-
- /**
- * 根据设备id集合查询设备信息
- *
- * @param startDeviceIdList 设备id集合
- * @return
- */
- List<QsDevice> queryByIds(@Param("startDeviceIdList") List<Long> startDeviceIdList);
-
- /**
- * 根据计划id查询设备数量
- *
- * @param planId 设备id
- * @return
- */
- Integer countRecordPlanDevice(Long planId);
-
- /**
- * 根据行政区划查询设备信息
- *
- * @param civilCode 行政区划
- * @return
- */
- List<QsDevice> queryByCivilCode(@Param("civilCode") String civilCode);
-
- /**
- * 根据行政区划更新设备信息
- *
- * @param civilCode 行政区划
- * @param deviceList 设备信息
- * @return
- */
- int updateCivilCodeByDeviceList(@Param("civilCode") String civilCode, @Param("deviceList") List<QsDevice> deviceList);
-
- /**
- * 根据行政区划编码删除设备
- *
- * @param allChildren 所有子节点
- */
- void removeCivilCode(@Param("allChildren") List<QsRegion> allChildren);
-
- /**
- * 根据设备id查询设备关联的行政区划树
- *
- * @param deviceId 区域国标编号
- * @return
- */
- List<QsRegionTree> queryForRegionTreeByCivilCode(String deviceId);
-
- /**
- * 根据设备id集合查询设备关联的行政区划树
- *
- * @param businessGroup
- * @param deviceList
- * @return
- */
- int updateBusinessGroupBydeviceList(@Param("businessGroup") String businessGroup, @Param("deviceList") List<QsDevice> deviceList);
-
- /**
- * 根据业务分组查询设备信息
- *
- * @param businessGroup
- * @return
- */
- List<QsDevice> queryByBusinessGroup(@Param("businessGroup") String businessGroup);
-
- /**
- * 根据父节点查询设备信息
- *
- * @param parentId
- * @return
- */
- List<QsDevice> queryByParentId(@Param("parentId") String parentId);
-
- /**
- * 根据父节点更新设备信息
- *
- * @param parentId
- * @param deviceList
- * @return
- */
- int updateParentIdByDeviceList(@Param("parentId") String parentId, @Param("deviceList") List<QsDevice> deviceList);
-
- /**
- * 根据通道id集合更新设备信息
- *
- * @param deviceList
- * @return
- */
- int removeParentIdByDevices(@Param("deviceList") List<QsDevice> deviceList);
-
- /**
- * 根据分组查询设备信息
- *
- * @param groupList
- * @return
- */
- List<QsDevice> queryByGroupList(List<QsGroup> groupList);
-
- /**
- * 根据业务分组查询设备关联的业务分组树
- *
- * @param query
- * @param parent
- * @return
- */
- List<QsGroupTree> queryForGroupTreeByParentId(@Param("query") String query, @Param("parent") String parent);
-
- /**
- * 根据行政区域获取视频监控设备列表
- *
- * @param qsDevice
- * @return
- */
- List<QsDevice> queryListByCivilCode(QsDevice qsDevice);
-
- /**
- * 根据行政区划编码添加设备
- *
- * @param civilCode
- * @param deviceList
- */
- int updateRegion(@Param("civilCode") String civilCode, @Param("deviceList") List<QsDevice> deviceList);
-
- /**
- * 根据行政区划编码删除设备
- *
- * @param deviceList
- * @return
- */
- int removeCivilCodeByDeletes(@Param("deviceList") List<QsDevice> deviceList);
-
- /**
- * 存在行政区划但无法挂载的通道列表
- *
- * @param qsDevice
- * @return
- */
- List<QsDevice> queryListByCivilCodeForUnusual(QsDevice qsDevice);
-
- /**
- * 获取所有异常的行政区划编码
- *
- * @return
- */
- List<Long> queryAllForUnusualCivilCode();
-
- /**
- * 根据设备id集合更新行政区划
- *
- * @param deviceList
- */
- void removeCivilCodeByDeviceIds(@Param("deviceList") List<Long> deviceList);
-
- /**
- * 获取关联业务分组通道列表
- *
- * @param qsDevice
- * @return
- */
- List<QsDevice> queryListByParentId(QsDevice qsDevice);
-
- /**
- * 设备设置业务分组
- *
- * @param parentId
- * @param businessGroup
- * @param deviceList
- * @return
- */
- int updateGroup(@Param("parentId") String parentId, @Param("businessGroup") String businessGroup, @Param("deviceList") List<QsDevice> deviceList);
-
- /**
- * 存在父节点编号但无法挂载的设备列表
- *
- * @param qsDevice
- * @return
- */
- List<QsDevice> queryListByParentForUnusual(QsDevice qsDevice);
-
- /**
- * 获取所有异常的父节点编号
- *
- * @return
- */
- List<Long> queryAllForUnusualParent();
-
- /**
- * 根据设备id集合更新父节点
- *
- * @param deviceIdsForClear
- */
- void removeParentIdByDeviceIds(@Param("deviceIdsForClear") List<Long> deviceIdsForClear);
-
- /**
- * 获取设备统计信息
- *
- * @return
- */
- DeviceStats getDeviceStatistics();
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsGroupMapper.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsGroupMapper.java
deleted file mode 100644
index 9736353..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsGroupMapper.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.ard.qs.mapper;
-
-import com.ard.qs.api.domain.QsGroup;
-import com.ard.qs.domain.QsGroupTree;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @FileName QsGroupMapper
- * @Description
- * @Author fengcheng
- * @date 2026-04-14
- **/
-public interface QsGroupMapper {
-
- /**
- * 根据设备id查询分组
- *
- * @param groupList
- * @return
- */
- List<QsGroup> queryInGroupListByDeviceId(@Param("groupList") ArrayList<QsGroup> groupList);
-
- /**
- * 新增分组
- *
- * @param group
- */
- void addBusinessGroup(QsGroup group);
-
- /**
- * 根据分组名称查询分组
- *
- * @param businessGroup
- * @return
- */
- QsGroup queryBusinessGroup(@Param("businessGroup") String businessGroup);
-
- /**
- * 根据设备id查询分组
- *
- * @param deviceId
- * @param businessGroup
- * @return
- */
- QsGroup queryOneByDeviceId(@Param("deviceId") String deviceId, @Param("businessGroup") String businessGroup);
-
- /**
- * 新增分组
- *
- * @param group
- */
- void add(QsGroup group);
-
- /**
- * 根据id查询分组
- *
- * @param id
- * @return
- */
- QsGroup queryOne(int id);
-
- /**
- * 更新分组
- *
- * @param group 分组信息
- */
- void update(QsGroup group);
-
- /**
- * 获取分组子节点
- *
- * @param id
- * @return
- */
- List<QsGroup> getChildren(int id);
-
- /**
- * 更新子节点
- *
- * @param parentId
- * @param group
- * @return
- */
- int updateChild(@Param("parentId") Integer parentId, @Param("group") QsGroup group);
-
- /**
- * 根据分组名称查询分组
- *
- * @param businessGroup
- * @return
- */
- List<QsGroup> queryByBusinessGroup(@Param("businessGroup") String businessGroup);
-
- /**
- * 批量删除
- *
- * @param allChildren 所有子节点
- */
- void batchDelete(@Param("allChildren") List<QsGroup> allChildren);
-
- /**
- * 查询分组树
- *
- * @param query 查询条件
- * @param parentId 父节点
- * @return
- */
- List<QsGroupTree> queryForTree(@Param("query") String query, @Param("parentId") Integer parentId);
-
- /**
- * 查询分组节点设备
- *
- * @return
- */
- List<QsGroupTree> queryForDevice();
-
- /**
- * 查询分组
- *
- * @param query
- * @param parentId
- * @param businessGroup
- * @return
- */
- List<QsGroup> query(@Param("query") String query, @Param("parentId") String parentId, @Param("businessGroup") String businessGroup);
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsRegionMapper.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsRegionMapper.java
deleted file mode 100644
index a1823f4..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/mapper/QsRegionMapper.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.ard.qs.mapper;
-
-import com.ard.qs.api.domain.QsRegion;
-import com.ard.qs.domain.QsRegionTree;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @FileName QsRegionMapper
- * @Description
- * @Author fengcheng
- * @date 2026-04-13
- **/
-public interface QsRegionMapper {
-
- /**
- * 添加区域
- *
- * @param region 区域信息
- */
- void add(QsRegion region);
-
- /**
- * 查询区域
- *
- * @param id 区域id
- * @return
- */
- QsRegion queryOne(int id);
-
- /**
- * 根据设备id查询区域
- *
- * @param deviceId 设备id
- * @return
- */
- QsRegion queryByDeviceId(String deviceId);
-
- /**
- * 更新父节点区域
- *
- * @param parentId 父节点id
- * @param parentDeviceId 父节点设备id
- */
- void updateChild(@Param("parentId") int parentId, @Param("parentDeviceId") String parentDeviceId);
-
- /**
- * 更新区域
- *
- * @param region
- */
- void update(QsRegion region);
-
- /**
- * 查询子节点
- *
- * @param parentId 父节点id
- * @return
- */
- List<QsRegion> getChildren(@Param("parentId") Integer parentId);
-
- /**
- * 删除所有子节点
- *
- * @param allChildren 所有子节点
- */
- void batchDelete(@Param("allChildren") List<QsRegion> allChildren);
-
- /**
- * 查询树形结构
- *
- * @param parent 所属行政区划编号
- * @return
- */
- List<QsRegionTree> queryForTree(Integer parent);
-
- /**
- * 查询区域节点设备
- *
- * @return
- */
- List<QsRegionTree> queryForDevice();
-
- /**
- * 查询区域
- *
- * @param query 要搜索的内容
- * @param parentId 父节点id
- * @return
- */
- List<QsRegion> query(@Param("query") String query, @Param("parentId") String parentId);
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/runner/QsCommandLineRunner.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/runner/QsCommandLineRunner.java
deleted file mode 100644
index 4570452..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/runner/QsCommandLineRunner.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.ard.qs.runner;
-
-import com.ard.qs.service.IQsDeviceService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.stereotype.Component;
-
-/**
- * 启动服务
- *
- * @FileName QsCommandLineRunner
- * @Description
- * @Author fengcheng
- * @date 2026-04-08
- **/
-@Component
-@Slf4j
-public class QsCommandLineRunner implements CommandLineRunner, DisposableBean {
-
- @Autowired
- private IQsDeviceService qsDeviceService;
-
-
- @Override
- public void destroy() throws Exception {
-
- }
-
- @Override
- public void run(String... args) throws Exception {
- log.info("启动服务==>修改所有设备播状态离线和设备状态离线");
- qsDeviceService.updateAllQsDevicesToOffline();
-
- qsDeviceService.task();
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsDeviceService.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsDeviceService.java
deleted file mode 100644
index 2db763f..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsDeviceService.java
+++ /dev/null
@@ -1,432 +0,0 @@
-package com.ard.qs.service;
-
-import com.ard.qs.api.domain.QsDevice;
-import com.ard.qs.api.domain.QsGroup;
-import com.ard.qs.api.domain.QsRegion;
-import com.ard.qs.domain.*;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * 视频监控设备Service接口
- *
- * @author fengcheng
- * @date 2026-03-27
- */
-public interface IQsDeviceService {
- /**
- * 查询视频监控设备
- *
- * @param id 视频监控设备主键
- * @return 视频监控设备
- */
- public QsDevice selectQsDeviceById(Long id);
-
- /**
- * 查询视频监控设备列表
- *
- * @param qsDevice 视频监控设备
- * @return 视频监控设备集合
- */
- public List<QsDevice> selectQsDeviceList(QsDevice qsDevice);
-
- /**
- * 新增视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return 结果
- */
- public int insertQsDevice(QsDevice qsDevice);
-
- /**
- * 修改视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return 结果
- */
- public int updateQsDevice(QsDevice qsDevice);
-
- /**
- * 批量删除视频监控设备
- *
- * @param ids 需要删除的视频监控设备主键集合
- * @return 结果
- */
- public int deleteQsDeviceByIds(Long[] ids);
-
- /**
- * 删除视频监控设备信息
- *
- * @param id 视频监控设备主键
- * @return 结果
- */
- public int deleteQsDeviceById(Long id);
-
- /**
- * 状态修改
- *
- * @param qsDevice 视频监控设备
- * @return
- */
- int updateQsDeviceStatus(QsDevice qsDevice);
-
- /**
- * 更新设备在线状态
- *
- * @param onlineDeviceSet 在线设备集合
- * @param deviceStatus 设备状态
- * @return
- */
- Boolean updateQsDeviceStatusList(Set<Long> onlineDeviceSet, String deviceStatus);
-
- /**
- * 修改视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return
- */
- int editQsDevice(QsDevice qsDevice);
-
- /**
- * 更具流id获取视频监控设备
- *
- * @param stream 流id
- * @return
- */
- QsDevice getQsDeviceStream(String stream);
-
- /**
- * 修改所有设备播状态离线和设备状态离线
- */
- void updateAllQsDevicesToOffline();
-
- /**
- * 获取所有视频监控设备流地址
- *
- * @return
- */
- List<QsDevice> fetchAllQsDeviceStreamUrls();
-
- /**
- * 更新所有视频监控设备流地址
- *
- * @param newQsDeviceList
- */
- void updateAllQsDeviceStreamUrls(List<QsDevice> newQsDeviceList);
-
- /**
- * 任务
- */
- void task();
-
- /**
- * 获取计划记录对应的视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return
- */
- List<QsDevice> listPlanRecordQsDevice(QsDevice qsDevice);
-
- /**
- * 录制计划关联所有设备
- *
- * @param planId
- */
- void linkAll(Long planId);
-
- /**
- * 录制计划取消关联所有设备
- *
- * @param planId
- */
- void cleanAll(Long planId);
-
- /**
- * 设备关联录制计划
- *
- * @param deviceIds
- * @param planId
- */
- void link(List<Long> deviceIds, Long planId);
-
- /**
- * 清理设备计划id
- *
- * @param planId 设备id
- */
- void cleanRecordPlanId(Long planId);
-
- /**
- * 根据设备id集合查询设备信息
- *
- * @param startDeviceIdList 设备id集合
- * @return
- */
- List<QsDevice> queryByIds(List<Long> startDeviceIdList);
-
- /**
- * 根据计划id查询设备数量
- *
- * @param planId 设备id
- * @return
- */
- Integer countRecordPlanDevice(Long planId);
-
- /**
- * 根据行政区划编码更新设备行政区划编码
- *
- * @param oldCivilCode 旧的行政区划编码
- * @param newCivilCode 新的行政区划编码
- */
- void updateCivilCode(String oldCivilCode, String newCivilCode);
-
- /**
- * 根据行政区划编码删除设备
- *
- * @param allChildren 所有子节点
- */
- void removeCivilCode(List<QsRegion> allChildren);
-
- /**
- * 根据设备id查询设备关联的行政区划树
- *
- * @param deviceId 区域国标编号
- * @return
- */
- List<QsRegionTree> queryForRegionTreeByCivilCode(String deviceId);
-
- /**
- * 根据业务分组更新设备业务分组
- *
- * @param oldBusinessGroup
- * @param newBusinessGroup
- */
- void updateBusinessGroup(String oldBusinessGroup, String newBusinessGroup);
-
- /**
- * 根据业务分组更新设备
- *
- * @param oldParentId
- * @param newParentId
- */
- void updateParentIdGroup(String oldParentId, String newParentId);
-
- /**
- * 根据业务分组删除设备
- *
- * @param businessGroup
- */
- void removeParentIdByBusinessGroup(String businessGroup);
-
- /**
- * 根据业务分组删除设备
- *
- * @param groupList
- */
- void removeParentIdByGroupList(List<QsGroup> groupList);
-
- /**
- * 根据业务分组查询设备关联的业务分组树
- *
- * @param query
- * @param parent
- * @return
- */
- List<QsGroupTree> queryForGroupTreeByParentId(String query, String parent);
-
- /**
- * 根据行政区域获取视频监控设备列表
- *
- * @param qsDevice
- * @return
- */
- List<QsDevice> queryListByCivilCode(QsDevice qsDevice);
-
- /**
- * 根据行政区划编码添加设备
- *
- * @param civilCode
- * @param deviceIds
- */
- void addDeviceToRegion(String civilCode, List<Long> deviceIds);
-
- /**
- * 设备删除行政区划
- *
- * @param civilCode
- * @param deviceIds
- */
- void deleteDeviceToRegion(String civilCode, List<Long> deviceIds);
-
- /**
- * 存在行政区划但无法挂载的通道列表
- *
- * @param qsDevice
- * @return
- */
- List<QsDevice> queryListByCivilCodeForUnusual(QsDevice qsDevice);
-
- /**
- * 清除存在行政区划但无法挂载的设备列表
- *
- * @param all
- * @param deviceIds
- */
- void clearDeviceCivilCode(Boolean all, List<Long> deviceIds);
-
- /**
- * 获取编码列表
- *
- * @return
- */
- List<NetworkIdentificationType> getNetworkIdentificationTypeList();
-
- /**
- * 获取编码列表
- *
- * @return
- */
- List<DeviceType> getDeviceTypeList();
-
- /**
- * 获取行业编码列表
- *
- * @return
- */
- List<IndustryCodeType> getIndustryCodeList();
-
- /**
- * 获取关联业务分组通道列表
- *
- * @param qsDevice
- * @return
- */
- List<QsDevice> queryListByParentId(QsDevice qsDevice);
-
- /**
- * 设备设置业务分组
- *
- * @param parentId
- * @param businessGroup
- * @param deviceIds
- */
- void addChannelToGroup(String parentId, String businessGroup, List<Long> deviceIds);
-
- /**
- * 删除业务分组设备
- *
- * @param parentId
- * @param businessGroup
- * @param deviceIds
- */
- void deleteDeviceToGroup(String parentId, String businessGroup, List<Long> deviceIds);
-
- /**
- * 存在父节点编号但无法挂载的设备列表
- *
- * @param qsDevice
- * @return
- */
- List<QsDevice> queryListByParentForUnusual(QsDevice qsDevice);
-
- /**
- * 清除存在分组节点但无法挂载的设备列表
- *
- * @param all
- * @param deviceIds
- */
- void clearDeviceParent(Boolean all, List<Long> deviceIds);
-
- /**
- * 获取设备统计信息
- *
- * @return
- */
- DeviceStats getDeviceStatistics();
-
- /**
- * 新增视频监控设备
- *
- * @param qsDevice
- * @return
- */
- int addQsDevice(QsDevice qsDevice);
-
- /**
- * 根据 gbDeviceId 更新设备在线状态
- *
- * @param gbDeviceId 国标设备编号
- * @param deviceStatus 设备状态
- * @return
- */
- Boolean updateDeviceStatusByGbDeviceId(String gbDeviceId, String deviceStatus);
-
- /**
- * 根据 jtMobileNo 更新设备在线状态
- *
- * @param jtMobileNo 设备手机号
- * @param deviceStatus 设备状态
- * @return
- */
- Boolean updateDeviceStatusByJtMobileNo(String jtMobileNo, String deviceStatus);
-
- /**
- * 开始云台控制
- *
- * @param id 设备id
- * @param direction 方向
- * @param controlSpeed 控制速度
- */
- void startPtz(Long id, String direction, Integer controlSpeed);
-
- /**
- * 结束云台控制
- *
- * @param id 设备id
- * @param direction 方向
- * @param controlSpeed 控制速度
- */
- void endPtz(Long id, String direction, Integer controlSpeed);
-
- /**
- * 获取预置点列表
- *
- * @param id 设备id
- * @param channelId 通道id
- * @return 预置点列表
- */
- List<Preset> getPresetList(Long id, Integer channelId);
-
- /**
- * 设置预置点
- *
- * @param id 设备id
- * @param channelId 通道id
- * @param presetIndex 预置点索引
- * @param presetName 预置点名称
- */
- void setPreset(Long id, Integer channelId, Integer presetIndex, String presetName);
-
- /**
- * 调用预置点
- *
- * @param id 设备id
- * @param channelId 通道id
- * @param presetIndex 预置点索引
- * @param speed 速度
- */
- void gotoPreset(Long id, Integer channelId, Integer presetIndex, Integer speed);
-
- /**
- * 删除预置点
- *
- * @param id 设备id
- * @param channelId 通道id
- * @param presetIndex 预置点索引
- */
- void deletePreset(Long id, Integer channelId, Integer presetIndex);
-
-
- void getVideoSnapshot(Long id);
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsGroupService.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsGroupService.java
deleted file mode 100644
index 2ba904c..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsGroupService.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.ard.qs.service;
-
-import com.ard.qs.api.domain.QsGroup;
-import com.ard.qs.domain.QsGroupTree;
-
-import java.util.List;
-
-/**
- * 分组管理服务接口
- *
- * @FileName IQsGroupService
- * @Description
- * @Author fengcheng
- * @date 2026-04-14
- **/
-public interface IQsGroupService {
-
- /**
- * 添加分组
- *
- * @param group 分组信息
- */
- void add(QsGroup group);
-
- /**
- * 更新分组
- *
- * @param group 分组信息
- */
- void update(QsGroup group);
-
- /**
- * 删除分组
- *
- * @param id 分组id
- */
- boolean delete(Integer id);
-
- /**
- * 查询分组树
- *
- * @param query 查询条件
- * @param parentId 父节点
- * @param hasDevice 是否包含设备
- * @return
- */
- List<QsGroupTree> queryForTree(String query, Integer parent, Boolean hasDevice);
-
- /**
- * 查询分组节点设备
- *
- * @return
- */
- List<QsGroupTree> queryForDevice();
-
- /**
- * 查询分组
- *
- * @param query 要搜索的内容
- * @return
- */
- List<QsGroup> queryList(String query);
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsRegionService.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsRegionService.java
deleted file mode 100644
index be57dd0..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IQsRegionService.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.ard.qs.service;
-
-import com.ard.qs.api.domain.QsRegion;
-import com.ard.qs.domain.QsRegionTree;
-
-import java.util.List;
-
-/**
- * 区域管理Service接口
- *
- * @FileName IQsRegionService
- * @Description
- * @Author fengcheng
- * @date 2026-04-13
- **/
-public interface IQsRegionService {
-
- /**
- * 添加区域
- *
- * @param region 区域信息
- */
- void add(QsRegion region);
-
- /**
- * 更新区域
- *
- * @param region 区域信息
- */
- void update(QsRegion region);
-
- /**
- * 区域ID
- *
- * @param id 区域ID
- * @return
- */
- boolean deleteByDeviceId(Integer id);
-
- /**
- * @param parent
- * @param hasDevice
- * @return
- */
- List<QsRegionTree> queryForTree(Integer parent, Boolean hasDevice);
-
- /**
- * 查询区域节点设备
- *
- * @return
- */
- List<QsRegionTree> queryForDevice();
-
- /**
- * 查询区域
- *
- * @param query 要搜索的内容
- * @return
- */
- List<QsRegion> queryList(Integer pageNum, Integer pageSize, String query);
-
- /**
- * 获取所属的行政区划下的行政区划
- *
- * @param parent 所属的行政区划
- * @return
- */
- List<QsRegion> getAllChild(String parent);
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IRedisCatchStorageService.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IRedisCatchStorageService.java
deleted file mode 100644
index b7101f8..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/IRedisCatchStorageService.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.ard.qs.service;
-
-import com.ard.qs.common.SystemAllInfo;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * @FileName IRedisCatchStorage
- * @Description
- * @Author fengcheng
- * @date 2026-04-15
- **/
-public interface IRedisCatchStorageService {
-
- /**
- * 获取系统信息
- *
- * @return
- */
- SystemAllInfo getSystemInfo();
-
- void addCpuInfo(double cpuInfo);
-
- void addMemInfo(double memInfo);
-
- void addNetInfo(Map<String, Double> networkInterfaces);
-
- void addDiskInfo(List<Map<String, Object>> diskInfo);
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsDeviceServiceImpl.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsDeviceServiceImpl.java
deleted file mode 100644
index a95ba25..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsDeviceServiceImpl.java
+++ /dev/null
@@ -1,1293 +0,0 @@
-package com.ard.qs.service.impl;
-
-import cn.hutool.core.util.IdUtil;
-import com.ard.common.core.constant.SecurityConstants;
-import com.ard.common.core.domain.R;
-import com.ard.common.core.enums.LiveStreamType;
-import com.ard.common.core.utils.DateUtils;
-import com.ard.common.core.utils.file.FileMultipartFile;
-import com.ard.common.security.utils.SecurityUtils;
-import com.ard.gb28181.api.RemoteGb28181Service;
-import com.ard.qs.api.domain.QsDevice;
-import com.ard.qs.api.domain.QsGroup;
-import com.ard.qs.api.domain.QsRegion;
-import com.ard.qs.domain.*;
-import com.ard.qs.mapper.QsDeviceMapper;
-import com.ard.qs.mapper.QsRegionMapper;
-import com.ard.qs.service.IQsDeviceService;
-import com.ard.qs.utils.StreamDetector;
-import com.ard.qs.utils.VideoSnapshotUtil;
-import com.ard.system.api.RemoteFileService;
-import com.ard.system.api.domain.SysFile;
-import com.ard.zlm.api.RemoteZlmService;
-import jakarta.annotation.Resource;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.ObjectUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * 视频监控设备Service业务层处理
- *
- * @author fengcheng
- * @date 2026-03-27
- */
-@Slf4j
-@Service
-@Transactional(rollbackFor = Exception.class)
-public class QsDeviceServiceImpl implements IQsDeviceService {
- @Autowired
- private QsDeviceMapper qsDeviceMapper;
-
- @Autowired
- private RemoteGb28181Service remoteGb28181Service;
-
- @Autowired
- private RemoteZlmService remoteZlmService;
-
- @Autowired
- private StreamDetector streamDetector;
-
- @Autowired
- private ThreadPoolTaskExecutor taskExecutor;
-
- @Autowired
- private QsRegionMapper qsRegionMapper;
-
- @Autowired
- private VideoSnapshotUtil videoSnapshotUtil;
-
- @Resource
- private RemoteFileService remoteFileService;
-
- /**
- * 查询视频监控设备
- *
- * @param id 视频监控设备主键
- * @return 视频监控设备
- */
- @Override
- public QsDevice selectQsDeviceById(Long id) {
- return qsDeviceMapper.selectQsDeviceById(id);
- }
-
- /**
- * 查询视频监控设备列表
- *
- * @param qsDevice 视频监控设备
- * @return 视频监控设备
- */
- @Override
- public List<QsDevice> selectQsDeviceList(QsDevice qsDevice) {
- return qsDeviceMapper.selectQsDeviceList(qsDevice);
- }
-
- /**
- * 新增视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return 结果
- */
- @Override
- public int insertQsDevice(QsDevice qsDevice) {
- qsDevice.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
- qsDevice.setCreateTime(DateUtils.getNowDate());
- qsDevice.setDeviceStatus("ON");
- // RTSP协议
- if (LiveStreamType.RTSP.getCode().equals(qsDevice.getType())) {
- qsDevice.setDeviceCode("device_" + IdUtil.getSnowflakeNextId());
- if (!isValidRtspFormat(qsDevice.getLiveAddress())) {
- throw new RuntimeException("RTSP地址格式不正确");
- }
- }
-
- // RTMP协议
- if (LiveStreamType.RTMP.getCode().equals(qsDevice.getType())) {
- qsDevice.setDeviceCode("device_" + IdUtil.getSnowflakeNextId());
- if (!isValidRtmpFormat(qsDevice.getLiveAddress())) {
- throw new RuntimeException("RTMP地址格式不正确");
- }
- }
-
- // 推流模式
- if (LiveStreamType.PUSH.getCode().equals(qsDevice.getType())) {
- qsDevice.setDeviceCode("device_" + IdUtil.getSnowflakeNextId());
- qsDevice.setDeviceStatus("OFFLINE");
- }
-
- // gb28181协议
- if (LiveStreamType.GB28181.getCode().equals(qsDevice.getType())) {
- qsDevice.setDeviceCode("device_" + IdUtil.getSnowflakeNextId());
- }
-
- // JT1078协议
- if (LiveStreamType.JT1078.getCode().equals(qsDevice.getType())) {
- qsDevice.setDeviceCode("device_" + IdUtil.getSnowflakeNextId());
- }
- return qsDeviceMapper.insertQsDevice(qsDevice);
- }
-
- /**
- * 修改视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return 结果
- */
- @Override
- public int updateQsDevice(QsDevice qsDevice) {
- qsDevice.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
- qsDevice.setUpdateTime(DateUtils.getNowDate());
-
- // RTSP协议
- if (LiveStreamType.RTSP.getCode().equals(qsDevice.getType())) {
- if (!isValidRtspFormat(qsDevice.getLiveAddress())) {
- throw new RuntimeException("RTSP地址格式不正确");
- }
- }
-
- // RTMP协议
- if (LiveStreamType.RTMP.getCode().equals(qsDevice.getType())) {
- if (!isValidRtmpFormat(qsDevice.getLiveAddress())) {
- throw new RuntimeException("RTMP地址格式不正确");
- }
- }
-
- // FLV协议
- if (LiveStreamType.FLV.getCode().equals(qsDevice.getType())) {
- String flvType = getProtocolTypeSimple(qsDevice.getLiveAddress());
- qsDevice.setFlvType(flvType);
- if (!isValidFlvAddress(qsDevice.getLiveAddress())) {
- throw new RuntimeException("FLV地址格式不正确");
- }
- }
-
- // HLS协议
- if (LiveStreamType.HLS.getCode().equals(qsDevice.getType())) {
- if (!isValidHlsAddress(qsDevice.getLiveAddress())) {
- throw new RuntimeException("HLS地址格式不正确");
- }
- }
-
- // 视频文件
- if (LiveStreamType.VIDEO_FILE.getCode().equals(qsDevice.getType())) {
- if (!isValidMp4Address(qsDevice.getLiveAddress())) {
- throw new RuntimeException("视频文件格式不正确");
- }
- }
-
-// // 海康SDK
-// if (LiveStreamType.HIK_SDK.getCode().equals(qsDevice.getType())) {
-//
-// LoginDevice loginDevice = new LoginDevice();
-// loginDevice.setIpAddress(qsDevice.getIpAddress());
-// loginDevice.setPort(Short.parseShort(String.valueOf(qsDevice.getPort())));
-// loginDevice.setUserName(qsDevice.getUserName());
-// loginDevice.setPassword(qsDevice.getPassword());
-// R<Integer> r = remoteHaiKangService.loginDevice(loginDevice, SecurityConstants.INNER);
-// if (r.getCode() != Constants.SUCCESS) {
-// throw new RuntimeException(r.getMsg());
-// }
-// }
-
-// // 大华sdk
-// if (LiveStreamType.DAHUA_SDK.getCode().equals(qsDevice.getType())) {
-//
-// com.ruoyi.dahua.api.domain.LoginDevice loginDevice = new com.ruoyi.dahua.api.domain.LoginDevice();
-//
-// // 1=主动添加
-// if("1".equals(qsDevice.getOnlineType())){
-// qsDevice.setDeviceCode("dahua_" + IdUtil.getSnowflakeNextId());
-// loginDevice.setIpAddress(qsDevice.getIpAddress());
-// loginDevice.setPort(qsDevice.getPort());
-// loginDevice.setUserName(qsDevice.getUserName());
-// loginDevice.setPassword(qsDevice.getPassword());
-// }
-//
-// // 2=主动注册
-// if("2".equals(qsDevice.getOnlineType())){
-// R<DahuaDevice> dahuaDevicer = remoteDaHuaService.getDahuaDevice(qsDevice.getIpAddress(),
-// SecurityConstants.INNER);
-// if(dahuaDevicer.getCode() != Constants.SUCCESS){
-// throw new RuntimeException(dahuaDevicer.getMsg());
-// }
-// if(dahuaDevicer.getData() == null){
-// throw new RuntimeException("未找到设备");
-// }
-// loginDevice.setIpAddress(qsDevice.getIpAddress());
-// loginDevice.setPort(Integer.valueOf(dahuaDevicer.getData().getPort()));
-// loginDevice.setDeviceId(dahuaDevicer.getData().getDeviceId());
-// loginDevice.setUserName(qsDevice.getUserName());
-// loginDevice.setPassword(qsDevice.getPassword());
-// loginDevice.setOnlineType(qsDevice.getOnlineType());
-// }
-//
-// R<Void> r = remoteDaHuaService.loginDevice(loginDevice, SecurityConstants.INNER);
-// if (r.getCode() != Constants.SUCCESS) {
-// throw new RuntimeException(r.getMsg());
-// }
-// }
- return qsDeviceMapper.updateQsDevice(qsDevice);
- }
-
- /**
- * 批量删除视频监控设备
- *
- * @param ids 需要删除的视频监控设备主键
- * @return 结果
- */
- @Override
- public int deleteQsDeviceByIds(Long[] ids) {
- return qsDeviceMapper.deleteQsDeviceByIds(ids);
- }
-
- /**
- * 删除视频监控设备信息
- *
- * @param id 视频监控设备主键
- * @return 结果
- */
- @Override
- public int deleteQsDeviceById(Long id) {
- return qsDeviceMapper.deleteQsDeviceById(id);
- }
-
- /**
- * 状态修改
- *
- * @param qsDevice 视频监控设备
- * @return
- */
- @Override
- public int updateQsDeviceStatus(QsDevice qsDevice) {
- return qsDeviceMapper.updateQsDeviceStatus(qsDevice.getId(), qsDevice.getStatus());
- }
-
- /**
- * 更新设备在线状态
- *
- * @param onlineDeviceSet 在线设备集合
- * @param deviceStatus 设备状态
- * @return
- */
- @Override
- public Boolean updateQsDeviceStatusList(Set<Long> onlineDeviceSet, String deviceStatus) {
- return qsDeviceMapper.updateQsDeviceStatusList(onlineDeviceSet, deviceStatus);
- }
-
- /**
- * 修改视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return
- */
- @Override
- public int editQsDevice(QsDevice qsDevice) {
- return qsDeviceMapper.updateQsDevice(qsDevice);
- }
-
- /**
- * 更具流id获取视频监控设备
- *
- * @param stream 流id
- * @return
- */
- @Override
- public QsDevice getQsDeviceStream(String stream) {
- return qsDeviceMapper.getQsDeviceStream(stream);
- }
-
- /**
- * 修改所有设备播状态离线和设备状态离线
- */
-
- @Override
- public void updateAllQsDevicesToOffline() {
- qsDeviceMapper.updateAllQsDevicesToOffline();
- }
-
- /**
- * 获取所有视频监控设备流地址
- *
- * @return
- */
- @Override
- public List<QsDevice> fetchAllQsDeviceStreamUrls() {
- return qsDeviceMapper.fetchAllQsDeviceStreamUrls();
- }
-
- /**
- * 更新所有视频监控设备流地址
- *
- * @param newQsDeviceList
- */
- @Override
- public void updateAllQsDeviceStreamUrls(List<QsDevice> newQsDeviceList) {
- qsDeviceMapper.updateAllQsDeviceStreamUrls(newQsDeviceList);
- }
-
- @Async("taskExecutor")
- @Override
- public void task() {
- List<QsDevice> qsDeviceList = fetchAllQsDeviceStreamUrls();
- if (qsDeviceList.isEmpty()) {
- return;
- }
-
- // 处理所有设备,替换 ws/wss 为 http/https,先替换 wss 防止被误判
- qsDeviceList.forEach(device -> {
- String originalUrl = device.getLiveAddress();
- if (originalUrl != null && !originalUrl.isEmpty()) {
- // 注意替换顺序,先替换 wss -> https,再替换 ws -> http
- String newUrl = originalUrl.replace("wss://", "https://")
- .replace("ws://", "http://");
- device.setLiveAddress(newUrl);
- }
- });
-
- List<StreamDetector.StreamResult> streamResults = streamDetector.batchDetect(qsDeviceList, taskExecutor);
-
- List<QsDevice> newQsDeviceList = new ArrayList<>();
- for (StreamDetector.StreamResult streamResult : streamResults) {
- QsDevice device = new QsDevice();
- device.setId(streamResult.getId());
- device.setDeviceStatus(streamResult.getStatus());
- newQsDeviceList.add(device);
- }
-
- if (!newQsDeviceList.isEmpty()) {
- updateAllQsDeviceStreamUrls(newQsDeviceList);
- }
- }
-
- /**
- * 获取计划记录对应的视频监控设备
- *
- * @param qsDevice 视频监控设备
- * @return
- */
- @Override
- public List<QsDevice> listPlanRecordQsDevice(QsDevice qsDevice) {
- return qsDeviceMapper.listPlanRecordQsDevice(qsDevice);
- }
-
- /**
- * 设备关联录制计划
- *
- * @param deviceIds
- * @param planId
- */
- @Override
- public void link(List<Long> deviceIds, Long planId) {
- qsDeviceMapper.link(deviceIds, planId);
- }
-
- /**
- * 清理设备计划id
- *
- * @param planId 设备id
- */
- @Override
- public void cleanRecordPlanId(Long planId) {
- qsDeviceMapper.cleanRecordPlanId(planId);
- }
-
- /**
- * 根据设备id集合查询设备信息
- *
- * @param startDeviceIdList 设备id集合
- * @return
- */
- @Override
- public List<QsDevice> queryByIds(List<Long> startDeviceIdList) {
- return qsDeviceMapper.queryByIds(startDeviceIdList);
- }
-
- /**
- * 根据计划id查询设备数量
- *
- * @param planId 设备id
- * @return
- */
- @Override
- public Integer countRecordPlanDevice(Long planId) {
- return qsDeviceMapper.countRecordPlanDevice(planId);
- }
-
- /**
- * 根据行政区划编码更新设备行政区划编码
- *
- * @param oldCivilCode 旧的行政区划编码
- * @param newCivilCode 新的行政区划编码
- */
- @Override
- public void updateCivilCode(String oldCivilCode, String newCivilCode) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByCivilCode(oldCivilCode);
- if (deviceList.isEmpty()) {
- return;
- }
- int result = qsDeviceMapper.updateCivilCodeByDeviceList(newCivilCode, deviceList);
- }
-
- /**
- * 根据行政区划编码删除设备
- *
- * @param allChildren 所有子节点
- */
- @Override
- public void removeCivilCode(List<QsRegion> allChildren) {
- qsDeviceMapper.removeCivilCode(allChildren);
- }
-
- /**
- * 根据设备id查询设备关联的行政区划树
- *
- * @param deviceId 区域国标编号
- * @return
- */
- @Override
- public List<QsRegionTree> queryForRegionTreeByCivilCode(String deviceId) {
- return qsDeviceMapper.queryForRegionTreeByCivilCode(deviceId);
- }
-
- /**
- * 根据业务分组更新设备业务分组
- *
- * @param oldBusinessGroup
- * @param newBusinessGroup
- */
- @Override
- public void updateBusinessGroup(String oldBusinessGroup, String newBusinessGroup) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByBusinessGroup(oldBusinessGroup);
- if (deviceList.isEmpty()) {
- log.info("[更新业务分组] 发现未关联任何设备: {}", oldBusinessGroup);
- return;
- }
- int result = qsDeviceMapper.updateBusinessGroupBydeviceList(newBusinessGroup, deviceList);
- }
-
- /**
- * 根据业务分组更新设备
- *
- * @param oldParentId
- * @param newParentId
- */
- @Override
- public void updateParentIdGroup(String oldParentId, String newParentId) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByParentId(oldParentId);
- if (deviceList.isEmpty()) {
- return;
- }
- int result = qsDeviceMapper.updateParentIdByDeviceList(newParentId, deviceList);
- }
-
- /**
- * 根据业务分组删除设备
- *
- * @param businessGroup
- */
- @Override
- public void removeParentIdByBusinessGroup(String businessGroup) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByBusinessGroup(businessGroup);
- if (deviceList.isEmpty()) {
- return;
- }
- int result = qsDeviceMapper.removeParentIdByDevices(deviceList);
- }
-
- /**
- * 根据业务分组删除设备
- *
- * @param groupList
- */
- @Override
- public void removeParentIdByGroupList(List<QsGroup> groupList) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByGroupList(groupList);
- if (deviceList.isEmpty()) {
- return;
- }
- qsDeviceMapper.removeParentIdByDevices(deviceList);
- }
-
- /**
- * 根据业务分组查询设备关联的业务分组树
- *
- * @param query
- * @param parent
- * @return
- */
- @Override
- public List<QsGroupTree> queryForGroupTreeByParentId(String query, String parent) {
- return qsDeviceMapper.queryForGroupTreeByParentId(query, parent);
- }
-
- /**
- * 根据行政区域获取视频监控设备列表
- *
- * @param qsDevice
- * @return
- */
- @Override
- public List<QsDevice> queryListByCivilCode(QsDevice qsDevice) {
- return qsDeviceMapper.queryListByCivilCode(qsDevice);
- }
-
- /**
- * 根据行政区划编码添加设备
- *
- * @param civilCode
- * @param deviceIds
- */
- @Override
- public void addDeviceToRegion(String civilCode, List<Long> deviceIds) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByIds(deviceIds);
- if (deviceList.isEmpty()) {
- throw new RuntimeException("所有设备Id不存在");
- }
- for (QsDevice device : deviceList) {
- device.setGbCivilCode(civilCode);
- }
- int result = qsDeviceMapper.updateRegion(civilCode, deviceList);
- }
-
- /**
- * 设备删除行政区划
- *
- * @param civilCode
- * @param deviceIds
- */
- @Override
- public void deleteDeviceToRegion(String civilCode, List<Long> deviceIds) {
- if (!ObjectUtils.isEmpty(civilCode)) {
- deleteToRegionByCivilCode(civilCode);
- }
- if (!ObjectUtils.isEmpty(deviceIds)) {
- deleteToRegionByChannelIds(deviceIds);
- }
- }
-
- /**
- * 存在行政区划但无法挂载的通道列表
- *
- * @param qsDevice
- * @return
- */
- @Override
- public List<QsDevice> queryListByCivilCodeForUnusual(QsDevice qsDevice) {
- return qsDeviceMapper.queryListByCivilCodeForUnusual(qsDevice);
- }
-
- /**
- * 清除存在行政区划但无法挂载的设备列表
- *
- * @param all
- * @param deviceIds
- */
- @Override
- public void clearDeviceCivilCode(Boolean all, List<Long> deviceIds) {
- List<Long> deviceIdsForClear;
- if (all != null && all) {
- deviceIdsForClear = qsDeviceMapper.queryAllForUnusualCivilCode();
- } else {
- deviceIdsForClear = deviceIds;
- }
- qsDeviceMapper.removeCivilCodeByDeviceIds(deviceIdsForClear);
- }
-
- /**
- * 获取编码列表
- *
- * @return
- */
- @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;
- }
-
- /**
- * 获取编码列表
- *
- * @return
- */
- @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;
- }
-
- /**
- * 获取行业编码列表
- *
- * @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;
- }
-
- /**
- * 获取关联业务分组通道列表
- *
- * @param qsDevice
- * @return
- */
- @Override
- public List<QsDevice> queryListByParentId(QsDevice qsDevice) {
- return qsDeviceMapper.queryListByParentId(qsDevice);
- }
-
- /**
- * 设备设置业务分组
- *
- * @param parentId
- * @param businessGroup
- * @param deviceIds
- */
- @Override
- public void addChannelToGroup(String parentId, String businessGroup, List<Long> deviceIds) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByIds(deviceIds);
- if (deviceList.isEmpty()) {
- throw new RuntimeException("所有设备Id不存在");
- }
- int result = qsDeviceMapper.updateGroup(parentId, businessGroup, deviceList);
- }
-
- /**
- * 删除业务分组设备
- *
- * @param parentId
- * @param businessGroup
- * @param deviceIds
- */
- @Override
- public void deleteDeviceToGroup(String parentId, String businessGroup, List<Long> deviceIds) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByIds(deviceIds);
- if (deviceList.isEmpty()) {
- throw new RuntimeException("所有通道Id不存在");
- }
- qsDeviceMapper.removeParentIdByDevices(deviceList);
- }
-
- /**
- * 存在父节点编号但无法挂载的设备列表
- *
- * @param qsDevice
- * @return
- */
- @Override
- public List<QsDevice> queryListByParentForUnusual(QsDevice qsDevice) {
- return qsDeviceMapper.queryListByParentForUnusual(qsDevice);
- }
-
- /**
- * 清除存在分组节点但无法挂载的设备列表
- *
- * @param all
- * @param deviceIds
- */
- @Override
- public void clearDeviceParent(Boolean all, List<Long> deviceIds) {
- List<Long> deviceIdsForClear;
- if (all != null && all) {
- deviceIdsForClear = qsDeviceMapper.queryAllForUnusualParent();
- } else {
- deviceIdsForClear = deviceIds;
- }
- qsDeviceMapper.removeParentIdByDeviceIds(deviceIdsForClear);
- }
-
- /**
- * 获取设备统计信息
- *
- * @return
- */
- @Override
- public DeviceStats getDeviceStatistics() {
- return qsDeviceMapper.getDeviceStatistics();
- }
-
- /**
- * 新增视频监控设备
- *
- * @param qsDevice
- * @return
- */
- @Override
- public int addQsDevice(QsDevice qsDevice) {
- return qsDeviceMapper.insertQsDevice(qsDevice);
- }
-
- /**
- * 根据 gbDeviceId 更新设备在线状态
- *
- * @param gbDeviceId 国标设备编号
- * @param deviceStatus 设备状态
- * @return
- */
- @Override
- public Boolean updateDeviceStatusByGbDeviceId(String gbDeviceId, String deviceStatus) {
- // 先查询是否有对应的设备
- QsDevice queryDevice = new QsDevice();
- queryDevice.setGbDeviceId(gbDeviceId);
- List<QsDevice> deviceList = qsDeviceMapper.selectQsDeviceList(queryDevice);
- if (deviceList.isEmpty()) {
- log.warn("[更新设备状态] 未找到 gbDeviceId 对应的设备:{}", gbDeviceId);
- return false;
- }
- // 更新设备状态
- QsDevice qsDevice = new QsDevice();
- qsDevice.setId(deviceList.get(0).getId());
- qsDevice.setDeviceStatus(deviceStatus);
- int result = qsDeviceMapper.updateQsDevice(qsDevice);
- return result > 0;
- }
-
- /**
- * 根据 jtMobileNo 更新设备在线状态
- *
- * @param jtMobileNo 设备手机号
- * @param deviceStatus 设备状态
- * @return
- */
- @Override
- public Boolean updateDeviceStatusByJtMobileNo(String jtMobileNo, String deviceStatus) {
- // 先查询是否有对应的设备
- QsDevice queryDevice = new QsDevice();
- queryDevice.setJtMobileNo(jtMobileNo);
- List<QsDevice> deviceList = qsDeviceMapper.selectQsDeviceList(queryDevice);
- if (deviceList.isEmpty()) {
- log.warn("[更新设备状态] 未找到 jtMobileNo 对应的设备:{}", jtMobileNo);
- return false;
- }
- // 更新设备状态
- QsDevice qsDevice = new QsDevice();
- qsDevice.setId(deviceList.get(0).getId());
- qsDevice.setDeviceStatus(deviceStatus);
- int result = qsDeviceMapper.updateQsDevice(qsDevice);
- return result > 0;
- }
-
- private void deleteToRegionByChannelIds(List<Long> deviceIds) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByIds(deviceIds);
- if (deviceList.isEmpty()) {
- throw new RuntimeException("所有通道Id不存在");
- }
- int result = qsDeviceMapper.removeCivilCodeByDeletes(deviceList);
- }
-
- private void deleteToRegionByCivilCode(String civilCode) {
- List<QsDevice> deviceList = qsDeviceMapper.queryByCivilCode(civilCode);
- if (deviceList.isEmpty()) {
- throw new RuntimeException("所有设备Id不存在");
- }
- int result = qsDeviceMapper.removeCivilCodeByDeletes(deviceList);
- }
-
- /**
- * 录制计划关联所有设备
- *
- * @param planId
- */
- @Override
- public void linkAll(Long planId) {
- qsDeviceMapper.linkAll(planId);
- }
-
- /**
- * 录制计划取消关联所有设备
- *
- * @param planId
- */
- @Override
- public void cleanAll(Long planId) {
- qsDeviceMapper.cleanAll(planId);
- }
-
- /**
- * 判断是否为合法的 RTSP 地址格式
- *
- * @param url 直播地址
- * @return true 表示格式正确且为 RTSP 协议
- */
- public static boolean isValidRtspFormat(String url) {
- if (url == null || url.trim().isEmpty()) {
- return false;
- }
-
- try {
- URI uri = new URI(url);
- // 1. 检查协议头是否为 rtsp
- if (!"rtsp".equalsIgnoreCase(uri.getScheme())) {
- return false;
- }
- // 2. 检查是否有主机地址(防止 rtsp:// 这种空地址)
- return uri.getHost() != null;
- } catch (URISyntaxException e) {
- return false;
- }
- }
-
- /**
- * 使用正则表达式判断是否为合法的 RTMP 地址
- * 匹配规则:rtmp:// + 域名/IP + 可选端口 + 路径
- */
- public static boolean isValidRtmpFormat(String url) {
- if (url == null || url.trim().isEmpty()) {
- return false;
- }
-
- // 正则解释:
- // ^rtmp:// : 必须以 rtmp:// 开头
- // [a-zA-Z0-9-.]+ : 域名或IP
- // (:[\\d]{1,5})? : 可选的端口号 (如 :1935)
- // /.* : 后面必须跟斜杠和路径(应用名/流ID)
- String regex = "^rtmp://[a-zA-Z0-9-.]+(:[\\d]{1,5})?/.*$";
-
- Pattern pattern = Pattern.compile(regex);
- Matcher matcher = pattern.matcher(url);
-
- return matcher.matches();
- }
-
- /**
- * 判断是否为合法的 FLV 地址
- * 规则:
- * 1. 协议头支持:http://, https://, ws://, wss://
- * 2. 必须以 .flv 结尾(忽略大小写)
- * 3. 允许后面跟随查询参数(如 ?token=xxx)
- */
- public static boolean isValidFlvAddress(String url) {
- if (url == null || url.trim().isEmpty()) {
- return false;
- }
-
- // 正则解释:
- // ^https?:// : 匹配 http:// 或 https://
- // | : 或者
- // wss?:// : 匹配 ws:// 或 wss://
- // .+ : 匹配中间的域名和路径
- // \.flv : 必须以 .flv 结尾
- // (\\?.*)?$ : 允许后面跟随 ? 开头的参数(可选)
- String regex = "^(https?|wss?)://.+\\.flv(\\?.*)?$";
-
- Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
- Matcher matcher = pattern.matcher(url);
-
- return matcher.matches();
- }
-
- /**
- * 判断是否为合法的 HLS 地址
- * 规则:必须以 http:// 或 https:// 开头,且以 .m3u8 结尾(忽略大小写,允许带参数)
- */
- public static boolean isValidHlsAddress(String url) {
- if (url == null || url.trim().isEmpty()) {
- return false;
- }
-
- // 正则解释:
- // ^https?:// : 匹配 http:// 或 https://
- // .+ : 匹配中间的域名和路径
- // \.m3u8 : 必须以 .m3u8 结尾
- // (\\?.*)?$ : 允许后面跟随 ? 开头的参数(如 token=xxx),且参数是可选的
- String regex = "^https?://.+\\.m3u8(\\?.*)?$";
-
- Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
- Matcher matcher = pattern.matcher(url);
-
- return matcher.matches();
- }
-
- /**
- * 判断是否为合法的 MP4 地址
- * 规则:必须以 http:// 或 https:// 开头,且以 .mp4 结尾(忽略大小写,允许带参数)
- */
- public static boolean isValidMp4Address(String url) {
- if (url == null || url.trim().isEmpty()) {
- return false;
- }
-
- // 正则解释:
- // ^https?:// : 匹配 http:// 或 https://
- // .+ : 匹配中间的域名和路径
- // \.mp4 : 必须以 .mp4 结尾
- // (\\?.*)?$ : 允许后面跟随 ? 开头的参数(如 token=xxx),且参数是可选的
- String regex = "^https?://.+\\.mp4(\\?.*)?$";
-
- Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
- Matcher matcher = pattern.matcher(url);
-
- return matcher.matches();
- }
-
- /**
- * 判断 URL 协议类型 (无前缀版本)
- */
- public static String getProtocolTypeSimple(String url) {
- if (url == null) return null;
-
- // 转小写以防万一
- String lowerUrl = url.toLowerCase();
-
- if (lowerUrl.startsWith("http://") || lowerUrl.startsWith("https://")) {
- return "flv";
- }
-
- if (lowerUrl.startsWith("ws://") || lowerUrl.startsWith("wss://")) {
- return "ws";
- }
-
- return null;
- }
-
- /**
- * 将方向字符串转换为海康 ISUP PTZ 命令码
- */
- private int convertDirectionToHikIsupPtz(String direction) {
- if (direction == null || direction.isEmpty()) {
- throw new RuntimeException("云台控制方向不能为空");
- }
- String lowerDir = direction.toLowerCase();
- switch (lowerDir) {
- case "up":
- case "tilt_up":
- return 0; // PTZ_UP
- case "down":
- case "tilt_down":
- return 1; // PTZ_DOWN
- case "left":
- case "pan_left":
- return 2; // PTZ_LEFT
- case "right":
- case "pan_right":
- return 3; // PTZ_RIGHT
- case "upleft":
- case "up_left":
- return 4; // PTZ_UPLEFT
- case "downleft":
- case "down_left":
- return 5; // PTZ_DOWNLEFT
- case "upright":
- case "up_right":
- return 6; // PTZ_UPRIGHT
- case "downright":
- case "down_right":
- return 7; // PTZ_DOWNRIGHT
- case "zoomin":
- case "zoom_in":
- return 8; // PTZ_ZOOMIN
- case "zoomout":
- case "zoom_out":
- return 9; // PTZ_ZOOMOUT
- case "near":
- case "focus_near":
- return 10; // PTZ_FOCUSNEAR
- case "far":
- case "focus_far":
- return 11; // PTZ_FOCUSFAR
- case "in":
- case "iris_open":
- return 12; // PTZ_IRISSTARTUP
- case "out":
- case "iris_close":
- return 13; // PTZ_IRISSTOPDOWN
- default:
- throw new RuntimeException("不支持的云台控制方向: " + direction);
- }
- }
-
- @Override
- public void startPtz(Long id, String direction, Integer controlSpeed) {
- QsDevice device = selectQsDeviceById(id);
- if (device == null) {
- throw new RuntimeException("设备不存在");
- }
-
- Integer channel = device.getChannel() != null ? device.getChannel() : 0;
- String deviceType = device.getType();
-
- if (LiveStreamType.GB28181.getCode().equals(deviceType)) {
- // GB28181协议
- if (device.getGbDeviceId() == null || device.getGbChannelId() == null) {
- throw new RuntimeException("设备未配置 GB28181 设备ID或通道ID");
- }
- // 根据控制类型调用不同的 GB28181 接口
- String controlType = getPtzControlType(direction);
- Integer speed = (controlSpeed != null) ? controlSpeed : 50;
-
- switch (controlType) {
- case "rotate":
- Integer horizonSpeed = speed;
- Integer verticalSpeed = speed;
- Integer zoomSpeed = (speed / 10);
- remoteGb28181Service.ptz(device.getGbDeviceId(), device.getGbChannelId(), direction, horizonSpeed
- , verticalSpeed, zoomSpeed, SecurityConstants.INNER);
- break;
- case "focus":
- remoteGb28181Service.focus(device.getGbDeviceId(), device.getGbChannelId(), direction, speed,
- SecurityConstants.INNER);
- break;
- case "iris":
- remoteGb28181Service.iris(device.getGbDeviceId(), device.getGbChannelId(), direction, speed,
- SecurityConstants.INNER);
- break;
- case "zoom":
- // GB28181 的缩放通过 ptz 接口处理
- Integer horizonSpeedForZoom = 0;
- Integer verticalSpeedForZoom = 0;
- Integer zoomSpeedForZoom = speed;
- remoteGb28181Service.ptz(device.getGbDeviceId(), device.getGbChannelId(), direction,
- horizonSpeedForZoom, verticalSpeedForZoom, zoomSpeedForZoom, SecurityConstants.INNER);
- break;
- default:
- throw new RuntimeException("不支持的云台控制类型: " + controlType);
- }
-
- } else {
- throw new RuntimeException("不支持的设备类型: " + deviceType);
- }
- }
-
- private String getPtzControlType(String direction) {
- switch (direction) {
- case "up":
- case "down":
- case "left":
- case "right":
- return "rotate";
- case "zoomin":
- case "zoomout":
- return "zoom";
- case "near":
- case "far":
- return "focus";
- case "in":
- case "out":
- return "iris";
- default:
- return "rotate";
- }
- }
-
- @Override
- public void endPtz(Long id, String direction, Integer controlSpeed) {
- QsDevice device = selectQsDeviceById(id);
- if (device == null) {
- throw new RuntimeException("设备不存在");
- }
-
- Integer channel = device.getChannel() != null ? device.getChannel() : 0;
- String deviceType = device.getType();
-
- if (LiveStreamType.GB28181.getCode().equals(deviceType)) {
- // GB28181协议
- if (device.getGbDeviceId() == null || device.getGbChannelId() == null) {
- throw new RuntimeException("设备未配置 GB28181 设备ID或通道ID");
- }
- // 根据控制类型调用不同的 GB28181 停止接口
- String controlType = getPtzControlType(direction);
- String stopCommand = "stop";
- Integer stopSpeed = 0;
-
- switch (controlType) {
- case "rotate":
- remoteGb28181Service.ptz(device.getGbDeviceId(), device.getGbChannelId(), stopCommand, 0, 0, 0,
- SecurityConstants.INNER);
- break;
- case "focus":
- remoteGb28181Service.focus(device.getGbDeviceId(), device.getGbChannelId(), stopCommand,
- stopSpeed, SecurityConstants.INNER);
- break;
- case "iris":
- remoteGb28181Service.iris(device.getGbDeviceId(), device.getGbChannelId(), stopCommand, stopSpeed
- , SecurityConstants.INNER);
- break;
- case "zoom":
- remoteGb28181Service.ptz(device.getGbDeviceId(), device.getGbChannelId(), stopCommand, 0, 0, 0,
- SecurityConstants.INNER);
- break;
- default:
- // 默认调用 ptz 停止
- remoteGb28181Service.ptz(device.getGbDeviceId(), device.getGbChannelId(), stopCommand, 0, 0, 0,
- SecurityConstants.INNER);
- break;
- }
-
- } else {
- throw new RuntimeException("不支持的设备类型: " + deviceType);
- }
- }
-
-
- @Override
- public List<Preset> getPresetList(Long id, Integer channelId) {
- QsDevice device = selectQsDeviceById(id);
- if (device == null) {
- throw new RuntimeException("设备不存在");
- }
-
- String deviceType = device.getType();
- Integer channel = channelId != null ? channelId : (device.getChannel() != null ? device.getChannel() : 0);
-
- if (LiveStreamType.GB28181.getCode().equals(deviceType)) {
- if (device.getGbDeviceId() == null || device.getGbChannelId() == null) {
- throw new RuntimeException("设备未配置 GB28181 设备ID或通道ID");
- }
- R<Object> result = remoteGb28181Service.queryPreset(device.getGbDeviceId(), device.getGbChannelId(),
- SecurityConstants.INNER);
- Object data = result.getData();
- List<Preset> presetList = new ArrayList<>();
- if (data instanceof List) {
- List<?> list = (List<?>) data;
- for (Object item : list) {
- if (item instanceof Map) {
- Map<?, ?> map = (Map<?, ?>) item;
- Preset preset = new Preset();
- Object indexObj = map.get("index");
- Object nameObj = map.get("name");
- preset.setIndex(indexObj != null ? Integer.parseInt(indexObj.toString()) : null);
- preset.setName(nameObj != null ? nameObj.toString() : null);
- presetList.add(preset);
- }
- }
- }
- return presetList;
- } else {
- throw new RuntimeException("不支持的设备类型: " + deviceType);
- }
- }
-
- @Override
- public void setPreset(Long id, Integer channelId, Integer presetIndex, String presetName) {
- QsDevice device = selectQsDeviceById(id);
- if (device == null) {
- throw new RuntimeException("设备不存在");
- }
-
- String deviceType = device.getType();
- Integer channel = channelId != null ? channelId : (device.getChannel() != null ? device.getChannel() : 0);
-
- if (LiveStreamType.GB28181.getCode().equals(deviceType)) {
- if (device.getGbDeviceId() == null || device.getGbChannelId() == null) {
- throw new RuntimeException("设备未配置 GB28181 设备ID或通道ID");
- }
- remoteGb28181Service.addPreset(device.getGbDeviceId(), device.getGbChannelId(), presetIndex,
- SecurityConstants.INNER);
- } else {
- throw new RuntimeException("不支持的设备类型: " + deviceType);
- }
- }
-
- @Override
- public void gotoPreset(Long id, Integer channelId, Integer presetIndex, Integer speed) {
- QsDevice device = selectQsDeviceById(id);
- if (device == null) {
- throw new RuntimeException("设备不存在");
- }
-
- String deviceType = device.getType();
- Integer channel = channelId != null ? channelId : (device.getChannel() != null ? device.getChannel() : 0);
- Integer useSpeed = speed != null ? speed : 50;
-
- if (LiveStreamType.GB28181.getCode().equals(deviceType)) {
- if (device.getGbDeviceId() == null || device.getGbChannelId() == null) {
- throw new RuntimeException("设备未配置 GB28181 设备ID或通道ID");
- }
- remoteGb28181Service.callPreset(device.getGbDeviceId(), device.getGbChannelId(), presetIndex,
- SecurityConstants.INNER);
- } else {
- throw new RuntimeException("不支持的设备类型: " + deviceType);
- }
- }
-
- @Override
- public void deletePreset(Long id, Integer channelId, Integer presetIndex) {
- QsDevice device = selectQsDeviceById(id);
- if (device == null) {
- throw new RuntimeException("设备不存在");
- }
-
- String deviceType = device.getType();
- Integer channel = channelId != null ? channelId : (device.getChannel() != null ? device.getChannel() : 0);
-
- if (LiveStreamType.GB28181.getCode().equals(deviceType)) {
- if (device.getGbDeviceId() == null || device.getGbChannelId() == null) {
- throw new RuntimeException("设备未配置 GB28181 设备ID或通道ID");
- }
- remoteGb28181Service.deletePreset(device.getGbDeviceId(), device.getGbChannelId(), presetIndex,
- SecurityConstants.INNER);
- } else {
- throw new RuntimeException("不支持的设备类型: " + deviceType);
- }
- }
-
- @Override
- public void getVideoSnapshot(Long id) {
- QsDevice device = this.selectQsDeviceById(id);
- if (device == null) {
- throw new RuntimeException("设备不存在");
- }
-
- if (device.getLiveAddress() == null || device.getLiveAddress().isEmpty()) {
- throw new RuntimeException("设备直播地址为空");
- }
-
- try {
-// String videoPath = convertUrlToPath(device.getLiveAddress(), this.fileDomain, this.filePrefix, this.filePath);
-//
-// String fileName = "/video_file-" + device.getDeviceCode() + ".jpg";
-//
-// String savePath = this.filePath + "/snap" + fileName;
-
- // 截取第 1 秒的画面
- // videoSnapshotUtil.takeSnapshot(videoPath, savePath, 1.0);
-
- // String filePath = fileDomain + filePrefix + "/snap/" + fileName;
- // 通过文件服务上传到 MinIO
-// File snapFile = new File(localSnapPath);
-// FileMultipartFile multipartFile = new FileMultipartFile(snapFile, fileName, "image/jpeg");
-// R<SysFile> fileResult = remoteFileService.upload(multipartFile);
-// if (fileResult == null || fileResult.getData() == null) {
-// throw new RuntimeException("上传截图到文件服务失败");
-// }
-//
-// QsDevice qsDevice = new QsDevice();
-// qsDevice.setId(id);
-// qsDevice.setSnap(filePath);
-// this.updateQsDevice(qsDevice);
- } catch (Exception e) {
- log.error("[获取视频截图失败] 设备ID: {}, 错误: {}", id, e.getMessage());
- }
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsGroupServiceImpl.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsGroupServiceImpl.java
deleted file mode 100644
index 7610fdc..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsGroupServiceImpl.java
+++ /dev/null
@@ -1,236 +0,0 @@
-package com.ard.qs.service.impl;
-
-import com.google.common.collect.Lists;
-import com.ard.common.core.utils.DateUtils;
-import com.ard.qs.common.GbCode;
-import com.ard.qs.api.domain.QsGroup;
-import com.ard.qs.domain.QsGroupTree;
-import com.ard.qs.mapper.QsGroupMapper;
-import com.ard.qs.service.IQsDeviceService;
-import com.ard.qs.service.IQsGroupService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.Assert;
-import org.springframework.util.ObjectUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 分组管理服务层处理
- *
- * @FileName QsGroupServiceImpl
- * @Description
- * @Author fengcheng
- * @date 2026-04-14
- **/
-@Slf4j
-@Service
-@Transactional(rollbackFor = Exception.class)
-public class QsGroupServiceImpl implements IQsGroupService {
-
- @Autowired
- private QsGroupMapper qsGroupMapper;
-
- @Autowired
- private IQsDeviceService qsDeviceService;
-
- /**
- * 添加分组
- *
- * @param group 分组信息
- */
- @Override
- public void add(QsGroup group) {
- Assert.notNull(group, "参数不可为NULL");
- Assert.notNull(group.getDeviceId(), "分组编号不可为NULL");
- Assert.isTrue(group.getDeviceId().trim().length() == 20, "分组编号必须为20位");
- Assert.notNull(group.getName(), "分组名称不可为NULL");
-
- GbCode gbCode = GbCode.decode(group.getDeviceId());
- Assert.notNull(gbCode, "分组编号不满足国标定义");
-
- // 查询数据库中已经存在的.
- List<QsGroup> groupListInDb = qsGroupMapper.queryInGroupListByDeviceId(Lists.newArrayList(group));
- if (!ObjectUtils.isEmpty(groupListInDb)) {
- throw new RuntimeException(String.format("该节点编号 %s 已存在", group.getDeviceId()));
- }
-
- if ("215".equals(gbCode.getTypeCode())) {
- // 添加业务分组
- addBusinessGroup(group);
- } else {
- Assert.isTrue("216".equals(gbCode.getTypeCode()), "创建虚拟组织时设备编号11-13位应使用216");
- // 添加虚拟组织
- addGroup(group);
- }
- }
-
- /**
- * 更新分组
- *
- * @param group 分组信息
- */
- @Override
- public void update(QsGroup group) {
- Assert.isTrue(group.getId() > 0, "更新必须携带分组ID");
- Assert.notNull(group.getDeviceId(), "编号不可为NULL");
- Assert.notNull(group.getBusinessGroup(), "业务分组不可为NULL");
- QsGroup groupInDb = qsGroupMapper.queryOne(group.getId());
- Assert.notNull(groupInDb, "分组不存在");
-
- // 查询数据库中已经存在的.
- List<QsGroup> groupListInDb = qsGroupMapper.queryInGroupListByDeviceId(Lists.newArrayList(group));
- if (!ObjectUtils.isEmpty(groupListInDb) && groupListInDb.get(0).getId() != group.getId()) {
- throw new RuntimeException(String.format("该该节点编号 %s 已存在", group.getDeviceId()));
- }
-
- group.setName(group.getName());
- group.setUpdateTime(DateUtils.getNowDate());
- qsGroupMapper.update(group);
-
- // 修改他的子节点
- if (!group.getDeviceId().equals(groupInDb.getDeviceId())
- || !group.getBusinessGroup().equals(groupInDb.getBusinessGroup())) {
- List<QsGroup> groupList = queryAllChildren(groupInDb.getId());
- if (!groupList.isEmpty()) {
- int result = qsGroupMapper.updateChild(groupInDb.getId(), group);
- if (result > 0) {
- for (QsGroup chjildGroup : groupList) {
- chjildGroup.setParentDeviceId(group.getDeviceId());
- chjildGroup.setBusinessGroup(group.getBusinessGroup());
- }
- }
- }
- }
-
- // 由于编号变化,会需要处理太多内容以及可能发送大量消息,所以目前更新只只支持重命名
- GbCode decode = GbCode.decode(group.getDeviceId());
- if (!groupInDb.getDeviceId().equals(group.getDeviceId())) {
- if (decode.getTypeCode().equals("215")) {
- // 业务分组变化。需要将其下的所有业务分组修改
- qsDeviceService.updateBusinessGroup(groupInDb.getDeviceId(), group.getDeviceId());
- } else {
- // 虚拟组织修改,需要把其下的子节点修改父节点ID
- qsDeviceService.updateParentIdGroup(groupInDb.getDeviceId(), group.getDeviceId());
- }
- }
- }
-
- /**
- * 删除分组
- *
- * @param id 分组id
- */
- @Override
- public boolean delete(Integer id) {
- QsGroup group = qsGroupMapper.queryOne(id);
- Assert.notNull(group, "分组不存在");
- List<QsGroup> groupListForDelete = new ArrayList<>();
- GbCode gbCode = GbCode.decode(group.getDeviceId());
- if (gbCode.getTypeCode().equals("215")) {
- List<QsGroup> groupList = qsGroupMapper.queryByBusinessGroup(group.getDeviceId());
- if (!groupList.isEmpty()) {
- groupListForDelete.addAll(groupList);
- }
- // 业务分组
- qsDeviceService.removeParentIdByBusinessGroup(group.getDeviceId());
- } else {
- List<QsGroup> groupList = queryAllChildren(group.getId());
- if (!groupList.isEmpty()) {
- groupListForDelete.addAll(groupList);
- }
- groupListForDelete.add(group);
- qsDeviceService.removeParentIdByGroupList(groupListForDelete);
- }
- qsGroupMapper.batchDelete(groupListForDelete);
-
- return true;
- }
-
- /**
- * 查询分组树
- *
- * @param query 查询条件
- * @param parentId 父节点
- * @param hasDevice 是否包含设备
- * @return
- */
- @Override
- public List<QsGroupTree> queryForTree(String query, Integer parentId, Boolean hasDevice) {
- List<QsGroupTree> groupTrees = qsGroupMapper.queryForTree(query, parentId);
- if (parentId == null) {
- return groupTrees;
- }
- // 查询含有的通道
- QsGroup parentGroup = qsGroupMapper.queryOne(parentId);
- if (parentGroup != null && hasDevice != null && hasDevice) {
- List<QsGroupTree> groupTreesForChannel = qsDeviceService.queryForGroupTreeByParentId(query, parentGroup.getDeviceId());
- if (!ObjectUtils.isEmpty(groupTreesForChannel)) {
- groupTrees.addAll(groupTreesForChannel);
- }
- }
- return groupTrees;
- }
-
- /**
- * 查询分组节点设备
- *
- * @return
- */
- @Override
- public List<QsGroupTree> queryForDevice() {
- return qsGroupMapper.queryForDevice();
- }
-
- /**
- * 查询分组
- *
- * @param query 要搜索的内容
- * @return
- */
- @Override
- public List<QsGroup> queryList(String query) {
- if (query != null) {
- query = query.replaceAll("/", "//")
- .replaceAll("%", "/%")
- .replaceAll("_", "/_");
- }
- List<QsGroup> list = qsGroupMapper.query(query, null, null);
- return list;
- }
-
- private List<QsGroup> queryAllChildren(int id) {
- List<QsGroup> children = qsGroupMapper.getChildren(id);
- if (ObjectUtils.isEmpty(children)) {
- return children;
- }
- for (int i = 0; i < children.size(); i++) {
- children.addAll(queryAllChildren(children.get(i).getId()));
- }
- return children;
- }
-
- private void addBusinessGroup(QsGroup group) {
- group.setBusinessGroup(group.getDeviceId());
- group.setCreateTime(DateUtils.getNowDate());
- qsGroupMapper.addBusinessGroup(group);
- }
-
- private void addGroup(QsGroup group) {
- // 建立虚拟组织
- Assert.notNull(group.getBusinessGroup(), "所属的业务分组分组不存在");
- QsGroup businessGroup = qsGroupMapper.queryBusinessGroup(group.getBusinessGroup());
- Assert.notNull(businessGroup, "所属的业务分组分组不存在");
- if (!ObjectUtils.isEmpty(group.getParentDeviceId())) {
- QsGroup parentGroup = qsGroupMapper.queryOneByDeviceId(group.getParentDeviceId(), group.getBusinessGroup());
- Assert.notNull(parentGroup, "所属的上级分组分组不存在");
- } else {
- group.setParentDeviceId(null);
- }
- group.setCreateTime(DateUtils.getNowDate());
- qsGroupMapper.add(group);
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsRegionServiceImpl.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsRegionServiceImpl.java
deleted file mode 100644
index b079608..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/QsRegionServiceImpl.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package com.ard.qs.service.impl;
-
-import com.ard.common.core.utils.DateUtils;
-import com.ard.qs.api.domain.QsRegion;
-import com.ard.qs.domain.QsRegionTree;
-import com.ard.qs.mapper.QsRegionMapper;
-import com.ard.qs.service.IQsDeviceService;
-import com.ard.qs.service.IQsRegionService;
-import com.ard.qs.api.utils.CivilCodeUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.DuplicateKeyException;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.Assert;
-import org.springframework.util.ObjectUtils;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * 区域管理Service接口 实现类
- *
- * @FileName QsRegionServiceImpl
- * @Description
- * @Author fengcheng
- * @date 2026-04-13
- **/
-@Slf4j
-@Service
-@Transactional(rollbackFor = Exception.class)
-public class QsRegionServiceImpl implements IQsRegionService {
-
- @Autowired
- private QsRegionMapper qsRegionMapper;
- ;
-
- @Autowired
- private IQsDeviceService qsDeviceService;
-
- /**
- * 添加区域
- *
- * @param region 区域信息
- */
- @Override
- public void add(QsRegion region) {
- Assert.hasLength(region.getName(), "名称必须存在");
- Assert.hasLength(region.getDeviceId(), "国标编号必须存在");
- if (ObjectUtils.isEmpty(region.getParentDeviceId()) || ObjectUtils.isEmpty(region.getParentDeviceId().trim())) {
- region.setParentDeviceId(null);
- }
- region.setCreateTime(DateUtils.getNowDate());
-
- try {
- qsRegionMapper.add(region);
- } catch (DuplicateKeyException e) {
- throw new RuntimeException("此行政区划已存在");
- }
- }
-
- /**
- * 更新区域
- *
- * @param region 区域信息
- */
- @Override
- public void update(QsRegion region) {
- Assert.notNull(region.getDeviceId(), "编号不可为NULL");
- Assert.notNull(region.getName(), "名称不可为NULL");
- QsRegion regionInDb = qsRegionMapper.queryOne(region.getId());
- Assert.notNull(regionInDb, "待更新行政区划在数据库中不存在");
- region.setUpdateTime(DateUtils.getNowDate());
-
- if (!regionInDb.getDeviceId().equals(region.getDeviceId())) {
- QsRegion regionNewInDb = qsRegionMapper.queryByDeviceId(region.getDeviceId());
- Assert.isNull(regionNewInDb, "此行政区划已存在");
- // 编号发生变化,把分配了这个行政区划的设备全部更新,并发送数据
- qsDeviceService.updateCivilCode(regionInDb.getDeviceId(), region.getDeviceId());
- // 子节点信息更新
- qsRegionMapper.updateChild(region.getId(), region.getDeviceId());
- }
- qsRegionMapper.update(region);
- }
-
- /**
- * 删除区域
- *
- * @param id 区域ID
- * @return
- */
- @Override
- public boolean deleteByDeviceId(Integer id) {
- QsRegion region = qsRegionMapper.queryOne(id);
- // 获取所有子节点
- List<QsRegion> allChildren = getAllChildren(id);
- allChildren.add(region);
- // 设置使用这些节点的设备的civilCode为null,
- qsDeviceService.removeCivilCode(allChildren);
- qsRegionMapper.batchDelete(allChildren);
- return true;
- }
-
- /**
- * 查询区域节点
- *
- * @param parent 所属行政区划编号
- * @param hasDevice 是否查询设备
- * @return
- */
- @Override
- public List<QsRegionTree> queryForTree(Integer parent, Boolean hasDevice) {
- List<QsRegionTree> regionList = qsRegionMapper.queryForTree(parent);
- if (parent != null && hasDevice != null && hasDevice) {
- QsRegion parentRegion = qsRegionMapper.queryOne(parent);
- if (parentRegion != null) {
- List<QsRegionTree> channelList = qsDeviceService.queryForRegionTreeByCivilCode(parentRegion.getDeviceId());
- regionList.addAll(channelList);
- }
- }
- return regionList;
- }
-
- /**
- * 查询区域节点设备
- *
- * @return
- */
- @Override
- public List<QsRegionTree> queryForDevice() {
- return qsRegionMapper.queryForDevice();
- }
-
- /**
- * 查询区域
- *
- * @param query 要搜索的内容
- * @return
- */
- @Override
- public List<QsRegion> queryList(Integer pageNum, Integer pageSize, String query) {
- if (query != null) {
- query = query.replaceAll("/", "//")
- .replaceAll("%", "/%")
- .replaceAll("_", "/_");
- }
- return qsRegionMapper.query(query, null);
- }
-
- /**
- * 获取所属的行政区划下的行政区划
- *
- * @param parent 所属的行政区划
- * @return
- */
- @Override
- public List<QsRegion> getAllChild(String parent) {
- List<QsRegion> allChild = CivilCodeUtil.INSTANCE.getAllChild(parent);
- Collections.sort(allChild);
- return allChild;
- }
-
- /**
- * 获取所有子节点
- *
- * @param deviceId
- * @return
- */
- private List<QsRegion> getAllChildren(Integer deviceId) {
- if (deviceId == null) {
- return new ArrayList<>();
- }
- List<QsRegion> children = qsRegionMapper.getChildren(deviceId);
- if (ObjectUtils.isEmpty(children)) {
- return children;
- }
- List<QsRegion> regions = new ArrayList<>(children);
- for (QsRegion region : children) {
- if (region.getDeviceId().length() < 8) {
- regions.addAll(getAllChildren(region.getId()));
- }
- }
- return regions;
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/RedisCatchStorageServiceImpl.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/RedisCatchStorageServiceImpl.java
deleted file mode 100644
index 3009f05..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/service/impl/RedisCatchStorageServiceImpl.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package com.ard.qs.service.impl;
-
-import com.ard.qs.common.SystemAllInfo;
-import com.ard.qs.common.VideoManagerConstants;
-import com.ard.qs.service.IRedisCatchStorageService;
-import com.ard.qs.utils.DateUtil;
-import com.ard.qs.utils.SystemInfoUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.stereotype.Component;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @FileName RedisCatchStorageSericeImpl
- * @Description
- * @Author fengcheng
- * @date 2026-04-15
- **/
-@Slf4j
-@Component
-public class RedisCatchStorageServiceImpl implements IRedisCatchStorageService {
-
- @Autowired
- private RedisTemplate<Object, Object> redisTemplate;
-
- /**
- * 获取系统信息
- *
- * @return
- */
- @Override
- public SystemAllInfo getSystemInfo() {
- String cpuKey = VideoManagerConstants.SYSTEM_INFO_CPU_PREFIX;
- String memKey = VideoManagerConstants.SYSTEM_INFO_MEM_PREFIX;
- String netKey = VideoManagerConstants.SYSTEM_INFO_NET_PREFIX;
- String diskKey = VideoManagerConstants.SYSTEM_INFO_DISK_PREFIX;
- SystemAllInfo systemAllInfo = new SystemAllInfo();
- systemAllInfo.setCpu(redisTemplate.opsForList().range(cpuKey, 0, -1));
- systemAllInfo.setMem(redisTemplate.opsForList().range(memKey, 0, -1));
- systemAllInfo.setNet(redisTemplate.opsForList().range(netKey, 0, -1));
-
- systemAllInfo.setDisk(redisTemplate.opsForValue().get(diskKey));
- systemAllInfo.setNetTotal(SystemInfoUtils.getNetworkTotal());
- return systemAllInfo;
- }
-
- @Override
- public void addCpuInfo(double cpuInfo) {
- String key = VideoManagerConstants.SYSTEM_INFO_CPU_PREFIX;
- Map<String, String> infoMap = new HashMap<>();
- infoMap.put("time", DateUtil.getNow());
- infoMap.put("data", String.valueOf(cpuInfo));
- redisTemplate.opsForList().rightPush(key, infoMap);
- // 每秒一个,最多只存30个
- Long size = redisTemplate.opsForList().size(key);
- if (size != null && size >= 30) {
- for (int i = 0; i < size - 30; i++) {
- redisTemplate.opsForList().leftPop(key);
- }
- }
- }
-
- @Override
- public void addMemInfo(double memInfo) {
- String key = VideoManagerConstants.SYSTEM_INFO_MEM_PREFIX;
- Map<String, String> infoMap = new HashMap<>();
- infoMap.put("time", DateUtil.getNow());
- infoMap.put("data", String.valueOf(memInfo));
- redisTemplate.opsForList().rightPush(key, infoMap);
- // 每秒一个,最多只存30个
- Long size = redisTemplate.opsForList().size(key);
- if (size != null && size >= 30) {
- for (int i = 0; i < size - 30; i++) {
- redisTemplate.opsForList().leftPop(key);
- }
- }
- }
-
- @Override
- public void addNetInfo(Map<String, Double> networkInterfaces) {
- String key = VideoManagerConstants.SYSTEM_INFO_NET_PREFIX;
- Map<String, Object> infoMap = new HashMap<>();
- infoMap.put("time", DateUtil.getNow());
- for (String netKey : networkInterfaces.keySet()) {
- infoMap.put(netKey, networkInterfaces.get(netKey));
- }
- redisTemplate.opsForList().rightPush(key, infoMap);
- // 每秒一个,最多只存30个
- Long size = redisTemplate.opsForList().size(key);
- if (size != null && size >= 30) {
- for (int i = 0; i < size - 30; i++) {
- redisTemplate.opsForList().leftPop(key);
- }
- }
- }
-
- @Override
- public void addDiskInfo(List<Map<String, Object>> diskInfo) {
- String key = VideoManagerConstants.SYSTEM_INFO_DISK_PREFIX;
- redisTemplate.opsForValue().set(key, diskInfo);
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/task/SystemInfoTimerTask.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/task/SystemInfoTimerTask.java
deleted file mode 100644
index 20d0c05..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/task/SystemInfoTimerTask.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.ard.qs.task;
-
-import com.ard.qs.service.IRedisCatchStorageService;
-import com.ard.qs.utils.SystemInfoUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 获取系统信息写入redis
- */
-@Slf4j
-@Component
-public class SystemInfoTimerTask {
-
- @Autowired
- private IRedisCatchStorageService redisCatchStorageService;
-
- @Scheduled(fixedRate = 2000) //每2秒执行一次
- public void execute() {
- try {
- double cpuInfo = SystemInfoUtils.getCpuInfo();
- redisCatchStorageService.addCpuInfo(cpuInfo);
- double memInfo = SystemInfoUtils.getMemInfo();
- redisCatchStorageService.addMemInfo(memInfo);
- Map<String, Double> networkInterfaces = SystemInfoUtils.getNetworkInterfaces();
- redisCatchStorageService.addNetInfo(networkInterfaces);
- List<Map<String, Object>> diskInfo = SystemInfoUtils.getDiskInfo();
- redisCatchStorageService.addDiskInfo(diskInfo);
- } catch (InterruptedException e) {
- log.error("[获取系统信息失败] {}", e.getMessage());
- Thread.currentThread().interrupt();
- } catch (Exception e) {
- log.error("[获取系统信息异常] {}", e.getMessage(), e);
- }
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/DateUtil.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/DateUtil.java
deleted file mode 100644
index 5c05f61..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/DateUtil.java
+++ /dev/null
@@ -1,229 +0,0 @@
-package com.ard.qs.utils;
-
-
-import jakarta.validation.constraints.NotNull;
-import org.apache.commons.lang3.ObjectUtils;
-
-import java.time.Instant;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.time.format.DateTimeFormatter;
-import java.time.format.DateTimeParseException;
-import java.time.temporal.ChronoUnit;
-import java.time.temporal.TemporalAccessor;
-import java.util.Locale;
-
-/**
- * 全局时间工具类
- * @author lin
- */
-public class DateUtil {
-
- /**
- * 兼容不规范的iso8601时间格式
- */
- private static final String ISO8601_COMPATIBLE_PATTERN = "yyyy-M-d'T'H:m:s";
-
- /**
- * 用以输出标准的iso8601时间格式
- */
- private static final String ISO8601_PATTERN = "yyyy-MM-dd'T'HH:mm:ss";
-
- /**
- * iso8601时间格式带时区,例如:2024-02-21T11:10:36+08:00
- */
- private static final String ISO8601_ZONE_PATTERN = "yyyy-MM-dd'T'HH:mm:ssXXX";
-
- /**
- * 兼容的时间格式 iso8601时间格式带毫秒
- */
- private static final String ISO8601_MILLISECOND_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS";
-
- /**
- * wvp内部统一时间格式
- */
- public static final String PATTERN = "yyyy-MM-dd HH:mm:ss";
-
- /**
- * wvp内部统一时间格式
- */
- public static final String URL_PATTERN = "yyyyMMddHHmmss";
- public static final String PATTERN1078 = "yyMMddHHmmss";
- public static final String PATTERN1078Date = "yyyyMMdd";
-
- /**
- * 日期格式
- */
- public static final String date_PATTERN = "yyyy-MM-dd";
-
- public static final String zoneStr = "Asia/Shanghai";
-
- public static final DateTimeFormatter formatterCompatibleISO8601 = DateTimeFormatter.ofPattern(ISO8601_COMPATIBLE_PATTERN, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
- public static final DateTimeFormatter formatterISO8601 = DateTimeFormatter.ofPattern(ISO8601_PATTERN, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
- public static final DateTimeFormatter formatterZoneISO8601 = DateTimeFormatter.ofPattern(ISO8601_ZONE_PATTERN, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
- public static final DateTimeFormatter formatterMillisecondISO8601 = DateTimeFormatter.ofPattern(ISO8601_MILLISECOND_PATTERN, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
-
- public static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(PATTERN, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
- public static final DateTimeFormatter DateFormatter = DateTimeFormatter.ofPattern(date_PATTERN, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
- public static final DateTimeFormatter urlFormatter = DateTimeFormatter.ofPattern(URL_PATTERN, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
- public static final DateTimeFormatter formatter1078 = DateTimeFormatter.ofPattern(PATTERN1078, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
- public static final DateTimeFormatter formatter1078date = DateTimeFormatter.ofPattern(PATTERN1078Date, Locale.getDefault()).withZone(ZoneId.of(zoneStr));
-
- public static String yyyy_MM_dd_HH_mm_ssToISO8601(@NotNull String formatTime) {
- return formatterISO8601.format(formatter.parse(formatTime));
- }
-
- public static String yyyy_MM_dd_HH_mm_ssToUrl(@NotNull String formatTime) {
- return urlFormatter.format(formatter.parse(formatTime));
- }
-
- public static String ISO8601Toyyyy_MM_dd_HH_mm_ss(String formatTime) {
- // 三种日期格式都尝试,为了兼容不同厂家的日期格式
- if (verification(formatTime, formatterCompatibleISO8601)) {
- return formatter.format(formatterCompatibleISO8601.parse(formatTime));
- } else if (verification(formatTime, formatterZoneISO8601)) {
- return formatter.format(formatterZoneISO8601.parse(formatTime));
- } else if (verification(formatTime, formatterMillisecondISO8601)) {
- return formatter.format(formatterMillisecondISO8601.parse(formatTime));
- }
- return formatter.format(formatterISO8601.parse(formatTime));
- }
-
- public static String urlToyyyy_MM_dd_HH_mm_ss(String formatTime) {
- return formatter.format(urlFormatter.parse(formatTime));
- }
- public static String yyyy_MM_dd_HH_mm_ssTo1078(String formatTime) {
- return formatter1078.format(formatter.parse(formatTime));
- }
- public static String jt1078Toyyyy_MM_dd_HH_mm_ss(String formatTime) {
- return formatter.format(formatter1078.parse(formatTime));
- }
- public static String jt1078dateToyyyy_MM_dd(String formatTime) {
- return DateFormatter.format(formatter1078date.parse(formatTime));
- }
-
- /**
- * yyyy_MM_dd_HH_mm_ss 转时间戳
- * @param formatTime
- * @return
- */
- public static long yyyy_MM_dd_HH_mm_ssToTimestamp(String formatTime) {
- TemporalAccessor temporalAccessor = formatter.parse(formatTime);
- Instant instant = Instant.from(temporalAccessor);
- return instant.getEpochSecond();
- }
-
- /**
- * 时间戳 转 yyyy_MM_dd_HH_mm_ss
- */
- public static String timestampTo_yyyy_MM_dd_HH_mm_ss(long timestamp) {
- Instant instant = Instant.ofEpochSecond(timestamp);
- return formatter.format(LocalDateTime.ofInstant(instant, ZoneId.of(zoneStr)));
- }
-
- /**
- * 时间戳 转 yyyy_MM_dd_HH_mm_ss
- */
- public static String timestampMsToUrlToyyyy_MM_dd_HH_mm_ss(long timestamp) {
- Instant instant = Instant.ofEpochMilli(timestamp);
- return urlFormatter.format(LocalDateTime.ofInstant(instant, ZoneId.of(zoneStr)));
- }
-
- /**
- * yyyy_MM_dd_HH_mm_ss 转时间戳(毫秒)
- *
- * @param formatTime
- * @return
- */
- public static long yyyy_MM_dd_HH_mm_ssToTimestampMs(String formatTime) {
- TemporalAccessor temporalAccessor = formatter.parse(formatTime);
- Instant instant = Instant.from(temporalAccessor);
- return instant.toEpochMilli();
- }
-
- /**
- * 时间戳(毫秒) 转 yyyy_MM_dd_HH_mm_ss
- */
- public static String timestampMsTo_yyyy_MM_dd_HH_mm_ss(long timestamp) {
- Instant instant = Instant.ofEpochMilli(timestamp);
- return formatter.format(LocalDateTime.ofInstant(instant, ZoneId.of(zoneStr)));
- }
-
- /**
- * yyyy_MM_dd_HH_mm_ss 转时间戳(毫秒)
- *
- * @param formatTime
- * @return
- */
- public static long urlToTimestampMs(String formatTime) {
- TemporalAccessor temporalAccessor = urlFormatter.parse(formatTime);
- Instant instant = Instant.from(temporalAccessor);
- return instant.toEpochMilli();
- }
-
- /**
- * 时间戳 转 yyyy_MM_dd
- */
- public static String timestampTo_yyyy_MM_dd(long timestamp) {
- Instant instant = Instant.ofEpochMilli(timestamp);
- return DateFormatter.format(LocalDateTime.ofInstant(instant, ZoneId.of(zoneStr)));
- }
-
- /**
- * 获取当前时间
- * @return
- */
- public static String getNow() {
- LocalDateTime nowDateTime = LocalDateTime.now();
- return formatter.format(nowDateTime);
- }
-
- /**
- * 获取当前时间
- * @return
- */
- public static String getNowForUrl() {
- LocalDateTime nowDateTime = LocalDateTime.now();
- return urlFormatter.format(nowDateTime);
- }
-
-
- /**
- * 格式校验
- * @param timeStr 时间字符串
- * @param dateTimeFormatter 待校验的格式
- * @return
- */
- public static boolean verification(String timeStr, DateTimeFormatter dateTimeFormatter) {
- try {
- LocalDate.parse(timeStr, dateTimeFormatter);
- return true;
- }catch (DateTimeParseException exception) {
- return false;
- }
- }
-
- public static String getNowForISO8601() {
- LocalDateTime nowDateTime = LocalDateTime.now();
- return formatterISO8601.format(nowDateTime);
- }
-
- public static long getDifferenceForNow(String keepaliveTime) {
- if (ObjectUtils.isEmpty(keepaliveTime)) {
- return 0;
- }
- Instant beforeInstant = Instant.from(formatter.parse(keepaliveTime));
- return ChronoUnit.MILLIS.between(beforeInstant, Instant.now());
- }
-
- public static long getDifference(String startTime, String endTime) {
- if (ObjectUtils.isEmpty(startTime) || ObjectUtils.isEmpty(endTime)) {
- return 0;
- }
- Instant startInstant = Instant.from(formatter.parse(startTime));
- Instant endInstant = Instant.from(formatter.parse(endTime));
- return ChronoUnit.MILLIS.between(startInstant, endInstant);
- }
-
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/StreamDetector.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/StreamDetector.java
deleted file mode 100644
index b7b0763..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/StreamDetector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package com.ard.qs.utils;
-
-import com.ard.qs.api.domain.QsDevice;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.bytedeco.javacv.FFmpegFrameGrabber;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.TimeUnit;
-
-@Slf4j
-@Component
-public class StreamDetector {
-
- /**
- * 批量检测流状态
- */
- public List<StreamResult> batchDetect(List<QsDevice> qsDeviceList, ThreadPoolTaskExecutor taskExecutor) {
- List<StreamResult> results = new ArrayList<>();
- List<CompletableFuture<StreamResult>> futures = new ArrayList<>();
-
- for (QsDevice device : qsDeviceList) {
- // 使用自定义线程池异步执行
- CompletableFuture<StreamResult> future = CompletableFuture.supplyAsync(() ->
- detectSingle(device.getId(), device.getLiveAddress()), taskExecutor).orTimeout(15, TimeUnit.SECONDS); // 兜底超时
-
- futures.add(future);
- }
-
- // 等待所有任务完成
- for (CompletableFuture<StreamResult> future : futures) {
- try {
- results.add(future.join());
- } catch (Exception e) {
- log.error("[流检测失败] 批量检测时发生异常: {}", e.getMessage());
- }
- }
- return results;
- }
-
- /**
- * 单个流检测逻辑
- */
- public StreamResult detectSingle(Long id, String url) {
- if (url == null || url.isEmpty()) {
- return new StreamResult(id, "OFFLINE");
- }
-
- FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(url);
-
- try {
- // --- 核心配置 ---
- grabber.setOption("stimeout", "3000000"); // 3秒超时
- grabber.setOption("reconnect", "0"); // 禁用重连
- grabber.setOption("protocol_whitelist", "file,http,https,tcp,tls,ws,wss,crypto,udp,rtp,rtcp,rtmp,rtmpt,subfile,pipe,data");
- grabber.setOption("user_agent", "Mozilla/5.0 (compatible; StreamChecker)");
-
- grabber.start();
-
- if (grabber.getFormat() != null) {
- return new StreamResult(id, "ON");
- }
-
- return new StreamResult(id, "OFFLINE");
-
- } catch (Exception e) {
- log.debug("[流检测] 设备ID: {}, URL: {}, 检测结果: OFFLINE, 原因: {}", id, url, e.getMessage());
- return new StreamResult(id, "OFFLINE");
- } finally {
- try {
- if (grabber != null) {
- grabber.stop();
- grabber.release();
- }
- } catch (Exception e) {
- log.debug("[流检测] 释放资源失败: {}", e.getMessage());
- }
- }
- }
-
- // 结果封装类
- @Data
- public static class StreamResult {
- public Long id;
- public String status;
-
- public StreamResult(Long id, String status) {
- this.id = id;
- this.status = status;
- }
- }
-}
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/SystemInfoUtils.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/SystemInfoUtils.java
deleted file mode 100644
index b2c83f8..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/SystemInfoUtils.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package com.ard.qs.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.util.DigestUtils;
-import oshi.SystemInfo;
-import oshi.hardware.CentralProcessor;
-import oshi.hardware.GlobalMemory;
-import oshi.hardware.HardwareAbstractionLayer;
-import oshi.hardware.NetworkIF;
-import oshi.software.os.OperatingSystem;
-
-import java.io.File;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 实现参考自xiaozhangnomoney原创文章,
- * 版权声明:本文为xiaozhangnomoney原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明
- * 原文出处链接:https://blog.csdn.net/xiaozhangnomoney/article/details/107769147
- */
-@Slf4j
-public class SystemInfoUtils {
-
- /**
- * 获取cpu信息
- *
- * @return
- * @throws InterruptedException
- */
- public static double getCpuInfo() throws InterruptedException {
- SystemInfo systemInfo = new SystemInfo();
- CentralProcessor processor = systemInfo.getHardware().getProcessor();
- long[] prevTicks = processor.getSystemCpuLoadTicks();
- // 睡眠1s
- TimeUnit.SECONDS.sleep(1);
- long[] ticks = processor.getSystemCpuLoadTicks();
- long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()];
- long irq = ticks[CentralProcessor.TickType.IRQ.getIndex()] - prevTicks[CentralProcessor.TickType.IRQ.getIndex()];
- long softirq = ticks[CentralProcessor.TickType.SOFTIRQ.getIndex()] - prevTicks[CentralProcessor.TickType.SOFTIRQ.getIndex()];
- long steal = ticks[CentralProcessor.TickType.STEAL.getIndex()] - prevTicks[CentralProcessor.TickType.STEAL.getIndex()];
- long cSys = ticks[CentralProcessor.TickType.SYSTEM.getIndex()] - prevTicks[CentralProcessor.TickType.SYSTEM.getIndex()];
- long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()];
- long iowait = ticks[CentralProcessor.TickType.IOWAIT.getIndex()] - prevTicks[CentralProcessor.TickType.IOWAIT.getIndex()];
- long idle = ticks[CentralProcessor.TickType.IDLE.getIndex()] - prevTicks[CentralProcessor.TickType.IDLE.getIndex()];
- long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal;
- return 1.0 - (idle * 1.0 / totalCpu);
- }
-
- /**
- * 获取内存使用率
- *
- * @return
- */
- public static double getMemInfo() {
- SystemInfo systemInfo = new SystemInfo();
- GlobalMemory memory = systemInfo.getHardware().getMemory();
- //总内存
- long totalByte = memory.getTotal();
- //剩余
- long acaliableByte = memory.getAvailable();
- return (totalByte - acaliableByte) * 1.0 / totalByte;
- }
-
- /**
- * 获取网络上传和下载
- *
- * @return
- */
- public static Map<String, Double> getNetworkInterfaces() {
- SystemInfo si = new SystemInfo();
- HardwareAbstractionLayer hal = si.getHardware();
- List<NetworkIF> beforeRecvNetworkIFs = hal.getNetworkIFs();
- HashMap<String, Double> map = new HashMap<>();
-
- // 默认值
- map.put("in", 0.0);
- map.put("out", 0.0);
-
- if (beforeRecvNetworkIFs == null || beforeRecvNetworkIFs.isEmpty()) {
- log.warn("[系统信息] 未找到网络接口");
- return map;
- }
-
- NetworkIF beforeBet = beforeRecvNetworkIFs.get(beforeRecvNetworkIFs.size() - 1);
- long beforeRecv = beforeBet.getBytesRecv();
- long beforeSend = beforeBet.getBytesSent();
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- log.error("[线程休眠失败] : {}", e.getMessage());
- Thread.currentThread().interrupt();
- }
- List<NetworkIF> afterNetworkIFs = hal.getNetworkIFs();
-
- if (afterNetworkIFs == null || afterNetworkIFs.isEmpty()) {
- log.warn("[系统信息] 未找到网络接口(第二次)");
- return map;
- }
-
- NetworkIF afterNet = afterNetworkIFs.get(afterNetworkIFs.size() - 1);
-
- // 速度单位: Mbps
- map.put("in", formatUnits(afterNet.getBytesRecv() - beforeRecv, 1048576L));
- map.put("out", formatUnits(afterNet.getBytesSent() - beforeSend, 1048576L));
- return map;
- }
-
- /**
- * 获取带宽总值
- *
- * @return
- */
- public static long getNetworkTotal() {
- SystemInfo si = new SystemInfo();
- HardwareAbstractionLayer hal = si.getHardware();
- List<NetworkIF> recvNetworkIFs = hal.getNetworkIFs();
-
- if (recvNetworkIFs == null || recvNetworkIFs.isEmpty()) {
- log.warn("[系统信息] 未找到网络接口");
- return 0L;
- }
-
- NetworkIF networkIF = recvNetworkIFs.get(recvNetworkIFs.size() - 1);
-
- return networkIF.getSpeed() / 1048576L / 8L;
- }
-
- public static double formatUnits(long value, long prefix) {
- return (double) value / (double) prefix;
- }
-
- /**
- * 获取进程数
- *
- * @return
- */
- public static int getProcessesCount() {
- SystemInfo si = new SystemInfo();
- OperatingSystem os = si.getOperatingSystem();
-
- int processCount = os.getProcessCount();
- return processCount;
- }
-
- public static List<Map<String, Object>> getDiskInfo() {
- List<Map<String, Object>> result = new ArrayList<>();
-
- String osName = System.getProperty("os.name");
- List<String> pathArray = new ArrayList<>();
- if (osName.startsWith("Mac OS")) {
- // 苹果
- pathArray.add("/");
- } else if (osName.startsWith("Windows")) {
- // windows
- pathArray.add("C:");
- } else {
- pathArray.add("/");
- pathArray.add("/home");
- }
- for (String path : pathArray) {
- Map<String, Object> infoMap = new HashMap<>();
- infoMap.put("path", path);
- File partitionFile = new File(path);
- // 单位: GB
- infoMap.put("use", (partitionFile.getTotalSpace() - partitionFile.getFreeSpace()) / 1024 / 1024 / 1024D);
- infoMap.put("free", partitionFile.getFreeSpace() / 1024 / 1024 / 1024D);
- result.add(infoMap);
- }
- return result;
- }
-
- public static String getHardwareId() {
- SystemInfo systemInfo = new SystemInfo();
- HardwareAbstractionLayer hardware = systemInfo.getHardware();
- // CPU ID
- String cpuId = hardware.getProcessor().getProcessorIdentifier().getProcessorID();
- // 主板序号
- String serialNumber = hardware.getComputerSystem().getSerialNumber();
-
- return DigestUtils.md5DigestAsHex((DigestUtils.md5DigestAsHex(cpuId.getBytes(StandardCharsets.UTF_8)) + DigestUtils.md5DigestAsHex(serialNumber.getBytes(StandardCharsets.UTF_8))).getBytes(StandardCharsets.UTF_8));
- }
-}
diff --git a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/VideoSnapshotUtil.java b/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/VideoSnapshotUtil.java
deleted file mode 100644
index 66b3884..0000000
--- a/ard-modules/ard-modules-qs/src/main/java/com/ard/qs/utils/VideoSnapshotUtil.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package com.ard.qs.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.bytedeco.javacv.FFmpegFrameGrabber;
-import org.bytedeco.javacv.Frame;
-import org.bytedeco.javacv.Java2DFrameConverter;
-import org.springframework.stereotype.Component;
-
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.io.File;
-
-@Slf4j
-@Component
-public class VideoSnapshotUtil {
-
- /**
- * 截取视频指定秒数的图片
- *
- * @param videoPath 视频文件路径 (本地路径或 URL)
- * @param outputPath 图片保存路径
- * @param frameSecond 截取第几秒的画面 (例如 1.0 表示第 1 秒)
- * @return 截图文件
- */
- public File takeSnapshot(String videoPath, String outputPath, double frameSecond) throws Exception {
- FFmpegFrameGrabber grabber = null;
-
- try {
- grabber = FFmpegFrameGrabber.createDefault(videoPath);
- grabber.start();
-
- // 1. 获取视频元数据
- int frameCount = grabber.getLengthInFrames();
- double duration = grabber.getTimestamp() / 1000000; // 获取视频时长(秒) - 注意单位转换
- // 注意:FFmpegFrameGrabber 的 seek 操作是基于关键帧的,可能不是绝对精确,
- // 如果需要绝对精确,需要循环 grabFrame 直到目标时间。
-
- // 2. 定位到指定时间 (微秒)
- // 简单做法:直接 seek,但可能跳到最近的关键帧
- grabber.setTimestamp((long) (frameSecond * 1000000));
-
- // 3. 抓取帧
- Frame frame = grabber.grabImage();
-
- if (frame == null) {
- throw new RuntimeException("无法抓取该时间点的帧,可能视频过短或格式不支持");
- }
-
- // 4. 转换并保存
- Java2DFrameConverter converter = new Java2DFrameConverter();
- BufferedImage image = converter.getBufferedImage(frame);
-
- // 处理旋转 (手机视频常见)
- String rotate = grabber.getVideoMetadata("rotate");
- if (rotate != null && !rotate.isEmpty()) {
- image = rotateImage(image, Integer.parseInt(rotate));
- }
-
- File outputFile = new File(outputPath);
- // 确保父目录存在
- if (!outputFile.getParentFile().exists()) {
- outputFile.getParentFile().mkdirs();
- }
-
- ImageIO.write(image, "jpg", outputFile);
- return outputFile;
-
- } finally {
- if (grabber != null) {
- try {
- grabber.stop();
- } catch (Exception e) {
- log.warn("[视频截图] 停止 grabber 失败: {}", e.getMessage());
- }
- try {
- grabber.release();
- } catch (Exception e) {
- log.warn("[视频截图] 释放 grabber 资源失败: {}", e.getMessage());
- }
- }
- }
- }
-
- // 简单的图片旋转辅助方法
- private BufferedImage rotateImage(BufferedImage src, int degrees) {
- // 这里需要实现具体的旋转逻辑,可以使用 java.awt.geom.AffineTransform
- // 为了代码简洁,此处省略具体旋转实现,实际项目中建议使用 Thumbnailator 或 imgscalr 库
- return src;
- }
-}
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/resources/banner.txt b/ard-modules/ard-modules-qs/src/main/resources/banner.txt
deleted file mode 100644
index baa54a6..0000000
--- a/ard-modules/ard-modules-qs/src/main/resources/banner.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Spring Boot Version: ${spring-boot.version}
-Spring Application Name: ${spring.application.name}
- .__
-_______ __ __ ____ ___.__.|__| ______ ______
-\_ __ \ | \/ _ < | || | ______ / ____// ___/
- | | \/ | ( <_> )___ || | /_____/ < <_| |\___ \
- |__| |____/ \____// ____||__| \__ /____ >
- \/ |__| \/
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/resources/bootstrap.yml b/ard-modules/ard-modules-qs/src/main/resources/bootstrap.yml
deleted file mode 100644
index 907069c..0000000
--- a/ard-modules/ard-modules-qs/src/main/resources/bootstrap.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-# Tomcat
-server:
- port: 8091
-
-# Spring
-spring:
- application:
- # 应用名称
- name: ard-qs
- profiles:
- # 环境配置
- active: @spring.profile@
- cloud:
- nacos:
- username: nacos
- password: Ardkj.2025
- discovery:
- # 服务注册地址
- server-addr: @nacos.server.address@
- config:
- # 配置中心地址
- server-addr: @nacos.server.address@
- config:
- # 配置文件格式
- file-extension: yml
- import:
- - nacos:application-${spring.profiles.active}.${spring.config.file-extension}
- - nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}
diff --git a/ard-modules/ard-modules-qs/src/main/resources/civilCode.csv b/ard-modules/ard-modules-qs/src/main/resources/civilCode.csv
deleted file mode 100644
index 6c2284a..0000000
--- a/ard-modules/ard-modules-qs/src/main/resources/civilCode.csv
+++ /dev/null
@@ -1,3224 +0,0 @@
-编号,名称,上级
-11,北京市,
-1101,市辖区,11
-110101,东城区,1101
-110102,西城区,1101
-110105,朝阳区,1101
-110106,丰台区,1101
-110107,石景山区,1101
-110108,海淀区,1101
-110109,门头沟区,1101
-110111,房山区,1101
-110112,通州区,1101
-110113,顺义区,1101
-110114,昌平区,1101
-110115,大兴区,1101
-110116,怀柔区,1101
-110117,平谷区,1101
-110118,密云区,1101
-110119,延庆区,1101
-12,天津市,
-1201,市辖区,12
-120101,和平区,1201
-120102,河东区,1201
-120103,河西区,1201
-120104,南开区,1201
-120105,河北区,1201
-120106,红桥区,1201
-120110,东丽区,1201
-120111,西青区,1201
-120112,津南区,1201
-120113,北辰区,1201
-120114,武清区,1201
-120115,宝坻区,1201
-120116,滨海新区,1201
-120117,宁河区,1201
-120118,静海区,1201
-120119,蓟州区,1201
-13,河北省,
-1301,石家庄市,13
-130102,长安区,1301
-130104,桥西区,1301
-130105,新华区,1301
-130107,井陉矿区,1301
-130108,裕华区,1301
-130109,藁城区,1301
-130110,鹿泉区,1301
-130111,栾城区,1301
-130121,井陉县,1301
-130123,正定县,1301
-130125,行唐县,1301
-130126,灵寿县,1301
-130127,高邑县,1301
-130128,深泽县,1301
-130129,赞皇县,1301
-130130,无极县,1301
-130131,平山县,1301
-130132,元氏县,1301
-130133,赵县,1301
-130181,辛集市,1301
-130183,晋州市,1301
-130184,新乐市,1301
-1302,唐山市,13
-130202,路南区,1302
-130203,路北区,1302
-130204,古冶区,1302
-130205,开平区,1302
-130207,丰南区,1302
-130208,丰润区,1302
-130209,曹妃甸区,1302
-130224,滦南县,1302
-130225,乐亭县,1302
-130227,迁西县,1302
-130229,玉田县,1302
-130281,遵化市,1302
-130283,迁安市,1302
-130284,滦州市,1302
-1303,秦皇岛市,13
-130302,海港区,1303
-130303,山海关区,1303
-130304,北戴河区,1303
-130306,抚宁区,1303
-130321,青龙满族自治县,1303
-130322,昌黎县,1303
-130324,卢龙县,1303
-1304,邯郸市,13
-130402,邯山区,1304
-130403,丛台区,1304
-130404,复兴区,1304
-130406,峰峰矿区,1304
-130407,肥乡区,1304
-130408,永年区,1304
-130423,临漳县,1304
-130424,成安县,1304
-130425,大名县,1304
-130426,涉县,1304
-130427,磁县,1304
-130430,邱县,1304
-130431,鸡泽县,1304
-130432,广平县,1304
-130433,馆陶县,1304
-130434,魏县,1304
-130435,曲周县,1304
-130481,武安市,1304
-1305,邢台市,13
-130502,桥东区,1305
-130503,桥西区,1305
-130521,邢台县,1305
-130522,临城县,1305
-130523,内丘县,1305
-130524,柏乡县,1305
-130525,隆尧县,1305
-130526,任县,1305
-130527,南和县,1305
-130528,宁晋县,1305
-130529,巨鹿县,1305
-130530,新河县,1305
-130531,广宗县,1305
-130532,平乡县,1305
-130533,威县,1305
-130534,清河县,1305
-130535,临西县,1305
-130581,南宫市,1305
-130582,沙河市,1305
-1306,保定市,13
-130602,竞秀区,1306
-130606,莲池区,1306
-130607,满城区,1306
-130608,清苑区,1306
-130609,徐水区,1306
-130623,涞水县,1306
-130624,阜平县,1306
-130626,定兴县,1306
-130627,唐县,1306
-130628,高阳县,1306
-130629,容城县,1306
-130630,涞源县,1306
-130631,望都县,1306
-130632,安新县,1306
-130633,易县,1306
-130634,曲阳县,1306
-130635,蠡县,1306
-130636,顺平县,1306
-130637,博野县,1306
-130638,雄县,1306
-130681,涿州市,1306
-130682,定州市,1306
-130683,安国市,1306
-130684,高碑店市,1306
-1307,张家口市,13
-130702,桥东区,1307
-130703,桥西区,1307
-130705,宣化区,1307
-130706,下花园区,1307
-130708,万全区,1307
-130709,崇礼区,1307
-130722,张北县,1307
-130723,康保县,1307
-130724,沽源县,1307
-130725,尚义县,1307
-130726,蔚县,1307
-130727,阳原县,1307
-130728,怀安县,1307
-130730,怀来县,1307
-130731,涿鹿县,1307
-130732,赤城县,1307
-1308,承德市,13
-130802,双桥区,1308
-130803,双滦区,1308
-130804,鹰手营子矿区,1308
-130821,承德县,1308
-130822,兴隆县,1308
-130824,滦平县,1308
-130825,隆化县,1308
-130826,丰宁满族自治县,1308
-130827,宽城满族自治县,1308
-130828,围场满族蒙古族自治县,1308
-130881,平泉市,1308
-1309,沧州市,13
-130902,新华区,1309
-130903,运河区,1309
-130921,沧县,1309
-130922,青县,1309
-130923,东光县,1309
-130924,海兴县,1309
-130925,盐山县,1309
-130926,肃宁县,1309
-130927,南皮县,1309
-130928,吴桥县,1309
-130929,献县,1309
-130930,孟村回族自治县,1309
-130981,泊头市,1309
-130982,任丘市,1309
-130983,黄骅市,1309
-130984,河间市,1309
-1310,廊坊市,13
-131002,安次区,1310
-131003,广阳区,1310
-131022,固安县,1310
-131023,永清县,1310
-131024,香河县,1310
-131025,大城县,1310
-131026,文安县,1310
-131028,大厂回族自治县,1310
-131081,霸州市,1310
-131082,三河市,1310
-1311,衡水市,13
-131102,桃城区,1311
-131103,冀州区,1311
-131121,枣强县,1311
-131122,武邑县,1311
-131123,武强县,1311
-131124,饶阳县,1311
-131125,安平县,1311
-131126,故城县,1311
-131127,景县,1311
-131128,阜城县,1311
-131182,深州市,1311
-14,山西省,
-1401,太原市,14
-140105,小店区,1401
-140106,迎泽区,1401
-140107,杏花岭区,1401
-140108,尖草坪区,1401
-140109,万柏林区,1401
-140110,晋源区,1401
-140121,清徐县,1401
-140122,阳曲县,1401
-140123,娄烦县,1401
-140181,古交市,1401
-1402,大同市,14
-140212,新荣区,1402
-140213,平城区,1402
-140214,云冈区,1402
-140215,云州区,1402
-140221,阳高县,1402
-140222,天镇县,1402
-140223,广灵县,1402
-140224,灵丘县,1402
-140225,浑源县,1402
-140226,左云县,1402
-1403,阳泉市,14
-140302,城区,1403
-140303,矿区,1403
-140311,郊区,1403
-140321,平定县,1403
-140322,盂县,1403
-1404,长治市,14
-140403,潞州区,1404
-140404,上党区,1404
-140405,屯留区,1404
-140406,潞城区,1404
-140423,襄垣县,1404
-140425,平顺县,1404
-140426,黎城县,1404
-140427,壶关县,1404
-140428,长子县,1404
-140429,武乡县,1404
-140430,沁县,1404
-140431,沁源县,1404
-1405,晋城市,14
-140502,城区,1405
-140521,沁水县,1405
-140522,阳城县,1405
-140524,陵川县,1405
-140525,泽州县,1405
-140581,高平市,1405
-1406,朔州市,14
-140602,朔城区,1406
-140603,平鲁区,1406
-140621,山阴县,1406
-140622,应县,1406
-140623,右玉县,1406
-140681,怀仁市,1406
-1407,晋中市,14
-140702,榆次区,1407
-140721,榆社县,1407
-140722,左权县,1407
-140723,和顺县,1407
-140724,昔阳县,1407
-140725,寿阳县,1407
-140726,太谷县,1407
-140727,祁县,1407
-140728,平遥县,1407
-140729,灵石县,1407
-140781,介休市,1407
-1408,运城市,14
-140802,盐湖区,1408
-140821,临猗县,1408
-140822,万荣县,1408
-140823,闻喜县,1408
-140824,稷山县,1408
-140825,新绛县,1408
-140826,绛县,1408
-140827,垣曲县,1408
-140828,夏县,1408
-140829,平陆县,1408
-140830,芮城县,1408
-140881,永济市,1408
-140882,河津市,1408
-1409,忻州市,14
-140902,忻府区,1409
-140921,定襄县,1409
-140922,五台县,1409
-140923,代县,1409
-140924,繁峙县,1409
-140925,宁武县,1409
-140926,静乐县,1409
-140927,神池县,1409
-140928,五寨县,1409
-140929,岢岚县,1409
-140930,河曲县,1409
-140931,保德县,1409
-140932,偏关县,1409
-140981,原平市,1409
-1410,临汾市,14
-141002,尧都区,1410
-141021,曲沃县,1410
-141022,翼城县,1410
-141023,襄汾县,1410
-141024,洪洞县,1410
-141025,古县,1410
-141026,安泽县,1410
-141027,浮山县,1410
-141028,吉县,1410
-141029,乡宁县,1410
-141030,大宁县,1410
-141031,隰县,1410
-141032,永和县,1410
-141033,蒲县,1410
-141034,汾西县,1410
-141081,侯马市,1410
-141082,霍州市,1410
-1411,吕梁市,14
-141102,离石区,1411
-141121,文水县,1411
-141122,交城县,1411
-141123,兴县,1411
-141124,临县,1411
-141125,柳林县,1411
-141126,石楼县,1411
-141127,岚县,1411
-141128,方山县,1411
-141129,中阳县,1411
-141130,交口县,1411
-141181,孝义市,1411
-141182,汾阳市,1411
-15,内蒙古自治区,
-1501,呼和浩特市,15
-150102,新城区,1501
-150103,回民区,1501
-150104,玉泉区,1501
-150105,赛罕区,1501
-150121,土默特左旗,1501
-150122,托克托县,1501
-150123,和林格尔县,1501
-150124,清水河县,1501
-150125,武川县,1501
-1502,包头市,15
-150202,东河区,1502
-150203,昆都仑区,1502
-150204,青山区,1502
-150205,石拐区,1502
-150206,白云鄂博矿区,1502
-150207,九原区,1502
-150221,土默特右旗,1502
-150222,固阳县,1502
-150223,达尔罕茂明安联合旗,1502
-1503,乌海市,15
-150302,海勃湾区,1503
-150303,海南区,1503
-150304,乌达区,1503
-1504,赤峰市,15
-150402,红山区,1504
-150403,元宝山区,1504
-150404,松山区,1504
-150421,阿鲁科尔沁旗,1504
-150422,巴林左旗,1504
-150423,巴林右旗,1504
-150424,林西县,1504
-150425,克什克腾旗,1504
-150426,翁牛特旗,1504
-150428,喀喇沁旗,1504
-150429,宁城县,1504
-150430,敖汉旗,1504
-1505,通辽市,15
-150502,科尔沁区,1505
-150521,科尔沁左翼中旗,1505
-150522,科尔沁左翼后旗,1505
-150523,开鲁县,1505
-150524,库伦旗,1505
-150525,奈曼旗,1505
-150526,扎鲁特旗,1505
-150581,霍林郭勒市,1505
-1506,鄂尔多斯市,15
-150602,东胜区,1506
-150603,康巴什区,1506
-150621,达拉特旗,1506
-150622,准格尔旗,1506
-150623,鄂托克前旗,1506
-150624,鄂托克旗,1506
-150625,杭锦旗,1506
-150626,乌审旗,1506
-150627,伊金霍洛旗,1506
-1507,呼伦贝尔市,15
-150702,海拉尔区,1507
-150703,扎赉诺尔区,1507
-150721,阿荣旗,1507
-150722,莫力达瓦达斡尔族自治旗,1507
-150723,鄂伦春自治旗,1507
-150724,鄂温克族自治旗,1507
-150725,陈巴尔虎旗,1507
-150726,新巴尔虎左旗,1507
-150727,新巴尔虎右旗,1507
-150781,满洲里市,1507
-150782,牙克石市,1507
-150783,扎兰屯市,1507
-150784,额尔古纳市,1507
-150785,根河市,1507
-1508,巴彦淖尔市,15
-150802,临河区,1508
-150821,五原县,1508
-150822,磴口县,1508
-150823,乌拉特前旗,1508
-150824,乌拉特中旗,1508
-150825,乌拉特后旗,1508
-150826,杭锦后旗,1508
-1509,乌兰察布市,15
-150902,集宁区,1509
-150921,卓资县,1509
-150922,化德县,1509
-150923,商都县,1509
-150924,兴和县,1509
-150925,凉城县,1509
-150926,察哈尔右翼前旗,1509
-150927,察哈尔右翼中旗,1509
-150928,察哈尔右翼后旗,1509
-150929,四子王旗,1509
-150981,丰镇市,1509
-1522,兴安盟,15
-152201,乌兰浩特市,1522
-152202,阿尔山市,1522
-152221,科尔沁右翼前旗,1522
-152222,科尔沁右翼中旗,1522
-152223,扎赉特旗,1522
-152224,突泉县,1522
-1525,锡林郭勒盟,15
-152501,二连浩特市,1525
-152502,锡林浩特市,1525
-152522,阿巴嘎旗,1525
-152523,苏尼特左旗,1525
-152524,苏尼特右旗,1525
-152525,东乌珠穆沁旗,1525
-152526,西乌珠穆沁旗,1525
-152527,太仆寺旗,1525
-152528,镶黄旗,1525
-152529,正镶白旗,1525
-152530,正蓝旗,1525
-152531,多伦县,1525
-1529,阿拉善盟,15
-152921,阿拉善左旗,1529
-152922,阿拉善右旗,1529
-152923,额济纳旗,1529
-21,辽宁省,
-2101,沈阳市,21
-210102,和平区,2101
-210103,沈河区,2101
-210104,大东区,2101
-210105,皇姑区,2101
-210106,铁西区,2101
-210111,苏家屯区,2101
-210112,浑南区,2101
-210113,沈北新区,2101
-210114,于洪区,2101
-210115,辽中区,2101
-210123,康平县,2101
-210124,法库县,2101
-210181,新民市,2101
-2102,大连市,21
-210202,中山区,2102
-210203,西岗区,2102
-210204,沙河口区,2102
-210211,甘井子区,2102
-210212,旅顺口区,2102
-210213,金州区,2102
-210214,普兰店区,2102
-210224,长海县,2102
-210281,瓦房店市,2102
-210283,庄河市,2102
-2103,鞍山市,21
-210302,铁东区,2103
-210303,铁西区,2103
-210304,立山区,2103
-210311,千山区,2103
-210321,台安县,2103
-210323,岫岩满族自治县,2103
-210381,海城市,2103
-2104,抚顺市,21
-210402,新抚区,2104
-210403,东洲区,2104
-210404,望花区,2104
-210411,顺城区,2104
-210421,抚顺县,2104
-210422,新宾满族自治县,2104
-210423,清原满族自治县,2104
-2105,本溪市,21
-210502,平山区,2105
-210503,溪湖区,2105
-210504,明山区,2105
-210505,南芬区,2105
-210521,本溪满族自治县,2105
-210522,桓仁满族自治县,2105
-2106,丹东市,21
-210602,元宝区,2106
-210603,振兴区,2106
-210604,振安区,2106
-210624,宽甸满族自治县,2106
-210681,东港市,2106
-210682,凤城市,2106
-2107,锦州市,21
-210702,古塔区,2107
-210703,凌河区,2107
-210711,太和区,2107
-210726,黑山县,2107
-210727,义县,2107
-210781,凌海市,2107
-210782,北镇市,2107
-2108,营口市,21
-210802,站前区,2108
-210803,西市区,2108
-210804,鲅鱼圈区,2108
-210811,老边区,2108
-210881,盖州市,2108
-210882,大石桥市,2108
-2109,阜新市,21
-210902,海州区,2109
-210903,新邱区,2109
-210904,太平区,2109
-210905,清河门区,2109
-210911,细河区,2109
-210921,阜新蒙古族自治县,2109
-210922,彰武县,2109
-2110,辽阳市,21
-211002,白塔区,2110
-211003,文圣区,2110
-211004,宏伟区,2110
-211005,弓长岭区,2110
-211011,太子河区,2110
-211021,辽阳县,2110
-211081,灯塔市,2110
-2111,盘锦市,21
-211102,双台子区,2111
-211103,兴隆台区,2111
-211104,大洼区,2111
-211122,盘山县,2111
-2112,铁岭市,21
-211202,银州区,2112
-211204,清河区,2112
-211221,铁岭县,2112
-211223,西丰县,2112
-211224,昌图县,2112
-211281,调兵山市,2112
-211282,开原市,2112
-2113,朝阳市,21
-211302,双塔区,2113
-211303,龙城区,2113
-211321,朝阳县,2113
-211322,建平县,2113
-211324,喀喇沁左翼蒙古族自治县,2113
-211381,北票市,2113
-211382,凌源市,2113
-2114,葫芦岛市,21
-211402,连山区,2114
-211403,龙港区,2114
-211404,南票区,2114
-211421,绥中县,2114
-211422,建昌县,2114
-211481,兴城市,2114
-22,吉林省,
-2201,长春市,22
-220102,南关区,2201
-220103,宽城区,2201
-220104,朝阳区,2201
-220105,二道区,2201
-220106,绿园区,2201
-220112,双阳区,2201
-220113,九台区,2201
-220122,农安县,2201
-220182,榆树市,2201
-220183,德惠市,2201
-2202,吉林市,22
-220202,昌邑区,2202
-220203,龙潭区,2202
-220204,船营区,2202
-220211,丰满区,2202
-220221,永吉县,2202
-220281,蛟河市,2202
-220282,桦甸市,2202
-220283,舒兰市,2202
-220284,磐石市,2202
-2203,四平市,22
-220302,铁西区,2203
-220303,铁东区,2203
-220322,梨树县,2203
-220323,伊通满族自治县,2203
-220381,公主岭市,2203
-220382,双辽市,2203
-2204,辽源市,22
-220402,龙山区,2204
-220403,西安区,2204
-220421,东丰县,2204
-220422,东辽县,2204
-2205,通化市,22
-220502,东昌区,2205
-220503,二道江区,2205
-220521,通化县,2205
-220523,辉南县,2205
-220524,柳河县,2205
-220581,梅河口市,2205
-220582,集安市,2205
-2206,白山市,22
-220602,浑江区,2206
-220605,江源区,2206
-220621,抚松县,2206
-220622,靖宇县,2206
-220623,长白朝鲜族自治县,2206
-220681,临江市,2206
-2207,松原市,22
-220702,宁江区,2207
-220721,前郭尔罗斯蒙古族自治县,2207
-220722,长岭县,2207
-220723,乾安县,2207
-220781,扶余市,2207
-2208,白城市,22
-220802,洮北区,2208
-220821,镇赉县,2208
-220822,通榆县,2208
-220881,洮南市,2208
-220882,大安市,2208
-2224,延边朝鲜族自治州,22
-222401,延吉市,2224
-222402,图们市,2224
-222403,敦化市,2224
-222404,珲春市,2224
-222405,龙井市,2224
-222406,和龙市,2224
-222424,汪清县,2224
-222426,安图县,2224
-23,黑龙江省,
-2301,哈尔滨市,23
-230102,道里区,2301
-230103,南岗区,2301
-230104,道外区,2301
-230108,平房区,2301
-230109,松北区,2301
-230110,香坊区,2301
-230111,呼兰区,2301
-230112,阿城区,2301
-230113,双城区,2301
-230123,依兰县,2301
-230124,方正县,2301
-230125,宾县,2301
-230126,巴彦县,2301
-230127,木兰县,2301
-230128,通河县,2301
-230129,延寿县,2301
-230183,尚志市,2301
-230184,五常市,2301
-2302,齐齐哈尔市,23
-230202,龙沙区,2302
-230203,建华区,2302
-230204,铁锋区,2302
-230205,昂昂溪区,2302
-230206,富拉尔基区,2302
-230207,碾子山区,2302
-230208,梅里斯达斡尔族区,2302
-230221,龙江县,2302
-230223,依安县,2302
-230224,泰来县,2302
-230225,甘南县,2302
-230227,富裕县,2302
-230229,克山县,2302
-230230,克东县,2302
-230231,拜泉县,2302
-230281,讷河市,2302
-2303,鸡西市,23
-230302,鸡冠区,2303
-230303,恒山区,2303
-230304,滴道区,2303
-230305,梨树区,2303
-230306,城子河区,2303
-230307,麻山区,2303
-230321,鸡东县,2303
-230381,虎林市,2303
-230382,密山市,2303
-2304,鹤岗市,23
-230402,向阳区,2304
-230403,工农区,2304
-230404,南山区,2304
-230405,兴安区,2304
-230406,东山区,2304
-230407,兴山区,2304
-230421,萝北县,2304
-230422,绥滨县,2304
-2305,双鸭山市,23
-230502,尖山区,2305
-230503,岭东区,2305
-230505,四方台区,2305
-230506,宝山区,2305
-230521,集贤县,2305
-230522,友谊县,2305
-230523,宝清县,2305
-230524,饶河县,2305
-2306,大庆市,23
-230602,萨尔图区,2306
-230603,龙凤区,2306
-230604,让胡路区,2306
-230605,红岗区,2306
-230606,大同区,2306
-230621,肇州县,2306
-230622,肇源县,2306
-230623,林甸县,2306
-230624,杜尔伯特蒙古族自治县,2306
-2307,伊春市,23
-230702,伊春区,2307
-230703,南岔区,2307
-230704,友好区,2307
-230705,西林区,2307
-230706,翠峦区,2307
-230707,新青区,2307
-230708,美溪区,2307
-230709,金山屯区,2307
-230710,五营区,2307
-230711,乌马河区,2307
-230712,汤旺河区,2307
-230713,带岭区,2307
-230714,乌伊岭区,2307
-230715,红星区,2307
-230716,上甘岭区,2307
-230722,嘉荫县,2307
-230781,铁力市,2307
-2308,佳木斯市,23
-230803,向阳区,2308
-230804,前进区,2308
-230805,东风区,2308
-230811,郊区,2308
-230822,桦南县,2308
-230826,桦川县,2308
-230828,汤原县,2308
-230881,同江市,2308
-230882,富锦市,2308
-230883,抚远市,2308
-2309,七台河市,23
-230902,新兴区,2309
-230903,桃山区,2309
-230904,茄子河区,2309
-230921,勃利县,2309
-2310,牡丹江市,23
-231002,东安区,2310
-231003,阳明区,2310
-231004,爱民区,2310
-231005,西安区,2310
-231025,林口县,2310
-231081,绥芬河市,2310
-231083,海林市,2310
-231084,宁安市,2310
-231085,穆棱市,2310
-231086,东宁市,2310
-2311,黑河市,23
-231102,爱辉区,2311
-231121,嫩江县,2311
-231123,逊克县,2311
-231124,孙吴县,2311
-231181,北安市,2311
-231182,五大连池市,2311
-2312,绥化市,23
-231202,北林区,2312
-231221,望奎县,2312
-231222,兰西县,2312
-231223,青冈县,2312
-231224,庆安县,2312
-231225,明水县,2312
-231226,绥棱县,2312
-231281,安达市,2312
-231282,肇东市,2312
-231283,海伦市,2312
-2327,大兴安岭地区,23
-232701,漠河市,2327
-232721,呼玛县,2327
-232722,塔河县,2327
-31,上海市,
-3101,市辖区,31
-310101,黄浦区,3101
-310104,徐汇区,3101
-310105,长宁区,3101
-310106,静安区,3101
-310107,普陀区,3101
-310109,虹口区,3101
-310110,杨浦区,3101
-310112,闵行区,3101
-310113,宝山区,3101
-310114,嘉定区,3101
-310115,浦东新区,3101
-310116,金山区,3101
-310117,松江区,3101
-310118,青浦区,3101
-310120,奉贤区,3101
-310151,崇明区,3101
-32,江苏省,
-3201,南京市,32
-320102,玄武区,3201
-320104,秦淮区,3201
-320105,建邺区,3201
-320106,鼓楼区,3201
-320111,浦口区,3201
-320113,栖霞区,3201
-320114,雨花台区,3201
-320115,江宁区,3201
-320116,六合区,3201
-320117,溧水区,3201
-320118,高淳区,3201
-3202,无锡市,32
-320205,锡山区,3202
-320206,惠山区,3202
-320211,滨湖区,3202
-320213,梁溪区,3202
-320214,新吴区,3202
-320281,江阴市,3202
-320282,宜兴市,3202
-3203,徐州市,32
-320302,鼓楼区,3203
-320303,云龙区,3203
-320305,贾汪区,3203
-320311,泉山区,3203
-320312,铜山区,3203
-320321,丰县,3203
-320322,沛县,3203
-320324,睢宁县,3203
-320381,新沂市,3203
-320382,邳州市,3203
-3204,常州市,32
-320402,天宁区,3204
-320404,钟楼区,3204
-320411,新北区,3204
-320412,武进区,3204
-320413,金坛区,3204
-320481,溧阳市,3204
-3205,苏州市,32
-320505,虎丘区,3205
-320506,吴中区,3205
-320507,相城区,3205
-320508,姑苏区,3205
-320509,吴江区,3205
-320581,常熟市,3205
-320582,张家港市,3205
-320583,昆山市,3205
-320585,太仓市,3205
-3206,南通市,32
-320602,崇川区,3206
-320611,港闸区,3206
-320612,通州区,3206
-320623,如东县,3206
-320681,启东市,3206
-320682,如皋市,3206
-320684,海门市,3206
-320685,海安市,3206
-3207,连云港市,32
-320703,连云区,3207
-320706,海州区,3207
-320707,赣榆区,3207
-320722,东海县,3207
-320723,灌云县,3207
-320724,灌南县,3207
-3208,淮安市,32
-320803,淮安区,3208
-320804,淮阴区,3208
-320812,清江浦区,3208
-320813,洪泽区,3208
-320826,涟水县,3208
-320830,盱眙县,3208
-320831,金湖县,3208
-3209,盐城市,32
-320902,亭湖区,3209
-320903,盐都区,3209
-320904,大丰区,3209
-320921,响水县,3209
-320922,滨海县,3209
-320923,阜宁县,3209
-320924,射阳县,3209
-320925,建湖县,3209
-320981,东台市,3209
-3210,扬州市,32
-321002,广陵区,3210
-321003,邗江区,3210
-321012,江都区,3210
-321023,宝应县,3210
-321081,仪征市,3210
-321084,高邮市,3210
-3211,镇江市,32
-321102,京口区,3211
-321111,润州区,3211
-321112,丹徒区,3211
-321181,丹阳市,3211
-321182,扬中市,3211
-321183,句容市,3211
-3212,泰州市,32
-321202,海陵区,3212
-321203,高港区,3212
-321204,姜堰区,3212
-321281,兴化市,3212
-321282,靖江市,3212
-321283,泰兴市,3212
-3213,宿迁市,32
-321302,宿城区,3213
-321311,宿豫区,3213
-321322,沭阳县,3213
-321323,泗阳县,3213
-321324,泗洪县,3213
-33,浙江省,
-3301,杭州市,33
-330102,上城区,3301
-330103,下城区,3301
-330104,江干区,3301
-330105,拱墅区,3301
-330106,西湖区,3301
-330108,滨江区,3301
-330109,萧山区,3301
-330110,余杭区,3301
-330111,富阳区,3301
-330112,临安区,3301
-330122,桐庐县,3301
-330127,淳安县,3301
-330182,建德市,3301
-3302,宁波市,33
-330203,海曙区,3302
-330205,江北区,3302
-330206,北仑区,3302
-330211,镇海区,3302
-330212,鄞州区,3302
-330213,奉化区,3302
-330225,象山县,3302
-330226,宁海县,3302
-330281,余姚市,3302
-330282,慈溪市,3302
-3303,温州市,33
-330302,鹿城区,3303
-330303,龙湾区,3303
-330304,瓯海区,3303
-330305,洞头区,3303
-330324,永嘉县,3303
-330326,平阳县,3303
-330327,苍南县,3303
-330328,文成县,3303
-330329,泰顺县,3303
-330381,瑞安市,3303
-330382,乐清市,3303
-3304,嘉兴市,33
-330402,南湖区,3304
-330411,秀洲区,3304
-330421,嘉善县,3304
-330424,海盐县,3304
-330481,海宁市,3304
-330482,平湖市,3304
-330483,桐乡市,3304
-3305,湖州市,33
-330502,吴兴区,3305
-330503,南浔区,3305
-330521,德清县,3305
-330522,长兴县,3305
-330523,安吉县,3305
-3306,绍兴市,33
-330602,越城区,3306
-330603,柯桥区,3306
-330604,上虞区,3306
-330624,新昌县,3306
-330681,诸暨市,3306
-330683,嵊州市,3306
-3307,金华市,33
-330702,婺城区,3307
-330703,金东区,3307
-330723,武义县,3307
-330726,浦江县,3307
-330727,磐安县,3307
-330781,兰溪市,3307
-330782,义乌市,3307
-330783,东阳市,3307
-330784,永康市,3307
-3308,衢州市,33
-330802,柯城区,3308
-330803,衢江区,3308
-330822,常山县,3308
-330824,开化县,3308
-330825,龙游县,3308
-330881,江山市,3308
-3309,舟山市,33
-330902,定海区,3309
-330903,普陀区,3309
-330921,岱山县,3309
-330922,嵊泗县,3309
-3310,台州市,33
-331002,椒江区,3310
-331003,黄岩区,3310
-331004,路桥区,3310
-331022,三门县,3310
-331023,天台县,3310
-331024,仙居县,3310
-331081,温岭市,3310
-331082,临海市,3310
-331083,玉环市,3310
-3311,丽水市,33
-331102,莲都区,3311
-331121,青田县,3311
-331122,缙云县,3311
-331123,遂昌县,3311
-331124,松阳县,3311
-331125,云和县,3311
-331126,庆元县,3311
-331127,景宁畲族自治县,3311
-331181,龙泉市,3311
-34,安徽省,
-3401,合肥市,34
-340102,瑶海区,3401
-340103,庐阳区,3401
-340104,蜀山区,3401
-340111,包河区,3401
-340121,长丰县,3401
-340122,肥东县,3401
-340123,肥西县,3401
-340124,庐江县,3401
-340181,巢湖市,3401
-3402,芜湖市,34
-340202,镜湖区,3402
-340203,弋江区,3402
-340207,鸠江区,3402
-340208,三山区,3402
-340221,芜湖县,3402
-340222,繁昌县,3402
-340223,南陵县,3402
-340225,无为县,3402
-3403,蚌埠市,34
-340302,龙子湖区,3403
-340303,蚌山区,3403
-340304,禹会区,3403
-340311,淮上区,3403
-340321,怀远县,3403
-340322,五河县,3403
-340323,固镇县,3403
-3404,淮南市,34
-340402,大通区,3404
-340403,田家庵区,3404
-340404,谢家集区,3404
-340405,八公山区,3404
-340406,潘集区,3404
-340421,凤台县,3404
-340422,寿县,3404
-3405,马鞍山市,34
-340503,花山区,3405
-340504,雨山区,3405
-340506,博望区,3405
-340521,当涂县,3405
-340522,含山县,3405
-340523,和县,3405
-3406,淮北市,34
-340602,杜集区,3406
-340603,相山区,3406
-340604,烈山区,3406
-340621,濉溪县,3406
-3407,铜陵市,34
-340705,铜官区,3407
-340706,义安区,3407
-340711,郊区,3407
-340722,枞阳县,3407
-3408,安庆市,34
-340802,迎江区,3408
-340803,大观区,3408
-340811,宜秀区,3408
-340822,怀宁县,3408
-340825,太湖县,3408
-340826,宿松县,3408
-340827,望江县,3408
-340828,岳西县,3408
-340881,桐城市,3408
-340882,潜山市,3408
-3410,黄山市,34
-341002,屯溪区,3410
-341003,黄山区,3410
-341004,徽州区,3410
-341021,歙县,3410
-341022,休宁县,3410
-341023,黟县,3410
-341024,祁门县,3410
-3411,滁州市,34
-341102,琅琊区,3411
-341103,南谯区,3411
-341122,来安县,3411
-341124,全椒县,3411
-341125,定远县,3411
-341126,凤阳县,3411
-341181,天长市,3411
-341182,明光市,3411
-3412,阜阳市,34
-341202,颍州区,3412
-341203,颍东区,3412
-341204,颍泉区,3412
-341221,临泉县,3412
-341222,太和县,3412
-341225,阜南县,3412
-341226,颍上县,3412
-341282,界首市,3412
-3413,宿州市,34
-341302,埇桥区,3413
-341321,砀山县,3413
-341322,萧县,3413
-341323,灵璧县,3413
-341324,泗县,3413
-3415,六安市,34
-341502,金安区,3415
-341503,裕安区,3415
-341504,叶集区,3415
-341522,霍邱县,3415
-341523,舒城县,3415
-341524,金寨县,3415
-341525,霍山县,3415
-3416,亳州市,34
-341602,谯城区,3416
-341621,涡阳县,3416
-341622,蒙城县,3416
-341623,利辛县,3416
-3417,池州市,34
-341702,贵池区,3417
-341721,东至县,3417
-341722,石台县,3417
-341723,青阳县,3417
-3418,宣城市,34
-341802,宣州区,3418
-341821,郎溪县,3418
-341822,广德县,3418
-341823,泾县,3418
-341824,绩溪县,3418
-341825,旌德县,3418
-341881,宁国市,3418
-35,福建省,
-3501,福州市,35
-350102,鼓楼区,3501
-350103,台江区,3501
-350104,仓山区,3501
-350105,马尾区,3501
-350111,晋安区,3501
-350112,长乐区,3501
-350121,闽侯县,3501
-350122,连江县,3501
-350123,罗源县,3501
-350124,闽清县,3501
-350125,永泰县,3501
-350128,平潭县,3501
-350181,福清市,3501
-3502,厦门市,35
-350203,思明区,3502
-350205,海沧区,3502
-350206,湖里区,3502
-350211,集美区,3502
-350212,同安区,3502
-350213,翔安区,3502
-3503,莆田市,35
-350302,城厢区,3503
-350303,涵江区,3503
-350304,荔城区,3503
-350305,秀屿区,3503
-350322,仙游县,3503
-3504,三明市,35
-350402,梅列区,3504
-350403,三元区,3504
-350421,明溪县,3504
-350423,清流县,3504
-350424,宁化县,3504
-350425,大田县,3504
-350426,尤溪县,3504
-350427,沙县,3504
-350428,将乐县,3504
-350429,泰宁县,3504
-350430,建宁县,3504
-350481,永安市,3504
-3505,泉州市,35
-350502,鲤城区,3505
-350503,丰泽区,3505
-350504,洛江区,3505
-350505,泉港区,3505
-350521,惠安县,3505
-350524,安溪县,3505
-350525,永春县,3505
-350526,德化县,3505
-350527,金门县,3505
-350581,石狮市,3505
-350582,晋江市,3505
-350583,南安市,3505
-3506,漳州市,35
-350602,芗城区,3506
-350603,龙文区,3506
-350622,云霄县,3506
-350623,漳浦县,3506
-350624,诏安县,3506
-350625,长泰县,3506
-350626,东山县,3506
-350627,南靖县,3506
-350628,平和县,3506
-350629,华安县,3506
-350681,龙海市,3506
-3507,南平市,35
-350702,延平区,3507
-350703,建阳区,3507
-350721,顺昌县,3507
-350722,浦城县,3507
-350723,光泽县,3507
-350724,松溪县,3507
-350725,政和县,3507
-350781,邵武市,3507
-350782,武夷山市,3507
-350783,建瓯市,3507
-3508,龙岩市,35
-350802,新罗区,3508
-350803,永定区,3508
-350821,长汀县,3508
-350823,上杭县,3508
-350824,武平县,3508
-350825,连城县,3508
-350881,漳平市,3508
-3509,宁德市,35
-350902,蕉城区,3509
-350921,霞浦县,3509
-350922,古田县,3509
-350923,屏南县,3509
-350924,寿宁县,3509
-350925,周宁县,3509
-350926,柘荣县,3509
-350981,福安市,3509
-350982,福鼎市,3509
-36,江西省,
-3601,南昌市,36
-360102,东湖区,3601
-360103,西湖区,3601
-360104,青云谱区,3601
-360105,湾里区,3601
-360111,青山湖区,3601
-360112,新建区,3601
-360121,南昌县,3601
-360123,安义县,3601
-360124,进贤县,3601
-3602,景德镇市,36
-360202,昌江区,3602
-360203,珠山区,3602
-360222,浮梁县,3602
-360281,乐平市,3602
-3603,萍乡市,36
-360302,安源区,3603
-360313,湘东区,3603
-360321,莲花县,3603
-360322,上栗县,3603
-360323,芦溪县,3603
-3604,九江市,36
-360402,濂溪区,3604
-360403,浔阳区,3604
-360404,柴桑区,3604
-360423,武宁县,3604
-360424,修水县,3604
-360425,永修县,3604
-360426,德安县,3604
-360428,都昌县,3604
-360429,湖口县,3604
-360430,彭泽县,3604
-360481,瑞昌市,3604
-360482,共青城市,3604
-360483,庐山市,3604
-3605,新余市,36
-360502,渝水区,3605
-360521,分宜县,3605
-3606,鹰潭市,36
-360602,月湖区,3606
-360603,余江区,3606
-360681,贵溪市,3606
-3607,赣州市,36
-360702,章贡区,3607
-360703,南康区,3607
-360704,赣县区,3607
-360722,信丰县,3607
-360723,大余县,3607
-360724,上犹县,3607
-360725,崇义县,3607
-360726,安远县,3607
-360727,龙南县,3607
-360728,定南县,3607
-360729,全南县,3607
-360730,宁都县,3607
-360731,于都县,3607
-360732,兴国县,3607
-360733,会昌县,3607
-360734,寻乌县,3607
-360735,石城县,3607
-360781,瑞金市,3607
-3608,吉安市,36
-360802,吉州区,3608
-360803,青原区,3608
-360821,吉安县,3608
-360822,吉水县,3608
-360823,峡江县,3608
-360824,新干县,3608
-360825,永丰县,3608
-360826,泰和县,3608
-360827,遂川县,3608
-360828,万安县,3608
-360829,安福县,3608
-360830,永新县,3608
-360881,井冈山市,3608
-3609,宜春市,36
-360902,袁州区,3609
-360921,奉新县,3609
-360922,万载县,3609
-360923,上高县,3609
-360924,宜丰县,3609
-360925,靖安县,3609
-360926,铜鼓县,3609
-360981,丰城市,3609
-360982,樟树市,3609
-360983,高安市,3609
-3610,抚州市,36
-361002,临川区,3610
-361003,东乡区,3610
-361021,南城县,3610
-361022,黎川县,3610
-361023,南丰县,3610
-361024,崇仁县,3610
-361025,乐安县,3610
-361026,宜黄县,3610
-361027,金溪县,3610
-361028,资溪县,3610
-361030,广昌县,3610
-3611,上饶市,36
-361102,信州区,3611
-361103,广丰区,3611
-361121,上饶县,3611
-361123,玉山县,3611
-361124,铅山县,3611
-361125,横峰县,3611
-361126,弋阳县,3611
-361127,余干县,3611
-361128,鄱阳县,3611
-361129,万年县,3611
-361130,婺源县,3611
-361181,德兴市,3611
-37,山东省,
-3701,济南市,37
-370102,历下区,3701
-370103,市中区,3701
-370104,槐荫区,3701
-370105,天桥区,3701
-370112,历城区,3701
-370113,长清区,3701
-370114,章丘区,3701
-370115,济阳区,3701
-370124,平阴县,3701
-370126,商河县,3701
-3702,青岛市,37
-370202,市南区,3702
-370203,市北区,3702
-370211,黄岛区,3702
-370212,崂山区,3702
-370213,李沧区,3702
-370214,城阳区,3702
-370215,即墨区,3702
-370281,胶州市,3702
-370283,平度市,3702
-370285,莱西市,3702
-3703,淄博市,37
-370302,淄川区,3703
-370303,张店区,3703
-370304,博山区,3703
-370305,临淄区,3703
-370306,周村区,3703
-370321,桓台县,3703
-370322,高青县,3703
-370323,沂源县,3703
-3704,枣庄市,37
-370402,市中区,3704
-370403,薛城区,3704
-370404,峄城区,3704
-370405,台儿庄区,3704
-370406,山亭区,3704
-370481,滕州市,3704
-3705,东营市,37
-370502,东营区,3705
-370503,河口区,3705
-370505,垦利区,3705
-370522,利津县,3705
-370523,广饶县,3705
-3706,烟台市,37
-370602,芝罘区,3706
-370611,福山区,3706
-370612,牟平区,3706
-370613,莱山区,3706
-370634,长岛县,3706
-370681,龙口市,3706
-370682,莱阳市,3706
-370683,莱州市,3706
-370684,蓬莱市,3706
-370685,招远市,3706
-370686,栖霞市,3706
-370687,海阳市,3706
-3707,潍坊市,37
-370702,潍城区,3707
-370703,寒亭区,3707
-370704,坊子区,3707
-370705,奎文区,3707
-370724,临朐县,3707
-370725,昌乐县,3707
-370781,青州市,3707
-370782,诸城市,3707
-370783,寿光市,3707
-370784,安丘市,3707
-370785,高密市,3707
-370786,昌邑市,3707
-3708,济宁市,37
-370811,任城区,3708
-370812,兖州区,3708
-370826,微山县,3708
-370827,鱼台县,3708
-370828,金乡县,3708
-370829,嘉祥县,3708
-370830,汶上县,3708
-370831,泗水县,3708
-370832,梁山县,3708
-370881,曲阜市,3708
-370883,邹城市,3708
-3709,泰安市,37
-370902,泰山区,3709
-370911,岱岳区,3709
-370921,宁阳县,3709
-370923,东平县,3709
-370982,新泰市,3709
-370983,肥城市,3709
-3710,威海市,37
-371002,环翠区,3710
-371003,文登区,3710
-371082,荣成市,3710
-371083,乳山市,3710
-3711,日照市,37
-371102,东港区,3711
-371103,岚山区,3711
-371121,五莲县,3711
-371122,莒县,3711
-3712,莱芜市,37
-371202,莱城区,3712
-371203,钢城区,3712
-3713,临沂市,37
-371302,兰山区,3713
-371311,罗庄区,3713
-371312,河东区,3713
-371321,沂南县,3713
-371322,郯城县,3713
-371323,沂水县,3713
-371324,兰陵县,3713
-371325,费县,3713
-371326,平邑县,3713
-371327,莒南县,3713
-371328,蒙阴县,3713
-371329,临沭县,3713
-3714,德州市,37
-371402,德城区,3714
-371403,陵城区,3714
-371422,宁津县,3714
-371423,庆云县,3714
-371424,临邑县,3714
-371425,齐河县,3714
-371426,平原县,3714
-371427,夏津县,3714
-371428,武城县,3714
-371481,乐陵市,3714
-371482,禹城市,3714
-3715,聊城市,37
-371502,东昌府区,3715
-371521,阳谷县,3715
-371522,莘县,3715
-371523,茌平县,3715
-371524,东阿县,3715
-371525,冠县,3715
-371526,高唐县,3715
-371581,临清市,3715
-3716,滨州市,37
-371602,滨城区,3716
-371603,沾化区,3716
-371621,惠民县,3716
-371622,阳信县,3716
-371623,无棣县,3716
-371625,博兴县,3716
-371681,邹平市,3716
-3717,菏泽市,37
-371702,牡丹区,3717
-371703,定陶区,3717
-371721,曹县,3717
-371722,单县,3717
-371723,成武县,3717
-371724,巨野县,3717
-371725,郓城县,3717
-371726,鄄城县,3717
-371728,东明县,3717
-41,河南省,
-4101,郑州市,41
-410102,中原区,4101
-410103,二七区,4101
-410104,管城回族区,4101
-410105,金水区,4101
-410106,上街区,4101
-410108,惠济区,4101
-410122,中牟县,4101
-410181,巩义市,4101
-410182,荥阳市,4101
-410183,新密市,4101
-410184,新郑市,4101
-410185,登封市,4101
-4102,开封市,41
-410202,龙亭区,4102
-410203,顺河回族区,4102
-410204,鼓楼区,4102
-410205,禹王台区,4102
-410212,祥符区,4102
-410221,杞县,4102
-410222,通许县,4102
-410223,尉氏县,4102
-410225,兰考县,4102
-4103,洛阳市,41
-410302,老城区,4103
-410303,西工区,4103
-410304,瀍河回族区,4103
-410305,涧西区,4103
-410306,吉利区,4103
-410311,洛龙区,4103
-410322,孟津县,4103
-410323,新安县,4103
-410324,栾川县,4103
-410325,嵩县,4103
-410326,汝阳县,4103
-410327,宜阳县,4103
-410328,洛宁县,4103
-410329,伊川县,4103
-410381,偃师市,4103
-4104,平顶山市,41
-410402,新华区,4104
-410403,卫东区,4104
-410404,石龙区,4104
-410411,湛河区,4104
-410421,宝丰县,4104
-410422,叶县,4104
-410423,鲁山县,4104
-410425,郏县,4104
-410481,舞钢市,4104
-410482,汝州市,4104
-4105,安阳市,41
-410502,文峰区,4105
-410503,北关区,4105
-410505,殷都区,4105
-410506,龙安区,4105
-410522,安阳县,4105
-410523,汤阴县,4105
-410526,滑县,4105
-410527,内黄县,4105
-410581,林州市,4105
-4106,鹤壁市,41
-410602,鹤山区,4106
-410603,山城区,4106
-410611,淇滨区,4106
-410621,浚县,4106
-410622,淇县,4106
-4107,新乡市,41
-410702,红旗区,4107
-410703,卫滨区,4107
-410704,凤泉区,4107
-410711,牧野区,4107
-410721,新乡县,4107
-410724,获嘉县,4107
-410725,原阳县,4107
-410726,延津县,4107
-410727,封丘县,4107
-410728,长垣县,4107
-410781,卫辉市,4107
-410782,辉县市,4107
-4108,焦作市,41
-410802,解放区,4108
-410803,中站区,4108
-410804,马村区,4108
-410811,山阳区,4108
-410821,修武县,4108
-410822,博爱县,4108
-410823,武陟县,4108
-410825,温县,4108
-410882,沁阳市,4108
-410883,孟州市,4108
-4109,濮阳市,41
-410902,华龙区,4109
-410922,清丰县,4109
-410923,南乐县,4109
-410926,范县,4109
-410927,台前县,4109
-410928,濮阳县,4109
-4110,许昌市,41
-411002,魏都区,4110
-411003,建安区,4110
-411024,鄢陵县,4110
-411025,襄城县,4110
-411081,禹州市,4110
-411082,长葛市,4110
-4111,漯河市,41
-411102,源汇区,4111
-411103,郾城区,4111
-411104,召陵区,4111
-411121,舞阳县,4111
-411122,临颍县,4111
-4112,三门峡市,41
-411202,湖滨区,4112
-411203,陕州区,4112
-411221,渑池县,4112
-411224,卢氏县,4112
-411281,义马市,4112
-411282,灵宝市,4112
-4113,南阳市,41
-411302,宛城区,4113
-411303,卧龙区,4113
-411321,南召县,4113
-411322,方城县,4113
-411323,西峡县,4113
-411324,镇平县,4113
-411325,内乡县,4113
-411326,淅川县,4113
-411327,社旗县,4113
-411328,唐河县,4113
-411329,新野县,4113
-411330,桐柏县,4113
-411381,邓州市,4113
-4114,商丘市,41
-411402,梁园区,4114
-411403,睢阳区,4114
-411421,民权县,4114
-411422,睢县,4114
-411423,宁陵县,4114
-411424,柘城县,4114
-411425,虞城县,4114
-411426,夏邑县,4114
-411481,永城市,4114
-4115,信阳市,41
-411502,浉河区,4115
-411503,平桥区,4115
-411521,罗山县,4115
-411522,光山县,4115
-411523,新县,4115
-411524,商城县,4115
-411525,固始县,4115
-411526,潢川县,4115
-411527,淮滨县,4115
-411528,息县,4115
-4116,周口市,41
-411602,川汇区,4116
-411621,扶沟县,4116
-411622,西华县,4116
-411623,商水县,4116
-411624,沈丘县,4116
-411625,郸城县,4116
-411626,淮阳县,4116
-411627,太康县,4116
-411628,鹿邑县,4116
-411681,项城市,4116
-4117,驻马店市,41
-411702,驿城区,4117
-411721,西平县,4117
-411722,上蔡县,4117
-411723,平舆县,4117
-411724,正阳县,4117
-411725,确山县,4117
-411726,泌阳县,4117
-411727,汝南县,4117
-411728,遂平县,4117
-411729,新蔡县,4117
-419001,济源市,41
-42,湖北省,
-4201,武汉市,42
-420102,江岸区,4201
-420103,江汉区,4201
-420104,硚口区,4201
-420105,汉阳区,4201
-420106,武昌区,4201
-420107,青山区,4201
-420111,洪山区,4201
-420112,东西湖区,4201
-420113,汉南区,4201
-420114,蔡甸区,4201
-420115,江夏区,4201
-420116,黄陂区,4201
-420117,新洲区,4201
-4202,黄石市,42
-420202,黄石港区,4202
-420203,西塞山区,4202
-420204,下陆区,4202
-420205,铁山区,4202
-420222,阳新县,4202
-420281,大冶市,4202
-4203,十堰市,42
-420302,茅箭区,4203
-420303,张湾区,4203
-420304,郧阳区,4203
-420322,郧西县,4203
-420323,竹山县,4203
-420324,竹溪县,4203
-420325,房县,4203
-420381,丹江口市,4203
-4205,宜昌市,42
-420502,西陵区,4205
-420503,伍家岗区,4205
-420504,点军区,4205
-420505,猇亭区,4205
-420506,夷陵区,4205
-420525,远安县,4205
-420526,兴山县,4205
-420527,秭归县,4205
-420528,长阳土家族自治县,4205
-420529,五峰土家族自治县,4205
-420581,宜都市,4205
-420582,当阳市,4205
-420583,枝江市,4205
-4206,襄阳市,42
-420602,襄城区,4206
-420606,樊城区,4206
-420607,襄州区,4206
-420624,南漳县,4206
-420625,谷城县,4206
-420626,保康县,4206
-420682,老河口市,4206
-420683,枣阳市,4206
-420684,宜城市,4206
-4207,鄂州市,42
-420702,梁子湖区,4207
-420703,华容区,4207
-420704,鄂城区,4207
-4208,荆门市,42
-420802,东宝区,4208
-420804,掇刀区,4208
-420822,沙洋县,4208
-420881,钟祥市,4208
-420882,京山市,4208
-4209,孝感市,42
-420902,孝南区,4209
-420921,孝昌县,4209
-420922,大悟县,4209
-420923,云梦县,4209
-420981,应城市,4209
-420982,安陆市,4209
-420984,汉川市,4209
-4210,荆州市,42
-421002,沙市区,4210
-421003,荆州区,4210
-421022,公安县,4210
-421023,监利县,4210
-421024,江陵县,4210
-421081,石首市,4210
-421083,洪湖市,4210
-421087,松滋市,4210
-4211,黄冈市,42
-421102,黄州区,4211
-421121,团风县,4211
-421122,红安县,4211
-421123,罗田县,4211
-421124,英山县,4211
-421125,浠水县,4211
-421126,蕲春县,4211
-421127,黄梅县,4211
-421181,麻城市,4211
-421182,武穴市,4211
-4212,咸宁市,42
-421202,咸安区,4212
-421221,嘉鱼县,4212
-421222,通城县,4212
-421223,崇阳县,4212
-421224,通山县,4212
-421281,赤壁市,4212
-4213,随州市,42
-421303,曾都区,4213
-421321,随县,4213
-421381,广水市,4213
-4228,恩施土家族苗族自治州,42
-422801,恩施市,4228
-422802,利川市,4228
-422822,建始县,4228
-422823,巴东县,4228
-422825,宣恩县,4228
-422826,咸丰县,4228
-422827,来凤县,4228
-422828,鹤峰县,4228
-429004,仙桃市,42
-429005,潜江市,42
-429006,天门市,42
-429021,神农架林区,42
-43,湖南省,
-4301,长沙市,43
-430102,芙蓉区,4301
-430103,天心区,4301
-430104,岳麓区,4301
-430105,开福区,4301
-430111,雨花区,4301
-430112,望城区,4301
-430121,长沙县,4301
-430181,浏阳市,4301
-430182,宁乡市,4301
-4302,株洲市,43
-430202,荷塘区,4302
-430203,芦淞区,4302
-430204,石峰区,4302
-430211,天元区,4302
-430212,渌口区,4302
-430223,攸县,4302
-430224,茶陵县,4302
-430225,炎陵县,4302
-430281,醴陵市,4302
-4303,湘潭市,43
-430302,雨湖区,4303
-430304,岳塘区,4303
-430321,湘潭县,4303
-430381,湘乡市,4303
-430382,韶山市,4303
-4304,衡阳市,43
-430405,珠晖区,4304
-430406,雁峰区,4304
-430407,石鼓区,4304
-430408,蒸湘区,4304
-430412,南岳区,4304
-430421,衡阳县,4304
-430422,衡南县,4304
-430423,衡山县,4304
-430424,衡东县,4304
-430426,祁东县,4304
-430481,耒阳市,4304
-430482,常宁市,4304
-4305,邵阳市,43
-430502,双清区,4305
-430503,大祥区,4305
-430511,北塔区,4305
-430521,邵东县,4305
-430522,新邵县,4305
-430523,邵阳县,4305
-430524,隆回县,4305
-430525,洞口县,4305
-430527,绥宁县,4305
-430528,新宁县,4305
-430529,城步苗族自治县,4305
-430581,武冈市,4305
-4306,岳阳市,43
-430602,岳阳楼区,4306
-430603,云溪区,4306
-430611,君山区,4306
-430621,岳阳县,4306
-430623,华容县,4306
-430624,湘阴县,4306
-430626,平江县,4306
-430681,汨罗市,4306
-430682,临湘市,4306
-4307,常德市,43
-430702,武陵区,4307
-430703,鼎城区,4307
-430721,安乡县,4307
-430722,汉寿县,4307
-430723,澧县,4307
-430724,临澧县,4307
-430725,桃源县,4307
-430726,石门县,4307
-430781,津市市,4307
-4308,张家界市,43
-430802,永定区,4308
-430811,武陵源区,4308
-430821,慈利县,4308
-430822,桑植县,4308
-4309,益阳市,43
-430902,资阳区,4309
-430903,赫山区,4309
-430921,南县,4309
-430922,桃江县,4309
-430923,安化县,4309
-430981,沅江市,4309
-4310,郴州市,43
-431002,北湖区,4310
-431003,苏仙区,4310
-431021,桂阳县,4310
-431022,宜章县,4310
-431023,永兴县,4310
-431024,嘉禾县,4310
-431025,临武县,4310
-431026,汝城县,4310
-431027,桂东县,4310
-431028,安仁县,4310
-431081,资兴市,4310
-4311,永州市,43
-431102,零陵区,4311
-431103,冷水滩区,4311
-431121,祁阳县,4311
-431122,东安县,4311
-431123,双牌县,4311
-431124,道县,4311
-431125,江永县,4311
-431126,宁远县,4311
-431127,蓝山县,4311
-431128,新田县,4311
-431129,江华瑶族自治县,4311
-4312,怀化市,43
-431202,鹤城区,4312
-431221,中方县,4312
-431222,沅陵县,4312
-431223,辰溪县,4312
-431224,溆浦县,4312
-431225,会同县,4312
-431226,麻阳苗族自治县,4312
-431227,新晃侗族自治县,4312
-431228,芷江侗族自治县,4312
-431229,靖州苗族侗族自治县,4312
-431230,通道侗族自治县,4312
-431281,洪江市,4312
-4313,娄底市,43
-431302,娄星区,4313
-431321,双峰县,4313
-431322,新化县,4313
-431381,冷水江市,4313
-431382,涟源市,4313
-4331,湘西土家族苗族自治州,43
-433101,吉首市,4331
-433122,泸溪县,4331
-433123,凤凰县,4331
-433124,花垣县,4331
-433125,保靖县,4331
-433126,古丈县,4331
-433127,永顺县,4331
-433130,龙山县,4331
-44,广东省,
-4401,广州市,44
-440103,荔湾区,4401
-440104,越秀区,4401
-440105,海珠区,4401
-440106,天河区,4401
-440111,白云区,4401
-440112,黄埔区,4401
-440113,番禺区,4401
-440114,花都区,4401
-440115,南沙区,4401
-440117,从化区,4401
-440118,增城区,4401
-4402,韶关市,44
-440203,武江区,4402
-440204,浈江区,4402
-440205,曲江区,4402
-440222,始兴县,4402
-440224,仁化县,4402
-440229,翁源县,4402
-440232,乳源瑶族自治县,4402
-440233,新丰县,4402
-440281,乐昌市,4402
-440282,南雄市,4402
-4403,深圳市,44
-440303,罗湖区,4403
-440304,福田区,4403
-440305,南山区,4403
-440306,宝安区,4403
-440307,龙岗区,4403
-440308,盐田区,4403
-440309,龙华区,4403
-440310,坪山区,4403
-440311,光明区,4403
-4404,珠海市,44
-440402,香洲区,4404
-440403,斗门区,4404
-440404,金湾区,4404
-4405,汕头市,44
-440507,龙湖区,4405
-440511,金平区,4405
-440512,濠江区,4405
-440513,潮阳区,4405
-440514,潮南区,4405
-440515,澄海区,4405
-440523,南澳县,4405
-4406,佛山市,44
-440604,禅城区,4406
-440605,南海区,4406
-440606,顺德区,4406
-440607,三水区,4406
-440608,高明区,4406
-4407,江门市,44
-440703,蓬江区,4407
-440704,江海区,4407
-440705,新会区,4407
-440781,台山市,4407
-440783,开平市,4407
-440784,鹤山市,4407
-440785,恩平市,4407
-4408,湛江市,44
-440802,赤坎区,4408
-440803,霞山区,4408
-440804,坡头区,4408
-440811,麻章区,4408
-440823,遂溪县,4408
-440825,徐闻县,4408
-440881,廉江市,4408
-440882,雷州市,4408
-440883,吴川市,4408
-4409,茂名市,44
-440902,茂南区,4409
-440904,电白区,4409
-440981,高州市,4409
-440982,化州市,4409
-440983,信宜市,4409
-4412,肇庆市,44
-441202,端州区,4412
-441203,鼎湖区,4412
-441204,高要区,4412
-441223,广宁县,4412
-441224,怀集县,4412
-441225,封开县,4412
-441226,德庆县,4412
-441284,四会市,4412
-4413,惠州市,44
-441302,惠城区,4413
-441303,惠阳区,4413
-441322,博罗县,4413
-441323,惠东县,4413
-441324,龙门县,4413
-4414,梅州市,44
-441402,梅江区,4414
-441403,梅县区,4414
-441422,大埔县,4414
-441423,丰顺县,4414
-441424,五华县,4414
-441426,平远县,4414
-441427,蕉岭县,4414
-441481,兴宁市,4414
-4415,汕尾市,44
-441502,城区,4415
-441521,海丰县,4415
-441523,陆河县,4415
-441581,陆丰市,4415
-4416,河源市,44
-441602,源城区,4416
-441621,紫金县,4416
-441622,龙川县,4416
-441623,连平县,4416
-441624,和平县,4416
-441625,东源县,4416
-4417,阳江市,44
-441702,江城区,4417
-441704,阳东区,4417
-441721,阳西县,4417
-441781,阳春市,4417
-4418,清远市,44
-441802,清城区,4418
-441803,清新区,4418
-441821,佛冈县,4418
-441823,阳山县,4418
-441825,连山壮族瑶族自治县,4418
-441826,连南瑶族自治县,4418
-441881,英德市,4418
-441882,连州市,4418
-4419,东莞市,44
-4420,中山市,44
-4451,潮州市,44
-445102,湘桥区,4451
-445103,潮安区,4451
-445122,饶平县,4451
-4452,揭阳市,44
-445202,榕城区,4452
-445203,揭东区,4452
-445222,揭西县,4452
-445224,惠来县,4452
-445281,普宁市,4452
-4453,云浮市,44
-445302,云城区,4453
-445303,云安区,4453
-445321,新兴县,4453
-445322,郁南县,4453
-445381,罗定市,4453
-45,广西壮族自治区,
-4501,南宁市,45
-450102,兴宁区,4501
-450103,青秀区,4501
-450105,江南区,4501
-450107,西乡塘区,4501
-450108,良庆区,4501
-450109,邕宁区,4501
-450110,武鸣区,4501
-450123,隆安县,4501
-450124,马山县,4501
-450125,上林县,4501
-450126,宾阳县,4501
-450127,横县,4501
-4502,柳州市,45
-450202,城中区,4502
-450203,鱼峰区,4502
-450204,柳南区,4502
-450205,柳北区,4502
-450206,柳江区,4502
-450222,柳城县,4502
-450223,鹿寨县,4502
-450224,融安县,4502
-450225,融水苗族自治县,4502
-450226,三江侗族自治县,4502
-4503,桂林市,45
-450302,秀峰区,4503
-450303,叠彩区,4503
-450304,象山区,4503
-450305,七星区,4503
-450311,雁山区,4503
-450312,临桂区,4503
-450321,阳朔县,4503
-450323,灵川县,4503
-450324,全州县,4503
-450325,兴安县,4503
-450326,永福县,4503
-450327,灌阳县,4503
-450328,龙胜各族自治县,4503
-450329,资源县,4503
-450330,平乐县,4503
-450332,恭城瑶族自治县,4503
-450381,荔浦市,4503
-4504,梧州市,45
-450403,万秀区,4504
-450405,长洲区,4504
-450406,龙圩区,4504
-450421,苍梧县,4504
-450422,藤县,4504
-450423,蒙山县,4504
-450481,岑溪市,4504
-4505,北海市,45
-450502,海城区,4505
-450503,银海区,4505
-450512,铁山港区,4505
-450521,合浦县,4505
-4506,防城港市,45
-450602,港口区,4506
-450603,防城区,4506
-450621,上思县,4506
-450681,东兴市,4506
-4507,钦州市,45
-450702,钦南区,4507
-450703,钦北区,4507
-450721,灵山县,4507
-450722,浦北县,4507
-4508,贵港市,45
-450802,港北区,4508
-450803,港南区,4508
-450804,覃塘区,4508
-450821,平南县,4508
-450881,桂平市,4508
-4509,玉林市,45
-450902,玉州区,4509
-450903,福绵区,4509
-450921,容县,4509
-450922,陆川县,4509
-450923,博白县,4509
-450924,兴业县,4509
-450981,北流市,4509
-4510,百色市,45
-451002,右江区,4510
-451021,田阳县,4510
-451022,田东县,4510
-451023,平果县,4510
-451024,德保县,4510
-451026,那坡县,4510
-451027,凌云县,4510
-451028,乐业县,4510
-451029,田林县,4510
-451030,西林县,4510
-451031,隆林各族自治县,4510
-451081,靖西市,4510
-4511,贺州市,45
-451102,八步区,4511
-451103,平桂区,4511
-451121,昭平县,4511
-451122,钟山县,4511
-451123,富川瑶族自治县,4511
-4512,河池市,45
-451202,金城江区,4512
-451203,宜州区,4512
-451221,南丹县,4512
-451222,天峨县,4512
-451223,凤山县,4512
-451224,东兰县,4512
-451225,罗城仫佬族自治县,4512
-451226,环江毛南族自治县,4512
-451227,巴马瑶族自治县,4512
-451228,都安瑶族自治县,4512
-451229,大化瑶族自治县,4512
-4513,来宾市,45
-451302,兴宾区,4513
-451321,忻城县,4513
-451322,象州县,4513
-451323,武宣县,4513
-451324,金秀瑶族自治县,4513
-451381,合山市,4513
-4514,崇左市,45
-451402,江州区,4514
-451421,扶绥县,4514
-451422,宁明县,4514
-451423,龙州县,4514
-451424,大新县,4514
-451425,天等县,4514
-451481,凭祥市,4514
-46,海南省,
-4601,海口市,46
-460105,秀英区,4601
-460106,龙华区,4601
-460107,琼山区,4601
-460108,美兰区,4601
-4602,三亚市,46
-460202,海棠区,4602
-460203,吉阳区,4602
-460204,天涯区,4602
-460205,崖州区,4602
-4603,三沙市,46
-4604,儋州市,46
-469001,五指山市,46
-469002,琼海市,46
-469005,文昌市,46
-469006,万宁市,46
-469007,东方市,46
-469021,定安县,46
-469022,屯昌县,46
-469023,澄迈县,46
-469024,临高县,46
-469025,白沙黎族自治县,46
-469026,昌江黎族自治县,46
-469027,乐东黎族自治县,46
-469028,陵水黎族自治县,46
-469029,保亭黎族苗族自治县,46
-469030,琼中黎族苗族自治县,46
-50,重庆市,
-5001,市辖区,50
-500101,万州区,5001
-500102,涪陵区,5001
-500103,渝中区,5001
-500104,大渡口区,5001
-500105,江北区,5001
-500106,沙坪坝区,5001
-500107,九龙坡区,5001
-500108,南岸区,5001
-500109,北碚区,5001
-500110,綦江区,5001
-500111,大足区,5001
-500112,渝北区,5001
-500113,巴南区,5001
-500114,黔江区,5001
-500115,长寿区,5001
-500116,江津区,5001
-500117,合川区,5001
-500118,永川区,5001
-500119,南川区,5001
-500120,璧山区,5001
-500151,铜梁区,5001
-500152,潼南区,5001
-500153,荣昌区,5001
-500154,开州区,5001
-500155,梁平区,5001
-500156,武隆区,5001
-500229,城口县,5001
-500230,丰都县,5001
-500231,垫江县,5001
-500233,忠县,5001
-500235,云阳县,5001
-500236,奉节县,5001
-500237,巫山县,5001
-500238,巫溪县,5001
-500240,石柱土家族自治县,5001
-500241,秀山土家族苗族自治县,5001
-500242,酉阳土家族苗族自治县,5001
-500243,彭水苗族土家族自治县,5001
-51,四川省,
-5101,成都市,51
-510104,锦江区,5101
-510105,青羊区,5101
-510106,金牛区,5101
-510107,武侯区,5101
-510108,成华区,5101
-510112,龙泉驿区,5101
-510113,青白江区,5101
-510114,新都区,5101
-510115,温江区,5101
-510116,双流区,5101
-510117,郫都区,5101
-510121,金堂县,5101
-510129,大邑县,5101
-510131,蒲江县,5101
-510132,新津县,5101
-510181,都江堰市,5101
-510182,彭州市,5101
-510183,邛崃市,5101
-510184,崇州市,5101
-510185,简阳市,5101
-5103,自贡市,51
-510302,自流井区,5103
-510303,贡井区,5103
-510304,大安区,5103
-510311,沿滩区,5103
-510321,荣县,5103
-510322,富顺县,5103
-5104,攀枝花市,51
-510402,东区,5104
-510403,西区,5104
-510411,仁和区,5104
-510421,米易县,5104
-510422,盐边县,5104
-5105,泸州市,51
-510502,江阳区,5105
-510503,纳溪区,5105
-510504,龙马潭区,5105
-510521,泸县,5105
-510522,合江县,5105
-510524,叙永县,5105
-510525,古蔺县,5105
-5106,德阳市,51
-510603,旌阳区,5106
-510604,罗江区,5106
-510623,中江县,5106
-510681,广汉市,5106
-510682,什邡市,5106
-510683,绵竹市,5106
-5107,绵阳市,51
-510703,涪城区,5107
-510704,游仙区,5107
-510705,安州区,5107
-510722,三台县,5107
-510723,盐亭县,5107
-510725,梓潼县,5107
-510726,北川羌族自治县,5107
-510727,平武县,5107
-510781,江油市,5107
-5108,广元市,51
-510802,利州区,5108
-510811,昭化区,5108
-510812,朝天区,5108
-510821,旺苍县,5108
-510822,青川县,5108
-510823,剑阁县,5108
-510824,苍溪县,5108
-5109,遂宁市,51
-510903,船山区,5109
-510904,安居区,5109
-510921,蓬溪县,5109
-510922,射洪县,5109
-510923,大英县,5109
-5110,内江市,51
-511002,市中区,5110
-511011,东兴区,5110
-511024,威远县,5110
-511025,资中县,5110
-511083,隆昌市,5110
-5111,乐山市,51
-511102,市中区,5111
-511111,沙湾区,5111
-511112,五通桥区,5111
-511113,金口河区,5111
-511123,犍为县,5111
-511124,井研县,5111
-511126,夹江县,5111
-511129,沐川县,5111
-511132,峨边彝族自治县,5111
-511133,马边彝族自治县,5111
-511181,峨眉山市,5111
-5113,南充市,51
-511302,顺庆区,5113
-511303,高坪区,5113
-511304,嘉陵区,5113
-511321,南部县,5113
-511322,营山县,5113
-511323,蓬安县,5113
-511324,仪陇县,5113
-511325,西充县,5113
-511381,阆中市,5113
-5114,眉山市,51
-511402,东坡区,5114
-511403,彭山区,5114
-511421,仁寿县,5114
-511423,洪雅县,5114
-511424,丹棱县,5114
-511425,青神县,5114
-5115,宜宾市,51
-511502,翠屏区,5115
-511503,南溪区,5115
-511504,叙州区,5115
-511523,江安县,5115
-511524,长宁县,5115
-511525,高县,5115
-511526,珙县,5115
-511527,筠连县,5115
-511528,兴文县,5115
-511529,屏山县,5115
-5116,广安市,51
-511602,广安区,5116
-511603,前锋区,5116
-511621,岳池县,5116
-511622,武胜县,5116
-511623,邻水县,5116
-511681,华蓥市,5116
-5117,达州市,51
-511702,通川区,5117
-511703,达川区,5117
-511722,宣汉县,5117
-511723,开江县,5117
-511724,大竹县,5117
-511725,渠县,5117
-511781,万源市,5117
-5118,雅安市,51
-511802,雨城区,5118
-511803,名山区,5118
-511822,荥经县,5118
-511823,汉源县,5118
-511824,石棉县,5118
-511825,天全县,5118
-511826,芦山县,5118
-511827,宝兴县,5118
-5119,巴中市,51
-511902,巴州区,5119
-511903,恩阳区,5119
-511921,通江县,5119
-511922,南江县,5119
-511923,平昌县,5119
-5120,资阳市,51
-512002,雁江区,5120
-512021,安岳县,5120
-512022,乐至县,5120
-5132,阿坝藏族羌族自治州,51
-513201,马尔康市,5132
-513221,汶川县,5132
-513222,理县,5132
-513223,茂县,5132
-513224,松潘县,5132
-513225,九寨沟县,5132
-513226,金川县,5132
-513227,小金县,5132
-513228,黑水县,5132
-513230,壤塘县,5132
-513231,阿坝县,5132
-513232,若尔盖县,5132
-513233,红原县,5132
-5133,甘孜藏族自治州,51
-513301,康定市,5133
-513322,泸定县,5133
-513323,丹巴县,5133
-513324,九龙县,5133
-513325,雅江县,5133
-513326,道孚县,5133
-513327,炉霍县,5133
-513328,甘孜县,5133
-513329,新龙县,5133
-513330,德格县,5133
-513331,白玉县,5133
-513332,石渠县,5133
-513333,色达县,5133
-513334,理塘县,5133
-513335,巴塘县,5133
-513336,乡城县,5133
-513337,稻城县,5133
-513338,得荣县,5133
-5134,凉山彝族自治州,51
-513401,西昌市,5134
-513422,木里藏族自治县,5134
-513423,盐源县,5134
-513424,德昌县,5134
-513425,会理县,5134
-513426,会东县,5134
-513427,宁南县,5134
-513428,普格县,5134
-513429,布拖县,5134
-513430,金阳县,5134
-513431,昭觉县,5134
-513432,喜德县,5134
-513433,冕宁县,5134
-513434,越西县,5134
-513435,甘洛县,5134
-513436,美姑县,5134
-513437,雷波县,5134
-52,贵州省,
-5201,贵阳市,52
-520102,南明区,5201
-520103,云岩区,5201
-520111,花溪区,5201
-520112,乌当区,5201
-520113,白云区,5201
-520115,观山湖区,5201
-520121,开阳县,5201
-520122,息烽县,5201
-520123,修文县,5201
-520181,清镇市,5201
-5202,六盘水市,52
-520201,钟山区,5202
-520203,六枝特区,5202
-520221,水城县,5202
-520281,盘州市,5202
-5203,遵义市,52
-520302,红花岗区,5203
-520303,汇川区,5203
-520304,播州区,5203
-520322,桐梓县,5203
-520323,绥阳县,5203
-520324,正安县,5203
-520325,道真仡佬族苗族自治县,5203
-520326,务川仡佬族苗族自治县,5203
-520327,凤冈县,5203
-520328,湄潭县,5203
-520329,余庆县,5203
-520330,习水县,5203
-520381,赤水市,5203
-520382,仁怀市,5203
-5204,安顺市,52
-520402,西秀区,5204
-520403,平坝区,5204
-520422,普定县,5204
-520423,镇宁布依族苗族自治县,5204
-520424,关岭布依族苗族自治县,5204
-520425,紫云苗族布依族自治县,5204
-5205,毕节市,52
-520502,七星关区,5205
-520521,大方县,5205
-520522,黔西县,5205
-520523,金沙县,5205
-520524,织金县,5205
-520525,纳雍县,5205
-520526,威宁彝族回族苗族自治县,5205
-520527,赫章县,5205
-5206,铜仁市,52
-520602,碧江区,5206
-520603,万山区,5206
-520621,江口县,5206
-520622,玉屏侗族自治县,5206
-520623,石阡县,5206
-520624,思南县,5206
-520625,印江土家族苗族自治县,5206
-520626,德江县,5206
-520627,沿河土家族自治县,5206
-520628,松桃苗族自治县,5206
-5223,黔西南布依族苗族自治州,52
-522301,兴义市,5223
-522302,兴仁市,5223
-522323,普安县,5223
-522324,晴隆县,5223
-522325,贞丰县,5223
-522326,望谟县,5223
-522327,册亨县,5223
-522328,安龙县,5223
-5226,黔东南苗族侗族自治州,52
-522601,凯里市,5226
-522622,黄平县,5226
-522623,施秉县,5226
-522624,三穗县,5226
-522625,镇远县,5226
-522626,岑巩县,5226
-522627,天柱县,5226
-522628,锦屏县,5226
-522629,剑河县,5226
-522630,台江县,5226
-522631,黎平县,5226
-522632,榕江县,5226
-522633,从江县,5226
-522634,雷山县,5226
-522635,麻江县,5226
-522636,丹寨县,5226
-5227,黔南布依族苗族自治州,52
-522701,都匀市,5227
-522702,福泉市,5227
-522722,荔波县,5227
-522723,贵定县,5227
-522725,瓮安县,5227
-522726,独山县,5227
-522727,平塘县,5227
-522728,罗甸县,5227
-522729,长顺县,5227
-522730,龙里县,5227
-522731,惠水县,5227
-522732,三都水族自治县,5227
-53,云南省,
-5301,昆明市,53
-530102,五华区,5301
-530103,盘龙区,5301
-530111,官渡区,5301
-530112,西山区,5301
-530113,东川区,5301
-530114,呈贡区,5301
-530115,晋宁区,5301
-530124,富民县,5301
-530125,宜良县,5301
-530126,石林彝族自治县,5301
-530127,嵩明县,5301
-530128,禄劝彝族苗族自治县,5301
-530129,寻甸回族彝族自治县,5301
-530181,安宁市,5301
-5303,曲靖市,53
-530302,麒麟区,5303
-530303,沾益区,5303
-530304,马龙区,5303
-530322,陆良县,5303
-530323,师宗县,5303
-530324,罗平县,5303
-530325,富源县,5303
-530326,会泽县,5303
-530381,宣威市,5303
-5304,玉溪市,53
-530402,红塔区,5304
-530403,江川区,5304
-530422,澄江县,5304
-530423,通海县,5304
-530424,华宁县,5304
-530425,易门县,5304
-530426,峨山彝族自治县,5304
-530427,新平彝族傣族自治县,5304
-530428,元江哈尼族彝族傣族自治县,5304
-5305,保山市,53
-530502,隆阳区,5305
-530521,施甸县,5305
-530523,龙陵县,5305
-530524,昌宁县,5305
-530581,腾冲市,5305
-5306,昭通市,53
-530602,昭阳区,5306
-530621,鲁甸县,5306
-530622,巧家县,5306
-530623,盐津县,5306
-530624,大关县,5306
-530625,永善县,5306
-530626,绥江县,5306
-530627,镇雄县,5306
-530628,彝良县,5306
-530629,威信县,5306
-530681,水富市,5306
-5307,丽江市,53
-530702,古城区,5307
-530721,玉龙纳西族自治县,5307
-530722,永胜县,5307
-530723,华坪县,5307
-530724,宁蒗彝族自治县,5307
-5308,普洱市,53
-530802,思茅区,5308
-530821,宁洱哈尼族彝族自治县,5308
-530822,墨江哈尼族自治县,5308
-530823,景东彝族自治县,5308
-530824,景谷傣族彝族自治县,5308
-530825,镇沅彝族哈尼族拉祜族自治县,5308
-530826,江城哈尼族彝族自治县,5308
-530827,孟连傣族拉祜族佤族自治县,5308
-530828,澜沧拉祜族自治县,5308
-530829,西盟佤族自治县,5308
-5309,临沧市,53
-530902,临翔区,5309
-530921,凤庆县,5309
-530922,云县,5309
-530923,永德县,5309
-530924,镇康县,5309
-530925,双江拉祜族佤族布朗族傣族自治县,5309
-530926,耿马傣族佤族自治县,5309
-530927,沧源佤族自治县,5309
-5323,楚雄彝族自治州,53
-532301,楚雄市,5323
-532322,双柏县,5323
-532323,牟定县,5323
-532324,南华县,5323
-532325,姚安县,5323
-532326,大姚县,5323
-532327,永仁县,5323
-532328,元谋县,5323
-532329,武定县,5323
-532331,禄丰县,5323
-5325,红河哈尼族彝族自治州,53
-532501,个旧市,5325
-532502,开远市,5325
-532503,蒙自市,5325
-532504,弥勒市,5325
-532523,屏边苗族自治县,5325
-532524,建水县,5325
-532525,石屏县,5325
-532527,泸西县,5325
-532528,元阳县,5325
-532529,红河县,5325
-532530,金平苗族瑶族傣族自治县,5325
-532531,绿春县,5325
-532532,河口瑶族自治县,5325
-5326,文山壮族苗族自治州,53
-532601,文山市,5326
-532622,砚山县,5326
-532623,西畴县,5326
-532624,麻栗坡县,5326
-532625,马关县,5326
-532626,丘北县,5326
-532627,广南县,5326
-532628,富宁县,5326
-5328,西双版纳傣族自治州,53
-532801,景洪市,5328
-532822,勐海县,5328
-532823,勐腊县,5328
-5329,大理白族自治州,53
-532901,大理市,5329
-532922,漾濞彝族自治县,5329
-532923,祥云县,5329
-532924,宾川县,5329
-532925,弥渡县,5329
-532926,南涧彝族自治县,5329
-532927,巍山彝族回族自治县,5329
-532928,永平县,5329
-532929,云龙县,5329
-532930,洱源县,5329
-532931,剑川县,5329
-532932,鹤庆县,5329
-5331,德宏傣族景颇族自治州,53
-533102,瑞丽市,5331
-533103,芒市,5331
-533122,梁河县,5331
-533123,盈江县,5331
-533124,陇川县,5331
-5333,怒江傈僳族自治州,53
-533301,泸水市,5333
-533323,福贡县,5333
-533324,贡山独龙族怒族自治县,5333
-533325,兰坪白族普米族自治县,5333
-5334,迪庆藏族自治州,53
-533401,香格里拉市,5334
-533422,德钦县,5334
-533423,维西傈僳族自治县,5334
-54,西藏自治区,
-5401,拉萨市,54
-540102,城关区,5401
-540103,堆龙德庆区,5401
-540104,达孜区,5401
-540121,林周县,5401
-540122,当雄县,5401
-540123,尼木县,5401
-540124,曲水县,5401
-540127,墨竹工卡县,5401
-5402,日喀则市,54
-540202,桑珠孜区,5402
-540221,南木林县,5402
-540222,江孜县,5402
-540223,定日县,5402
-540224,萨迦县,5402
-540225,拉孜县,5402
-540226,昂仁县,5402
-540227,谢通门县,5402
-540228,白朗县,5402
-540229,仁布县,5402
-540230,康马县,5402
-540231,定结县,5402
-540232,仲巴县,5402
-540233,亚东县,5402
-540234,吉隆县,5402
-540235,聂拉木县,5402
-540236,萨嘎县,5402
-540237,岗巴县,5402
-5403,昌都市,54
-540302,卡若区,5403
-540321,江达县,5403
-540322,贡觉县,5403
-540323,类乌齐县,5403
-540324,丁青县,5403
-540325,察雅县,5403
-540326,八宿县,5403
-540327,左贡县,5403
-540328,芒康县,5403
-540329,洛隆县,5403
-540330,边坝县,5403
-5404,林芝市,54
-540402,巴宜区,5404
-540421,工布江达县,5404
-540422,米林县,5404
-540423,墨脱县,5404
-540424,波密县,5404
-540425,察隅县,5404
-540426,朗县,5404
-5405,山南市,54
-540502,乃东区,5405
-540521,扎囊县,5405
-540522,贡嘎县,5405
-540523,桑日县,5405
-540524,琼结县,5405
-540525,曲松县,5405
-540526,措美县,5405
-540527,洛扎县,5405
-540528,加查县,5405
-540529,隆子县,5405
-540530,错那县,5405
-540531,浪卡子县,5405
-5406,那曲市,54
-540602,色尼区,5406
-540621,嘉黎县,5406
-540622,比如县,5406
-540623,聂荣县,5406
-540624,安多县,5406
-540625,申扎县,5406
-540626,索县,5406
-540627,班戈县,5406
-540628,巴青县,5406
-540629,尼玛县,5406
-540630,双湖县,5406
-5425,阿里地区,54
-542521,普兰县,5425
-542522,札达县,5425
-542523,噶尔县,5425
-542524,日土县,5425
-542525,革吉县,5425
-542526,改则县,5425
-542527,措勤县,5425
-61,陕西省,
-6101,西安市,61
-610102,新城区,6101
-610103,碑林区,6101
-610104,莲湖区,6101
-610111,灞桥区,6101
-610112,未央区,6101
-610113,雁塔区,6101
-610114,阎良区,6101
-610115,临潼区,6101
-610116,长安区,6101
-610117,高陵区,6101
-610118,鄠邑区,6101
-610122,蓝田县,6101
-610124,周至县,6101
-6102,铜川市,61
-610202,王益区,6102
-610203,印台区,6102
-610204,耀州区,6102
-610222,宜君县,6102
-6103,宝鸡市,61
-610302,渭滨区,6103
-610303,金台区,6103
-610304,陈仓区,6103
-610322,凤翔县,6103
-610323,岐山县,6103
-610324,扶风县,6103
-610326,眉县,6103
-610327,陇县,6103
-610328,千阳县,6103
-610329,麟游县,6103
-610330,凤县,6103
-610331,太白县,6103
-6104,咸阳市,61
-610402,秦都区,6104
-610403,杨陵区,6104
-610404,渭城区,6104
-610422,三原县,6104
-610423,泾阳县,6104
-610424,乾县,6104
-610425,礼泉县,6104
-610426,永寿县,6104
-610428,长武县,6104
-610429,旬邑县,6104
-610430,淳化县,6104
-610431,武功县,6104
-610481,兴平市,6104
-610482,彬州市,6104
-6105,渭南市,61
-610502,临渭区,6105
-610503,华州区,6105
-610522,潼关县,6105
-610523,大荔县,6105
-610524,合阳县,6105
-610525,澄城县,6105
-610526,蒲城县,6105
-610527,白水县,6105
-610528,富平县,6105
-610581,韩城市,6105
-610582,华阴市,6105
-6106,延安市,61
-610602,宝塔区,6106
-610603,安塞区,6106
-610621,延长县,6106
-610622,延川县,6106
-610623,子长县,6106
-610625,志丹县,6106
-610626,吴起县,6106
-610627,甘泉县,6106
-610628,富县,6106
-610629,洛川县,6106
-610630,宜川县,6106
-610631,黄龙县,6106
-610632,黄陵县,6106
-6107,汉中市,61
-610702,汉台区,6107
-610703,南郑区,6107
-610722,城固县,6107
-610723,洋县,6107
-610724,西乡县,6107
-610725,勉县,6107
-610726,宁强县,6107
-610727,略阳县,6107
-610728,镇巴县,6107
-610729,留坝县,6107
-610730,佛坪县,6107
-6108,榆林市,61
-610802,榆阳区,6108
-610803,横山区,6108
-610822,府谷县,6108
-610824,靖边县,6108
-610825,定边县,6108
-610826,绥德县,6108
-610827,米脂县,6108
-610828,佳县,6108
-610829,吴堡县,6108
-610830,清涧县,6108
-610831,子洲县,6108
-610881,神木市,6108
-6109,安康市,61
-610902,汉滨区,6109
-610921,汉阴县,6109
-610922,石泉县,6109
-610923,宁陕县,6109
-610924,紫阳县,6109
-610925,岚皋县,6109
-610926,平利县,6109
-610927,镇坪县,6109
-610928,旬阳县,6109
-610929,白河县,6109
-6110,商洛市,61
-611002,商州区,6110
-611021,洛南县,6110
-611022,丹凤县,6110
-611023,商南县,6110
-611024,山阳县,6110
-611025,镇安县,6110
-611026,柞水县,6110
-62,甘肃省,
-6201,兰州市,62
-620102,城关区,6201
-620103,七里河区,6201
-620104,西固区,6201
-620105,安宁区,6201
-620111,红古区,6201
-620121,永登县,6201
-620122,皋兰县,6201
-620123,榆中县,6201
-6202,嘉峪关市,62
-6203,金昌市,62
-620302,金川区,6203
-620321,永昌县,6203
-6204,白银市,62
-620402,白银区,6204
-620403,平川区,6204
-620421,靖远县,6204
-620422,会宁县,6204
-620423,景泰县,6204
-6205,天水市,62
-620502,秦州区,6205
-620503,麦积区,6205
-620521,清水县,6205
-620522,秦安县,6205
-620523,甘谷县,6205
-620524,武山县,6205
-620525,张家川回族自治县,6205
-6206,武威市,62
-620602,凉州区,6206
-620621,民勤县,6206
-620622,古浪县,6206
-620623,天祝藏族自治县,6206
-6207,张掖市,62
-620702,甘州区,6207
-620721,肃南裕固族自治县,6207
-620722,民乐县,6207
-620723,临泽县,6207
-620724,高台县,6207
-620725,山丹县,6207
-6208,平凉市,62
-620802,崆峒区,6208
-620821,泾川县,6208
-620822,灵台县,6208
-620823,崇信县,6208
-620825,庄浪县,6208
-620826,静宁县,6208
-620881,华亭市,6208
-6209,酒泉市,62
-620902,肃州区,6209
-620921,金塔县,6209
-620922,瓜州县,6209
-620923,肃北蒙古族自治县,6209
-620924,阿克塞哈萨克族自治县,6209
-620981,玉门市,6209
-620982,敦煌市,6209
-6210,庆阳市,62
-621002,西峰区,6210
-621021,庆城县,6210
-621022,环县,6210
-621023,华池县,6210
-621024,合水县,6210
-621025,正宁县,6210
-621026,宁县,6210
-621027,镇原县,6210
-6211,定西市,62
-621102,安定区,6211
-621121,通渭县,6211
-621122,陇西县,6211
-621123,渭源县,6211
-621124,临洮县,6211
-621125,漳县,6211
-621126,岷县,6211
-6212,陇南市,62
-621202,武都区,6212
-621221,成县,6212
-621222,文县,6212
-621223,宕昌县,6212
-621224,康县,6212
-621225,西和县,6212
-621226,礼县,6212
-621227,徽县,6212
-621228,两当县,6212
-6229,临夏回族自治州,62
-622901,临夏市,6229
-622921,临夏县,6229
-622922,康乐县,6229
-622923,永靖县,6229
-622924,广河县,6229
-622925,和政县,6229
-622926,东乡族自治县,6229
-622927,积石山保安族东乡族撒拉族自治县,6229
-6230,甘南藏族自治州,62
-623001,合作市,6230
-623021,临潭县,6230
-623022,卓尼县,6230
-623023,舟曲县,6230
-623024,迭部县,6230
-623025,玛曲县,6230
-623026,碌曲县,6230
-623027,夏河县,6230
-63,青海省,
-6301,西宁市,63
-630102,城东区,6301
-630103,城中区,6301
-630104,城西区,6301
-630105,城北区,6301
-630121,大通回族土族自治县,6301
-630122,湟中县,6301
-630123,湟源县,6301
-6302,海东市,63
-630202,乐都区,6302
-630203,平安区,6302
-630222,民和回族土族自治县,6302
-630223,互助土族自治县,6302
-630224,化隆回族自治县,6302
-630225,循化撒拉族自治县,6302
-6322,海北藏族自治州,63
-632221,门源回族自治县,6322
-632222,祁连县,6322
-632223,海晏县,6322
-632224,刚察县,6322
-6323,黄南藏族自治州,63
-632321,同仁县,6323
-632322,尖扎县,6323
-632323,泽库县,6323
-632324,河南蒙古族自治县,6323
-6325,海南藏族自治州,63
-632521,共和县,6325
-632522,同德县,6325
-632523,贵德县,6325
-632524,兴海县,6325
-632525,贵南县,6325
-6326,果洛藏族自治州,63
-632621,玛沁县,6326
-632622,班玛县,6326
-632623,甘德县,6326
-632624,达日县,6326
-632625,久治县,6326
-632626,玛多县,6326
-6327,玉树藏族自治州,63
-632701,玉树市,6327
-632722,杂多县,6327
-632723,称多县,6327
-632724,治多县,6327
-632725,囊谦县,6327
-632726,曲麻莱县,6327
-6328,海西蒙古族藏族自治州,63
-632801,格尔木市,6328
-632802,德令哈市,6328
-632803,茫崖市,6328
-632821,乌兰县,6328
-632822,都兰县,6328
-632823,天峻县,6328
-64,宁夏回族自治区,
-6401,银川市,64
-640104,兴庆区,6401
-640105,西夏区,6401
-640106,金凤区,6401
-640121,永宁县,6401
-640122,贺兰县,6401
-640181,灵武市,6401
-6402,石嘴山市,64
-640202,大武口区,6402
-640205,惠农区,6402
-640221,平罗县,6402
-6403,吴忠市,64
-640302,利通区,6403
-640303,红寺堡区,6403
-640323,盐池县,6403
-640324,同心县,6403
-640381,青铜峡市,6403
-6404,固原市,64
-640402,原州区,6404
-640422,西吉县,6404
-640423,隆德县,6404
-640424,泾源县,6404
-640425,彭阳县,6404
-6405,中卫市,64
-640502,沙坡头区,6405
-640521,中宁县,6405
-640522,海原县,6405
-65,新疆维吾尔自治区,
-6501,乌鲁木齐市,65
-650102,天山区,6501
-650103,沙依巴克区,6501
-650104,新市区,6501
-650105,水磨沟区,6501
-650106,头屯河区,6501
-650107,达坂城区,6501
-650109,米东区,6501
-650121,乌鲁木齐县,6501
-6502,克拉玛依市,65
-650202,独山子区,6502
-650203,克拉玛依区,6502
-650204,白碱滩区,6502
-650205,乌尔禾区,6502
-6504,吐鲁番市,65
-650402,高昌区,6504
-650421,鄯善县,6504
-650422,托克逊县,6504
-6505,哈密市,65
-650502,伊州区,6505
-650521,巴里坤哈萨克自治县,6505
-650522,伊吾县,6505
-6523,昌吉回族自治州,65
-652301,昌吉市,6523
-652302,阜康市,6523
-652323,呼图壁县,6523
-652324,玛纳斯县,6523
-652325,奇台县,6523
-652327,吉木萨尔县,6523
-652328,木垒哈萨克自治县,6523
-6527,博尔塔拉蒙古自治州,65
-652701,博乐市,6527
-652702,阿拉山口市,6527
-652722,精河县,6527
-652723,温泉县,6527
-6528,巴音郭楞蒙古自治州,65
-652801,库尔勒市,6528
-652822,轮台县,6528
-652823,尉犁县,6528
-652824,若羌县,6528
-652825,且末县,6528
-652826,焉耆回族自治县,6528
-652827,和静县,6528
-652828,和硕县,6528
-652829,博湖县,6528
-6529,阿克苏地区,65
-652901,阿克苏市,6529
-652922,温宿县,6529
-652923,库车县,6529
-652924,沙雅县,6529
-652925,新和县,6529
-652926,拜城县,6529
-652927,乌什县,6529
-652928,阿瓦提县,6529
-652929,柯坪县,6529
-6530,克孜勒苏柯尔克孜自治州,65
-653001,阿图什市,6530
-653022,阿克陶县,6530
-653023,阿合奇县,6530
-653024,乌恰县,6530
-6531,喀什地区,65
-653101,喀什市,6531
-653121,疏附县,6531
-653122,疏勒县,6531
-653123,英吉沙县,6531
-653124,泽普县,6531
-653125,莎车县,6531
-653126,叶城县,6531
-653127,麦盖提县,6531
-653128,岳普湖县,6531
-653129,伽师县,6531
-653130,巴楚县,6531
-653131,塔什库尔干塔吉克自治县,6531
-6532,和田地区,65
-653201,和田市,6532
-653221,和田县,6532
-653222,墨玉县,6532
-653223,皮山县,6532
-653224,洛浦县,6532
-653225,策勒县,6532
-653226,于田县,6532
-653227,民丰县,6532
-6540,伊犁哈萨克自治州,65
-654002,伊宁市,6540
-654003,奎屯市,6540
-654004,霍尔果斯市,6540
-654021,伊宁县,6540
-654022,察布查尔锡伯自治县,6540
-654023,霍城县,6540
-654024,巩留县,6540
-654025,新源县,6540
-654026,昭苏县,6540
-654027,特克斯县,6540
-654028,尼勒克县,6540
-6542,塔城地区,65
-654201,塔城市,6542
-654202,乌苏市,6542
-654221,额敏县,6542
-654223,沙湾县,6542
-654224,托里县,6542
-654225,裕民县,6542
-654226,和布克赛尔蒙古自治县,6542
-6543,阿勒泰地区,65
-654301,阿勒泰市,6543
-654321,布尔津县,6543
-654322,富蕴县,6543
-654323,福海县,6543
-654324,哈巴河县,6543
-654325,青河县,6543
-654326,吉木乃县,6543
-659001,石河子市,65
-659002,阿拉尔市,65
-659003,图木舒克市,65
-659004,五家渠市,65
-659005,北屯市,65
-659006,铁门关市,65
-659007,双河市,65
-659008,可克达拉市,65
-659009,昆玉市,65
-71,台湾省,
-81,香港特别行政区,
-82,澳门特别行政区,
diff --git a/ard-modules/ard-modules-qs/src/main/resources/gb_dict.json b/ard-modules/ard-modules-qs/src/main/resources/gb_dict.json
deleted file mode 100644
index 3399fac..0000000
--- a/ard-modules/ard-modules-qs/src/main/resources/gb_dict.json
+++ /dev/null
@@ -1,439 +0,0 @@
-[
- {
- "id": "gender",
- "label": "性别",
- "data": {
- "0": "未知的性别",
- "1": "男性",
- "2": "女性",
- "9": "未说明的性别"
- }
- },
- {
- "id": "infoType",
- "label": "信息分类",
- "data": {
- "0": "其他",
- "1": "自动采集",
- "2": "人工采集"
- }
- },
- {
- "id": "DispositionCategoryType",
- "label": "布控类别",
- "data": {
- "1": "人",
- "2": "机动车",
- "3": "非机动车",
- "4": "关键字"
- }
- },
- {
- "id": "tollgateUsageType",
- "label": "卡口用途",
- "data": {
- "80": "治安卡口",
- "81": "交通卡口",
- "82": "其他"
- }
- },
- {
- "id": "tollgateCatType",
- "label": "卡口类型",
- "data": {
- "10": "国际",
- "20": "省际",
- "30": "市际",
- "31": "市区",
- "40": "县际",
- "41": "县区",
- "99": "其他"
- }
- },
- {
- "id": "isType",
- "label": "是否枚举",
- "data": {
- "0": "否",
- "1": "是",
- "2": "不确定"
- }
- },
- {
- "id": "imageType",
- "label": "图片类型",
- "data": {
- "01": "车辆大图",
- "02": "车牌彩色小图",
- "03": "车牌二值化图",
- "04": "驾驶员面部特征图",
- "05": "副驾驶面部特征图",
- "06": "车标",
- "07": "违章合成图",
- "08": "过车合成图",
- "09": "车辆特写图",
- "10": "人员图",
- "11": "人脸图",
- "12": "非机动车图",
- "13": "物品图",
- "14": "场景图",
- "100": "一般图片"
- }
- },
- {
- "id": "directionType",
- "label": "方向",
- "data": {
- "1": "西向东",
- "2": "东向西",
- "3": "北向南",
- "4": "南向北",
- "5": "西南到东北",
- "6": "东北到西南",
- "7": "西北到东南",
- "8": "东南到西北",
- "9": "其他"
- }
- },
- {
- "id": "color",
- "label": "颜色",
- "data": {
- "1": "黑色",
- "2": "白色",
- "3": "灰色",
- "4": "红色",
- "5": "蓝色",
- "6": "黄色",
- "7": "橙色",
- "8": "棕色",
- "9": "绿色",
- "10": "紫色",
- "11": "青色",
- "12": "粉色",
- "13": "透明",
- "99": "其他"
- }
- },
- {
- "id": "plateClassType",
- "label": "号牌种类",
- "data": {
- "01": "大型汽车号牌",
- "02": "小型汽车号牌",
- "03": "使馆汽车号牌",
- "04": "领馆汽车号牌",
- "05": "境外汽车号牌",
- "06": "外籍汽车号牌",
- "07": "普通摩托车号牌",
- "08": "轻便摩托车号牌",
- "09": "使馆摩托车号牌",
- "10": "领馆摩托车号牌",
- "11": "境外摩托车号牌",
- "12": "外籍摩托车号牌",
- "13": "低速车号牌",
- "14": "拖拉机号牌",
- "15": "挂车号牌",
- "16": "教练汽车号牌",
- "17": "教练摩托车号牌",
- "20": "临时入境汽车号牌",
- "21": "临时入境摩托车号牌",
- "22": "临时行驶车号牌",
- "23": "警用汽车号牌",
- "24": "警用摩托车号牌",
- "25": "原农机号牌",
- "26": "香港入出境号牌",
- "27": "澳门入出境号牌",
- "31": "武警号牌",
- "32": "军队号牌",
- "99": "其他号牌"
- }
- },
- {
- "id": "vehicleBrandType",
- "label": "车辆品牌",
- "data": {
- "0": "其他",
- "1": "大众",
- "2": "别克",
- "3": "宝马",
- "4": "本田",
- "5": "标致",
- "6": "丰田",
- "7": "福特",
- "8": "日产",
- "9": "奥迪",
- "10": "马自达",
- "11": "雪佛兰",
- "12": "雪铁龙",
- "13": "现代",
- "14": "奇瑞",
- "15": "起亚",
- "16": "荣威",
- "17": "三菱",
- "18": "斯柯达",
- "19": "吉利",
- "20": "中华",
- "21": "沃尔沃",
- "22": "雷克萨斯",
- "23": "菲亚特",
- "24": "吉利帝豪",
- "25": "东风",
- "26": "比亚迪",
- "27": "铃木",
- "28": "金杯",
- "29": "海马",
- "30": "五菱",
- "31": "江淮",
- "32": "斯巴鲁",
- "33": "英伦",
- "34": "长城",
- "35": "哈飞",
- "36": "庆铃(五十铃)",
- "37": "东南",
- "38": "长安",
- "39": "福田",
- "40": "夏利",
- "41": "奔驰",
- "42": "一汽",
- "43": "依维柯",
- "44": "力帆",
- "45": "一汽奔腾",
- "46": "皇冠",
- "47": "雷诺",
- "48": "JMC",
- "49": "MG名爵",
- "50": "凯马",
- "51": "众泰",
- "52": "昌河",
- "53": "厦门金龙",
- "54": "上海汇众",
- "55": "苏州金龙",
- "56": "海格",
- "57": "宇通",
- "58": "中国重汽",
- "59": "北奔重卡",
- "60": "华菱星马汽车",
- "61": "跃进汽车",
- "62": "黄海汽车",
- "65": "保时捷",
- "66": "凯迪拉克",
- "67": "英菲尼迪",
- "68": "吉利全球鹰",
- "69": "吉普",
- "70": "路虎",
- "71": "长丰猎豹",
- "73": "时代汽车",
- "75": "长安轿车",
- "76": "陕汽重卡",
- "81": "安凯",
- "82": "申龙",
- "83": "大宇",
- "86": "中通",
- "87": "宝骏",
- "88": "北汽威旺",
- "89": "广汽传祺",
- "90": "陆风",
- "92": "北京",
- "94": "威麟",
- "95": "欧宝",
- "96": "开瑞",
- "97": "华普",
- "103": "讴歌",
- "104": "启辰",
- "107": "北汽制造",
- "108": "纳智捷",
- "109": "野马",
- "110": "中兴",
- "112": "克莱斯勒",
- "113": "广汽吉奥",
- "115": "瑞麟",
- "117": "捷豹",
- "119": "唐骏欧铃",
- "121": "福迪",
- "122": "莲花",
- "124": "双环",
- "128": "永源",
- "136": "江南",
- "144": "道奇",
- "155": "大运汽车",
- "167": "北方客车",
- "176": "九龙",
- "191": "宾利",
- "201": "舒驰客车",
- "230": "红旗"
- }
- },
- {
- "id": "vehicleClassType",
- "label": "车辆类型",
- "data": {
- "K10": "大型客车",
- "K11": "大型普通客车",
- "K12": "大型双层客车",
- "K13": "大型卧铺客车",
- "K14": "大型铰接客车",
- "K15": "大型越野客车",
- "K16": "大型轿车",
- "K17": "大型专用客车",
- "K20": "中型客车",
- "K21": "中型普通客车",
- "K22": "中型双层客车",
- "K23": "中型卧铺客车",
- "K24": "中型铰接客车",
- "K25": "中型越野客车",
- "K27": "中型专用客车",
- "K30": "小型客车",
- "K31": "小型普通客车",
- "K32": "小型越野客车",
- "K33": "小型轿车",
- "K34": "小型专用客车",
- "K40": "微型客车",
- "K41": "微型普通客车",
- "K42": "微型越野客车",
- "K43": "微型轿车",
- "H10": "重型货车",
- "H11": "重型普通货车",
- "H12": "重型厢式货车",
- "H13": "重型封闭货车",
- "H14": "重型罐式货车",
- "H15": "重型平板货车",
- "H16": "重型集装厢车",
- "H17": "重型自卸货车",
- "H18": "重型特殊结构货车",
- "H19": "重型仓栅式货车",
- "H20": "中型货车",
- "H21": "中型普通货车",
- "H22": "中型厢式货车",
- "H23": "中型封闭货车",
- "H24": "中型罐式货车",
- "H25": "中型平板货车",
- "H26": "中型集装厢车",
- "H27": "中型自卸货车",
- "H28": "中型特殊结构货车",
- "H29": "中型仓栅式货车",
- "H30": "轻型货车",
- "H31": "轻型普通货车",
- "H32": "轻型厢式货车",
- "H33": "轻型封闭货车",
- "H34": "轻型罐式货车",
- "H35": "轻型平板货车",
- "H37": "轻型自卸货车",
- "H38": "轻型特殊结构货车",
- "H39": "轻型仓栅式货车",
- "H40": "微型货车",
- "H41": "微型普通货车",
- "H42": "微型厢式货车",
- "H43": "微型封闭货车",
- "H44": "微型罐式货车",
- "H45": "微型自卸货车",
- "H46": "微型特殊结构货车",
- "H47": "微型仓栅式货车",
- "H50": "低速货车",
- "H51": "普通低速货车",
- "H52": "厢式低速货车",
- "H53": "罐式低速货车",
- "H54": "自卸低速货车",
- "H55": "仓栅式低速货车",
- "Q10": "重型牵引车",
- "Q11": "重型半挂牵引车",
- "Q12": "重型全挂牵引车",
- "Q20": "中型牵引车",
- "Q21": "中型半挂牵引车",
- "Q22": "中型全挂牵引车",
- "Q30": "轻型牵引车",
- "Q31": "轻型半挂牵引车",
- "Q32": "轻型全挂牵引车",
- "Z11": "大型专项作业车",
- "Z21": "中型专项作业车",
- "Z31": "小型专项作业车",
- "Z41": "微型专项作业车",
- "Z51": "重型专项作业车",
- "Z71": "轻型专项作业车",
- "D11": "无轨电车",
- "D12": "有轨电车",
- "M10": "三轮摩托车",
- "M11": "普通正三轮摩托车",
- "M12": "轻便正三轮摩托车",
- "M13": "正三轮载客摩托车",
- "M14": "正三轮载货摩托车",
- "M15": "侧三轮摩托车",
- "M20": "二轮摩托车",
- "M21": "普通二轮摩托车",
- "M22": "轻便二轮摩托车",
- "N11": "三轮汽车",
- "T11": "大型轮式拖拉机",
- "T20": "小型拖拉机",
- "T21": "小型轮式拖拉机",
- "T22": "手扶拖拉机",
- "T23": "手扶变形运输机",
- "J11": "轮式装载机械",
- "J12": "轮式挖掘机械",
- "J13": "轮式平地机械",
- "G10": "重型全挂车",
- "G11": "重型普通全挂车",
- "G12": "重型厢式全挂车",
- "G13": "重型罐式全挂车",
- "G14": "重型平板全挂车",
- "G15": "重型集装箱全挂车",
- "G16": "重型自卸全挂车",
- "G17": "重型仓栅式全挂车",
- "G18": "重型旅居全挂车",
- "G19": "重型专项作业全挂车",
- "G20": "中型全挂车",
- "G21": "中型普通全挂车",
- "G22": "中型厢式全挂车",
- "G23": "中型罐式全挂车",
- "G24": "中型平板全挂车",
- "G25": "中型集装箱全挂车",
- "G26": "中型自卸全挂车",
- "G27": "中型仓栅式全挂车",
- "G28": "中型旅居全挂车",
- "G29": "中型专项作业全挂车",
- "G30": "轻型全挂车",
- "G31": "轻型普通全挂车",
- "G32": "轻型厢式全挂车",
- "G33": "轻型罐式全挂车",
- "G34": "轻型平板全挂车",
- "G35": "轻型自卸全挂车",
- "G36": "轻型仓栅式全挂车",
- "G37": "轻型旅居全挂车",
- "G38": "轻型专项作业全挂车",
- "B10": "重型半挂车",
- "B11": "重型普通半挂车",
- "B12": "重型厢式半挂车",
- "B13": "重型罐式半挂车",
- "B14": "重型平板半挂车",
- "B15": "重型集装箱半挂车",
- "B16": "重型自卸半挂车",
- "B17": "重型特殊结构半挂车",
- "B18": "重型仓栅式半挂车",
- "B19": "重型旅居半挂车",
- "B1A": "重型专项作业半挂车",
- "B1B": "重型低平板半挂车",
- "B20": "中型半挂车",
- "B21": "中型普通半挂车",
- "B22": "中型厢式半挂车",
- "B23": "中型罐式半挂车",
- "B24": "中型平板半挂车",
- "B25": "中型集装箱半挂车",
- "B26": "中型自卸半挂车",
- "B27": "中型特殊结构半挂车",
- "B28": "中型仓栅式半挂车",
- "B29": "中型旅居半挂车",
- "B2A": "中型专项作业半挂车",
- "B2B": "中型低平板半挂车",
- "B30": "轻型半挂车",
- "B31": "轻型普通半挂车",
- "B32": "轻型厢式半挂车",
- "B33": "轻型罐式半挂车",
- "B34": "轻型平板半挂车",
- "B35": "轻型自卸半挂车",
- "B36": "轻型仓栅式半挂车",
- "B37": "轻型旅居半挂车",
- "B38": "轻型专项作业半挂车",
- "B39": "轻型低平板半挂车",
- "X99": "其他"
- }
- }
-]
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/resources/logback.xml b/ard-modules/ard-modules-qs/src/main/resources/logback.xml
deleted file mode 100644
index 5cd518c..0000000
--- a/ard-modules/ard-modules-qs/src/main/resources/logback.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration scan="true" scanPeriod="60 seconds" debug="false">
- <!-- 日志存放路径 -->
- <property name="log.path" value="logs/ard-qs" />
- <!-- 日志输出格式 -->
- <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
-
- <!-- 控制台输出 -->
- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>${log.pattern}</pattern>
- </encoder>
- </appender>
-
- <!-- 系统日志输出 -->
- <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${log.path}/info.log</file>
- <!-- 循环政策:基于时间创建日志文件 -->
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- 日志文件名格式 -->
- <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
- <!-- 日志最大的历史 60天 -->
- <maxHistory>60</maxHistory>
- </rollingPolicy>
- <encoder>
- <pattern>${log.pattern}</pattern>
- </encoder>
- <filter class="ch.qos.logback.classic.filter.LevelFilter">
- <!-- 过滤的级别 -->
- <level>INFO</level>
- <!-- 匹配时的操作:接收(记录) -->
- <onMatch>ACCEPT</onMatch>
- <!-- 不匹配时的操作:拒绝(不记录) -->
- <onMismatch>DENY</onMismatch>
- </filter>
- </appender>
-
- <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${log.path}/error.log</file>
- <!-- 循环政策:基于时间创建日志文件 -->
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- 日志文件名格式 -->
- <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
- <!-- 日志最大的历史 60天 -->
- <maxHistory>60</maxHistory>
- </rollingPolicy>
- <encoder>
- <pattern>${log.pattern}</pattern>
- </encoder>
- <filter class="ch.qos.logback.classic.filter.LevelFilter">
- <!-- 过滤的级别 -->
- <level>ERROR</level>
- <!-- 匹配时的操作:接收(记录) -->
- <onMatch>ACCEPT</onMatch>
- <!-- 不匹配时的操作:拒绝(不记录) -->
- <onMismatch>DENY</onMismatch>
- </filter>
- </appender>
-
- <!-- 系统模块日志级别控制 -->
- <logger name="com.ard" level="info" />
- <!-- Spring日志级别控制 -->
- <logger name="org.springframework" level="warn" />
-
- <root level="info">
- <appender-ref ref="console" />
- </root>
-
- <!--系统操作日志-->
- <root level="info">
- <appender-ref ref="file_info" />
- <appender-ref ref="file_error" />
- </root>
-</configuration>
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsDeviceMapper.xml b/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsDeviceMapper.xml
deleted file mode 100644
index 5772626..0000000
--- a/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsDeviceMapper.xml
+++ /dev/null
@@ -1,729 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ard.qs.mapper.QsDeviceMapper">
-
- <resultMap type="QsDevice" id="QsDeviceResult">
- <result property="id" column="id"/>
- <result property="deviceCode" column="device_code"/>
- <result property="deviceName" column="device_name"/>
- <result property="ipAddress" column="ip_address"/>
- <result property="port" column="port"/>
- <result property="userName" column="user_name"/>
- <result property="password" column="password"/>
- <result property="type" column="type"/>
- <result property="deviceType" column="device_type"/>
- <result property="liveAddress" column="live_address"/>
- <result property="channel" column="channel"/>
- <result property="alarmChannelId" column="alarm_channel_id"/>
- <result property="status" column="status"/>
- <result property="streamType" column="stream_type"/>
- <result property="longitude" column="longitude"/>
- <result property="latitude" column="latitude"/>
- <result property="gbCode" column="gb_code"/>
- <result property="protocol" column="protocol"/>
- <result property="deviceStatus" column="device_status"/>
- <result property="onlineType" column="online_type"/>
- <result property="enableAudio" column="enable_audio"/>
- <result property="enableMp4" column="enable_mp4"/>
- <result property="streamStatus" column="stream_status"/>
- <result property="mediaServerId" column="media_serverId"/>
- <result property="streamKey" column="stream_key"/>
- <result property="enableDisableNoneReader" column="enable_disable_none_reader"/>
- <result property="snap" column="snap"/>
- <result property="flvType" column="flv_type"/>
- <result property="onvifAuth" column="onvif_auth"/>
- <result property="onvifHostName" column="onvif_host_name"/>
- <result property="recordPlanId" column="record_plan_id"/>
- <result property="gbCivilCode" column="gb_civil_code"/>
- <result property="gbBusinessGroupId" column="gb_business_group_id"/>
- <result property="gbParentId" column="gb_parent_id"/>
- <result property="manufacturer" column="manufacturer"/>
- <result property="address" column="address"/>
- <result property="ptzType" column="ptz_type"/>
- <result property="gbDeviceId" column="gb_device_id"/>
- <result property="gbChannelId" column="gb_channel_id"/>
- <result property="streamMode" column="stream_mode"/>
- <result property="jtMobileNo" column="jt_mobile_no"/>
- <result property="jtPlateNo" column="jt_plate_no"/>
- <result property="jtPlateColor" column="jt_plate_color"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="remark" column="remark"/>
- </resultMap>
-
- <resultMap type="QsRegionTree" id="QsRegionTreeResult">
- <result property="id" column="id"/>
- <result property="deviceId" column="device_id"/>
- <result property="name" column="name"/>
- <result property="parentId" column="parent_id"/>
- <result property="parentDeviceId" column="parent_device_id"/>
- <result property="treeId" column="tree_id"/>
- <result property="isLeaf" column="is_leaf"/>
- <result property="type" column="type"/>
- <result property="status" column="status"/>
- <result property="longitude" column="longitude"/>
- <result property="latitude" column="latitude"/>
- <result property="manufacturer" column="manufacturer"/>
- <result property="address" column="address"/>
- <result property="ptzType" column="ptz_type"/>
- <result property="streamType" column="stream_type"/>
- <result property="ipAddress" column="ip_address"/>
- </resultMap>
-
- <resultMap type="QsGroupTree" id="QsGroupTreeResult">
- <id property="id" column="id"/>
- <result property="deviceId" column="device_id"/>
- <result property="name" column="name"/>
- <result property="parentId" column="parent_id"/>
- <result property="parentDeviceId" column="parent_device_id"/>
- <result property="businessGroup" column="business_group"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="civilCode" column="civil_code"/>
- <result property="alias" column="alias"/>
- <result property="treeId" column="tree_id"/>
- <result property="isLeaf" column="is_leaf"/>
- <result property="type" column="type"/>
- <result property="status" column="status"/>
- <result property="longitude" column="longitude"/>
- <result property="latitude" column="latitude"/>
- <result property="manufacturer" column="manufacturer"/>
- <result property="address" column="address"/>
- <result property="ptzType" column="ptz_type"/>
- <result property="streamType" column="stream_type"/>
- <result property="ipAddress" column="ip_address"/>
- </resultMap>
-
- <resultMap id="DeviceStatsResultMap" type="DeviceStats">
- <result column="totalDeviceCount" property="totalDeviceCount"/>
- <result column="totalOnlineCount" property="totalOnlineCount"/>
- <result column="totalOfflineCount" property="totalOfflineCount"/>
- <result column="enableCount" property="enableCount"/>
- <result column="deactivateCount" property="deactivateCount"/>
- <result column="rtspCount" property="rtspCount"/>
- <result column="rtmpCount" property="rtmpCount"/>
- <result column="flvCount" property="flvCount"/>
- <result column="hlsCount" property="hlsCount"/>
- <result column="onvifCount" property="onvifCount"/>
- <result column="fileCount" property="fileCount"/>
- <result column="hikSdkCount" property="hikSdkCount"/>
- <result column="hikIsupCount" property="hikIsupCount"/>
- <result column="dahuaSdkCount" property="dahuaSdkCount"/>
- <result column="gb28181Count" property="gb28181Count"/>
- <result column="jt1078Count" property="jt1078Count"/>
- <result column="pushCount" property="pushCount"/>
- </resultMap>
-
-
- <sql id="selectQsDeviceVo">
- select id,
- device_code,
- device_name,
- ip_address,
- port,
- user_name,
- password,
- type,
- device_type,
- live_address,
- channel,
- alarm_channel_id,
- status,
- stream_type,
- longitude,
- latitude,
- gb_code,
- protocol,
- device_status,
- online_type,
- enable_audio,
- enable_mp4,
- stream_status,
- media_serverId,
- stream_key,
- enable_disable_none_reader,
- snap,
- flv_type,
- onvif_auth,
- onvif_host_name,
- record_plan_id,
- gb_civil_code,
- gb_business_group_id,
- gb_parent_id,
- manufacturer,
- address,
- ptz_type,
- gb_device_id,
- gb_channel_id,
- stream_mode,
- jt_mobile_no,
- jt_plate_no,
- jt_plate_color,
- create_by,
- create_time,
- update_by,
- update_time,
- remark
- from qs_device
- </sql>
-
- <select id="selectQsDeviceList" parameterType="QsDevice" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- <where>
- <if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')
- </if>
- <if test="ipAddress != null and ipAddress != ''">and ip_address like concat('%', #{ipAddress}, '%')</if>
- <if test="type != null and type != ''">and type = #{type}</if>
- <if test="status != null and status != ''">and status = #{status}</if>
- <if test="deviceStatus != null and deviceStatus != ''">and device_status = #{deviceStatus}</if>
- <if test="gbCivilCode != null and gbCivilCode != ''">and gb_civil_code = #{gbCivilCode}</if>
- <if test="gbParentId != null and gbParentId != ''">and gb_parent_id = #{gbParentId}</if>
- </where>
- </select>
-
- <select id="selectQsDeviceById" parameterType="Long" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- where id = #{id}
- </select>
-
- <select id="getQsDeviceStream" resultMap="QsDeviceResult"
- parameterType="java.lang.String">
- <include refid="selectQsDeviceVo"/>
- where device_code = #{stream}
- </select>
-
- <insert id="insertQsDevice" parameterType="QsDevice" useGeneratedKeys="true" keyProperty="id">
- insert into qs_device
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="deviceCode != null and deviceCode != ''">device_code,</if>
- <if test="deviceName != null">device_name,</if>
- <if test="ipAddress != null and ipAddress != ''">ip_address,</if>
- <if test="port != null">port,</if>
- <if test="userName != null and userName != ''">user_name,</if>
- <if test="password != null and password != ''">password,</if>
- <if test="type != null">type,</if>
- <if test="deviceType != null">device_type,</if>
- <if test="liveAddress != null">live_address,</if>
- <if test="channel != null">channel,</if>
- <if test="alarmChannelId != null">alarm_channel_id,</if>
- <if test="status != null">status,</if>
- <if test="streamType != null">stream_type,</if>
- <if test="longitude != null">longitude,</if>
- <if test="latitude != null">latitude,</if>
- <if test="gbCode != null">gb_code,</if>
- <if test="protocol != null">protocol,</if>
- <if test="deviceStatus != null">device_status,</if>
- <if test="onlineType != null">online_type,</if>
- <if test="enableAudio != null">enable_audio,</if>
- <if test="enableMp4 != null">enable_mp4,</if>
- <if test="streamStatus != null">stream_status,</if>
- <if test="mediaServerId != null">media_serverId,</if>
- <if test="streamKey != null">stream_key,</if>
- <if test="enableDisableNoneReader != null">enable_disable_none_reader,</if>
- <if test="snap != null">snap,</if>
- <if test="flvType != null">flv_type,</if>
- <if test="onvifAuth != null">onvif_auth,</if>
- <if test="onvifHostName != null">onvif_host_name,</if>
- <if test="recordPlanId != null">record_plan_id,</if>
- <if test="gbCivilCode != null">gb_civil_code,</if>
- <if test="gbBusinessGroupId != null">gb_business_group_id,</if>
- <if test="gbParentId != null">gb_parent_id,</if>
- <if test="manufacturer != null">manufacturer,</if>
- <if test="address != null">address,</if>
- <if test="ptzType != null">ptz_type,</if>
- <if test="gbDeviceId != null">gb_device_id,</if>
- <if test="gbChannelId != null">gb_channel_id,</if>
- <if test="streamMode != null">stream_mode,</if>
- <if test="jtMobileNo != null">jt_mobile_no,</if>
- <if test="jtPlateNo != null">jt_plate_no,</if>
- <if test="jtPlateColor != null">jt_plate_color,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
- <if test="deviceName != null">#{deviceName},</if>
- <if test="ipAddress != null and ipAddress != ''">#{ipAddress},</if>
- <if test="port != null">#{port},</if>
- <if test="userName != null and userName != ''">#{userName},</if>
- <if test="password != null and password != ''">#{password},</if>
- <if test="type != null">#{type},</if>
- <if test="deviceType != null">#{deviceType},</if>
- <if test="liveAddress != null">#{liveAddress},</if>
- <if test="channel != null">#{channel},</if>
- <if test="alarmChannelId != null">#{alarmChannelId},</if>
- <if test="status != null">#{status},</if>
- <if test="streamType != null">#{streamType},</if>
- <if test="longitude != null">#{longitude},</if>
- <if test="latitude != null">#{latitude},</if>
- <if test="gbCode != null">#{gbCode},</if>
- <if test="protocol != null">#{protocol},</if>
- <if test="deviceStatus != null">#{deviceStatus},</if>
- <if test="onlineType != null">#{onlineType},</if>
- <if test="enableAudio != null">#{enableAudio},</if>
- <if test="enableMp4 != null">#{enableMp4},</if>
- <if test="streamStatus != null">#{streamStatus},</if>
- <if test="mediaServerId != null">#{mediaServerId},</if>
- <if test="streamKey != null">#{streamKey},</if>
- <if test="enableDisableNoneReader != null">#{enableDisableNoneReader},</if>
- <if test="snap != null">#{snap},</if>
- <if test="flvType != null">#{flvType},</if>
- <if test="onvifAuth != null">#{onvifAuth},</if>
- <if test="onvifHostName != null">#{onvifHostName},</if>
- <if test="recordPlanId != null">#{recordPlanId},</if>
- <if test="gbCivilCode != null">#{gbCivilCode},</if>
- <if test="gbBusinessGroupId != null">#{gbBusinessGroupId},</if>
- <if test="gbParentId != null">#{gbParentId},</if>
- <if test="manufacturer != null">#{manufacturer},</if>
- <if test="ptzType != null">#{ptzType},</if>
- <if test="gbDeviceId != null">#{gbDeviceId},</if>
- <if test="gbChannelId != null">#{gbChannelId},</if>
- <if test="streamMode != null">#{streamMode},</if>
- <if test="jtMobileNo != null">#{jtMobileNo},</if>
- <if test="jtPlateNo != null">#{jtPlateNo},</if>
- <if test="jtPlateColor != null">#{jtPlateColor},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
-
- <update id="updateQsDevice" parameterType="QsDevice">
- update qs_device
- <trim prefix="SET" suffixOverrides=",">
- <if test="deviceCode != null and deviceCode != ''">device_code = #{deviceCode},</if>
- <if test="deviceName != null">device_name = #{deviceName},</if>
- <if test="ipAddress != null and ipAddress != ''">ip_address = #{ipAddress},</if>
- <if test="port != null">port = #{port},</if>
- <if test="userName != null and userName != ''">user_name = #{userName},</if>
- <if test="password != null and password != ''">password = #{password},</if>
- <if test="type != null">type = #{type},</if>
- <if test="deviceType != null">device_type = #{deviceType},</if>
- <if test="liveAddress != null">live_address = #{liveAddress},</if>
- <if test="channel != null">channel = #{channel},</if>
- <if test="alarmChannelId != null">alarm_channel_id = #{alarmChannelId},</if>
- <if test="status != null">status = #{status},</if>
- <if test="streamType != null">stream_type = #{streamType},</if>
- <if test="longitude != null">longitude = #{longitude},</if>
- <if test="latitude != null">latitude = #{latitude},</if>
- <if test="gbCode != null">gb_code = #{gbCode},</if>
- <if test="protocol != null">protocol = #{protocol},</if>
- <if test="deviceStatus != null">device_status = #{deviceStatus},</if>
- <if test="onlineType != null">online_type = #{onlineType},</if>
- <if test="enableAudio != null">enable_audio = #{enableAudio},</if>
- <if test="enableMp4 != null">enable_mp4 = #{enableMp4},</if>
- <if test="streamStatus != null">stream_status = #{streamStatus},</if>
- <if test="mediaServerId != null">media_serverId = #{mediaServerId},</if>
- <if test="streamKey != null">stream_key = #{streamKey},</if>
- <if test="enableDisableNoneReader != null">enable_disable_none_reader = #{enableDisableNoneReader},</if>
- <if test="snap != null">snap = #{snap},</if>
- <if test="flvType != null">flv_type = #{flvType},</if>
- <if test="onvifAuth != null">onvif_auth = #{onvifAuth},</if>
- <if test="onvifHostName != null">onvif_host_name = #{onvifHostName},</if>
- <if test="recordPlanId != null">record_plan_id = #{recordPlanId},</if>
- <if test="gbCivilCode != null">gb_civil_code = #{gbCivilCode},</if>
- <if test="gbBusinessGroupId != null">gb_business_group_id = #{gbBusinessGroupId},</if>
- <if test="gbParentId != null">gb_parent_id = #{gbParentId},</if>
- <if test="manufacturer != null">manufacturer = #{manufacturer},</if>
- <if test="address != null">address = #{address},</if>
- <if test="ptzType != null">ptz_type = #{ptzType},</if>
- <if test="gbDeviceId != null">gb_device_id = #{gbDeviceId},</if>
- <if test="gbChannelId != null">gb_channel_id = #{gbChannelId},</if>
- <if test="streamMode != null">stream_mode = #{streamMode},</if>
- <if test="jtMobileNo != null">jt_mobile_no = #{jtMobileNo},</if>
- <if test="jtPlateNo != null">jt_plate_no = #{jtPlateNo},</if>
- <if test="jtPlateColor != null">jt_plate_color = #{jtPlateColor},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where id = #{id}
- </update>
-
- <update id="updateQsDeviceStatus">
- update qs_device
- set status = #{status},
- update_time = sysdate()
- where id = #{id}
- </update>
- <update id="updateQsDeviceStatusList">
- update qs_device set device_status = #{deviceStatus}, update_time = sysdate() where id in
- <foreach item="id" collection="list" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
-
- <update id="updateAllQsDevicesToOffline">
- update qs_device
- set device_status = 'OFFLINE',
- stream_status = '0',
- media_serverId = null,
- stream_key = null
- </update>
- <update id="updateAllQsDeviceStreamUrls"
- parameterType="QsDevice">
- <foreach collection="list" item="item" separator=";">
- UPDATE qs_device
- <set>
- device_status = #{item.deviceStatus}
- </set>
- WHERE id = #{item.id}
- </foreach>
- </update>
-
- <update id="linkAll" parameterType="java.lang.Long">
- UPDATE qs_device
- set record_plan_id = #{planId}
- where status = 'ENABLE'
- </update>
-
- <update id="cleanAll" parameterType="java.lang.Long">
- UPDATE qs_device
- set record_plan_id = null
- where record_plan_id = #{planId}
- </update>
-
- <update id="link">
- UPDATE qs_device
- set record_plan_id = #{planId}
- where
- <foreach collection="deviceIds" item="id" separator="or">
- id = #{id}
- </foreach>
- </update>
-
- <update id="cleanRecordPlanId" parameterType="java.lang.Long">
- UPDATE qs_device
- set record_plan_id = null
- where record_plan_id = #{planId}
- </update>
-
- <update id="updateCivilCodeByDeviceList">
- UPDATE qs_device
- SET gb_civil_code = #{civilCode}
- WHERE id IN
- <foreach collection="deviceList" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </update>
-
- <update id="updateBusinessGroupBydeviceList">
- UPDATE qs_device
- SET gb_business_group_id = #{businessGroup}
- WHERE id IN
- <foreach collection="deviceList" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </update>
-
- <update id="updateParentIdByDeviceList">
- UPDATE qs_device
- SET gb_parent_id = #{parentId}
- WHERE id IN
- <foreach collection="deviceList" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </update>
-
- <update id="removeParentIdByDevices">
- UPDATE qs_device
- SET gb_parent_id = null,
- gb_business_group_id = null
- WHERE id IN
- <foreach collection="deviceList" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </update>
-
- <update id="updateRegion">
- UPDATE qs_device
- SET gb_civil_code = #{civilCode}
- WHERE id IN
- <foreach collection="deviceList" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </update>
-
- <update id="removeCivilCodeByDeletes">
- UPDATE qs_device
- SET gb_civil_code = null
- WHERE id IN
- <foreach collection="deviceList" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </update>
-
- <update id="removeCivilCodeByDeviceIds">
- UPDATE qs_device
- SET gb_civil_code = null
- WHERE id IN
- <foreach collection="deviceList" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </update>
-
- <update id="updateGroup">
- UPDATE qs_device
- SET gb_parent_id = #{parentId},
- gb_business_group_id = #{businessGroup}
- WHERE id IN
- <foreach collection="deviceList" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </update>
-
- <update id="removeParentIdByDeviceIds">
- UPDATE qs_device
- SET gb_parent_id = null,
- gb_business_group_id = null
- WHERE id IN
- <foreach collection="deviceIdsForClear" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </update>
-
- <select id="fetchAllQsDeviceStreamUrls" resultMap="QsDeviceResult">
- select id,
- live_address
- from qs_device
- where type in ('1', '2', '3', '4', '6')
- </select>
- <select id="listPlanRecordQsDevice" parameterType="QsDevice" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- <where>
- <if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')
- </if>
- <if test="type != null and type != ''">and type = #{type}</if>
- <if test="status != null and status != ''">and status = #{status}</if>
- <if test="deviceStatus != null and deviceStatus != ''">and device_status = #{deviceStatus}</if>
-
- <if test="recordPlanId != null">
- and record_plan_id = #{recordPlanId}
- </if>
- <if test="recordPlanId == null">
- and record_plan_id is null
- </if>
-
- and status = 'ENABLE'
- </where>
- </select>
-
- <select id="queryByIds" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- where id in
- <foreach item="id" collection="startDeviceIdList" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
-
- <select id="countRecordPlanDevice" resultType="java.lang.Integer" parameterType="java.lang.Long">
- select count(1)
- from qs_device
- where record_plan_id = #{planId}
- and status = 'ENABLE'
- </select>
-
- <select id="queryByCivilCode" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- where gb_civil_code = #{civilCode}
- </select>
-
- <select id="queryForRegionTreeByCivilCode" resultMap="QsRegionTreeResult"
- parameterType="java.lang.String">
- SELECT id as id,
- device_name as name,
- device_status as status,
- true as is_leaf,
- longitude as longitude,
- 1 as type,
- latitude as latitude,
- type as stream_type,
- manufacturer as manufacturer,
- address as address,
- ptz_type as ptz_type
- FROM qs_device
- WHERE gb_civil_code = #{deviceId}
- and status = 'ENABLE'
- </select>
-
- <select id="queryByBusinessGroup" resultMap="QsRegionTreeResult" parameterType="java.lang.String">
- <include refid="selectQsDeviceVo"/>
- where gb_business_group_id= #{businessGroup}
- </select>
-
- <select id="queryByParentId" resultMap="QsDeviceResult"
- parameterType="java.lang.String">
- <include refid="selectQsDeviceVo"/>
- where gb_parent_id = #{parentId}
- </select>
-
- <select id="queryByGroupList" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- where
- gb_parent_id in
- <foreach collection="groupList" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </select>
-
- <select id="queryForGroupTreeByParentId" resultMap="QsGroupTreeResult">
- SELECT id as id,
- device_name as name,
- device_status as status,
- true as is_leaf,
- longitude as longitude,
- 1 as type,
- latitude as latitude,
- type as stream_type,
- manufacturer as manufacturer,
- address as address,
- ptz_type as ptz_type
- FROM qs_device
- WHERE gb_parent_id = #{parent}
- and status = 'ENABLE'
- <if test="query != null and query != ''">
- AND device_name LIKE concat('%', #{query}, '%'))
- </if>
- </select>
-
- <select id="queryListByCivilCode" parameterType="QsDevice" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- <where>
- <if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')
- </if>
- <if test="ipAddress != null and ipAddress != ''">and ip_address like concat('%', #{ipAddress}, '%')</if>
- <if test="type != null and type != ''">and type = #{type}</if>
- <if test="status != null and status != ''">and status = #{status}</if>
- <if test="deviceStatus != null and deviceStatus != ''">and device_status = #{deviceStatus}</if>
- <if test="gbCivilCode != null and gbCivilCode != ''">and gb_civil_code = #{gbCivilCode}</if>
- <if test="gbCivilCode == null or gbCivilCode ==''">
- AND gb_civil_code is null
- </if>
- </where>
- </select>
-
- <select id="queryListByCivilCodeForUnusual" parameterType="QsDevice" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- d
- LEFT JOIN (
- SELECT wcr.device_id FROM qs_common_region wcr
- ) temp ON temp.device_id = d.gb_civil_code
- WHERE d.gb_civil_code IS NOT NULL
- AND temp.device_id IS NULL
-
- <if test="deviceName != null and deviceName != ''">and d.device_name like concat('%', #{deviceName}, '%')
- </if>
- <if test="ipAddress != null and ipAddress != ''">and d.ip_address like concat('%', #{ipAddress}, '%')</if>
- <if test="type != null and type != ''">and d.type = #{type}</if>
- <if test="deviceStatus != null and deviceStatus != ''">and d.device_status = #{deviceStatus}</if>
- <if test="status != null and status != ''">and status = #{status}</if>
- </select>
-
- <select id="queryAllForUnusualCivilCode" resultType="java.lang.Long">
- SELECT d.id
- FROM qs_device d
- LEFT JOIN (SELECT wcr.device_id FROM qs_common_region wcr) temp ON temp.device_id = d.gb_civil_code
- WHERE d.gb_civil_code IS NOT NULL
- AND temp.device_id IS NULL
- </select>
-
- <select id="queryListByParentId" parameterType="QsDevice" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- <where>
- <if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')
- </if>
- <if test="ipAddress != null and ipAddress != ''">and ip_address like concat('%', #{ipAddress}, '%')</if>
- <if test="type != null and type != ''">and type = #{type}</if>
- <if test="deviceStatus != null and deviceStatus != ''">and device_status = #{deviceStatus}</if>
- <if test="gbCivilCode != null and gbCivilCode != ''">and gb_civil_code = #{gbCivilCode}</if>
- <if test="gbParentId == null or gbParentId ==''">
- AND gb_parent_id is null
- </if>
- </where>
- <if test="status != null and status != ''">and status = #{status}</if>
- </select>
-
- <select id="queryListByParentForUnusual" parameterType="QsDevice" resultMap="QsDeviceResult">
- <include refid="selectQsDeviceVo"/>
- d
- LEFT JOIN (
- SELECT wcg.device_id FROM qs_common_group wcg
- ) temp ON temp.device_id = d.gb_parent_id
- WHERE d.gb_parent_id IS NOT NULL
- AND temp.device_id IS NULL
-
- <if test="deviceName != null and deviceName != ''">and d.device_name like concat('%', #{deviceName}, '%')
- </if>
- <if test="ipAddress != null and ipAddress != ''">and d.ip_address like concat('%', #{ipAddress}, '%')</if>
- <if test="type != null and type != ''">and d.type = #{type}</if>
- <if test="deviceStatus != null and deviceStatus != ''">and d.device_status = #{deviceStatus}</if>
- <if test="status != null and status != ''">and status = #{status}</if>
- </select>
-
- <select id="queryAllForUnusualParent" resultType="java.lang.Long">
- SELECT d.id
- FROM qs_device d
- LEFT JOIN (SELECT wcg.device_id
- FROM qs_common_group wcg) temp ON temp.device_id = d.gb_parent_id
- WHERE d.gb_parent_id IS NOT NULL
- AND temp.device_id IS NULL
- </select>
-
- <select id="getDeviceStatistics" resultMap="DeviceStatsResultMap">
- SELECT
- COUNT(*) AS 'totalDeviceCount',
- SUM(CASE WHEN device_status = 'ON' THEN 1 ELSE 0 END) AS 'totalOnlineCount',
- SUM(CASE WHEN device_status = 'OFFLINE' THEN 1 ELSE 0 END) AS 'totalOfflineCount',
-
- SUM(CASE WHEN status = 'ENABLE' THEN 1 ELSE 0 END) AS 'enableCount',
- SUM(CASE WHEN status = 'DEACTIVATE' THEN 1 ELSE 0 END) AS 'deactivateCount',
-
- SUM(CASE WHEN type = '1' THEN 1 ELSE 0 END) AS 'rtspCount',
- SUM(CASE WHEN type = '2' THEN 1 ELSE 0 END) AS 'rtmpCount',
- SUM(CASE WHEN type = '3' THEN 1 ELSE 0 END) AS 'flvCount' ,
- SUM(CASE WHEN type = '4' THEN 1 ELSE 0 END) AS 'hlsCount' ,
- SUM(CASE WHEN type = '5' THEN 1 ELSE 0 END) AS 'onvifCount' ,
- SUM(CASE WHEN type = '6' THEN 1 ELSE 0 END) AS 'fileCount' ,
- SUM(CASE WHEN type = '7' THEN 1 ELSE 0 END) AS 'hikSdkCount' ,
- SUM(CASE WHEN type = '8' THEN 1 ELSE 0 END) AS 'hikIsupCount' ,
- SUM(CASE WHEN type = '9' THEN 1 ELSE 0 END) AS 'dahuaSdkCount',
- SUM(CASE WHEN type = '12' THEN 1 ELSE 0 END) AS 'gb28181Count',
- SUM(CASE WHEN type = '13' THEN 1 ELSE 0 END) AS 'pushCount',
- SUM(CASE WHEN type = '14' THEN 1 ELSE 0 END) AS 'jt1078Count'
-
- FROM qs_device;
- </select>
-
- <delete id="deleteQsDeviceById" parameterType="Long">
- delete
- from qs_device
- where id = #{id}
- </delete>
-
- <delete id="deleteQsDeviceByIds" parameterType="String">
- delete from qs_device where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
-
- <delete id="removeCivilCode">
- UPDATE qs_device
- SET gb_civil_code = null
- WHERE gb_civil_code IN
- <foreach collection="allChildren" item="item" open="(" separator="," close=")">
- #{item.deviceId}
- </foreach>
- </delete>
-</mapper>
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsGroupMapper.xml b/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsGroupMapper.xml
deleted file mode 100644
index 97c6b91..0000000
--- a/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsGroupMapper.xml
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ard.qs.mapper.QsGroupMapper">
-
- <resultMap type="QsGroup" id="QsGroupResult">
- <id property="id" column="id"/>
- <result property="deviceId" column="device_id"/>
- <result property="name" column="name"/>
- <result property="parentId" column="parent_id"/>
- <result property="parentDeviceId" column="parent_device_id"/>
- <result property="businessGroup" column="business_group"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="civilCode" column="civil_code"/>
- <result property="alias" column="alias"/>
- </resultMap>
-
-
- <resultMap type="QsGroupTree" id="QsGroupTreeResult">
- <id property="id" column="id"/>
- <result property="deviceId" column="device_id"/>
- <result property="name" column="name"/>
- <result property="parentId" column="parent_id"/>
- <result property="parentDeviceId" column="parent_device_id"/>
- <result property="businessGroup" column="business_group"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="civilCode" column="civil_code"/>
- <result property="alias" column="alias"/>
- <result property="treeId" column="tree_id"/>
- <result property="isLeaf" column="is_leaf"/>
- <result property="type" column="type"/>
- <result property="status" column="status"/>
- <result property="longitude" column="longitude"/>
- <result property="latitude" column="latitude"/>
- <result property="manufacturer" column="manufacturer"/>
- <result property="address" column="address"/>
- <result property="ptzType" column="ptz_type"/>
- <result property="streamType" column="stream_type"/>
- <result property="ipAddress" column="ip_address"/>
- </resultMap>
-
- <sql id="selectQsGroupVo">
- select id,
- device_id,
- name,
- parent_id,
- parent_device_id,
- business_group,
- create_time,
- update_time,
- civil_code,
- alias
- from qs_common_group
- </sql>
-
- <insert id="addBusinessGroup" parameterType="QsGroup" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- INSERT INTO qs_common_group
- (device_id,
- name,
- parent_id,
- business_group,
- create_time,
- update_time,
- civil_code,
- alias)
- VALUES (#{deviceId},
- #{name},
- #{parentId},
- #{businessGroup},
- #{createTime},
- #{updateTime},
- #{civilCode},
- #{alias})
- </insert>
-
- <insert id="add" parameterType="QsGroup" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- INSERT INTO qs_common_group
- (device_id,
- name,
- parent_id,
- parent_device_id,
- business_group,
- create_time,
- update_time,
- civil_code,
- alias)
- VALUES (#{deviceId},
- #{name},
- #{parentId},
- #{parentDeviceId},
- #{businessGroup},
- #{createTime},
- #{updateTime},
- #{civilCode},
- #{alias})
- </insert>
-
- <update id="update" parameterType="QsGroup">
- UPDATE qs_common_group
- SET update_time = #{updateTime},
- device_id = #{deviceId},
- name = #{name},
- parent_id = #{parentId},
- parent_device_id = #{parentDeviceId},
- business_group = #{businessGroup},
- civil_code = #{civilCode},
- alias = #{alias}
- WHERE id = #{id}
- </update>
-
- <update id="updateChild">
- UPDATE qs_common_group
- SET parent_device_id = #{group.deviceId},
- business_group = #{group.businessGroup}
- WHERE parent_id = #{parentId}
- </update>
-
- <delete id="batchDelete">
- DELETE FROM qs_common_group
- WHERE id IN
- <foreach collection="allChildren" item="item" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </delete>
-
- <select id="queryInGroupListByDeviceId" resultMap="QsGroupResult">
- <include refid="selectQsGroupVo"/>
- WHERE device_id IN
- <foreach collection="groupList" item="item" open="(" separator="," close=")">
- #{item.deviceId}
- </foreach>
- </select>
-
- <select id="queryBusinessGroup" resultMap="QsGroupResult" parameterType="java.lang.String">
- <include refid="selectQsGroupVo"/>
- WHERE device_id = #{businessGroup} and business_group = #{businessGroup}
- </select>
-
- <select id="queryOneByDeviceId" resultMap="QsGroupResult">
- <include refid="selectQsGroupVo"/>
- WHERE device_id = #{deviceId} and business_group = #{businessGroup}
- </select>
-
- <select id="queryOne" resultMap="QsGroupResult" parameterType="int">
- <include refid="selectQsGroupVo"/>
- WHERE id = #{id}
- </select>
-
- <select id="getChildren" resultMap="QsGroupResult" parameterType="int">
- <include refid="selectQsGroupVo"/>
- WHERE parent_id = #{parentId}
- </select>
-
- <select id="queryByBusinessGroup" resultMap="QsGroupResult"
- parameterType="java.lang.String">
- <include refid="selectQsGroupVo"/>
- WHERE business_group = #{businessGroup}
- </select>
-
- <select id="queryForTree" resultMap="QsGroupTreeResult">
- SELECT
- *,
- concat('group', id) as tree_id,
- 0 as type,
- false as is_leaf,
- 'ON' as status
- FROM qs_common_group
- <where>
- <if test="parentId != null">
- AND parent_id = #{parentId}
- </if>
- <if test="parentId == null">
- AND parent_id IS NULL
- </if>
- <if test="query != null">
- AND (device_id LIKE concat('%', #{query}, '%') OR name LIKE concat('%', #{query}, '%'))
- </if>
- </where>
- </select>
-
- <select id="queryForDevice" resultMap="QsGroupTreeResult">
- SELECT
- id,
- id AS tree_id,
- ip_address AS ip_address,
- longitude AS longitude,
- latitude AS latitude,
- device_name AS name,
- device_status AS status,
- type,
- flv_type AS flv_type,
- address AS address,
- manufacturer AS manufacturer,
- type AS stream_type
- FROM qs_device
- WHERE status = 'ENABLE' and (gb_parent_id IS NOT NULL AND TRIM(gb_parent_id) != '')
- AND (
- (longitude IS NOT NULL AND TRIM(longitude) != '')
- OR
- (latitude IS NOT NULL AND TRIM(latitude) != '')
- )
- </select>
-
- <select id="query" resultMap="QsGroupResult">
- SELECT *
- FROM qs_common_group
- WHERE 1=1
- <if test="query != null">
- AND (device_id LIKE concat('%', #{query}, '%') OR name LIKE concat('%', #{query}, '%'))
- </if>
- <if test="parentId != null and businessGroupId != null">
- AND parent_device_id = #{parentId} AND business_group = #{businessGroup}
- </if>
- ORDER BY id
- </select>
-</mapper>
\ No newline at end of file
diff --git a/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsRegionMapper.xml b/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsRegionMapper.xml
deleted file mode 100644
index befe8f8..0000000
--- a/ard-modules/ard-modules-qs/src/main/resources/mapper/qs/QsRegionMapper.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ard.qs.mapper.QsRegionMapper">
-
- <resultMap type="QsRegion" id="QsRegionResult">
- <result property="id" column="id"/>
- <result property="deviceId" column="device_id"/>
- <result property="name" column="name"/>
- <result property="parentId" column="parent_id"/>
- <result property="parentDeviceId" column="parent_device_id"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- </resultMap>
-
- <resultMap type="QsRegionTree" id="QsRegionTreeResult">
- <result property="id" column="id"/>
- <result property="deviceId" column="device_id"/>
- <result property="name" column="name"/>
- <result property="parentId" column="parent_id"/>
- <result property="parentDeviceId" column="parent_device_id"/>
- <result property="treeId" column="tree_id"/>
- <result property="isLeaf" column="is_leaf"/>
- <result property="type" column="type"/>
- <result property="status" column="status"/>
- <result property="longitude" column="longitude"/>
- <result property="latitude" column="latitude"/>
- <result property="manufacturer" column="manufacturer"/>
- <result property="address" column="address"/>
- <result property="ptzType" column="ptz_type"/>
- <result property="streamType" column="stream_type"/>
- <result property="ipAddress" column="ip_address"/>
- </resultMap>
-
-
- <sql id="selectQsRegionVo">
- select id,
- device_id,
- name,
- parent_id,
- parent_device_id,
- create_time,
- update_time
- from qs_common_region
- </sql>
-
- <insert id="add" parameterType="QsRegion" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- INSERT INTO qs_common_region (device_id, name, parent_id, parent_device_id, create_time, update_time)
- VALUES (#{deviceId}, #{name}, #{parentId}, #{parentDeviceId}, #{createTime}, #{updateTime})
- </insert>
-
- <update id="updateChild">
- UPDATE qs_common_region
- SET parent_device_id = #{parentDeviceId}
- WHERE parent_id = #{parentId}
- </update>
-
- <update id="update">
- UPDATE qs_common_region
- SET update_time = #{updateTime},
- device_id = #{deviceId},
- name = #{name},
- parent_id = #{parentId},
- parent_device_id = #{parentDeviceId}
- WHERE id = #{id}
- </update>
-
- <delete id="batchDelete">
- DELETE FROM qs_common_region
- WHERE id IN
- <foreach item="item" collection="allChildren" open="(" separator="," close=")">
- #{item.id}
- </foreach>
- </delete>
-
- <select id="queryOne" resultMap="QsRegionResult">
- <include refid="selectQsRegionVo"/>
- WHERE id = #{id}
- </select>
-
- <select id="queryByDeviceId" resultMap="QsRegionResult">
- <include refid="selectQsRegionVo"/>
- WHERE device_id = #{deviceId}
- </select>
- <select id="getChildren" parameterType="java.lang.Integer">
- <include refid="selectQsRegionVo"/>
- WHERE parent_id = #{parentId} ORDER BY id
- </select>
-
- <select id="queryForTree" resultMap="QsRegionTreeResult" parameterType="java.lang.Integer">
- SELECT
- *,
- concat('region', id) as tree_id,
- 0 as type,
- 'ON' as status,
- false as is_leaf
- FROM qs_common_region
- WHERE
- <if test="parentId != null">
- parent_id = #{parentId}
- </if>
- <if test="parentId == null">
- parent_id is null
- </if>
- </select>
-
- <select id="queryForDevice" resultMap="QsRegionTreeResult">
- SELECT
- id,
- id AS tree_id,
- ip_address AS ip_address,
- longitude AS longitude,
- latitude AS latitude,
- device_name AS name,
- device_status AS status,
- type,
- flv_type AS flv_type,
- address AS address,
- manufacturer AS manufacturer,
- type AS stream_type
- FROM
- qs_device
- WHERE
- status = 'ENABLE'
- and ( gb_civil_code IS NOT NULL AND TRIM( gb_civil_code ) != '' )
-
- AND (
- (
- ( longitude IS NOT NULL AND TRIM( longitude ) != '' )
- OR ( latitude IS NOT NULL AND TRIM( latitude ) != '' )
- )
- )
- </select>
- <select id="query" resultMap="QsRegionResult">
- <include refid="selectQsRegionVo"/>
- <where>
- <if test="query != null">
- AND (device_id LIKE concat('%', #{query}, '%') escape '/' OR name LIKE concat('%', #{query}, '%') escape '/')
- </if>
- <if test="parentId != null">
- AND parent_device_id = #{parentId}
- </if>
- </where>
- ORDER BY id
- </select>
-</mapper>
\ No newline at end of file
diff --git a/ard-modules/ard-modules-work/pom.xml b/ard-modules/ard-modules-work/pom.xml
index e137cdb..097c113 100644
--- a/ard-modules/ard-modules-work/pom.xml
+++ b/ard-modules/ard-modules-work/pom.xml
@@ -193,10 +193,6 @@
<artifactId>spring-test</artifactId>
<version>5.3.18</version>
</dependency>
- <dependency>
- <groupId>com.ard</groupId>
- <artifactId>ard-api-qs</artifactId>
- </dependency>
</dependencies>
<build>
diff --git a/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/api/ArdChannelApiController.java b/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/api/ArdChannelApiController.java
index fad5443..4d11e85 100644
--- a/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/api/ArdChannelApiController.java
+++ b/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/api/ArdChannelApiController.java
@@ -1,20 +1,11 @@
package com.ard.work.device.channel.api;
import com.ard.common.core.domain.R;
-import com.ard.common.core.utils.poi.ExcelUtil;
import com.ard.common.core.web.controller.BaseController;
-import com.ard.common.core.web.domain.AjaxResult;
-import com.ard.common.core.web.page.TableDataInfo;
-import com.ard.common.log.annotation.Log;
-import com.ard.common.log.enums.BusinessType;
import com.ard.common.security.annotation.InnerAuth;
-import com.ard.common.security.annotation.RequiresPermissions;
-import com.ard.qs.api.domain.QsDevice;
import com.ard.work.api.domian.ArdChannel;
import com.ard.work.device.channel.service.IArdChannelService;
-import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
-import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
diff --git a/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/mapper/ArdChannelMapper.java b/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/mapper/ArdChannelMapper.java
index 97b7644..a3ac3ad 100644
--- a/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/mapper/ArdChannelMapper.java
+++ b/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/mapper/ArdChannelMapper.java
@@ -1,6 +1,5 @@
package com.ard.work.device.channel.mapper;
-import com.ard.qs.api.domain.QsDevice;
import com.ard.work.api.domian.ArdChannel;
import org.apache.ibatis.annotations.Param;
diff --git a/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/IArdChannelService.java b/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/IArdChannelService.java
index c2378a1..23afbed 100644
--- a/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/IArdChannelService.java
+++ b/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/IArdChannelService.java
@@ -1,6 +1,5 @@
package com.ard.work.device.channel.service;
-import com.ard.qs.api.domain.QsDevice;
import com.ard.work.api.domian.ArdChannel;
import java.util.List;
diff --git a/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/impl/ArdChannelServiceImpl.java b/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/impl/ArdChannelServiceImpl.java
index 74ce42a..4f4e03c 100644
--- a/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/impl/ArdChannelServiceImpl.java
+++ b/ard-modules/ard-modules-work/src/main/java/com/ard/work/device/channel/service/impl/ArdChannelServiceImpl.java
@@ -1,17 +1,8 @@
package com.ard.work.device.channel.service.impl;
-import com.ard.common.core.constant.CacheConstants;
-import com.ard.common.core.constant.Constants;
-import com.ard.common.core.constant.SecurityConstants;
import com.ard.common.core.constant.UserConstants;
-import com.ard.common.core.domain.R;
-import com.ard.common.core.enums.LiveStreamType;
import com.ard.common.core.utils.uuid.IdUtils;
import com.ard.common.redis.service.RedisService;
-import com.ard.qs.api.RemoteQsDeviceService;
-import com.ard.qs.api.domain.QsDevice;
-import com.ard.work.api.domian.ArdCamera;
-import com.ard.work.api.domian.ArdCameraHepu;
import com.ard.work.api.domian.ArdChannel;
import com.ard.work.device.channel.mapper.ArdChannelMapper;
import com.ard.work.device.channel.service.IArdChannelService;
@@ -19,9 +10,9 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+
import java.util.List;
import java.util.Objects;
-import java.util.Optional;
/**
* 通道管理Service业务层处理
@@ -34,8 +25,6 @@
public class ArdChannelServiceImpl implements IArdChannelService {
@Resource
private ArdChannelMapper ardChannelMapper;
- @Resource
- private RemoteQsDeviceService remoteQsDeviceService;
@Resource
private RedisService redisService;
@@ -105,11 +94,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteArdChannelByIds(String[] ids) {
- int i = ardChannelMapper.deleteArdChannelByIds(ids);
- if (i > 0) {
- R<Boolean> delR = remoteQsDeviceService.removeQsDevice(ids, SecurityConstants.INNER);
- }
- return i;
+ return ardChannelMapper.deleteArdChannelByIds(ids);
}
/**
diff --git a/ard-modules/ard-modules-work/src/main/java/com/ard/work/websocket/config/PTZWebSocketInitializer.java b/ard-modules/ard-modules-work/src/main/java/com/ard/work/websocket/config/PTZWebSocketInitializer.java
new file mode 100644
index 0000000..2ddbc0e
--- /dev/null
+++ b/ard-modules/ard-modules-work/src/main/java/com/ard/work/websocket/config/PTZWebSocketInitializer.java
@@ -0,0 +1,24 @@
+package com.ard.work.websocket.config;
+
+import com.ard.work.websocket.utils.PTZWebSocketUtils;
+import jakarta.annotation.PostConstruct;
+import jakarta.annotation.Resource;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.stereotype.Component;
+
+/**
+ * 将 wsPushExecutor 静态注入 PTZWebSocketUtils,启用异步并行广播
+ *
+ * @author 刘苏义
+ */
+@Component
+public class PTZWebSocketInitializer {
+
+ @Resource(name = "wsPushExecutor")
+ private ThreadPoolTaskExecutor wsPushExecutor;
+
+ @PostConstruct
+ public void init() {
+ PTZWebSocketUtils.setPushExecutor(wsPushExecutor);
+ }
+}
diff --git a/ard-modules/ard-modules-zlm/pom.xml b/ard-modules/ard-modules-zlm/pom.xml
index e09a6db..651f78a 100644
--- a/ard-modules/ard-modules-zlm/pom.xml
+++ b/ard-modules/ard-modules-zlm/pom.xml
@@ -92,11 +92,6 @@
<groupId>com.ard</groupId>
<artifactId>ard-api-zlm</artifactId>
</dependency>
- <!-- 泉视 接口 -->
- <dependency>
- <groupId>com.ard</groupId>
- <artifactId>ard-api-qs</artifactId>
- </dependency>
<!-- gb28181 接口 -->
<dependency>
<groupId>com.ard</groupId>
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/controller/ZlmController.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/controller/ZlmController.java
index 6f325da..54a3f88 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/controller/ZlmController.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/controller/ZlmController.java
@@ -11,8 +11,8 @@
import com.ard.gb28181.api.domain.Device;
import com.ard.gb28181.api.domain.DeviceChannel;
import com.ard.gb28181.api.domain.GbChannelDTO;
-import com.ard.qs.api.RemoteQsDeviceService;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.domain.StreamChannel;
+import com.ard.zlm.service.ZlmStreamService;
import com.ard.work.api.RemoteCameraService;
import com.ard.zlm.api.domain.*;
import com.ard.zlm.common.InviteErrorCode;
@@ -68,7 +68,7 @@
private RemoteGb28181Service remoteGb28181Service;
@Resource
- private RemoteQsDeviceService remoteQsDeviceService;
+ private ZlmStreamService zlmStreamService;
@Resource
@Lazy
@@ -502,50 +502,50 @@
log.info("[gb28181 开始点播] id:{} ", id);
Assert.notNull(id, "设备id");
- R<QsDevice> qsDevicer = remoteQsDeviceService.getQsDeviceInfo(id, SecurityConstants.INNER);
+ R<StreamChannel> qsDevicer = zlmStreamService.getQsDeviceInfo(id, SecurityConstants.INNER);
if (qsDevicer.getCode() != Constants.SUCCESS) {
throw new RuntimeException("获取设备信息失败 id:" + id);
}
Assert.notNull(qsDevicer.getData(), "设备不存在 id:" + id);
- QsDevice qsDevice = qsDevicer.getData();
+ StreamChannel streamChannel = qsDevicer.getData();
- if ("OFFLINE".equals(qsDevice.getDeviceStatus())) {
+ if (!Boolean.TRUE.equals(streamChannel.getDeviceOnLine())) {
throw new RuntimeException("设备不在线 id:" + id);
}
- R<Device> deviceR = remoteGb28181Service.getDeviceByDeviceId(qsDevice.getGbDeviceId(), SecurityConstants.INNER);
+ R<Device> deviceR = remoteGb28181Service.getDeviceByDeviceId(streamChannel.getGbDeviceId(), SecurityConstants.INNER);
if (deviceR.getCode() != Constants.SUCCESS) {
- throw new RuntimeException("gb28181 获取设备信息失败 id:" + qsDevice.getGbDeviceId());
+ throw new RuntimeException("gb28181 获取设备信息失败 id:" + streamChannel.getGbDeviceId());
}
- Assert.notNull(deviceR.getData(), "gb28181 国标设备不存在 id:" + qsDevice.getGbDeviceId());
+ Assert.notNull(deviceR.getData(), "gb28181 国标设备不存在 id:" + streamChannel.getGbDeviceId());
if (!deviceR.getData().isOnLine()) {
- throw new RuntimeException("gb28181 国标设备不在线失败 id:" + qsDevice.getGbDeviceId());
+ throw new RuntimeException("gb28181 国标设备不在线失败 id:" + streamChannel.getGbDeviceId());
}
- R<DeviceChannel> deviceChannelR = remoteGb28181Service.getDeviceChannelByChannelId(qsDevice.getGbDeviceId(), qsDevice.getGbChannelId(), SecurityConstants.INNER);
+ R<DeviceChannel> deviceChannelR = remoteGb28181Service.getDeviceChannelByChannelId(streamChannel.getGbDeviceId(), streamChannel.getGbChannelId(), SecurityConstants.INNER);
if (deviceChannelR.getCode() != Constants.SUCCESS) {
- throw new RuntimeException("gb28181 获取设备通道失败 gbDeviceId:" + qsDevice.getGbDeviceId() + ",gbChannelId:" + qsDevice.getGbChannelId());
+ throw new RuntimeException("gb28181 获取设备通道失败 gbDeviceId:" + streamChannel.getGbDeviceId() + ",gbChannelId:" + streamChannel.getGbChannelId());
}
- Assert.notNull(deviceChannelR.getData(), "gb28181 获取设备通道失败不存在 gbDeviceId:" + qsDevice.getGbDeviceId() + ",gbChannelId:" + qsDevice.getGbChannelId());
+ Assert.notNull(deviceChannelR.getData(), "gb28181 获取设备通道失败不存在 gbDeviceId:" + streamChannel.getGbDeviceId() + ",gbChannelId:" + streamChannel.getGbChannelId());
if (!"ON".equals(deviceChannelR.getData().getStatus())) {
- throw new RuntimeException("gb28181 国标设备通道不在线失败 gbDeviceId:" + qsDevice.getGbDeviceId() + ",gbChannelId:" + qsDevice.getGbChannelId());
+ throw new RuntimeException("gb28181 国标设备通道不在线失败 gbDeviceId:" + streamChannel.getGbDeviceId() + ",gbChannelId:" + streamChannel.getGbChannelId());
}
DeferredResult<R<StreamContent>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue());
result.onTimeout(() -> {
- log.info("[点播等待超时] gbDeviceId:{}, gbChannelId:{}, ", qsDevice.getGbDeviceId(), qsDevice.getGbChannelId());
+ log.info("[点播等待超时] gbDeviceId:{}, gbChannelId:{}, ", streamChannel.getGbDeviceId(), streamChannel.getGbChannelId());
// 释放rtpserver
R<StreamContent> wvpResult = R.fail();
wvpResult.setMsg("点播超时");
result.setResult(wvpResult);
- inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, qsDevice.getId());
- mediaServerService.stopGb28181Play(InviteSessionType.PLAY, qsDevice, deviceR.getData(), qsDevice.getDeviceCode());
+ inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, streamChannel.getId());
+ mediaServerService.stopGb28181Play(InviteSessionType.PLAY, streamChannel, deviceR.getData(), streamChannel.getDeviceCode());
});
ErrorCallback<StreamInfo> callback = (code, msg, streamInfo) -> {
@@ -578,8 +578,8 @@
}
};
- qsDevice.setStreamMode(deviceR.getData().getStreamMode());
- mediaServerService.startGb28181Play(qsDevice, deviceR.getData(), callback);
+ streamChannel.setStreamMode(deviceR.getData().getStreamMode());
+ mediaServerService.startGb28181Play(streamChannel, deviceR.getData(), callback);
return result;
}
@@ -595,43 +595,43 @@
log.info("[gb28181 停止点播] id:{} ", id);
Assert.notNull(id, "设备id");
- R<QsDevice> qsDevicer = remoteQsDeviceService.getQsDeviceInfo(id, SecurityConstants.INNER);
+ R<StreamChannel> qsDevicer = zlmStreamService.getQsDeviceInfo(id, SecurityConstants.INNER);
if (qsDevicer.getCode() != Constants.SUCCESS) {
throw new RuntimeException("获取设备信息失败 id:" + id);
}
Assert.notNull(qsDevicer.getData(), "设备不存在 id:" + id);
- QsDevice qsDevice = qsDevicer.getData();
+ StreamChannel streamChannel = qsDevicer.getData();
- if ("OFFLINE".equals(qsDevice.getDeviceStatus())) {
+ if (!Boolean.TRUE.equals(streamChannel.getDeviceOnLine())) {
throw new RuntimeException("设备不在线 id:" + id);
}
- R<Device> deviceR = remoteGb28181Service.getDeviceByDeviceId(qsDevice.getGbDeviceId(), SecurityConstants.INNER);
+ R<Device> deviceR = remoteGb28181Service.getDeviceByDeviceId(streamChannel.getGbDeviceId(), SecurityConstants.INNER);
if (deviceR.getCode() != Constants.SUCCESS) {
- throw new RuntimeException("gb28181 获取设备信息失败 id:" + qsDevice.getGbDeviceId());
+ throw new RuntimeException("gb28181 获取设备信息失败 id:" + streamChannel.getGbDeviceId());
}
- Assert.notNull(deviceR.getData(), "gb28181 国标设备不存在 id:" + qsDevice.getGbDeviceId());
+ Assert.notNull(deviceR.getData(), "gb28181 国标设备不存在 id:" + streamChannel.getGbDeviceId());
if (!deviceR.getData().isOnLine()) {
- throw new RuntimeException("gb28181 国标设备不在线失败 id:" + qsDevice.getGbDeviceId());
+ throw new RuntimeException("gb28181 国标设备不在线失败 id:" + streamChannel.getGbDeviceId());
}
- R<DeviceChannel> deviceChannelR = remoteGb28181Service.getDeviceChannelByChannelId(qsDevice.getGbDeviceId(), qsDevice.getGbChannelId(), SecurityConstants.INNER);
+ R<DeviceChannel> deviceChannelR = remoteGb28181Service.getDeviceChannelByChannelId(streamChannel.getGbDeviceId(), streamChannel.getGbChannelId(), SecurityConstants.INNER);
if (deviceChannelR.getCode() != Constants.SUCCESS) {
- throw new RuntimeException("gb28181 获取设备通道失败 gbDeviceId:" + qsDevice.getGbDeviceId() + ",gbChannelId:" + qsDevice.getGbChannelId());
+ throw new RuntimeException("gb28181 获取设备通道失败 gbDeviceId:" + streamChannel.getGbDeviceId() + ",gbChannelId:" + streamChannel.getGbChannelId());
}
- Assert.notNull(deviceChannelR.getData(), "gb28181 获取设备通道失败不存在 gbDeviceId:" + qsDevice.getGbDeviceId() + ",gbChannelId:" + qsDevice.getGbChannelId());
+ Assert.notNull(deviceChannelR.getData(), "gb28181 获取设备通道失败不存在 gbDeviceId:" + streamChannel.getGbDeviceId() + ",gbChannelId:" + streamChannel.getGbChannelId());
if (!"ON".equals(deviceChannelR.getData().getStatus())) {
- throw new RuntimeException("gb28181 国标设备通道不在线失败 gbDeviceId:" + qsDevice.getGbDeviceId() + ",gbChannelId:" + qsDevice.getGbChannelId());
+ throw new RuntimeException("gb28181 国标设备通道不在线失败 gbDeviceId:" + streamChannel.getGbDeviceId() + ",gbChannelId:" + streamChannel.getGbChannelId());
}
- mediaServerService.stopGb28181Play(InviteSessionType.PLAY, qsDevice, deviceR.getData(), qsDevice.getDeviceCode());
+ mediaServerService.stopGb28181Play(InviteSessionType.PLAY, streamChannel, deviceR.getData(), streamChannel.getDeviceCode());
JSONObject json = new JSONObject();
- json.put("deviceId", qsDevice.getGbDeviceId());
- json.put("channelId", qsDevice.getGbChannelId());
+ json.put("deviceId", streamChannel.getGbDeviceId());
+ json.put("channelId", streamChannel.getGbChannelId());
return AjaxResult.success(json);
}
@@ -662,7 +662,7 @@
}
Assert.notNull(channelR.getData(), "GbChannel不存在 gbDeviceId:" + gbDeviceId + " gbChannelId:" + gbChannelId);
- GbChannelDTO gbChannelDTO = channelR.getData();
+ StreamChannel streamChannel = ZlmStreamService.toStreamChannel(channelR.getData());
// 2. 查询国标设备
R<Device> deviceR = remoteGb28181Service.getDeviceByDeviceId(gbDeviceId, SecurityConstants.INNER);
@@ -694,8 +694,8 @@
fail.setMsg("点播超时");
result.setResult(fail);
- inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, gbChannelDTO.getId());
- mediaServerService.stopGb28181PlayByGbChannel(InviteSessionType.PLAY, gbChannelDTO, deviceR.getData(), gbChannelDTO.getDeviceCode());
+ inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, streamChannel.getId());
+ mediaServerService.stopGb28181PlayByGbChannel(InviteSessionType.PLAY, streamChannel, deviceR.getData(), streamChannel.getDeviceCode());
});
ErrorCallback<StreamInfo> callback = (code, msg, streamInfo) -> {
@@ -728,7 +728,7 @@
}
};
- mediaServerService.startGb28181PlayByGbChannel(gbChannelDTO, deviceR.getData(), callback);
+ mediaServerService.startGb28181PlayByGbChannel(streamChannel, deviceR.getData(), callback);
return result;
}
@@ -755,7 +755,7 @@
throw new RuntimeException("GbChannel不存在 gbDeviceId:" + gbDeviceId + " gbChannelId:" + gbChannelId);
}
- GbChannelDTO gbChannelDTO = channelR.getData();
+ StreamChannel streamChannel = ZlmStreamService.toStreamChannel(channelR.getData());
// 2. 查询国标设备
R<Device> deviceR = remoteGb28181Service.getDeviceByDeviceId(gbDeviceId, SecurityConstants.INNER);
@@ -771,8 +771,8 @@
}
Assert.notNull(deviceChannelR.getData(), "gb28181 国标设备通道不存在 gbDeviceId:" + gbDeviceId + " gbChannelId:" + gbChannelId);
- mediaServerService.stopGb28181PlayByGbChannel(InviteSessionType.PLAY, gbChannelDTO,
- deviceR.getData(), gbChannelDTO.getDeviceCode());
+ mediaServerService.stopGb28181PlayByGbChannel(InviteSessionType.PLAY, streamChannel,
+ deviceR.getData(), streamChannel.getDeviceCode());
JSONObject json = new JSONObject();
json.put("gbDeviceId", gbDeviceId);
@@ -803,9 +803,9 @@
}
Assert.notNull(channelR.getData(), "GbChannel不存在 channelId:" + channelId);
- GbChannelDTO gbChannelDTO = channelR.getData();
- String gbDeviceId = gbChannelDTO.getGbDeviceId();
- String gbChannelId = gbChannelDTO.getGbChannelId();
+ StreamChannel streamChannel = ZlmStreamService.toStreamChannel(channelR.getData());
+ String gbDeviceId = streamChannel.getGbDeviceId();
+ String gbChannelId = streamChannel.getGbChannelId();
// 2. 查询国标设备
R<Device> deviceR = remoteGb28181Service.getDeviceByDeviceId(gbDeviceId, SecurityConstants.INNER);
@@ -837,8 +837,8 @@
fail.setMsg("点播超时");
result.setResult(fail);
- inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, gbChannelDTO.getId());
- mediaServerService.stopGb28181PlayByGbChannel(InviteSessionType.PLAY, gbChannelDTO, deviceR.getData(), gbChannelDTO.getDeviceCode());
+ inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, streamChannel.getId());
+ mediaServerService.stopGb28181PlayByGbChannel(InviteSessionType.PLAY, streamChannel, deviceR.getData(), streamChannel.getDeviceCode());
});
ErrorCallback<StreamInfo> callback = (code, msg, streamInfo) -> {
@@ -871,7 +871,7 @@
}
};
- mediaServerService.startGb28181PlayByGbChannel(gbChannelDTO, deviceR.getData(), callback);
+ mediaServerService.startGb28181PlayByGbChannel(streamChannel, deviceR.getData(), callback);
return result;
}
@@ -893,9 +893,9 @@
throw new RuntimeException("GbChannel不存在 channelId:" + channelId);
}
- GbChannelDTO gbChannelDTO = channelR.getData();
- String gbDeviceId = gbChannelDTO.getGbDeviceId();
- String gbChannelId = gbChannelDTO.getGbChannelId();
+ StreamChannel streamChannel = ZlmStreamService.toStreamChannel(channelR.getData());
+ String gbDeviceId = streamChannel.getGbDeviceId();
+ String gbChannelId = streamChannel.getGbChannelId();
// 2. 查询国标设备
R<Device> deviceR = remoteGb28181Service.getDeviceByDeviceId(gbDeviceId, SecurityConstants.INNER);
@@ -911,8 +911,8 @@
}
Assert.notNull(deviceChannelR.getData(), "gb28181 国标设备通道不存在 gbDeviceId:" + gbDeviceId + " gbChannelId:" + gbChannelId);
- mediaServerService.stopGb28181PlayByGbChannel(InviteSessionType.PLAY, gbChannelDTO,
- deviceR.getData(), gbChannelDTO.getDeviceCode());
+ mediaServerService.stopGb28181PlayByGbChannel(InviteSessionType.PLAY, streamChannel,
+ deviceR.getData(), streamChannel.getDeviceCode());
JSONObject json = new JSONObject();
json.put("channelId", channelId);
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/domain/StreamChannel.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/domain/StreamChannel.java
new file mode 100644
index 0000000..c6eb447
--- /dev/null
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/domain/StreamChannel.java
@@ -0,0 +1,60 @@
+package com.ard.zlm.domain;
+
+import lombok.Data;
+
+/**
+ * ZLM 内部流通道对象
+ * <p>
+ * 统一表示可播放的通道,无论来源是国标设备(GbChannel)还是普通相机。
+ */
+@Data
+public class StreamChannel {
+
+ /** 通道ID */
+ private Long id;
+
+ /** 通道名称 */
+ private String channelName;
+
+ /** 设备编码(流标识) */
+ private String deviceCode;
+
+ /** 流标识(ZLM stream key) */
+ private String streamKey;
+
+ /** 流媒体服务ID */
+ private String mediaServerId;
+
+ /** 流状态(0=停止, 1=直播中) */
+ private String streamStatus;
+
+ /** 开启mp4录制 */
+ private String enableMp4;
+
+ /** 截图路径 */
+ private String snap;
+
+ /** 国标设备编码(仅国标通道) */
+ private String gbDeviceId;
+
+ /** 国标通道编码(仅国标通道) */
+ private String gbChannelId;
+
+ /** 流传输模式 */
+ private String streamMode;
+
+ /** 通道类型:gb28181 / camera */
+ private String channelType;
+
+ /** 流接入类型(兼容旧QsDevice: 1=RTSP,2=RTMP,12=GB28181,13=PUSH) */
+ private String type;
+
+ /** 状态(兼容旧QsDevice: ENABLE/DEACTIVATE) */
+ private String status;
+
+ /** 直播流地址(兼容旧QsDevice,国标通道不需要) */
+ private String liveAddress;
+
+ /** 父设备在线状态(用于判断能否播放) */
+ private Boolean deviceOnLine;
+}
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IDevicePlayService.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IDevicePlayService.java
index f9163d0..0181776 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IDevicePlayService.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IDevicePlayService.java
@@ -1,6 +1,6 @@
package com.ard.zlm.service;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.domain.StreamChannel;
import com.ard.work.api.domian.ArdChannel;
import com.ard.zlm.api.domain.StreamInfo;
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IMediaServerService.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IMediaServerService.java
index 7d49b49..ad8048f 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IMediaServerService.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/IMediaServerService.java
@@ -1,8 +1,8 @@
package com.ard.zlm.service;
import com.ard.gb28181.api.domain.Device;
-import com.ard.gb28181.api.domain.GbChannelDTO;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.domain.StreamChannel;
+import com.ard.zlm.domain.StreamChannel;
import com.ard.work.api.domian.ArdChannel;
import com.ard.zlm.api.domain.*;
import com.ard.zlm.common.InviteSessionType;
@@ -336,11 +336,11 @@
/**
* gb28181 播放
*
- * @param qsDevice
+ * @param streamChannel
* @param gbDevice
* @param callback
*/
- void startGb28181Play(QsDevice qsDevice, Device gbDevice, ErrorCallback<StreamInfo> callback);
+ void startGb28181Play(StreamChannel streamChannel, Device gbDevice, ErrorCallback<StreamInfo> callback);
/**
* 连接rtp服务
@@ -357,19 +357,19 @@
* gb28181 停止点播
*
* @param type
- * @param qsDevice
+ * @param streamChannel
* @param device
* @param stream
*/
- void stopGb28181Play(InviteSessionType type, QsDevice qsDevice, Device device, String stream);
+ void stopGb28181Play(InviteSessionType type, StreamChannel streamChannel, Device device, String stream);
/**
* gb28181 播放(基于GbChannel,不依赖QS)
*/
- void startGb28181PlayByGbChannel(GbChannelDTO gbChannelDTO, Device gbDevice, ErrorCallback<StreamInfo> callback);
+ void startGb28181PlayByGbChannel(StreamChannel streamChannel, Device gbDevice, ErrorCallback<StreamInfo> callback);
/**
* gb28181 停止点播(基于GbChannel,不依赖QS)
*/
- void stopGb28181PlayByGbChannel(InviteSessionType type, GbChannelDTO gbChannelDTO, Device device, String stream);
+ void stopGb28181PlayByGbChannel(InviteSessionType type, StreamChannel streamChannel, Device device, String stream);
}
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ISourcePlayService.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ISourcePlayService.java
index 9331a7e..46ca25f 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ISourcePlayService.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ISourcePlayService.java
@@ -1,6 +1,6 @@
package com.ard.zlm.service;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.domain.StreamChannel;
import com.ard.work.api.domian.ArdChannel;
import com.ard.zlm.api.domain.StreamInfo;
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ZlmStreamService.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ZlmStreamService.java
new file mode 100644
index 0000000..9efb4cb
--- /dev/null
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/ZlmStreamService.java
@@ -0,0 +1,107 @@
+package com.ard.zlm.service;
+
+import com.ard.common.core.constant.SecurityConstants;
+import com.ard.common.core.domain.R;
+import com.ard.gb28181.api.RemoteGb28181Service;
+import com.ard.gb28181.api.domain.GbChannelDTO;
+import com.ard.zlm.domain.StreamChannel;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * ZLM流媒体本地服务(统一管理国标通道和普通相机通道的流状态)
+ */
+@Slf4j
+@Service
+public class ZlmStreamService {
+
+ @Autowired
+ private RemoteGb28181Service remoteGb28181Service;
+
+ /**
+ * 根据ID获取通道信息
+ */
+ public R<StreamChannel> getQsDeviceInfo(Long id, String inner) {
+ try {
+ R<GbChannelDTO> r = remoteGb28181Service.getGbChannelById(id, SecurityConstants.INNER);
+ if (r != null && r.getData() != null && r.getData().getId() != null) {
+ return R.ok(toStreamChannel(r.getData()));
+ }
+ } catch (Exception e) {
+ log.error("[ZlmStream] 查询通道信息失败 id={}", id, e);
+ }
+ return R.ok(new StreamChannel());
+ }
+
+ /**
+ * 根据流标识获取通道
+ */
+ public R<StreamChannel> getQsDeviceStream(String stream, String inner) {
+ log.debug("[ZlmStream] 查找流: stream={}", stream);
+ return R.ok(new StreamChannel());
+ }
+
+ /**
+ * 更新通道流信息
+ */
+ public R<Boolean> updateQsDevice(StreamChannel streamChannel, String inner) {
+ try {
+ if (streamChannel.getId() != null && streamChannel.getId() > 0) {
+ GbChannelDTO dto = new GbChannelDTO();
+ dto.setId(streamChannel.getId());
+ dto.setStreamKey(streamChannel.getStreamKey());
+ dto.setMediaServerId(streamChannel.getMediaServerId());
+ dto.setStreamStatus(streamChannel.getStreamStatus());
+ dto.setSnap(streamChannel.getSnap());
+ R<Boolean> r = remoteGb28181Service.updateGbChannelStream(dto, SecurityConstants.INNER);
+ if (r != null && r.getData() != null) {
+ return r;
+ }
+ }
+ } catch (Exception e) {
+ log.error("[ZlmStream] 更新流信息失败 id={}", streamChannel.getId(), e);
+ }
+ return R.ok(false);
+ }
+
+ /**
+ * 新增通道
+ */
+ public R<Boolean> addQsDevice(StreamChannel streamChannel, String inner) {
+ log.info("[ZlmStream] 新增通道请求: channelName={}, channelType={}",
+ streamChannel.getChannelName(), streamChannel.getChannelType());
+ return R.ok(true);
+ }
+
+ /**
+ * 根据计划ID统计设备数量
+ */
+ public R<Integer> countRecordPlanDevice(Long planId, String inner) {
+ return R.ok(0);
+ }
+
+ /**
+ * 清理设备计划ID
+ */
+ public R<Void> cleanRecordPlanId(Long planId, String inner) {
+ return R.ok();
+ }
+
+ public static StreamChannel toStreamChannel(GbChannelDTO c) {
+ StreamChannel sc = new StreamChannel();
+ sc.setId(c.getId());
+ sc.setChannelName(c.getChannelName());
+ sc.setDeviceCode(c.getDeviceCode());
+ sc.setStreamKey(c.getStreamKey());
+ sc.setMediaServerId(c.getMediaServerId());
+ sc.setStreamStatus(c.getStreamStatus());
+ sc.setSnap(c.getSnap());
+ sc.setEnableMp4(c.getEnableMp4());
+ sc.setGbDeviceId(c.getGbDeviceId());
+ sc.setGbChannelId(c.getGbChannelId());
+ sc.setStreamMode(c.getStreamMode());
+ sc.setChannelType("gb28181");
+ return sc;
+ }
+}
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/DevicePlayServiceImpl.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/DevicePlayServiceImpl.java
index 79abe58..22e9d6d 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/DevicePlayServiceImpl.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/DevicePlayServiceImpl.java
@@ -1,7 +1,7 @@
package com.ard.zlm.service.impl;
import com.ard.common.core.enums.LiveStreamType;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.domain.StreamChannel;
import com.ard.work.api.domian.ArdChannel;
import com.ard.zlm.api.domain.StreamInfo;
import com.ard.zlm.service.ErrorCallback;
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServerServiceImpl.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServerServiceImpl.java
index f43e858..61b5487 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServerServiceImpl.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServerServiceImpl.java
@@ -11,9 +11,9 @@
import com.ard.common.core.utils.file.FileMultipartFile;
import com.ard.gb28181.api.RemoteGb28181Service;
import com.ard.gb28181.api.domain.Device;
-import com.ard.gb28181.api.domain.GbChannelDTO;
-import com.ard.qs.api.RemoteQsDeviceService;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.domain.StreamChannel;
+import com.ard.zlm.service.ZlmStreamService;
+import com.ard.zlm.domain.StreamChannel;
import com.ard.system.api.RemoteFileService;
import com.ard.system.api.domain.SysFile;
import com.ard.work.api.RemoteCameraService;
@@ -106,7 +106,7 @@
private HookSubscribe subscribe;
@Resource
- private RemoteQsDeviceService remoteQsDeviceService;
+ private ZlmStreamService zlmStreamService;
@Resource
private RemoteChannelService remoteChannelService;
@@ -185,7 +185,7 @@
}
redisCatchStorage.updateStreamAuthorityInfo(event.getApp(), event.getStream(), streamAuthorityInfo);
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceStream("pull_" + event.getApp() + "_" + event.getStream(),
+ R<StreamChannel> r = zlmStreamService.getQsDeviceStream("pull_" + event.getApp() + "_" + event.getStream(),
SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
log.error("获取设备信息失败,stream:{}", event.getStream());
@@ -193,7 +193,7 @@
}
if (r.getData() == null) {
- r = remoteQsDeviceService.getQsDeviceStream(event.getStream(), SecurityConstants.INNER);
+ r = zlmStreamService.getQsDeviceStream(event.getStream(), SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
log.error("获取设备信息失败,stream:{}", event.getStream());
return;
@@ -201,10 +201,9 @@
}
if (r.getData() == null) {
- QsDevice device = new QsDevice();
- device.setDeviceStatus("ON");
+ StreamChannel device = new StreamChannel();
device.setMediaServerId(mediaInfo.getMediaServer().getId());
- device.setDeviceName("推流设备_" + event.getApp() + "_" + event.getStream());
+ device.setChannelName("推流设备_" + event.getApp() + "_" + event.getStream());
device.setType(LiveStreamType.PUSH.getCode());
device.setStatus("ENABLE");
device.setStreamStatus("1");
@@ -214,7 +213,7 @@
String filePath = snapOnPlay(mediaInfo.getMediaServer(), event.getApp(), event.getStream());
device.setSnap(filePath);
- R<Boolean> addR = remoteQsDeviceService.addQsDevice(device, SecurityConstants.INNER);
+ R<Boolean> addR = zlmStreamService.addQsDevice(device, SecurityConstants.INNER);
if (addR.getCode() != Constants.SUCCESS) {
throw new RuntimeException("添加推流设备设备失败" + event.getApp() + "_" + event.getStream());
}
@@ -223,15 +222,14 @@
throw new RuntimeException("添加推流设备设备失败" + event.getApp() + "_" + event.getStream());
}
} else {
- QsDevice device = new QsDevice();
- device.setDeviceStatus("ON");
+ StreamChannel device = new StreamChannel();
device.setMediaServerId(mediaInfo.getMediaServer().getId());
device.setStreamKey(r.getData().getDeviceCode());
device.setStreamStatus("1");
device.setId(r.getData().getId());
String filePath = snapOnPlay(mediaInfo.getMediaServer(), event.getApp(), event.getStream());
device.setSnap(filePath);
- R<Boolean> updateR = remoteQsDeviceService.updateQsDevice(device, SecurityConstants.INNER);
+ R<Boolean> updateR = zlmStreamService.updateQsDevice(device, SecurityConstants.INNER);
if (updateR.getCode() != Constants.SUCCESS) {
throw new RuntimeException("修改推流设备设备失败" + event.getApp() + "_" + event.getStream());
}
@@ -269,7 +267,7 @@
if (inviteInfo != null && (inviteInfo.getType() == InviteSessionType.PLAY || inviteInfo.getType() == InviteSessionType.PLAYBACK)) {
inviteStreamService.removeInviteInfo(inviteInfo);
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(Long.valueOf(inviteInfo.getDeviceId()),
+ R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(Long.valueOf(inviteInfo.getDeviceId()),
SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
return;
@@ -301,7 +299,7 @@
}
if ("video_file".equals(event.getApp())) {
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceStream(event.getStream(), SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceStream(event.getStream(), SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
return;
}
@@ -310,12 +308,12 @@
return;
}
- QsDevice qsDevice = new QsDevice();
- qsDevice.setId(r.getData().getId());
- qsDevice.setStreamKey("");
- qsDevice.setMediaServerId("");
- qsDevice.setStreamStatus("0");
- R<Boolean> qsDevicer = remoteQsDeviceService.updateQsDevice(qsDevice, SecurityConstants.INNER);
+ StreamChannel streamChannel = new StreamChannel();
+ streamChannel.setId(r.getData().getId());
+ streamChannel.setStreamKey("");
+ streamChannel.setMediaServerId("");
+ streamChannel.setStreamStatus("0");
+ R<Boolean> qsDevicer = zlmStreamService.updateQsDevice(streamChannel, SecurityConstants.INNER);
if (qsDevicer.getCode() != Constants.SUCCESS) {
log.error("更新设备失败");
}
@@ -343,7 +341,7 @@
redisCatchStorage.removePushListItem(event.getApp(), event.getStream(), event.getMediaServer().getId());
}
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceStream("pull_" + event.getApp() + "_" + event.getStream(),
+ R<StreamChannel> r = zlmStreamService.getQsDeviceStream("pull_" + event.getApp() + "_" + event.getStream(),
SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
log.error("获取设备信息失败,stream:{}", event.getStream());
@@ -351,7 +349,7 @@
}
if (r.getData() == null) {
- r = remoteQsDeviceService.getQsDeviceStream(event.getStream(), SecurityConstants.INNER);
+ r = zlmStreamService.getQsDeviceStream(event.getStream(), SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
log.error("获取设备信息失败,stream:{}", event.getStream());
return;
@@ -361,13 +359,12 @@
if (r.getData() == null) {
return;
}
- QsDevice device = new QsDevice();
- device.setDeviceStatus("OFFLINE");
+ StreamChannel device = new StreamChannel();
device.setMediaServerId("");
device.setStreamKey("");
device.setStreamStatus("0");
device.setId(r.getData().getId());
- R<Boolean> updateR = remoteQsDeviceService.updateQsDevice(device, SecurityConstants.INNER);
+ R<Boolean> updateR = zlmStreamService.updateQsDevice(device, SecurityConstants.INNER);
if (updateR.getCode() != Constants.SUCCESS) {
throw new RuntimeException("修改推流设备设备失败" + event.getApp() + "_" + event.getStream());
}
@@ -991,7 +988,7 @@
return;
}
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(rtpServerParam.getId(), SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(rtpServerParam.getId(), SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
callback.run(InviteErrorCode.FAIL.getCode(), "获取设备信息失败" + rtpServerParam.getId(), null);
return;
@@ -1001,7 +998,7 @@
return;
}
- if ("OFFLINE".equals(r.getData().getDeviceStatus())) {
+ if (!Boolean.TRUE.equals(Boolean.TRUE.equals(r.getData().getDeviceOnLine()))) {
callback.run(InviteErrorCode.FAIL.getCode(), "设备不在线" + rtpServerParam.getId(), null);
return;
}
@@ -1024,7 +1021,7 @@
* @param callback 回调
* @return
*/
- private SSRCInfo play(ZlmMediaServer mediaServer, RTPServerParam rtpServerParam, QsDevice device, String ssrc,
+ private SSRCInfo play(ZlmMediaServer mediaServer, RTPServerParam rtpServerParam, StreamChannel device, String ssrc,
ErrorCallback<StreamInfo> callback) {
// 获取点播的状态信息
InviteInfo inviteInfoInCatch = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY,
@@ -1123,13 +1120,13 @@
String filePath = snapOnPlay(streamInfo.getMediaServer(), streamInfo.getApp(),
streamInfo.getStream());
- QsDevice qsDevice = new QsDevice();
- qsDevice.setId(rtpServerParam.getId());
- qsDevice.setStreamKey(rtpServerParam.getStreamId());
- qsDevice.setMediaServerId(mediaServer.getId());
- qsDevice.setStreamStatus("1");
- qsDevice.setSnap(filePath);
- R<Boolean> r = remoteQsDeviceService.updateQsDevice(qsDevice, SecurityConstants.INNER);
+ StreamChannel streamChannel = new StreamChannel();
+ streamChannel.setId(rtpServerParam.getId());
+ streamChannel.setStreamKey(rtpServerParam.getStreamId());
+ streamChannel.setMediaServerId(mediaServer.getId());
+ streamChannel.setStreamStatus("1");
+ streamChannel.setSnap(filePath);
+ R<Boolean> r = zlmStreamService.updateQsDevice(streamChannel, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("更新设备失败");
}
@@ -1217,14 +1214,14 @@
*/
@Override
public void stopRtpPlay(RTPServerParam rtpServerParam) {
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(rtpServerParam.getId(), SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(rtpServerParam.getId(), SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("获取设备信息失败");
}
if (r.getData() == null) {
throw new RuntimeException("设备不存在");
}
- QsDevice device = r.getData();
+ StreamChannel device = r.getData();
String mediaServerId = device.getMediaServerId();
ZlmMediaServer mediaServer = getOne(mediaServerId);
@@ -1241,12 +1238,12 @@
}
}
- QsDevice qsDevice = new QsDevice();
- qsDevice.setId(rtpServerParam.getId());
- qsDevice.setStreamKey("");
- qsDevice.setMediaServerId("");
- qsDevice.setStreamStatus("0");
- R<Boolean> devicer = remoteQsDeviceService.updateQsDevice(qsDevice, SecurityConstants.INNER);
+ StreamChannel streamChannel = new StreamChannel();
+ streamChannel.setId(rtpServerParam.getId());
+ streamChannel.setStreamKey("");
+ streamChannel.setMediaServerId("");
+ streamChannel.setStreamStatus("0");
+ R<Boolean> devicer = zlmStreamService.updateQsDevice(streamChannel, SecurityConstants.INNER);
if (devicer.getCode() != Constants.SUCCESS) {
throw new RuntimeException("更新设备失败");
}
@@ -1287,7 +1284,7 @@
return;
}
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(id, SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(id, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
callback.run(InviteErrorCode.FAIL.getCode(), "获取设备信息失败" + id, null);
return;
@@ -1297,11 +1294,11 @@
return;
}
- if ("OFFLINE".equals(r.getData().getDeviceStatus())) {
+ if (!Boolean.TRUE.equals(Boolean.TRUE.equals(r.getData().getDeviceOnLine()))) {
throw new RuntimeException("设备不在线" + id);
}
- QsDevice device = r.getData();
+ StreamChannel device = r.getData();
String videoPath = convertUrlToPath(device.getLiveAddress(), this.fileDomain, this.filePrefix, this.filePath);
loadMP4File(mediaServer, "video_file", device.getDeviceCode(), id, videoPath, ((code, msg, streamInfo) -> {
@@ -1316,7 +1313,7 @@
*/
@Override
public void closeStreams(Long id) {
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(id, SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(id, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("获取设备信息失败");
}
@@ -1324,7 +1321,7 @@
throw new RuntimeException("设备不存在");
}
- QsDevice device = r.getData();
+ StreamChannel device = r.getData();
ZlmMediaServer mediaServer = getOne(device.getMediaServerId());
if (mediaServer == null) {
@@ -1610,7 +1607,7 @@
*/
@Override
public Map<String, Object> getStreamPushAddress(Long id, String callId) {
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(id, SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(id, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("获取设备信息失败");
}
@@ -1640,7 +1637,7 @@
*/
@Override
public void streamPullPush(Long id, ErrorCallback<StreamInfo> callback) {
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(id, SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(id, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
log.info("获取设备信息失败 id:{}", id);
callback.run(InviteErrorCode.FAIL.getCode(), "获取设备信息失败", null);
@@ -1651,7 +1648,7 @@
callback.run(InviteErrorCode.FAIL.getCode(), "设备不存在", null);
return;
}
- QsDevice device = r.getData();
+ StreamChannel device = r.getData();
if (!LiveStreamType.PUSH.getCode().equals(device.getType())) {
log.info("直播流接入类型不对,应当是PUSH id:{}", id);
@@ -1672,10 +1669,10 @@
callback.run(InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(),
getStreamInfoByAppAndStream(mediaServer, "push", device.getDeviceCode(), mediaInfo));
if ("0".equals(device.getStreamStatus())) {
- QsDevice qsDevice = new QsDevice();
- qsDevice.setId(id);
- qsDevice.setStreamStatus("1");
- R<Boolean> updateR = remoteQsDeviceService.updateQsDevice(qsDevice, SecurityConstants.INNER);
+ StreamChannel streamChannel = new StreamChannel();
+ streamChannel.setId(id);
+ streamChannel.setStreamStatus("1");
+ R<Boolean> updateR = zlmStreamService.updateQsDevice(streamChannel, SecurityConstants.INNER);
if (updateR.getCode() != Constants.SUCCESS) {
log.info("修改推流设备设备失败 id:{}", id);
throw new RuntimeException("修改推流设备设备失败");
@@ -1694,12 +1691,12 @@
/**
* gb28181 播放
*
- * @param qsDevice
+ * @param streamChannel
* @param gbDevice
* @param callback
*/
@Override
- public void startGb28181Play(QsDevice qsDevice, Device gbDevice, ErrorCallback<StreamInfo> callback) {
+ public void startGb28181Play(StreamChannel streamChannel, Device gbDevice, ErrorCallback<StreamInfo> callback) {
ZlmMediaServer mediaServer = getMediaServerForMinimumLoad(null);
if (mediaServer == null) {
@@ -1707,18 +1704,18 @@
return;
}
- int tcpMode = qsDevice.getStreamMode().equals("TCP-ACTIVE") ? 2 : (qsDevice.getStreamMode().equals("TCP" +
+ int tcpMode = streamChannel.getStreamMode().equals("TCP-ACTIVE") ? 2 : (streamChannel.getStreamMode().equals("TCP" +
"-PASSIVE") ? 1 : 0);
RTPServerParam rtpServerParam = new RTPServerParam();
rtpServerParam.setApp("gb28181");
rtpServerParam.setMediaServer(mediaServer);
rtpServerParam.setType(LiveStreamType.GB28181.getCode());
- rtpServerParam.setStreamId(qsDevice.getDeviceCode());
+ rtpServerParam.setStreamId(streamChannel.getDeviceCode());
rtpServerParam.setTcpMode(tcpMode);
- rtpServerParam.setId(qsDevice.getId());
+ rtpServerParam.setId(streamChannel.getId());
- startGb28181PlayFun(mediaServer, qsDevice, gbDevice, rtpServerParam, null, callback);
+ startGb28181PlayFun(mediaServer, streamChannel, gbDevice, rtpServerParam, null, callback);
}
/**
@@ -1744,21 +1741,21 @@
* gb28181 停止点播
*
* @param type
- * @param qsDevice
+ * @param streamChannel
* @param device
* @param stream
*/
@Override
- public void stopGb28181Play(InviteSessionType type, QsDevice qsDevice, Device device, String stream) {
- InviteInfo inviteInfo = inviteStreamService.getInviteInfo(type, qsDevice.getId(), stream);
+ public void stopGb28181Play(InviteSessionType type, StreamChannel streamChannel, Device device, String stream) {
+ InviteInfo inviteInfo = inviteStreamService.getInviteInfo(type, streamChannel.getId(), stream);
if (inviteInfo == null) {
if (type == InviteSessionType.PLAY) {
- QsDevice qsDeviceUpdate = new QsDevice();
- qsDeviceUpdate.setId(qsDevice.getId());
+ StreamChannel qsDeviceUpdate = new StreamChannel();
+ qsDeviceUpdate.setId(streamChannel.getId());
qsDeviceUpdate.setStreamKey("");
qsDeviceUpdate.setMediaServerId("");
qsDeviceUpdate.setStreamStatus("0");
- R<Boolean> r = remoteQsDeviceService.updateQsDevice(qsDeviceUpdate, SecurityConstants.INNER);
+ R<Boolean> r = zlmStreamService.updateQsDevice(qsDeviceUpdate, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("更新设备失败");
}
@@ -1768,18 +1765,18 @@
inviteStreamService.removeInviteInfo(inviteInfo);
if (InviteSessionStatus.ok == inviteInfo.getStatus()) {
try {
- log.info("[停止点播/回放/下载] {}/{}", qsDevice.getGbDeviceId(), qsDevice.getGbChannelId());
+ log.info("[停止点播/回放/下载] {}/{}", streamChannel.getGbDeviceId(), streamChannel.getGbChannelId());
RtpServerParam rtpServer = new RtpServerParam();
rtpServer.setApp("gb28181");
- rtpServer.setStream(qsDevice.getDeviceCode());
- rtpServer.setGbDeviceId(qsDevice.getGbDeviceId());
- rtpServer.setGbChannelId(qsDevice.getGbChannelId());
+ rtpServer.setStream(streamChannel.getDeviceCode());
+ rtpServer.setGbDeviceId(streamChannel.getGbDeviceId());
+ rtpServer.setGbChannelId(streamChannel.getGbChannelId());
R<Void> r = remoteGb28181Service.streamByeCmd(rtpServer, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
- log.error("[命令发送失败] 停止点播/回放/下载, deviceId:{}", qsDevice.getGbDeviceId());
- throw new RuntimeException("[命令发送失败] 停止点播/回放/下载, deviceId:" + qsDevice.getGbDeviceId());
+ log.error("[命令发送失败] 停止点播/回放/下载, deviceId:{}", streamChannel.getGbDeviceId());
+ throw new RuntimeException("[命令发送失败] 停止点播/回放/下载, deviceId:" + streamChannel.getGbDeviceId());
}
} catch (Exception e) {
log.error("[命令发送失败] 停止点播/回放/下载, 发送BYE: {}", e.getMessage());
@@ -1788,12 +1785,12 @@
}
if (inviteInfo.getType() == InviteSessionType.PLAY) {
- QsDevice qsDeviceUpdate = new QsDevice();
- qsDeviceUpdate.setId(qsDevice.getId());
+ StreamChannel qsDeviceUpdate = new StreamChannel();
+ qsDeviceUpdate.setId(streamChannel.getId());
qsDeviceUpdate.setStreamKey("");
qsDeviceUpdate.setMediaServerId("");
qsDeviceUpdate.setStreamStatus("0");
- R<Boolean> r = remoteQsDeviceService.updateQsDevice(qsDeviceUpdate, SecurityConstants.INNER);
+ R<Boolean> r = zlmStreamService.updateQsDevice(qsDeviceUpdate, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("更新设备失败");
}
@@ -1816,7 +1813,7 @@
* gb28181 播放(基于GbDevice,不依赖QS)
*/
@Override
- public void startGb28181PlayByGbChannel(GbChannelDTO gbChannelDTO, Device gbDevice, ErrorCallback<StreamInfo> callback) {
+ public void startGb28181PlayByGbChannel(StreamChannel streamChannel, Device gbDevice, ErrorCallback<StreamInfo> callback) {
ZlmMediaServer mediaServer = getMediaServerForMinimumLoad(null);
if (mediaServer == null) {
@@ -1824,8 +1821,8 @@
return;
}
- String streamMode = gbChannelDTO.getStreamMode() != null
- ? gbChannelDTO.getStreamMode() : gbDevice.getStreamMode();
+ String streamMode = streamChannel.getStreamMode() != null
+ ? streamChannel.getStreamMode() : gbDevice.getStreamMode();
int tcpMode = streamMode.equals("TCP-ACTIVE") ? 2
: (streamMode.equals("TCP-PASSIVE") ? 1 : 0);
@@ -1833,27 +1830,27 @@
rtpServerParam.setApp("gb28181");
rtpServerParam.setMediaServer(mediaServer);
rtpServerParam.setType(LiveStreamType.GB28181.getCode());
- rtpServerParam.setStreamId(gbChannelDTO.getDeviceCode());
+ rtpServerParam.setStreamId(streamChannel.getDeviceCode());
rtpServerParam.setTcpMode(tcpMode);
- rtpServerParam.setId(gbChannelDTO.getId());
+ rtpServerParam.setId(streamChannel.getId());
- startGb28181PlayFunByGbChannel(mediaServer, gbChannelDTO, gbDevice, rtpServerParam, null, callback);
+ startGb28181PlayFunByGbChannel(mediaServer, streamChannel, gbDevice, rtpServerParam, null, callback);
}
/**
* gb28181 停止点播(基于GbDevice,不依赖QS)
*/
@Override
- public void stopGb28181PlayByGbChannel(InviteSessionType type, GbChannelDTO gbChannelDTO, Device device, String stream) {
- InviteInfo inviteInfo = inviteStreamService.getInviteInfo(type, gbChannelDTO.getId(), stream);
+ public void stopGb28181PlayByGbChannel(InviteSessionType type, StreamChannel streamChannel, Device device, String stream) {
+ InviteInfo inviteInfo = inviteStreamService.getInviteInfo(type, streamChannel.getId(), stream);
if (inviteInfo == null) {
if (type == InviteSessionType.PLAY) {
- GbChannelDTO update = new GbChannelDTO();
- update.setId(gbChannelDTO.getId());
+ StreamChannel update = new StreamChannel();
+ update.setId(streamChannel.getId());
update.setStreamKey("");
update.setMediaServerId("");
update.setStreamStatus("0");
- R<Boolean> r = remoteGb28181Service.updateGbChannelStream(update, SecurityConstants.INNER);
+ R<Boolean> r = zlmStreamService.updateQsDevice(update, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("更新GbDevice失败");
}
@@ -1863,18 +1860,18 @@
inviteStreamService.removeInviteInfo(inviteInfo);
if (InviteSessionStatus.ok == inviteInfo.getStatus()) {
try {
- log.info("[停止点播/回放/下载] {}/{}", gbChannelDTO.getGbDeviceId(), gbChannelDTO.getGbChannelId());
+ log.info("[停止点播/回放/下载] {}/{}", streamChannel.getGbDeviceId(), streamChannel.getGbChannelId());
RtpServerParam rtpServer = new RtpServerParam();
rtpServer.setApp("gb28181");
- rtpServer.setStream(gbChannelDTO.getDeviceCode());
- rtpServer.setGbDeviceId(gbChannelDTO.getGbDeviceId());
- rtpServer.setGbChannelId(gbChannelDTO.getGbChannelId());
+ rtpServer.setStream(streamChannel.getDeviceCode());
+ rtpServer.setGbDeviceId(streamChannel.getGbDeviceId());
+ rtpServer.setGbChannelId(streamChannel.getGbChannelId());
R<Void> r = remoteGb28181Service.streamByeCmd(rtpServer, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
- log.error("[命令发送失败] 停止点播/回放/下载, deviceId:{}", gbChannelDTO.getGbDeviceId());
- throw new RuntimeException("[命令发送失败] 停止点播/回放/下载, deviceId:" + gbChannelDTO.getGbDeviceId());
+ log.error("[命令发送失败] 停止点播/回放/下载, deviceId:{}", streamChannel.getGbDeviceId());
+ throw new RuntimeException("[命令发送失败] 停止点播/回放/下载, deviceId:" + streamChannel.getGbDeviceId());
}
} catch (Exception e) {
log.error("[命令发送失败] 停止点播/回放/下载, 发送BYE: {}", e.getMessage());
@@ -1883,12 +1880,12 @@
}
if (inviteInfo.getType() == InviteSessionType.PLAY) {
- GbChannelDTO update = new GbChannelDTO();
- update.setId(gbChannelDTO.getId());
+ StreamChannel update = new StreamChannel();
+ update.setId(streamChannel.getId());
update.setStreamKey("");
update.setMediaServerId("");
update.setStreamStatus("0");
- R<Boolean> r = remoteGb28181Service.updateGbChannelStream(update, SecurityConstants.INNER);
+ R<Boolean> r = zlmStreamService.updateQsDevice(update, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("更新GbDevice失败");
}
@@ -1917,7 +1914,7 @@
* @param ssrc
* @param callback
*/
- private SSRCInfo startGb28181PlayFun(ZlmMediaServer mediaServer, QsDevice device, Device gbDevice,
+ private SSRCInfo startGb28181PlayFun(ZlmMediaServer mediaServer, StreamChannel device, Device gbDevice,
RTPServerParam rtpServerParam, String ssrc,
ErrorCallback<StreamInfo> callback) {
// 获取点播的状态信息
@@ -2017,13 +2014,13 @@
String filePath = snapOnPlay(streamInfo.getMediaServer(), streamInfo.getApp(),
streamInfo.getStream());
- QsDevice qsDevice = new QsDevice();
- qsDevice.setId(rtpServerParam.getId());
- qsDevice.setStreamKey(rtpServerParam.getStreamId());
- qsDevice.setMediaServerId(mediaServer.getId());
- qsDevice.setStreamStatus("1");
- qsDevice.setSnap(filePath);
- R<Boolean> r = remoteQsDeviceService.updateQsDevice(qsDevice, SecurityConstants.INNER);
+ StreamChannel streamChannel = new StreamChannel();
+ streamChannel.setId(rtpServerParam.getId());
+ streamChannel.setStreamKey(rtpServerParam.getStreamId());
+ streamChannel.setMediaServerId(mediaServer.getId());
+ streamChannel.setStreamStatus("1");
+ streamChannel.setSnap(filePath);
+ R<Boolean> r = zlmStreamService.updateQsDevice(streamChannel, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("更新设备失败");
}
@@ -2127,24 +2124,24 @@
/**
* 开启国标28181播放(基于GbDevice,不依赖QS)
*/
- private SSRCInfo startGb28181PlayFunByGbChannel(ZlmMediaServer mediaServer, GbChannelDTO gbChannelDTO,
+ private SSRCInfo startGb28181PlayFunByGbChannel(ZlmMediaServer mediaServer, StreamChannel streamChannel,
Device gbDevice, RTPServerParam rtpServerParam,
String ssrc, ErrorCallback<StreamInfo> callback) {
// 获取点播的状态信息
InviteInfo inviteInfoInCatch = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY,
- gbChannelDTO.getId());
+ streamChannel.getId());
if (inviteInfoInCatch != null) {
if (inviteInfoInCatch.getStreamInfo() == null) {
ssrcFactory.releaseSsrc(mediaServer.getId(), null);
- inviteStreamService.once(InviteSessionType.PLAY, gbChannelDTO.getId(), null, callback);
- log.info("[点播开始] 已经请求中,等待结果, deviceId: {}, channel: {}", gbChannelDTO.getId(), gbChannelDTO.getId());
+ inviteStreamService.once(InviteSessionType.PLAY, streamChannel.getId(), null, callback);
+ log.info("[点播开始] 已经请求中,等待结果, deviceId: {}, channel: {}", streamChannel.getId(), streamChannel.getId());
return inviteInfoInCatch.getSsrcInfo();
} else {
StreamInfo streamInfo = inviteInfoInCatch.getStreamInfo();
String streamId = streamInfo.getStream();
if (streamId == null) {
callback.run(InviteErrorCode.ERROR_FOR_CATCH_DATA.getCode(), "点播失败, redis缓存streamId等于null", null);
- inviteStreamService.call(InviteSessionType.PLAY, gbChannelDTO.getId(), null,
+ inviteStreamService.call(InviteSessionType.PLAY, streamChannel.getId(), null,
InviteErrorCode.ERROR_FOR_CATCH_DATA.getCode(), "点播失败, redis缓存streamId等于null", null);
return inviteInfoInCatch.getSsrcInfo();
}
@@ -2154,18 +2151,18 @@
if (callback != null) {
callback.run(InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(), streamInfo);
}
- inviteStreamService.call(InviteSessionType.PLAY, gbChannelDTO.getId(), null,
+ inviteStreamService.call(InviteSessionType.PLAY, streamChannel.getId(), null,
InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(), streamInfo);
- log.info("[点播已存在] 直接返回, 设备编号: {}", gbChannelDTO.getId());
+ log.info("[点播已存在] 直接返回, 设备编号: {}", streamChannel.getId());
return inviteInfoInCatch.getSsrcInfo();
} else {
- inviteStreamService.once(InviteSessionType.PLAY, gbChannelDTO.getId(), null, callback);
+ inviteStreamService.once(InviteSessionType.PLAY, streamChannel.getId(), null, callback);
RTPServerParam stopRtp = new RTPServerParam();
- stopRtp.setId(gbChannelDTO.getId());
+ stopRtp.setId(streamChannel.getId());
stopRtp.setType(rtpServerParam.getType());
stopRtp.setStreamId(rtpServerParam.getStreamId());
stopRtpPlay(stopRtp);
- inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, gbChannelDTO.getId());
+ inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, streamChannel.getId());
}
}
}
@@ -2192,7 +2189,7 @@
callback.run(InviteErrorCode.ERROR_FOR_STREAM_PARSING_EXCEPTIONS.getCode(),
InviteErrorCode.ERROR_FOR_STREAM_PARSING_EXCEPTIONS.getMsg(), null);
}
- inviteStreamService.call(InviteSessionType.PLAY, gbChannelDTO.getId(), null,
+ inviteStreamService.call(InviteSessionType.PLAY, streamChannel.getId(), null,
InviteErrorCode.ERROR_FOR_STREAM_PARSING_EXCEPTIONS.getCode(),
InviteErrorCode.ERROR_FOR_STREAM_PARSING_EXCEPTIONS.getMsg(), null);
if (result != null && result.getSsrcInfo() != null) {
@@ -2203,11 +2200,11 @@
}
if (callback != null) {
callback.run(InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(), streamInfo);
- inviteStreamService.call(InviteSessionType.PLAY, gbChannelDTO.getId(), null,
+ inviteStreamService.call(InviteSessionType.PLAY, streamChannel.getId(), null,
InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(), streamInfo);
InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(
- InviteSessionType.PLAY, gbChannelDTO.getId());
+ InviteSessionType.PLAY, streamChannel.getId());
if (inviteInfo != null) {
inviteInfo.setStatus(InviteSessionStatus.ok);
inviteInfo.setStreamInfo(streamInfo);
@@ -2218,13 +2215,13 @@
streamInfo.getStream());
// 更新GbDevice流状态
- GbChannelDTO update = new GbChannelDTO();
+ StreamChannel update = new StreamChannel();
update.setId(rtpServerParam.getId());
update.setStreamKey(rtpServerParam.getStreamId());
update.setMediaServerId(mediaServer.getId());
update.setStreamStatus("1");
update.setSnap(filePath);
- R<Boolean> r = remoteGb28181Service.updateGbChannelStream(update, SecurityConstants.INNER);
+ R<Boolean> r = zlmStreamService.updateQsDevice(update, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
throw new RuntimeException("更新GbDevice失败");
}
@@ -2234,8 +2231,8 @@
if (callback != null) {
callback.run(code, msg, null);
}
- inviteStreamService.call(InviteSessionType.PLAY, gbChannelDTO.getId(), null, code, msg, null);
- inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, gbChannelDTO.getId());
+ inviteStreamService.call(InviteSessionType.PLAY, streamChannel.getId(), null, code, msg, null);
+ inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, streamChannel.getId());
if (result != null && result.getSsrcInfo() != null) {
closeRTPServer(mediaServer, result.getSsrcInfo().getStream());
ssrcFactory.releaseSsrc(mediaServer.getId(), result.getSsrcInfo().getSsrc());
@@ -2244,12 +2241,12 @@
});
if (ssrcInfo == null || ssrcInfo.getPort() <= 0) {
- log.info("[点播端口/SSRC]获取失败,设备编号:{}, 通道编号:{}, ssrcInfo: {}", gbChannelDTO.getId(), gbChannelDTO.getId(), ssrcInfo);
+ log.info("[点播端口/SSRC]获取失败,设备编号:{}, 通道编号:{}, ssrcInfo: {}", streamChannel.getId(), streamChannel.getId(), ssrcInfo);
if (rtpServerParam.getPresetSsrc() == null) {
ssrcFactory.releaseSsrc(mediaServer.getId(), ssrc);
}
callback.run(InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getCode(), "获取端口或者ssrc失败", null);
- inviteStreamService.call(InviteSessionType.PLAY, gbChannelDTO.getId(), null,
+ inviteStreamService.call(InviteSessionType.PLAY, streamChannel.getId(), null,
InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getCode(),
InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getMsg(), null);
return null;
@@ -2263,27 +2260,27 @@
rtpServer.setId(rtpServerParam.getId());
rtpServer.setSsrc(rtpServerParam.getSsrc());
rtpServer.setGbDeviceId(gbDevice.getDeviceId());
- rtpServer.setGbChannelId(gbChannelDTO.getGbChannelId());
+ rtpServer.setGbChannelId(streamChannel.getGbChannelId());
rtpServer.setStreamMode(gbDevice.getStreamMode());
rtpServer.setMediaServerId(mediaServer.getId());
rtpServer.setApp(rtpServerParam.getApp());
rtpServer.setStream(rtpServerParam.getStreamId());
log.info("[国标28181点播开始(基于GbDevice)] ===============================");
- log.info("[国标28181] GbDeviceId: {}, 设备国标ID: {}, 通道国标ID: {}", gbChannelDTO.getId(),
- gbDevice.getDeviceId(), gbChannelDTO.getGbChannelId());
+ log.info("[国标28181] GbDeviceId: {}, 设备国标ID: {}, 通道国标ID: {}", streamChannel.getId(),
+ gbDevice.getDeviceId(), streamChannel.getGbChannelId());
log.info("[国标28181] 流模式: {}, ZLM tcpMode: {}, ssrcCheck: {}", gbDevice.getStreamMode(),
rtpServerParam.getTcpMode(), rtpServerParam.isSsrcCheck());
log.info("[国标28181] ZLM媒体服务器IP: {}, 收流端口: {}, 流ID: {}, SSRC: {}", ip, port, ssrcInfo.getStream(),
ssrcInfo.getSsrc());
log.info("[国标28181] =======================================");
- InviteInfo inviteInfo = InviteInfo.getInviteInfo(gbChannelDTO.getId().toString(), gbChannelDTO.getId(),
+ InviteInfo inviteInfo = InviteInfo.getInviteInfo(streamChannel.getId().toString(), streamChannel.getId(),
ssrcInfo.getStream(), ssrcInfo, mediaServer.getId(), mediaServer.getSdpIp(), ssrcInfo.getPort(),
gbDevice.getStreamMode(), InviteSessionType.PLAY, InviteSessionStatus.ready,
userSetting.getRecordSip());
- if ("1".equals(gbChannelDTO.getEnableMp4())) {
+ if ("1".equals(streamChannel.getEnableMp4())) {
inviteInfo.setRecord(true);
}
@@ -2293,8 +2290,8 @@
if (r.getCode() != Constants.SUCCESS) {
log.info("[点播失败]{}:{} deviceId: {}, channelId:{}", r.getCode(), r.getMsg(),
- gbChannelDTO.getGbDeviceId(), gbChannelDTO.getGbChannelId());
- inviteInfo = inviteStreamService.getInviteInfo(InviteSessionType.PLAY, gbChannelDTO.getId(),
+ streamChannel.getGbDeviceId(), streamChannel.getGbChannelId());
+ inviteInfo = inviteStreamService.getInviteInfo(InviteSessionType.PLAY, streamChannel.getId(),
rtpServerParam.getStreamId());
if (inviteInfo != null) {
inviteStreamService.removeInviteInfo(inviteInfo);
@@ -2307,9 +2304,9 @@
if (callback != null) {
callback.run(r.getCode(), r.getMsg(), null);
}
- inviteStreamService.call(InviteSessionType.PLAY, gbChannelDTO.getId(), null,
+ inviteStreamService.call(InviteSessionType.PLAY, streamChannel.getId(), null,
r.getCode(), r.getMsg(), null);
- inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, gbChannelDTO.getId());
+ inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, streamChannel.getId());
return ssrcInfo;
}
return ssrcInfo;
@@ -2360,12 +2357,12 @@
if (callback != null) {
callback.run(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg(), streamInfo);
- QsDevice qsDevice = new QsDevice();
- qsDevice.setId(id);
- qsDevice.setStreamKey(stream);
- qsDevice.setMediaServerId(mediaServer.getId());
- qsDevice.setStreamStatus("1");
- R<Boolean> r = remoteQsDeviceService.updateQsDevice(qsDevice, SecurityConstants.INNER);
+ StreamChannel streamChannel = new StreamChannel();
+ streamChannel.setId(id);
+ streamChannel.setStreamKey(stream);
+ streamChannel.setMediaServerId(mediaServer.getId());
+ streamChannel.setStreamStatus("1");
+ R<Boolean> r = zlmStreamService.updateQsDevice(streamChannel, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
log.error("更新设备失败");
callback.run(InviteErrorCode.FAIL.getCode(), "更新设备失败", null);
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServiceImpl.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServiceImpl.java
index cad5265..9e005d3 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServiceImpl.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/MediaServiceImpl.java
@@ -5,8 +5,8 @@
import com.ard.common.core.domain.R;
import com.ard.gb28181.api.RemoteGb28181Service;
import com.ard.gb28181.api.domain.Device;
-import com.ard.qs.api.RemoteQsDeviceService;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.service.ZlmStreamService;
+import com.ard.zlm.domain.StreamChannel;
import com.ard.zlm.api.domain.RTPServerParam;
import com.ard.zlm.api.domain.StreamPullPlay;
import com.ard.zlm.api.domain.ZlmMediaServer;
@@ -31,7 +31,7 @@
public class MediaServiceImpl implements IMediaService {
@Autowired
- private RemoteQsDeviceService remoteQsDeviceService;
+ private ZlmStreamService zlmStreamService;
@Autowired
private IMediaServerService mediaServerService;
@@ -51,12 +51,12 @@
@Override
public boolean closeStreamOnNoneReader(String mediaServerId, String app, String stream, String schema) {
-// R<QsDevice> r = remoteQsDeviceService.getQsDeviceStream(stream, SecurityConstants.INNER);
+// R<StreamChannel> r = zlmStreamService.getQsDeviceStream(stream, SecurityConstants.INNER);
// if (r.getCode() != Constants.SUCCESS) {
// return false;
// }
//
-// QsDevice data = r.getData();
+// StreamChannel data = r.getData();
// if (data == null) {
// return false;
// }
@@ -115,7 +115,7 @@
// 海康sdk 海康isup 大华sdk
if ("haikang".equals(app) || "haikang_isup".equals(app) || "dahua".equals(app)) {
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceStream(stream, SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceStream(stream, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
result.setEnable_mp4(false);
@@ -127,7 +127,7 @@
}
// 推流
if ("push".equals(app)) {
- R<QsDevice> r = remoteQsDeviceService.getQsDeviceStream(stream, SecurityConstants.INNER);
+ R<StreamChannel> r = zlmStreamService.getQsDeviceStream(stream, SecurityConstants.INNER);
if (r.getCode() != Constants.SUCCESS) {
result.setEnable_mp4(false);
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/SourcePlayServiceImpl.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/SourcePlayServiceImpl.java
index b55ce9a..ac5333f 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/SourcePlayServiceImpl.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/SourcePlayServiceImpl.java
@@ -1,7 +1,7 @@
package com.ard.zlm.service.impl;
import com.ard.common.core.constant.HttpStatus;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.domain.StreamChannel;
import com.ard.work.api.domian.ArdChannel;
import com.ard.zlm.api.domain.StreamInfo;
import com.ard.zlm.service.ErrorCallback;
diff --git a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/ZlmRecordPlanServiceImpl.java b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/ZlmRecordPlanServiceImpl.java
index 2ba564b..65f8f45 100644
--- a/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/ZlmRecordPlanServiceImpl.java
+++ b/ard-modules/ard-modules-zlm/src/main/java/com/ard/zlm/service/impl/ZlmRecordPlanServiceImpl.java
@@ -8,8 +8,8 @@
import com.ard.common.core.domain.R;
import com.ard.common.core.enums.LiveStreamType;
import com.ard.common.core.utils.DateUtils;
-import com.ard.qs.api.RemoteQsDeviceService;
-import com.ard.qs.api.domain.QsDevice;
+import com.ard.zlm.service.ZlmStreamService;
+import com.ard.zlm.domain.StreamChannel;
import com.ard.zlm.api.domain.MediaInfo;
import com.ard.zlm.api.domain.RTPServerParam;
import com.ard.zlm.api.domain.StreamInfo;
@@ -51,7 +51,7 @@
private ZlmRecordPlanItemMapper zlmRecordPlanItemMapper;
@Resource
- private RemoteQsDeviceService remoteQsDeviceService;
+ private ZlmStreamService zlmStreamService;
@Resource
private RemoteChannelService remoteChannelService;
@Resource
@@ -76,7 +76,7 @@
}
// 重新拉起
R<ArdChannel> r = remoteChannelService.getInfo(deviceId, SecurityConstants.INNER);
- // R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(deviceId, SecurityConstants.INNER);
+ // R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(deviceId, SecurityConstants.INNER);
if (r.getCode() != HttpStatus.SUCCESS) {
throw new RuntimeException("根据设备id查询设备信息失败");
}
@@ -91,7 +91,7 @@
return;
}
-// if ("OFFLINE".equals(device.getDeviceStatus())) {
+// if (!Boolean.TRUE.equals(device.getDeviceOnLine())) {
// log.warn("[录制计划] 流离开时拉起需要录像的流时, 发现设备不在线, id: {}", deviceId);
// return;
// }
@@ -147,7 +147,7 @@
public List<ZlmRecordPlan> selectZlmRecordPlanList(ZlmRecordPlan zlmRecordPlan) {
List<ZlmRecordPlan> zlmRecordPlans = zlmRecordPlanMapper.selectZlmRecordPlanList(zlmRecordPlan);
for (ZlmRecordPlan recordPlan : zlmRecordPlans) {
- R<Integer> r = remoteQsDeviceService.countRecordPlanDevice(recordPlan.getId(), SecurityConstants.INNER);
+ R<Integer> r = zlmStreamService.countRecordPlanDevice(recordPlan.getId(), SecurityConstants.INNER);
if (r.getCode() != HttpStatus.SUCCESS) {
throw new RuntimeException("删除录像计划失败");
}
@@ -214,7 +214,7 @@
public int deleteZlmRecordPlanByIds(Long[] ids) {
for (Long id : ids) {
zlmRecordPlanItemMapper.cleanItems(id);
- R<Void> r = remoteQsDeviceService.cleanRecordPlanId(id, SecurityConstants.INNER);
+ R<Void> r = zlmStreamService.cleanRecordPlanId(id, SecurityConstants.INNER);
if (r.getCode() != HttpStatus.SUCCESS) {
throw new RuntimeException("删除录像计划失败");
}
@@ -248,7 +248,7 @@
// recordStreamMap.keySet().forEach(startDeviceIdList::remove);
// if (!startDeviceIdList.isEmpty()) {
// // 获取所有的关联的设备
-// // R<List<QsDevice>> r = remoteQsDeviceService.queryByIds(startDeviceIdList, SecurityConstants.INNER);
+// // R<List<StreamChannel>> r = zlmStreamService.queryByIds(startDeviceIdList, SecurityConstants.INNER);
// R<List<ArdChannel>> r = remoteChannelService.queryByIds(startDeviceIdList, SecurityConstants.INNER);
// if (r.getCode() != HttpStatus.SUCCESS) {
// throw new RuntimeException("根据设备id集合查询设备信息失败");
@@ -257,7 +257,7 @@
// if (!deviceList.isEmpty()) {
// // 查找是否已经开启录像, 如果没有则开启录像
// for (ArdChannel device : deviceList) {
-//// if ("OFFLINE".equals(device.getDeviceStatus())) {
+//// if (!Boolean.TRUE.equals(device.getDeviceOnLine())) {
//// log.warn("[录制计划] 流离开时拉起需要录像的流时, 发现设备不在线, id: {}", device.getId());
//// return;
//// }
@@ -302,7 +302,7 @@
streamInfo.getApp(), streamInfo.getStream());
if (mediaInfo.getReaderCount() == null || mediaInfo.getReaderCount() == 0) {
R<ArdChannel> r = remoteChannelService.getInfo(deviceId, SecurityConstants.INNER);
- // R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(deviceId, SecurityConstants.INNER);
+ // R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(deviceId, SecurityConstants.INNER);
if (r.getCode() != HttpStatus.SUCCESS) {
throw new RuntimeException("根据通道id查询设备信息失败");
}
diff --git a/ard-modules/pom.xml b/ard-modules/pom.xml
index 0e72f66..f0a8f99 100644
--- a/ard-modules/pom.xml
+++ b/ard-modules/pom.xml
@@ -14,7 +14,6 @@
<module>ard-modules-job</module>
<module>ard-modules-file</module>
<module>ard-modules-zlm</module>
- <module>ard-modules-qs</module>
<module>ard-modules-gb28181</module>
<module>ard-modules-agent</module>
<module>ard-modules-work</module>
--
Gitblit v1.9.3