Browse Source

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
9e7d541dc2
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java

+ 4
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java View File

@@ -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);

Loading…
Cancel
Save