Ver código fonte

修改应急任务数据

tags/v1.2.0^2
wanjing 1 ano atrás
pai
commit
9842a4f6a7
2 arquivos alterados com 8 adições e 6 exclusões
  1. +1
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/UpdateEmergencyMissionStatusService.java
  2. +7
    -4
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/AirportCallBackUpdateStatusService.java

+ 1
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/UpdateEmergencyMissionStatusService.java Ver arquivo

@@ -6,7 +6,6 @@ import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.enums.AccidentTaskEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.ThMissionMapper;
import com.tuoheng.admin.mapper.WarningRecordMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -46,7 +45,7 @@ public class UpdateEmergencyMissionStatusService {
ThMission mission = thMissionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, oldMission.getId())
.eq(ThMission::getMark, MarkEnum.VALID.getCode()));
emergencyMission.setStatus(mission.getStatus());
emergencyMission.setStatus(oldMission.getStatus());
emergencyMission.setPlayUrl(mission.getPlayUrl());
emergencyMission.setAiplayUrl(mission.getAiplayUrl());
emergencyMission.setPullUrl(mission.getAipullUrl());

+ 7
- 4
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/AirportCallBackUpdateStatusService.java Ver arquivo

@@ -64,15 +64,20 @@ public class AirportCallBackUpdateStatusService {
// ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.WAIT.getCode());
Assert.notNull(thMission, "飞行任务不能为空!");
ThMission thMissionUpdate = setStatus(missionStatusRequest, thMission, AirPortTaskStatusEnum.FLIGHT);
//开始分析
try {
JSONObject jsonObject = startAI(missionStatusRequest);
//开始分析
JSONObject jsonObject = this.startAI(missionStatusRequest);
thMissionUpdate.setRequestId(jsonObject.getJSONObject("data").getString("requestId"));
thMissionUpdate.setAipullUrl(jsonObject.getJSONObject("data").getString("aipullUrl"));
thMissionUpdate.setAipushUrl(jsonObject.getJSONObject("data").getString("aipushUrl"));
thMissionUpdate.setPlayUrl(missionStatusRequest.getPlayUrl());
thMissionUpdate.setAiplayUrl(jsonObject.getJSONObject("data").getString("aiplayUrl"));
thMissionUpdate.setAnalyseStatus(AiAnalyseStatusEnum.WAITING.getCode());

log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate));
thMissionMapper.updateById(thMissionUpdate);

thMission.setStatus(TaskStatusEnum.FLIGHT.getCode());
} catch (ServiceException e) {
//如果调用DSP失败就直接失败!
log.error("调用DSP数据失败:{}", e.getMessage());
@@ -80,8 +85,6 @@ public class AirportCallBackUpdateStatusService {
thMissionMapper.updateById(thMissionUpdate);
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "任务分析失败!");
}
log.info("修改飞行状态:{}", JSONObject.toJSONString(thMissionUpdate));
thMissionMapper.updateById(thMissionUpdate);
} else if (AirPortTaskStatusEnum.WAIT.getCode() == missionStatusRequest.getStatus()) {
// 机场飞行完成,立即修改任务状态为已完成
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());

Carregando…
Cancelar
Salvar