Bladeren bron

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

tags/v1.0.0^2^2
wanjing 1 jaar geleden
bovenliggende
commit
8f801c4a69
1 gewijzigde bestanden met toevoegingen van 25 en 12 verwijderingen
  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 Bestand weergeven

import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.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.AiAnalyseStatusEnum;
import com.tuoheng.admin.enums.MarkTypeEnum; import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.TaskStatusEnum; import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum; 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.service.third.dsp.IDspService;
import com.tuoheng.admin.utils.AirWeatherUtil; import com.tuoheng.admin.utils.AirWeatherUtil;
import com.tuoheng.admin.vo.AirWeatherVO; 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 lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@Autowired @Autowired
private FlightDataMapper flightDataMapper; private FlightDataMapper flightDataMapper;


@Autowired
private ReportMapper reportMapper;

@Autowired @Autowired
private IDspService dspService; private IDspService dspService;


Inspection inspectionUpdate = new Inspection(); Inspection inspectionUpdate = new Inspection();
inspectionUpdate.setId(inspection.getId()); inspectionUpdate.setId(inspection.getId());
inspectionUpdate.setStatus(TaskStatusEnum.COMPLETE.getCode()); inspectionUpdate.setStatus(TaskStatusEnum.COMPLETE.getCode());
inspectionUpdate.setExecutionEndTime(DateUtils.now());


List<Business> businessList = businessMapper.selectList(new LambdaQueryWrapper<Business>() List<Business> businessList = businessMapper.selectList(new LambdaQueryWrapper<Business>()
.eq(Business::getTypeId, inspection.getId()) .eq(Business::getTypeId, inspection.getId())
inspectionUpdate.setFlyHeight(flightData.getUltrasonic()); inspectionUpdate.setFlyHeight(flightData.getUltrasonic());
} }
} }

inspectionMapper.updateById(inspectionUpdate); inspectionMapper.updateById(inspectionUpdate);

this.updateReport(inspection);
} }


public JsonResult getWeather(String airportUrl, Integer airportId) { public JsonResult getWeather(String airportUrl, Integer airportId) {
return JsonResult.error(EditInspectionStatusCodeEnum.GET_WEATHER_FAILED.getCode(), EditInspectionStatusCodeEnum.GET_WEATHER_FAILED.getMsg()); 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);
}

} }

Laden…
Annuleren
Opslaan