|  | @@ -5,6 +5,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
 | 
	
		
			
				|  |  |  import com.genersoft.iot.vmp.common.InviteInfo;
 | 
	
		
			
				|  |  |  import com.genersoft.iot.vmp.common.InviteSessionType;
 | 
	
		
			
				|  |  |  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.DeviceChannel;
 | 
	
		
			
				|  |  |  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.PlatformChannelMapper;
 | 
	
		
			
				|  |  |  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.gb28181.platform.bean.ChannelReduce;
 | 
	
		
			
				|  |  |  import lombok.extern.slf4j.Slf4j;
 | 
	
	
		
			
				|  | @@ -345,12 +347,20 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      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
 | 
	
		
			
				|  |  |      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
 |