正在显示
13 个修改的文件
包含
903 行增加
和
46 行删除
@@ -38,8 +38,9 @@ public class KAKO_Reader extends Thread{ | @@ -38,8 +38,9 @@ public class KAKO_Reader extends Thread{ | ||
38 | analysisRoute.setMessage(message); | 38 | analysisRoute.setMessage(message); |
39 | threadPoolEs.execute(analysisRoute); | 39 | threadPoolEs.execute(analysisRoute); |
40 | logger.info("[THREADPOOL-INFO]-当前运行线程总数量: " + threadPoolEs.getActiveCount()); | 40 | logger.info("[THREADPOOL-INFO]-当前运行线程总数量: " + threadPoolEs.getActiveCount()); |
41 | - logger.info("[THREADPOOL-INFO]-线程队列数量: " + threadPoolEs.getQueue().size()); | 41 | + logger.info("[THREADPOOL-INFO]-当前线程数量: " + threadPoolEs.getTaskCount()); |
42 | logger.info("[THREADPOOL-INFO]-完成的线程总数量: " + threadPoolEs.getCompletedTaskCount()); | 42 | logger.info("[THREADPOOL-INFO]-完成的线程总数量: " + threadPoolEs.getCompletedTaskCount()); |
43 | + logger.info("[THREADPOOL-INFO]-线程队列数量: " + threadPoolEs.getQueue().size()); | ||
43 | logger.info("[THREADPOOL-INFO]-空闲线程释放时间(秒): " + threadPoolEs.getKeepAliveTime(TimeUnit.SECONDS)); | 44 | logger.info("[THREADPOOL-INFO]-空闲线程释放时间(秒): " + threadPoolEs.getKeepAliveTime(TimeUnit.SECONDS)); |
44 | 45 | ||
45 | //AnalysisRoute.analysis(message); | 46 | //AnalysisRoute.analysis(message); |
@@ -101,7 +101,8 @@ public class AnalysisRoute implements Runnable{ | @@ -101,7 +101,8 @@ public class AnalysisRoute implements Runnable{ | ||
101 | if(info.getBarcode().length()>0){ | 101 | if(info.getBarcode().length()>0){ |
102 | //LogicOperation.operation(info) | 102 | //LogicOperation.operation(info) |
103 | try { | 103 | try { |
104 | - if(LiftBar.liftBar(info)){ | 104 | + LiftBar lift = new LiftBar(); |
105 | + if(lift.liftBar(info)){ | ||
105 | String type = null; | 106 | String type = null; |
106 | if("I".equals(info.getIetype())){ | 107 | if("I".equals(info.getIetype())){ |
107 | type="进入"; | 108 | type="进入"; |
@@ -112,6 +113,7 @@ public class AnalysisRoute implements Runnable{ | @@ -112,6 +113,7 @@ public class AnalysisRoute implements Runnable{ | ||
112 | logger.info("------->>>>>>>"+info.getVename()+"已"+type+info.getAreaid()+"场站<<<<<<<-----"); | 113 | logger.info("------->>>>>>>"+info.getVename()+"已"+type+info.getAreaid()+"场站<<<<<<<-----"); |
113 | } | 114 | } |
114 | } catch (InterruptedException e) { | 115 | } catch (InterruptedException e) { |
116 | + logger.error(e); | ||
115 | e.printStackTrace(); | 117 | e.printStackTrace(); |
116 | } | 118 | } |
117 | }else{ | 119 | }else{ |
@@ -2,6 +2,7 @@ package com.sy.logic; | @@ -2,6 +2,7 @@ package com.sy.logic; | ||
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | import com.alibaba.fastjson.JSONArray; | 4 | import com.alibaba.fastjson.JSONArray; |
5 | +import com.alibaba.fastjson.JSONObject; | ||
5 | import com.sy.crossDomain.buildBarCode; | 6 | import com.sy.crossDomain.buildBarCode; |
6 | import com.sy.model.*; | 7 | import com.sy.model.*; |
7 | import com.sy.relation.VeManifestRelation; | 8 | import com.sy.relation.VeManifestRelation; |
@@ -23,6 +24,7 @@ import org.springframework.stereotype.Component; | @@ -23,6 +24,7 @@ import org.springframework.stereotype.Component; | ||
23 | import org.apache.log4j.Logger; | 24 | import org.apache.log4j.Logger; |
24 | 25 | ||
25 | import javax.annotation.PostConstruct; | 26 | import javax.annotation.PostConstruct; |
27 | +import javax.validation.constraints.NotNull; | ||
26 | import java.io.BufferedReader; | 28 | import java.io.BufferedReader; |
27 | import java.io.IOException; | 29 | import java.io.IOException; |
28 | import java.io.InputStreamReader; | 30 | import java.io.InputStreamReader; |
@@ -41,6 +43,7 @@ import java.util.Map; | @@ -41,6 +43,7 @@ import java.util.Map; | ||
41 | @Component | 43 | @Component |
42 | public class LiftBar { | 44 | public class LiftBar { |
43 | private static final Logger logger = Logger.getLogger(LiftBar.class); | 45 | private static final Logger logger = Logger.getLogger(LiftBar.class); |
46 | + private static final org.slf4j.Logger log4 = org.slf4j.LoggerFactory.getLogger(LiftBar.class); | ||
44 | @Autowired | 47 | @Autowired |
45 | private LandBusListService listService;//进出场申请表 | 48 | private LandBusListService listService;//进出场申请表 |
46 | @Autowired | 49 | @Autowired |
@@ -76,10 +79,18 @@ public class LiftBar { | @@ -76,10 +79,18 @@ public class LiftBar { | ||
76 | private static String ERRORWT = "出起始场站的重量和进目的场站的重量不一致"; | 79 | private static String ERRORWT = "出起始场站的重量和进目的场站的重量不一致"; |
77 | private static String IEPORSE = "无相对应进出场申请"; | 80 | private static String IEPORSE = "无相对应进出场申请"; |
78 | private static String FANGXING="有运单未放行"; | 81 | private static String FANGXING="有运单未放行"; |
82 | + private static String FENBO = "装载运单的分拨申请舱单未通过校验"; | ||
83 | + | ||
84 | + //分拨申请回执 | ||
85 | + private static String ALLOCATE_01 = "39301 分拨申请审核通过。"; | ||
86 | + private static String ALLOCATE_04 = "39103 分拨申请重复传输,海关审核不通过。"; | ||
79 | 87 | ||
80 | @Autowired | 88 | @Autowired |
81 | private FeignService feignService; | 89 | private FeignService feignService; |
82 | 90 | ||
91 | + @Autowired | ||
92 | + private NmmsService nmmsService; | ||
93 | + | ||
83 | @PostConstruct | 94 | @PostConstruct |
84 | public void init() { | 95 | public void init() { |
85 | logic = this; | 96 | logic = this; |
@@ -94,13 +105,14 @@ public class LiftBar { | @@ -94,13 +105,14 @@ public class LiftBar { | ||
94 | logic.wharfHost=this.wharfHost; | 105 | logic.wharfHost=this.wharfHost; |
95 | logic.nmmsHost=this.nmmsHost; | 106 | logic.nmmsHost=this.nmmsHost; |
96 | logic.feignService=this.feignService; | 107 | logic.feignService=this.feignService; |
108 | + logic.nmmsService=this.nmmsService; | ||
97 | } | 109 | } |
98 | 110 | ||
99 | /** | 111 | /** |
100 | * @Param info 卡口采集数据 | 112 | * @Param info 卡口采集数据 |
101 | * @Result 计算卡口采集数据并发送报文 | 113 | * @Result 计算卡口采集数据并发送报文 |
102 | */ | 114 | */ |
103 | - public static boolean liftBar(GatherInfo info) throws InterruptedException { | 115 | + public boolean liftBar(GatherInfo info) throws InterruptedException { |
104 | PropertyConfigurator.configure("config/log4j.properties"); | 116 | PropertyConfigurator.configure("config/log4j.properties"); |
105 | //默认返回值 | 117 | //默认返回值 |
106 | boolean result = false; | 118 | boolean result = false; |
@@ -114,8 +126,9 @@ public class LiftBar { | @@ -114,8 +126,9 @@ public class LiftBar { | ||
114 | 126 | ||
115 | //1. 若无车牌号,返回未识别错误 | 127 | //1. 若无车牌号,返回未识别错误 |
116 | if (vaName.length() <= 0) { | 128 | if (vaName.length() <= 0) { |
117 | - CommandClient.Client(info, NO_CHEPAI + vaName); | ||
118 | logger.error(NO_CHEPAI+vaName); | 129 | logger.error(NO_CHEPAI+vaName); |
130 | + CommandClient.Client(info, NO_CHEPAI + vaName); | ||
131 | + | ||
119 | return result; | 132 | return result; |
120 | } | 133 | } |
121 | 134 | ||
@@ -170,20 +183,25 @@ public class LiftBar { | @@ -170,20 +183,25 @@ public class LiftBar { | ||
170 | diffVal = inWt- growssWt; | 183 | diffVal = inWt- growssWt; |
171 | } | 184 | } |
172 | 185 | ||
186 | + log4.info("[CHECK-INFO]-出场过磅重量:{}-申报装载货物重量:{}-入场过磅重量:{}-进出差值:{}-车重:{}",growssWt,goodsWt,inWt,diffVal,ve.getSelfWt()); | ||
187 | + | ||
173 | //判断场站出场是否要重量校验,配置文件中配置的场站直接抬杆放行. | 188 | //判断场站出场是否要重量校验,配置文件中配置的场站直接抬杆放行. |
174 | if(FileTool.readProperties("station").equals(list.getEndstation())||FileTool.readProperties("stationsf").equals(list.getEndstation())){ | 189 | if(FileTool.readProperties("station").equals(list.getEndstation())||FileTool.readProperties("stationsf").equals(list.getEndstation())){ |
175 | checkResult=true; | 190 | checkResult=true; |
176 | //货物类型判断,直接放行的.todo:这个逻辑比较强大,后期要看怎么处理 | 191 | //货物类型判断,直接放行的.todo:这个逻辑比较强大,后期要看怎么处理 |
177 | }else if(!"普通货物".equals(list.getCocode()) && !"转关货物".equals(list.getCocode())){ | 192 | }else if(!"普通货物".equals(list.getCocode()) && !"转关货物".equals(list.getCocode())){ |
193 | + //todo:比如货物类型为快件货物,只走重量校验,不走放行信息等校验. | ||
178 | logger.info("车辆装载货物为:"+list.getCocode()); | 194 | logger.info("车辆装载货物为:"+list.getCocode()); |
179 | checkResult=true; | 195 | checkResult=true; |
180 | }else { | 196 | }else { |
181 | // 出场校验根据业务类型 | 197 | // 出场校验根据业务类型 |
198 | + logger.info("[进出场申请]-业务类型为:"+list.getCocode()+list.getBusinesstype()); | ||
182 | switch (list.getBusinesstype()){ | 199 | switch (list.getBusinesstype()){ |
183 | case "出口送货": | 200 | case "出口送货": |
184 | if (logic.weightCheckHandleService.checkExportDownLoading(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt)){ | 201 | if (logic.weightCheckHandleService.checkExportDownLoading(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt)){ |
185 | checkResult=true; | 202 | checkResult=true; |
186 | }else{ | 203 | }else{ |
204 | + logger.error("[出口送货]-出场重量未通过校验:"+GROWSSEXCETION); | ||
187 | CommandClient.Client(info, GROWSSEXCETION); | 205 | CommandClient.Client(info, GROWSSEXCETION); |
188 | return false; | 206 | return false; |
189 | } | 207 | } |
@@ -197,21 +215,50 @@ public class LiftBar { | @@ -197,21 +215,50 @@ public class LiftBar { | ||
197 | checkResult=true; | 215 | checkResult=true; |
198 | }else { | 216 | }else { |
199 | //有运单未放行 | 217 | //有运单未放行 |
218 | + logger.error("[进口提货]-出场未通过校验:"+FANGXING+list.getMasterList()); | ||
200 | CommandClient.Client(info, FANGXING); | 219 | CommandClient.Client(info, FANGXING); |
201 | return false; | 220 | return false; |
202 | } | 221 | } |
203 | 222 | ||
204 | //todo:装载运单历史数据累加超重判定 | 223 | //todo:装载运单历史数据累加超重判定 |
205 | }else{ | 224 | }else{ |
225 | + logger.error("[进口提货]-出场重量未通过校验:"+GROWSSEXCETION); | ||
206 | CommandClient.Client(info, GROWSSEXCETION); | 226 | CommandClient.Client(info, GROWSSEXCETION); |
207 | return false; | 227 | return false; |
208 | } | 228 | } |
209 | break; | 229 | break; |
210 | case "分拨业务": | 230 | case "分拨业务": |
231 | + if (logic.weightCheckHandleService.checkAllocateOrDispatch(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt)){ | ||
232 | + //todo:检查分拨申请 | ||
233 | + boolean allocatCheck = checkNmmsAllocate(list.getMasterList()); | ||
234 | + if(!allocatCheck){ | ||
235 | + logger.error("[分拨业务]-分拨申请舱单未通过校验:"+FENBO); | ||
236 | + CommandClient.Client(info, FENBO); | ||
237 | + return false; | ||
238 | + } | ||
239 | + checkResult=true; | ||
240 | + //todo:分拨运抵通知,重车入场视为运抵 | ||
241 | + }else{ | ||
242 | + logger.error("[分拨业务]-出场重量未通过校验:"+GROWSSEXCETION); | ||
243 | + CommandClient.Client(info, GROWSSEXCETION); | ||
244 | + return false; | ||
245 | + } | ||
246 | + break; | ||
211 | case "调拨业务": | 247 | case "调拨业务": |
212 | if (logic.weightCheckHandleService.checkAllocateOrDispatch(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt)){ | 248 | if (logic.weightCheckHandleService.checkAllocateOrDispatch(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt)){ |
213 | checkResult=true; | 249 | checkResult=true; |
250 | + //检查运单放行 | ||
251 | + if (logic.resMessageService.checkManifestRelease(list.getMasterList())){ | ||
252 | + checkResult=true; | ||
253 | + }else { | ||
254 | + //有运单未放行 | ||
255 | + logger.error("[调拨业务]-出场未通过校验:"+FANGXING+list.getMasterList()); | ||
256 | + CommandClient.Client(info, FANGXING); | ||
257 | + return false; | ||
258 | + } | ||
259 | + //todo:检查ULD放行. | ||
214 | }else{ | 260 | }else{ |
261 | + logger.error("[调拨业务]-出场未通过校验:"+GROWSSEXCETION); | ||
215 | CommandClient.Client(info, GROWSSEXCETION); | 262 | CommandClient.Client(info, GROWSSEXCETION); |
216 | return false; | 263 | return false; |
217 | } | 264 | } |
@@ -222,22 +269,25 @@ public class LiftBar { | @@ -222,22 +269,25 @@ public class LiftBar { | ||
222 | } | 269 | } |
223 | 270 | ||
224 | 271 | ||
225 | - check = logic.weightCheckHandleService.checkResult(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt); | ||
226 | - if("出口送货".equals(list.getBusinesstype())){ | ||
227 | - if(check){ | ||
228 | - checkResult=true; | ||
229 | - }else{ | ||
230 | - CommandClient.Client(info, GROWSSEXCETION); | ||
231 | - } | ||
232 | - }else{ | ||
233 | - //其他业务的装载运单放行判断 | ||
234 | - checkMainfest = logic.checkManifest(list.getMasterList()); | ||
235 | - if(checkMainfest){ | ||
236 | - checkResult=check || checkMainfest; | ||
237 | - }else{ | ||
238 | - CommandClient.Client(info, FANGXING);//有运单未放行 | ||
239 | - } | ||
240 | - } | 272 | + //旧业务逻辑,不启用了 |
273 | +// check = logic.weightCheckHandleService.checkResult(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt); | ||
274 | +// if("出口送货".equals(list.getBusinesstype())){ | ||
275 | +// if(check){ | ||
276 | +// checkResult=true; | ||
277 | +// }else{ | ||
278 | +// CommandClient.Client(info, GROWSSEXCETION); | ||
279 | +// } | ||
280 | +// }else{ | ||
281 | +// //其他业务的装载运单放行判断 | ||
282 | +// checkMainfest = logic.checkManifest(list.getMasterList()); | ||
283 | +// if(checkMainfest){ | ||
284 | +// checkResult=check || checkMainfest; | ||
285 | +// }else{ | ||
286 | +// CommandClient.Client(info, FANGXING);//有运单未放行 | ||
287 | +// } | ||
288 | +// } | ||
289 | + | ||
290 | + | ||
241 | } | 291 | } |
242 | 292 | ||
243 | } | 293 | } |
@@ -279,7 +329,8 @@ public class LiftBar { | @@ -279,7 +329,8 @@ public class LiftBar { | ||
279 | int count=logic.listService.selectlaststation(list.getTrailerFrameNo(),list.getBarcode()); | 329 | int count=logic.listService.selectlaststation(list.getTrailerFrameNo(),list.getBarcode()); |
280 | //二维码失效 | 330 | //二维码失效 |
281 | if(count==0){ | 331 | if(count==0){ |
282 | - buildBarCode.cancleBarCode(vaName); | 332 | + //测试注释掉 |
333 | +// buildBarCode.cancleBarCode(vaName); | ||
283 | } | 334 | } |
284 | 335 | ||
285 | /** | 336 | /** |
@@ -482,14 +533,17 @@ public class LiftBar { | @@ -482,14 +533,17 @@ public class LiftBar { | ||
482 | if (!(waybill.indexOf("-") != -1)) { | 533 | if (!(waybill.indexOf("-") != -1)) { |
483 | waybill = waybill.substring(0, 3) + "-" + waybill.substring(3); | 534 | waybill = waybill.substring(0, 3) + "-" + waybill.substring(3); |
484 | } | 535 | } |
485 | - String url = logic.nmmsHost+"orig/orig?waybill=" + waybill + "&imp=" + imp; | ||
486 | - // String url = "http://tjfx.15miaoo.com:8003/tj/orig/orig?waybill=" + waybill + "&imp=" + imp; | 536 | +// String url = logic.nmmsHost+"orig/orig?waybill=" + waybill + "&imp=" + imp; |
537 | + String url = "http://tjfx.15miaoo.com:8003/tj/orig/orig?waybill=" + waybill + "&imp=" + imp; | ||
487 | StringBuilder json = new StringBuilder(); | 538 | StringBuilder json = new StringBuilder(); |
488 | Map map = null; | 539 | Map map = null; |
489 | double bg = 0; | 540 | double bg = 0; |
490 | try { | 541 | try { |
491 | URL Url = new URL(url); | 542 | URL Url = new URL(url); |
492 | URLConnection yc = Url.openConnection(); | 543 | URLConnection yc = Url.openConnection(); |
544 | + //设置接口超时 | ||
545 | + yc.setReadTimeout(5000); | ||
546 | + yc.setConnectTimeout(3000); | ||
493 | BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(), "utf-8")); | 547 | BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(), "utf-8")); |
494 | String inputLine = null; | 548 | String inputLine = null; |
495 | while ((inputLine = in.readLine()) != null) { | 549 | while ((inputLine = in.readLine()) != null) { |
@@ -577,6 +631,7 @@ public class LiftBar { | @@ -577,6 +631,7 @@ public class LiftBar { | ||
577 | } | 631 | } |
578 | } | 632 | } |
579 | } | 633 | } |
634 | + | ||
580 | /** | 635 | /** |
581 | * 为提前运抵服务发送数据 | 636 | * 为提前运抵服务发送数据 |
582 | * | 637 | * |
@@ -594,5 +649,57 @@ public class LiftBar { | @@ -594,5 +649,57 @@ public class LiftBar { | ||
594 | Map<String,Object> map=logic.feignService.sendMessage(arrive); | 649 | Map<String,Object> map=logic.feignService.sendMessage(arrive); |
595 | logger.info(""+map); | 650 | logger.info(""+map); |
596 | } | 651 | } |
652 | + | ||
653 | + /** | ||
654 | + * 新舱单分拨申请数据查询 | ||
655 | + * @param waybill 查询的运单号 | ||
656 | + * @return | ||
657 | + */ | ||
658 | + public Map nmmsAllocate(@NotNull String waybill){ | ||
659 | + logger.info("新舱单查询分拨申请数据开始"); | ||
660 | + Map map = logic.nmmsService.getAllocate(waybill,0,10); | ||
661 | + logger.info(""+map); | ||
662 | + return map; | ||
663 | + } | ||
664 | + | ||
665 | + public boolean checkNmmsAllocate(String waybill){ | ||
666 | + if (waybill.length() < 1) { | ||
667 | + return false; | ||
668 | + } | ||
669 | + waybill = waybill.replace("-", ""); | ||
670 | + //中文逗号替换 | ||
671 | + waybill = waybill.replace(",", ","); | ||
672 | + String[] maifest = waybill.split(","); | ||
673 | + logger.info("运单列表:" + waybill); | ||
674 | + boolean flag = false; | ||
675 | + | ||
676 | + for (String awb : maifest) { | ||
677 | + Map map= nmmsAllocate(awb); | ||
678 | + if (map.containsKey("reslut")){ | ||
679 | + String result = map.get("reslut").toString(); | ||
680 | + JSONObject jsonObject = JSON.parseObject(result); | ||
681 | + if (jsonObject.containsKey("ds")) { | ||
682 | + JSONArray ds = jsonObject.getJSONArray("ds"); | ||
683 | + JSONObject awbinfo = ds.getJSONObject(0); | ||
684 | + if (awbinfo.containsKey("RECEIPTINFORMATION")){ | ||
685 | + if (awbinfo.getString("RECEIPTINFORMATION").contains("39301") || awbinfo.getString("RECEIPTINFORMATION").contains("39103")){ | ||
686 | + log4.info("运单:{},分拨回执查询结果:{}",awb,awbinfo.getString("RECEIPTINFORMATION")); | ||
687 | + }else { | ||
688 | + log4.info("运单{}分拨申请回执不正常:{}",awb,awbinfo.getString("RECEIPTINFORMATION")); | ||
689 | + return false; | ||
690 | + } | ||
691 | + } | ||
692 | + }else { | ||
693 | + log4.info("运单:{}分拨申请回执未查询到,或未进行分拨申请",awb); | ||
694 | + return false; | ||
695 | + } | ||
696 | + }else{ | ||
697 | + log4.info("运单:{}分拨申请回执未查询到,或未进行分拨申请",awb); | ||
698 | + return false; | ||
699 | + } | ||
700 | + | ||
701 | + } | ||
702 | + return true; | ||
703 | + } | ||
597 | } | 704 | } |
598 | 705 |
1 | +package com.sy.service; | ||
2 | + | ||
3 | + | ||
4 | +import com.sy.service.impl.MessageServiceHystrix; | ||
5 | +import com.sy.service.impl.NmmsServiceHystrix; | ||
6 | +import org.springframework.cloud.openfeign.FeignClient; | ||
7 | +import org.springframework.stereotype.Component; | ||
8 | +import org.springframework.web.bind.annotation.PostMapping; | ||
9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
10 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
11 | + | ||
12 | +import java.util.Map; | ||
13 | + | ||
14 | +/** | ||
15 | + * @author mrz | ||
16 | + */ | ||
17 | +@Component | ||
18 | +@FeignClient(name = "nmmsFeign",url = "http://nmms1.15miaoo.com:17999",fallback = NmmsServiceHystrix.class) | ||
19 | +public interface NmmsService { | ||
20 | + | ||
21 | + @ResponseBody | ||
22 | + @PostMapping("/Allocate/querypage_inportallocate") | ||
23 | + Map getAllocate( | ||
24 | + @RequestParam(value = "waybill", required = true) String waybill, | ||
25 | + @RequestParam(value = "pageIndex", required = true,defaultValue = "0") int pageIndex, | ||
26 | + @RequestParam(value = "pageSize", required = true,defaultValue = "10") int pageSize | ||
27 | + ); | ||
28 | + | ||
29 | + | ||
30 | +} |
@@ -6,10 +6,12 @@ import com.sy.service.LandRoadVeService; | @@ -6,10 +6,12 @@ import com.sy.service.LandRoadVeService; | ||
6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
7 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
8 | 8 | ||
9 | +import javax.annotation.Resource; | ||
10 | + | ||
9 | @Service | 11 | @Service |
10 | public class LandRoadVeServiceImpl implements LandRoadVeService { | 12 | public class LandRoadVeServiceImpl implements LandRoadVeService { |
11 | 13 | ||
12 | - @Autowired | 14 | + @Resource |
13 | private LandRoadVeMapper veMapper; | 15 | private LandRoadVeMapper veMapper; |
14 | 16 | ||
15 | @Override | 17 | @Override |
1 | +package com.sy.service.impl; | ||
2 | + | ||
3 | +import com.sy.service.NmmsService; | ||
4 | +import org.slf4j.Logger; | ||
5 | +import org.slf4j.LoggerFactory; | ||
6 | +import org.springframework.stereotype.Service; | ||
7 | + | ||
8 | +import java.util.Map; | ||
9 | + | ||
10 | +@Service | ||
11 | +public class NmmsServiceHystrix implements NmmsService { | ||
12 | + private static final Logger logger = LoggerFactory.getLogger(NmmsServiceHystrix.class); | ||
13 | + | ||
14 | + @Override | ||
15 | + public Map<String, Object> getAllocate(String waybill, int pageIndex, int pageSize) { | ||
16 | + logger.error("查询分拨申请数据失败,{}",waybill); | ||
17 | + return null; | ||
18 | + } | ||
19 | +} |
@@ -18,6 +18,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | @@ -18,6 +18,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | ||
18 | //从配置文件中读取货物重差可控范围 | 18 | //从配置文件中读取货物重差可控范围 |
19 | private static String checkWt = FileTool.readProperties("grossWt"); | 19 | private static String checkWt = FileTool.readProperties("grossWt"); |
20 | 20 | ||
21 | + | ||
21 | /** | 22 | /** |
22 | * 校验载重和称重是否在合理的范围 | 23 | * 校验载重和称重是否在合理的范围 |
23 | * | 24 | * |
@@ -72,9 +73,12 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | @@ -72,9 +73,12 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | ||
72 | double result2= 0.0; | 73 | double result2= 0.0; |
73 | if(grossWt>0){ | 74 | if(grossWt>0){ |
74 | result = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt)); | 75 | result = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt)); |
76 | + System.out.println("进出场比对差值:"+result); | ||
75 | result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt)); | 77 | result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt)); |
78 | + System.out.println("空车出场差值:"+result2); | ||
76 | } | 79 | } |
77 | - if (result <= valueDob() || result2 <= valueDob()) { | 80 | + double range = valueDob(); |
81 | + if (result <= range || result2 <= range) { | ||
78 | flag = true; | 82 | flag = true; |
79 | } | 83 | } |
80 | return flag; | 84 | return flag; |
@@ -96,12 +100,30 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | @@ -96,12 +100,30 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | ||
96 | DecimalFormat df = new DecimalFormat("0.00"); | 100 | DecimalFormat df = new DecimalFormat("0.00"); |
97 | boolean flag = false; | 101 | boolean flag = false; |
98 | double result= 0.0; | 102 | double result= 0.0; |
103 | + double result1= 0.0; | ||
99 | if(grossWt>0){ | 104 | if(grossWt>0){ |
105 | + //进场过磅重量+带货重量 = 出场过磅重量 | ||
100 | result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); | 106 | result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); |
107 | + | ||
108 | + //todo:这里没有加空车离场判定,暂时不加,进口提货业务空车离场走空车验放判定系统. | ||
109 | + | ||
110 | + //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 | ||
111 | + result1 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt)); | ||
101 | } | 112 | } |
102 | - if (result <= valueDob()) { | 113 | + double range = valueDob(); |
114 | + System.out.println("进出场差值:"+result); | ||
115 | + System.out.println("提货离场差值:"+result1); | ||
116 | + | ||
117 | + if (result <= range) { | ||
118 | + | ||
103 | flag = true; | 119 | flag = true; |
104 | } | 120 | } |
121 | + | ||
122 | + //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 | ||
123 | + if (result1 <= range) { | ||
124 | + | ||
125 | + return true; | ||
126 | + } | ||
105 | return flag; | 127 | return flag; |
106 | } | 128 | } |
107 | 129 | ||
@@ -133,8 +155,12 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | @@ -133,8 +155,12 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | ||
133 | result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); | 155 | result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); |
134 | result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt)); | 156 | result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt)); |
135 | result3 = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt)); | 157 | result3 = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt)); |
158 | + System.out.println("进场提货离场差值:"+result); | ||
159 | + System.out.println("空车离场差值:"+result2); | ||
160 | + System.out.println("进场卸货离场差值:"+result3); | ||
136 | } | 161 | } |
137 | - if (result <= valueDob() || result2 <= valueDob() || result3 <= valueDob() ) { | 162 | + double range = valueDob(); |
163 | + if (result <= range || result2 <= range || result3 <= range ) { | ||
138 | flag = true; | 164 | flag = true; |
139 | } | 165 | } |
140 | return flag; | 166 | return flag; |
@@ -7,6 +7,7 @@ import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter; | @@ -7,6 +7,7 @@ import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter; | ||
7 | public class NumberConverter extends AbstractSingleValueConverter{ | 7 | public class NumberConverter extends AbstractSingleValueConverter{ |
8 | 8 | ||
9 | 9 | ||
10 | + @Override | ||
10 | public boolean canConvert(Class type) { | 11 | public boolean canConvert(Class type) { |
11 | return type.equals(BigDecimal.class); | 12 | return type.equals(BigDecimal.class); |
12 | } | 13 | } |
1 | +package com.sy; | ||
2 | + | ||
3 | +import com.sy.bwAnalysis.AnalysisRoute; | ||
4 | +import com.sy.logic.LiftBar; | ||
5 | +import com.sy.utils.XMLThreadPoolFactory; | ||
6 | +import org.junit.Test; | ||
7 | +import org.junit.runner.RunWith; | ||
8 | +import org.springframework.boot.test.context.SpringBootTest; | ||
9 | +import org.springframework.test.context.junit4.SpringRunner; | ||
10 | + | ||
11 | +import java.util.concurrent.ThreadPoolExecutor; | ||
12 | + | ||
13 | +@RunWith(SpringRunner.class) | ||
14 | +@SpringBootTest | ||
15 | +public class BeihuoAllocateTests { | ||
16 | + | ||
17 | + private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(LiftBar.class); | ||
18 | + | ||
19 | + private static ThreadPoolExecutor threadPoolEs = XMLThreadPoolFactory.instance("kakou"); | ||
20 | + private AnalysisRoute analysisRoute=new AnalysisRoute(); | ||
21 | + | ||
22 | + //车牌号 | ||
23 | + private String voNo = "豫A61CR7"; | ||
24 | + //备案重量 | ||
25 | + private String vo_weight = "2000"; | ||
26 | + //过卡重量 | ||
27 | + private String cross_weight= "2324"; | ||
28 | + //场站编号 | ||
29 | + private String areaID = "4604600000"; | ||
30 | + //通道编号 | ||
31 | + private String chnlNo = "4604601010"; | ||
32 | + //进出场类型I/E | ||
33 | + private String ie = "I"; | ||
34 | + //二维码 | ||
35 | + private String barcode = "613f5c"; | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + //进通道报文 | ||
40 | + private static String IMPORT_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + | ||
41 | + "<MSG>\n" + | ||
42 | + "\t<META>\n" + | ||
43 | + "\t\t<SNDR>KAO</SNDR>\n" + | ||
44 | + "\t\t<RCVR/>\n" + | ||
45 | + "\t\t<SEQN>20220624063157</SEQN>\n" + | ||
46 | + "\t\t<DDTM>20220624063157</DDTM>\n" + | ||
47 | + "\t\t<TYPE>KAKO</TYPE>\n" + | ||
48 | + "\t\t<STYP>CARM</STYP>\n" + | ||
49 | + "\t</META>\n" + | ||
50 | + "\t<GATHER_INFO AREA_ID=\"${areaID}\" CHNL_NO=\"${chnlNo}\" I_E_TYPE=\"${IETYPE}\" SEQ_NO=\"20220624063118000004\">\n" + | ||
51 | + "\t\t<IC>\n" + | ||
52 | + "\t\t\t<DR_IC_NO/>\n" + | ||
53 | + "\t\t\t<IC_DR_CUSTOMS_NO/>\n" + | ||
54 | + "\t\t\t<IC_CO_CUSTOMS_NO/>\n" + | ||
55 | + "\t\t\t<IC_BILL_NO/>\n" + | ||
56 | + "\t\t\t<IC_FORM_TYPE/>\n" + | ||
57 | + "\t\t\t<IC_GROSS_WT/>\n" + | ||
58 | + "\t\t\t<IC_VE_CUSTOMS_NO/>\n" + | ||
59 | + "\t\t\t<IC_VE_NAME/>\n" + | ||
60 | + "\t\t\t<IC_CONTA_ID/>\n" + | ||
61 | + "\t\t\t<IC_ESEAL_ID/>\n" + | ||
62 | + "\t\t\t<IC_REG_DATETIME/>\n" + | ||
63 | + "\t\t\t<IC_PER_DAY_DUE/>\n" + | ||
64 | + "\t\t\t<GPS_ID/>\n" + | ||
65 | + "\t\t</IC>\n" + | ||
66 | + "\t\t<WEIGHT>\n" + | ||
67 | + "\t\t\t<GROSS_WT>${cross_weight}</GROSS_WT>\n" + | ||
68 | + "\t\t</WEIGHT>\n" + | ||
69 | + "\t\t<CAR>\n" + | ||
70 | + "\t\t\t<VE_NAME>${car}</VE_NAME>\n" + | ||
71 | + "\t\t\t<CAR_EC_NO/>\n" + | ||
72 | + "\t\t\t<CAR_EC_NO2/>\n" + | ||
73 | + "\t\t\t<VE_CUSTOMS_NO/>\n" + | ||
74 | + "\t\t\t<VE_WT/>\n" + | ||
75 | + "\t\t</CAR>\n" + | ||
76 | + "\t\t<CONTA>\n" + | ||
77 | + "\t\t\t<CONTA_NUM/>\n" + | ||
78 | + "\t\t\t<CONTA_RECO>1</CONTA_RECO>\n" + | ||
79 | + "\t\t\t<CONTA_ID_F/>\n" + | ||
80 | + "\t\t\t<CONTA_ID_B/>\n" + | ||
81 | + "\t\t\t<CONTA_MODEL_F/>\n" + | ||
82 | + "\t\t\t<CONTA_MODEL_B/>\n" + | ||
83 | + "\t\t</CONTA>\n" + | ||
84 | + "\t\t<ORDER_NUM/>\n" + | ||
85 | + "\t\t<BAR_CODE>${barcode}</BAR_CODE>\n" + | ||
86 | + "\t\t<SEAL>\n" + | ||
87 | + "\t\t\t<ESEAL_ID/>\n" + | ||
88 | + "\t\t\t<SEAL_KEY/>\n" + | ||
89 | + "\t\t</SEAL>\n" + | ||
90 | + "\t</GATHER_INFO>\n" + | ||
91 | + "</MSG>"; | ||
92 | + | ||
93 | + | ||
94 | + | ||
95 | + /** | ||
96 | + * 分拨业务_进场测试_入场提货_第一场站_空车进北货 | ||
97 | + */ | ||
98 | + @Test | ||
99 | + public void allocate_I1() throws InterruptedException { | ||
100 | + //车牌号 | ||
101 | + String voNo = "豫A61CR9"; | ||
102 | + //过卡重量 | ||
103 | + String cross_weight= "4300"; | ||
104 | + //场站编号-北货 | ||
105 | + String areaID = "4604600000"; | ||
106 | + //通道编号 | ||
107 | + String chnlNo = "4604601030"; | ||
108 | + //进出场类型I/E | ||
109 | + String ie = "I"; | ||
110 | + //二维码 | ||
111 | + String barcode = "9cc260"; | ||
112 | + | ||
113 | + logger.error("开始分拨业务进场测试1"); | ||
114 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
115 | + .replace("${cross_weight}",cross_weight) | ||
116 | + .replace("${areaID}",areaID) | ||
117 | + .replace("${chnlNo}",chnlNo) | ||
118 | + .replace("${IETYPE}",ie) | ||
119 | + .replace("${barcode}",barcode); | ||
120 | + //进港提货测试 | ||
121 | + | ||
122 | + analysisRoute.setMessage(IMPORT_XML); | ||
123 | + analysisRoute.run(); | ||
124 | + } | ||
125 | + | ||
126 | + /** | ||
127 | + * 分拨业务_离场测试_提货离场_第一场站_提货出北货 | ||
128 | + */ | ||
129 | + @Test | ||
130 | + public void allocate_E1() throws InterruptedException { | ||
131 | + //车牌号 | ||
132 | + String voNo = "豫A61CR9"; | ||
133 | + //过卡重量 | ||
134 | + String cross_weight= String.valueOf(4300+1921); | ||
135 | + //场站编号-北货 | ||
136 | + String areaID = "4604600000"; | ||
137 | + //通道编号 | ||
138 | + String chnlNo = "4604600030"; | ||
139 | + //进出场类型I/E | ||
140 | + String ie = "E"; | ||
141 | + //二维码 | ||
142 | + String barcode = "9cc260"; | ||
143 | + | ||
144 | + logger.error("开始分拨离场测试1"); | ||
145 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
146 | + .replace("${cross_weight}",cross_weight) | ||
147 | + .replace("${areaID}",areaID) | ||
148 | + .replace("${chnlNo}",chnlNo) | ||
149 | + .replace("${IETYPE}",ie) | ||
150 | + .replace("${barcode}",barcode); | ||
151 | + //进港提货测试 | ||
152 | + | ||
153 | + analysisRoute.setMessage(IMPORT_XML); | ||
154 | + analysisRoute.run(); | ||
155 | + } | ||
156 | + | ||
157 | + /** | ||
158 | + * 分拨业务_进场测试_入场提货_第二场站_载货进第二场站 | ||
159 | + */ | ||
160 | + @Test | ||
161 | + public void allocate_I2() throws InterruptedException { | ||
162 | + //车牌号 | ||
163 | + String voNo = "豫A61CR9"; | ||
164 | + //过卡重量 | ||
165 | + String cross_weight= String.valueOf(4300+2310.00); | ||
166 | + //场站编号-西货站 | ||
167 | + String areaID = "4604000000"; | ||
168 | + //通道编号 | ||
169 | + String chnlNo = "4604333321"; | ||
170 | + //进出场类型I/E | ||
171 | + String ie = "I"; | ||
172 | + //二维码 | ||
173 | + String barcode = "9cc260"; | ||
174 | + | ||
175 | + logger.error("开始分拨业务进场测试1"); | ||
176 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
177 | + .replace("${cross_weight}",cross_weight) | ||
178 | + .replace("${areaID}",areaID) | ||
179 | + .replace("${chnlNo}",chnlNo) | ||
180 | + .replace("${IETYPE}",ie) | ||
181 | + .replace("${barcode}",barcode); | ||
182 | + //进港提货测试 | ||
183 | + | ||
184 | + analysisRoute.setMessage(IMPORT_XML); | ||
185 | + analysisRoute.run(); | ||
186 | + } | ||
187 | + | ||
188 | + /** | ||
189 | + * 分拨业务_离场测试_提货离场_第一场站_提货出北货 | ||
190 | + */ | ||
191 | + @Test | ||
192 | + public void allocate_E2() throws InterruptedException { | ||
193 | + //车牌号 | ||
194 | + String voNo = "豫A61CR9"; | ||
195 | + //过卡重量 | ||
196 | + String cross_weight= String.valueOf(4300); | ||
197 | + //场站编号-北货 | ||
198 | + String areaID = "4604000000"; | ||
199 | + //通道编号 | ||
200 | + String chnlNo = "4604333322"; | ||
201 | + //进出场类型I/E | ||
202 | + String ie = "E"; | ||
203 | + //二维码 | ||
204 | + String barcode = "9cc260"; | ||
205 | + | ||
206 | + logger.error("开始分拨离场测试1"); | ||
207 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
208 | + .replace("${cross_weight}",cross_weight) | ||
209 | + .replace("${areaID}",areaID) | ||
210 | + .replace("${chnlNo}",chnlNo) | ||
211 | + .replace("${IETYPE}",ie) | ||
212 | + .replace("${barcode}",barcode); | ||
213 | + //进港提货测试 | ||
214 | + | ||
215 | + analysisRoute.setMessage(IMPORT_XML); | ||
216 | + analysisRoute.run(); | ||
217 | + } | ||
218 | + | ||
219 | + /** | ||
220 | + * 调拨申请查询 | ||
221 | + */ | ||
222 | + @Test | ||
223 | + public void allocate(){ | ||
224 | + LiftBar liftBar = new LiftBar(); | ||
225 | + liftBar.checkNmmsAllocate("160-14342370,172-36357112,180-66012590,82814608112"); | ||
226 | + } | ||
227 | + | ||
228 | + | ||
229 | +} |
@@ -3,7 +3,6 @@ package com.sy; | @@ -3,7 +3,6 @@ package com.sy; | ||
3 | import com.sy.bwAnalysis.AnalysisRoute; | 3 | import com.sy.bwAnalysis.AnalysisRoute; |
4 | import com.sy.logic.LiftBar; | 4 | import com.sy.logic.LiftBar; |
5 | import com.sy.utils.XMLThreadPoolFactory; | 5 | import com.sy.utils.XMLThreadPoolFactory; |
6 | -import org.apache.log4j.Logger; | ||
7 | import org.junit.Test; | 6 | import org.junit.Test; |
8 | import org.junit.runner.RunWith; | 7 | import org.junit.runner.RunWith; |
9 | import org.springframework.boot.test.context.SpringBootTest; | 8 | import org.springframework.boot.test.context.SpringBootTest; |
@@ -16,8 +15,7 @@ import java.util.concurrent.TimeUnit; | @@ -16,8 +15,7 @@ import java.util.concurrent.TimeUnit; | ||
16 | @SpringBootTest | 15 | @SpringBootTest |
17 | public class BeihuoTests { | 16 | public class BeihuoTests { |
18 | 17 | ||
19 | - | ||
20 | - private static final Logger logger = Logger.getLogger(LiftBar.class); | 18 | + private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(LiftBar.class); |
21 | 19 | ||
22 | private static ThreadPoolExecutor threadPoolEs = XMLThreadPoolFactory.instance("kakou"); | 20 | private static ThreadPoolExecutor threadPoolEs = XMLThreadPoolFactory.instance("kakou"); |
23 | private AnalysisRoute analysisRoute=new AnalysisRoute(); | 21 | private AnalysisRoute analysisRoute=new AnalysisRoute(); |
@@ -93,13 +91,72 @@ public class BeihuoTests { | @@ -93,13 +91,72 @@ public class BeihuoTests { | ||
93 | "\t</GATHER_INFO>\n" + | 91 | "\t</GATHER_INFO>\n" + |
94 | "</MSG>"; | 92 | "</MSG>"; |
95 | 93 | ||
94 | + public static String XML = "<MSG>\n" + | ||
95 | + "\t<META>\n" + | ||
96 | + "\t\t<SNDR>KAO</SNDR>\n" + | ||
97 | + "\t\t<RCVR/>\n" + | ||
98 | + "\t\t<SEQN>20220624063157</SEQN>\n" + | ||
99 | + "\t\t<DDTM>20220624063157</DDTM>\n" + | ||
100 | + "\t\t<TYPE>KAKO</TYPE>\n" + | ||
101 | + "\t\t<STYP>CARM</STYP>\n" + | ||
102 | + "\t</META>\n" + | ||
103 | + "\t<GATHER_INFO AREA_ID=\"0000000000\" CHNL_NO=\"0000000000\" I_E_TYPE=\"I\" SEQ_NO=\"123\">\n" + | ||
104 | + "\t\t<IC>\n" + | ||
105 | + "\t\t\t<DR_IC_NO/>\n" + | ||
106 | + "\t\t\t<IC_DR_CUSTOMS_NO/>\n" + | ||
107 | + "\t\t\t<IC_CO_CUSTOMS_NO/>\n" + | ||
108 | + "\t\t\t<IC_BILL_NO/>\n" + | ||
109 | + "\t\t\t<IC_GROSS_WT/>\n" + | ||
110 | + "\t\t\t<IC_VE_CUSTOMS_NO/>\n" + | ||
111 | + "\t\t\t<IC_VE_NAME/>\n" + | ||
112 | + "\t\t\t<IC_CONTA_ID/>\n" + | ||
113 | + "\t\t\t<IC_ESEAL_ID/>\n" + | ||
114 | + "\t\t\t<IC_EX_DATA/>\n" + | ||
115 | + "\t\t</IC>\n" + | ||
116 | + "\t\t<WEIGHT>\n" + | ||
117 | + "\t\t\t<GROSS_WT>22000</GROSS_WT>\n" + | ||
118 | + "\t\t</WEIGHT>\n" + | ||
119 | + "\t\t<CAR>\n" + | ||
120 | + "\t\t\t<VE_NAME/>\n" + | ||
121 | + "\t\t\t<CAR_EC_NO/>\n" + | ||
122 | + "\t\t\t<CAR_EC_NO2/>\n" + | ||
123 | + "\t\t\t<VE_CUSTOMS_NO/>\n" + | ||
124 | + "\t\t\t<VE_WT/>\n" + | ||
125 | + "\t\t</CAR>\n" + | ||
126 | + "\t\t<CONTA>\n" + | ||
127 | + "\t\t\t<CONTA_NUM/>\n" + | ||
128 | + "\t\t\t<CONTA_RECO/>\n" + | ||
129 | + "\t\t\t<CONTA_MODEL_F/>\n" + | ||
130 | + "\t\t\t<CONTA_MODEL_B/>\n" + | ||
131 | + "\t\t\t<CONTA_ID_F/>\n" + | ||
132 | + "\t\t\t<CONTA_ID_B/>\n" + | ||
133 | + "\t\t</CONTA>\n" + | ||
134 | + "\t\t<SEAL>\n" + | ||
135 | + "\t\t\t<ESEAL_ID/>\n" + | ||
136 | + "\t\t</SEAL>\n" + | ||
137 | + "\t\t<BAR_CODE>1111</BAR_CODE>\n" + | ||
138 | + "\t</GATHER_INFO>\n" + | ||
139 | + "</MSG>"; | ||
96 | /** | 140 | /** |
97 | - * 出口送货_进场测试 | 141 | + * 进场测试 |
98 | */ | 142 | */ |
99 | @Test | 143 | @Test |
100 | - public void exportDownload_I(){ | 144 | + public void exportDownload_I() throws InterruptedException { |
145 | + //车牌号 | ||
146 | + String voNo = "豫A61CR7"; | ||
147 | + //过卡重量 | ||
148 | + String cross_weight= "2000"; | ||
149 | + //场站编号 | ||
150 | + String areaID = "4604600000"; | ||
151 | + //通道编号 | ||
152 | + String chnlNo = "4604601011"; | ||
153 | + //进出场类型I/E | ||
154 | + String ie = "I"; | ||
155 | + //二维码 | ||
156 | + String barcode = "5198ad"; | ||
157 | + | ||
101 | logger.error("开始进场测试"); | 158 | logger.error("开始进场测试"); |
102 | - IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | 159 | + IMPORT_XML= XML.replace("${car}",voNo) |
103 | .replace("${cross_weight}",cross_weight) | 160 | .replace("${cross_weight}",cross_weight) |
104 | .replace("${areaID}",areaID) | 161 | .replace("${areaID}",areaID) |
105 | .replace("${chnlNo}",chnlNo) | 162 | .replace("${chnlNo}",chnlNo) |
@@ -108,21 +165,19 @@ public class BeihuoTests { | @@ -108,21 +165,19 @@ public class BeihuoTests { | ||
108 | //进港提货测试 | 165 | //进港提货测试 |
109 | 166 | ||
110 | analysisRoute.setMessage(IMPORT_XML); | 167 | analysisRoute.setMessage(IMPORT_XML); |
111 | - | 168 | + analysisRoute.run(); |
112 | } | 169 | } |
113 | 170 | ||
114 | /** | 171 | /** |
115 | - * 出口送货_出场测试 | 172 | + * 出场测试 |
116 | */ | 173 | */ |
117 | @Test | 174 | @Test |
118 | public void exportDownload_E(){ | 175 | public void exportDownload_E(){ |
119 | 176 | ||
120 | //车牌号 | 177 | //车牌号 |
121 | String voNo = "豫A61CR7"; | 178 | String voNo = "豫A61CR7"; |
122 | - //备案重量 | ||
123 | - String vo_weight = "2000"; | ||
124 | //过卡重量 | 179 | //过卡重量 |
125 | - String cross_weight= "2324"; | 180 | + String cross_weight= String.valueOf(2000); |
126 | //场站编号 | 181 | //场站编号 |
127 | String areaID = "4604600000"; | 182 | String areaID = "4604600000"; |
128 | //通道编号 | 183 | //通道编号 |
@@ -130,7 +185,7 @@ public class BeihuoTests { | @@ -130,7 +185,7 @@ public class BeihuoTests { | ||
130 | //进出场类型I/E | 185 | //进出场类型I/E |
131 | String ie = "E"; | 186 | String ie = "E"; |
132 | //二维码 | 187 | //二维码 |
133 | - String barcode = "613f5c"; | 188 | + String barcode = "5198ad"; |
134 | logger.error("开始出口送货离场测试"); | 189 | logger.error("开始出口送货离场测试"); |
135 | IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | 190 | IMPORT_XML= IMPORT_XML.replace("${car}",voNo) |
136 | .replace("${cross_weight}",cross_weight) | 191 | .replace("${cross_weight}",cross_weight) |
@@ -140,14 +195,175 @@ public class BeihuoTests { | @@ -140,14 +195,175 @@ public class BeihuoTests { | ||
140 | .replace("${barcode}",barcode); | 195 | .replace("${barcode}",barcode); |
141 | //进港提货测试 | 196 | //进港提货测试 |
142 | analysisRoute.setMessage(IMPORT_XML); | 197 | analysisRoute.setMessage(IMPORT_XML); |
143 | - threadPoolEs.execute(analysisRoute); | 198 | + analysisRoute.run(); |
144 | 199 | ||
145 | - System.out.println("[THREAD-INFI]-线程运行线程总数量 = " + threadPoolEs.getActiveCount()); | ||
146 | - System.out.println("[THREAD-INFI]-线程队列数量 = " + threadPoolEs.getQueue().size()); | ||
147 | - System.out.println("threadPoolEs.getCompletedTaskCount() = " + threadPoolEs.getCompletedTaskCount()); | ||
148 | - System.out.println("threadPoolEs.getKeepAliveTime(TimeUnit.SECONDS) = " + threadPoolEs.getKeepAliveTime(TimeUnit.SECONDS)); | ||
149 | - System.out.println("threadPoolEs.getTaskCount() = " + threadPoolEs.getTaskCount()); | ||
150 | } | 200 | } |
151 | 201 | ||
152 | 202 | ||
203 | + /** | ||
204 | + * 带货送货测试 | ||
205 | + */ | ||
206 | + @Test | ||
207 | + public void exportDownload_I_withGoods() { | ||
208 | + //车牌号 | ||
209 | + voNo = "豫A61CR7"; | ||
210 | + //过卡重量 | ||
211 | + cross_weight= "3000"; | ||
212 | + //场站编号 | ||
213 | + areaID = "4604600000"; | ||
214 | + //通道编号 | ||
215 | + chnlNo = "4604601011"; | ||
216 | + //进出场类型I/E | ||
217 | + ie = "I"; | ||
218 | + //二维码 | ||
219 | + barcode = "78825a"; | ||
220 | + message(); | ||
221 | + } | ||
222 | + | ||
223 | + @Test | ||
224 | + public void exportDownload_e_withGoods() { | ||
225 | + //车牌号 | ||
226 | + voNo = "豫A61CR7"; | ||
227 | + //过卡重量 | ||
228 | + cross_weight= String.valueOf(3000-402.00); | ||
229 | + //场站编号 | ||
230 | + areaID = "4604600000"; | ||
231 | + //通道编号 | ||
232 | + chnlNo = "4604600011"; | ||
233 | + //进出场类型I/E | ||
234 | + ie = "E"; | ||
235 | + //二维码 | ||
236 | + barcode = "78825a"; | ||
237 | + message(); | ||
238 | + } | ||
239 | + | ||
240 | + /** | ||
241 | + * 带货提货测试 | ||
242 | + */ | ||
243 | + @Test | ||
244 | + public void DLV_I_withGoods() { | ||
245 | + //车牌号 | ||
246 | + voNo = "豫A61CR7"; | ||
247 | + //过卡重量 | ||
248 | + cross_weight= "4000"; | ||
249 | + //场站编号 | ||
250 | + areaID = "4604600000"; | ||
251 | + //通道编号 | ||
252 | + chnlNo = "4604601011"; | ||
253 | + //进出场类型I/E | ||
254 | + ie = "I"; | ||
255 | + //二维码 | ||
256 | + barcode = "14e13a"; | ||
257 | + message(); | ||
258 | + } | ||
259 | + | ||
260 | + @Test | ||
261 | + public void DLV_e_withGoods() { | ||
262 | + //车牌号 | ||
263 | + voNo = "豫A61CR7"; | ||
264 | + //过卡重量 | ||
265 | + cross_weight= String.valueOf(4000+3000); | ||
266 | + //场站编号 | ||
267 | + areaID = "4604600000"; | ||
268 | + //通道编号 | ||
269 | + chnlNo = "4604600011"; | ||
270 | + //进出场类型I/E | ||
271 | + ie = "E"; | ||
272 | + //二维码 | ||
273 | + barcode = "14e13a"; | ||
274 | + message(); | ||
275 | + } | ||
276 | + | ||
277 | + | ||
278 | + /** | ||
279 | + * 分批送货,加带货送货一起了 | ||
280 | + */ | ||
281 | + @Test | ||
282 | + public void export_I_withGoodsSplit() { | ||
283 | + //车牌号 | ||
284 | + voNo = "豫A61CR7"; | ||
285 | + //过卡重量 | ||
286 | + cross_weight= "4000"; | ||
287 | + //场站编号 | ||
288 | + areaID = "4604600000"; | ||
289 | + //通道编号 | ||
290 | + chnlNo = "4604601011"; | ||
291 | + //进出场类型I/E | ||
292 | + ie = "I"; | ||
293 | + //二维码 | ||
294 | + barcode = "1498f9"; | ||
295 | + message(); | ||
296 | + } | ||
297 | + | ||
298 | + @Test | ||
299 | + public void export_E_withGoodsSplit() { | ||
300 | + //车牌号 | ||
301 | + voNo = "豫A61CR7"; | ||
302 | + //过卡重量 | ||
303 | + cross_weight= String.valueOf(4000-2742); | ||
304 | + //场站编号 | ||
305 | + areaID = "4604600000"; | ||
306 | + //通道编号 | ||
307 | + chnlNo = "4604600011"; | ||
308 | + //进出场类型I/E | ||
309 | + ie = "E"; | ||
310 | + //二维码 | ||
311 | + barcode = "1498f9"; | ||
312 | + message(); | ||
313 | + } | ||
314 | + | ||
315 | + /** | ||
316 | + * 分批提货+带货提货 | ||
317 | + */ | ||
318 | + @Test | ||
319 | + public void dlv_I_withGoodsSplit() { | ||
320 | + //车牌号 | ||
321 | + voNo = "豫A61CR7"; | ||
322 | + //过卡重量 | ||
323 | + cross_weight= "4000"; | ||
324 | + //场站编号 | ||
325 | + areaID = "4604600000"; | ||
326 | + //通道编号 | ||
327 | + chnlNo = "4604601011"; | ||
328 | + //进出场类型I/E | ||
329 | + ie = "I"; | ||
330 | + //二维码 | ||
331 | + barcode = "7d0368"; | ||
332 | + message(); | ||
333 | + } | ||
334 | + | ||
335 | + @Test | ||
336 | + public void dlv_E_withGoodsSplit() { | ||
337 | + //车牌号 | ||
338 | + voNo = "豫A61CR7"; | ||
339 | + //过卡重量 | ||
340 | + cross_weight= String.valueOf(4000+2700); | ||
341 | + //场站编号 | ||
342 | + areaID = "4604600000"; | ||
343 | + //通道编号 | ||
344 | + chnlNo = "4604600011"; | ||
345 | + //进出场类型I/E | ||
346 | + ie = "E"; | ||
347 | + //二维码 | ||
348 | + barcode = "7d0368"; | ||
349 | + message(); | ||
350 | + } | ||
351 | + | ||
352 | + /** | ||
353 | + * | ||
354 | + */ | ||
355 | + public void message(){ | ||
356 | + logger.error("开始进场测试"); | ||
357 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
358 | + .replace("${cross_weight}",cross_weight) | ||
359 | + .replace("${areaID}",areaID) | ||
360 | + .replace("${chnlNo}",chnlNo) | ||
361 | + .replace("${IETYPE}",ie) | ||
362 | + .replace("${barcode}",barcode); | ||
363 | + //进港提货测试 | ||
364 | + | ||
365 | + analysisRoute.setMessage(IMPORT_XML); | ||
366 | + analysisRoute.run(); | ||
367 | + } | ||
368 | + | ||
153 | } | 369 | } |
1 | +package com.sy; | ||
2 | + | ||
3 | +import com.sy.bwAnalysis.AnalysisRoute; | ||
4 | +import com.sy.logic.LiftBar; | ||
5 | +import com.sy.utils.XMLThreadPoolFactory; | ||
6 | +import org.junit.Test; | ||
7 | +import org.junit.runner.RunWith; | ||
8 | +import org.springframework.boot.test.context.SpringBootTest; | ||
9 | +import org.springframework.test.context.junit4.SpringRunner; | ||
10 | + | ||
11 | +import java.util.concurrent.ThreadPoolExecutor; | ||
12 | + | ||
13 | +/** | ||
14 | + * 调拨测试 | ||
15 | + */ | ||
16 | +@RunWith(SpringRunner.class) | ||
17 | +@SpringBootTest | ||
18 | +public class BeihuoTransfersTests { | ||
19 | + | ||
20 | + private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(LiftBar.class); | ||
21 | + | ||
22 | + private static ThreadPoolExecutor threadPoolEs = XMLThreadPoolFactory.instance("kakou"); | ||
23 | + private AnalysisRoute analysisRoute=new AnalysisRoute(); | ||
24 | + | ||
25 | + //车牌号 | ||
26 | + private String voNo = "豫A61CR8"; | ||
27 | + //备案重量 | ||
28 | + private String vo_weight = "4200"; | ||
29 | + //过卡重量 | ||
30 | + private String cross_weight= "2324"; | ||
31 | + //场站编号 | ||
32 | + private String areaID = "4604600000"; | ||
33 | + //通道编号 | ||
34 | + private String chnlNo = "4604601010"; | ||
35 | + //进出场类型I/E | ||
36 | + private String ie = "I"; | ||
37 | + //二维码 | ||
38 | + private String barcode = "613f5c"; | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + //进通道报文 | ||
43 | + private static String IMPORT_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + | ||
44 | + "<MSG>\n" + | ||
45 | + "\t<META>\n" + | ||
46 | + "\t\t<SNDR>KAO</SNDR>\n" + | ||
47 | + "\t\t<RCVR/>\n" + | ||
48 | + "\t\t<SEQN>20220624063157</SEQN>\n" + | ||
49 | + "\t\t<DDTM>20220624063157</DDTM>\n" + | ||
50 | + "\t\t<TYPE>KAKO</TYPE>\n" + | ||
51 | + "\t\t<STYP>CARM</STYP>\n" + | ||
52 | + "\t</META>\n" + | ||
53 | + "\t<GATHER_INFO AREA_ID=\"${areaID}\" CHNL_NO=\"${chnlNo}\" I_E_TYPE=\"${IETYPE}\" SEQ_NO=\"20220624063118000004\">\n" + | ||
54 | + "\t\t<IC>\n" + | ||
55 | + "\t\t\t<DR_IC_NO/>\n" + | ||
56 | + "\t\t\t<IC_DR_CUSTOMS_NO/>\n" + | ||
57 | + "\t\t\t<IC_CO_CUSTOMS_NO/>\n" + | ||
58 | + "\t\t\t<IC_BILL_NO/>\n" + | ||
59 | + "\t\t\t<IC_FORM_TYPE/>\n" + | ||
60 | + "\t\t\t<IC_GROSS_WT/>\n" + | ||
61 | + "\t\t\t<IC_VE_CUSTOMS_NO/>\n" + | ||
62 | + "\t\t\t<IC_VE_NAME/>\n" + | ||
63 | + "\t\t\t<IC_CONTA_ID/>\n" + | ||
64 | + "\t\t\t<IC_ESEAL_ID/>\n" + | ||
65 | + "\t\t\t<IC_REG_DATETIME/>\n" + | ||
66 | + "\t\t\t<IC_PER_DAY_DUE/>\n" + | ||
67 | + "\t\t\t<GPS_ID/>\n" + | ||
68 | + "\t\t</IC>\n" + | ||
69 | + "\t\t<WEIGHT>\n" + | ||
70 | + "\t\t\t<GROSS_WT>${cross_weight}</GROSS_WT>\n" + | ||
71 | + "\t\t</WEIGHT>\n" + | ||
72 | + "\t\t<CAR>\n" + | ||
73 | + "\t\t\t<VE_NAME>${car}</VE_NAME>\n" + | ||
74 | + "\t\t\t<CAR_EC_NO/>\n" + | ||
75 | + "\t\t\t<CAR_EC_NO2/>\n" + | ||
76 | + "\t\t\t<VE_CUSTOMS_NO/>\n" + | ||
77 | + "\t\t\t<VE_WT/>\n" + | ||
78 | + "\t\t</CAR>\n" + | ||
79 | + "\t\t<CONTA>\n" + | ||
80 | + "\t\t\t<CONTA_NUM/>\n" + | ||
81 | + "\t\t\t<CONTA_RECO>1</CONTA_RECO>\n" + | ||
82 | + "\t\t\t<CONTA_ID_F/>\n" + | ||
83 | + "\t\t\t<CONTA_ID_B/>\n" + | ||
84 | + "\t\t\t<CONTA_MODEL_F/>\n" + | ||
85 | + "\t\t\t<CONTA_MODEL_B/>\n" + | ||
86 | + "\t\t</CONTA>\n" + | ||
87 | + "\t\t<ORDER_NUM/>\n" + | ||
88 | + "\t\t<BAR_CODE>${barcode}</BAR_CODE>\n" + | ||
89 | + "\t\t<SEAL>\n" + | ||
90 | + "\t\t\t<ESEAL_ID/>\n" + | ||
91 | + "\t\t\t<SEAL_KEY/>\n" + | ||
92 | + "\t\t</SEAL>\n" + | ||
93 | + "\t</GATHER_INFO>\n" + | ||
94 | + "</MSG>"; | ||
95 | + | ||
96 | + | ||
97 | + | ||
98 | + /** | ||
99 | + * 分拨业务_进场测试_入场提货_第一场站_空车进北货 | ||
100 | + */ | ||
101 | + @Test | ||
102 | + public void allocate_I1() throws InterruptedException { | ||
103 | + //车牌号 | ||
104 | + String voNo = "豫A61CR8"; | ||
105 | + //过卡重量 | ||
106 | + String cross_weight= "4200"; | ||
107 | + //场站编号-综保区 | ||
108 | + String areaID = "4600329012"; | ||
109 | + //通道编号-主卡 | ||
110 | + String chnlNo = "4600011005"; | ||
111 | + //进出场类型I/E | ||
112 | + String ie = "I"; | ||
113 | + //二维码 | ||
114 | + String barcode = "9aeb41"; | ||
115 | + | ||
116 | + logger.error("开始出口调拨业务进场测试1"); | ||
117 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
118 | + .replace("${cross_weight}",cross_weight) | ||
119 | + .replace("${areaID}",areaID) | ||
120 | + .replace("${chnlNo}",chnlNo) | ||
121 | + .replace("${IETYPE}",ie) | ||
122 | + .replace("${barcode}",barcode); | ||
123 | + //进港提货测试 | ||
124 | + | ||
125 | + analysisRoute.setMessage(IMPORT_XML); | ||
126 | + analysisRoute.run(); | ||
127 | + } | ||
128 | + | ||
129 | + /** | ||
130 | + * 分拨业务_离场测试_提货离场_第一场站_提货出北货 | ||
131 | + */ | ||
132 | + @Test | ||
133 | + public void allocate_E1() throws InterruptedException { | ||
134 | + //车牌号 | ||
135 | + String voNo = "豫A61CR8"; | ||
136 | + //过卡重量 | ||
137 | + String cross_weight= String.valueOf(4200+1701.00); | ||
138 | + //场站编号-综保区 | ||
139 | + String areaID = "4600329012"; | ||
140 | + //通道编号-主卡6 | ||
141 | + String chnlNo = "4600010006"; | ||
142 | + //进出场类型I/E | ||
143 | + String ie = "E"; | ||
144 | + //二维码 | ||
145 | + String barcode = "9aeb41"; | ||
146 | + | ||
147 | + logger.error("开始分拨离场测试1"); | ||
148 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
149 | + .replace("${cross_weight}",cross_weight) | ||
150 | + .replace("${areaID}",areaID) | ||
151 | + .replace("${chnlNo}",chnlNo) | ||
152 | + .replace("${IETYPE}",ie) | ||
153 | + .replace("${barcode}",barcode); | ||
154 | + //进港提货测试 | ||
155 | + | ||
156 | + analysisRoute.setMessage(IMPORT_XML); | ||
157 | + analysisRoute.run(); | ||
158 | + } | ||
159 | + | ||
160 | + /** | ||
161 | + * 分拨业务_进场测试_入场提货_第二场站_载货进第二场站 | ||
162 | + */ | ||
163 | + @Test | ||
164 | + public void allocate_I2() throws InterruptedException { | ||
165 | + //车牌号 | ||
166 | + String voNo = "豫A61CR8"; | ||
167 | + //过卡重量 | ||
168 | + String cross_weight= String.valueOf(4200+1701.00); | ||
169 | + //场站编号-北货站 | ||
170 | + String areaID = "4604600000"; | ||
171 | + //通道编号-三号进 | ||
172 | + String chnlNo = "4604601030"; | ||
173 | + //进出场类型I/E | ||
174 | + String ie = "I"; | ||
175 | + //二维码 | ||
176 | + String barcode = "9aeb41"; | ||
177 | + | ||
178 | + logger.error("开始调拨业务进场测试2,带货入场"); | ||
179 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
180 | + .replace("${cross_weight}",cross_weight) | ||
181 | + .replace("${areaID}",areaID) | ||
182 | + .replace("${chnlNo}",chnlNo) | ||
183 | + .replace("${IETYPE}",ie) | ||
184 | + .replace("${barcode}",barcode); | ||
185 | + //进港提货测试 | ||
186 | + | ||
187 | + analysisRoute.setMessage(IMPORT_XML); | ||
188 | + analysisRoute.run(); | ||
189 | + } | ||
190 | + | ||
191 | + /** | ||
192 | + * 分拨业务_离场测试_提货离场_第一场站_提货出北货 | ||
193 | + */ | ||
194 | + @Test | ||
195 | + public void allocate_E2() throws InterruptedException { | ||
196 | + //车牌号 | ||
197 | + String voNo = "豫A61CR8"; | ||
198 | + //过卡重量 | ||
199 | + String cross_weight= String.valueOf(4200); | ||
200 | + //场站编号-北货 | ||
201 | + String areaID = "4604600000"; | ||
202 | + //通道编号 | ||
203 | + String chnlNo = "4604600030"; | ||
204 | + //进出场类型I/E | ||
205 | + String ie = "E"; | ||
206 | + //二维码 | ||
207 | + String barcode = "9aeb41"; | ||
208 | + | ||
209 | + logger.error("开始调拨离场测试2"); | ||
210 | + IMPORT_XML= IMPORT_XML.replace("${car}",voNo) | ||
211 | + .replace("${cross_weight}",cross_weight) | ||
212 | + .replace("${areaID}",areaID) | ||
213 | + .replace("${chnlNo}",chnlNo) | ||
214 | + .replace("${IETYPE}",ie) | ||
215 | + .replace("${barcode}",barcode); | ||
216 | + //进港提货测试 | ||
217 | + | ||
218 | + analysisRoute.setMessage(IMPORT_XML); | ||
219 | + analysisRoute.run(); | ||
220 | + } | ||
221 | + | ||
222 | + | ||
223 | +} |
-
请 注册 或 登录 后发表评论