|
|
@@ -64,15 +64,20 @@ public class AirportCallBackUpdateStatusService { |
|
|
|
// ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode()); |
|
|
|
Assert.notNull(thMission, "飞行任务不能为空!"); |
|
|
|
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission, AirPortTaskStatusEnum.FLIGHT); |
|
|
|
//开始分析 |
|
|
|
try { |
|
|
|
JSONObject jsonObject = startAI(missionStatusRequest); |
|
|
|
//开始分析 |
|
|
|
JSONObject jsonObject = this.startAI(missionStatusRequest); |
|
|
|
thMissionUpdate.setRequestId(jsonObject.getJSONObject("data").getString("requestId")); |
|
|
|
thMissionUpdate.setAipullUrl(jsonObject.getJSONObject("data").getString("aipullUrl")); |
|
|
|
thMissionUpdate.setAipushUrl(jsonObject.getJSONObject("data").getString("aipushUrl")); |
|
|
|
thMissionUpdate.setPlayUrl(missionStatusRequest.getPlayUrl()); |
|
|
|
thMissionUpdate.setAiplayUrl(jsonObject.getJSONObject("data").getString("aiplayUrl")); |
|
|
|
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.WAITING.getCode()); |
|
|
|
|
|
|
|
log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate)); |
|
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
|
|
|
|
|
thMission.setStatus(TaskStatusEnum.FLIGHT.getCode()); |
|
|
|
} catch (ServiceException e) { |
|
|
|
//如果调用DSP失败就直接失败! |
|
|
|
log.error("调用DSP数据失败:{}", e.getMessage()); |
|
|
@@ -80,8 +85,6 @@ public class AirportCallBackUpdateStatusService { |
|
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
|
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "任务分析失败!"); |
|
|
|
} |
|
|
|
log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate)); |
|
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
|
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { |
|
|
|
// 机场飞行完成,立即修改任务状态为已完成 |
|
|
|
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); |