|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
//String---> JsonResult |
|
|
//String---> JsonResult |
|
|
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStatusStr, JsonResult.class); |
|
|
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStatusStr, JsonResult.class); |
|
|
List<AirPortStatusVO> airPortStatusVOList = (List<AirPortStatusVO>) jsonResult.getData(); |
|
|
|
|
|
// List<AirPortStatusVO> airPortStatusVOList = com.alibaba.fastjson.JSONObject.parseArray(JSONObject.toJSONString(jsonResult.getData()), AirPortStatusVO.class); |
|
|
|
|
|
|
|
|
if(ObjectUtil.isEmpty(jsonResult) || !ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0){ |
|
|
|
|
|
log.info("获取机场列表为空"); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//List<AirPortStatusVO> airPortStatusVOList = (List<AirPortStatusVO>) jsonResult.getData(); |
|
|
|
|
|
List<AirPortStatusVO> airPortStatusVOList = com.alibaba.fastjson.JSONObject.parseArray(JSONObject.toJSONString(jsonResult.getData()), AirPortStatusVO.class); |
|
|
Map<Integer,AirPortStatusVO> map = new HashMap<>(); |
|
|
Map<Integer,AirPortStatusVO> map = new HashMap<>(); |
|
|
for (AirPortStatusVO airPortStatusVO : airPortStatusVOList) { |
|
|
for (AirPortStatusVO airPortStatusVO : airPortStatusVOList) { |
|
|
map.put(airPortStatusVO.getAirportId(),airPortStatusVO); |
|
|
map.put(airPortStatusVO.getAirportId(),airPortStatusVO); |