|
|
@@ -1,6 +1,7 @@ |
|
|
|
package com.tuoheng.admin.tzhl.service.airport; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.tuoheng.admin.constant.SystemConstant; |
|
|
|
import com.tuoheng.admin.dto.GetAirportListDto; |
|
|
@@ -20,6 +21,8 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.client.RestClientException; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取机场列表 |
|
|
|
* @Author ChengWang |
|
|
@@ -67,15 +70,15 @@ public class TZHLGetAirportListService { |
|
|
|
log.error("请求获取机场列表" + response.getBody()); |
|
|
|
return JsonResult.error(response.getBody().getMsg()); |
|
|
|
} |
|
|
|
if(response.getBody().getData() == null){ |
|
|
|
return JsonResult.error("查询机场列表数据为空"); |
|
|
|
} |
|
|
|
log.info("查询机场列表数据成功,response={}", response); |
|
|
|
|
|
|
|
String body = JSONObject.toJSONString(response.getBody().getData()); |
|
|
|
|
|
|
|
GetAirportListDto getAirportListDto = JSONObject.parseObject(response.getBody().getData().toString(), GetAirportListDto.class); |
|
|
|
if(ObjectUtil.isNull(getAirportListDto)){ |
|
|
|
List<GetAirportListDto> getAirportListDtoLists = JSON.parseArray(JSON.parse(body).toString(), GetAirportListDto.class); |
|
|
|
if(ObjectUtil.isNull(getAirportListDtoLists)){ |
|
|
|
return JsonResult.error("查询机场列表数据为空"); |
|
|
|
} |
|
|
|
return JsonResult.success(getAirportListDto); |
|
|
|
return JsonResult.success(getAirportListDtoLists); |
|
|
|
} |
|
|
|
|
|
|
|
private JsonResult check(String token) { |