Przeglądaj źródła

Merge branch 'release' of gitadmin/tuoheng_air_monitor into master

tags/v1.0.2
wanjing 1 rok temu
rodzic
commit
d8f731b67e
1 zmienionych plików z 9 dodań i 6 usunięć
  1. +9
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/GetAirportDetailService.java

+ 9
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/airport/GetAirportDetailService.java Wyświetl plik

@@ -1,6 +1,5 @@
package com.tuoheng.admin.service.third.airport;

import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.tuoheng.admin.constant.SystemConstant;
import com.tuoheng.admin.entity.dto.AirportDetailDto;
@@ -13,7 +12,6 @@ import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


import java.util.List;
import java.util.Objects;

@@ -30,8 +28,13 @@ public class GetAirportDetailService {
String param = "airportId=" + airportId;
String result = HttpUtils.sendGet(url, param);
JsonResult jsonResult = JacksonUtil.json2pojo(result, JsonResult.class);
if (0 != jsonResult.getCode()) {
log.info("调用机场平台,获取天气信息失败,{}", jsonResult);
return JsonResult.error(jsonResult.getMsg());
}
AirportDetailDto vo = new AirportDetailDto();
JSONObject dataObject = (JSONObject) JSONObject.toJSON(jsonResult.getData());

log.info("响应信息:{}", dataObject.toJSONString());
JSONObject wthJson = dataObject.getJSONObject("WTH");
if (Objects.nonNull(wthJson)) {
@@ -59,13 +62,13 @@ public class GetAirportDetailService {
mountJson.getString("searchlightName")
);
}
if(Objects.nonNull(mountJson)){
if (Objects.nonNull(mountJson)) {
String strJson = mountJson.getString("mountEquipmentList");

log.info("参数信息,strJson={}",strJson);
if(StringUtils.isNotEmpty(strJson)){
log.info("参数信息,strJson={}", strJson);
if (StringUtils.isNotEmpty(strJson)) {
String mountEquipmentList = strJson;
if(StringUtils.isNotEmpty(mountEquipmentList)){
if (StringUtils.isNotEmpty(mountEquipmentList)) {
List<MountEquipment> mountEquipments = JSONObject.parseArray(mountEquipmentList, MountEquipment.class);
vo.setMountEquipmentList(mountEquipments);
}

Ładowanie…
Anuluj
Zapisz