瀏覽代碼

优化代码

tags/v1.0.0^2
chengwang 1 年之前
父節點
當前提交
c23f6501e5
共有 1 個檔案被更改,包括 5 行新增4 行删除
  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 查看文件

@@ -1,5 +1,6 @@
package com.tuoheng.admin.service.inspection.query;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.LiveChannel;
@@ -37,7 +38,7 @@ public class QueryVideoService {
}
//根据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());

}
@@ -48,10 +49,10 @@ public class QueryVideoService {
.eq(LiveChannel::getMark, 1)
.eq(LiveChannel::getInspectionId, inspection.getId())
.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());
}
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());
}
liveChannelVo.setAipullUrl(liveChannel.getAipullUrl());
@@ -59,7 +60,7 @@ public class QueryVideoService {
}
if (15 == inspection.getStatus()) {
//任务状态为任务飞行完成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());
}
liveChannelVo.setAiVideoUrl(CommonConfig.videoURL + inspection.getAiVideoUrl());

Loading…
取消
儲存