|
|
@@ -62,11 +62,13 @@ public class AirportCallBackUpdateStatusService { |
|
|
|
|
|
|
|
Integer status = null; |
|
|
|
if (AirPortTaskStatusEnum.FLIGHT.getCode() == missionStatusRequest.getStatus()) { |
|
|
|
log.info("被硬件调用,存任务状态:执行中"); |
|
|
|
// ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode()); |
|
|
|
Assert.notNull(thMission, "飞行任务不能为空!"); |
|
|
|
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission, AirPortTaskStatusEnum.FLIGHT); |
|
|
|
try { |
|
|
|
//开始分析 |
|
|
|
log.info("被硬件调用,存任务状态:开始分析"); |
|
|
|
JSONObject jsonObject = this.startAI(missionStatusRequest); |
|
|
|
thMissionUpdate.setRequestId(jsonObject.getJSONObject("data").getString("requestId")); |
|
|
|
thMissionUpdate.setAipullUrl(jsonObject.getJSONObject("data").getString("aipullUrl")); |
|
|
@@ -75,7 +77,7 @@ public class AirportCallBackUpdateStatusService { |
|
|
|
thMissionUpdate.setAiplayUrl(jsonObject.getJSONObject("data").getString("aiplayUrl")); |
|
|
|
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.WAITING.getCode()); |
|
|
|
|
|
|
|
log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate)); |
|
|
|
log.info("被硬件调用,原任务状态:status:{}", thMission.getStatus()); |
|
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
|
|
|
|
|
status = TaskStatusEnum.FLIGHT.getCode(); |
|
|
@@ -90,6 +92,7 @@ public class AirportCallBackUpdateStatusService { |
|
|
|
} |
|
|
|
updateEmergencyMissionStatusService.updateStatus(thMission, status); |
|
|
|
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { |
|
|
|
log.info("被硬件调用,存任务状态:已完成"); |
|
|
|
// 机场飞行完成,立即修改任务状态为已完成 |
|
|
|
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); |
|
|
|
thMissionUpdate.setId(Integer.parseInt(missionStatusRequest.getRequestId())); |
|
|
@@ -103,6 +106,8 @@ public class AirportCallBackUpdateStatusService { |
|
|
|
thMissionUpdate.setWeather(""); |
|
|
|
log.info("获取天气信息失败,请重试"); |
|
|
|
} |
|
|
|
|
|
|
|
log.info("被硬件调用,任务状态:status:{}", thMissionUpdate.getStatus()); |
|
|
|
thMissionMapper.updateById(thMissionUpdate); |
|
|
|
|
|
|
|
status = TaskStatusEnum.COMPLETE.getCode(); |
|
|
@@ -119,6 +124,7 @@ public class AirportCallBackUpdateStatusService { |
|
|
|
} |
|
|
|
|
|
|
|
private JSONObject startAI(MissionStatusRequest missionStatusRequest) throws ServiceException { |
|
|
|
log.info("开始AI分析"); |
|
|
|
//任务调用完成之后,调用发送通道,请求DSP需要分析 |
|
|
|
//调用DSP接口 |
|
|
|
JSONObject request = new JSONObject(); |
|
|
@@ -159,6 +165,7 @@ public class AirportCallBackUpdateStatusService { |
|
|
|
} |
|
|
|
|
|
|
|
private Boolean stopAI(MissionStatusRequest missionStatusRequest, ThMission thMission) { |
|
|
|
log.info("停止AI分析"); |
|
|
|
Assert.notNull(thMission, "飞行任务不能为空!"); |
|
|
|
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); |
|
|
|
thMissionUpdate.setId(thMission.getId()); |