Browse Source

修改获取应急任务列表代码

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
7d2ac13b6d
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryEmergencyListService.java

+ 7
- 5
tuoheng-admin/src/main/java/com/tuoheng/admin/service/mission/query/QueryEmergencyListService.java View File

Map<Integer, AirPortStatusVO> airPortStatusVOMap = getAirPortStatusVOMap(missionList); Map<Integer, AirPortStatusVO> airPortStatusVOMap = getAirPortStatusVOMap(missionList);
AirPortStatusVO airPortStatusVO; AirPortStatusVO airPortStatusVO;
for (EmergencyMissionVO emergencyMissionVO : emergencyMissionVOList) { for (EmergencyMissionVO emergencyMissionVO : emergencyMissionVOList) {
airPortStatusVO = airPortStatusVOMap.get(emergencyMissionVO.getAirportId());
if (ObjectUtil.isNotNull(airPortStatusVO)) {
emergencyMissionVO.setAirportStatus(airPortStatusVO.getMsg());
if (ObjectUtil.isNotNull(airPortStatusVOMap)) {
airPortStatusVO = airPortStatusVOMap.get(emergencyMissionVO.getAirportId());
if (ObjectUtil.isNotNull(airPortStatusVO)) {
emergencyMissionVO.setAirportStatus(airPortStatusVO.getMsg());
}
} }
} }
return JsonResult.success(missionList);
return JsonResult.success(emergencyMissionVOList);
} }


/** /**
String airPortStatusStr = HttpUtils.sendGet(url, param); String airPortStatusStr = HttpUtils.sendGet(url, param);
if (StringUtils.isEmpty(airPortStatusStr)) { if (StringUtils.isEmpty(airPortStatusStr)) {
log.info("调用机场平台,查询飞行状态:机场接口返回数据为空,查询飞行状态失败"); log.info("调用机场平台,查询飞行状态:机场接口返回数据为空,查询飞行状态失败");
throw new ServiceException("机场接口返回数据为空,查询飞行状态失败");
return null;
} }
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStatusStr, JsonResult.class); JsonResult jsonResult = JacksonUtil.json2pojo(airPortStatusStr, JsonResult.class);



Loading…
Cancel
Save