Ver código fonte

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/v1.2.0^2
wanjing 1 ano atrás
pai
commit
3484df52df
1 arquivos alterados com 14 adições e 0 exclusões
  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 Ver arquivo

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

Carregando…
Cancelar
Salvar