Pārlūkot izejas kodu

修改应急任务数据

tags/v1.2.0^2
wanjing pirms 1 gada
vecāks
revīzija
ea595ebdc4
3 mainītis faili ar 16 papildinājumiem un 8 dzēšanām
  1. +6
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/UpdateEmergencyMissionStatusService.java
  2. +9
    -5
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/AirportCallBackUpdateStatusService.java
  3. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallBackService.java

+ 6
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/UpdateEmergencyMissionStatusService.java Parādīt failu

* *
* @param oldMission * @param oldMission
*/ */
public void updateStatus(ThMission oldMission) {
public void updateStatus(ThMission oldMission, Integer status) {
log.info("进入修改应急任务数据"); log.info("进入修改应急任务数据");
if (ObjectUtil.isNull(oldMission.getAccidentTask())) { if (ObjectUtil.isNull(oldMission.getAccidentTask())) {
return; return;
ThMission mission = thMissionMapper.selectOne(new LambdaQueryWrapper<ThMission>() ThMission mission = thMissionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, oldMission.getId()) .eq(ThMission::getId, oldMission.getId())
.eq(ThMission::getMark, MarkEnum.VALID.getCode())); .eq(ThMission::getMark, MarkEnum.VALID.getCode()));
emergencyMission.setStatus(oldMission.getStatus());
if (ObjectUtil.isNotNull(status)) {
emergencyMission.setStatus(status);
} else {
emergencyMission.setStatus(oldMission.getStatus());
}
emergencyMission.setPlayUrl(mission.getPlayUrl()); emergencyMission.setPlayUrl(mission.getPlayUrl());
emergencyMission.setAiplayUrl(mission.getAiplayUrl()); emergencyMission.setAiplayUrl(mission.getAiplayUrl());
emergencyMission.setPullUrl(mission.getAipullUrl()); emergencyMission.setPullUrl(mission.getAipullUrl());

+ 9
- 5
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/AirportCallBackUpdateStatusService.java Parādīt failu

.eq(ThMission::getId, missionStatusRequest.getRequestId()) .eq(ThMission::getId, missionStatusRequest.getRequestId())
.eq(ThMission::getMark, MarkEnum.VALID.getCode())); .eq(ThMission::getMark, MarkEnum.VALID.getCode()));


Integer status = null;
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());
Assert.notNull(thMission, "飞行任务不能为空!"); Assert.notNull(thMission, "飞行任务不能为空!");
log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate)); log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate));
thMissionMapper.updateById(thMissionUpdate); thMissionMapper.updateById(thMissionUpdate);


thMission.setStatus(TaskStatusEnum.FLIGHT.getCode());
status = TaskStatusEnum.FLIGHT.getCode();
} catch (ServiceException e) { } catch (ServiceException e) {
//如果调用DSP失败就直接失败! //如果调用DSP失败就直接失败!
log.error("调用DSP数据失败:{}", e.getMessage()); log.error("调用DSP数据失败:{}", e.getMessage());
thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode()); thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode());
thMissionMapper.updateById(thMissionUpdate); thMissionMapper.updateById(thMissionUpdate);
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "任务分析失败!");

status = TaskStatusEnum.FAIL.getCode();
// throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "任务分析失败!");
} }
updateEmergencyMissionStatusService.updateStatus(thMission, status);
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) { } else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) {
// 机场飞行完成,立即修改任务状态为已完成 // 机场飞行完成,立即修改任务状态为已完成
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
} }
thMissionMapper.updateById(thMissionUpdate); thMissionMapper.updateById(thMissionUpdate);


status = TaskStatusEnum.COMPLETE.getCode();
updateEmergencyMissionStatusService.updateStatus(thMission, status);

//硬件停止后,停止AI分析 //硬件停止后,停止AI分析
this.stopAI(missionStatusRequest, thMission); this.stopAI(missionStatusRequest, thMission);
} else { } else {
throw new ServiceException(ServiceExceptionEnum.TASK_NOT_STATUS); throw new ServiceException(ServiceExceptionEnum.TASK_NOT_STATUS);
} }

updateEmergencyMissionStatusService.updateStatus(thMission);

return true; return true;
} }



+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallBackService.java Parādīt failu

log.info("DSP分析,修改分析状态失败"); log.info("DSP分析,修改分析状态失败");
} }


updateEmergencyMissionStatusService.updateStatus(mission);
updateEmergencyMissionStatusService.updateStatus(mission, null);


return JsonResult.success(); return JsonResult.success();
} }

Notiek ielāde…
Atcelt
Saglabāt