|
|
@@ -222,11 +222,9 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, |
|
|
|
String url = CommonConfig.airportURL + "/api/airportInterface/getWeather"; |
|
|
|
String param = "airportId=" + airportId; |
|
|
|
String weatherStr = HttpUtils.sendGet(url, param); |
|
|
|
log.info("获取天气信息,weatherStr={}", weatherStr); |
|
|
|
JsonResult jsonResult; |
|
|
|
try { |
|
|
|
jsonResult = JacksonUtil.json2pojo(weatherStr, JsonResult.class); |
|
|
|
log.info("获取天气信息,jsonResult={}", jsonResult); |
|
|
|
if (ObjectUtil.isEmpty(jsonResult) || Objects.requireNonNull(jsonResult).getCode() != 0) { |
|
|
|
log.info("获取天气信息失败,返回为空或code不为0"); |
|
|
|
log.info("获取天气信息失败,url={}", url); |
|
|
@@ -237,7 +235,10 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper, |
|
|
|
log.info("获取天气信息,返回数据为空"); |
|
|
|
return new AirWeatherVO(); |
|
|
|
} |
|
|
|
return JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData()), AirWeatherVO.class); |
|
|
|
log.info("获取天气信息,jsonResult Data={}", jsonResult.getData()); |
|
|
|
AirWeatherVO airWeatherVO = JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData()), AirWeatherVO.class); |
|
|
|
log.info("获取天气信息,airWeatherVO={}", airWeatherVO); |
|
|
|
return airWeatherVO; |
|
|
|
} catch (Exception e) { |
|
|
|
log.info("获取天气信息异常,url={}", url); |
|
|
|
log.info("获取天气信息异常,param={}", param); |