mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-06-19 17:47:50 +08:00
Merge branch 'master' of https://github.com/648540858/wvp-GB28181-pro
This commit is contained in:
commit
f11e605b74
25
README.md
25
README.md
@ -8,16 +8,16 @@
|
|||||||
[](https://github.com/xia-chu/ZLMediaKit/pulls)
|
[](https://github.com/xia-chu/ZLMediaKit/pulls)
|
||||||
|
|
||||||
|
|
||||||
WEB VIDEO PLATFORM是一个基于GB28181-2016标准实现的开箱即用的网络视频平台,负责实现核心信令与设备管理后台部分,支持NAT穿透,支持海康、大华、宇视等品牌的IPC、NVR接入。支持国标级联,支持将不带国标功能的摄像机/直播流/直播推流转发到其他国标平台。
|
WEB VIDEO PLATFORM是一个基于GB28181-2016标准实现的开箱即用的网络视频平台,负责实现核心信令与设备管理后台部分,支持NAT穿透,支持海康、大华、宇视等品牌的IPC、NVR接入。支持国标级联,支持将不带国标功能的摄像机/直播流/直播推流转发到其他国标平台。
|
||||||
|
|
||||||
流媒体服务基于@夏楚 ZLMediaKit [https://github.com/ZLMediaKit/ZLMediaKit](https://github.com/ZLMediaKit/ZLMediaKit)
|
流媒体服务基于@夏楚 ZLMediaKit [https://github.com/ZLMediaKit/ZLMediaKit](https://github.com/ZLMediaKit/ZLMediaKit)
|
||||||
播放器使用@dexter jessibuca [https://github.com/langhuihui/jessibuca/tree/v3](https://github.com/langhuihui/jessibuca/tree/v3)
|
播放器使用@dexter jessibuca [https://github.com/langhuihui/jessibuca/tree/v3](https://github.com/langhuihui/jessibuca/tree/v3)
|
||||||
前端页面基于@Kyle MediaServerUI [https://gitee.com/kkkkk5G/MediaServerUI](https://gitee.com/kkkkk5G/MediaServerUI) 进行修改.
|
前端页面基于@Kyle MediaServerUI [https://gitee.com/kkkkk5G/MediaServerUI](https://gitee.com/kkkkk5G/MediaServerUI) 进行修改.
|
||||||
|
|
||||||
# 应用场景:
|
# 应用场景:
|
||||||
支持浏览器无插件播放摄像头视频。
|
支持浏览器无插件播放摄像头视频。
|
||||||
支持国标设备(摄像机、平台、NVR等)设备接入
|
支持国标设备(摄像机、平台、NVR等)设备接入
|
||||||
支持非国标(onvif, rtsp, rtmp,直播设备等等)设备接入,充分利旧。
|
支持非国标(onvif, rtsp, rtmp,直播设备等等)设备接入,充分利旧。
|
||||||
支持国标级联。多平台级联。跨网视频预览。
|
支持国标级联。多平台级联。跨网视频预览。
|
||||||
支持跨网网闸平台互联。
|
支持跨网网闸平台互联。
|
||||||
|
|
||||||
@ -43,10 +43,9 @@ https://gitee.com/pan648540858/wvp-GB28181-pro.git
|
|||||||

|

|
||||||

|

|
||||||
|
|
||||||
# 功能特性
|
# 功能特性
|
||||||
- [X] 集成web界面
|
- [X] 集成web界面
|
||||||
- [X] 兼容性良好
|
- [X] 兼容性良好
|
||||||
- [X] 支持电子地图,支持接入WGS84和GCJ02两种坐标系,并且自动转化为合适的坐标系进行展示和分发
|
|
||||||
- [X] 接入设备
|
- [X] 接入设备
|
||||||
- [X] 视频预览
|
- [X] 视频预览
|
||||||
- [X] 支持主码流子码流切换
|
- [X] 支持主码流子码流切换
|
||||||
@ -68,6 +67,7 @@ https://gitee.com/pan648540858/wvp-GB28181-pro.git
|
|||||||
- [X] 支持播放H264和H265
|
- [X] 支持播放H264和H265
|
||||||
- [X] 报警信息处理,支持向前端推送报警信息
|
- [X] 报警信息处理,支持向前端推送报警信息
|
||||||
- [X] 语音对讲
|
- [X] 语音对讲
|
||||||
|
- [X] 支持业务分组和行政区划树自定义展示以及级联推送
|
||||||
- [X] 支持订阅与通知方法
|
- [X] 支持订阅与通知方法
|
||||||
- [X] 移动位置订阅
|
- [X] 移动位置订阅
|
||||||
- [X] 移动位置通知处理
|
- [X] 移动位置通知处理
|
||||||
@ -84,6 +84,7 @@ https://gitee.com/pan648540858/wvp-GB28181-pro.git
|
|||||||
- [X] 注册
|
- [X] 注册
|
||||||
- [X] 心跳保活
|
- [X] 心跳保活
|
||||||
- [X] 通道选择
|
- [X] 通道选择
|
||||||
|
- [X] 支持通道编号自定义, 支持每个平台使用不同的通道编号
|
||||||
- [X] 通道推送
|
- [X] 通道推送
|
||||||
- [X] 点播
|
- [X] 点播
|
||||||
- [X] 云台控制
|
- [X] 云台控制
|
||||||
@ -95,10 +96,11 @@ https://gitee.com/pan648540858/wvp-GB28181-pro.git
|
|||||||
- [X] 录像查看与播放
|
- [X] 录像查看与播放
|
||||||
- [X] GPS订阅与通知(直播推流)
|
- [X] GPS订阅与通知(直播推流)
|
||||||
- [X] 语音对讲
|
- [X] 语音对讲
|
||||||
- [X] 支持自动配置ZLM媒体服务, 减少因配置问题所出现的问题;
|
- [X] 支持同时级联到多个上级平台
|
||||||
|
- [X] 支持自动配置ZLM媒体服务, 减少因配置问题所出现的问题;
|
||||||
- [X] 多流媒体节点,自动选择负载最低的节点使用。
|
- [X] 多流媒体节点,自动选择负载最低的节点使用。
|
||||||
- [X] 支持启用udp多端口模式, 提高udp模式下媒体传输性能;
|
- [X] 支持启用udp多端口模式, 提高udp模式下媒体传输性能;
|
||||||
- [X] 支持公网部署;
|
- [X] 支持公网部署;
|
||||||
- [X] 支持wvp与zlm分开部署,提升平台并发能力
|
- [X] 支持wvp与zlm分开部署,提升平台并发能力
|
||||||
- [X] 支持拉流RTSP/RTMP,分发为各种流格式,或者推送到其他国标平台
|
- [X] 支持拉流RTSP/RTMP,分发为各种流格式,或者推送到其他国标平台
|
||||||
- [X] 支持推流RTSP/RTMP,分发为各种流格式,或者推送到其他国标平台
|
- [X] 支持推流RTSP/RTMP,分发为各种流格式,或者推送到其他国标平台
|
||||||
@ -108,8 +110,9 @@ https://gitee.com/pan648540858/wvp-GB28181-pro.git
|
|||||||
- [X] 支持打包可执行jar和war
|
- [X] 支持打包可执行jar和war
|
||||||
- [X] 支持跨域请求,支持前后端分离部署
|
- [X] 支持跨域请求,支持前后端分离部署
|
||||||
- [X] 支持Mysql,Postgresql,金仓等数据库
|
- [X] 支持Mysql,Postgresql,金仓等数据库
|
||||||
- [X] 支持Onvif(目前在onvif分支,需要安装onvif服务,服务请在知识星球获取)
|
- [X] 支持录制计划, 根据设定的时间对通道进行录制. 暂不支持将录制的内容转发到国标上级
|
||||||
|
- [X] 支持Onvif, 目前付费提供, 永久免费试用包在知识星球获取
|
||||||
|
- [X] 支持国标28181-2022协议, 目前付费提供, 永久免费试用包在知识星球获取
|
||||||
|
|
||||||
|
|
||||||
# 非开源的内容
|
# 非开源的内容
|
||||||
@ -120,7 +123,7 @@ https://gitee.com/pan648540858/wvp-GB28181-pro.git
|
|||||||
# 授权协议
|
# 授权协议
|
||||||
本项目自有代码使用宽松的MIT协议,在保留版权信息的情况下可以自由应用于各自商用、非商业的项目。 但是本项目也零碎的使用了一些其他的开源代码,在商用的情况下请自行替代或剔除; 由于使用本项目而产生的商业纠纷或侵权行为一概与本项目及开发者无关,请自行承担法律风险。 在使用本项目代码时,也应该在授权协议中同时表明本项目依赖的第三方库的协议
|
本项目自有代码使用宽松的MIT协议,在保留版权信息的情况下可以自由应用于各自商用、非商业的项目。 但是本项目也零碎的使用了一些其他的开源代码,在商用的情况下请自行替代或剔除; 由于使用本项目而产生的商业纠纷或侵权行为一概与本项目及开发者无关,请自行承担法律风险。 在使用本项目代码时,也应该在授权协议中同时表明本项目依赖的第三方库的协议
|
||||||
|
|
||||||
# 技术支持
|
# 技术支持
|
||||||
|
|
||||||
[知识星球](https://t.zsxq.com/0d8VAD3Dm)专栏列表:,
|
[知识星球](https://t.zsxq.com/0d8VAD3Dm)专栏列表:,
|
||||||
- [使用入门系列一:WVP-PRO能做什么](https://t.zsxq.com/0dLguVoSp)
|
- [使用入门系列一:WVP-PRO能做什么](https://t.zsxq.com/0dLguVoSp)
|
||||||
@ -132,7 +135,7 @@ https://gitee.com/pan648540858/wvp-GB28181-pro.git
|
|||||||
感谢作者[dexter langhuihui](https://github.com/langhuihui) 开源这么好用的WEB播放器。
|
感谢作者[dexter langhuihui](https://github.com/langhuihui) 开源这么好用的WEB播放器。
|
||||||
感谢作者[Kyle](https://gitee.com/kkkkk5G) 开源了好用的前端页面
|
感谢作者[Kyle](https://gitee.com/kkkkk5G) 开源了好用的前端页面
|
||||||
感谢各位大佬的赞助以及对项目的指正与帮助。包括但不限于代码贡献、问题反馈、资金捐赠等各种方式的支持!以下排名不分先后:
|
感谢各位大佬的赞助以及对项目的指正与帮助。包括但不限于代码贡献、问题反馈、资金捐赠等各种方式的支持!以下排名不分先后:
|
||||||
[lawrencehj](https://github.com/lawrencehj) [Smallwhitepig](https://github.com/Smallwhitepig) [swwhaha](https://github.com/swwheihei)
|
[lawrencehj](https://github.com/lawrencehj) [Smallwhitepig](https://github.com/Smallwhitepig) [swwhaha](https://github.com/swwheihei)
|
||||||
[hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen)
|
[hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen)
|
||||||
[chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb)
|
[chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb)
|
||||||
[ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) [Albertzhu666](https://github.com/Albertzhu666)
|
[ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) [Albertzhu666](https://github.com/Albertzhu666)
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import java.io.BufferedReader;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,7 +55,7 @@ public class CivilCodeFileConf implements CommandLineRunner {
|
|||||||
inputStream = Files.newInputStream(civilCodeFile.toPath());
|
inputStream = Files.newInputStream(civilCodeFile.toPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferedReader inputStreamReader = new BufferedReader(new InputStreamReader(inputStream));
|
BufferedReader inputStreamReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
||||||
int index = -1;
|
int index = -1;
|
||||||
String line;
|
String line;
|
||||||
while ((line = inputStreamReader.readLine()) != null) {
|
while ((line = inputStreamReader.readLine()) != null) {
|
||||||
|
|||||||
@ -34,6 +34,7 @@ public class DynamicTask {
|
|||||||
threadPoolTaskScheduler.setPoolSize(300);
|
threadPoolTaskScheduler.setPoolSize(300);
|
||||||
threadPoolTaskScheduler.setWaitForTasksToCompleteOnShutdown(true);
|
threadPoolTaskScheduler.setWaitForTasksToCompleteOnShutdown(true);
|
||||||
threadPoolTaskScheduler.setAwaitTerminationSeconds(10);
|
threadPoolTaskScheduler.setAwaitTerminationSeconds(10);
|
||||||
|
threadPoolTaskScheduler.setThreadNamePrefix("dynamicTask-");
|
||||||
threadPoolTaskScheduler.initialize();
|
threadPoolTaskScheduler.initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,18 @@
|
|||||||
package com.genersoft.iot.vmp.conf;
|
package com.genersoft.iot.vmp.conf;
|
||||||
|
|
||||||
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.annotation.SchedulingConfigurer;
|
import org.springframework.scheduling.annotation.SchedulingConfigurer;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
import static com.genersoft.iot.vmp.conf.ThreadPoolTaskConfig.cpuNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* "@Scheduled"是Spring框架提供的一种定时任务执行机制,默认情况下它是单线程的,在同时执行多个定时任务时可能会出现阻塞和性能问题。
|
* "@Scheduled"是Spring框架提供的一种定时任务执行机制,默认情况下它是单线程的,在同时执行多个定时任务时可能会出现阻塞和性能问题。
|
||||||
* 为了解决这种单线程瓶颈问题,可以将定时任务的执行机制改为支持多线程
|
* 为了解决这种单线程瓶颈问题,可以将定时任务的执行机制改为支持多线程
|
||||||
@ -15,16 +20,21 @@ import java.util.concurrent.ThreadPoolExecutor;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class ScheduleConfig implements SchedulingConfigurer {
|
public class ScheduleConfig implements SchedulingConfigurer {
|
||||||
|
|
||||||
public static final int cpuNum = Runtime.getRuntime().availableProcessors();
|
/**
|
||||||
|
* 核心线程数(默认线程数)
|
||||||
|
*/
|
||||||
|
private static final int corePoolSize = Math.max(cpuNum, 20);
|
||||||
|
|
||||||
private static final int corePoolSize = cpuNum;
|
/**
|
||||||
|
* 线程池名前缀
|
||||||
private static final String threadNamePrefix = "scheduled-task-pool-%d";
|
*/
|
||||||
|
private static final String threadNamePrefix = "schedule";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
|
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
|
||||||
taskRegistrar.setScheduler(new ScheduledThreadPoolExecutor(corePoolSize,
|
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(corePoolSize,
|
||||||
new BasicThreadFactory.Builder().namingPattern(threadNamePrefix).daemon(true).build(),
|
new BasicThreadFactory.Builder().namingPattern(threadNamePrefix).daemon(true).build(),
|
||||||
new ThreadPoolExecutor.CallerRunsPolicy()));
|
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
taskRegistrar.setScheduler(scheduledThreadPoolExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,11 +28,11 @@ public class ThreadPoolTaskConfig {
|
|||||||
/**
|
/**
|
||||||
* 核心线程数(默认线程数)
|
* 核心线程数(默认线程数)
|
||||||
*/
|
*/
|
||||||
private static final int corePoolSize = cpuNum;
|
private static final int corePoolSize = Math.max(cpuNum * 2, 16);
|
||||||
/**
|
/**
|
||||||
* 最大线程数
|
* 最大线程数
|
||||||
*/
|
*/
|
||||||
private static final int maxPoolSize = cpuNum*2;
|
private static final int maxPoolSize = corePoolSize * 10;
|
||||||
/**
|
/**
|
||||||
* 允许线程空闲时间(单位:默认为秒)
|
* 允许线程空闲时间(单位:默认为秒)
|
||||||
*/
|
*/
|
||||||
@ -45,12 +45,9 @@ public class ThreadPoolTaskConfig {
|
|||||||
/**
|
/**
|
||||||
* 线程池名前缀
|
* 线程池名前缀
|
||||||
*/
|
*/
|
||||||
private static final String threadNamePrefix = "wvp-";
|
private static final String threadNamePrefix = "async-";
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Bean("taskExecutor") // bean的名称,默认为首字母小写的方法名
|
@Bean("taskExecutor") // bean的名称,默认为首字母小写的方法名
|
||||||
public ThreadPoolTaskExecutor taskExecutor() {
|
public ThreadPoolTaskExecutor taskExecutor() {
|
||||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public class JwtUtils implements InitializingBean {
|
|||||||
/**
|
/**
|
||||||
* token过期时间(分钟)
|
* token过期时间(分钟)
|
||||||
*/
|
*/
|
||||||
public static final long EXPIRATION_TIME = 30 * 24 * 60;
|
public static final long EXPIRATION_TIME = 30;
|
||||||
|
|
||||||
private static RsaJsonWebKey rsaJsonWebKey;
|
private static RsaJsonWebKey rsaJsonWebKey;
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,10 @@
|
|||||||
package com.genersoft.iot.vmp.gb28181.bean;
|
package com.genersoft.iot.vmp.gb28181.bean;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.Delayed;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lin
|
* @author lin
|
||||||
@ -19,11 +15,12 @@ public class CatalogData {
|
|||||||
* 命令序列号
|
* 命令序列号
|
||||||
*/
|
*/
|
||||||
private int sn;
|
private int sn;
|
||||||
private int total;
|
private Integer total;
|
||||||
private Instant time;
|
private Instant time;
|
||||||
private Device device;
|
private Device device;
|
||||||
private String errorMsg;
|
private String errorMsg;
|
||||||
private Set<String> redisKeysForChannel = new HashSet<>();
|
private Set<String> redisKeysForChannel = new HashSet<>();
|
||||||
|
private Set<String> errorChannel = new HashSet<>();
|
||||||
private Set<String> redisKeysForRegion = new HashSet<>();
|
private Set<String> redisKeysForRegion = new HashSet<>();
|
||||||
private Set<String> redisKeysForGroup = new HashSet<>();
|
private Set<String> redisKeysForGroup = new HashSet<>();
|
||||||
|
|
||||||
|
|||||||
@ -126,6 +126,9 @@ public class CommonGBChannel {
|
|||||||
@Schema(description = "关联的国标设备数据库ID")
|
@Schema(description = "关联的国标设备数据库ID")
|
||||||
private Integer gbDeviceDbId;
|
private Integer gbDeviceDbId;
|
||||||
|
|
||||||
|
@Schema(description = "二进制保存的录制计划, 每一位表示每个小时的前半个小时")
|
||||||
|
private Long recordPLan;
|
||||||
|
|
||||||
@Schema(description = "关联的推流Id(流来源是推流时有效)")
|
@Schema(description = "关联的推流Id(流来源是推流时有效)")
|
||||||
private Integer streamPushId;
|
private Integer streamPushId;
|
||||||
|
|
||||||
|
|||||||
@ -175,15 +175,18 @@ public class SendRtpInfo {
|
|||||||
return sendRtpItem;
|
return sendRtpItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SendRtpInfo getInstance(Integer localPort, MediaServer mediaServer, String ip, int port, String ssrc,
|
public static SendRtpInfo getInstance(Integer localPort, MediaServer mediaServer, String ip, Integer port, String ssrc,
|
||||||
String deviceId, String platformId, Integer channelId, boolean isTcp, boolean rtcp,
|
String deviceId, String platformId, Integer channelId, Boolean isTcp, Boolean rtcp,
|
||||||
String serverId) {
|
String serverId) {
|
||||||
if (localPort == 0) {
|
if (localPort == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SendRtpInfo sendRtpItem = new SendRtpInfo();
|
SendRtpInfo sendRtpItem = new SendRtpInfo();
|
||||||
sendRtpItem.setIp(ip);
|
sendRtpItem.setIp(ip);
|
||||||
sendRtpItem.setPort(port);
|
if(port != null) {
|
||||||
|
sendRtpItem.setPort(port);
|
||||||
|
}
|
||||||
|
|
||||||
sendRtpItem.setSsrc(ssrc);
|
sendRtpItem.setSsrc(ssrc);
|
||||||
if (deviceId != null) {
|
if (deviceId != null) {
|
||||||
sendRtpItem.setTargetId(deviceId);
|
sendRtpItem.setTargetId(deviceId);
|
||||||
|
|||||||
@ -1,51 +1,31 @@
|
|||||||
package com.genersoft.iot.vmp.gb28181.bean;
|
package com.genersoft.iot.vmp.gb28181.bean;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 摄像机同步状态
|
* 摄像机同步状态
|
||||||
* @author lin
|
* @author lin
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
@Schema(description = "摄像机同步状态")
|
@Schema(description = "摄像机同步状态")
|
||||||
public class SyncStatus {
|
public class SyncStatus {
|
||||||
|
|
||||||
@Schema(description = "总数")
|
@Schema(description = "总数")
|
||||||
private int total;
|
private Integer total;
|
||||||
|
|
||||||
@Schema(description = "当前更新多少")
|
@Schema(description = "当前更新多少")
|
||||||
private int current;
|
private Integer current;
|
||||||
|
|
||||||
@Schema(description = "错误描述")
|
@Schema(description = "错误描述")
|
||||||
private String errorMsg;
|
private String errorMsg;
|
||||||
|
|
||||||
@Schema(description = "是否同步中")
|
@Schema(description = "是否同步中")
|
||||||
private boolean syncIng;
|
private Boolean syncIng;
|
||||||
|
|
||||||
public int getTotal() {
|
@Schema(description = "时间")
|
||||||
return total;
|
private Instant time;
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotal(int total) {
|
|
||||||
this.total = total;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCurrent() {
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCurrent(int current) {
|
|
||||||
this.current = current;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getErrorMsg() {
|
|
||||||
return errorMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setErrorMsg(String errorMsg) {
|
|
||||||
this.errorMsg = errorMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSyncIng() {
|
|
||||||
return syncIng;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSyncIng(boolean syncIng) {
|
|
||||||
this.syncIng = syncIng;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,11 +101,31 @@ public class CommonChannelController {
|
|||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
|
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||||
|
@Parameter(name = "query", description = "查询内容")
|
||||||
|
@Parameter(name = "online", description = "是否在线")
|
||||||
|
@Parameter(name = "hasRecordPlan", description = "是否已设置录制计划")
|
||||||
|
@Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public PageInfo<CommonGBChannel> queryList(int page, int count,
|
||||||
|
@RequestParam(required = false) String query,
|
||||||
|
@RequestParam(required = false) Boolean online,
|
||||||
|
@RequestParam(required = false) Boolean hasRecordPlan,
|
||||||
|
@RequestParam(required = false) Integer channelType){
|
||||||
|
if (ObjectUtils.isEmpty(query)){
|
||||||
|
query = null;
|
||||||
|
}
|
||||||
|
return channelService.queryList(page, count, query, online, hasRecordPlan, channelType);
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取关联行政区划通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "获取关联行政区划通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "page", description = "当前页", required = true)
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||||
@Parameter(name = "query", description = "查询内容")
|
@Parameter(name = "query", description = "查询内容")
|
||||||
@Parameter(name = "online", description = "是否在线")
|
@Parameter(name = "online", description = "是否在线")
|
||||||
|
@Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理")
|
||||||
@Parameter(name = "civilCode", description = "行政区划")
|
@Parameter(name = "civilCode", description = "行政区划")
|
||||||
@GetMapping("/civilcode/list")
|
@GetMapping("/civilcode/list")
|
||||||
public PageInfo<CommonGBChannel> queryListByCivilCode(int page, int count,
|
public PageInfo<CommonGBChannel> queryListByCivilCode(int page, int count,
|
||||||
@ -124,6 +144,7 @@ public class CommonChannelController {
|
|||||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||||
@Parameter(name = "query", description = "查询内容")
|
@Parameter(name = "query", description = "查询内容")
|
||||||
@Parameter(name = "online", description = "是否在线")
|
@Parameter(name = "online", description = "是否在线")
|
||||||
|
@Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理")
|
||||||
@Parameter(name = "groupDeviceId", description = "业务分组下的父节点ID")
|
@Parameter(name = "groupDeviceId", description = "业务分组下的父节点ID")
|
||||||
@GetMapping("/parent/list")
|
@GetMapping("/parent/list")
|
||||||
public PageInfo<CommonGBChannel> queryListByParentId(int page, int count,
|
public PageInfo<CommonGBChannel> queryListByParentId(int page, int count,
|
||||||
@ -240,21 +261,7 @@ public class CommonChannelController {
|
|||||||
result.setResult(WVPResult.fail(code, msg));
|
result.setResult(WVPResult.fail(code, msg));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
channelPlayService.play(channel, null, callback);
|
||||||
if (channel.getGbDeviceDbId() != null) {
|
|
||||||
// 国标通道
|
|
||||||
channelPlayService.playGbDeviceChannel(channel, callback);
|
|
||||||
} else if (channel.getStreamProxyId() != null) {
|
|
||||||
// 拉流代理
|
|
||||||
channelPlayService.playProxy(channel, callback);
|
|
||||||
} else if (channel.getStreamPushId() != null) {
|
|
||||||
// 推流
|
|
||||||
channelPlayService.playPush(channel, null, null, callback);
|
|
||||||
} else {
|
|
||||||
// 通道数据异常
|
|
||||||
log.error("[点播通用通道] 通道数据异常,无法识别通道来源: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
|
||||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -144,9 +144,21 @@ public class DeviceQuery {
|
|||||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||||
boolean status = deviceService.isSyncRunning(deviceId);
|
boolean status = deviceService.isSyncRunning(deviceId);
|
||||||
// 已存在则返回进度
|
// 已存在则返回进度
|
||||||
if (status) {
|
if (deviceService.isSyncRunning(deviceId)) {
|
||||||
SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
|
SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
|
||||||
return WVPResult.success(channelSyncStatus);
|
WVPResult wvpResult = new WVPResult();
|
||||||
|
if (channelSyncStatus.getErrorMsg() != null) {
|
||||||
|
wvpResult.setCode(ErrorCode.ERROR100.getCode());
|
||||||
|
wvpResult.setMsg(channelSyncStatus.getErrorMsg());
|
||||||
|
}else if (channelSyncStatus.getTotal() == null || channelSyncStatus.getTotal() == 0){
|
||||||
|
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
||||||
|
wvpResult.setMsg("等待通道信息...");
|
||||||
|
}else {
|
||||||
|
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
||||||
|
wvpResult.setMsg(ErrorCode.SUCCESS.getMsg());
|
||||||
|
wvpResult.setData(channelSyncStatus);
|
||||||
|
}
|
||||||
|
return wvpResult;
|
||||||
}
|
}
|
||||||
deviceService.sync(device);
|
deviceService.sync(device);
|
||||||
|
|
||||||
@ -257,7 +269,7 @@ public class DeviceQuery {
|
|||||||
@Operation(summary = "修改数据流传输模式", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "修改数据流传输模式", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
|
||||||
@Parameter(name = "streamMode", description = "数据流传输模式, 取值:" +
|
@Parameter(name = "streamMode", description = "数据流传输模式, 取值:" +
|
||||||
"UDP(udp传输),TCP-ACTIVE(tcp主动模式,暂不支持),TCP-PASSIVE(tcp被动模式)", required = true)
|
"UDP(udp传输),TCP-ACTIVE(tcp主动模式),TCP-PASSIVE(tcp被动模式)", required = true)
|
||||||
@PostMapping("/transport/{deviceId}/{streamMode}")
|
@PostMapping("/transport/{deviceId}/{streamMode}")
|
||||||
public void updateTransport(@PathVariable String deviceId, @PathVariable String streamMode){
|
public void updateTransport(@PathVariable String deviceId, @PathVariable String streamMode){
|
||||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||||
@ -414,15 +426,18 @@ public class DeviceQuery {
|
|||||||
SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
|
SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
|
||||||
WVPResult<SyncStatus> wvpResult = new WVPResult<>();
|
WVPResult<SyncStatus> wvpResult = new WVPResult<>();
|
||||||
if (channelSyncStatus == null) {
|
if (channelSyncStatus == null) {
|
||||||
wvpResult.setCode(-1);
|
wvpResult.setCode(ErrorCode.ERROR100.getCode());
|
||||||
wvpResult.setMsg("同步尚未开始");
|
wvpResult.setMsg("同步不存在");
|
||||||
|
}else if (channelSyncStatus.getErrorMsg() != null) {
|
||||||
|
wvpResult.setCode(ErrorCode.ERROR100.getCode());
|
||||||
|
wvpResult.setMsg(channelSyncStatus.getErrorMsg());
|
||||||
|
}else if (channelSyncStatus.getTotal() == null || channelSyncStatus.getTotal() == 0){
|
||||||
|
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
||||||
|
wvpResult.setMsg("等待通道信息...");
|
||||||
}else {
|
}else {
|
||||||
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
wvpResult.setCode(ErrorCode.SUCCESS.getCode());
|
||||||
wvpResult.setMsg(ErrorCode.SUCCESS.getMsg());
|
wvpResult.setMsg(ErrorCode.SUCCESS.getMsg());
|
||||||
wvpResult.setData(channelSyncStatus);
|
wvpResult.setData(channelSyncStatus);
|
||||||
if (channelSyncStatus.getErrorMsg() != null) {
|
|
||||||
wvpResult.setMsg(channelSyncStatus.getErrorMsg());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return wvpResult;
|
return wvpResult;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -457,4 +457,97 @@ public interface CommonGBChannelMapper {
|
|||||||
" </script>"})
|
" </script>"})
|
||||||
void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels);
|
void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels);
|
||||||
|
|
||||||
|
@SelectProvider(type = ChannelProvider.class, method = "queryList")
|
||||||
|
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online, @Param("hasRecordPlan") Boolean hasRecordPlan, @Param("channelType") Integer channelType);
|
||||||
|
|
||||||
|
@Update(value = {" <script>" +
|
||||||
|
" UPDATE wvp_device_channel " +
|
||||||
|
" SET record_plan_id = null" +
|
||||||
|
" WHERE id in "+
|
||||||
|
" <foreach collection='channelIds' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||||
|
" </script>"})
|
||||||
|
void removeRecordPlan(List<Integer> channelIds);
|
||||||
|
|
||||||
|
@Update(value = {" <script>" +
|
||||||
|
" UPDATE wvp_device_channel " +
|
||||||
|
" SET record_plan_id = #{planId}" +
|
||||||
|
" WHERE id in "+
|
||||||
|
" <foreach collection='channelIds' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||||
|
" </script>"})
|
||||||
|
void addRecordPlan(List<Integer> channelIds, @Param("planId") Integer planId);
|
||||||
|
|
||||||
|
@Update(value = {" <script>" +
|
||||||
|
" UPDATE wvp_device_channel " +
|
||||||
|
" SET record_plan_id = #{planId}" +
|
||||||
|
" </script>"})
|
||||||
|
void addRecordPlanForAll(@Param("planId") Integer planId);
|
||||||
|
|
||||||
|
@Update(value = {" <script>" +
|
||||||
|
" UPDATE wvp_device_channel " +
|
||||||
|
" SET record_plan_id = null" +
|
||||||
|
" WHERE record_plan_id = #{planId} "+
|
||||||
|
" </script>"})
|
||||||
|
void removeRecordPlanByPlanId( @Param("planId") Integer planId);
|
||||||
|
|
||||||
|
|
||||||
|
@Select("<script>" +
|
||||||
|
" select " +
|
||||||
|
" wdc.id as gb_id,\n" +
|
||||||
|
" wdc.device_db_id as gb_device_db_id,\n" +
|
||||||
|
" wdc.stream_push_id,\n" +
|
||||||
|
" wdc.stream_proxy_id,\n" +
|
||||||
|
" wdc.create_time,\n" +
|
||||||
|
" wdc.update_time,\n" +
|
||||||
|
" wdc.record_plan_id,\n" +
|
||||||
|
" coalesce( wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
|
||||||
|
" coalesce( wdc.gb_name, wdc.name) as gb_name,\n" +
|
||||||
|
" coalesce( wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||||
|
" coalesce( wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||||
|
" coalesce( wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||||
|
" coalesce( wdc.gb_civil_code, wdc.civil_code) as gb_civil_code,\n" +
|
||||||
|
" coalesce( wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||||
|
" coalesce( wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||||
|
" coalesce( wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||||
|
" coalesce( wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
|
||||||
|
" coalesce( wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
|
||||||
|
" coalesce( wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
|
||||||
|
" coalesce( wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
|
||||||
|
" coalesce( wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
|
||||||
|
" coalesce( wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
|
||||||
|
" coalesce( wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
|
||||||
|
" coalesce( wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
|
||||||
|
" coalesce( wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
|
||||||
|
" coalesce( wdc.gb_port, wdc.port) as gb_port,\n" +
|
||||||
|
" coalesce( wdc.gb_password, wdc.password) as gb_password,\n" +
|
||||||
|
" coalesce( wdc.gb_status, wdc.status) as gb_status,\n" +
|
||||||
|
" coalesce( wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
|
||||||
|
" coalesce( wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
|
||||||
|
" coalesce( wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
|
||||||
|
" coalesce( wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
|
||||||
|
" coalesce( wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
|
||||||
|
" coalesce( wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
|
||||||
|
" coalesce( wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
|
||||||
|
" coalesce( wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
|
||||||
|
" coalesce( wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
|
||||||
|
" coalesce( wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
|
||||||
|
" coalesce( wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
|
||||||
|
" coalesce( wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
|
||||||
|
" coalesce( wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode \n" +
|
||||||
|
" from wvp_device_channel wdc" +
|
||||||
|
" where wdc.channel_type = 0 " +
|
||||||
|
" <if test='query != null'> " +
|
||||||
|
" AND (coalesce(wdc.gb_device_id, wdc.device_id) LIKE concat('%',#{query},'%') escape '/' " +
|
||||||
|
" OR coalesce(wdc.gb_name, wdc.name) LIKE concat('%',#{query},'%') escape '/')</if> " +
|
||||||
|
" <if test='online == true'> AND coalesce(wdc.gb_status, wdc.status) = 'ON'</if> " +
|
||||||
|
" <if test='online == false'> AND coalesce(wdc.gb_status, wdc.status) = 'OFF'</if> " +
|
||||||
|
" <if test='hasLink == true'> AND wdc.record_plan_id = #{planId}</if> " +
|
||||||
|
" <if test='hasLink == false'> AND wdc.record_plan_id is null</if> " +
|
||||||
|
" <if test='channelType == 0'> AND wdc.device_db_id is not null</if> " +
|
||||||
|
" <if test='channelType == 1'> AND wdc.stream_push_id is not null</if> " +
|
||||||
|
" <if test='channelType == 2'> AND wdc.stream_proxy_id is not null</if> " +
|
||||||
|
"</script>")
|
||||||
|
List<CommonGBChannel> queryForRecordPlanForWebList(@Param("planId") Integer planId, @Param("query") String query,
|
||||||
|
@Param("channelType") Integer channelType, @Param("online") Boolean online,
|
||||||
|
@Param("hasLink") Boolean hasLink);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,6 +93,12 @@ public interface DeviceChannelMapper {
|
|||||||
@SelectProvider(type = DeviceChannelProvider.class, method = "queryChannelsByDeviceDbId")
|
@SelectProvider(type = DeviceChannelProvider.class, method = "queryChannelsByDeviceDbId")
|
||||||
List<DeviceChannel> queryChannelsByDeviceDbId(@Param("deviceDbId") int deviceDbId);
|
List<DeviceChannel> queryChannelsByDeviceDbId(@Param("deviceDbId") int deviceDbId);
|
||||||
|
|
||||||
|
@Select(value = {" <script> " +
|
||||||
|
"select id from wvp_device_channel where device_db_id in " +
|
||||||
|
" <foreach item='item' index='index' collection='deviceDbIds' open='(' separator=',' close=')'> #{item} </foreach>" +
|
||||||
|
" </script>"})
|
||||||
|
List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbIds);
|
||||||
|
|
||||||
@Delete("DELETE FROM wvp_device_channel WHERE device_db_id=#{deviceId}")
|
@Delete("DELETE FROM wvp_device_channel WHERE device_db_id=#{deviceId}")
|
||||||
int cleanChannelsByDeviceId(@Param("deviceId") int deviceId);
|
int cleanChannelsByDeviceId(@Param("deviceId") int deviceId);
|
||||||
|
|
||||||
@ -407,6 +413,10 @@ public interface DeviceChannelMapper {
|
|||||||
"</script>")
|
"</script>")
|
||||||
void updateChannelStreamIdentification(DeviceChannel channel);
|
void updateChannelStreamIdentification(DeviceChannel channel);
|
||||||
|
|
||||||
|
@Update("<script>" +
|
||||||
|
"UPDATE wvp_device_channel SET stream_identification=#{streamIdentification}" +
|
||||||
|
"</script>")
|
||||||
|
void updateAllChannelStreamIdentification(@Param("streamIdentification") String streamIdentification);
|
||||||
|
|
||||||
@Update({"<script>" +
|
@Update({"<script>" +
|
||||||
"<foreach collection='channelList' item='item' separator=';'>" +
|
"<foreach collection='channelList' item='item' separator=';'>" +
|
||||||
|
|||||||
@ -17,6 +17,7 @@ public class ChannelProvider {
|
|||||||
" stream_proxy_id,\n" +
|
" stream_proxy_id,\n" +
|
||||||
" create_time,\n" +
|
" create_time,\n" +
|
||||||
" update_time,\n" +
|
" update_time,\n" +
|
||||||
|
" record_plan_id,\n" +
|
||||||
" coalesce(gb_device_id, device_id) as gb_device_id,\n" +
|
" coalesce(gb_device_id, device_id) as gb_device_id,\n" +
|
||||||
" coalesce(gb_name, name) as gb_name,\n" +
|
" coalesce(gb_name, name) as gb_name,\n" +
|
||||||
" coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" +
|
" coalesce(gb_manufacturer, manufacturer) as gb_manufacturer,\n" +
|
||||||
@ -182,6 +183,37 @@ public class ChannelProvider {
|
|||||||
return sqlBuild.toString();
|
return sqlBuild.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String queryList(Map<String, Object> params ){
|
||||||
|
StringBuilder sqlBuild = new StringBuilder();
|
||||||
|
sqlBuild.append(BASE_SQL);
|
||||||
|
sqlBuild.append(" where channel_type = 0 ");
|
||||||
|
if (params.get("query") != null) {
|
||||||
|
sqlBuild.append(" AND (coalesce(gb_device_id, device_id) LIKE concat('%',#{query},'%') escape '/'" +
|
||||||
|
" OR coalesce(gb_name, name) LIKE concat('%',#{query},'%') escape '/' )")
|
||||||
|
;
|
||||||
|
}
|
||||||
|
if (params.get("online") != null && (Boolean)params.get("online")) {
|
||||||
|
sqlBuild.append(" AND coalesce(gb_status, status) = 'ON'");
|
||||||
|
}
|
||||||
|
if (params.get("online") != null && !(Boolean)params.get("online")) {
|
||||||
|
sqlBuild.append(" AND coalesce(gb_status, status) = 'OFF'");
|
||||||
|
}
|
||||||
|
if (params.get("hasRecordPlan") != null && (Boolean)params.get("hasRecordPlan")) {
|
||||||
|
sqlBuild.append(" AND record_plan_id > 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.get("channelType") != null) {
|
||||||
|
if ((Integer)params.get("channelType") == 0) {
|
||||||
|
sqlBuild.append(" AND device_db_id is not null");
|
||||||
|
}else if ((Integer)params.get("channelType") == 1) {
|
||||||
|
sqlBuild.append(" AND stream_push_id is not null");
|
||||||
|
}else if ((Integer)params.get("channelType") == 2) {
|
||||||
|
sqlBuild.append(" AND stream_proxy_id is not null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sqlBuild.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public String queryInListByStatus(Map<String, Object> params ){
|
public String queryInListByStatus(Map<String, Object> params ){
|
||||||
StringBuilder sqlBuild = new StringBuilder();
|
StringBuilder sqlBuild = new StringBuilder();
|
||||||
sqlBuild.append(BASE_SQL);
|
sqlBuild.append(BASE_SQL);
|
||||||
|
|||||||
@ -122,4 +122,7 @@ public interface IDeviceChannelService {
|
|||||||
|
|
||||||
DeviceChannel getOneBySourceId(int deviceDbId, String channelId);
|
DeviceChannel getOneBySourceId(int deviceDbId, String channelId);
|
||||||
|
|
||||||
|
List<DeviceChannel> queryChaneListByDeviceDbId(Integer deviceDbId);
|
||||||
|
|
||||||
|
List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,8 @@ public interface IGbChannelPlayService {
|
|||||||
|
|
||||||
void start(CommonGBChannel channel, InviteInfo inviteInfo, Platform platform, ErrorCallback<StreamInfo> callback);
|
void start(CommonGBChannel channel, InviteInfo inviteInfo, Platform platform, ErrorCallback<StreamInfo> callback);
|
||||||
|
|
||||||
|
void play(CommonGBChannel channel, Platform platform, ErrorCallback<StreamInfo> callback);
|
||||||
|
|
||||||
void playGbDeviceChannel(CommonGBChannel channel, ErrorCallback<StreamInfo> callback);
|
void playGbDeviceChannel(CommonGBChannel channel, ErrorCallback<StreamInfo> callback);
|
||||||
|
|
||||||
void playProxy(CommonGBChannel channel, ErrorCallback<StreamInfo> callback);
|
void playProxy(CommonGBChannel channel, ErrorCallback<StreamInfo> callback);
|
||||||
|
|||||||
@ -84,4 +84,7 @@ public interface IGbChannelService {
|
|||||||
List<CommonGBChannel> queryListByStreamPushList(List<StreamPush> streamPushList);
|
List<CommonGBChannel> queryListByStreamPushList(List<StreamPush> streamPushList);
|
||||||
|
|
||||||
void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels);
|
void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels);
|
||||||
|
|
||||||
|
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan, Integer channelType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -338,7 +338,11 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
|||||||
log.info("[更新通道码流类型] 设备: {}, 通道:{}, 码流: {}", channel.getDeviceId(), channel.getDeviceId(),
|
log.info("[更新通道码流类型] 设备: {}, 通道:{}, 码流: {}", channel.getDeviceId(), channel.getDeviceId(),
|
||||||
channel.getStreamIdentification());
|
channel.getStreamIdentification());
|
||||||
}
|
}
|
||||||
channelMapper.updateChannelStreamIdentification(channel);
|
if (channel.getId() > 0) {
|
||||||
|
channelMapper.updateChannelStreamIdentification(channel);
|
||||||
|
}else {
|
||||||
|
channelMapper.updateAllChannelStreamIdentification(channel.getStreamIdentification());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -350,6 +354,16 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
|||||||
return channelMapper.queryChannelsByDeviceDbId(device.getId());
|
return channelMapper.queryChannelsByDeviceDbId(device.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceChannel> queryChaneListByDeviceDbId(Integer deviceDbId) {
|
||||||
|
return channelMapper.queryChannelsByDeviceDbId(deviceDbId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Integer> queryChaneIdListByDeviceDbIds(List<Integer> deviceDbIds) {
|
||||||
|
return channelMapper.queryChaneIdListByDeviceDbIds(deviceDbIds);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateChannelGPS(Device device, DeviceChannel deviceChannel, MobilePosition mobilePosition) {
|
public void updateChannelGPS(Device device, DeviceChannel deviceChannel, MobilePosition mobilePosition) {
|
||||||
if (userSetting.getSavePositionHistory()) {
|
if (userSetting.getSavePositionHistory()) {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.genersoft.iot.vmp.gb28181.service.impl;
|
package com.genersoft.iot.vmp.gb28181.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.genersoft.iot.vmp.common.CommonCallback;
|
import com.genersoft.iot.vmp.common.CommonCallback;
|
||||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
||||||
@ -322,7 +323,8 @@ public class DeviceServiceImpl implements IDeviceService {
|
|||||||
@Override
|
@Override
|
||||||
public void sync(Device device) {
|
public void sync(Device device) {
|
||||||
if (catalogResponseMessageHandler.isSyncRunning(device.getDeviceId())) {
|
if (catalogResponseMessageHandler.isSyncRunning(device.getDeviceId())) {
|
||||||
log.info("开启同步时发现同步已经存在");
|
SyncStatus syncStatus = catalogResponseMessageHandler.getChannelSyncProgress(device.getDeviceId());
|
||||||
|
log.info("[同步通道] 同步已存在, 设备: {}, 同步信息: {}", device.getDeviceId(), JSON.toJSON(syncStatus));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int sn = (int)((Math.random()*9+1)*100000);
|
int sn = (int)((Math.random()*9+1)*100000);
|
||||||
@ -330,6 +332,7 @@ public class DeviceServiceImpl implements IDeviceService {
|
|||||||
try {
|
try {
|
||||||
sipCommander.catalogQuery(device, sn, event -> {
|
sipCommander.catalogQuery(device, sn, event -> {
|
||||||
String errorMsg = String.format("同步通道失败,错误码: %s, %s", event.statusCode, event.msg);
|
String errorMsg = String.format("同步通道失败,错误码: %s, %s", event.statusCode, event.msg);
|
||||||
|
log.info("[同步通道]失败,编号: {}, 错误码: {}, {}", device.getDeviceId(), event.statusCode, event.msg);
|
||||||
catalogResponseMessageHandler.setChannelSyncEnd(device.getDeviceId(), sn, errorMsg);
|
catalogResponseMessageHandler.setChannelSyncEnd(device.getDeviceId(), sn, errorMsg);
|
||||||
});
|
});
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||||
|
|||||||
@ -39,20 +39,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
|||||||
}
|
}
|
||||||
log.info("[点播通用通道] 类型:{}, 通道: {}({})", inviteInfo.getSessionName(), channel.getGbName(), channel.getGbDeviceId());
|
log.info("[点播通用通道] 类型:{}, 通道: {}({})", inviteInfo.getSessionName(), channel.getGbName(), channel.getGbDeviceId());
|
||||||
if ("Play".equalsIgnoreCase(inviteInfo.getSessionName())) {
|
if ("Play".equalsIgnoreCase(inviteInfo.getSessionName())) {
|
||||||
if (channel.getGbDeviceDbId() != null) {
|
play(channel, platform, callback);
|
||||||
// 国标通道
|
|
||||||
playGbDeviceChannel(channel, callback);
|
|
||||||
} else if (channel.getStreamProxyId() != null) {
|
|
||||||
// 拉流代理
|
|
||||||
playProxy(channel, callback);
|
|
||||||
} else if (channel.getStreamPushId() != null) {
|
|
||||||
// 推流
|
|
||||||
playPush(channel, platform.getServerGBId(), platform.getName(), callback);
|
|
||||||
} else {
|
|
||||||
// 通道数据异常
|
|
||||||
log.error("[点播通用通道] 通道数据异常,无法识别通道来源: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
|
||||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
|
||||||
}
|
|
||||||
}else if ("Playback".equals(inviteInfo.getSessionName())) {
|
}else if ("Playback".equals(inviteInfo.getSessionName())) {
|
||||||
if (channel.getGbDeviceDbId() != null) {
|
if (channel.getGbDeviceDbId() != null) {
|
||||||
// 国标通道
|
// 国标通道
|
||||||
@ -101,6 +88,29 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void play(CommonGBChannel channel, Platform platform, ErrorCallback<StreamInfo> callback) {
|
||||||
|
if (channel.getGbDeviceDbId() != null) {
|
||||||
|
// 国标通道
|
||||||
|
playGbDeviceChannel(channel, callback);
|
||||||
|
} else if (channel.getStreamProxyId() != null) {
|
||||||
|
// 拉流代理
|
||||||
|
playProxy(channel, callback);
|
||||||
|
} else if (channel.getStreamPushId() != null) {
|
||||||
|
if (platform != null) {
|
||||||
|
// 推流
|
||||||
|
playPush(channel, platform.getServerGBId(), platform.getName(), callback);
|
||||||
|
}else {
|
||||||
|
// 推流
|
||||||
|
playPush(channel, null, null, callback);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 通道数据异常
|
||||||
|
log.error("[点播通用通道] 通道数据异常,无法识别通道来源: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
||||||
|
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playGbDeviceChannel(CommonGBChannel channel, ErrorCallback<StreamInfo> callback){
|
public void playGbDeviceChannel(CommonGBChannel channel, ErrorCallback<StreamInfo> callback){
|
||||||
// 国标通道
|
// 国标通道
|
||||||
|
|||||||
@ -714,4 +714,16 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
|||||||
public void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels) {
|
public void updateGpsByDeviceIdForStreamPush(List<CommonGBChannel> channels) {
|
||||||
commonGBChannelMapper.updateGpsByDeviceIdForStreamPush(channels);
|
commonGBChannelMapper.updateGpsByDeviceIdForStreamPush(channels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan, Integer channelType) {
|
||||||
|
PageHelper.startPage(page, count);
|
||||||
|
if (query != null) {
|
||||||
|
query = query.replaceAll("/", "//")
|
||||||
|
.replaceAll("%", "/%")
|
||||||
|
.replaceAll("_", "/_");
|
||||||
|
}
|
||||||
|
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType);
|
||||||
|
return new PageInfo<>(all);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,6 +55,11 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
|||||||
@Override
|
@Override
|
||||||
public PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Integer channelType, Boolean online, Integer platformId, Boolean hasShare) {
|
public PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Integer channelType, Boolean online, Integer platformId, Boolean hasShare) {
|
||||||
PageHelper.startPage(page, count);
|
PageHelper.startPage(page, count);
|
||||||
|
if (query != null) {
|
||||||
|
query = query.replaceAll("/", "//")
|
||||||
|
.replaceAll("%", "/%")
|
||||||
|
.replaceAll("_", "/_");
|
||||||
|
}
|
||||||
List<PlatformChannel> all = platformChannelMapper.queryForPlatformForWebList(platformId, query, channelType, online, hasShare);
|
List<PlatformChannel> all = platformChannelMapper.queryForPlatformForWebList(platformId, query, channelType, online, hasShare);
|
||||||
return new PageInfo<>(all);
|
return new PageInfo<>(all);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -578,45 +578,6 @@ public class PlatformServiceImpl implements IPlatformService {
|
|||||||
|
|
||||||
inviteOKHandler(event, ssrcInfo, tcpMode, ssrcCheck, mediaServerItem, platform, channel, timeOutTaskKey,
|
inviteOKHandler(event, ssrcInfo, tcpMode, ssrcCheck, mediaServerItem, platform, channel, timeOutTaskKey,
|
||||||
null, inviteInfo, InviteSessionType.BROADCAST);
|
null, inviteInfo, InviteSessionType.BROADCAST);
|
||||||
// // 收到200OK 检测ssrc是否有变化,防止上级自定义了ssrc
|
|
||||||
// ResponseEvent responseEvent = (ResponseEvent) event.event;
|
|
||||||
// String contentString = new String(responseEvent.getResponse().getRawContent());
|
|
||||||
// // 获取ssrc
|
|
||||||
// int ssrcIndex = contentString.indexOf("y=");
|
|
||||||
// // 检查是否有y字段
|
|
||||||
// if (ssrcIndex >= 0) {
|
|
||||||
// //ssrc规定长度为10字节,不取余下长度以避免后续还有“f=”字段 TODO 后续对不规范的非10位ssrc兼容
|
|
||||||
// String ssrcInResponse = contentString.substring(ssrcIndex + 2, ssrcIndex + 12);
|
|
||||||
// // 查询到ssrc不一致且开启了ssrc校验则需要针对处理
|
|
||||||
// if (ssrcInfo.getSsrc().equals(ssrcInResponse) || ssrcCheck) {
|
|
||||||
// tcpActiveHandler(platform, )
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// logger.info("[点播消息] 收到invite 200, 发现下级自定义了ssrc: {}", ssrcInResponse);
|
|
||||||
// if (!mediaServerItem.isRtpEnable()) {
|
|
||||||
// logger.info("[点播消息] SSRC修正 {}->{}", ssrcInfo.getSsrc(), ssrcInResponse);
|
|
||||||
// // 释放ssrc
|
|
||||||
// mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc());
|
|
||||||
// // 单端口模式streamId也有变化,需要重新设置监听
|
|
||||||
// if (!mediaServerItem.isRtpEnable()) {
|
|
||||||
// // 添加订阅
|
|
||||||
// HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", ssrcInfo.getStream(), true, "rtsp", mediaServerItem.getId());
|
|
||||||
// subscribe.removeSubscribe(hookSubscribe);
|
|
||||||
// hookSubscribe.getContent().put("stream", String.format("%08x", Integer.parseInt(ssrcInResponse)).toUpperCase());
|
|
||||||
// subscribe.addSubscribe(hookSubscribe, (mediaServerItemInUse, hookParam) -> {
|
|
||||||
// logger.info("[ZLM HOOK] ssrc修正后收到订阅消息: " + hookParam);
|
|
||||||
// dynamicTask.stop(timeOutTaskKey);
|
|
||||||
// // hook响应
|
|
||||||
// playService.onPublishHandlerForPlay(mediaServerItemInUse, hookParam, platform.getServerGBId(), channelId);
|
|
||||||
// hookEvent.response(mediaServerItemInUse, hookParam);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// // 关闭rtp server
|
|
||||||
// mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream());
|
|
||||||
// // 重新开启ssrc server
|
|
||||||
// mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, false, false, ssrcInfo.getPort(), true, false, tcpMode);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}, eventResult -> {
|
}, eventResult -> {
|
||||||
// 收到错误回复
|
// 收到错误回复
|
||||||
if (errorEvent != null) {
|
if (errorEvent != null) {
|
||||||
|
|||||||
@ -517,7 +517,14 @@ public class PlayServiceImpl implements IPlayService {
|
|||||||
}, userSetting.getPlayTimeout());
|
}, userSetting.getPlayTimeout());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mediaServerService.startSendRtpPassive(mediaServerItem, sendRtpInfo, userSetting.getPlayTimeout() * 1000);
|
Integer localPort = mediaServerService.startSendRtpPassive(mediaServerItem, sendRtpInfo, userSetting.getPlayTimeout() * 1000);
|
||||||
|
if (localPort == null || localPort <= 0) {
|
||||||
|
timeoutCallback.run();
|
||||||
|
mediaServerService.releaseSsrc(mediaServerItem.getId(), sendRtpInfo.getSsrc());
|
||||||
|
sessionManager.removeByStream(sendRtpInfo.getStream());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sendRtpInfo.setPort(localPort);
|
||||||
}catch (ControllerException e) {
|
}catch (ControllerException e) {
|
||||||
mediaServerService.releaseSsrc(mediaServerItem.getId(), sendRtpInfo.getSsrc());
|
mediaServerService.releaseSsrc(mediaServerItem.getId(), sendRtpInfo.getSsrc());
|
||||||
log.info("[语音对讲]失败 deviceId: {}, channelId: {}", device.getDeviceId(), channel.getDeviceId());
|
log.info("[语音对讲]失败 deviceId: {}, channelId: {}", device.getDeviceId(), channel.getDeviceId());
|
||||||
|
|||||||
@ -170,11 +170,16 @@ public class CatalogDataManager implements CommandLineRunner {
|
|||||||
syncStatus.setCurrent(catalogData.getRedisKeysForChannel().size());
|
syncStatus.setCurrent(catalogData.getRedisKeysForChannel().size());
|
||||||
syncStatus.setTotal(catalogData.getTotal());
|
syncStatus.setTotal(catalogData.getTotal());
|
||||||
syncStatus.setErrorMsg(catalogData.getErrorMsg());
|
syncStatus.setErrorMsg(catalogData.getErrorMsg());
|
||||||
if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end)) {
|
syncStatus.setTime(catalogData.getTime());
|
||||||
|
if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.ready) || catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end)) {
|
||||||
syncStatus.setSyncIng(false);
|
syncStatus.setSyncIng(false);
|
||||||
}else {
|
}else {
|
||||||
syncStatus.setSyncIng(true);
|
syncStatus.setSyncIng(true);
|
||||||
}
|
}
|
||||||
|
if (catalogData.getErrorMsg() != null) {
|
||||||
|
// 失败的同步信息,返回一次后直接移除
|
||||||
|
dataMap.remove(key);
|
||||||
|
}
|
||||||
return syncStatus;
|
return syncStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -237,7 +242,8 @@ public class CatalogDataManager implements CommandLineRunner {
|
|||||||
catalogData.setErrorMsg(errorMsg);
|
catalogData.setErrorMsg(errorMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end) && catalogData.getTime().isBefore(instantBefore30S)) { // 超过三十秒,如果标记为end则删除
|
if ((catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end) || catalogData.getStatus().equals(CatalogData.CatalogDataStatus.ready))
|
||||||
|
&& catalogData.getTime().isBefore(instantBefore30S)) { // 超过三十秒,如果标记为end则删除
|
||||||
dataMap.remove(dataKey);
|
dataMap.remove(dataKey);
|
||||||
Set<String> redisKeysForChannel = catalogData.getRedisKeysForChannel();
|
Set<String> redisKeysForChannel = catalogData.getRedisKeysForChannel();
|
||||||
if (redisKeysForChannel != null && !redisKeysForChannel.isEmpty()) {
|
if (redisKeysForChannel != null && !redisKeysForChannel.isEmpty()) {
|
||||||
@ -277,7 +283,7 @@ public class CatalogDataManager implements CommandLineRunner {
|
|||||||
if (catalogData == null) {
|
if (catalogData == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return catalogData.getRedisKeysForChannel().size();
|
return catalogData.getRedisKeysForChannel().size() + catalogData.getErrorChannel().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int sumNum(String deviceId, int sn) {
|
public int sumNum(String deviceId, int sn) {
|
||||||
|
|||||||
@ -981,8 +981,6 @@ public class SIPCommander implements ISIPCommander {
|
|||||||
catalogXml.append(" <DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n");
|
catalogXml.append(" <DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n");
|
||||||
catalogXml.append("</Query>\r\n");
|
catalogXml.append("</Query>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()));
|
Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()));
|
||||||
|
|
||||||
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent);
|
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent);
|
||||||
|
|||||||
@ -303,7 +303,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
Media media = mediaDescription.getMedia();
|
Media media = mediaDescription.getMedia();
|
||||||
|
|
||||||
Vector mediaFormats = media.getMediaFormats(false);
|
Vector mediaFormats = media.getMediaFormats(false);
|
||||||
if (mediaFormats.contains("96")) {
|
if (mediaFormats.contains("96") || mediaFormats.contains("8")) {
|
||||||
port = media.getMediaPort();
|
port = media.getMediaPort();
|
||||||
//String mediaType = media.getMediaType();
|
//String mediaType = media.getMediaType();
|
||||||
String protocol = media.getProtocol();
|
String protocol = media.getProtocol();
|
||||||
|
|||||||
@ -94,4 +94,6 @@ public class BroadcastResponseMessageHandler extends SIPRequestProcessorParent i
|
|||||||
public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
|
public void handForPlatform(RequestEvent evt, Platform parentPlatform, Element element) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ public interface IMediaNodeServerService {
|
|||||||
|
|
||||||
Map<String, String> getFFmpegCMDs(MediaServer mediaServer);
|
Map<String, String> getFFmpegCMDs(MediaServer mediaServer);
|
||||||
|
|
||||||
void startSendRtpPassive(MediaServer mediaServer, SendRtpInfo sendRtpItem, Integer timeout);
|
Integer startSendRtpPassive(MediaServer mediaServer, SendRtpInfo sendRtpItem, Integer timeout);
|
||||||
|
|
||||||
void startSendRtpStream(MediaServer mediaServer, SendRtpInfo sendRtpItem);
|
void startSendRtpStream(MediaServer mediaServer, SendRtpInfo sendRtpItem);
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,7 @@ public interface IMediaServerService {
|
|||||||
|
|
||||||
Boolean isStreamReady(MediaServer mediaServer, String rtp, String streamId);
|
Boolean isStreamReady(MediaServer mediaServer, String rtp, String streamId);
|
||||||
|
|
||||||
void startSendRtpPassive(MediaServer mediaServer, SendRtpInfo sendRtpItem, Integer timeout);
|
Integer startSendRtpPassive(MediaServer mediaServer, SendRtpInfo sendRtpItem, Integer timeout);
|
||||||
|
|
||||||
void startSendRtp(MediaServer mediaServer, SendRtpInfo sendRtpItem);
|
void startSendRtp(MediaServer mediaServer, SendRtpInfo sendRtpItem);
|
||||||
|
|
||||||
|
|||||||
@ -867,13 +867,13 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startSendRtpPassive(MediaServer mediaServer, SendRtpInfo sendRtpItem, Integer timeout) {
|
public Integer startSendRtpPassive(MediaServer mediaServer, SendRtpInfo sendRtpItem, Integer timeout) {
|
||||||
IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServer.getType());
|
IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServer.getType());
|
||||||
if (mediaNodeServerService == null) {
|
if (mediaNodeServerService == null) {
|
||||||
log.info("[startSendRtpPassive] 失败, mediaServer的类型: {},未找到对应的实现类", mediaServer.getType());
|
log.info("[startSendRtpPassive] 失败, mediaServer的类型: {},未找到对应的实现类", mediaServer.getType());
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到mediaServer对应的实现类");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到mediaServer对应的实现类");
|
||||||
}
|
}
|
||||||
mediaNodeServerService.startSendRtpPassive(mediaServer, sendRtpItem, timeout);
|
return mediaNodeServerService.startSendRtpPassive(mediaServer, sendRtpItem, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -107,9 +107,9 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService {
|
|||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "读取配置失败");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "读取配置失败");
|
||||||
}
|
}
|
||||||
mediaServer.setId(zlmServerConfig.getGeneralMediaServerId());
|
mediaServer.setId(zlmServerConfig.getGeneralMediaServerId());
|
||||||
mediaServer.setHttpSSlPort(zlmServerConfig.getHttpPort());
|
mediaServer.setHttpSSlPort(zlmServerConfig.getHttpSSLport());
|
||||||
mediaServer.setFlvSSLPort(zlmServerConfig.getHttpPort());
|
mediaServer.setFlvSSLPort(zlmServerConfig.getHttpSSLport());
|
||||||
mediaServer.setWsFlvSSLPort(zlmServerConfig.getHttpPort());
|
mediaServer.setWsFlvSSLPort(zlmServerConfig.getHttpSSLport());
|
||||||
mediaServer.setRtmpPort(zlmServerConfig.getRtmpPort());
|
mediaServer.setRtmpPort(zlmServerConfig.getRtmpPort());
|
||||||
mediaServer.setRtmpSSlPort(zlmServerConfig.getRtmpSslPort());
|
mediaServer.setRtmpSSlPort(zlmServerConfig.getRtmpSslPort());
|
||||||
mediaServer.setRtspPort(zlmServerConfig.getRtspPort());
|
mediaServer.setRtspPort(zlmServerConfig.getRtspPort());
|
||||||
@ -329,7 +329,7 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startSendRtpPassive(MediaServer mediaServer, SendRtpInfo sendRtpItem, Integer timeout) {
|
public Integer startSendRtpPassive(MediaServer mediaServer, SendRtpInfo sendRtpItem, Integer timeout) {
|
||||||
Map<String, Object> param = new HashMap<>(12);
|
Map<String, Object> param = new HashMap<>(12);
|
||||||
param.put("vhost","__defaultVhost__");
|
param.put("vhost","__defaultVhost__");
|
||||||
param.put("app", sendRtpItem.getApp());
|
param.put("app", sendRtpItem.getApp());
|
||||||
@ -361,6 +361,7 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService {
|
|||||||
log.info("调用ZLM-TCP被动推流接口, 结果: {}", jsonObject);
|
log.info("调用ZLM-TCP被动推流接口, 结果: {}", jsonObject);
|
||||||
log.info("启动监听TCP被动推流成功[ {}/{} ],{}->{}:{}, " , sendRtpItem.getApp(), sendRtpItem.getStream(),
|
log.info("启动监听TCP被动推流成功[ {}/{} ],{}->{}:{}, " , sendRtpItem.getApp(), sendRtpItem.getStream(),
|
||||||
jsonObject.getString("local_port"), param.get("dst_url"), param.get("dst_port"));
|
jsonObject.getString("local_port"), param.get("dst_url"), param.get("dst_port"));
|
||||||
|
return jsonObject.getInteger("local_port");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -1,19 +1,13 @@
|
|||||||
package com.genersoft.iot.vmp.media.zlm.dto.hook;
|
package com.genersoft.iot.vmp.media.zlm.dto.hook;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* zlm hook事件的参数
|
* zlm hook事件的参数
|
||||||
* @author lin
|
* @author lin
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public class HookParam {
|
public class HookParam {
|
||||||
private String mediaServerId;
|
private String mediaServerId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getMediaServerId() {
|
|
||||||
return mediaServerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMediaServerId(String mediaServerId) {
|
|
||||||
this.mediaServerId = mediaServerId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
package com.genersoft.iot.vmp.media.zlm.dto.hook;
|
package com.genersoft.iot.vmp.media.zlm.dto.hook;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
|
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
public class HookResultForOnPublish extends HookResult{
|
public class HookResultForOnPublish extends HookResult{
|
||||||
|
|
||||||
private boolean enable_audio;
|
private boolean enable_audio;
|
||||||
@ -34,54 +38,6 @@ public class HookResultForOnPublish extends HookResult{
|
|||||||
setMsg(msg);
|
setMsg(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnable_audio() {
|
|
||||||
return enable_audio;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnable_audio(boolean enable_audio) {
|
|
||||||
this.enable_audio = enable_audio;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnable_mp4() {
|
|
||||||
return enable_mp4;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnable_mp4(boolean enable_mp4) {
|
|
||||||
this.enable_mp4 = enable_mp4;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMp4_max_second() {
|
|
||||||
return mp4_max_second;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMp4_max_second(int mp4_max_second) {
|
|
||||||
this.mp4_max_second = mp4_max_second;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMp4_save_path() {
|
|
||||||
return mp4_save_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMp4_save_path(String mp4_save_path) {
|
|
||||||
this.mp4_save_path = mp4_save_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStream_replace() {
|
|
||||||
return stream_replace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStream_replace(String stream_replace) {
|
|
||||||
this.stream_replace = stream_replace;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getModify_stamp() {
|
|
||||||
return modify_stamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setModify_stamp(Integer modify_stamp) {
|
|
||||||
this.modify_stamp = modify_stamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "HookResultForOnPublish{" +
|
return "HookResultForOnPublish{" +
|
||||||
|
|||||||
@ -1,84 +1,48 @@
|
|||||||
package com.genersoft.iot.vmp.media.zlm.dto.hook;
|
package com.genersoft.iot.vmp.media.zlm.dto.hook;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* zlm hook事件中的on_publish事件的参数
|
* zlm hook事件中的on_publish事件的参数
|
||||||
* @author lin
|
* @author lin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class OnPublishHookParam extends HookParam{
|
public class OnPublishHookParam extends HookParam{
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private String app;
|
private String app;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private String stream;
|
private String stream;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private String params;
|
private String params;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private int port;
|
private int port;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private String schema;
|
private String schema;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private String vhost;
|
private String vhost;
|
||||||
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getApp() {
|
|
||||||
return app;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApp(String app) {
|
|
||||||
this.app = app;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStream() {
|
|
||||||
return stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStream(String stream) {
|
|
||||||
this.stream = stream;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIp() {
|
|
||||||
return ip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIp(String ip) {
|
|
||||||
this.ip = ip;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getParams() {
|
|
||||||
return params;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setParams(String params) {
|
|
||||||
this.params = params;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPort() {
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPort(int port) {
|
|
||||||
this.port = port;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSchema() {
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSchema(String schema) {
|
|
||||||
this.schema = schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVhost() {
|
|
||||||
return vhost;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVhost(String vhost) {
|
|
||||||
this.vhost = vhost;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "OnPublishHookParam{" +
|
return "OnPublishHookParam{" +
|
||||||
|
|||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.genersoft.iot.vmp.service;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.RecordPlan;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IRecordPlanService {
|
||||||
|
|
||||||
|
|
||||||
|
RecordPlan get(Integer planId);
|
||||||
|
|
||||||
|
void update(RecordPlan plan);
|
||||||
|
|
||||||
|
void delete(Integer planId);
|
||||||
|
|
||||||
|
PageInfo<RecordPlan> query(Integer page, Integer count, String query);
|
||||||
|
|
||||||
|
void add(RecordPlan plan);
|
||||||
|
|
||||||
|
void link(List<Integer> channelIds, Integer planId);
|
||||||
|
|
||||||
|
PageInfo<CommonGBChannel> queryChannelList(int page, int count, String query, Integer channelType, Boolean online, Integer planId, Boolean hasLink);
|
||||||
|
|
||||||
|
void linkAll(Integer planId);
|
||||||
|
|
||||||
|
void cleanAll(Integer planId);
|
||||||
|
|
||||||
|
Integer recording(String app, String stream);
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.genersoft.iot.vmp.service.bean;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "录制计划")
|
||||||
|
public class RecordPlan {
|
||||||
|
|
||||||
|
@Schema(description = "计划数据库ID")
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
@Schema(description = "计划名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "计划关联通道数量")
|
||||||
|
private int channelCount;
|
||||||
|
|
||||||
|
@Schema(description = "是否开启定时截图")
|
||||||
|
private Boolean snap;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private String updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "计划内容")
|
||||||
|
private List<RecordPlanItem> planItemList;
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package com.genersoft.iot.vmp.service.bean;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "录制计划项")
|
||||||
|
public class RecordPlanItem {
|
||||||
|
|
||||||
|
@Schema(description = "计划项数据库ID")
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
@Schema(description = "计划开始时间的序号, 从0点开始,每半个小时增加1")
|
||||||
|
private Integer start;
|
||||||
|
|
||||||
|
@Schema(description = "计划结束时间的序号, 从0点开始,每半个小时增加1")
|
||||||
|
private Integer stop;
|
||||||
|
|
||||||
|
@Schema(description = "计划周几执行")
|
||||||
|
private Integer weekDay;
|
||||||
|
|
||||||
|
@Schema(description = "所属计划ID")
|
||||||
|
private Integer planId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -15,6 +15,7 @@ import com.genersoft.iot.vmp.media.bean.MediaServer;
|
|||||||
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
|
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||||
import com.genersoft.iot.vmp.service.IMediaService;
|
import com.genersoft.iot.vmp.service.IMediaService;
|
||||||
|
import com.genersoft.iot.vmp.service.IRecordPlanService;
|
||||||
import com.genersoft.iot.vmp.service.IUserService;
|
import com.genersoft.iot.vmp.service.IUserService;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy;
|
import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy;
|
||||||
@ -59,6 +60,9 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SipInviteSessionManager sessionManager;
|
private SipInviteSessionManager sessionManager;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRecordPlanService recordPlanService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean authenticatePlay(String app, String stream, String callId) {
|
public boolean authenticatePlay(String app, String stream, String callId) {
|
||||||
if (app == null || stream == null) {
|
if (app == null || stream == null) {
|
||||||
@ -78,6 +82,12 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
public ResultForOnPublish authenticatePublish(MediaServer mediaServer, String app, String stream, String params) {
|
public ResultForOnPublish authenticatePublish(MediaServer mediaServer, String app, String stream, String params) {
|
||||||
// 推流鉴权的处理
|
// 推流鉴权的处理
|
||||||
if (!"rtp".equals(app)) {
|
if (!"rtp".equals(app)) {
|
||||||
|
if ("talk".equals(app) && stream.endsWith("_talk")) {
|
||||||
|
ResultForOnPublish result = new ResultForOnPublish();
|
||||||
|
result.setEnable_mp4(false);
|
||||||
|
result.setEnable_audio(true);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
StreamProxy streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(app, stream);
|
StreamProxy streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(app, stream);
|
||||||
if (streamProxyItem != null) {
|
if (streamProxyItem != null) {
|
||||||
ResultForOnPublish result = new ResultForOnPublish();
|
ResultForOnPublish result = new ResultForOnPublish();
|
||||||
@ -199,6 +209,9 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
@Override
|
@Override
|
||||||
public boolean closeStreamOnNoneReader(String mediaServerId, String app, String stream, String schema) {
|
public boolean closeStreamOnNoneReader(String mediaServerId, String app, String stream, String schema) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
if (recordPlanService.recording(app, stream) != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// 国标类型的流
|
// 国标类型的流
|
||||||
if ("rtp".equals(app)) {
|
if ("rtp".equals(app)) {
|
||||||
result = userSetting.getStreamOnDemand();
|
result = userSetting.getStreamOnDemand();
|
||||||
|
|||||||
@ -0,0 +1,289 @@
|
|||||||
|
package com.genersoft.iot.vmp.service.impl;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||||
|
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.dao.CommonGBChannelMapper;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IGbChannelPlayService;
|
||||||
|
import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
||||||
|
import com.genersoft.iot.vmp.media.event.media.MediaDepartureEvent;
|
||||||
|
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||||
|
import com.genersoft.iot.vmp.service.IRecordPlanService;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.RecordPlan;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.RecordPlanItem;
|
||||||
|
import com.genersoft.iot.vmp.storager.dao.RecordPlanMapper;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.google.common.base.Joiner;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class RecordPlanServiceImpl implements IRecordPlanService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RecordPlanMapper recordPlanMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CommonGBChannelMapper channelMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IGbChannelPlayService channelPlayService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMediaServerService mediaServerService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流离开的处理
|
||||||
|
*/
|
||||||
|
@Async("taskExecutor")
|
||||||
|
@EventListener
|
||||||
|
public void onApplicationEvent(MediaDepartureEvent event) {
|
||||||
|
// 流断开,检查是否还处于录像状态, 如果是则继续录像
|
||||||
|
Integer channelId = recording(event.getApp(), event.getStream());
|
||||||
|
if(channelId == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 重新拉起
|
||||||
|
CommonGBChannel channel = channelMapper.queryById(channelId);
|
||||||
|
if (channel == null) {
|
||||||
|
log.warn("[录制计划] 流离开时拉起需要录像的流时, 发现通道不存在, id: {}", channelId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 开启点播,
|
||||||
|
channelPlayService.play(channel, null, ((code, msg, streamInfo) -> {
|
||||||
|
if (code == InviteErrorCode.SUCCESS.getCode() && streamInfo != null) {
|
||||||
|
log.info("[录像] 流离开时拉起需要录像的流, 开启成功, 通道ID: {}", channel.getGbId());
|
||||||
|
recordStreamMap.put(channel.getGbId(), streamInfo);
|
||||||
|
} else {
|
||||||
|
recordStreamMap.remove(channelId);
|
||||||
|
log.info("[录像] 流离开时拉起需要录像的流, 开启失败, 十分钟后重试, 通道ID: {}", channel.getGbId());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Integer, StreamInfo> recordStreamMap = new HashMap<>();
|
||||||
|
|
||||||
|
// @Scheduled(cron = "0 */30 * * * *")
|
||||||
|
@Scheduled(fixedRate = 10, timeUnit = TimeUnit.MINUTES)
|
||||||
|
public void execution() {
|
||||||
|
log.info("[录制计划] 执行");
|
||||||
|
// 查询现在需要录像的通道Id
|
||||||
|
List<Integer> startChannelIdList = queryCurrentChannelRecord();
|
||||||
|
|
||||||
|
if (startChannelIdList.isEmpty()) {
|
||||||
|
// 当前没有录像任务, 如果存在旧的正在录像的就移除
|
||||||
|
if(!recordStreamMap.isEmpty()) {
|
||||||
|
stopStreams(recordStreamMap.keySet(), recordStreamMap);
|
||||||
|
recordStreamMap.clear();
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
// 当前存在录像任务, 获取正在录像中存在但是当前录制列表不存在的内容,进行停止; 获取正在录像中没有但是当前需录制的列表中存在的进行开启.
|
||||||
|
Set<Integer> recordStreamSet = new HashSet<>(recordStreamMap.keySet());
|
||||||
|
startChannelIdList.forEach(recordStreamSet::remove);
|
||||||
|
if (!recordStreamSet.isEmpty()) {
|
||||||
|
// 正在录像中存在但是当前录制列表不存在的内容,进行停止;
|
||||||
|
stopStreams(recordStreamSet, recordStreamMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移除startChannelIdList中已经在录像的部分, 剩下的都是需要新添加的(正在录像中没有但是当前需录制的列表中存在的进行开启)
|
||||||
|
recordStreamMap.keySet().forEach(startChannelIdList::remove);
|
||||||
|
if (!startChannelIdList.isEmpty()) {
|
||||||
|
// 获取所有的关联的通道
|
||||||
|
List<CommonGBChannel> channelList = channelMapper.queryByIds(startChannelIdList);
|
||||||
|
if (!channelList.isEmpty()) {
|
||||||
|
// 查找是否已经开启录像, 如果没有则开启录像
|
||||||
|
for (CommonGBChannel channel : channelList) {
|
||||||
|
// 开启点播,
|
||||||
|
channelPlayService.play(channel, null, ((code, msg, streamInfo) -> {
|
||||||
|
if (code == InviteErrorCode.SUCCESS.getCode() && streamInfo != null) {
|
||||||
|
log.info("[录像] 开启成功, 通道ID: {}", channel.getGbId());
|
||||||
|
recordStreamMap.put(channel.getGbId(), streamInfo);
|
||||||
|
} else {
|
||||||
|
log.info("[录像] 开启失败, 十分钟后重试, 通道ID: {}", channel.getGbId());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.error("[录制计划] 数据异常, 这些关联的通道已经不存在了: {}", Joiner.on(",").join(startChannelIdList));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间段应该录像的通道Id列表
|
||||||
|
*/
|
||||||
|
private List<Integer> queryCurrentChannelRecord(){
|
||||||
|
// 获取当前时间在一周内的序号, 数据库存储的从第几个30分钟开始, 0-47, 包括首尾
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
int week = now.getDayOfWeek().getValue();
|
||||||
|
int index = now.getHour() * 2 + (now.getMinute() > 30?1:0);
|
||||||
|
|
||||||
|
// 查询现在需要录像的通道Id
|
||||||
|
return recordPlanMapper.queryRecordIng(week, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopStreams(Collection<Integer> channelIds, Map<Integer, StreamInfo> recordStreamMap) {
|
||||||
|
for (Integer channelId : channelIds) {
|
||||||
|
try {
|
||||||
|
StreamInfo streamInfo = recordStreamMap.get(channelId);
|
||||||
|
if (streamInfo == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 查看是否有人观看,存在则不做处理,等待后续自然处理,如果无人观看,则关闭该流
|
||||||
|
MediaInfo mediaInfo = mediaServerService.getMediaInfo(streamInfo.getMediaServer(), streamInfo.getApp(), streamInfo.getStream());
|
||||||
|
if (mediaInfo.getReaderCount() == null || mediaInfo.getReaderCount() == 0) {
|
||||||
|
mediaServerService.closeStreams(streamInfo.getMediaServer(), streamInfo.getApp(), streamInfo.getStream());
|
||||||
|
log.info("[录制计划] 停止, 通道ID: {}", channelId);
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
log.error("[录制计划] 停止时异常", e);
|
||||||
|
}finally {
|
||||||
|
recordStreamMap.remove(channelId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer recording(String app, String stream) {
|
||||||
|
for (Integer channelId : recordStreamMap.keySet()) {
|
||||||
|
StreamInfo streamInfo = recordStreamMap.get(channelId);
|
||||||
|
if (streamInfo != null && streamInfo.getApp().equals(app) && streamInfo.getStream().equals(stream)) {
|
||||||
|
return channelId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void add(RecordPlan plan) {
|
||||||
|
plan.setCreateTime(DateUtil.getNow());
|
||||||
|
plan.setUpdateTime(DateUtil.getNow());
|
||||||
|
recordPlanMapper.add(plan);
|
||||||
|
if (plan.getId() > 0 && !plan.getPlanItemList().isEmpty()) {
|
||||||
|
for (RecordPlanItem recordPlanItem : plan.getPlanItemList()) {
|
||||||
|
recordPlanItem.setPlanId(plan.getId());
|
||||||
|
}
|
||||||
|
recordPlanMapper.batchAddItem(plan.getId(), plan.getPlanItemList());
|
||||||
|
}
|
||||||
|
// TODO 更新录像队列
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RecordPlan get(Integer planId) {
|
||||||
|
RecordPlan recordPlan = recordPlanMapper.get(planId);
|
||||||
|
if (recordPlan == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<RecordPlanItem> recordPlanItemList = recordPlanMapper.getItemList(planId);
|
||||||
|
if (!recordPlanItemList.isEmpty()) {
|
||||||
|
recordPlan.setPlanItemList(recordPlanItemList);
|
||||||
|
}
|
||||||
|
return recordPlan;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void update(RecordPlan plan) {
|
||||||
|
plan.setUpdateTime(DateUtil.getNow());
|
||||||
|
recordPlanMapper.update(plan);
|
||||||
|
recordPlanMapper.cleanItems(plan.getId());
|
||||||
|
if (plan.getPlanItemList() != null && !plan.getPlanItemList().isEmpty()){
|
||||||
|
List<RecordPlanItem> planItemList = new ArrayList<>();
|
||||||
|
for (RecordPlanItem recordPlanItem : plan.getPlanItemList()) {
|
||||||
|
if (recordPlanItem.getStart() == null || recordPlanItem.getStop() == null || recordPlanItem.getWeekDay() == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (recordPlanItem.getPlanId() == null) {
|
||||||
|
recordPlanItem.setPlanId(plan.getId());
|
||||||
|
}
|
||||||
|
planItemList.add(recordPlanItem);
|
||||||
|
}
|
||||||
|
if(!planItemList.isEmpty()) {
|
||||||
|
recordPlanMapper.batchAddItem(plan.getId(), planItemList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// TODO 更新录像队列
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void delete(Integer planId) {
|
||||||
|
RecordPlan recordPlan = recordPlanMapper.get(planId);
|
||||||
|
if (recordPlan == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "录制计划不存在");
|
||||||
|
}
|
||||||
|
// 清理关联的通道
|
||||||
|
channelMapper.removeRecordPlanByPlanId(recordPlan.getId());
|
||||||
|
recordPlanMapper.cleanItems(planId);
|
||||||
|
recordPlanMapper.delete(planId);
|
||||||
|
// TODO 更新录像队列
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<RecordPlan> query(Integer page, Integer count, String query) {
|
||||||
|
PageHelper.startPage(page, count);
|
||||||
|
if (query != null) {
|
||||||
|
query = query.replaceAll("/", "//")
|
||||||
|
.replaceAll("%", "/%")
|
||||||
|
.replaceAll("_", "/_");
|
||||||
|
}
|
||||||
|
List<RecordPlan> all = recordPlanMapper.query(query);
|
||||||
|
return new PageInfo<>(all);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void link(List<Integer> channelIds, Integer planId) {
|
||||||
|
if (channelIds == null || channelIds.isEmpty()) {
|
||||||
|
log.info("[录制计划] 关联/移除关联时, 通道编号必须存在");
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "通道编号必须存在");
|
||||||
|
}
|
||||||
|
if (planId == null) {
|
||||||
|
channelMapper.removeRecordPlan(channelIds);
|
||||||
|
}else {
|
||||||
|
channelMapper.addRecordPlan(channelIds, planId);
|
||||||
|
}
|
||||||
|
// 查看当前的待录制列表是否变化,如果变化,则调用录制计划马上开始录制
|
||||||
|
execution();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<CommonGBChannel> queryChannelList(int page, int count, String query, Integer channelType, Boolean online, Integer planId, Boolean hasLink) {
|
||||||
|
PageHelper.startPage(page, count);
|
||||||
|
if (query != null) {
|
||||||
|
query = query.replaceAll("/", "//")
|
||||||
|
.replaceAll("%", "/%")
|
||||||
|
.replaceAll("_", "/_");
|
||||||
|
}
|
||||||
|
List<CommonGBChannel> all = channelMapper.queryForRecordPlanForWebList(planId, query, channelType, online, hasLink);
|
||||||
|
return new PageInfo<>(all);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void linkAll(Integer planId) {
|
||||||
|
channelMapper.addRecordPlanForAll(planId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanAll(Integer planId) {
|
||||||
|
channelMapper.removeRecordPlanByPlanId(planId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -53,7 +53,7 @@ public interface CloudRecordServiceMapper {
|
|||||||
" <if test= 'ids != null ' > and id in " +
|
" <if test= 'ids != null ' > and id in " +
|
||||||
" <foreach collection='ids' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
" <foreach collection='ids' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||||
" </if>" +
|
" </if>" +
|
||||||
" order by start_time ASC" +
|
" order by start_time desc" +
|
||||||
" </script>")
|
" </script>")
|
||||||
List<CloudRecordItem> getList(@Param("query") String query, @Param("app") String app, @Param("stream") String stream,
|
List<CloudRecordItem> getList(@Param("query") String query, @Param("app") String app, @Param("stream") String stream,
|
||||||
@Param("startTimeStamp")Long startTimeStamp, @Param("endTimeStamp")Long endTimeStamp,
|
@Param("startTimeStamp")Long startTimeStamp, @Param("endTimeStamp")Long endTimeStamp,
|
||||||
|
|||||||
@ -0,0 +1,67 @@
|
|||||||
|
package com.genersoft.iot.vmp.storager.dao;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.service.bean.RecordPlan;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.RecordPlanItem;
|
||||||
|
import org.apache.ibatis.annotations.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface RecordPlanMapper {
|
||||||
|
|
||||||
|
@Insert(" <script>" +
|
||||||
|
"INSERT INTO wvp_record_plan (" +
|
||||||
|
" name," +
|
||||||
|
" snap," +
|
||||||
|
" create_time," +
|
||||||
|
" update_time) " +
|
||||||
|
"VALUES (" +
|
||||||
|
" #{name}," +
|
||||||
|
" #{snap}," +
|
||||||
|
" #{createTime}," +
|
||||||
|
" #{updateTime})" +
|
||||||
|
" </script>")
|
||||||
|
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||||
|
void add(RecordPlan plan);
|
||||||
|
|
||||||
|
@Insert(" <script>" +
|
||||||
|
"INSERT INTO wvp_record_plan_item (" +
|
||||||
|
"start," +
|
||||||
|
"stop, " +
|
||||||
|
"week_day," +
|
||||||
|
"plan_id) " +
|
||||||
|
"VALUES" +
|
||||||
|
"<foreach collection='planItemList' index='index' item='item' separator=','> " +
|
||||||
|
"(#{item.start}, #{item.stop}, #{item.weekDay},#{planId})" +
|
||||||
|
"</foreach> " +
|
||||||
|
" </script>")
|
||||||
|
void batchAddItem(@Param("planId") int planId, List<RecordPlanItem> planItemList);
|
||||||
|
|
||||||
|
@Select("select * from wvp_record_plan where id = #{planId}")
|
||||||
|
RecordPlan get(@Param("planId") Integer planId);
|
||||||
|
|
||||||
|
@Select(" <script>" +
|
||||||
|
" SELECT wrp.*, (select count(1) from wvp_device_channel where record_plan_id = wrp.id) AS channelCount\n" +
|
||||||
|
" FROM wvp_record_plan wrp where 1=1" +
|
||||||
|
" <if test='query != null'> AND (name LIKE concat('%',#{query},'%') escape '/' )</if> " +
|
||||||
|
" </script>")
|
||||||
|
List<RecordPlan> query(@Param("query") String query);
|
||||||
|
|
||||||
|
@Update("UPDATE wvp_record_plan SET update_time=#{updateTime}, name=#{name}, snap=#{snap} WHERE id=#{id}")
|
||||||
|
void update(RecordPlan plan);
|
||||||
|
|
||||||
|
@Delete("DELETE FROM wvp_record_plan WHERE id=#{planId}")
|
||||||
|
void delete(@Param("planId") Integer planId);
|
||||||
|
|
||||||
|
@Select("select * from wvp_record_plan_item where plan_id = #{planId}")
|
||||||
|
List<RecordPlanItem> getItemList(@Param("planId") Integer planId);
|
||||||
|
|
||||||
|
@Delete("DELETE FROM wvp_record_plan_item WHERE plan_id = #{planId}")
|
||||||
|
void cleanItems(@Param("planId") Integer planId);
|
||||||
|
|
||||||
|
@Select(" <script>" +
|
||||||
|
" select wdc.id from wvp_device_channel wdc left join wvp_record_plan_item wrpi on wrpi.plan_id = wdc.record_plan_id " +
|
||||||
|
" where wrpi.week_day = #{week} and wrpi.start <= #{index} and stop >= #{index} group by wdc.id" +
|
||||||
|
" </script>")
|
||||||
|
List<Integer> queryRecordIng(@Param("week") int week, @Param("index") int index);
|
||||||
|
}
|
||||||
@ -230,16 +230,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||||||
gbChannelService.add(streamProxy.buildCommonGBChannel());
|
gbChannelService.add(streamProxy.buildCommonGBChannel());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 判断是否需要重启代理
|
|
||||||
if (!streamProxyInDb.getApp().equals(streamProxy.getApp())
|
|
||||||
|| !streamProxyInDb.getStream().equals(streamProxy.getStream())
|
|
||||||
|| (streamProxyInDb.getMediaServerId() != null && streamProxyInDb.getMediaServerId().equals(streamProxy.getMediaServerId()))
|
|
||||||
|| (streamProxyInDb.getMediaServerId() == null && streamProxy.getMediaServerId() != null)
|
|
||||||
) {
|
|
||||||
// 变化则重启代理
|
|
||||||
playService.stopProxy(streamProxyInDb);
|
|
||||||
playService.startProxy(streamProxy);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,150 @@
|
|||||||
|
package com.genersoft.iot.vmp.vmanager.recordPlan;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
|
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
||||||
|
import com.genersoft.iot.vmp.service.IRecordPlanService;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.RecordPlan;
|
||||||
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
|
import com.genersoft.iot.vmp.vmanager.recordPlan.bean.RecordPlanParam;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Tag(name = "录制计划")
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/record/plan")
|
||||||
|
public class RecordPlanController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRecordPlanService recordPlanService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceChannelService deviceChannelService;
|
||||||
|
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/add")
|
||||||
|
@Operation(summary = "添加录制计划", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "plan", description = "计划", required = true)
|
||||||
|
public void add(@RequestBody RecordPlan plan) {
|
||||||
|
if (plan.getPlanItemList() == null || plan.getPlanItemList().isEmpty()) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "添加录制计划时,录制计划不可为空");
|
||||||
|
}
|
||||||
|
recordPlanService.add(plan);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/link")
|
||||||
|
@Operation(summary = "通道关联录制计划", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "param", description = "通道关联录制计划", required = true)
|
||||||
|
public void link(@RequestBody RecordPlanParam param) {
|
||||||
|
if (param.getAllLink() != null) {
|
||||||
|
if (param.getAllLink()) {
|
||||||
|
recordPlanService.linkAll(param.getPlanId());
|
||||||
|
}else {
|
||||||
|
recordPlanService.cleanAll(param.getPlanId());
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (param.getChannelIds() == null && param.getDeviceDbIds() == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "通道ID和国标设备ID不可都为NULL");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Integer> channelIds = new ArrayList<>();
|
||||||
|
if (param.getChannelIds() != null) {
|
||||||
|
channelIds.addAll(param.getChannelIds());
|
||||||
|
}else {
|
||||||
|
List<Integer> chanelIdList = deviceChannelService.queryChaneIdListByDeviceDbIds(param.getDeviceDbIds());
|
||||||
|
if (chanelIdList != null && !chanelIdList.isEmpty()) {
|
||||||
|
channelIds = chanelIdList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
recordPlanService.link(channelIds, param.getPlanId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "查询录制计划", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "planId", description = "计划ID", required = true)
|
||||||
|
public RecordPlan get(Integer planId) {
|
||||||
|
if (planId == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "计划ID不可为NULL");
|
||||||
|
}
|
||||||
|
return recordPlanService.get(planId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/query")
|
||||||
|
@Operation(summary = "查询录制计划列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "query", description = "检索内容", required = false)
|
||||||
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
|
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||||
|
public PageInfo<RecordPlan> query(@RequestParam(required = false) String query, @RequestParam Integer page, @RequestParam Integer count) {
|
||||||
|
if (query != null && ObjectUtils.isEmpty(query.trim())) {
|
||||||
|
query = null;
|
||||||
|
}
|
||||||
|
return recordPlanService.query(page, count, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询级联平台的所有所有通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
|
@Parameter(name = "count", description = "每页条数", required = true)
|
||||||
|
@Parameter(name = "planId", description = "录制计划ID")
|
||||||
|
@Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理")
|
||||||
|
@Parameter(name = "query", description = "查询内容")
|
||||||
|
@Parameter(name = "online", description = "是否在线")
|
||||||
|
@Parameter(name = "hasLink", description = "是否已经关联")
|
||||||
|
@GetMapping("/channel/list")
|
||||||
|
@ResponseBody
|
||||||
|
public PageInfo<CommonGBChannel> queryChannelList(int page, int count,
|
||||||
|
@RequestParam(required = false) Integer planId,
|
||||||
|
@RequestParam(required = false) String query,
|
||||||
|
@RequestParam(required = false) Integer channelType,
|
||||||
|
@RequestParam(required = false) Boolean online,
|
||||||
|
@RequestParam(required = false) Boolean hasLink) {
|
||||||
|
|
||||||
|
Assert.notNull(planId, "录制计划ID不可为NULL");
|
||||||
|
if (org.springframework.util.ObjectUtils.isEmpty(query)) {
|
||||||
|
query = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return recordPlanService.queryChannelList(page, count, query, channelType, online, planId, hasLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/update")
|
||||||
|
@Operation(summary = "更新录制计划", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "plan", description = "计划", required = true)
|
||||||
|
public void update(@RequestBody RecordPlan plan) {
|
||||||
|
if (plan == null || plan.getId() == 0) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR400);
|
||||||
|
}
|
||||||
|
recordPlanService.update(plan);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除录制计划", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@Parameter(name = "planId", description = "计划ID", required = true)
|
||||||
|
public void delete(Integer planId) {
|
||||||
|
if (planId == null) {
|
||||||
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "计划IDID不可为NULL");
|
||||||
|
}
|
||||||
|
recordPlanService.delete(planId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.genersoft.iot.vmp.vmanager.recordPlan.bean;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "录制计划-添加/编辑参数")
|
||||||
|
public class RecordPlanParam {
|
||||||
|
|
||||||
|
@Schema(description = "关联的通道ID")
|
||||||
|
private List<Integer> channelIds;
|
||||||
|
|
||||||
|
@Schema(description = "关联的设备ID,会为设备下的所有通道关联此录制计划,channelId存在是此项不生效,")
|
||||||
|
private List<Integer> deviceDbIds;
|
||||||
|
|
||||||
|
@Schema(description = "全部关联/全部取消关联")
|
||||||
|
private Boolean allLink;
|
||||||
|
|
||||||
|
@Schema(description = "录制计划ID, ID为空是删除关联的计划")
|
||||||
|
private Integer planId;
|
||||||
|
}
|
||||||
10
src/main/resources/index.html
Normal file
10
src/main/resources/index.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
111
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -15,6 +15,7 @@
|
|||||||
"@liveqing/liveplayer": "^2.7.10",
|
"@liveqing/liveplayer": "^2.7.10",
|
||||||
"@wchbrad/vue-easy-tree": "^1.0.12",
|
"@wchbrad/vue-easy-tree": "^1.0.12",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
|
"byte-weektime-picker": "^1.1.1",
|
||||||
"core-js": "^2.6.5",
|
"core-js": "^2.6.5",
|
||||||
"echarts": "^4.9.0",
|
"echarts": "^4.9.0",
|
||||||
"element-ui": "^2.15.14",
|
"element-ui": "^2.15.14",
|
||||||
|
|||||||
@ -7,26 +7,28 @@
|
|||||||
|
|
||||||
<div class="page-header-btn">
|
<div class="page-header-btn">
|
||||||
搜索:
|
搜索:
|
||||||
<el-input @input="getRecordList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
|
<el-input @input="initData" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
|
||||||
prefix-icon="el-icon-search" v-model="search" clearable></el-input>
|
prefix-icon="el-icon-search" v-model="search" clearable></el-input>
|
||||||
开始时间:
|
开始时间:
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="startTime"
|
v-model="startTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
|
size="mini"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
@change="getMediaServerList"
|
@change="initData"
|
||||||
placeholder="选择日期时间">
|
placeholder="选择日期时间">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
结束时间:
|
结束时间:
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="endTime"
|
v-model="endTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
|
size="mini"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
@change="getMediaServerList"
|
@change="initData"
|
||||||
placeholder="选择日期时间">
|
placeholder="选择日期时间">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
节点选择:
|
节点选择:
|
||||||
<el-select size="mini" @change="getMediaServerList" style="width: 16rem; margin-right: 1rem;"
|
<el-select size="mini" @change="initData" style="width: 16rem; margin-right: 1rem;"
|
||||||
v-model="mediaServerId" placeholder="请选择" >
|
v-model="mediaServerId" placeholder="请选择" >
|
||||||
<el-option label="全部" value=""></el-option>
|
<el-option label="全部" value=""></el-option>
|
||||||
<el-option
|
<el-option
|
||||||
@ -38,7 +40,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
<!-- <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteRecord()">批量删除</el-button>-->
|
<!-- <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteRecord()">批量删除</el-button>-->
|
||||||
<el-button icon="el-icon-refresh-right" circle size="mini" :loading="loading"
|
<el-button icon="el-icon-refresh-right" circle size="mini" :loading="loading"
|
||||||
@click="getRecordList()"></el-button>
|
@click="initData()"></el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--设备列表-->
|
<!--设备列表-->
|
||||||
@ -146,14 +148,13 @@ export default {
|
|||||||
computed: {},
|
computed: {},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initData();
|
this.initData();
|
||||||
|
this.getMediaServerList();
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
this.$destroy('recordVideoPlayer');
|
this.$destroy('recordVideoPlayer');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData: function () {
|
initData: function () {
|
||||||
// 获取媒体节点列表
|
|
||||||
this.getMediaServerList();
|
|
||||||
this.getRecordList();
|
this.getRecordList();
|
||||||
},
|
},
|
||||||
currentChange: function (val) {
|
currentChange: function (val) {
|
||||||
|
|||||||
@ -246,6 +246,15 @@ export default {
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
if (res.data.data && res.data.data.errorMsg) {
|
||||||
|
that.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: res.data.data.errorMsg,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.$refs.syncChannelProgress.openDialog(itemData.deviceId, ()=>{
|
this.$refs.syncChannelProgress.openDialog(itemData.deviceId, ()=>{
|
||||||
console.log(32322)
|
console.log(32322)
|
||||||
this.initData()
|
this.initData()
|
||||||
|
|||||||
236
web_src/src/components/RecordPLan.vue
Executable file
236
web_src/src/components/RecordPLan.vue
Executable file
@ -0,0 +1,236 @@
|
|||||||
|
<template>
|
||||||
|
<div id="recordPLan" style="width: 100%">
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-title">
|
||||||
|
<div >录像计划</div>
|
||||||
|
</div>
|
||||||
|
<div class="page-header-btn">
|
||||||
|
<div style="display: inline;">
|
||||||
|
搜索:
|
||||||
|
<el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
|
||||||
|
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
|
||||||
|
<el-button size="mini" type="primary" @click="add()">
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="el-icon-refresh-right" circle size="mini" @click="getRecordPlanList()"></el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table size="medium" ref="recordPlanListTable" :data="recordPlanList" :height="winHeight" style="width: 100%"
|
||||||
|
header-row-class-name="table-header" >
|
||||||
|
<el-table-column type="selection" width="55" >
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="name" label="名称" >
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="channelCount" label="关联通道" >
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="updateTime" label="更新时间">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="创建时间">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="300" fixed="right">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<el-button size="medium" icon="el-icon-link" type="text" @click="link(scope.row)">关联通道</el-button>
|
||||||
|
<el-button size="medium" icon="el-icon-edit" type="text" @click="edit(scope.row)">编辑</el-button>
|
||||||
|
<el-button size="medium" icon="el-icon-delete" style="color: #f56c6c" type="text" @click="deletePlan(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
style="text-align: right"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
:current-page="currentPage"
|
||||||
|
:page-size="count"
|
||||||
|
:page-sizes="[15, 25, 35, 50]"
|
||||||
|
layout="total, sizes, prev, pager, next"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
<editRecordPlan ref="editRecordPlan"></editRecordPlan>
|
||||||
|
<LinkChannelRecord ref="linkChannelRecord"></LinkChannelRecord>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import uiHeader from '../layout/UiHeader.vue'
|
||||||
|
import EditRecordPlan from "./dialog/editRecordPlan.vue";
|
||||||
|
import LinkChannelRecord from "./dialog/linkChannelRecord.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'recordPLan',
|
||||||
|
components: {
|
||||||
|
EditRecordPlan,
|
||||||
|
LinkChannelRecord,
|
||||||
|
uiHeader,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
recordPlanList: [],
|
||||||
|
searchSrt: "",
|
||||||
|
winHeight: window.innerHeight - 180,
|
||||||
|
currentPage: 1,
|
||||||
|
count: 15,
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
destroyed() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initData: function () {
|
||||||
|
this.getRecordPlanList();
|
||||||
|
},
|
||||||
|
currentChange: function (val) {
|
||||||
|
this.currentPage = val;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
handleSizeChange: function (val) {
|
||||||
|
this.count = val;
|
||||||
|
this.getRecordPlanList();
|
||||||
|
},
|
||||||
|
getRecordPlanList: function () {
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/record/plan/query`,
|
||||||
|
params: {
|
||||||
|
page: this.currentPage,
|
||||||
|
count: this.count,
|
||||||
|
query: this.searchSrt,
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.total = res.data.data.total;
|
||||||
|
this.recordPlanList = res.data.data.list;
|
||||||
|
// 防止出现表格错位
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.recordPlanListTable.doLayout();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getSnap: function (row) {
|
||||||
|
let baseUrl = window.baseUrl ? window.baseUrl : "";
|
||||||
|
return ((process.env.NODE_ENV === 'development') ? process.env.BASE_API : baseUrl) + '/api/device/query/snap/' + this.deviceId + '/' + row.deviceId;
|
||||||
|
},
|
||||||
|
search: function () {
|
||||||
|
this.currentPage = 1;
|
||||||
|
this.total = 0;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
refresh: function () {
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
add: function () {
|
||||||
|
this.$refs.editRecordPlan.openDialog(null, ()=>{
|
||||||
|
this.initData()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit: function (plan) {
|
||||||
|
this.$refs.editRecordPlan.openDialog(plan, ()=>{
|
||||||
|
this.initData()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
link: function (plan) {
|
||||||
|
this.$refs.linkChannelRecord.openDialog(plan.id, ()=>{
|
||||||
|
this.initData()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
deletePlan: function (plan) {
|
||||||
|
this.$confirm('确定删除?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$axios({
|
||||||
|
method: 'delete',
|
||||||
|
url: "/api/record/plan/delete",
|
||||||
|
params: {
|
||||||
|
planId: plan.id,
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success',
|
||||||
|
});
|
||||||
|
this.initData();
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: res.data.msg,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.videoList {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item {
|
||||||
|
position: relative;
|
||||||
|
width: 15rem;
|
||||||
|
height: 10rem;
|
||||||
|
margin-right: 1rem;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item-img {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item-img:after {
|
||||||
|
content: "";
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 3rem;
|
||||||
|
height: 3rem;
|
||||||
|
background-image: url("../assets/loading.png");
|
||||||
|
background-size: cover;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item-title {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
color: #000000;
|
||||||
|
background-color: #ffffff;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
padding: 0.3rem;
|
||||||
|
width: 14.4rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -14,6 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="showHeader" style="height: 2rem; background-color: #FFFFFF"></div>
|
<div v-if="showHeader" style="height: 2rem; background-color: #FFFFFF"></div>
|
||||||
<div>
|
<div>
|
||||||
|
<el-alert v-if="showAlert && edit" title="操作提示" description="你可以使用右键菜单管理节点" type="info" style="text-align: left"></el-alert>
|
||||||
<vue-easy-tree
|
<vue-easy-tree
|
||||||
class="flow-tree"
|
class="flow-tree"
|
||||||
ref="veTree"
|
ref="veTree"
|
||||||
@ -65,6 +66,7 @@ export default {
|
|||||||
id: "treeId"
|
id: "treeId"
|
||||||
},
|
},
|
||||||
showCode: false,
|
showCode: false,
|
||||||
|
showAlert: true,
|
||||||
searchSrt: "",
|
searchSrt: "",
|
||||||
chooseId: "",
|
chooseId: "",
|
||||||
treeData: [],
|
treeData: [],
|
||||||
@ -101,6 +103,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
|
if (res.data.data.length > 0) {
|
||||||
|
this.showAlert = false
|
||||||
|
}
|
||||||
resolve(res.data.data);
|
resolve(res.data.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showHeader" style="height: 2rem; background-color: #FFFFFF" ></div>
|
<div v-if="showHeader" style="height: 2rem; background-color: #FFFFFF" ></div>
|
||||||
<div >
|
<div>
|
||||||
|
<el-alert v-if="showAlert && edit" title="操作提示" description="你可以使用右键菜单管理节点" type="info" style="text-align: left"></el-alert>
|
||||||
<vue-easy-tree
|
<vue-easy-tree
|
||||||
class="flow-tree"
|
class="flow-tree"
|
||||||
ref="veTree"
|
ref="veTree"
|
||||||
@ -63,6 +64,7 @@ export default {
|
|||||||
label: "name",
|
label: "name",
|
||||||
},
|
},
|
||||||
showCode: false,
|
showCode: false,
|
||||||
|
showAlert: true,
|
||||||
searchSrt: "",
|
searchSrt: "",
|
||||||
chooseId: "",
|
chooseId: "",
|
||||||
treeData: [],
|
treeData: [],
|
||||||
@ -99,6 +101,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
|
if (res.data.data.length > 0) {
|
||||||
|
this.showAlert = false
|
||||||
|
}
|
||||||
resolve(res.data.data);
|
resolve(res.data.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -64,16 +64,22 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<div style="display: grid; grid-template-columns: 1fr 1fr">
|
||||||
style="text-align: right"
|
<div style="text-align: left; line-height: 32px">
|
||||||
@size-change="handleSizeChange"
|
<i class="el-icon-info"></i>未找到通道,可在国标设备/通道中选择编辑按钮, 选择{{dataType === 'civilCode'?'行政区划':'父节点编码'}}
|
||||||
@current-change="currentChange"
|
</div>
|
||||||
:current-page="currentPage"
|
<el-pagination
|
||||||
:page-size="count"
|
style="text-align: right"
|
||||||
:page-sizes="[10, 25, 35, 50, 200, 1000, 50000]"
|
@size-change="handleSizeChange"
|
||||||
layout="total, sizes, prev, pager, next"
|
@current-change="currentChange"
|
||||||
:total="total">
|
:current-page="currentPage"
|
||||||
</el-pagination>
|
:page-size="count"
|
||||||
|
:page-sizes="[10, 25, 35, 50, 200, 1000, 50000]"
|
||||||
|
layout="total, sizes, prev, pager, next"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -60,16 +60,14 @@ export default {
|
|||||||
url:`/api/device/query/${this.deviceId}/sync_status/`,
|
url:`/api/device/query/${this.deviceId}/sync_status/`,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
if (!this.syncFlag) {
|
|
||||||
this.syncFlag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.data.data != null) {
|
if (res.data.data != null) {
|
||||||
if (res.data.data.syncIng) {
|
if (res.data.data.syncIng) {
|
||||||
if (res.data.data.total == 0) {
|
if (res.data.data.total === 0) {
|
||||||
this.msg = `等待同步中`;
|
this.msg = `等待同步中`;
|
||||||
this.timmer = setTimeout(this.getProgress, 300)
|
this.timmer = setTimeout(this.getProgress, 300)
|
||||||
}else {
|
}else {
|
||||||
|
this.syncFlag = true;
|
||||||
this.total = res.data.data.total;
|
this.total = res.data.data.total;
|
||||||
this.current = res.data.data.current;
|
this.current = res.data.data.current;
|
||||||
this.percentage = Math.floor(Number(res.data.data.current)/Number(res.data.data.total)* 10000)/100;
|
this.percentage = Math.floor(Number(res.data.data.current)/Number(res.data.data.total)* 10000)/100;
|
||||||
@ -89,6 +87,9 @@ export default {
|
|||||||
}, 3000)
|
}, 3000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
this.msg = res.data.msg;
|
||||||
|
this.timmer = setTimeout(this.getProgress, 300)
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if (this.syncFlag) {
|
if (this.syncFlag) {
|
||||||
|
|||||||
@ -501,35 +501,6 @@ export default {
|
|||||||
videoError: function (e) {
|
videoError: function (e) {
|
||||||
console.log("播放器错误:" + JSON.stringify(e));
|
console.log("播放器错误:" + JSON.stringify(e));
|
||||||
},
|
},
|
||||||
presetPosition: function (cmdCode, presetPos) {
|
|
||||||
console.log('预置位控制:' + this.presetPos + ' : 0x' + cmdCode.toString(16));
|
|
||||||
let that = this;
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=0¶meter2=' + presetPos + '&combindCode2=0'
|
|
||||||
}).then(function (res) {
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setSpeedOrTime: function (cmdCode, groupNum, parameter) {
|
|
||||||
let that = this;
|
|
||||||
let parameter2 = parameter % 256;
|
|
||||||
let combindCode2 = Math.floor(parameter / 256) * 16;
|
|
||||||
console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter2.toString(16) + ' 0x' + combindCode2.toString(16));
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter2 + '&combindCode2=' + combindCode2
|
|
||||||
}).then(function (res) {
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setCommand: function (cmdCode, groupNum, parameter) {
|
|
||||||
let that = this;
|
|
||||||
console.log('前端控制:0x' + cmdCode.toString(16) + ' 0x' + groupNum.toString(16) + ' 0x' + parameter.toString(16) + ' 0x0');
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: '/api/ptz/front_end_command/' + this.deviceId + '/' + this.channelId + '?cmdCode=' + cmdCode + '¶meter1=' + groupNum + '¶meter2=' + parameter + '&combindCode2=0'
|
|
||||||
}).then(function (res) {
|
|
||||||
});
|
|
||||||
},
|
|
||||||
copyUrl: function (dropdownItem) {
|
copyUrl: function (dropdownItem) {
|
||||||
console.log(dropdownItem)
|
console.log(dropdownItem)
|
||||||
this.$copyText(dropdownItem).then((e) => {
|
this.$copyText(dropdownItem).then((e) => {
|
||||||
@ -613,17 +584,6 @@ export default {
|
|||||||
recvOnly: false,
|
recvOnly: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
// webrtcPlayer.on(ZLMRTCClient.Events.WEBRTC_ON_REMOTE_STREAMS,(e)=>{//获取到了远端流,可以播放
|
|
||||||
// console.error('播放成功',e.streams)
|
|
||||||
// this.broadcastStatus = 1;
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// webrtcPlayer.on(ZLMRTCClient.Events.WEBRTC_ON_LOCAL_STREAM,(s)=>{// 获取到了本地流
|
|
||||||
// this.broadcastStatus = 1;
|
|
||||||
// // document.getElementById('selfVideo').srcObject=s;
|
|
||||||
// // this.eventcallbacK("LOCAL STREAM", "获取到了本地流")
|
|
||||||
// });
|
|
||||||
|
|
||||||
this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_NOT_SUPPORT, (e) => {// 获取到了本地流
|
this.broadcastRtc.on(ZLMRTCClient.Events.WEBRTC_NOT_SUPPORT, (e) => {// 获取到了本地流
|
||||||
console.error('不支持webrtc', e)
|
console.error('不支持webrtc', e)
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
228
web_src/src/components/dialog/editRecordPlan.vue
Normal file
228
web_src/src/components/dialog/editRecordPlan.vue
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
<template>
|
||||||
|
<div id="editRecordPlan" v-loading="loading" style="text-align: left;">
|
||||||
|
<el-dialog
|
||||||
|
title="录制计划"
|
||||||
|
width="700px"
|
||||||
|
top="2rem"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="showDialog"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
@close="close()"
|
||||||
|
>
|
||||||
|
<div id="shared" style="margin-right: 20px;">
|
||||||
|
<el-form >
|
||||||
|
<el-form-item label="名称">
|
||||||
|
<el-input type="text" v-model="planName"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<ByteWeektimePicker v-model="byteTime" name="name"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<div style="float: right; margin-top: 20px">
|
||||||
|
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||||
|
<el-button @click="close">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ByteWeektimePicker } from 'byte-weektime-picker'
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "editRecordPlan",
|
||||||
|
props: {},
|
||||||
|
components: {ByteWeektimePicker},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
options: [],
|
||||||
|
loading: false,
|
||||||
|
edit: false,
|
||||||
|
planName: null,
|
||||||
|
id: null,
|
||||||
|
showDialog: false,
|
||||||
|
endCallback: "",
|
||||||
|
byteTime: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openDialog: function (recordPlan, endCallback) {
|
||||||
|
this.endCallback = endCallback;
|
||||||
|
this.showDialog = true;
|
||||||
|
this.byteTime= "";
|
||||||
|
if (recordPlan) {
|
||||||
|
this.edit = true
|
||||||
|
this.planName = recordPlan.name
|
||||||
|
this.id = recordPlan.id
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: "/api/record/plan/get",
|
||||||
|
params: {
|
||||||
|
planId: recordPlan.id,
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.code === 0 && res.data.data.planItemList) {
|
||||||
|
this.byteTime = this.plan2Byte(res.data.data.planItemList)
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSubmit: function () {
|
||||||
|
let planList = this.byteTime2PlanList();
|
||||||
|
if (!this.edit) {
|
||||||
|
this.$axios({
|
||||||
|
method: 'post',
|
||||||
|
url: "/api/record/plan/add",
|
||||||
|
data: {
|
||||||
|
name: this.planName,
|
||||||
|
planItemList: planList
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: '添加成功',
|
||||||
|
type: 'success',
|
||||||
|
});
|
||||||
|
this.showDialog = false;
|
||||||
|
this.endCallback()
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: res.data.msg,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
this.$axios({
|
||||||
|
method: 'post',
|
||||||
|
url: "/api/record/plan/update",
|
||||||
|
data: {
|
||||||
|
id: this.id,
|
||||||
|
name: this.planName,
|
||||||
|
planItemList: planList
|
||||||
|
}
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: '更新成功',
|
||||||
|
type: 'success',
|
||||||
|
});
|
||||||
|
this.showDialog = false;
|
||||||
|
this.endCallback()
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: res.data.msg,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
close: function () {
|
||||||
|
this.showDialog = false;
|
||||||
|
this.id = null
|
||||||
|
this.planName = null
|
||||||
|
this.byteTime = ""
|
||||||
|
this.endCallback = ""
|
||||||
|
if(this.endCallback) {
|
||||||
|
this.endCallback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
byteTime2PlanList() {
|
||||||
|
if (this.byteTime.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const DayTimes = 24 * 2;
|
||||||
|
let planList = []
|
||||||
|
let week = 1;
|
||||||
|
// 把 336长度的 list 分成 7 组,每组 48 个
|
||||||
|
for (let i = 0; i < this.byteTime.length; i += DayTimes) {
|
||||||
|
let planArray = this.byteTime2Plan(this.byteTime.slice(i, i + DayTimes));
|
||||||
|
if(!planArray || planArray.length === 0) {
|
||||||
|
week ++;
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for (let j = 0; j < planArray.length; j++) {
|
||||||
|
planList.push({
|
||||||
|
planId: this.id,
|
||||||
|
start: planArray[j].start,
|
||||||
|
stop: planArray[j].stop,
|
||||||
|
weekDay: week
|
||||||
|
})
|
||||||
|
}
|
||||||
|
week ++;
|
||||||
|
}
|
||||||
|
return planList
|
||||||
|
},
|
||||||
|
byteTime2Plan(weekItem){
|
||||||
|
let start = null;
|
||||||
|
let stop = null;
|
||||||
|
let result = []
|
||||||
|
for (let i = 0; i < weekItem.length; i++) {
|
||||||
|
let item = weekItem[i]
|
||||||
|
if (item === '1') { // 表示选中
|
||||||
|
stop = i
|
||||||
|
if (start === null ) {
|
||||||
|
start = i
|
||||||
|
}
|
||||||
|
if (i === weekItem.length - 1 && start != null && stop != null) {
|
||||||
|
result.push({
|
||||||
|
start: start,
|
||||||
|
stop: stop,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (stop !== null){
|
||||||
|
result.push({
|
||||||
|
start: start,
|
||||||
|
stop: stop,
|
||||||
|
})
|
||||||
|
start = null
|
||||||
|
stop = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
plan2Byte(planList) {
|
||||||
|
let byte = ""
|
||||||
|
let indexArray = {}
|
||||||
|
for (let i = 0; i < planList.length; i++) {
|
||||||
|
|
||||||
|
let weekDay = planList[i].weekDay
|
||||||
|
let index = planList[i].start
|
||||||
|
let endIndex = planList[i].stop
|
||||||
|
for (let j = index; j <= endIndex; j++) {
|
||||||
|
indexArray["key_" + (j + (weekDay - 1 )*48)] = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 336; i++) {
|
||||||
|
if (indexArray["key_" + i]){
|
||||||
|
byte += "1"
|
||||||
|
}else {
|
||||||
|
byte += "0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return byte
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@ -22,7 +22,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="行政区划" prop="name">
|
<el-form-item label="行政区划" prop="name">
|
||||||
<el-input v-model="group.civilCode" >
|
<el-input v-model="group.civilCode" >
|
||||||
<el-button slot="append" @click="buildCivilCode(group.civilCode)">生成</el-button>
|
<el-button slot="append" @click="buildCivilCode(group.civilCode)">选择</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@ -37,17 +37,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<channelCode ref="channelCode"></channelCode>
|
<channelCode ref="channelCode"></channelCode>
|
||||||
<regionCode ref="regionCode"></regionCode>
|
<chooseCivilCode ref="chooseCivilCode"></chooseCivilCode>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import channelCode from "./channelCode.vue";
|
import channelCode from "./channelCode.vue";
|
||||||
import regionCode from "./regionCode.vue";
|
import ChooseCivilCode from "./chooseCivilCode.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "groupEdit",
|
name: "groupEdit",
|
||||||
components: {channelCode, regionCode},
|
components: {ChooseCivilCode, channelCode},
|
||||||
computed: {},
|
computed: {},
|
||||||
props: [],
|
props: [],
|
||||||
created() {},
|
created() {},
|
||||||
@ -116,11 +116,9 @@ export default {
|
|||||||
}, deviceId, 5 , lockContent);
|
}, deviceId, 5 , lockContent);
|
||||||
},
|
},
|
||||||
buildCivilCode: function (deviceId){
|
buildCivilCode: function (deviceId){
|
||||||
this.$refs.regionCode.openDialog(code=>{
|
this.$refs.chooseCivilCode.openDialog(code=>{
|
||||||
console.log("2222")
|
|
||||||
console.log(code)
|
|
||||||
this.group.civilCode = code;
|
this.group.civilCode = code;
|
||||||
}, deviceId)
|
});
|
||||||
},
|
},
|
||||||
close: function () {
|
close: function () {
|
||||||
this.showDialog = false;
|
this.showDialog = false;
|
||||||
|
|||||||
355
web_src/src/components/dialog/linkChannelRecord.vue
Executable file
355
web_src/src/components/dialog/linkChannelRecord.vue
Executable file
@ -0,0 +1,355 @@
|
|||||||
|
<template>
|
||||||
|
<div id="linkChannelRecord" style="width: 100%; background-color: #FFFFFF; display: grid; grid-template-columns: 200px auto;">
|
||||||
|
<el-dialog title="通道关联" v-loading="dialogLoading" v-if="showDialog" top="2rem" width="80%" :close-on-click-modal="false" :visible.sync="showDialog" :destroy-on-close="true" @close="close()">
|
||||||
|
<div style="display: grid; grid-template-columns: 100px auto;">
|
||||||
|
<el-tabs tab-position="left" style="" v-model="hasLink" @tab-click="search">
|
||||||
|
<el-tab-pane label="未关联" name="false"></el-tab-pane>
|
||||||
|
<el-tab-pane label="已关联" name="true"></el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<div>
|
||||||
|
<div class="page-header">
|
||||||
|
<div class="page-header-btn" >
|
||||||
|
<div style="display: inline;">
|
||||||
|
搜索:
|
||||||
|
<el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
|
||||||
|
prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
|
||||||
|
|
||||||
|
在线状态:
|
||||||
|
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="online" placeholder="请选择"
|
||||||
|
default-first-option>
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<el-option label="在线" value="true"></el-option>
|
||||||
|
<el-option label="离线" value="false"></el-option>
|
||||||
|
</el-select>
|
||||||
|
类型:
|
||||||
|
<el-select size="mini" style="width: 8rem; margin-right: 1rem;" @change="search" v-model="channelType" placeholder="请选择"
|
||||||
|
default-first-option>
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<el-option label="国标设备" :value="0"></el-option>
|
||||||
|
<el-option label="推流设备" :value="1"></el-option>
|
||||||
|
<el-option label="拉流代理" :value="2"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button v-if="hasLink !=='true'" size="mini" type="primary" @click="add()">
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="hasLink ==='true'" size="mini" type="danger" @click="remove()">
|
||||||
|
移除
|
||||||
|
</el-button>
|
||||||
|
<el-button size="mini" v-if="hasLink !=='true'" @click="addByDevice()">按设备添加</el-button>
|
||||||
|
<el-button size="mini" v-if="hasLink ==='true'" @click="removeByDevice()">按设备移除</el-button>
|
||||||
|
<el-button size="mini" v-if="hasLink !=='true'" @click="addAll()">添加所有通道</el-button>
|
||||||
|
<el-button size="mini" v-if="hasLink ==='true'" @click="removeAll()">移除所有通道</el-button>
|
||||||
|
<el-button size="mini" @click="getChannelList()">刷新</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table size="small" ref="channelListTable" :data="channelList" :height="winHeight"
|
||||||
|
header-row-class-name="table-header" @selection-change="handleSelectionChange" >
|
||||||
|
<el-table-column type="selection" width="55" >
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="gbName" label="名称" min-width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="gbDeviceId" label="编号" min-width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="gbManufacturer" label="厂家" min-width="100">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="类型" min-width="100">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<div slot="reference" class="name-wrapper">
|
||||||
|
<el-tag size="medium" effect="plain" v-if="scope.row.gbDeviceDbId">国标设备</el-tag>
|
||||||
|
<el-tag size="medium" effect="plain" type="success" v-if="scope.row.streamPushId">推流设备</el-tag>
|
||||||
|
<el-tag size="medium" effect="plain" type="warning" v-if="scope.row.streamProxyId">拉流代理</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" min-width="100">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<div slot="reference" class="name-wrapper">
|
||||||
|
<el-tag size="medium" v-if="scope.row.gbStatus === 'ON'">在线</el-tag>
|
||||||
|
<el-tag size="medium" type="info" v-if="scope.row.gbStatus !== 'ON'">离线</el-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
style="text-align: right"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="currentChange"
|
||||||
|
:current-page="currentPage"
|
||||||
|
:page-size="count"
|
||||||
|
:page-sizes="[15, 25, 35, 50]"
|
||||||
|
layout="total, sizes, prev, pager, next"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
<gbDeviceSelect ref="gbDeviceSelect"></gbDeviceSelect>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import gbDeviceSelect from "./GbDeviceSelect.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'linkChannelRecord',
|
||||||
|
components: {gbDeviceSelect},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogLoading: false,
|
||||||
|
showDialog: false,
|
||||||
|
chooseData: {},
|
||||||
|
channelList: [],
|
||||||
|
searchSrt: "",
|
||||||
|
channelType: "",
|
||||||
|
online: "",
|
||||||
|
hasLink: "false",
|
||||||
|
winHeight: window.innerHeight - 250,
|
||||||
|
currentPage: 1,
|
||||||
|
count: 15,
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
planId: null,
|
||||||
|
loadSnap: {},
|
||||||
|
multipleSelection: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {},
|
||||||
|
destroyed() {},
|
||||||
|
methods: {
|
||||||
|
openDialog(planId, closeCallback) {
|
||||||
|
this.planId = planId
|
||||||
|
this.showDialog = true
|
||||||
|
this.closeCallback = closeCallback
|
||||||
|
this.initData()
|
||||||
|
},
|
||||||
|
initData: function () {
|
||||||
|
this.currentPage= 1;
|
||||||
|
this.count= 15;
|
||||||
|
this.total= 0;
|
||||||
|
this.getChannelList();
|
||||||
|
},
|
||||||
|
currentChange: function (val) {
|
||||||
|
this.currentPage = val;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
handleSizeChange: function (val) {
|
||||||
|
this.count = val;
|
||||||
|
this.getChannelList();
|
||||||
|
},
|
||||||
|
getChannelList: function () {
|
||||||
|
this.$axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `/api/record/plan/channel/list`,
|
||||||
|
params: {
|
||||||
|
page: this.currentPage,
|
||||||
|
count: this.count,
|
||||||
|
query: this.searchSrt,
|
||||||
|
online: this.online,
|
||||||
|
channelType: this.channelType,
|
||||||
|
planId: this.planId,
|
||||||
|
hasLink: this.hasLink
|
||||||
|
}
|
||||||
|
}).then((res)=> {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.total = res.data.data.total;
|
||||||
|
this.channelList = res.data.data.list;
|
||||||
|
// 防止出现表格错位
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.channelListTable.doLayout();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error)=> {
|
||||||
|
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSelectionChange: function (val){
|
||||||
|
this.multipleSelection = val;
|
||||||
|
},
|
||||||
|
|
||||||
|
linkPlan: function (data){
|
||||||
|
this.loading = true
|
||||||
|
return this.$axios({
|
||||||
|
method: 'post',
|
||||||
|
url: `/api/record/plan/link`,
|
||||||
|
data: data
|
||||||
|
}).then((res)=> {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
this.$message.success({
|
||||||
|
showClose: true,
|
||||||
|
message: "保存成功"
|
||||||
|
})
|
||||||
|
this.getChannelList()
|
||||||
|
}else {
|
||||||
|
this.$message.error({
|
||||||
|
showClose: true,
|
||||||
|
message: res.data.msg
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.loading = false
|
||||||
|
}).catch((error)=> {
|
||||||
|
this.$message.error({
|
||||||
|
showClose: true,
|
||||||
|
message: error
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
add: function (row) {
|
||||||
|
let channels = []
|
||||||
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||||
|
channels.push(this.multipleSelection[i].gbId)
|
||||||
|
}
|
||||||
|
if (channels.length === 0) {
|
||||||
|
this.$message.info({
|
||||||
|
showClose: true,
|
||||||
|
message: "请选择通道"
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.linkPlan({
|
||||||
|
planId: this.planId,
|
||||||
|
channelIds: channels
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addAll: function (row) {
|
||||||
|
this.$confirm("添加所有通道将包括已经添加到其他计划的通道,确定添加所有通道?", '提示', {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.linkPlan({
|
||||||
|
planId: this.planId,
|
||||||
|
allLink: true
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
addByDevice: function (row) {
|
||||||
|
this.$refs.gbDeviceSelect.openDialog((rows)=>{
|
||||||
|
let deviceIds = []
|
||||||
|
for (let i = 0; i < rows.length; i++) {
|
||||||
|
deviceIds.push(rows[i].id)
|
||||||
|
}
|
||||||
|
this.linkPlan({
|
||||||
|
planId: this.planId,
|
||||||
|
deviceDbIds: deviceIds
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
removeByDevice: function (row) {
|
||||||
|
this.$refs.gbDeviceSelect.openDialog((rows)=>{
|
||||||
|
let deviceIds = []
|
||||||
|
for (let i = 0; i < rows.length; i++) {
|
||||||
|
deviceIds.push(rows[i].id)
|
||||||
|
}
|
||||||
|
this.linkPlan({
|
||||||
|
deviceDbIds: deviceIds
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
remove: function (row) {
|
||||||
|
let channels = []
|
||||||
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||||
|
channels.push(this.multipleSelection[i].gbId)
|
||||||
|
}
|
||||||
|
if (channels.length === 0) {
|
||||||
|
this.$message.info({
|
||||||
|
showClose: true,
|
||||||
|
message: "请选择通道"
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.linkPlan({
|
||||||
|
channelIds: channels
|
||||||
|
})
|
||||||
|
},
|
||||||
|
removeAll: function (row) {
|
||||||
|
|
||||||
|
this.$confirm("确定移除所有通道?", '提示', {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.linkPlan({
|
||||||
|
planId: this.planId,
|
||||||
|
allLink: false
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
search: function () {
|
||||||
|
this.currentPage = 1;
|
||||||
|
this.total = 0;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
refresh: function () {
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.videoList {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item {
|
||||||
|
position: relative;
|
||||||
|
width: 15rem;
|
||||||
|
height: 10rem;
|
||||||
|
margin-right: 1rem;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item-img {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item-img:after {
|
||||||
|
content: "";
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 3rem;
|
||||||
|
height: 3rem;
|
||||||
|
background-image: url("../../assets/loading.png");
|
||||||
|
background-size: cover;
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item-title {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
color: #000000;
|
||||||
|
background-color: #ffffff;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
padding: 0.3rem;
|
||||||
|
width: 14.4rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -8,9 +8,10 @@
|
|||||||
<el-main style="padding: 5px;">
|
<el-main style="padding: 5px;">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<el-breadcrumb separator="/">
|
<el-breadcrumb separator="/" v-if="regionParents.length > 0">
|
||||||
<el-breadcrumb-item v-for="key in regionParents" key="key">{{ key }}</el-breadcrumb-item>
|
<el-breadcrumb-item v-for="key in regionParents" key="key">{{ key }}</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
|
<div v-else style="color: #00c6ff">未选择虚拟组织</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-header-btn">
|
<div class="page-header-btn">
|
||||||
<div style="display: inline;">
|
<div style="display: inline;">
|
||||||
@ -121,7 +122,7 @@ export default {
|
|||||||
groupDeviceId: "",
|
groupDeviceId: "",
|
||||||
groupId: "",
|
groupId: "",
|
||||||
businessGroup: "",
|
businessGroup: "",
|
||||||
regionParents: ["请选择虚拟组织"],
|
regionParents: [],
|
||||||
multipleSelection: []
|
multipleSelection: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -289,7 +290,11 @@ export default {
|
|||||||
treeNodeClickEvent: function (group) {
|
treeNodeClickEvent: function (group) {
|
||||||
if (group.deviceId === "" || group.deviceId === group.businessGroup) {
|
if (group.deviceId === "" || group.deviceId === group.businessGroup) {
|
||||||
this.channelList = []
|
this.channelList = []
|
||||||
this.regionParents = ["请选择虚拟组织"];
|
this.regionParents = [];
|
||||||
|
this.$message.info({
|
||||||
|
showClose: true,
|
||||||
|
message: "当前为业务分组,挂载通道请选择其下的虚拟组织,如不存在可右键新建"
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.groupDeviceId = group.deviceId;
|
this.groupDeviceId = group.deviceId;
|
||||||
|
|||||||
@ -82,6 +82,7 @@ import uiHeader from '../layout/UiHeader.vue'
|
|||||||
import MediaServer from './service/MediaServer'
|
import MediaServer from './service/MediaServer'
|
||||||
import operationsFoShowLog from './dialog/operationsFoShowLog.vue'
|
import operationsFoShowLog from './dialog/operationsFoShowLog.vue'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import userService from "./service/UserService";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
@ -154,16 +155,47 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
downloadFile(file) {
|
downloadFile(file) {
|
||||||
const link = document.createElement('a');
|
// const link = document.createElement('a');
|
||||||
link.target = "_blank";
|
// link.target = "_blank";
|
||||||
link.download = file.fileName;
|
// link.download = file.fileName;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
// if (process.env.NODE_ENV === 'development') {
|
||||||
link.href = `/debug/api/log/file/${file.fileName}`
|
// link.href = `/debug/api/log/file/${file.fileName}`
|
||||||
}else {
|
// }else {
|
||||||
link.href = `/api/log/file/${file.fileName}`
|
// link.href = `/api/log/file/${file.fileName}`
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
// link.click();
|
||||||
|
|
||||||
link.click();
|
|
||||||
|
// 文件下载地址
|
||||||
|
const fileUrl = ((process.env.NODE_ENV === 'development') ? process.env.BASE_API : baseUrl) + `/api/log/file/${file.fileName}`;
|
||||||
|
|
||||||
|
// 设置请求头
|
||||||
|
const headers = new Headers();
|
||||||
|
headers.append('access-token', userService.getToken()); // 设置授权头,替换YourAccessToken为实际的访问令牌
|
||||||
|
// 发起 请求
|
||||||
|
fetch(fileUrl, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: headers,
|
||||||
|
})
|
||||||
|
.then(response => response.blob())
|
||||||
|
.then(blob => {
|
||||||
|
console.log(blob)
|
||||||
|
// 创建一个虚拟的链接元素,模拟点击下载
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.target = "_blank";
|
||||||
|
link.href = window.URL.createObjectURL(blob);
|
||||||
|
link.download = file.fileName; // 设置下载文件名,替换filename.ext为实际的文件名和扩展名
|
||||||
|
document.body.appendChild(link);
|
||||||
|
|
||||||
|
// 模拟点击
|
||||||
|
link.click();
|
||||||
|
|
||||||
|
// 移除虚拟链接元素
|
||||||
|
document.body.removeChild(link);
|
||||||
|
this.$message.success("已申请截图",{closed: true})
|
||||||
|
})
|
||||||
|
.catch(error => console.error('下载失败:', error));
|
||||||
},
|
},
|
||||||
loadEnd() {
|
loadEnd() {
|
||||||
this.playerTitle = this.file.fileName
|
this.playerTitle = this.file.fileName
|
||||||
|
|||||||
@ -8,9 +8,10 @@
|
|||||||
<el-main style="padding: 5px;">
|
<el-main style="padding: 5px;">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<el-breadcrumb separator="/">
|
<el-breadcrumb separator="/" v-if="regionParents.length > 0">
|
||||||
<el-breadcrumb-item v-for="key in regionParents" key="key">{{ key }}</el-breadcrumb-item>
|
<el-breadcrumb-item v-for="key in regionParents" key="key">{{ key }}</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
|
<div v-else style="color: #00c6ff">未选择行政区划</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-header-btn">
|
<div class="page-header-btn">
|
||||||
<div style="display: inline;">
|
<div style="display: inline;">
|
||||||
@ -116,7 +117,7 @@ export default {
|
|||||||
loadSnap: {},
|
loadSnap: {},
|
||||||
regionId: "",
|
regionId: "",
|
||||||
regionDeviceId: "",
|
regionDeviceId: "",
|
||||||
regionParents: ["请选择行政区划"],
|
regionParents: [],
|
||||||
multipleSelection: []
|
multipleSelection: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -285,7 +286,7 @@ export default {
|
|||||||
this.regionDeviceId = region.deviceId;
|
this.regionDeviceId = region.deviceId;
|
||||||
if (region.deviceId === "") {
|
if (region.deviceId === "") {
|
||||||
this.channelList = []
|
this.channelList = []
|
||||||
this.regionParents = ["请选择行政区划"];
|
this.regionParents = [];
|
||||||
}
|
}
|
||||||
this.initData();
|
this.initData();
|
||||||
// 获取regionDeviceId对应的节点信息
|
// 获取regionDeviceId对应的节点信息
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
<el-menu-item index="/channel/region">行政区划</el-menu-item>
|
<el-menu-item index="/channel/region">行政区划</el-menu-item>
|
||||||
<el-menu-item index="/channel/group">业务分组</el-menu-item>
|
<el-menu-item index="/channel/group">业务分组</el-menu-item>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
|
<el-menu-item index="/recordPlan">录制计划</el-menu-item>
|
||||||
<el-menu-item index="/cloudRecord">云端录像</el-menu-item>
|
<el-menu-item index="/cloudRecord">云端录像</el-menu-item>
|
||||||
<el-menu-item index="/mediaServerManger">节点管理</el-menu-item>
|
<el-menu-item index="/mediaServerManger">节点管理</el-menu-item>
|
||||||
<el-menu-item index="/platformList/15/1">国标级联</el-menu-item>
|
<el-menu-item index="/platformList/15/1">国标级联</el-menu-item>
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import rtcPlayer from '../components/dialog/rtcPlayer.vue'
|
|||||||
import region from '../components/region.vue'
|
import region from '../components/region.vue'
|
||||||
import group from '../components/group.vue'
|
import group from '../components/group.vue'
|
||||||
import operations from '../components/operations.vue'
|
import operations from '../components/operations.vue'
|
||||||
|
import recordPLan from '../components/RecordPLan.vue'
|
||||||
|
|
||||||
const originalPush = VueRouter.prototype.push
|
const originalPush = VueRouter.prototype.push
|
||||||
VueRouter.prototype.push = function push(location) {
|
VueRouter.prototype.push = function push(location) {
|
||||||
@ -148,6 +149,10 @@ export default new VueRouter({
|
|||||||
path: '/operations',
|
path: '/operations',
|
||||||
component: operations,
|
component: operations,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/recordPLan',
|
||||||
|
component: recordPLan,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,342 +0,0 @@
|
|||||||
/*建表*/
|
|
||||||
create table wvp_device (
|
|
||||||
id serial primary key ,
|
|
||||||
device_id character varying(50) not null ,
|
|
||||||
name character varying(255),
|
|
||||||
manufacturer character varying(255),
|
|
||||||
model character varying(255),
|
|
||||||
firmware character varying(255),
|
|
||||||
transport character varying(50),
|
|
||||||
stream_mode character varying(50),
|
|
||||||
on_line bool default false,
|
|
||||||
register_time character varying(50),
|
|
||||||
keepalive_time character varying(50),
|
|
||||||
ip character varying(50),
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50),
|
|
||||||
port integer,
|
|
||||||
expires integer,
|
|
||||||
subscribe_cycle_for_catalog integer DEFAULT 0,
|
|
||||||
subscribe_cycle_for_mobile_position integer DEFAULT 0,
|
|
||||||
mobile_position_submission_interval integer DEFAULT 5,
|
|
||||||
subscribe_cycle_for_alarm integer DEFAULT 0,
|
|
||||||
host_address character varying(50),
|
|
||||||
charset character varying(50),
|
|
||||||
ssrc_check bool default false,
|
|
||||||
geo_coord_sys character varying(50),
|
|
||||||
media_server_id character varying(50),
|
|
||||||
custom_name character varying(255),
|
|
||||||
sdp_ip character varying(50),
|
|
||||||
local_ip character varying(50),
|
|
||||||
password character varying(255),
|
|
||||||
as_message_channel bool default false,
|
|
||||||
keepalive_interval_time integer,
|
|
||||||
broadcast_push_after_ack bool default false,
|
|
||||||
constraint uk_device_device unique (device_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_device_alarm (
|
|
||||||
id serial primary key ,
|
|
||||||
device_id character varying(50) not null,
|
|
||||||
channel_id character varying(50) not null,
|
|
||||||
alarm_priority character varying(50),
|
|
||||||
alarm_method character varying(50),
|
|
||||||
alarm_time character varying(50),
|
|
||||||
alarm_description character varying(255),
|
|
||||||
longitude double precision,
|
|
||||||
latitude double precision,
|
|
||||||
alarm_type character varying(50),
|
|
||||||
create_time character varying(50) not null
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_device_channel (
|
|
||||||
id serial primary key ,
|
|
||||||
channel_id character varying(50) not null,
|
|
||||||
name character varying(255),
|
|
||||||
custom_name character varying(255),
|
|
||||||
manufacture character varying(50),
|
|
||||||
model character varying(50),
|
|
||||||
owner character varying(50),
|
|
||||||
civil_code character varying(50),
|
|
||||||
block character varying(50),
|
|
||||||
address character varying(50),
|
|
||||||
parent_id character varying(50),
|
|
||||||
safety_way integer,
|
|
||||||
register_way integer,
|
|
||||||
cert_num character varying(50),
|
|
||||||
certifiable integer,
|
|
||||||
err_code integer,
|
|
||||||
end_time character varying(50),
|
|
||||||
secrecy character varying(50),
|
|
||||||
ip_address character varying(50),
|
|
||||||
port integer,
|
|
||||||
password character varying(255),
|
|
||||||
ptz_type integer,
|
|
||||||
custom_ptz_type integer,
|
|
||||||
status bool default false,
|
|
||||||
longitude double precision,
|
|
||||||
custom_longitude double precision,
|
|
||||||
latitude double precision,
|
|
||||||
custom_latitude double precision,
|
|
||||||
stream_id character varying(255),
|
|
||||||
device_id character varying(50) not null,
|
|
||||||
parental character varying(50),
|
|
||||||
has_audio bool default false,
|
|
||||||
create_time character varying(50) not null,
|
|
||||||
update_time character varying(50) not null,
|
|
||||||
sub_count integer,
|
|
||||||
longitude_gcj02 double precision,
|
|
||||||
latitude_gcj02 double precision,
|
|
||||||
longitude_wgs84 double precision,
|
|
||||||
latitude_wgs84 double precision,
|
|
||||||
business_group_id character varying(50),
|
|
||||||
gps_time character varying(50),
|
|
||||||
stream_identification character varying(50),
|
|
||||||
constraint uk_wvp_device_channel_unique_device_channel unique (device_id, channel_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_device_mobile_position (
|
|
||||||
id serial primary key,
|
|
||||||
device_id character varying(50) not null,
|
|
||||||
channel_id character varying(50) not null,
|
|
||||||
device_name character varying(255),
|
|
||||||
time character varying(50),
|
|
||||||
longitude double precision,
|
|
||||||
latitude double precision,
|
|
||||||
altitude double precision,
|
|
||||||
speed double precision,
|
|
||||||
direction double precision,
|
|
||||||
report_source character varying(50),
|
|
||||||
longitude_gcj02 double precision,
|
|
||||||
latitude_gcj02 double precision,
|
|
||||||
longitude_wgs84 double precision,
|
|
||||||
latitude_wgs84 double precision,
|
|
||||||
create_time character varying(50)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_gb_stream (
|
|
||||||
gb_stream_id serial primary key,
|
|
||||||
app character varying(255) not null,
|
|
||||||
stream character varying(255) not null,
|
|
||||||
gb_id character varying(50) not null,
|
|
||||||
name character varying(255),
|
|
||||||
longitude double precision,
|
|
||||||
latitude double precision,
|
|
||||||
stream_type character varying(50),
|
|
||||||
media_server_id character varying(50),
|
|
||||||
create_time character varying(50),
|
|
||||||
constraint uk_gb_stream_unique_gb_id unique (gb_id),
|
|
||||||
constraint uk_gb_stream_unique_app_stream unique (app, stream)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_log (
|
|
||||||
id serial primary key ,
|
|
||||||
name character varying(50),
|
|
||||||
type character varying(50),
|
|
||||||
uri character varying(200),
|
|
||||||
address character varying(50),
|
|
||||||
result character varying(50),
|
|
||||||
timing bigint,
|
|
||||||
username character varying(50),
|
|
||||||
create_time character varying(50)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_media_server (
|
|
||||||
id character varying(255) primary key ,
|
|
||||||
ip character varying(50),
|
|
||||||
hook_ip character varying(50),
|
|
||||||
sdp_ip character varying(50),
|
|
||||||
stream_ip character varying(50),
|
|
||||||
http_port integer,
|
|
||||||
http_ssl_port integer,
|
|
||||||
rtmp_port integer,
|
|
||||||
rtmp_ssl_port integer,
|
|
||||||
rtp_proxy_port integer,
|
|
||||||
rtsp_port integer,
|
|
||||||
rtsp_ssl_port integer,
|
|
||||||
flv_port integer,
|
|
||||||
flv_ssl_port integer,
|
|
||||||
ws_flv_port integer,
|
|
||||||
ws_flv_ssl_port integer,
|
|
||||||
auto_config bool default false,
|
|
||||||
secret character varying(50),
|
|
||||||
type character varying(50) default 'zlm',
|
|
||||||
rtp_enable bool default false,
|
|
||||||
rtp_port_range character varying(50),
|
|
||||||
send_rtp_port_range character varying(50),
|
|
||||||
record_assist_port integer,
|
|
||||||
default_server bool default false,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50),
|
|
||||||
hook_alive_interval integer,
|
|
||||||
record_path character varying(255),
|
|
||||||
record_day integer default 7,
|
|
||||||
transcode_suffix character varying(255),
|
|
||||||
constraint uk_media_server_unique_ip_http_port unique (ip, http_port)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_platform (
|
|
||||||
id serial primary key ,
|
|
||||||
enable bool default false,
|
|
||||||
name character varying(255),
|
|
||||||
server_gb_id character varying(50),
|
|
||||||
server_gb_domain character varying(50),
|
|
||||||
server_ip character varying(50),
|
|
||||||
server_port integer,
|
|
||||||
device_gb_id character varying(50),
|
|
||||||
device_ip character varying(50),
|
|
||||||
device_port character varying(50),
|
|
||||||
username character varying(255),
|
|
||||||
password character varying(50),
|
|
||||||
expires character varying(50),
|
|
||||||
keep_timeout character varying(50),
|
|
||||||
transport character varying(50),
|
|
||||||
character_set character varying(50),
|
|
||||||
catalog_id character varying(50),
|
|
||||||
ptz bool default false,
|
|
||||||
rtcp bool default false,
|
|
||||||
status bool default false,
|
|
||||||
start_offline_push bool default false,
|
|
||||||
administrative_division character varying(50),
|
|
||||||
catalog_group integer,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50),
|
|
||||||
as_message_channel bool default false,
|
|
||||||
auto_push_channel bool default false,
|
|
||||||
send_stream_ip character varying(50),
|
|
||||||
constraint uk_platform_unique_server_gb_id unique (server_gb_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_platform_catalog (
|
|
||||||
id character varying(50),
|
|
||||||
platform_id character varying(50),
|
|
||||||
name character varying(255),
|
|
||||||
parent_id character varying(50),
|
|
||||||
civil_code character varying(50),
|
|
||||||
business_group_id character varying(50),
|
|
||||||
constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_platform_gb_channel (
|
|
||||||
id serial primary key ,
|
|
||||||
platform_id character varying(50),
|
|
||||||
catalog_id character varying(50),
|
|
||||||
device_channel_id integer,
|
|
||||||
constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, catalog_id, device_channel_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_platform_gb_stream (
|
|
||||||
id serial primary key,
|
|
||||||
platform_id character varying(50),
|
|
||||||
catalog_id character varying(50),
|
|
||||||
gb_stream_id integer,
|
|
||||||
constraint uk_platform_gb_stream_platform_id_catalog_id_gb_stream_id unique (platform_id, catalog_id, gb_stream_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_stream_proxy (
|
|
||||||
id serial primary key,
|
|
||||||
type character varying(50),
|
|
||||||
app character varying(255),
|
|
||||||
stream character varying(255),
|
|
||||||
url character varying(255),
|
|
||||||
src_url character varying(255),
|
|
||||||
dst_url character varying(255),
|
|
||||||
timeout_ms integer,
|
|
||||||
ffmpeg_cmd_key character varying(255),
|
|
||||||
rtp_type character varying(50),
|
|
||||||
media_server_id character varying(50),
|
|
||||||
enable_audio bool default false,
|
|
||||||
enable_mp4 bool default false,
|
|
||||||
enable bool default false,
|
|
||||||
status boolean,
|
|
||||||
enable_remove_none_reader bool default false,
|
|
||||||
create_time character varying(50),
|
|
||||||
name character varying(255),
|
|
||||||
update_time character varying(50),
|
|
||||||
stream_key character varying(255),
|
|
||||||
enable_disable_none_reader bool default false,
|
|
||||||
constraint uk_stream_proxy_app_stream unique (app, stream)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_stream_push (
|
|
||||||
id serial primary key,
|
|
||||||
app character varying(255),
|
|
||||||
stream character varying(255),
|
|
||||||
total_reader_count character varying(50),
|
|
||||||
origin_type integer,
|
|
||||||
origin_type_str character varying(50),
|
|
||||||
create_time character varying(50),
|
|
||||||
alive_second integer,
|
|
||||||
media_server_id character varying(50),
|
|
||||||
server_id character varying(50),
|
|
||||||
push_time character varying(50),
|
|
||||||
status bool default false,
|
|
||||||
update_time character varying(50),
|
|
||||||
push_ing bool default false,
|
|
||||||
self bool default false,
|
|
||||||
constraint uk_stream_push_app_stream unique (app, stream)
|
|
||||||
);
|
|
||||||
create table wvp_cloud_record (
|
|
||||||
id serial primary key,
|
|
||||||
app character varying(255),
|
|
||||||
stream character varying(255),
|
|
||||||
call_id character varying(255),
|
|
||||||
start_time bigint,
|
|
||||||
end_time bigint,
|
|
||||||
media_server_id character varying(50),
|
|
||||||
file_name character varying(255),
|
|
||||||
folder character varying(255),
|
|
||||||
file_path character varying(255),
|
|
||||||
collect bool default false,
|
|
||||||
file_size bigint,
|
|
||||||
time_len bigint,
|
|
||||||
constraint uk_stream_push_app_stream_path unique (app, stream, file_path)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_user (
|
|
||||||
id serial primary key,
|
|
||||||
username character varying(255),
|
|
||||||
password character varying(255),
|
|
||||||
role_id integer,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50),
|
|
||||||
push_key character varying(50),
|
|
||||||
constraint uk_user_username unique (username)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_user_role (
|
|
||||||
id serial primary key,
|
|
||||||
name character varying(50),
|
|
||||||
authority character varying(50),
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50)
|
|
||||||
);
|
|
||||||
create table wvp_resources_tree (
|
|
||||||
id serial primary key ,
|
|
||||||
is_catalog bool default true,
|
|
||||||
device_channel_id integer ,
|
|
||||||
gb_stream_id integer,
|
|
||||||
name character varying(255),
|
|
||||||
parentId integer,
|
|
||||||
path character varying(255)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_user_api_key (
|
|
||||||
id serial primary key ,
|
|
||||||
user_id bigint,
|
|
||||||
app character varying(255) ,
|
|
||||||
api_key text,
|
|
||||||
expired_at bigint,
|
|
||||||
remark character varying(255),
|
|
||||||
enable bool default true,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/*初始数据*/
|
|
||||||
INSERT INTO wvp_user VALUES (1, 'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3');
|
|
||||||
INSERT INTO wvp_user_role VALUES (1, 'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,342 +0,0 @@
|
|||||||
/*建表*/
|
|
||||||
create table wvp_device (
|
|
||||||
id serial primary key ,
|
|
||||||
device_id character varying(50) not null ,
|
|
||||||
name character varying(255),
|
|
||||||
manufacturer character varying(255),
|
|
||||||
model character varying(255),
|
|
||||||
firmware character varying(255),
|
|
||||||
transport character varying(50),
|
|
||||||
stream_mode character varying(50),
|
|
||||||
on_line bool default false,
|
|
||||||
register_time character varying(50),
|
|
||||||
keepalive_time character varying(50),
|
|
||||||
ip character varying(50),
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50),
|
|
||||||
port integer,
|
|
||||||
expires integer,
|
|
||||||
subscribe_cycle_for_catalog integer DEFAULT 0,
|
|
||||||
subscribe_cycle_for_mobile_position integer DEFAULT 0,
|
|
||||||
mobile_position_submission_interval integer DEFAULT 5,
|
|
||||||
subscribe_cycle_for_alarm integer DEFAULT 0,
|
|
||||||
host_address character varying(50),
|
|
||||||
charset character varying(50),
|
|
||||||
ssrc_check bool default false,
|
|
||||||
geo_coord_sys character varying(50),
|
|
||||||
media_server_id character varying(50),
|
|
||||||
custom_name character varying(255),
|
|
||||||
sdp_ip character varying(50),
|
|
||||||
local_ip character varying(50),
|
|
||||||
password character varying(255),
|
|
||||||
as_message_channel bool default false,
|
|
||||||
keepalive_interval_time integer,
|
|
||||||
broadcast_push_after_ack bool default false,
|
|
||||||
constraint uk_device_device unique (device_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_device_alarm (
|
|
||||||
id serial primary key ,
|
|
||||||
device_id character varying(50) not null,
|
|
||||||
channel_id character varying(50) not null,
|
|
||||||
alarm_priority character varying(50),
|
|
||||||
alarm_method character varying(50),
|
|
||||||
alarm_time character varying(50),
|
|
||||||
alarm_description character varying(255),
|
|
||||||
longitude double precision,
|
|
||||||
latitude double precision,
|
|
||||||
alarm_type character varying(50),
|
|
||||||
create_time character varying(50) not null
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_device_channel (
|
|
||||||
id serial primary key ,
|
|
||||||
channel_id character varying(50) not null,
|
|
||||||
name character varying(255),
|
|
||||||
custom_name character varying(255),
|
|
||||||
manufacture character varying(50),
|
|
||||||
model character varying(50),
|
|
||||||
owner character varying(50),
|
|
||||||
civil_code character varying(50),
|
|
||||||
block character varying(50),
|
|
||||||
address character varying(50),
|
|
||||||
parent_id character varying(50),
|
|
||||||
safety_way integer,
|
|
||||||
register_way integer,
|
|
||||||
cert_num character varying(50),
|
|
||||||
certifiable integer,
|
|
||||||
err_code integer,
|
|
||||||
end_time character varying(50),
|
|
||||||
secrecy character varying(50),
|
|
||||||
ip_address character varying(50),
|
|
||||||
port integer,
|
|
||||||
password character varying(255),
|
|
||||||
ptz_type integer,
|
|
||||||
custom_ptz_type integer,
|
|
||||||
status bool default false,
|
|
||||||
longitude double precision,
|
|
||||||
custom_longitude double precision,
|
|
||||||
latitude double precision,
|
|
||||||
custom_latitude double precision,
|
|
||||||
stream_id character varying(255),
|
|
||||||
device_id character varying(50) not null,
|
|
||||||
parental character varying(50),
|
|
||||||
has_audio bool default false,
|
|
||||||
create_time character varying(50) not null,
|
|
||||||
update_time character varying(50) not null,
|
|
||||||
sub_count integer,
|
|
||||||
longitude_gcj02 double precision,
|
|
||||||
latitude_gcj02 double precision,
|
|
||||||
longitude_wgs84 double precision,
|
|
||||||
latitude_wgs84 double precision,
|
|
||||||
business_group_id character varying(50),
|
|
||||||
gps_time character varying(50),
|
|
||||||
stream_identification character varying(50),
|
|
||||||
constraint uk_wvp_device_channel_unique_device_channel unique (device_id, channel_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_device_mobile_position (
|
|
||||||
id serial primary key,
|
|
||||||
device_id character varying(50) not null,
|
|
||||||
channel_id character varying(50) not null,
|
|
||||||
device_name character varying(255),
|
|
||||||
time character varying(50),
|
|
||||||
longitude double precision,
|
|
||||||
latitude double precision,
|
|
||||||
altitude double precision,
|
|
||||||
speed double precision,
|
|
||||||
direction double precision,
|
|
||||||
report_source character varying(50),
|
|
||||||
longitude_gcj02 double precision,
|
|
||||||
latitude_gcj02 double precision,
|
|
||||||
longitude_wgs84 double precision,
|
|
||||||
latitude_wgs84 double precision,
|
|
||||||
create_time character varying(50)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_gb_stream (
|
|
||||||
gb_stream_id serial primary key,
|
|
||||||
app character varying(255) not null,
|
|
||||||
stream character varying(255) not null,
|
|
||||||
gb_id character varying(50) not null,
|
|
||||||
name character varying(255),
|
|
||||||
longitude double precision,
|
|
||||||
latitude double precision,
|
|
||||||
stream_type character varying(50),
|
|
||||||
media_server_id character varying(50),
|
|
||||||
create_time character varying(50),
|
|
||||||
constraint uk_gb_stream_unique_gb_id unique (gb_id),
|
|
||||||
constraint uk_gb_stream_unique_app_stream unique (app, stream)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_log (
|
|
||||||
id serial primary key ,
|
|
||||||
name character varying(50),
|
|
||||||
type character varying(50),
|
|
||||||
uri character varying(200),
|
|
||||||
address character varying(50),
|
|
||||||
result character varying(50),
|
|
||||||
timing bigint,
|
|
||||||
username character varying(50),
|
|
||||||
create_time character varying(50)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_media_server (
|
|
||||||
id character varying(255) primary key ,
|
|
||||||
ip character varying(50),
|
|
||||||
hook_ip character varying(50),
|
|
||||||
sdp_ip character varying(50),
|
|
||||||
stream_ip character varying(50),
|
|
||||||
http_port integer,
|
|
||||||
http_ssl_port integer,
|
|
||||||
rtmp_port integer,
|
|
||||||
rtmp_ssl_port integer,
|
|
||||||
rtp_proxy_port integer,
|
|
||||||
rtsp_port integer,
|
|
||||||
rtsp_ssl_port integer,
|
|
||||||
flv_port integer,
|
|
||||||
flv_ssl_port integer,
|
|
||||||
ws_flv_port integer,
|
|
||||||
ws_flv_ssl_port integer,
|
|
||||||
auto_config bool default false,
|
|
||||||
secret character varying(50),
|
|
||||||
type character varying(50) default 'zlm',
|
|
||||||
rtp_enable bool default false,
|
|
||||||
rtp_port_range character varying(50),
|
|
||||||
send_rtp_port_range character varying(50),
|
|
||||||
record_assist_port integer,
|
|
||||||
default_server bool default false,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50),
|
|
||||||
hook_alive_interval integer,
|
|
||||||
record_path character varying(255),
|
|
||||||
record_day integer default 7,
|
|
||||||
transcode_suffix character varying(255),
|
|
||||||
constraint uk_media_server_unique_ip_http_port unique (ip, http_port)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_platform (
|
|
||||||
id serial primary key ,
|
|
||||||
enable bool default false,
|
|
||||||
name character varying(255),
|
|
||||||
server_gb_id character varying(50),
|
|
||||||
server_gb_domain character varying(50),
|
|
||||||
server_ip character varying(50),
|
|
||||||
server_port integer,
|
|
||||||
device_gb_id character varying(50),
|
|
||||||
device_ip character varying(50),
|
|
||||||
device_port character varying(50),
|
|
||||||
username character varying(255),
|
|
||||||
password character varying(50),
|
|
||||||
expires character varying(50),
|
|
||||||
keep_timeout character varying(50),
|
|
||||||
transport character varying(50),
|
|
||||||
character_set character varying(50),
|
|
||||||
catalog_id character varying(50),
|
|
||||||
ptz bool default false,
|
|
||||||
rtcp bool default false,
|
|
||||||
status bool default false,
|
|
||||||
start_offline_push bool default false,
|
|
||||||
administrative_division character varying(50),
|
|
||||||
catalog_group integer,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50),
|
|
||||||
as_message_channel bool default false,
|
|
||||||
auto_push_channel bool default false,
|
|
||||||
send_stream_ip character varying(50),
|
|
||||||
constraint uk_platform_unique_server_gb_id unique (server_gb_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_platform_catalog (
|
|
||||||
id character varying(50),
|
|
||||||
platform_id character varying(50),
|
|
||||||
name character varying(255),
|
|
||||||
parent_id character varying(50),
|
|
||||||
civil_code character varying(50),
|
|
||||||
business_group_id character varying(50),
|
|
||||||
constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_platform_gb_channel (
|
|
||||||
id serial primary key ,
|
|
||||||
platform_id character varying(50),
|
|
||||||
catalog_id character varying(50),
|
|
||||||
device_channel_id integer,
|
|
||||||
constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, catalog_id, device_channel_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_platform_gb_stream (
|
|
||||||
id serial primary key,
|
|
||||||
platform_id character varying(50),
|
|
||||||
catalog_id character varying(50),
|
|
||||||
gb_stream_id integer,
|
|
||||||
constraint uk_platform_gb_stream_platform_id_catalog_id_gb_stream_id unique (platform_id, catalog_id, gb_stream_id)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_stream_proxy (
|
|
||||||
id serial primary key,
|
|
||||||
type character varying(50),
|
|
||||||
app character varying(255),
|
|
||||||
stream character varying(255),
|
|
||||||
url character varying(255),
|
|
||||||
src_url character varying(255),
|
|
||||||
dst_url character varying(255),
|
|
||||||
timeout_ms integer,
|
|
||||||
ffmpeg_cmd_key character varying(255),
|
|
||||||
rtp_type character varying(50),
|
|
||||||
media_server_id character varying(50),
|
|
||||||
enable_audio bool default false,
|
|
||||||
enable_mp4 bool default false,
|
|
||||||
enable bool default false,
|
|
||||||
status boolean,
|
|
||||||
enable_remove_none_reader bool default false,
|
|
||||||
create_time character varying(50),
|
|
||||||
name character varying(255),
|
|
||||||
update_time character varying(50),
|
|
||||||
stream_key character varying(255),
|
|
||||||
enable_disable_none_reader bool default false,
|
|
||||||
constraint uk_stream_proxy_app_stream unique (app, stream)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_stream_push (
|
|
||||||
id serial primary key,
|
|
||||||
app character varying(255),
|
|
||||||
stream character varying(255),
|
|
||||||
total_reader_count character varying(50),
|
|
||||||
origin_type integer,
|
|
||||||
origin_type_str character varying(50),
|
|
||||||
create_time character varying(50),
|
|
||||||
alive_second integer,
|
|
||||||
media_server_id character varying(50),
|
|
||||||
server_id character varying(50),
|
|
||||||
push_time character varying(50),
|
|
||||||
status bool default false,
|
|
||||||
update_time character varying(50),
|
|
||||||
push_ing bool default false,
|
|
||||||
self bool default false,
|
|
||||||
constraint uk_stream_push_app_stream unique (app, stream)
|
|
||||||
);
|
|
||||||
create table wvp_cloud_record (
|
|
||||||
id serial primary key,
|
|
||||||
app character varying(255),
|
|
||||||
stream character varying(255),
|
|
||||||
call_id character varying(255),
|
|
||||||
start_time int8,
|
|
||||||
end_time int8,
|
|
||||||
media_server_id character varying(50),
|
|
||||||
file_name character varying(255),
|
|
||||||
folder character varying(255),
|
|
||||||
file_path character varying(255),
|
|
||||||
collect bool default false,
|
|
||||||
file_size int8,
|
|
||||||
time_len int8,
|
|
||||||
constraint uk_stream_push_app_stream_path unique (app, stream, file_path)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_user (
|
|
||||||
id serial primary key,
|
|
||||||
username character varying(255),
|
|
||||||
password character varying(255),
|
|
||||||
role_id integer,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50),
|
|
||||||
push_key character varying(50),
|
|
||||||
constraint uk_user_username unique (username)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_user_role (
|
|
||||||
id serial primary key,
|
|
||||||
name character varying(50),
|
|
||||||
authority character varying(50),
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50)
|
|
||||||
);
|
|
||||||
create table wvp_resources_tree (
|
|
||||||
id serial primary key ,
|
|
||||||
is_catalog bool default true,
|
|
||||||
device_channel_id integer ,
|
|
||||||
gb_stream_id integer,
|
|
||||||
name character varying(255),
|
|
||||||
parentId integer,
|
|
||||||
path character varying(255)
|
|
||||||
);
|
|
||||||
|
|
||||||
create table wvp_user_api_key (
|
|
||||||
id serial primary key ,
|
|
||||||
user_id bigint,
|
|
||||||
app character varying(255) ,
|
|
||||||
api_key text,
|
|
||||||
expired_at bigint,
|
|
||||||
remark character varying(255),
|
|
||||||
enable bool default true,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/*初始数据*/
|
|
||||||
INSERT INTO wvp_user VALUES (1, 'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3');
|
|
||||||
INSERT INTO wvp_user_role VALUES (1, 'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
alter table wvp_media_server
|
|
||||||
add transcode_suffix character varying(255);
|
|
||||||
|
|
||||||
alter table wvp_media_server
|
|
||||||
add type character varying(50) default 'zlm';
|
|
||||||
|
|
||||||
alter table wvp_media_server
|
|
||||||
add flv_port integer;
|
|
||||||
alter table wvp_media_server
|
|
||||||
add flv_ssl_port integer;
|
|
||||||
alter table wvp_media_server
|
|
||||||
add ws_flv_port integer;
|
|
||||||
alter table wvp_media_server
|
|
||||||
add ws_flv_ssl_port integer;
|
|
||||||
|
|
||||||
create table wvp_user_api_key (
|
|
||||||
id serial primary key ,
|
|
||||||
user_id bigint,
|
|
||||||
app character varying(255) ,
|
|
||||||
api_key text,
|
|
||||||
expired_at bigint,
|
|
||||||
remark character varying(255),
|
|
||||||
enable bool default true,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50)
|
|
||||||
);
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
alter table wvp_media_server
|
|
||||||
add transcode_suffix character varying(255);
|
|
||||||
|
|
||||||
alter table wvp_media_server
|
|
||||||
add type character varying(50) default 'zlm';
|
|
||||||
|
|
||||||
alter table wvp_media_server
|
|
||||||
add flv_port integer;
|
|
||||||
alter table wvp_media_server
|
|
||||||
add flv_ssl_port integer;
|
|
||||||
alter table wvp_media_server
|
|
||||||
add ws_flv_port integer;
|
|
||||||
alter table wvp_media_server
|
|
||||||
add ws_flv_ssl_port integer;
|
|
||||||
|
|
||||||
create table wvp_user_api_key (
|
|
||||||
id serial primary key ,
|
|
||||||
user_id bigint,
|
|
||||||
app character varying(255) ,
|
|
||||||
api_key text,
|
|
||||||
expired_at bigint,
|
|
||||||
remark character varying(255),
|
|
||||||
enable bool default true,
|
|
||||||
create_time character varying(50),
|
|
||||||
update_time character varying(50)
|
|
||||||
);
|
|
||||||
@ -147,6 +147,7 @@ create table wvp_device_channel
|
|||||||
gb_download_speed character varying(255),
|
gb_download_speed character varying(255),
|
||||||
gb_svc_space_support_mod integer,
|
gb_svc_space_support_mod integer,
|
||||||
gb_svc_time_support_mode integer,
|
gb_svc_time_support_mode integer,
|
||||||
|
record_plan_id integer,
|
||||||
stream_push_id integer,
|
stream_push_id integer,
|
||||||
stream_proxy_id integer,
|
stream_proxy_id integer,
|
||||||
constraint uk_wvp_device_channel_unique_device_channel unique (device_db_id, device_id),
|
constraint uk_wvp_device_channel_unique_device_channel unique (device_db_id, device_id),
|
||||||
@ -427,3 +428,23 @@ CREATE TABLE wvp_common_region
|
|||||||
constraint uk_common_region_device_id unique (device_id)
|
constraint uk_common_region_device_id unique (device_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table wvp_record_plan
|
||||||
|
(
|
||||||
|
id serial primary key,
|
||||||
|
snap bool default false,
|
||||||
|
name varchar(255) NOT NULL,
|
||||||
|
create_time character varying(50),
|
||||||
|
update_time character varying(50)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table wvp_record_plan_item
|
||||||
|
(
|
||||||
|
id serial primary key,
|
||||||
|
start int,
|
||||||
|
stop int,
|
||||||
|
week_day int,
|
||||||
|
plan_id int,
|
||||||
|
create_time character varying(50),
|
||||||
|
update_time character varying(50)
|
||||||
|
);
|
||||||
|
|
||||||
|
|||||||
@ -163,6 +163,7 @@ create table wvp_device_channel
|
|||||||
gb_download_speed character varying(255),
|
gb_download_speed character varying(255),
|
||||||
gb_svc_space_support_mod integer,
|
gb_svc_space_support_mod integer,
|
||||||
gb_svc_time_support_mode integer,
|
gb_svc_time_support_mode integer,
|
||||||
|
record_plan_id integer,
|
||||||
stream_push_id integer,
|
stream_push_id integer,
|
||||||
stream_proxy_id integer,
|
stream_proxy_id integer,
|
||||||
constraint uk_wvp_device_channel_unique_device_channel unique (device_db_id, device_id),
|
constraint uk_wvp_device_channel_unique_device_channel unique (device_db_id, device_id),
|
||||||
@ -444,3 +445,23 @@ CREATE TABLE wvp_common_region
|
|||||||
constraint uk_common_region_device_id unique (device_id)
|
constraint uk_common_region_device_id unique (device_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table wvp_record_plan
|
||||||
|
(
|
||||||
|
id serial primary key,
|
||||||
|
snap bool default false,
|
||||||
|
name varchar(255) NOT NULL,
|
||||||
|
create_time character varying(50),
|
||||||
|
update_time character varying(50)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table wvp_record_plan_item
|
||||||
|
(
|
||||||
|
id serial primary key,
|
||||||
|
start int,
|
||||||
|
stop int,
|
||||||
|
week_day int,
|
||||||
|
plan_id int,
|
||||||
|
create_time character varying(50),
|
||||||
|
update_time character varying(50)
|
||||||
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user