|
|
|
|
|
|
|
|
package com.tuoheng.admin.tzhl.service.airport; |
|
|
package com.tuoheng.admin.tzhl.service.airport; |
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.tuoheng.admin.constant.SystemConstant; |
|
|
import com.tuoheng.admin.constant.SystemConstant; |
|
|
import com.tuoheng.admin.dto.GetAirportListDto; |
|
|
import com.tuoheng.admin.dto.GetAirportListDto; |
|
|
|
|
|
|
|
|
import org.springframework.web.client.RestClientException; |
|
|
import org.springframework.web.client.RestClientException; |
|
|
import org.springframework.web.client.RestTemplate; |
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取机场列表 |
|
|
* 获取机场列表 |
|
|
* @Author ChengWang |
|
|
* @Author ChengWang |
|
|
|
|
|
|
|
|
log.error("请求获取机场列表" + response.getBody()); |
|
|
log.error("请求获取机场列表" + response.getBody()); |
|
|
return JsonResult.error(response.getBody().getMsg()); |
|
|
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.error("查询机场列表数据为空"); |
|
|
} |
|
|
} |
|
|
return JsonResult.success(getAirportListDto); |
|
|
|
|
|
|
|
|
return JsonResult.success(getAirportListDtoLists); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private JsonResult check(String token) { |
|
|
private JsonResult check(String token) { |