修复推流的添加
parent
6d0361edf8
commit
9ae08fd6c3
|
@ -140,6 +140,9 @@ alter table wvp_stream_proxy
|
||||||
alter table wvp_stream_proxy
|
alter table wvp_stream_proxy
|
||||||
add status bool default false;
|
add status bool default false;
|
||||||
|
|
||||||
|
alter table wvp_device
|
||||||
|
drop column auto_sync_channel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
43
sql/初始化.sql
43
sql/初始化.sql
|
@ -33,7 +33,6 @@ create table wvp_device (
|
||||||
keepalive_interval_time integer,
|
keepalive_interval_time integer,
|
||||||
switch_primary_sub_stream bool default false,
|
switch_primary_sub_stream bool default false,
|
||||||
broadcast_push_after_ack bool default false,
|
broadcast_push_after_ack bool default false,
|
||||||
auto_sync_channel bool default true,
|
|
||||||
constraint uk_device_device unique (device_id)
|
constraint uk_device_device unique (device_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -116,21 +115,6 @@ create table wvp_device_mobile_position (
|
||||||
create_time character varying(50)
|
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 (
|
create table wvp_log (
|
||||||
id serial primary key ,
|
id serial primary key ,
|
||||||
name character varying(50),
|
name character varying(50),
|
||||||
|
@ -200,16 +184,6 @@ create table wvp_platform (
|
||||||
constraint uk_platform_unique_server_gb_id unique (server_gb_id)
|
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 (
|
create table wvp_platform_gb_channel (
|
||||||
id serial primary key ,
|
id serial primary key ,
|
||||||
platform_id character varying(50),
|
platform_id character varying(50),
|
||||||
|
@ -218,14 +192,6 @@ create table wvp_platform_gb_channel (
|
||||||
constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, catalog_id, device_channel_id)
|
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 (
|
create table wvp_stream_proxy (
|
||||||
id serial primary key,
|
id serial primary key,
|
||||||
type character varying(50),
|
type character varying(50),
|
||||||
|
@ -288,15 +254,6 @@ create table wvp_user_role (
|
||||||
create_time character varying(50),
|
create_time character varying(50),
|
||||||
update_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)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/*初始数据*/
|
/*初始数据*/
|
||||||
|
|
|
@ -53,8 +53,9 @@ public class Gb28181Sdp {
|
||||||
|
|
||||||
for (Object description : mediaDescriptions) {
|
for (Object description : mediaDescriptions) {
|
||||||
MediaDescription mediaDescription = (MediaDescription) description;
|
MediaDescription mediaDescription = (MediaDescription) description;
|
||||||
gb28181Sdp.setDownloadSpeed(Integer.parseInt(mediaDescription.getAttribute("downloadspeed")));
|
if (mediaDescription.getAttribute("downloadspeed") != null) {
|
||||||
|
gb28181Sdp.setDownloadSpeed(Integer.parseInt(mediaDescription.getAttribute("downloadspeed")));
|
||||||
|
}
|
||||||
Media media = mediaDescription.getMedia();
|
Media media = mediaDescription.getMedia();
|
||||||
Vector mediaFormats = media.getMediaFormats(false);
|
Vector mediaFormats = media.getMediaFormats(false);
|
||||||
// 查看是否支持PS 负载96
|
// 查看是否支持PS 负载96
|
||||||
|
|
|
@ -9,7 +9,6 @@ import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory;
|
import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForServerStarted;
|
import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForServerStarted;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
|
||||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
|
@ -76,14 +76,6 @@ public class StreamProxy {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUpdateTime() {
|
|
||||||
return updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -96,27 +88,22 @@ public class StreamProxy {
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setApp(String app) {
|
public void setApp(String app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getStream() {
|
public String getStream() {
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setStream(String stream) {
|
public void setStream(String stream) {
|
||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getMediaServerId() {
|
public String getMediaServerId() {
|
||||||
return mediaServerId;
|
return mediaServerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setMediaServerId(String mediaServerId) {
|
public void setMediaServerId(String mediaServerId) {
|
||||||
this.mediaServerId = mediaServerId;
|
this.mediaServerId = mediaServerId;
|
||||||
}
|
}
|
||||||
|
@ -133,40 +120,40 @@ public class StreamProxy {
|
||||||
return srcUrl;
|
return srcUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSrcUrl(String src_url) {
|
public void setSrcUrl(String srcUrl) {
|
||||||
this.srcUrl = src_url;
|
this.srcUrl = srcUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDstUrl() {
|
public String getDstUrl() {
|
||||||
return dstUrl;
|
return dstUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDstUrl(String dst_url) {
|
public void setDstUrl(String dstUrl) {
|
||||||
this.dstUrl = dst_url;
|
this.dstUrl = dstUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTimeoutMs() {
|
public int getTimeoutMs() {
|
||||||
return timeoutMs;
|
return timeoutMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTimeoutMs(int timeout_ms) {
|
public void setTimeoutMs(int timeoutMs) {
|
||||||
this.timeoutMs = timeout_ms;
|
this.timeoutMs = timeoutMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFfmpegCmdKey() {
|
public String getFfmpegCmdKey() {
|
||||||
return ffmpegCmdKey;
|
return ffmpegCmdKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFfmpegCmdKey(String ffmpeg_cmd_key) {
|
public void setFfmpegCmdKey(String ffmpegCmdKey) {
|
||||||
this.ffmpegCmdKey = ffmpeg_cmd_key;
|
this.ffmpegCmdKey = ffmpegCmdKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRtpType() {
|
public String getRtpType() {
|
||||||
return rtpType;
|
return rtpType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRtpType(String rtp_type) {
|
public void setRtpType(String rtpType) {
|
||||||
this.rtpType = rtp_type;
|
this.rtpType = rtpType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnable() {
|
public boolean isEnable() {
|
||||||
|
@ -177,36 +164,36 @@ public class StreamProxy {
|
||||||
this.enable = enable;
|
this.enable = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEnableAudio() {
|
||||||
|
return enableAudio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnableAudio(boolean enableAudio) {
|
||||||
|
this.enableAudio = enableAudio;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isEnableMp4() {
|
public boolean isEnableMp4() {
|
||||||
return enableMp4;
|
return enableMp4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnableMp4(boolean enable_mp4) {
|
public void setEnableMp4(boolean enableMp4) {
|
||||||
this.enableMp4 = enable_mp4;
|
this.enableMp4 = enableMp4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnableRemoveNoneReader() {
|
public boolean isEnableRemoveNoneReader() {
|
||||||
return enableRemoveNoneReader;
|
return enableRemoveNoneReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnableRemoveNoneReader(boolean enable_remove_none_reader) {
|
public void setEnableRemoveNoneReader(boolean enableRemoveNoneReader) {
|
||||||
this.enableRemoveNoneReader = enable_remove_none_reader;
|
this.enableRemoveNoneReader = enableRemoveNoneReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnableDisableNoneReader() {
|
public boolean isEnableDisableNoneReader() {
|
||||||
return enableDisableNoneReader;
|
return enableDisableNoneReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnableDisableNoneReader(boolean enable_disable_none_reader) {
|
public void setEnableDisableNoneReader(boolean enableDisableNoneReader) {
|
||||||
this.enableDisableNoneReader = enable_disable_none_reader;
|
this.enableDisableNoneReader = enableDisableNoneReader;
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnableAudio() {
|
|
||||||
return enableAudio;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnableAudio(boolean enable_audio) {
|
|
||||||
this.enableAudio = enable_audio;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStreamKey() {
|
public String getStreamKey() {
|
||||||
|
@ -217,14 +204,6 @@ public class StreamProxy {
|
||||||
this.streamKey = streamKey;
|
this.streamKey = streamKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCommonGbChannelId() {
|
|
||||||
return commonGbChannelId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCommonGbChannelId(int commonGbChannelId) {
|
|
||||||
this.commonGbChannelId = commonGbChannelId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGbId() {
|
public String getGbId() {
|
||||||
return gbId;
|
return gbId;
|
||||||
}
|
}
|
||||||
|
@ -265,7 +244,7 @@ public class StreamProxy {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String isCreateTime() {
|
public String getCreateTime() {
|
||||||
return createTime;
|
return createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,11 +252,19 @@ public class StreamProxy {
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String isUpdateTime() {
|
public String getUpdateTime() {
|
||||||
return updateTime;
|
return updateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdateTime(String updateTime) {
|
public void setUpdateTime(String updateTime) {
|
||||||
this.updateTime = updateTime;
|
this.updateTime = updateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getCommonGbChannelId() {
|
||||||
|
return commonGbChannelId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommonGbChannelId(int commonGbChannelId) {
|
||||||
|
this.commonGbChannelId = commonGbChannelId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,4 +118,10 @@ public interface IStreamProxyService {
|
||||||
* 更新redis发来的gps更新消息
|
* 更新redis发来的gps更新消息
|
||||||
*/
|
*/
|
||||||
void updateStreamGPS(List<GPSMsgInfo> gpsMsgInfoList);
|
void updateStreamGPS(List<GPSMsgInfo> gpsMsgInfoList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有启用的拉流代理
|
||||||
|
*/
|
||||||
|
List<StreamProxy> getAllForEnable();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,22 +149,6 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int delAllChannelForGB(String platformId, String catalogId) {
|
|
||||||
|
|
||||||
int result;
|
|
||||||
if (platformId == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
ParentPlatform platform = platformMapper.getParentPlatByServerGBId(platformId);
|
|
||||||
if (platform == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (ObjectUtils.isEmpty(catalogId)) {
|
|
||||||
catalogId = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonGbChannel queryChannelByPlatformIdAndChannelDeviceId(Integer platformId, String channelId) {
|
public CommonGbChannel queryChannelByPlatformIdAndChannelDeviceId(Integer platformId, String channelId) {
|
||||||
return platformChannelMapper.queryChannelByPlatformIdAndChannelDeviceId(platformId, channelId);
|
return platformChannelMapper.queryChannelByPlatformIdAndChannelDeviceId(platformId, channelId);
|
||||||
|
|
|
@ -86,12 +86,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICommonGbChannelService commonGbChannelService;
|
private ICommonGbChannelService commonGbChannelService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private EventPublisher eventPublisher;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ParentPlatformMapper parentPlatformMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMediaServerService mediaServerService;
|
private IMediaServerService mediaServerService;
|
||||||
|
|
||||||
|
@ -159,24 +153,25 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
// 更新
|
// 更新
|
||||||
StreamProxy streamProxyInDb = videoManagerStorager.queryStreamProxy(param.getApp(), param.getStream());
|
StreamProxy streamProxyInDb = videoManagerStorager.queryStreamProxy(param.getApp(), param.getStream());
|
||||||
if (streamProxyInDb != null) {
|
if (streamProxyInDb != null) {
|
||||||
if (streamProxyInDb.getCommonGbChannelId() == 0 && param.getGbId() != null ) {
|
if (streamProxyInDb.getCommonGbChannelId() == 0 && !ObjectUtils.isEmpty(param.getGbId()) ) {
|
||||||
// 新增通用通道
|
// 新增通用通道
|
||||||
CommonGbChannel commonGbChannel = CommonGbChannel.getInstance(param);
|
CommonGbChannel commonGbChannel = CommonGbChannel.getInstance(param);
|
||||||
commonGbChannelService.add(commonGbChannel);
|
commonGbChannelService.add(commonGbChannel);
|
||||||
param.setCommonGbChannelId(commonGbChannel.getCommonGbId());
|
param.setCommonGbChannelId(commonGbChannel.getCommonGbId());
|
||||||
}
|
}
|
||||||
if (streamProxyInDb.getCommonGbChannelId() > 0 && param.getGbId() == null ) {
|
if (streamProxyInDb.getCommonGbChannelId() > 0 && ObjectUtils.isEmpty(param.getGbId()) ) {
|
||||||
// 移除通用通道
|
// 移除通用通道
|
||||||
commonGbChannelService.deleteById(streamProxyInDb.getCommonGbChannelId());
|
commonGbChannelService.deleteById(streamProxyInDb.getCommonGbChannelId());
|
||||||
}
|
}
|
||||||
param.setUpdateTime(DateUtil.getNow());
|
param.setUpdateTime(DateUtil.getNow());
|
||||||
streamProxyMapper.update(param);
|
streamProxyMapper.update(param);
|
||||||
}else { // 新增
|
}else { // 新增
|
||||||
// 新增通用通道
|
if (!ObjectUtils.isEmpty(param.getGbId())) {
|
||||||
CommonGbChannel commonGbChannel = CommonGbChannel.getInstance(param);
|
// 新增通用通道
|
||||||
commonGbChannelService.add(commonGbChannel);
|
CommonGbChannel commonGbChannel = CommonGbChannel.getInstance(param);
|
||||||
param.setCommonGbChannelId(commonGbChannel.getCommonGbId());
|
commonGbChannelService.add(commonGbChannel);
|
||||||
|
param.setCommonGbChannelId(commonGbChannel.getCommonGbId());
|
||||||
|
}
|
||||||
param.setCreateTime(DateUtil.getNow());
|
param.setCreateTime(DateUtil.getNow());
|
||||||
param.setUpdateTime(DateUtil.getNow());
|
param.setUpdateTime(DateUtil.getNow());
|
||||||
streamProxyMapper.add(param);
|
streamProxyMapper.add(param);
|
||||||
|
@ -533,6 +528,9 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查拉流代理状态
|
||||||
|
*/
|
||||||
@Scheduled(cron = "* 0/10 * * * ?")
|
@Scheduled(cron = "* 0/10 * * * ?")
|
||||||
public void asyncCheckStreamProxyStatus() {
|
public void asyncCheckStreamProxyStatus() {
|
||||||
|
|
||||||
|
@ -544,13 +542,13 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
|
|
||||||
Map<String, MediaServerItem> serverItemMap = all.stream().collect(Collectors.toMap(MediaServerItem::getId, Function.identity(), (m1, m2) -> m1));
|
Map<String, MediaServerItem> serverItemMap = all.stream().collect(Collectors.toMap(MediaServerItem::getId, Function.identity(), (m1, m2) -> m1));
|
||||||
|
|
||||||
List<StreamProxyItem> list = videoManagerStorager.getStreamProxyListForEnable(true);
|
List<StreamProxy> list = getAllForEnable();
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(list)){
|
if (CollectionUtils.isEmpty(list)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (StreamProxyItem streamProxyItem : list) {
|
for (StreamProxy streamProxyItem : list) {
|
||||||
|
|
||||||
MediaServerItem mediaServerItem = serverItemMap.get(streamProxyItem.getMediaServerId());
|
MediaServerItem mediaServerItem = serverItemMap.get(streamProxyItem.getMediaServerId());
|
||||||
|
|
||||||
|
@ -575,4 +573,9 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
public void updateStreamGPS(List<GPSMsgInfo> gpsMsgInfoList) {
|
public void updateStreamGPS(List<GPSMsgInfo> gpsMsgInfoList) {
|
||||||
streamProxyMapper.updateStreamGPS(gpsMsgInfoList);
|
streamProxyMapper.updateStreamGPS(gpsMsgInfoList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StreamProxy> getAllForEnable() {
|
||||||
|
return streamProxyMapper.selectForEnable(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.alibaba.fastjson2.TypeReference;
|
import com.alibaba.fastjson2.TypeReference;
|
||||||
import com.genersoft.iot.vmp.common.BatchLimit;
|
import com.genersoft.iot.vmp.common.BatchLimit;
|
||||||
import com.genersoft.iot.vmp.common.CommonGbChannel;
|
import com.genersoft.iot.vmp.common.CommonGbChannel;
|
||||||
|
import com.genersoft.iot.vmp.conf.MediaConfig;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||||
|
@ -67,10 +68,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
private ICommonGbChannelService commonGbChannelService;
|
private ICommonGbChannelService commonGbChannelService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DataSourceTransactionManager dataSourceTransactionManager;
|
private MediaConfig mediaConfig;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TransactionDefinition transactionDefinition;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IGroupService groupService;
|
private IGroupService groupService;
|
||||||
|
|
|
@ -148,19 +148,6 @@ public interface DeviceChannelMapper {
|
||||||
@Update(value = {"UPDATE wvp_device_channel SET stream_id=#{streamId} WHERE device_id=#{deviceId} AND channel_id=#{channelId}"})
|
@Update(value = {"UPDATE wvp_device_channel SET stream_id=#{streamId} WHERE device_id=#{deviceId} AND channel_id=#{channelId}"})
|
||||||
void startPlay(@Param("deviceId") String deviceId, @Param("channelId") String channelId, @Param("streamId") String streamId);
|
void startPlay(@Param("deviceId") String deviceId, @Param("channelId") String channelId, @Param("streamId") String streamId);
|
||||||
|
|
||||||
@Select(value = {" <script>" +
|
|
||||||
"SELECT " +
|
|
||||||
" dc.*,\n" +
|
|
||||||
" pgc.platform_id as platform_id,\n" +
|
|
||||||
" pgc.catalog_id as catalog_id " +
|
|
||||||
" FROM wvp_device_channel dc " +
|
|
||||||
" LEFT JOIN wvp_platform_gb_channel pgc on pgc.device_channel_id = dc.id " +
|
|
||||||
" WHERE pgc.platform_id = #{platformId} " +
|
|
||||||
" ORDER BY dc.device_id, dc.channel_id ASC" +
|
|
||||||
" </script>"})
|
|
||||||
List<DeviceChannelInPlatform> queryChannelByPlatformId(String platformId);
|
|
||||||
|
|
||||||
|
|
||||||
@Select("SELECT * FROM wvp_device_channel WHERE channel_id=#{channelId}")
|
@Select("SELECT * FROM wvp_device_channel WHERE channel_id=#{channelId}")
|
||||||
List<DeviceChannel> queryChannelByChannelId( String channelId);
|
List<DeviceChannel> queryChannelByChannelId( String channelId);
|
||||||
|
|
||||||
|
@ -331,53 +318,10 @@ public interface DeviceChannelMapper {
|
||||||
" </script>"})
|
" </script>"})
|
||||||
void updatePosition(DeviceChannel deviceChannel);
|
void updatePosition(DeviceChannel deviceChannel);
|
||||||
|
|
||||||
@Select("SELECT * FROM wvp_device_channel WHERE length(trim(stream_id)) > 0")
|
|
||||||
List<DeviceChannel> getAllChannelInPlay();
|
|
||||||
|
|
||||||
@Select("select * from wvp_device_channel where longitude*latitude > 0 and device_id = #{deviceId}")
|
@Select("select * from wvp_device_channel where longitude*latitude > 0 and device_id = #{deviceId}")
|
||||||
List<DeviceChannel> getAllChannelWithCoordinate(String deviceId);
|
List<DeviceChannel> getAllChannelWithCoordinate(String deviceId);
|
||||||
|
|
||||||
|
|
||||||
@Select(value = {" <script>" +
|
|
||||||
"select * " +
|
|
||||||
"from wvp_device_channel " +
|
|
||||||
"where device_id=#{deviceId}" +
|
|
||||||
" <if test='parentId != null and length != null' > and parent_id= #{parentId} or left(channel_id, LENGTH(#{parentId})) = #{parentId} and length(channel_id)=#{length} </if>" +
|
|
||||||
" <if test='parentId == null and length != null' > and parent_id= #{parentId} or length(channel_id)=#{length} </if>" +
|
|
||||||
" <if test='parentId == null and length == null' > and parent_id= #{parentId} </if>" +
|
|
||||||
" <if test='parentId != null and length == null' > and parent_id= #{parentId} or left(channel_id, LENGTH(#{parentId})) = #{parentId} </if>" +
|
|
||||||
" </script>"})
|
|
||||||
List<DeviceChannel> getChannelsWithCivilCodeAndLength(@Param("deviceId") String deviceId, @Param("parentId") String parentId, @Param("length") Integer length);
|
|
||||||
|
|
||||||
@Select(value = {" <script>" +
|
|
||||||
"select * " +
|
|
||||||
"from wvp_device_channel " +
|
|
||||||
"where device_id=#{deviceId} and length(channel_id)>14 and civil_code=#{parentId}" +
|
|
||||||
" </script>"})
|
|
||||||
List<DeviceChannel> getChannelsByCivilCode(@Param("deviceId") String deviceId, @Param("parentId") String parentId);
|
|
||||||
|
|
||||||
@Select("select min(length(channel_id)) as minLength " +
|
|
||||||
"from wvp_device_channel " +
|
|
||||||
"where device_id=#{deviceId}")
|
|
||||||
Integer getChannelMinLength(String deviceId);
|
|
||||||
|
|
||||||
@Select("select * from wvp_device_channel where device_id=#{deviceId} and civil_code not in " +
|
|
||||||
"(select civil_code from wvp_device_channel where device_id=#{deviceId} group by civil_code)")
|
|
||||||
List<DeviceChannel> getChannelWithoutCivilCode(String deviceId);
|
|
||||||
|
|
||||||
@Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}")
|
|
||||||
List<DeviceChannel> getBusinessGroups(@Param("deviceId") String deviceId, @Param("typeCode") String typeCode);
|
|
||||||
|
|
||||||
@Select("select dc.id, dc.channel_id, dc.device_id, dc.name, dc.manufacture,dc.model,dc.owner, pc.civil_code,dc.block, " +
|
|
||||||
" dc.address, '0' as parental,'0' as channel_type, pc.id as parent_id, dc.safety_way, dc.register_way,dc.cert_num, dc.certifiable, " +
|
|
||||||
" dc.err_code,dc.end_time, dc.secrecy, dc.ip_address, dc.port, dc.ptz_type, dc.password, dc.status, " +
|
|
||||||
" dc.longitude_wgs84 as longitude, dc.latitude_wgs84 as latitude, pc.business_group_id " +
|
|
||||||
" from wvp_device_channel dc" +
|
|
||||||
" LEFT JOIN wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id" +
|
|
||||||
" LEFT JOIN wvp_platform_catalog pc on pgc.catalog_id = pc.id and pgc.platform_id = pc.platform_id" +
|
|
||||||
" where pgc.platform_id=#{serverGBId}")
|
|
||||||
List<DeviceChannel> queryChannelWithCatalog(String serverGBId);
|
|
||||||
|
|
||||||
@Select("select * from wvp_device_channel where device_id = #{deviceId}")
|
@Select("select * from wvp_device_channel where device_id = #{deviceId}")
|
||||||
List<DeviceChannel> queryAllChannels(String deviceId);
|
List<DeviceChannel> queryAllChannels(String deviceId);
|
||||||
|
|
||||||
|
@ -445,13 +389,6 @@ public interface DeviceChannelMapper {
|
||||||
" </script>"})
|
" </script>"})
|
||||||
List<DeviceChannel> getSubChannelsByDeviceId(@Param("deviceId") String deviceId, @Param("parentId") String parentId, @Param("onlyCatalog") boolean onlyCatalog);
|
List<DeviceChannel> getSubChannelsByDeviceId(@Param("deviceId") String deviceId, @Param("parentId") String parentId, @Param("onlyCatalog") boolean onlyCatalog);
|
||||||
|
|
||||||
@Update(" update wvp_device_channel wdc " +
|
|
||||||
" set " +
|
|
||||||
" common_gb_channel_id=" +
|
|
||||||
" (select wcgc.common_gb_id from wvp_common_channel wcgc where wdc.channel_id = wcgc.common_gb_device_id) " +
|
|
||||||
" where wdc.device_id = #{deviceId}")
|
|
||||||
int updateCommonChannelId(@Param("deviceId") String deviceId);
|
|
||||||
|
|
||||||
@Select(value = {" <script>" +
|
@Select(value = {" <script>" +
|
||||||
"select * " +
|
"select * " +
|
||||||
"from wvp_device_channel " +
|
"from wvp_device_channel " +
|
||||||
|
|
|
@ -44,7 +44,6 @@ public interface DeviceMapper {
|
||||||
"on_line," +
|
"on_line," +
|
||||||
"media_server_id," +
|
"media_server_id," +
|
||||||
"switch_primary_sub_stream," +
|
"switch_primary_sub_stream," +
|
||||||
"auto_sync_channel," +
|
|
||||||
"(SELECT count(0) FROM wvp_device_channel WHERE device_id=wvp_device.device_id) as channel_count "+
|
"(SELECT count(0) FROM wvp_device_channel WHERE device_id=wvp_device.device_id) as channel_count "+
|
||||||
" FROM wvp_device WHERE device_id = #{deviceId}")
|
" FROM wvp_device WHERE device_id = #{deviceId}")
|
||||||
Device getDeviceByDeviceId(String deviceId);
|
Device getDeviceByDeviceId(String deviceId);
|
||||||
|
@ -75,7 +74,6 @@ public interface DeviceMapper {
|
||||||
"subscribe_cycle_for_alarm,"+
|
"subscribe_cycle_for_alarm,"+
|
||||||
"ssrc_check,"+
|
"ssrc_check,"+
|
||||||
"as_message_channel,"+
|
"as_message_channel,"+
|
||||||
"auto_sync_channel,"+
|
|
||||||
"geo_coord_sys,"+
|
"geo_coord_sys,"+
|
||||||
"on_line"+
|
"on_line"+
|
||||||
") VALUES (" +
|
") VALUES (" +
|
||||||
|
@ -104,7 +102,6 @@ public interface DeviceMapper {
|
||||||
"#{subscribeCycleForAlarm}," +
|
"#{subscribeCycleForAlarm}," +
|
||||||
"#{ssrcCheck}," +
|
"#{ssrcCheck}," +
|
||||||
"#{asMessageChannel}," +
|
"#{asMessageChannel}," +
|
||||||
"#{autoSyncChannel}," +
|
|
||||||
"#{geoCoordSys}," +
|
"#{geoCoordSys}," +
|
||||||
"#{onLine}" +
|
"#{onLine}" +
|
||||||
")")
|
")")
|
||||||
|
@ -163,7 +160,6 @@ public interface DeviceMapper {
|
||||||
"on_line,"+
|
"on_line,"+
|
||||||
"media_server_id,"+
|
"media_server_id,"+
|
||||||
"switch_primary_sub_stream switchPrimarySubStream,"+
|
"switch_primary_sub_stream switchPrimarySubStream,"+
|
||||||
"auto_sync_channel,"+
|
|
||||||
"(SELECT count(0) FROM wvp_device_channel WHERE device_id=de.device_id) as channel_count " +
|
"(SELECT count(0) FROM wvp_device_channel WHERE device_id=de.device_id) as channel_count " +
|
||||||
"FROM wvp_device de" +
|
"FROM wvp_device de" +
|
||||||
"<if test=\"onLine != null\"> where on_line=${onLine}</if>"+
|
"<if test=\"onLine != null\"> where on_line=${onLine}</if>"+
|
||||||
|
@ -201,7 +197,6 @@ public interface DeviceMapper {
|
||||||
"subscribe_cycle_for_alarm,"+
|
"subscribe_cycle_for_alarm,"+
|
||||||
"ssrc_check,"+
|
"ssrc_check,"+
|
||||||
"as_message_channel,"+
|
"as_message_channel,"+
|
||||||
"auto_sync_channel,"+
|
|
||||||
"geo_coord_sys,"+
|
"geo_coord_sys,"+
|
||||||
"on_line"+
|
"on_line"+
|
||||||
" FROM wvp_device WHERE on_line = true")
|
" FROM wvp_device WHERE on_line = true")
|
||||||
|
@ -232,7 +227,6 @@ public interface DeviceMapper {
|
||||||
"subscribe_cycle_for_alarm,"+
|
"subscribe_cycle_for_alarm,"+
|
||||||
"ssrc_check,"+
|
"ssrc_check,"+
|
||||||
"as_message_channel,"+
|
"as_message_channel,"+
|
||||||
"auto_sync_channel,"+
|
|
||||||
"geo_coord_sys,"+
|
"geo_coord_sys,"+
|
||||||
"on_line"+
|
"on_line"+
|
||||||
" FROM wvp_device WHERE ip = #{host} AND port=#{port}")
|
" FROM wvp_device WHERE ip = #{host} AND port=#{port}")
|
||||||
|
@ -256,7 +250,6 @@ public interface DeviceMapper {
|
||||||
"<if test=\"asMessageChannel != null\">, as_message_channel=#{asMessageChannel}</if>" +
|
"<if test=\"asMessageChannel != null\">, as_message_channel=#{asMessageChannel}</if>" +
|
||||||
"<if test=\"geoCoordSys != null\">, geo_coord_sys=#{geoCoordSys}</if>" +
|
"<if test=\"geoCoordSys != null\">, geo_coord_sys=#{geoCoordSys}</if>" +
|
||||||
"<if test=\"switchPrimarySubStream != null\">, switch_primary_sub_stream=#{switchPrimarySubStream}</if>" +
|
"<if test=\"switchPrimarySubStream != null\">, switch_primary_sub_stream=#{switchPrimarySubStream}</if>" +
|
||||||
"<if test=\"autoSyncChannel != null\">, auto_sync_channel=#{autoSyncChannel}</if>" +
|
|
||||||
"<if test=\"mediaServerId != null\">, media_server_id=#{mediaServerId}</if>" +
|
"<if test=\"mediaServerId != null\">, media_server_id=#{mediaServerId}</if>" +
|
||||||
"WHERE device_id=#{deviceId}"+
|
"WHERE device_id=#{deviceId}"+
|
||||||
" </script>"})
|
" </script>"})
|
||||||
|
@ -272,7 +265,6 @@ public interface DeviceMapper {
|
||||||
"charset,"+
|
"charset,"+
|
||||||
"ssrc_check,"+
|
"ssrc_check,"+
|
||||||
"as_message_channel,"+
|
"as_message_channel,"+
|
||||||
"auto_sync_channel,"+
|
|
||||||
"geo_coord_sys,"+
|
"geo_coord_sys,"+
|
||||||
"on_line,"+
|
"on_line,"+
|
||||||
"media_server_id,"+
|
"media_server_id,"+
|
||||||
|
@ -287,7 +279,6 @@ public interface DeviceMapper {
|
||||||
"#{charset}," +
|
"#{charset}," +
|
||||||
"#{ssrcCheck}," +
|
"#{ssrcCheck}," +
|
||||||
"#{asMessageChannel}," +
|
"#{asMessageChannel}," +
|
||||||
"#{autoSyncChannel}," +
|
|
||||||
"#{geoCoordSys}," +
|
"#{geoCoordSys}," +
|
||||||
"#{onLine}," +
|
"#{onLine}," +
|
||||||
"#{mediaServerId}," +
|
"#{mediaServerId}," +
|
||||||
|
|
|
@ -62,18 +62,16 @@ public interface ParentPlatformMapper {
|
||||||
@Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}")
|
@Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}")
|
||||||
int delParentPlatform(ParentPlatform parentPlatform);
|
int delParentPlatform(ParentPlatform parentPlatform);
|
||||||
|
|
||||||
@Select("SELECT *, ((SELECT count(0)\n" +
|
@Select("<script>" +
|
||||||
" FROM wvp_platform_gb_channel pc\n" +
|
"SELECT * " +
|
||||||
" WHERE pc.platform_id = pp.server_gb_id)\n" +
|
"<if test='shareAllChannel == false'> " +
|
||||||
" +\n" +
|
"(SELECT count(0) as channel_count FROM wvp_common_channel_platform wccp WHERE wccp.platform_id = pp.id) " +
|
||||||
" (SELECT count(0)\n" +
|
"</if>" +
|
||||||
" FROM wvp_platform_gb_stream pgs\n" +
|
"<if test='shareAllChannel == true'> " +
|
||||||
" WHERE pgs.platform_id = pp.server_gb_id)\n" +
|
"(SELECT count(0) as channel_count FROM wvp_common_channel ) " +
|
||||||
" +\n" +
|
"</if>" +
|
||||||
" (SELECT count(0)\n" +
|
"FROM wvp_platform pp " +
|
||||||
" FROM wvp_platform_catalog pgc\n" +
|
"</script>")
|
||||||
" WHERE pgc.platform_id = pp.server_gb_id)) as channel_count\n" +
|
|
||||||
"FROM wvp_platform pp ")
|
|
||||||
List<ParentPlatform> getParentPlatformList();
|
List<ParentPlatform> getParentPlatformList();
|
||||||
|
|
||||||
@Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ")
|
@Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ")
|
||||||
|
@ -88,37 +86,33 @@ public interface ParentPlatformMapper {
|
||||||
@Select("SELECT * FROM wvp_platform WHERE id=#{id}")
|
@Select("SELECT * FROM wvp_platform WHERE id=#{id}")
|
||||||
ParentPlatform getParentPlatById(int id);
|
ParentPlatform getParentPlatById(int id);
|
||||||
|
|
||||||
@Update("UPDATE wvp_platform SET status=false" )
|
|
||||||
int outlineForAllParentPlatform();
|
|
||||||
|
|
||||||
@Update("UPDATE wvp_platform SET status=#{online} WHERE server_gb_id=#{platformGbID}" )
|
@Update("UPDATE wvp_platform SET status=#{online} WHERE server_gb_id=#{platformGbID}" )
|
||||||
int updateParentPlatformStatus(@Param("platformGbID") String platformGbID, @Param("online") boolean online);
|
int updateParentPlatformStatus(@Param("platformGbID") String platformGbID, @Param("online") boolean online);
|
||||||
|
|
||||||
@Update(value = {" <script>" +
|
|
||||||
"UPDATE wvp_platform " +
|
|
||||||
"SET catalog_id=#{catalogId}, update_time=#{updateTime}" +
|
|
||||||
"WHERE server_gb_id=#{platformId}"+
|
|
||||||
"</script>"})
|
|
||||||
int setDefaultCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId, @Param("updateTime") String updateTime);
|
|
||||||
|
|
||||||
@Select("select 'channel' as name, count(pgc.platform_id) count from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id where pgc.platform_id=#{platform_id} and dc.channel_id =#{gbId} " +
|
|
||||||
"union " +
|
|
||||||
"select 'stream' as name, count(pgs.platform_id) count from wvp_platform_gb_stream pgs left join wvp_gb_stream gs on pgs.gb_stream_id = gs.gb_stream_id where pgs.platform_id=#{platform_id} and gs.gb_id =#{gbId}")
|
|
||||||
List<ChannelSourceInfo> getChannelSource(@Param("platform_id") String platform_id, @Param("gbId") String gbId);
|
|
||||||
|
|
||||||
@Select("SELECT * FROM wvp_platform WHERE share_all_channel=true")
|
@Select("SELECT * FROM wvp_platform WHERE share_all_channel=true")
|
||||||
List<ParentPlatform> queryAllWithShareAll();
|
List<ParentPlatform> queryAllWithShareAll();
|
||||||
|
|
||||||
|
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
"select wp.*" +
|
"select wp.* " +
|
||||||
"from wvp_platform wp\n" +
|
" from wvp_platform wp\n" +
|
||||||
" left join wvp_common_channel_platform wccp on wp.id = wccp.platform_id\n" +
|
" left join wvp_common_channel_platform wccp on wp.id = wccp.platform_id\n" +
|
||||||
"where wp.share_all_channel = true " +
|
" where wp.share_all_channel = true " +
|
||||||
"or (wccp.common_gb_channel_id in " +
|
"<if test='(channelList != null and channelList.size != 0) and (platformIdList != null and platformIdList.size != 0) '> " +
|
||||||
"<foreach collection='channelList' item='item' open='(' separator=',' close=')' >#{item.commonGbId}</foreach>" +
|
" or (wccp.common_gb_channel_id in " +
|
||||||
"and wccp.platform_id in " +
|
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' >#{item.commonGbId}</foreach>" +
|
||||||
"<foreach collection='platformIdList' item='item' open='(' separator=',' close=')' >#{item}</foreach>" +
|
" and wccp.platform_id in " +
|
||||||
|
" <foreach collection='platformIdList' item='item' open='(' separator=',' close=')' >#{item}</foreach>)" +
|
||||||
|
"</if>" +
|
||||||
|
"<if test='(channelList != null and channelList.size != 0) and (platformIdList == null or platformIdList.size == 0) '> " +
|
||||||
|
" or wccp.common_gb_channel_id in " +
|
||||||
|
" <foreach collection='channelList' item='item' open='(' separator=',' close=')' >#{item.commonGbId}</foreach>" +
|
||||||
|
"</if>" +
|
||||||
|
"<if test='(channelList == null or channelList.size == 0) and (platformIdList != null and platformIdList.size != 0) '> " +
|
||||||
|
" or wccp.platform_id in " +
|
||||||
|
" <foreach collection='platformIdList' item='item' open='(' separator=',' close=')' >#{item}</foreach>" +
|
||||||
|
"</if>" +
|
||||||
"</script>")
|
"</script>")
|
||||||
List<ParentPlatform> querySharePlatform(@Param("channelList") List<CommonGbChannel> channelList,
|
List<ParentPlatform> querySharePlatform(@Param("channelList") List<CommonGbChannel> channelList,
|
||||||
@Param("platformIdList") List<Integer> platformIdList);
|
@Param("platformIdList") List<Integer> platformIdList);
|
||||||
|
|
|
@ -13,11 +13,12 @@ import java.util.List;
|
||||||
public interface StreamProxyMapper {
|
public interface StreamProxyMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO wvp_stream_proxy (type, name, app, stream,media_server_id, url, src_url, dst_url, " +
|
@Insert("INSERT INTO wvp_stream_proxy (type, name, app, stream,media_server_id, url, src_url, dst_url, " +
|
||||||
"timeout_ms, ffmpeg_cmd_key, rtp_type, enable_audio, enable_mp4, enable, status, stream_key, enable_remove_none_reader, enable_disable_none_reader, create_time) VALUES" +
|
"timeout_ms, ffmpeg_cmd_key, rtp_type, enable_audio, enable_mp4, enable, status, stream_key, " +
|
||||||
|
"enable_remove_none_reader, enable_disable_none_reader, create_time) VALUES " +
|
||||||
"(#{type}, #{name}, #{app}, #{stream}, #{mediaServerId}, #{url}, #{srcUrl}, #{dstUrl}, " +
|
"(#{type}, #{name}, #{app}, #{stream}, #{mediaServerId}, #{url}, #{srcUrl}, #{dstUrl}, " +
|
||||||
"#{timeoutMs}, #{ffmpegCmdKey}, #{rtpType}, #{enableAudio}, #{enableMp4}, #{enable}, #{status}, #{streamKey}, " +
|
"#{timeoutMs}, #{ffmpegCmdKey}, #{rtpType}, #{enableAudio}, #{enableMp4}, #{enable}, #{status}, #{streamKey}, " +
|
||||||
"#{enableRemoveNoneReader}, #{enableDisableNoneReader}, #{createTime} )")
|
"#{enableRemoveNoneReader}, #{enableDisableNoneReader}, #{createTime} )")
|
||||||
int add(StreamProxy streamProxyDto);
|
int add(StreamProxy streamProxy);
|
||||||
|
|
||||||
@Update("UPDATE wvp_stream_proxy " +
|
@Update("UPDATE wvp_stream_proxy " +
|
||||||
"SET type=#{type}, " +
|
"SET type=#{type}, " +
|
||||||
|
@ -44,22 +45,20 @@ public interface StreamProxyMapper {
|
||||||
@Delete("DELETE FROM wvp_stream_proxy WHERE app=#{app} AND stream=#{stream}")
|
@Delete("DELETE FROM wvp_stream_proxy WHERE app=#{app} AND stream=#{stream}")
|
||||||
int del(String app, String stream);
|
int del(String app, String stream);
|
||||||
|
|
||||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream order by st.create_time desc")
|
@Select("SELECT st.* FROM wvp_stream_proxy st order by st.create_time desc")
|
||||||
List<StreamProxy> selectAll();
|
List<StreamProxy> selectAll();
|
||||||
|
|
||||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude, 'proxy' as streamType FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable=#{enable} order by st.create_time desc")
|
@Select("SELECT st.* FROM wvp_stream_proxy st WHERE st.enable=#{enable} order by st.create_time desc")
|
||||||
List<StreamProxy> selectForEnable(boolean enable);
|
List<StreamProxy> selectForEnable(boolean enable);
|
||||||
|
|
||||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.app=#{app} AND st.stream=#{stream} order by st.create_time desc")
|
@Select("SELECT st.* from wvp_stream_proxy st WHERE st.app=#{app} AND st.stream=#{stream} order by st.create_time desc")
|
||||||
StreamProxy selectOne(@Param("app") String app, @Param("stream") String stream);
|
StreamProxy selectOne(@Param("app") String app, @Param("stream") String stream);
|
||||||
|
|
||||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " +
|
@Select("SELECT st.* FROM wvp_stream_proxy st " +
|
||||||
"LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
|
|
||||||
"WHERE st.enable=#{enable} and st.media_server_id= #{id} order by st.create_time desc")
|
"WHERE st.enable=#{enable} and st.media_server_id= #{id} order by st.create_time desc")
|
||||||
List<StreamProxy> selectForEnableInMediaServer(@Param("id") String id, @Param("enable") boolean enable);
|
List<StreamProxy> selectForEnableInMediaServer(@Param("id") String id, @Param("enable") boolean enable);
|
||||||
|
|
||||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " +
|
@Select("SELECT st.* FROM wvp_stream_proxy st " +
|
||||||
"LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
|
|
||||||
"WHERE st.media_server_id= #{id} order by st.create_time desc")
|
"WHERE st.media_server_id= #{id} order by st.create_time desc")
|
||||||
List<StreamProxy> selectInMediaServer(String id);
|
List<StreamProxy> selectInMediaServer(String id);
|
||||||
|
|
||||||
|
@ -76,7 +75,7 @@ public interface StreamProxyMapper {
|
||||||
@Delete("DELETE FROM wvp_stream_proxy WHERE enable_remove_none_reader=true AND media_server_id=#{mediaServerId}")
|
@Delete("DELETE FROM wvp_stream_proxy WHERE enable_remove_none_reader=true AND media_server_id=#{mediaServerId}")
|
||||||
void deleteAutoRemoveItemByMediaServerId(String mediaServerId);
|
void deleteAutoRemoveItemByMediaServerId(String mediaServerId);
|
||||||
|
|
||||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable_remove_none_reader=true AND st.media_server_id=#{mediaServerId} order by st.create_time desc")
|
@Select("SELECT st.* FROM wvp_stream_proxy st WHERE st.enable_remove_none_reader=true AND st.media_server_id=#{mediaServerId} order by st.create_time desc")
|
||||||
List<StreamProxy> selectAutoRemoveItemByMediaServerId(String mediaServerId);
|
List<StreamProxy> selectAutoRemoveItemByMediaServerId(String mediaServerId);
|
||||||
|
|
||||||
@Select("select count(1) as total, sum(status) as online from wvp_stream_proxy")
|
@Select("select count(1) as total, sum(status) as online from wvp_stream_proxy")
|
||||||
|
|
|
@ -14,9 +14,9 @@ import java.util.Map;
|
||||||
@Repository
|
@Repository
|
||||||
public interface StreamPushMapper {
|
public interface StreamPushMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO wvp_stream_push (app, stream, total_reader_count, origin_type, origin_type_str, " +
|
@Insert("INSERT INTO wvp_stream_push (app, stream, total_reader_count, " +
|
||||||
"push_time, alive_second, media_server_id, update_time, create_time, push_ing, self) VALUES" +
|
"push_time, alive_second, media_server_id, update_time, create_time, push_ing, self) VALUES" +
|
||||||
"(#{app}, #{stream}, #{totalReaderCount}, #{originType}, #{originTypeStr}, " +
|
"(#{app}, #{stream}, #{totalReaderCount}, " +
|
||||||
"#{pushTime}, #{aliveSecond}, #{mediaServerId} , #{updateTime} , #{createTime}, " +
|
"#{pushTime}, #{aliveSecond}, #{mediaServerId} , #{updateTime} , #{createTime}, " +
|
||||||
"#{pushIng}, #{self} )")
|
"#{pushIng}, #{self} )")
|
||||||
int add(StreamPush streamPushItem);
|
int add(StreamPush streamPushItem);
|
||||||
|
@ -27,8 +27,6 @@ public interface StreamPushMapper {
|
||||||
"SET update_time=#{updateTime}" +
|
"SET update_time=#{updateTime}" +
|
||||||
"<if test=\"mediaServerId != null\">, media_server_id=#{mediaServerId}</if>" +
|
"<if test=\"mediaServerId != null\">, media_server_id=#{mediaServerId}</if>" +
|
||||||
"<if test=\"totalReaderCount != null\">, total_reader_count=#{totalReaderCount}</if>" +
|
"<if test=\"totalReaderCount != null\">, total_reader_count=#{totalReaderCount}</if>" +
|
||||||
"<if test=\"originType != null\">, origin_type=#{originType}</if>" +
|
|
||||||
"<if test=\"originTypeStr != null\">, origin_type_str=#{originTypeStr}</if>" +
|
|
||||||
"<if test=\"pushTime != null\">, push_time=#{pushTime}</if>" +
|
"<if test=\"pushTime != null\">, push_time=#{pushTime}</if>" +
|
||||||
"<if test=\"aliveSecond != null\">, alive_second=#{aliveSecond}</if>" +
|
"<if test=\"aliveSecond != null\">, alive_second=#{aliveSecond}</if>" +
|
||||||
"<if test=\"pushIng != null\">, push_ing=#{pushIng}</if>" +
|
"<if test=\"pushIng != null\">, push_ing=#{pushIng}</if>" +
|
||||||
|
@ -41,9 +39,9 @@ public interface StreamPushMapper {
|
||||||
int del(String app, String stream);
|
int del(String app, String stream);
|
||||||
|
|
||||||
@Delete("<script> "+
|
@Delete("<script> "+
|
||||||
"DELETE sp FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where " +
|
"DELETE sp FROM wvp_stream_push sp where " +
|
||||||
"<foreach collection='streamPushItems' item='item' separator='or'>" +
|
"<foreach collection='streamPushItems' item='item' separator='or'>" +
|
||||||
"(sp.app=#{item.app} and sp.stream=#{item.stream} and gs.gb_id is null) " +
|
"(sp.app=#{item.app} and sp.stream=#{item.stream} and sp.gb_id is null) " +
|
||||||
"</foreach>" +
|
"</foreach>" +
|
||||||
"</script>")
|
"</script>")
|
||||||
int delAllWithoutGBId(List<StreamPush> streamPushItems);
|
int delAllWithoutGBId(List<StreamPush> streamPushItems);
|
||||||
|
@ -67,34 +65,31 @@ public interface StreamPushMapper {
|
||||||
|
|
||||||
@Select(value = {" <script>" +
|
@Select(value = {" <script>" +
|
||||||
"SELECT " +
|
"SELECT " +
|
||||||
"st.*, " +
|
"* " +
|
||||||
"gs.gb_id, gs.name, gs.longitude, gs.latitude, gs.gb_stream_id " +
|
|
||||||
"from " +
|
"from " +
|
||||||
"wvp_stream_push st " +
|
"wvp_stream_push " +
|
||||||
"LEFT join wvp_gb_stream gs " +
|
|
||||||
"on st.app = gs.app AND st.stream = gs.stream " +
|
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
"1=1 " +
|
"1=1 " +
|
||||||
" <if test='query != null'> AND (st.app LIKE concat('%',#{query},'%') OR st.stream LIKE concat('%',#{query},'%') OR gs.gb_id LIKE concat('%',#{query},'%') OR gs.name LIKE concat('%',#{query},'%'))</if> " +
|
" <if test='query != null'> AND (app LIKE concat('%',#{query},'%') OR stream LIKE concat('%',#{query},'%') OR gb_id LIKE concat('%',#{query},'%') OR name LIKE concat('%',#{query},'%'))</if> " +
|
||||||
" <if test='pushing == true' > AND (gs.gb_id is null OR st.push_ing=1)</if>" +
|
" <if test='pushing == true' > AND (gb_id is null OR push_ing=1)</if>" +
|
||||||
" <if test='pushing == false' > AND (st.push_ing is null OR st.push_ing=0) </if>" +
|
" <if test='pushing == false' > AND (push_ing is null OR push_ing=0) </if>" +
|
||||||
" <if test='mediaServerId != null' > AND st.media_server_id=#{mediaServerId} </if>" +
|
" <if test='mediaServerId != null' > AND media_server_id=#{mediaServerId} </if>" +
|
||||||
"order by st.create_time desc" +
|
"order by create_time desc" +
|
||||||
" </script>"})
|
" </script>"})
|
||||||
List<StreamPush> selectAllForList(@Param("query") String query, @Param("pushing") Boolean pushing, @Param("mediaServerId") String mediaServerId);
|
List<StreamPush> selectAllForList(@Param("query") String query, @Param("pushing") Boolean pushing, @Param("mediaServerId") String mediaServerId);
|
||||||
|
|
||||||
@Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream order by st.create_time desc")
|
@Select("SELECT * from wvp_stream_push order by create_time desc")
|
||||||
List<StreamPush> selectAll();
|
List<StreamPush> selectAll();
|
||||||
|
|
||||||
@Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream WHERE st.app=#{app} AND st.stream=#{stream}")
|
@Select("SELECT * from wvp_stream_push WHERE app=#{app} AND stream=#{stream}")
|
||||||
StreamPush selectOne(@Param("app") String app, @Param("stream") String stream);
|
StreamPush selectOne(@Param("app") String app, @Param("stream") String stream);
|
||||||
|
|
||||||
@Insert("<script>" +
|
@Insert("<script>" +
|
||||||
"Insert INTO wvp_stream_push (app, stream, total_reader_count, origin_type, origin_type_str, " +
|
"Insert INTO wvp_stream_push (app, stream, total_reader_count, " +
|
||||||
"create_time, alive_second, media_server_id, status, push_ing) " +
|
"create_time, alive_second, media_server_id, status, push_ing) " +
|
||||||
"VALUES <foreach collection='streamPushItems' item='item' index='index' separator=','>" +
|
"VALUES <foreach collection='streamPushItems' item='item' index='index' separator=','>" +
|
||||||
"( #{item.app}, #{item.stream}, #{item.totalReaderCount}, #{item.originType}, " +
|
"( #{item.app}, #{item.stream}, #{item.totalReaderCount}, " +
|
||||||
"#{item.originTypeStr},#{item.createTime}, #{item.aliveSecond}, #{item.mediaServerId}, #{item.status} ," +
|
"#{item.createTime}, #{item.aliveSecond}, #{item.mediaServerId}, #{item.status} ," +
|
||||||
" #{item.pushIng} )" +
|
" #{item.pushIng} )" +
|
||||||
" </foreach>" +
|
" </foreach>" +
|
||||||
"</script>")
|
"</script>")
|
||||||
|
@ -114,7 +109,7 @@ public interface StreamPushMapper {
|
||||||
@Select("SELECT * FROM wvp_stream_push WHERE media_server_id=#{mediaServerId}")
|
@Select("SELECT * FROM wvp_stream_push WHERE media_server_id=#{mediaServerId}")
|
||||||
List<StreamPush> selectAllByMediaServerId(String mediaServerId);
|
List<StreamPush> selectAllByMediaServerId(String mediaServerId);
|
||||||
|
|
||||||
@Select("SELECT sp.* FROM wvp_stream_push sp left join wvp_gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.media_server_id=#{mediaServerId} and gs.gb_id is null")
|
@Select("SELECT sp.* FROM wvp_stream_push sp WHERE sp.media_server_id=#{mediaServerId} and sp.gb_id is null")
|
||||||
List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
||||||
|
|
||||||
@Update("UPDATE wvp_stream_push " +
|
@Update("UPDATE wvp_stream_push " +
|
||||||
|
@ -132,16 +127,6 @@ public interface StreamPushMapper {
|
||||||
"WHERE media_server_id=#{mediaServerId}")
|
"WHERE media_server_id=#{mediaServerId}")
|
||||||
void updateStatusByMediaServerId(@Param("mediaServerId") String mediaServerId, @Param("status") boolean status);
|
void updateStatusByMediaServerId(@Param("mediaServerId") String mediaServerId, @Param("status") boolean status);
|
||||||
|
|
||||||
|
|
||||||
@Select("<script> "+
|
|
||||||
"SELECT gs.* FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream " +
|
|
||||||
"where sp.status = true and (gs.app, gs.stream) in (" +
|
|
||||||
"<foreach collection='offlineStreams' item='item' separator=','>" +
|
|
||||||
"(#{item.app}, #{item.stream}) " +
|
|
||||||
"</foreach>" +
|
|
||||||
")</script>")
|
|
||||||
List<GbStream> getOnlinePusherForGbInList(List<StreamPushItemFromRedis> offlineStreams);
|
|
||||||
|
|
||||||
@Update("<script> "+
|
@Update("<script> "+
|
||||||
"UPDATE wvp_stream_push SET status=0 where id in (" +
|
"UPDATE wvp_stream_push SET status=0 where id in (" +
|
||||||
"<foreach collection='offlineStreams' item='item' separator=','>" +
|
"<foreach collection='offlineStreams' item='item' separator=','>" +
|
||||||
|
@ -150,15 +135,6 @@ public interface StreamPushMapper {
|
||||||
")</script>")
|
")</script>")
|
||||||
void offline(List<StreamPush> offlineStreams);
|
void offline(List<StreamPush> offlineStreams);
|
||||||
|
|
||||||
@Select("<script> "+
|
|
||||||
"SELECT * FROM wvp_stream_push sp left join wvp_gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream " +
|
|
||||||
"where sp.status = 0 and (gs.app, gs.stream) in (" +
|
|
||||||
"<foreach collection='onlineStreams' item='item' separator=','>" +
|
|
||||||
"(#{item.app}, #{item.stream}) " +
|
|
||||||
"</foreach>" +
|
|
||||||
") </script>")
|
|
||||||
List<GbStream> getOfflinePusherForGbInList(List<StreamPushItemFromRedis> onlineStreams);
|
|
||||||
|
|
||||||
@Update("<script> "+
|
@Update("<script> "+
|
||||||
"UPDATE wvp_stream_push SET status=1 where (app, stream) in (" +
|
"UPDATE wvp_stream_push SET status=1 where (app, stream) in (" +
|
||||||
"<foreach collection='onlineStreams' item='item' separator=','>" +
|
"<foreach collection='onlineStreams' item='item' separator=','>" +
|
||||||
|
@ -174,7 +150,7 @@ public interface StreamPushMapper {
|
||||||
void setAllStreamOffline();
|
void setAllStreamOffline();
|
||||||
|
|
||||||
@MapKey("key")
|
@MapKey("key")
|
||||||
@Select("SELECT CONCAT(wgs.app,wgs.stream) as keyId, wgs.* from wvp_gb_stream as wgs")
|
@Select("SELECT CONCAT(wsp.app,wsp.stream) as keyId, wsp.* from wvp_stream_push as wsp ")
|
||||||
Map<String, StreamPush> getAllAppAndStream();
|
Map<String, StreamPush> getAllAppAndStream();
|
||||||
|
|
||||||
@Select("select count(1) from wvp_stream_push ")
|
@Select("select count(1) from wvp_stream_push ")
|
||||||
|
|
|
@ -58,23 +58,9 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ParentPlatformMapper platformMapper;
|
private ParentPlatformMapper platformMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRedisCatchStorage redisCatchStorage;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PlatformChannelMapper platformChannelMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PlatformCatalogMapper platformCatalogMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private StreamProxyMapper streamProxyMapper;
|
private StreamProxyMapper streamProxyMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StreamPushMapper streamPushMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserSetting userSetting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据设备ID判断设备是否存在
|
* 根据设备ID判断设备是否存在
|
||||||
|
|
Loading…
Reference in New Issue