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