Browse Source

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
5dabd887cd
1 changed files with 12 additions and 11 deletions
  1. +12
    -11
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java

+ 12
- 11
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/MissionServiceImpl.java View File

log.info("修改飞行状态:{}",JSONObject.toJSONString(thMissionUpdate)); log.info("修改飞行状态:{}",JSONObject.toJSONString(thMissionUpdate));
return thMissionMapper.updateById(thMissionUpdate) > 0; return thMissionMapper.updateById(thMissionUpdate) > 0;
}else if(AirPortTaskStatusEnum.WAIT.getCode()==missionStatusRequest.getStatus()){ }else if(AirPortTaskStatusEnum.WAIT.getCode()==missionStatusRequest.getStatus()){
// 机场飞行完成,立即修改任务状态为已完成
// 机场飞行完成,立即修改任务状态为已完成,设置天气
ThMission thMission = thMissionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, missionStatusRequest.getRequestId())
.eq(ThMission::getMark, MarkEnum.VALID.getCode()));
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());
thMissionUpdate.setId(Integer.parseInt(missionStatusRequest.getRequestId())); thMissionUpdate.setId(Integer.parseInt(missionStatusRequest.getRequestId()));
thMissionUpdate.setStatus(TaskStatusEnum.COMPLETE.getCode()); thMissionUpdate.setStatus(TaskStatusEnum.COMPLETE.getCode());
thMissionUpdate.setExecutionEndTime(new Date()); thMissionUpdate.setExecutionEndTime(new Date());
try {
AirWeatherVO weather = inspectionService.getWeather(thMission.getAirportId());
String weatherStr = WeatherUtil.getWeather(weather);
thMissionUpdate.setWeather(weatherStr);
} catch (Exception e){
thMissionUpdate.setWeather("");
log.info("获取天气信息失败,请重试");
}
thMissionMapper.updateById(thMissionUpdate); thMissionMapper.updateById(thMissionUpdate);


//硬件停止后,停止AI分析 //硬件停止后,停止AI分析
ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.FLIGHT.getCode()); ThMission thMission = getRecentlyRecord(missionStatusRequest,TaskStatusEnum.FLIGHT.getCode());
Assert.notNull(thMission, "飞行任务不能为空!"); Assert.notNull(thMission, "飞行任务不能为空!");
ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode()); ThMission thMissionUpdate = new ThMission(UpdateOrCreateEnum.UPDATE.getCode());

thMissionUpdate.setId(thMission.getId()); thMissionUpdate.setId(thMission.getId());
thMissionUpdate.setMileage(missionStatusRequest.getMileage()); thMissionUpdate.setMileage(missionStatusRequest.getMileage());
boolean result=false; boolean result=false;
try {
AirWeatherVO weather = inspectionService.getWeather(thMission.getAirportId());
String weatherStr = WeatherUtil.getWeather(weather);
thMissionUpdate.setWeather(weatherStr);
}catch (Exception e){
thMissionUpdate.setWeather("");
log.info("获取天气信息失败,请重试");
}

//任务调用完成之后,调用发送通道,请求DSP关闭请求 //任务调用完成之后,调用发送通道,请求DSP关闭请求
//调用DSP接口 //调用DSP接口
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();

Loading…
Cancel
Save