瀏覽代碼

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
wanjing 1 年之前
父節點
當前提交
c539943cf7
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/UpdateEmergencyMissionStatusService.java
  2. +8
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/AirportCallBackUpdateStatusService.java

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/UpdateEmergencyMissionStatusService.java 查看文件

@@ -23,7 +23,7 @@ public class UpdateEmergencyMissionStatusService {
* @param oldMission
*/
public void updateStatus(ThMission oldMission, Integer status) {
log.info("进入修改应急任务数据");
log.info("进入修改应急任务数据, type:{}, emergencyDataMissionId:{}, status={}", oldMission.getType()), oldMission.getEmergencyDataMissionId(), status);
if (1 == oldMission.getType()) {
return;
}

+ 8
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/AirportCallBackUpdateStatusService.java 查看文件

@@ -62,11 +62,13 @@ public class AirportCallBackUpdateStatusService {

Integer status = null;
if (AirPortTaskStatusEnum.FLIGHT.getCode() == missionStatusRequest.getStatus()) {
log.info("被硬件调用,存任务状态:执行中");
// ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode());
Assert.notNull(thMission, "飞行任务不能为空!");
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission, AirPortTaskStatusEnum.FLIGHT);
try {
//开始分析
log.info("被硬件调用,存任务状态:开始分析");
JSONObject jsonObject = this.startAI(missionStatusRequest);
thMissionUpdate.setRequestId(jsonObject.getJSONObject("data").getString("requestId"));
thMissionUpdate.setAipullUrl(jsonObject.getJSONObject("data").getString("aipullUrl"));
@@ -75,7 +77,7 @@ public class AirportCallBackUpdateStatusService {
thMissionUpdate.setAiplayUrl(jsonObject.getJSONObject("data").getString("aiplayUrl"));
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.WAITING.getCode());

log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate));
log.info("被硬件调用,原任务状态:status:{}", thMission.getStatus());
thMissionMapper.updateById(thMissionUpdate);

status = TaskStatusEnum.FLIGHT.getCode();
@@ -90,6 +92,7 @@ public class AirportCallBackUpdateStatusService {
}
updateEmergencyMissionStatusService.updateStatus(thMission, status);
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) {
log.info("被硬件调用,存任务状态:已完成");
// 机场飞行完成,立即修改任务状态为已完成
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(Integer.parseInt(missionStatusRequest.getRequestId()));
@@ -103,6 +106,8 @@ public class AirportCallBackUpdateStatusService {
thMissionUpdate.setWeather("");
log.info("获取天气信息失败,请重试");
}

log.info("被硬件调用,任务状态:status:{}", thMissionUpdate.getStatus());
thMissionMapper.updateById(thMissionUpdate);

status = TaskStatusEnum.COMPLETE.getCode();
@@ -119,6 +124,7 @@ public class AirportCallBackUpdateStatusService {
}

private JSONObject startAI(MissionStatusRequest missionStatusRequest) throws ServiceException {
log.info("开始AI分析");
//任务调用完成之后,调用发送通道,请求DSP需要分析
//调用DSP接口
JSONObject request = new JSONObject();
@@ -159,6 +165,7 @@ public class AirportCallBackUpdateStatusService {
}

private Boolean stopAI(MissionStatusRequest missionStatusRequest, ThMission thMission) {
log.info("停止AI分析");
Assert.notNull(thMission, "飞行任务不能为空!");
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(thMission.getId());

Loading…
取消
儲存