Selaa lähdekoodia

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.2.0^2
wanjing 1 vuosi sitten
vanhempi
commit
3484df52df
1 muutettua tiedostoa jossa 14 lisäystä ja 0 poistoa
  1. +14
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java

+ 14
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateWaittStatusService.java Näytä tiedosto

@@ -101,12 +101,24 @@ public class UpdateWaittStatusService {
}

public JsonResult getWeather(String airportUrl, Integer airportId) {
log.info("获取天气信息begin");
String url = airportUrl + SystemConstant.API_AIRPORT_GET_WEATHER;
String param = "airportId=" + airportId;

log.info("获取天气信息, url={}", url);
log.info("获取天气信息, param={}", param);

String weatherStr = HttpUtils.sendGet(url, param);

log.info("获取天气信息, weatherStr1={}", weatherStr);

JsonResult jsonResult;
try {
log.info("获取天气信息, weatherStr2={}", weatherStr);
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);
@@ -117,7 +129,9 @@ public class UpdateWaittStatusService {
log.info("获取天气信息,返回数据为空");
return JsonResult.success(new AirWeatherVO());
}
log.info("获取天气信息, jsonResult.getData={}", jsonResult.getData());
AirWeatherVO airWeatherVO = JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData()), AirWeatherVO.class);
log.info("获取天气信息,airWeatherVO={}", airWeatherVO);
return JsonResult.success(airWeatherVO);
} catch (Exception e) {
log.info("获取天气信息异常,url={}", url);

Loading…
Peruuta
Tallenna