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

@@ -179,10 +179,8 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi
thMissionMapper.updateById(mission);
}


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

//如果发送过来的状态是执行中,那么就说明之前是待执行,查询等待执行的数据,开始飞行
if(AirPortTaskStatusEnum.FLIGHT.getCode()==missionStatusRequest.getStatus()){
ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode());
@@ -207,6 +205,13 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi
log.info("修改飞行状态:{}",JSONObject.toJSONString(thMissionUpdate));
return thMissionMapper.updateById(thMissionUpdate) > 0;
}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分析
return stopAI(missionStatusRequest);
}else{

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

@@ -303,12 +303,12 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
if (aBoolean) {
setComplate(callbackRequest, mission, thMissionUpdate);
} else {
setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FAIL, mission);
// setTaskStatusEnum(thMissionUpdate, TaskStatusEnum.FAIL, mission);
}
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.setId(mission.getId());
thMissionUpdate.setExecutionEndTime(new Date());
@@ -326,13 +326,12 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio
} else {
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.SUCCESS.getCode());
}

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

}

Loading…
Cancel
Save