|
|
@@ -107,12 +107,20 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi |
|
|
|
Assert.notNull(thMission, "飞行任务不能为空!"); |
|
|
|
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission,AirPortTaskStatusEnum.FLIGHT); |
|
|
|
//开始分析 |
|
|
|
JSONObject jsonObject = 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(jsonObject.getJSONObject("data").getString("playUrl")); |
|
|
|
thMissionUpdate.setAiplayUrl(jsonObject.getJSONObject("data").getString("aiplayUrl")); |
|
|
|
try { |
|
|
|
JSONObject jsonObject = 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(jsonObject.getJSONObject("data").getString("playUrl")); |
|
|
|
thMissionUpdate.setAiplayUrl(jsonObject.getJSONObject("data").getString("aiplayUrl")); |
|
|
|
|
|
|
|
}catch (ServiceException e){ |
|
|
|
//如果调用DSP失败就直接失败! |
|
|
|
log.error("调用DSP数据失败:{}",e.getMessage()); |
|
|
|
thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode()); |
|
|
|
throw new ServiceException(HttpStatus.BAD_REQUEST.value(),"任务分析失败!"); |
|
|
|
} |
|
|
|
return thMissionMapper.updateById(thMissionUpdate) > 0; |
|
|
|
}else if(AirPortTaskStatusEnum.WAIT.getCode()==missionStatusRequest.getStatus()){ |
|
|
|
//硬件停止后,停止AI分析 |
|
|
@@ -166,6 +174,7 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi |
|
|
|
ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.FLIGHT.getCode()); |
|
|
|
Assert.notNull(thMission, "飞行任务不能为空!"); |
|
|
|
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission,AirPortTaskStatusEnum.WAIT); |
|
|
|
thMissionUpdate.setExecutionEndTime(new Date()); |
|
|
|
boolean result=false; |
|
|
|
if(thMissionMapper.updateById(thMissionUpdate) > 0){ |
|
|
|
//任务调用完成之后,调用发送通道,请求DSP关闭请求 |