Browse Source

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
88d4c66ef3
2 changed files with 12 additions and 8 deletions
  1. +7
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java
  2. +5
    -6
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java

+ 7
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java View File

thMissionMapper.updateById(mission); thMissionMapper.updateById(mission);
} }



@Override @Override
public boolean updateStatus(MissionStatusRequest missionStatusRequest) throws ServiceException { public boolean updateStatus(MissionStatusRequest missionStatusRequest) throws ServiceException {

//如果发送过来的状态是执行中,那么就说明之前是待执行,查询等待执行的数据,开始飞行 //如果发送过来的状态是执行中,那么就说明之前是待执行,查询等待执行的数据,开始飞行
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());
log.info("修改飞行状态:{}",JSONObject.toJSONString(thMissionUpdate)); log.info("修改飞行状态:{}",JSONObject.toJSONString(thMissionUpdate));
return thMissionMapper.updateById(thMissionUpdate) > 0; return thMissionMapper.updateById(thMissionUpdate) > 0;
}else if(AirPortTaskStatusEnum.WAIT.getCode()==missionStatusRequest.getStatus()){ }else if(AirPortTaskStatusEnum.WAIT.getCode()==missionStatusRequest.getStatus()){
// 机场飞行完成,立即修改任务状态为已完成
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(Integer.parseInt(missionStatusRequest.getRequestId()));
thMissionUpdate.setStatus(TaskStatusEnum.COMPLETE.getCode());
thMissionUpdate.setExecutionEndTime(new Date());
thMissionMapper.updateById(thMissionUpdate);

//硬件停止后,停止AI分析 //硬件停止后,停止AI分析
return stopAI(missionStatusRequest); return stopAI(missionStatusRequest);
}else{ }else{

+ 5
- 6
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/QuestionServiceImpl.java View File

if (aBoolean) { if (aBoolean) {
setComplate(callbackRequest, mission, thMissionUpdate); setComplate(callbackRequest, mission, thMissionUpdate);
} else { } else {
setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FAIL, mission);
// setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FAIL, mission);
} }
return JsonResult.success(); return JsonResult.success();
} }


private void setTaskStatusEnum(ThMission thMissionUpdate, TaskStatusEnum statusEnum, ThMission mission) {
private void setTaskStatusEnum2(ThMission thMissionUpdate, TaskStatusEnum statusEnum, ThMission mission) {
thMissionUpdate.setStatus(statusEnum.getCode()); thMissionUpdate.setStatus(statusEnum.getCode());
thMissionUpdate.setId(mission.getId()); thMissionUpdate.setId(mission.getId());
thMissionUpdate.setExecutionEndTime(new Date()); thMissionUpdate.setExecutionEndTime(new Date());
} else { } else {
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.SUCCESS.getCode()); thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.SUCCESS.getCode());
} }

setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.COMPLETE, mission);
// setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.COMPLETE, mission);
} else if (callbackRequest.getAnalyseStatus() == AiAnalyseStatusEnum.FAILED.getCode()) { } else if (callbackRequest.getAnalyseStatus() == AiAnalyseStatusEnum.FAILED.getCode()) {
setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FAIL, mission);
// setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FAIL, mission);
} else { } else {
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.RUNNING.getCode()); thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.RUNNING.getCode());
setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FLIGHT, mission);
// setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FLIGHT, mission);
} }


} }

Loading…
Cancel
Save