|
|
@@ -2,9 +2,12 @@ package com.tuoheng.admin.service.inspection.update.flyer; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.tuoheng.admin.entity.Inspection; |
|
|
|
import com.tuoheng.admin.entity.Report; |
|
|
|
import com.tuoheng.admin.enums.TaskStatusEnum; |
|
|
|
import com.tuoheng.admin.mapper.InspectionMapper; |
|
|
|
import com.tuoheng.admin.mapper.ReportMapper; |
|
|
|
import com.tuoheng.admin.request.inspection.UpdateTaskByCodeRequest; |
|
|
|
import com.tuoheng.common.core.exception.ServiceException; |
|
|
|
import com.tuoheng.common.core.utils.JacksonUtil; |
|
|
@@ -29,6 +32,9 @@ public class UpdateFlyerService { |
|
|
|
@Autowired |
|
|
|
private InspectionMapper inspectionMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ReportMapper reportMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private OnlineIdentifService onlineIdentifService; |
|
|
|
|
|
|
@@ -138,5 +144,21 @@ public class UpdateFlyerService { |
|
|
|
inspection.setStatus(request.getStatus()); |
|
|
|
inspection.setExecutionEndTime(request.getFlightEndTime()); |
|
|
|
inspectionMapper.updateById(inspection); |
|
|
|
|
|
|
|
this.updateReport(inspection); |
|
|
|
} |
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
|
|
|
|
} |