作者 王勇

新舱单服务,基本定型

... ... @@ -2,6 +2,7 @@ package com.sunyo.wlpt.cgonms.provide.controller;
import com.sunyo.wlpt.cgonms.provide.domain.*;
import com.sunyo.wlpt.cgonms.provide.feign.GetCgoAsmFeign;
import com.sunyo.wlpt.cgonms.provide.feign.GetTransportFeign;
import com.sunyo.wlpt.cgonms.provide.service.*;
import org.springframework.web.bind.annotation.*;
... ... @@ -37,6 +38,9 @@ public class CgoNmsController {
@Resource
private GetCgoAsmFeign getCgoAsmFeign;
@Resource
private GetTransportFeign getTransportFeign;
/**
* 根据航班日期获取出新舱单服务中的响应数据
*
... ... @@ -114,8 +118,10 @@ public class CgoNmsController {
}
}
System.out.println("新舱单服务,获取完毕");
List<ResultExitData> info = getCgoAsmFeign.getInfo(resultList);
System.out.println("代理人服务,获取完毕");
System.out.println("代理人服务,开始获取");
List<ResultExitData> asmInfo = getCgoAsmFeign.getInfo(resultList);
System.out.println("运输工具服务,开始获取");
List<ResultExitData> info = getTransportFeign.getInfo(asmInfo);
return info;
}
}
... ...
... ... @@ -38,7 +38,7 @@ public class ResultExitData implements Serializable {
/**
* 4.航班日期
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date flightDate;
/**
... ... @@ -122,4 +122,37 @@ public class ResultExitData implements Serializable {
* 20.一级类名称
*/
private String typeName;
/**
* 21.航空公司
*/
private String airCompany;
/**
* 22.机型
*/
private String cfTp;
/**
* 23.机号
*/
private String cfNo;
/**
* 24.航班(起飞)时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date flightTime;
/**
* 25.航班计划日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date flightPlanDate;
/**
* 26.航班计划时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date flightPlanTime;
}
... ...
package com.sunyo.wlpt.cgonms.provide.feign;
/**
* @author 子诚
* Description:
* 时间:2020/5/22 14:30
*/
import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@Component
@FeignClient(value = "transport-provide", fallback = GetTransportFeignHystrix.class)
public interface GetTransportFeign {
@PutMapping("transport/getInfo")
public List<ResultExitData> getInfo(@RequestBody List<ResultExitData> resultList);
}
... ...
package com.sunyo.wlpt.cgonms.provide.feign;
import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData;
import java.util.List;
/**
* @author 子诚
* Description:
* 时间:2020/5/22 14:32
*/
public class GetTransportFeignHystrix implements GetTransportFeign {
@Override
public List<ResultExitData> getInfo(List<ResultExitData> resultList) {
System.out.println("与“运输工具”服务断开连接,获取“运输工具”服务信息失败");
return null;
}
}
... ...
... ... @@ -66,8 +66,8 @@ feign:
client:
config:
default:
connectTimeout: 300000 # feign 的超时设置
readTimeout: 180000
connectTimeout: 60000000 # feign 的超时设置
readTimeout: 60000000
# boot admin
management:
endpoints:
... ...