Sfoglia il codice sorgente

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
wanjing 1 anno fa
parent
commit
1714c04065
3 ha cambiato i file con 16 aggiunte e 8 eliminazioni
  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 Vedi File

@@ -22,7 +22,7 @@ public class UpdateEmergencyMissionStatusService {
*
* @param oldMission
*/
public void updateStatus(ThMission oldMission) {
public void updateStatus(ThMission oldMission, Integer status) {
log.info("进入修改应急任务数据");
if (ObjectUtil.isNull(oldMission.getAccidentTask())) {
return;
@@ -45,7 +45,11 @@ public class UpdateEmergencyMissionStatusService {
ThMission mission = thMissionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, oldMission.getId())
.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.setAiplayUrl(mission.getAiplayUrl());
emergencyMission.setPullUrl(mission.getAipullUrl());

+ 9
- 5
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/AirportCallBackUpdateStatusService.java Vedi File

@@ -60,6 +60,7 @@ public class AirportCallBackUpdateStatusService {
.eq(ThMission::getId, missionStatusRequest.getRequestId())
.eq(ThMission::getMark, MarkEnum.VALID.getCode()));

Integer status = null;
if (AirPortTaskStatusEnum.FLIGHT.getCode() == missionStatusRequest.getStatus()) {
// ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode());
Assert.notNull(thMission, "飞行任务不能为空!");
@@ -77,14 +78,17 @@ public class AirportCallBackUpdateStatusService {
log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate));
thMissionMapper.updateById(thMissionUpdate);

thMission.setStatus(TaskStatusEnum.FLIGHT.getCode());
status = TaskStatusEnum.FLIGHT.getCode();
} catch (ServiceException e) {
//如果调用DSP失败就直接失败!
log.error("调用DSP数据失败:{}", e.getMessage());
thMissionUpdate.setStatus(TaskStatusEnum.FAIL.getCode());
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()) {
// 机场飞行完成,立即修改任务状态为已完成
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
@@ -101,14 +105,14 @@ public class AirportCallBackUpdateStatusService {
}
thMissionMapper.updateById(thMissionUpdate);

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

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

updateEmergencyMissionStatusService.updateStatus(thMission);

return true;
}


+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallBackService.java Vedi File

@@ -65,7 +65,7 @@ public class DspCallBackService {
log.info("DSP分析,修改分析状态失败");
}

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

return JsonResult.success();
}

Loading…
Annulla
Salva