Commit b5f5d2fe authored by tangwei's avatar tangwei

对接航班号

parent e4010526
package com.yeejoin.amos.boot.module.common.api.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
/**
* iot feign
*
* @author Dell
*/
@FeignClient(name = "AMOS-API-IOT-PLATFORM", path = "iot", configuration = {MultipartSupportConfig.class})
public interface IotFeignClient {
/**
* 根据航班号查询航班信息
**/
@RequestMapping(value = "/v1/iot/DynamicFlightInfo/{flightNo}", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getDynamicFlightInfo(@PathVariable String flightNo);
}
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto; import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft; import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
...@@ -48,7 +49,8 @@ public class AircraftController extends BaseController { ...@@ -48,7 +49,8 @@ public class AircraftController extends BaseController {
private AircraftServiceImpl aircraftServiceImpl; private AircraftServiceImpl aircraftServiceImpl;
@Autowired @Autowired
DataSourcesImpl dataSourcesImpl; DataSourcesImpl dataSourcesImpl;
@Autowired
IotFeignClient iotFeignClient;
/** /**
* 新增航空器信息 * 新增航空器信息
* *
...@@ -159,8 +161,6 @@ public class AircraftController extends BaseController { ...@@ -159,8 +161,6 @@ public class AircraftController extends BaseController {
@GetMapping(value = "/getAircraftNum") @GetMapping(value = "/getAircraftNum")
@ApiOperation(httpMethod = "GET", value = "获取24小时内的航班号", notes = "获取24小时内的航班号") @ApiOperation(httpMethod = "GET", value = "获取24小时内的航班号", notes = "获取24小时内的航班号")
public ResponseModel<List<Map<String, Object>>> getAircraftNum() { public ResponseModel<List<Map<String, Object>>> getAircraftNum() {
List<Map<String, Object>> list= new ArrayList<>(); List<Map<String, Object>> list= new ArrayList<>();
Map<String, Object> map=new HashedMap(); Map<String, Object> map=new HashedMap();
Map<String, Object> map1=new HashedMap(); Map<String, Object> map1=new HashedMap();
...@@ -181,12 +181,19 @@ public class AircraftController extends BaseController { ...@@ -181,12 +181,19 @@ public class AircraftController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "通过航班号,查询最新的航班信息", notes = "通过航班号,查询最新的航班信息") @ApiOperation(httpMethod = "GET", value = "通过航班号,查询最新的航班信息", notes = "通过航班号,查询最新的航班信息")
public ResponseModel<Map<String, Object>> getAircraftDetails(@PathVariable String num) { public ResponseModel<Map<String, Object>> getAircraftDetails(@PathVariable String num) {
Map<String, Object> map1=new HashedMap(); Map<String, Object> map1=new HashedMap();
map1.put("aircraftModel", "型号1");
map1.put("landingTime", new Date());
map1.put("fuelQuantity", "12"); ResponseModel<Map<String, Object>> dataModel= iotFeignClient.getDynamicFlightInfo(num);
map1.put("passengerCapacity", "测试2"); if(dataModel!=null) {
Map<String, Object> map= dataModel.getResult();
if(map!=null) {
map1.put("aircraftModel", map.get("aircraftType"));
map1.put("landingTime", map.get("sta"));
// map1.put("fuelQuantity", map.get(""));
map1.put("passengerCapacity", map.get("psgNumTotal"));
}
}
return ResponseHelper.buildResponse(map1); return ResponseHelper.buildResponse(map1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment