|
|
|
|
|
|
|
|
.eq(ThMission::getId, missionStatusRequest.getRequestId()) |
|
|
.eq(ThMission::getId, missionStatusRequest.getRequestId()) |
|
|
.eq(ThMission::getMark, MarkEnum.VALID.getCode())); |
|
|
.eq(ThMission::getMark, MarkEnum.VALID.getCode())); |
|
|
|
|
|
|
|
|
|
|
|
Integer status = null; |
|
|
if (AirPortTaskStatusEnum.FLIGHT.getCode() == missionStatusRequest.getStatus()) { |
|
|
if (AirPortTaskStatusEnum.FLIGHT.getCode() == missionStatusRequest.getStatus()) { |
|
|
// ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode()); |
|
|
// ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode()); |
|
|
Assert.notNull(thMission, "飞行任务不能为空!"); |
|
|
Assert.notNull(thMission, "飞行任务不能为空!"); |
|
|
|
|
|
|
|
|
log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate)); |
|
|
log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate)); |
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
|
|
|
|
|
|
thMission.setStatus(TaskStatusEnum.FLIGHT.getCode()); |
|
|
|
|
|
|
|
|
status = TaskStatusEnum.FLIGHT.getCode(); |
|
|
} catch (ServiceException e) { |
|
|
} catch (ServiceException e) { |
|
|
//如果调用DSP失败就直接失败! |
|
|
//如果调用DSP失败就直接失败! |
|
|
log.error("调用DSP数据失败:{}", e.getMessage()); |
|
|
log.error("调用DSP数据失败:{}", e.getMessage()); |
|
|
thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode()); |
|
|
thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode()); |
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "任务分析失败!"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
status = TaskStatusEnum.FAIL.getCode(); |
|
|
|
|
|
// throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "任务分析失败!"); |
|
|
} |
|
|
} |
|
|
|
|
|
updateEmergencyMissionStatusService.updateStatus(thMission, status); |
|
|
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { |
|
|
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { |
|
|
// 机场飞行完成,立即修改任务状态为已完成 |
|
|
// 机场飞行完成,立即修改任务状态为已完成 |
|
|
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); |
|
|
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
|
|
|
|
|
|
|
|
|
status = TaskStatusEnum.COMPLETE.getCode(); |
|
|
|
|
|
updateEmergencyMissionStatusService.updateStatus(thMission, status); |
|
|
|
|
|
|
|
|
//硬件停止后,停止AI分析 |
|
|
//硬件停止后,停止AI分析 |
|
|
this.stopAI(missionStatusRequest, thMission); |
|
|
this.stopAI(missionStatusRequest, thMission); |
|
|
} else { |
|
|
} else { |
|
|
throw new ServiceException(ServiceExceptionEnum.TASK_NOT_STATUS); |
|
|
throw new ServiceException(ServiceExceptionEnum.TASK_NOT_STATUS); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
updateEmergencyMissionStatusService.updateStatus(thMission); |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|