Browse Source

优化代码

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
c23f6501e5
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryVideoService.java

+ 5
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryVideoService.java View File

package com.tuoheng.admin.service.inspection.query; package com.tuoheng.admin.service.inspection.query;


import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.Inspection; import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.LiveChannel; import com.tuoheng.admin.entity.LiveChannel;
} }
//根据id查询对应的任务 //根据id查询对应的任务
Inspection inspection = inspectionMapper.selectById(id); Inspection inspection = inspectionMapper.selectById(id);
if (null == inspection) {
if (ObjectUtil.isNull(inspection)) {
return JsonResult.error(QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getMsg()); return JsonResult.error(QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.INSPECTION_IS_NOT_EXIST.getMsg());


} }
.eq(LiveChannel::getMark, 1) .eq(LiveChannel::getMark, 1)
.eq(LiveChannel::getInspectionId, inspection.getId()) .eq(LiveChannel::getInspectionId, inspection.getId())
.eq(LiveChannel::getStatus, 1)); .eq(LiveChannel::getStatus, 1));
if (null == liveChannel) {
if (ObjectUtil.isNull(liveChannel)) {
return JsonResult.error(QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getMsg()); return JsonResult.error(QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getCode(), QueryVideoServiceEnum.LIVE_CHANNEL_IS_NOT_EXIST.getMsg());
} }
if (liveChannel.getAipullUrl() == null) {
if (StringUtils.isEmpty(liveChannel.getAipullUrl())) {
return JsonResult.error(QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getCode(), QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getMsg()); return JsonResult.error(QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getCode(), QueryVideoServiceEnum.AIPULL_URL_IS_NOT_NULL.getMsg());
} }
liveChannelVo.setAipullUrl(liveChannel.getAipullUrl()); liveChannelVo.setAipullUrl(liveChannel.getAipullUrl());
} }
if (15 == inspection.getStatus()) { if (15 == inspection.getStatus()) {
//任务状态为任务飞行完成15视频回放 //任务状态为任务飞行完成15视频回放
if (inspection.getAiVideoUrl() == null) {
if (StringUtils.isEmpty(inspection.getAiVideoUrl())) {
return JsonResult.error(QueryVideoServiceEnum.AIVIDEO_URL_IS_NOT_NULL.getCode(), QueryVideoServiceEnum.AIVIDEO_URL_IS_NOT_NULL.getMsg()); return JsonResult.error(QueryVideoServiceEnum.AIVIDEO_URL_IS_NOT_NULL.getCode(), QueryVideoServiceEnum.AIVIDEO_URL_IS_NOT_NULL.getMsg());
} }
liveChannelVo.setAiVideoUrl(CommonConfig.videoURL + inspection.getAiVideoUrl()); liveChannelVo.setAiVideoUrl(CommonConfig.videoURL + inspection.getAiVideoUrl());

Loading…
Cancel
Save