正在显示
10 个修改的文件
包含
110 行增加
和
24 行删除
@@ -60,6 +60,8 @@ public class CgoNmsController { | @@ -60,6 +60,8 @@ public class CgoNmsController { | ||
60 | ResultExitData resultExitData = new ResultExitData(); | 60 | ResultExitData resultExitData = new ResultExitData(); |
61 | resultExitData.setFlightDate(flightDate); | 61 | resultExitData.setFlightDate(flightDate); |
62 | resultExitData.setFlightNo(flightNo); | 62 | resultExitData.setFlightNo(flightNo); |
63 | + System.out.println("开始时间:" + new Date()); | ||
64 | + System.out.println("出港数据,开始获取"); | ||
63 | /** | 65 | /** |
64 | * 1.先获取出 新舱单——理货信息 中的相应数据 | 66 | * 1.先获取出 新舱单——理货信息 中的相应数据 |
65 | * | 67 | * |
@@ -67,8 +69,8 @@ public class CgoNmsController { | @@ -67,8 +69,8 @@ public class CgoNmsController { | ||
67 | * 航段(在数据库里面为null,所以只能 起始站 > 目的站 ) | 69 | * 航段(在数据库里面为null,所以只能 起始站 > 目的站 ) |
68 | * 理货件数; 理货重量 | 70 | * 理货件数; 理货重量 |
69 | */ | 71 | */ |
70 | - | ||
71 | List<ResultExitData> resultList = resultExitDataService.getResultExitDataInfo(resultExitData); | 72 | List<ResultExitData> resultList = resultExitDataService.getResultExitDataInfo(resultExitData); |
73 | + System.out.println("长度为:" + resultList.size()); | ||
72 | for (int i = 0, resultSize = resultList.size(); i < resultSize; i++) { | 74 | for (int i = 0, resultSize = resultList.size(); i < resultSize; i++) { |
73 | ResultExitData result = resultList.get(i); | 75 | ResultExitData result = resultList.get(i); |
74 | //设置航班 | 76 | //设置航班 |
@@ -121,14 +123,54 @@ public class CgoNmsController { | @@ -121,14 +123,54 @@ public class CgoNmsController { | ||
121 | //获取目的货物目的站 | 123 | //获取目的货物目的站 |
122 | result.setAimStation(pm.get(0).getDestinationStation()); | 124 | result.setAimStation(pm.get(0).getDestinationStation()); |
123 | } | 125 | } |
126 | + /** | ||
127 | + * 获取数据仓库的对应数据 | ||
128 | + */ | ||
129 | +// if (result.getWaybillNoMaster() != null && result.getWaybillNoMaster() != "") {} | ||
130 | + ResultExitData dataWareHouseInfo = getDataWareHouseFeign.getInfo(result.getWaybillNoMaster()); | ||
131 | + //设置体积 | ||
132 | + result.setVolumeMeasure(dataWareHouseInfo.getVolumeMeasure()); | ||
133 | + //设置计费重量 | ||
134 | + result.setTotalGrossWeightMeasure(dataWareHouseInfo.getTotalGrossWeightMeasure()); | ||
135 | + | ||
136 | + | ||
137 | + /** | ||
138 | + * 获取运输工具的对应数据 | ||
139 | + */ | ||
140 | + ResultExitData transportInfo = getTransportFeign.getInfo(result.getFlightNo(), result.getFlightDate()); | ||
141 | + //设置航班公司 | ||
142 | + result.setAirCompany(transportInfo.getAirCompany()); | ||
143 | + //设置机型 | ||
144 | + result.setCfTp(transportInfo.getCfTp()); | ||
145 | + //设置机号 | ||
146 | + result.setCfNo(transportInfo.getCfNo()); | ||
147 | + //设置航班计划日期 | ||
148 | + result.setFlightPlanDate(transportInfo.getFlightPlanDate()); | ||
149 | + //设置航班(起飞)时间 | ||
150 | + result.setFlightTime(transportInfo.getFlightTime()); | ||
151 | + //设置航班计划时间 | ||
152 | + result.setFlightPlanTime(transportInfo.getFlightPlanTime()); | ||
153 | + | ||
154 | + /** | ||
155 | + * 获取代理人的相关数据 | ||
156 | + */ | ||
157 | +// if (result.getWaybillNoMaster() != null && result.getWaybillNoMaster() != "") { } | ||
158 | + ResultExitData asmInfo = getCgoAsmFeign.getInfo(result.getWaybillNoMaster()); | ||
159 | + //设置代理人全称 | ||
160 | + result.setFullName(asmInfo.getFullName()); | ||
161 | + //设置货主类型 | ||
162 | + result.setTheShipperType(asmInfo.getTheShipperType()); | ||
163 | + //设置品名 | ||
164 | + result.setSdCargoName(asmInfo.getSdCargoName()); | ||
165 | + //设置二级类名称 | ||
166 | + result.setTwoTypeName(asmInfo.getTwoTypeName()); | ||
167 | + //设置一级类名称 | ||
168 | + result.setTypeName(asmInfo.getTypeName()); | ||
169 | + | ||
170 | + System.out.println("第" + i + "条,获取完毕"); | ||
124 | } | 171 | } |
125 | - System.out.println("代理人服务,开始获取"); | ||
126 | - List<ResultExitData> asmInfo = getCgoAsmFeign.getInfo(resultList); | ||
127 | - System.out.println("运输工具服务,开始获取"); | ||
128 | - List<ResultExitData> transportInfo = getTransportFeign.getInfo(asmInfo); | ||
129 | - System.out.println("数据仓库服务,开始获取"); | ||
130 | - List<ResultExitData> info = getDataWareHouseFeign.getInfo(transportInfo); | ||
131 | - System.out.println("出港基本数据,获取完毕"); | ||
132 | - return info; | 172 | + System.out.println("结束时间:" + new Date()); |
173 | + System.out.println("出港信息,获取完毕"); | ||
174 | + return resultList; | ||
133 | } | 175 | } |
134 | } | 176 | } |
@@ -97,11 +97,13 @@ public class ResultExitData implements Serializable { | @@ -97,11 +97,13 @@ public class ResultExitData implements Serializable { | ||
97 | private String areaDescChn; | 97 | private String areaDescChn; |
98 | 98 | ||
99 | /** | 99 | /** |
100 | + * 代理人服务 | ||
100 | * 16.代理人全称 | 101 | * 16.代理人全称 |
101 | */ | 102 | */ |
102 | private String fullName; | 103 | private String fullName; |
103 | 104 | ||
104 | /** | 105 | /** |
106 | + * 代理人服务 | ||
105 | * 17.货主类型 | 107 | * 17.货主类型 |
106 | * 111 = 发货代理 | 108 | * 111 = 发货代理 |
107 | * 222 = 订舱代理 | 109 | * 222 = 订舱代理 |
@@ -110,59 +112,70 @@ public class ResultExitData implements Serializable { | @@ -110,59 +112,70 @@ public class ResultExitData implements Serializable { | ||
110 | private String theShipperType; | 112 | private String theShipperType; |
111 | 113 | ||
112 | /** | 114 | /** |
115 | + * 代理人服务 | ||
113 | * 18.品名 | 116 | * 18.品名 |
114 | */ | 117 | */ |
115 | private String sdCargoName; | 118 | private String sdCargoName; |
116 | 119 | ||
117 | /** | 120 | /** |
121 | + * 代理人服务 | ||
118 | * 19.二级类名称 | 122 | * 19.二级类名称 |
119 | */ | 123 | */ |
120 | private String twoTypeName; | 124 | private String twoTypeName; |
121 | 125 | ||
122 | /** | 126 | /** |
127 | + * 代理人服务 | ||
123 | * 20.一级类名称 | 128 | * 20.一级类名称 |
124 | */ | 129 | */ |
125 | private String typeName; | 130 | private String typeName; |
126 | 131 | ||
127 | /** | 132 | /** |
133 | + * 运输工具服务 | ||
128 | * 21.航空公司 | 134 | * 21.航空公司 |
129 | */ | 135 | */ |
130 | private String airCompany; | 136 | private String airCompany; |
131 | 137 | ||
132 | /** | 138 | /** |
139 | + * 运输工具服务 | ||
133 | * 22.机型 | 140 | * 22.机型 |
134 | */ | 141 | */ |
135 | private String cfTp; | 142 | private String cfTp; |
136 | 143 | ||
137 | /** | 144 | /** |
145 | + * 运输工具服务 | ||
138 | * 23.机号 | 146 | * 23.机号 |
139 | */ | 147 | */ |
140 | private String cfNo; | 148 | private String cfNo; |
141 | 149 | ||
142 | /** | 150 | /** |
151 | + * 运输工具服务 | ||
143 | * 24.航班(起飞)时间 | 152 | * 24.航班(起飞)时间 |
144 | */ | 153 | */ |
145 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 154 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
146 | private Date flightTime; | 155 | private Date flightTime; |
147 | 156 | ||
148 | /** | 157 | /** |
158 | + * 运输工具服务 | ||
149 | * 25.航班计划日期 | 159 | * 25.航班计划日期 |
150 | */ | 160 | */ |
151 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") | 161 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
152 | private Date flightPlanDate; | 162 | private Date flightPlanDate; |
153 | 163 | ||
154 | /** | 164 | /** |
165 | + * 运输工具服务 | ||
155 | * 26.航班计划时间 | 166 | * 26.航班计划时间 |
156 | */ | 167 | */ |
157 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 168 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
158 | private Date flightPlanTime; | 169 | private Date flightPlanTime; |
159 | 170 | ||
160 | /** | 171 | /** |
172 | + * 数据仓库服务 | ||
161 | * 27.计费重量 | 173 | * 27.计费重量 |
162 | */ | 174 | */ |
163 | private BigDecimal totalGrossWeightMeasure; | 175 | private BigDecimal totalGrossWeightMeasure; |
164 | 176 | ||
165 | /** | 177 | /** |
178 | + * 数据仓库服务 | ||
166 | * 28.体积 | 179 | * 28.体积 |
167 | */ | 180 | */ |
168 | private BigDecimal volumeMeasure; | 181 | private BigDecimal volumeMeasure; |
@@ -15,7 +15,7 @@ import java.util.List; | @@ -15,7 +15,7 @@ import java.util.List; | ||
15 | public class GetCgoAsmFeginHystrix implements GetCgoAsmFeign{ | 15 | public class GetCgoAsmFeginHystrix implements GetCgoAsmFeign{ |
16 | 16 | ||
17 | @Override | 17 | @Override |
18 | - public List<ResultExitData> getInfo(List<ResultExitData> resultList) { | 18 | + public ResultExitData getInfo(String waybillNoMaster) { |
19 | System.out.println("与代理人服务断开连接,获取代理人服务信息失败"); | 19 | System.out.println("与代理人服务断开连接,获取代理人服务信息失败"); |
20 | return null; | 20 | return null; |
21 | } | 21 | } |
@@ -3,19 +3,27 @@ package com.sunyo.wlpt.cgonms.provide.feign; | @@ -3,19 +3,27 @@ package com.sunyo.wlpt.cgonms.provide.feign; | ||
3 | import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData; | 3 | import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData; |
4 | import org.springframework.cloud.openfeign.FeignClient; | 4 | import org.springframework.cloud.openfeign.FeignClient; |
5 | import org.springframework.stereotype.Component; | 5 | import org.springframework.stereotype.Component; |
6 | +import org.springframework.web.bind.annotation.GetMapping; | ||
6 | import org.springframework.web.bind.annotation.PutMapping; | 7 | import org.springframework.web.bind.annotation.PutMapping; |
7 | import org.springframework.web.bind.annotation.RequestBody; | 8 | import org.springframework.web.bind.annotation.RequestBody; |
9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
8 | 10 | ||
9 | import java.util.List; | 11 | import java.util.List; |
10 | 12 | ||
11 | /** | 13 | /** |
12 | * @author 子诚 | 14 | * @author 子诚 |
13 | - * Description: | 15 | + * Description:根据运单号查询代理人服务的相关数据 |
14 | * 时间:2020/5/21 17:43 | 16 | * 时间:2020/5/21 17:43 |
15 | */ | 17 | */ |
16 | @Component | 18 | @Component |
17 | @FeignClient(value = "cgoasm-provide", fallback = GetCgoAsmFeginHystrix.class) | 19 | @FeignClient(value = "cgoasm-provide", fallback = GetCgoAsmFeginHystrix.class) |
18 | public interface GetCgoAsmFeign { | 20 | public interface GetCgoAsmFeign { |
19 | - @PutMapping("/cgoasm/getInfo") | ||
20 | - List<ResultExitData> getInfo(@RequestBody List<ResultExitData> resultList); | 21 | + /** |
22 | + * 根据运单号查询代理人服务的相关数据 | ||
23 | + * | ||
24 | + * @param waybillNoMaster 运单号 | ||
25 | + * @return | ||
26 | + */ | ||
27 | + @GetMapping("/cgoasm/getInfo") | ||
28 | + ResultExitData getInfo(@RequestParam(value = "waybillNoMaster", required = false) String waybillNoMaster); | ||
21 | } | 29 | } |
@@ -3,8 +3,10 @@ package com.sunyo.wlpt.cgonms.provide.feign; | @@ -3,8 +3,10 @@ package com.sunyo.wlpt.cgonms.provide.feign; | ||
3 | import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData; | 3 | import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData; |
4 | import org.springframework.cloud.openfeign.FeignClient; | 4 | import org.springframework.cloud.openfeign.FeignClient; |
5 | import org.springframework.stereotype.Component; | 5 | import org.springframework.stereotype.Component; |
6 | +import org.springframework.web.bind.annotation.GetMapping; | ||
6 | import org.springframework.web.bind.annotation.PutMapping; | 7 | import org.springframework.web.bind.annotation.PutMapping; |
7 | import org.springframework.web.bind.annotation.RequestBody; | 8 | import org.springframework.web.bind.annotation.RequestBody; |
9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
8 | 10 | ||
9 | import java.util.List; | 11 | import java.util.List; |
10 | 12 | ||
@@ -16,6 +18,12 @@ import java.util.List; | @@ -16,6 +18,12 @@ import java.util.List; | ||
16 | @Component | 18 | @Component |
17 | @FeignClient(value = "data-warehouse", fallback = GetDataWareHouseFeignHystrix.class) | 19 | @FeignClient(value = "data-warehouse", fallback = GetDataWareHouseFeignHystrix.class) |
18 | public interface GetDataWareHouseFeign { | 20 | public interface GetDataWareHouseFeign { |
19 | - @PutMapping("/data/getInfo") | ||
20 | - List<ResultExitData> getInfo(@RequestBody List<ResultExitData> resultList); | 21 | + /** |
22 | + * 根据运单号,查询数据仓库服务的体积和计费重量 | ||
23 | + * | ||
24 | + * @param waybillNoMaster 运单号 | ||
25 | + * @return | ||
26 | + */ | ||
27 | + @GetMapping("/data/getInfo") | ||
28 | + ResultExitData getInfo(@RequestParam(value = "waybillNoMaster", required = false) String waybillNoMaster); | ||
21 | } | 29 | } |
@@ -13,7 +13,7 @@ import java.util.List; | @@ -13,7 +13,7 @@ import java.util.List; | ||
13 | @Service | 13 | @Service |
14 | public class GetDataWareHouseFeignHystrix implements GetDataWareHouseFeign { | 14 | public class GetDataWareHouseFeignHystrix implements GetDataWareHouseFeign { |
15 | @Override | 15 | @Override |
16 | - public List<ResultExitData> getInfo(List<ResultExitData> resultList) { | 16 | + public ResultExitData getInfo(String waybillNoMaster) { |
17 | System.out.println("与 数据仓库 服务 断开连接,获取 数据仓库 服务信息失败"); | 17 | System.out.println("与 数据仓库 服务 断开连接,获取 数据仓库 服务信息失败"); |
18 | return null; | 18 | return null; |
19 | } | 19 | } |
@@ -9,14 +9,26 @@ package com.sunyo.wlpt.cgonms.provide.feign; | @@ -9,14 +9,26 @@ package com.sunyo.wlpt.cgonms.provide.feign; | ||
9 | import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData; | 9 | import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData; |
10 | import org.springframework.cloud.openfeign.FeignClient; | 10 | import org.springframework.cloud.openfeign.FeignClient; |
11 | import org.springframework.stereotype.Component; | 11 | import org.springframework.stereotype.Component; |
12 | +import org.springframework.web.bind.annotation.GetMapping; | ||
12 | import org.springframework.web.bind.annotation.PutMapping; | 13 | import org.springframework.web.bind.annotation.PutMapping; |
13 | import org.springframework.web.bind.annotation.RequestBody; | 14 | import org.springframework.web.bind.annotation.RequestBody; |
15 | +import org.springframework.web.bind.annotation.RequestParam; | ||
14 | 16 | ||
17 | +import java.util.Date; | ||
15 | import java.util.List; | 18 | import java.util.List; |
16 | 19 | ||
17 | @Component | 20 | @Component |
18 | @FeignClient(value = "transport-provide", fallback = GetTransportFeignHystrix.class) | 21 | @FeignClient(value = "transport-provide", fallback = GetTransportFeignHystrix.class) |
19 | public interface GetTransportFeign { | 22 | public interface GetTransportFeign { |
20 | - @PutMapping("transport/getInfo") | ||
21 | - public List<ResultExitData> getInfo(@RequestBody List<ResultExitData> resultList); | 23 | + /** |
24 | + * 根据承运人二字码、航班号、航班日期,获取,运输工具服务中的相关数据 | ||
25 | + * 航空公司、机型、机号、实际起飞时间、计划起飞时间 | ||
26 | + * | ||
27 | + * @param flightNo 航班号 | ||
28 | + * @param flightDate 航班日期 | ||
29 | + * @return | ||
30 | + */ | ||
31 | + @GetMapping("/transport/getInfo") | ||
32 | + public ResultExitData getInfo(@RequestParam(value = "flightNo", required = false) String flightNo, | ||
33 | + @RequestParam(value = "flightDate", required = false) Date flightDate); | ||
22 | } | 34 | } |
@@ -3,6 +3,7 @@ package com.sunyo.wlpt.cgonms.provide.feign; | @@ -3,6 +3,7 @@ package com.sunyo.wlpt.cgonms.provide.feign; | ||
3 | import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData; | 3 | import com.sunyo.wlpt.cgonms.provide.domain.ResultExitData; |
4 | import org.springframework.stereotype.Service; | 4 | import org.springframework.stereotype.Service; |
5 | 5 | ||
6 | +import java.util.Date; | ||
6 | import java.util.List; | 7 | import java.util.List; |
7 | 8 | ||
8 | /** | 9 | /** |
@@ -12,8 +13,9 @@ import java.util.List; | @@ -12,8 +13,9 @@ import java.util.List; | ||
12 | */ | 13 | */ |
13 | @Service | 14 | @Service |
14 | public class GetTransportFeignHystrix implements GetTransportFeign { | 15 | public class GetTransportFeignHystrix implements GetTransportFeign { |
16 | + | ||
15 | @Override | 17 | @Override |
16 | - public List<ResultExitData> getInfo(List<ResultExitData> resultList) { | 18 | + public ResultExitData getInfo(String flightNo, Date flightDate) { |
17 | System.out.println("与“运输工具”服务断开连接,获取“运输工具”服务信息失败"); | 19 | System.out.println("与“运输工具”服务断开连接,获取“运输工具”服务信息失败"); |
18 | return null; | 20 | return null; |
19 | } | 21 | } |
@@ -63,11 +63,11 @@ eureka: | @@ -63,11 +63,11 @@ eureka: | ||
63 | feign: | 63 | feign: |
64 | hystrix: | 64 | hystrix: |
65 | enabled: false | 65 | enabled: false |
66 | - client: | ||
67 | - config: | ||
68 | - default: | ||
69 | - connectTimeout: 60000000 # feign 的超时设置 | ||
70 | - readTimeout: 60000000 | 66 | +# client: |
67 | +# config: | ||
68 | +# default: | ||
69 | +# connectTimeout: 1000000 # feign 的超时设置 | ||
70 | +# readTimeout: 1000000 | ||
71 | # boot admin | 71 | # boot admin |
72 | management: | 72 | management: |
73 | endpoints: | 73 | endpoints: |
-
请 注册 或 登录 后发表评论