|
|
@@ -7,8 +7,7 @@ import com.tuoheng.admin.enums.code.inspection.QueryVideoServiceEnum; |
|
|
|
import com.tuoheng.admin.mapper.InspectionMapper; |
|
|
|
import com.tuoheng.admin.mapper.LiveChannelMapper; |
|
|
|
import com.tuoheng.admin.vo.LiveChannelVo; |
|
|
|
import com.tuoheng.common.core.enums.ServiceExceptionEnum; |
|
|
|
import com.tuoheng.common.core.exception.ServiceException; |
|
|
|
import com.tuoheng.common.core.config.common.CommonConfig; |
|
|
|
import com.tuoheng.common.core.utils.JsonResult; |
|
|
|
import com.tuoheng.common.core.utils.StringUtils; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@@ -33,43 +32,38 @@ public class QueryVideoService { |
|
|
|
|
|
|
|
|
|
|
|
public JsonResult getVideoById(String id) { |
|
|
|
if(StringUtils.isEmpty(id)){ |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getCode(),QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getMsg()); |
|
|
|
if (StringUtils.isEmpty(id)) { |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getCode(), QueryVideoServiceEnum.INSPECTION_ID_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
//根据id查询对应的任务 |
|
|
|
Inspection inspection = inspectionMapper.selectById(id); |
|
|
|
if(null == inspection){ |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getCode(),QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getMsg()); |
|
|
|
if (null == inspection) { |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getMsg()); |
|
|
|
|
|
|
|
} |
|
|
|
LiveChannelVo liveChannelVo = new LiveChannelVo(); |
|
|
|
if(10 == inspection.getStatus()){ |
|
|
|
if (10 == inspection.getStatus()) { |
|
|
|
//任务状态为任务飞行中10视频直播 |
|
|
|
LiveChannel liveChannel = liveChannelMapper.selectOne(new LambdaQueryWrapper<LiveChannel>() |
|
|
|
.eq(LiveChannel::getMark, 1) |
|
|
|
.eq(LiveChannel::getInspectionId, inspection.getId()) |
|
|
|
.eq(LiveChannel::getStatus, 1)); |
|
|
|
if(null == liveChannel){ |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getCode(),QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getMsg()); |
|
|
|
if (null == liveChannel) { |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getMsg()); |
|
|
|
} |
|
|
|
if(liveChannel.getAipullUrl()==null){ |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getCode(),QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getMsg()); |
|
|
|
if (liveChannel.getAipullUrl() == null) { |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getCode(), QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getMsg()); |
|
|
|
} |
|
|
|
liveChannelVo.setAipullUrl(liveChannel.getAipullUrl()); |
|
|
|
liveChannelVo.setAipullUrl(CommonConfig.videoURL + liveChannel.getAipullUrl()); |
|
|
|
|
|
|
|
} |
|
|
|
if(15 == inspection.getStatus()){ |
|
|
|
if (15 == inspection.getStatus()) { |
|
|
|
//任务状态为任务飞行完成15视频回放 |
|
|
|
if(inspection.getAiVideoUrl()==null){ |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.AIVIDEO_URL_IS_NOT_NULL.getCode(),QueryVideoServiceEnum.AIVIDEO_URL_IS_NOT_NULL.getMsg()); |
|
|
|
if (inspection.getAiVideoUrl() == null) { |
|
|
|
return JsonResult.error(QueryVideoServiceEnum.AIVIDEO_URL_IS_NOT_NULL.getCode(), QueryVideoServiceEnum.AIVIDEO_URL_IS_NOT_NULL.getMsg()); |
|
|
|
} |
|
|
|
liveChannelVo.setAiVideoUrl(inspection.getAiVideoUrl()); |
|
|
|
liveChannelVo.setAiVideoUrl(CommonConfig.videoURL + inspection.getAiVideoUrl()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(liveChannelVo); |
|
|
|
|
|
|
|
} |
|
|
|
} |