[WVP集群] 合并主线

master
648540858 2024-12-27 11:18:29 +08:00
parent e05d988755
commit a5f1422466
5 changed files with 16 additions and 13 deletions

View File

@ -771,7 +771,13 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
@Override @Override
public void queryRecordInfo(CommonGBChannel channel, String startTime, String endTime, ErrorCallback<RecordInfo> callback) { public void queryRecordInfo(CommonGBChannel channel, String startTime, String endTime, ErrorCallback<RecordInfo> callback) {
Device device = deviceMapper.query(channel.getGbDeviceDbId()); if (channel.getDataType() != ChannelDataType.GB28181.value){
// 只支持国标的语音喊话
log.warn("[INFO 消息] 非国标设备, 通道ID {}", channel.getGbId());
callback.run(ErrorCode.ERROR100.getCode(), "非国标设备", null);
return;
}
Device device = deviceMapper.query(channel.getDataDeviceId());
if (device == null) { if (device == null) {
log.warn("[点播] 未找到通道{}的设备信息", channel); log.warn("[点播] 未找到通道{}的设备信息", channel);
callback.run(ErrorCode.ERROR100.getCode(), "设备不存在", null); callback.run(ErrorCode.ERROR100.getCode(), "设备不存在", null);

View File

@ -6,7 +6,6 @@ import com.genersoft.iot.vmp.conf.exception.ServiceException;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.common.enums.ChannelDataType; import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
import com.genersoft.iot.vmp.gb28181.bean.InviteInfo;
import com.genersoft.iot.vmp.gb28181.bean.Platform; import com.genersoft.iot.vmp.gb28181.bean.Platform;
import com.genersoft.iot.vmp.gb28181.bean.PlayException; import com.genersoft.iot.vmp.gb28181.bean.PlayException;
import com.genersoft.iot.vmp.gb28181.service.IGbChannelPlayService; import com.genersoft.iot.vmp.gb28181.service.IGbChannelPlayService;
@ -97,13 +96,13 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
@Override @Override
public void stopPlay(InviteSessionType type, CommonGBChannel channel, String stream) { public void stopPlay(InviteSessionType type, CommonGBChannel channel, String stream) {
if (channel.getGbDeviceDbId() != null) { if (channel.getDataType() == ChannelDataType.GB28181.value) {
// 国标通道 // 国标通道
stopPlayDeviceChannel(type, channel, stream); stopPlayDeviceChannel(type, channel, stream);
} else if (channel.getStreamProxyId() != null) { } else if (channel.getDataType() == ChannelDataType.STREAM_PROXY.value) {
// 拉流代理 // 拉流代理
stopPlayProxy(channel); stopPlayProxy(channel);
} else if (channel.getStreamPushId() != null) { } else if (channel.getDataType() == ChannelDataType.STREAM_PUSH.value) {
// 推流 // 推流
stopPlayPush(channel); stopPlayPush(channel);
} else { } else {
@ -178,7 +177,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
public void stopPlayProxy(CommonGBChannel channel) { public void stopPlayProxy(CommonGBChannel channel) {
// 拉流代理通道 // 拉流代理通道
try { try {
streamProxyPlayService.stop(channel.getStreamProxyId()); streamProxyPlayService.stop(channel.getDataDeviceId());
}catch (Exception e) { }catch (Exception e) {
log.error("[停止点播失败] {}({})", channel.getGbName(), channel.getGbDeviceId(), e); log.error("[停止点播失败] {}({})", channel.getGbName(), channel.getGbDeviceId(), e);
} }
@ -201,7 +200,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
public void stopPlayPush(CommonGBChannel channel) { public void stopPlayPush(CommonGBChannel channel) {
// 推流 // 推流
try { try {
streamPushPlayService.stop(channel.getStreamPushId()); streamPushPlayService.stop(channel.getDataDeviceId());
}catch (Exception e) { }catch (Exception e) {
log.error("[停止点播失败] {}({})", channel.getGbName(), channel.getGbDeviceId(), e); log.error("[停止点播失败] {}({})", channel.getGbName(), channel.getGbDeviceId(), e);
} }

View File

@ -734,14 +734,13 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Override @Override
public void queryRecordInfo(CommonGBChannel channel, String startTime, String endTime, ErrorCallback<RecordInfo> callback) { public void queryRecordInfo(CommonGBChannel channel, String startTime, String endTime, ErrorCallback<RecordInfo> callback) {
if (channel.getGbDeviceDbId() != null) { if (channel.getDataType() == ChannelDataType.GB28181.value) {
deviceChannelService.queryRecordInfo(channel, startTime, endTime, callback); deviceChannelService.queryRecordInfo(channel, startTime, endTime, callback);
} else if (channel.getStreamProxyId() != null) { } else if (channel.getDataType() == ChannelDataType.STREAM_PROXY.value) {
// 拉流代理 // 拉流代理
log.warn("[下载通用通道录像] 不支持下载拉流代理的录像: {}({})", channel.getGbName(), channel.getGbDeviceId()); log.warn("[下载通用通道录像] 不支持下载拉流代理的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
throw new PlayException(Response.FORBIDDEN, "forbidden"); throw new PlayException(Response.FORBIDDEN, "forbidden");
} else if (channel.getStreamPushId() != null) { } else if (channel.getDataType() == ChannelDataType.STREAM_PUSH.value) {
// 推流 // 推流
log.warn("[下载通用通道录像] 不支持下载推流的录像: {}({})", channel.getGbName(), channel.getGbDeviceId()); log.warn("[下载通用通道录像] 不支持下载推流的录像: {}({})", channel.getGbName(), channel.getGbDeviceId());
throw new PlayException(Response.FORBIDDEN, "forbidden"); throw new PlayException(Response.FORBIDDEN, "forbidden");

View File

@ -1,6 +1,5 @@
package com.genersoft.iot.vmp.gb28181.service.impl; package com.genersoft.iot.vmp.gb28181.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.enums.ChannelDataType; import com.genersoft.iot.vmp.common.enums.ChannelDataType;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.dao.*; import com.genersoft.iot.vmp.gb28181.dao.*;

View File

@ -1707,7 +1707,7 @@ public class PlayServiceImpl implements IPlayService {
@Override @Override
public void stop(InviteSessionType inviteSessionType, CommonGBChannel channel, String stream) { public void stop(InviteSessionType inviteSessionType, CommonGBChannel channel, String stream) {
Device device = deviceService.getDevice(channel.getGbDeviceDbId()); Device device = deviceService.getDevice(channel.getDataDeviceId());
if (device == null) { if (device == null) {
log.warn("[停止播放] 未找到通道{}的设备信息", channel); log.warn("[停止播放] 未找到通道{}的设备信息", channel);
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error"); throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");