瀏覽代碼

1、机场回调修改任务结束时间;2、机场回调修改报告状态和结束时间;

tags/v1.0.0^2^2
wanjing 1 年之前
父節點
當前提交
8f801c4a69
共有 1 個檔案被更改,包括 25 行新增12 行删除
  1. +25
    -12
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java

+ 25
- 12
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java 查看文件

@@ -4,26 +4,18 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.entity.Business;
import com.tuoheng.admin.entity.FlightData;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.Tenant;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.AiAnalyseStatusEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum;
import com.tuoheng.admin.mapper.BusinessMapper;
import com.tuoheng.admin.mapper.FlightDataMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.mapper.TenantMapper;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.service.third.dsp.IDspService;
import com.tuoheng.admin.utils.AirWeatherUtil;
import com.tuoheng.admin.vo.AirWeatherVO;
import com.tuoheng.common.core.utils.HttpUtils;
import com.tuoheng.common.core.utils.JacksonUtil;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import com.tuoheng.common.core.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -48,6 +40,9 @@ public class UpdateWaittStatusService {
@Autowired
private FlightDataMapper flightDataMapper;

@Autowired
private ReportMapper reportMapper;

@Autowired
private IDspService dspService;

@@ -55,6 +50,7 @@ public class UpdateWaittStatusService {
Inspection inspectionUpdate = new Inspection();
inspectionUpdate.setId(inspection.getId());
inspectionUpdate.setStatus(TaskStatusEnum.COMPLETE.getCode());
inspectionUpdate.setExecutionEndTime(DateUtils.now());

List<Business> businessList = businessMapper.selectList(new LambdaQueryWrapper<Business>()
.eq(Business::getTypeId, inspection.getId())
@@ -102,7 +98,10 @@ public class UpdateWaittStatusService {
inspectionUpdate.setFlyHeight(flightData.getUltrasonic());
}
}

inspectionMapper.updateById(inspectionUpdate);

this.updateReport(inspection);
}

public JsonResult getWeather(String airportUrl, Integer airportId) {
@@ -124,4 +123,18 @@ public class UpdateWaittStatusService {
return JsonResult.error(EditInspectionStatusCodeEnum.GET_WEATHER_FAILED.getCode(), EditInspectionStatusCodeEnum.GET_WEATHER_FAILED.getMsg());
}
}

private void updateReport(Inspection inspection) {
Report report = reportMapper.selectOne(Wrappers.<Report>lambdaQuery()
.eq(Report::getInspectionId, inspection.getId())
.eq(Report::getMark, 1));
if (ObjectUtil.isNull(report)) {
log.info("该任务还没有生成报告,不需要修改报告的完成时间和状态");
return;
}
report.setStatus(inspection.getStatus());
report.setExecutionEndTime(inspection.getExecutionEndTime());
reportMapper.updateById(report);
}

}

Loading…
取消
儲存