临时提交

pull/1642/head
648540858 2024-07-09 18:00:44 +08:00
parent 046e7802f3
commit 61b811e701
2 changed files with 16 additions and 6 deletions

View File

@ -309,11 +309,11 @@ public interface DeviceChannelMapper {
@Delete("DELETE FROM wvp_device_channel WHERE id=#{id}") @Delete("DELETE FROM wvp_device_channel WHERE id=#{id}")
int del(@Param("id") int id); int del(@Param("id") int id);
@Update(value = {"UPDATE wvp_device_channel SET stream_id=null WHERE device_id=#{deviceId} AND channel_id=#{channelId}"}) @Update(value = {"UPDATE wvp_device_channel SET stream_id=null WHERE device_db_id=#{deviceId} AND device_id=#{channelId}"})
void stopPlay(@Param("deviceId") String deviceId, @Param("channelId") String channelId); void stopPlay(@Param("deviceId") int deviceId, @Param("channelId") String channelId);
@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_db_id=#{deviceId} AND device_id=#{channelId}"})
void startPlay(@Param("deviceId") String deviceId, @Param("channelId") String channelId, @Param("streamId") String streamId); void startPlay(@Param("deviceId") int deviceId, @Param("channelId") String channelId, @Param("streamId") String streamId);
@Select(value = {" <script>" + @Select(value = {" <script>" +

View File

@ -5,6 +5,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.InviteInfo; import com.genersoft.iot.vmp.common.InviteInfo;
import com.genersoft.iot.vmp.common.InviteSessionType; import com.genersoft.iot.vmp.common.InviteSessionType;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition; import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
@ -18,6 +19,7 @@ import com.genersoft.iot.vmp.gb28181.dao.DeviceMapper;
import com.genersoft.iot.vmp.gb28181.dao.DeviceMobilePositionMapper; import com.genersoft.iot.vmp.gb28181.dao.DeviceMobilePositionMapper;
import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo; import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -345,12 +347,20 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
@Override @Override
public void startPlay(String deviceId, String channelId, String stream) { public void startPlay(String deviceId, String channelId, String stream) {
channelMapper.startPlay(deviceId, channelId, stream); Device device = deviceMapper.getDeviceByDeviceId(deviceId);
if (device == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备: " +deviceId);
}
channelMapper.startPlay(device.getId(), channelId, stream);
} }
@Override @Override
public void stopPlay(String deviceId, String channelId) { public void stopPlay(String deviceId, String channelId) {
channelMapper.stopPlay(deviceId, channelId); Device device = deviceMapper.getDeviceByDeviceId(deviceId);
if (device == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到设备: " +deviceId);
}
channelMapper.stopPlay(device.getId(), channelId);
} }
@Override @Override