|
|
|
|
|
|
|
|
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.enums.AirPortTaskStatusEnum; |
|
|
import com.tuoheng.admin.enums.AirPortTaskStatusEnum; |
|
|
|
|
|
import com.tuoheng.admin.enums.InspectionStatusEnum; |
|
|
import com.tuoheng.admin.enums.MarkEnum; |
|
|
import com.tuoheng.admin.enums.MarkEnum; |
|
|
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum; |
|
|
import com.tuoheng.admin.enums.code.inspection.EditInspectionStatusCodeEnum; |
|
|
import com.tuoheng.admin.mapper.InspectionMapper; |
|
|
import com.tuoheng.admin.mapper.InspectionMapper; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Inspection inspection = (Inspection) result.getData(); |
|
|
Inspection inspection = (Inspection) result.getData(); |
|
|
|
|
|
|
|
|
|
|
|
Integer status = null; |
|
|
if (AirPortTaskStatusEnum.FLIGHT.getCode() != missionStatusRequest.getStatus() && AirPortTaskStatusEnum.WAIT.getCode() != missionStatusRequest.getStatus()) { |
|
|
if (AirPortTaskStatusEnum.FLIGHT.getCode() != missionStatusRequest.getStatus() && AirPortTaskStatusEnum.WAIT.getCode() != missionStatusRequest.getStatus()) { |
|
|
log.info("修改任务状态业务接口:飞行状态出错!"); |
|
|
log.info("修改任务状态业务接口:飞行状态出错!"); |
|
|
return JsonResult.error(EditInspectionStatusCodeEnum.TASK_NOT_STATUS.getCode(), EditInspectionStatusCodeEnum.TASK_NOT_STATUS.getMsg()); |
|
|
return JsonResult.error(EditInspectionStatusCodeEnum.TASK_NOT_STATUS.getCode(), EditInspectionStatusCodeEnum.TASK_NOT_STATUS.getMsg()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (AirPortTaskStatusEnum.FLIGHT.getCode() == missionStatusRequest.getStatus()) { |
|
|
if (AirPortTaskStatusEnum.FLIGHT.getCode() == missionStatusRequest.getStatus()) { |
|
|
log.info("修改任务状态业务接口:修改执行中状态"); |
|
|
log.info("修改任务状态业务接口:修改执行中状态"); |
|
|
|
|
|
status = InspectionStatusEnum.IN_FLIGHT.getCode(); |
|
|
updateFlightStatusService.updateFlightStatus(inspection, missionStatusRequest); |
|
|
updateFlightStatusService.updateFlightStatus(inspection, missionStatusRequest); |
|
|
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { |
|
|
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { |
|
|
log.info("修改任务状态业务接口:修改待执行状态"); |
|
|
log.info("修改任务状态业务接口:修改待执行状态"); |
|
|
|
|
|
status = InspectionStatusEnum.FLIGHT_COMPLETED.getCode(); |
|
|
updateWaittStatusService.updateWaittStatus(inspection); |
|
|
updateWaittStatusService.updateWaittStatus(inspection); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.updateEmergencyStatus(inspection, status); |
|
|
|
|
|
|
|
|
log.info("修改任务业务接口:修改任务成功:{}"); |
|
|
log.info("修改任务业务接口:修改任务成功:{}"); |
|
|
return JsonResult.success(); |
|
|
return JsonResult.success(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return JsonResult.success(inspection); |
|
|
return JsonResult.success(inspection); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 修改应急任务数据 |
|
|
|
|
|
* |
|
|
|
|
|
* @param oldInspection |
|
|
|
|
|
* @param status |
|
|
|
|
|
*/ |
|
|
|
|
|
public void updateEmergencyStatus(Inspection oldInspection, Integer status) { |
|
|
|
|
|
log.info("修改应急任务数据, type:{}, emergencyDataInspectionId:{}, status={}", oldInspection.getType(), oldInspection.getEmergencyDataInspectionId(), status); |
|
|
|
|
|
Inspection emergencyInspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>() |
|
|
|
|
|
.eq(Inspection::getEmergencyDataInspectionId, oldInspection.getId()) |
|
|
|
|
|
.eq(Inspection::getMark, MarkEnum.VALID.getCode())); |
|
|
|
|
|
if (ObjectUtil.isNull(emergencyInspection)) { |
|
|
|
|
|
log.info("修改应急任务数据,该巡检任务没有对应的应急任务"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
// 在查询一次,保证数据是最新的 |
|
|
|
|
|
Inspection inspection = inspectionMapper.selectOne(new LambdaQueryWrapper<Inspection>() |
|
|
|
|
|
.eq(Inspection::getId, oldInspection.getId()) |
|
|
|
|
|
.eq(Inspection::getMark, MarkEnum.VALID.getCode())); |
|
|
|
|
|
if (ObjectUtil.isNotNull(status)) { |
|
|
|
|
|
emergencyInspection.setStatus(status); |
|
|
|
|
|
} |
|
|
|
|
|
emergencyInspection.setAnalyseStatus(inspection.getAnalyseStatus()); |
|
|
|
|
|
emergencyInspection.setVideoUrl(inspection.getVideoUrl()); |
|
|
|
|
|
emergencyInspection.setAiVideoUrl(inspection.getAiVideoUrl()); |
|
|
|
|
|
inspectionMapper.updateById(inspection); |
|
|
|
|
|
log.info("修改应急任务数据完成"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |