diff --git a/pom.xml b/pom.xml index f754fbd..d784eee 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ <groupId>com.sy</groupId> <artifactId>analysis_imf</artifactId> - <version>0.0.1-SNAPSHOT</version> + <version>2.1-BH-SNAPSHOT</version> <packaging>jar</packaging> <name>analysis_imf</name> diff --git a/src/main/java/com/sy/IMF/IMF_Tesk.java b/src/main/java/com/sy/IMF/IMF_Tesk.java index 4b8bf39..6fb546c 100644 --- a/src/main/java/com/sy/IMF/IMF_Tesk.java +++ b/src/main/java/com/sy/IMF/IMF_Tesk.java @@ -17,7 +17,8 @@ public class IMF_Tesk { public static boolean isSuc = true; public static IMFClient client = null; -// @Scheduled(fixedRate = 5000) + //todo:测试关,生产开 + @Scheduled(fixedRate = 5000) private static void start() { //尝试catch SDK异常 try{ diff --git a/src/main/java/com/sy/IMF/KAKO_Reader.java b/src/main/java/com/sy/IMF/KAKO_Reader.java index bff22ae..ffe6c0c 100644 --- a/src/main/java/com/sy/IMF/KAKO_Reader.java +++ b/src/main/java/com/sy/IMF/KAKO_Reader.java @@ -31,7 +31,7 @@ public class KAKO_Reader extends Thread{ while(true) { if (IMF_Tesk.LOGIN_OK){ String message = this.client.getMSG(); - logger.info(t.toString()+"读取线程已获取到消息"); +// logger.info(t.toString()+"读取线程已获取到消息"); if (StringUtils.isNotEmpty(message)) { // logger.info(message); analysisRoute = new AnalysisRoute(); @@ -48,7 +48,8 @@ public class KAKO_Reader extends Thread{ // this.client.sendMSG(); // } }else { - logger.info("[READER-INFO]-获取到空消息,不处理"); +// logger.info("[READER-INFO]-获取到空消息,不处理"); +// System.out.println("[READER-INFO]-获取到空消息,不处理"); } } else { diff --git a/src/main/java/com/sy/logic/LiftBar.java b/src/main/java/com/sy/logic/LiftBar.java index c0f02f4..eef387c 100644 --- a/src/main/java/com/sy/logic/LiftBar.java +++ b/src/main/java/com/sy/logic/LiftBar.java @@ -195,12 +195,17 @@ public class LiftBar { //货物类型判断,直接放行的.todo:这个逻辑比较强大,后期要看怎么处理 }else if(!"普通货物".equals(list.getCocode()) && !"转关货物".equals(list.getCocode())){ //todo:比如货物类型为快件货物,只走重量校验,不走放行信息等校验. + //todo:退库货物可以关联货运系统,得到退库信息进行比对 + //todo:查验货物走查验信息比对 + //todo:快件暂不校验直接放行,不过得录单 + //todo:换单货物校验逻辑待定 logger.info("车辆装载货物为:"+list.getCocode()); checkResult=true; }else { // 出场校验根据业务类型 logger.info("[进出场申请]-业务类型为:"+list.getCocode()+list.getBusinesstype()); switch (list.getBusinesstype()){ + case "出口转关": case "出口送货": if (logic.weightCheckHandleService.checkExportDownLoading(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt)){ checkResult=true; @@ -333,8 +338,9 @@ public class LiftBar { int count=logic.listService.selectlaststation(list.getTrailerFrameNo(),list.getBarcode()); //二维码失效 if(count==0){ - //测试注释掉 -// buildBarCode.cancleBarCode(vaName); + //todo:测试注释掉,二维码释放 + logger.info("[进出场申请]-二维码释放:"+vaName); + buildBarCode.cancleBarCode(vaName); } /** @@ -662,7 +668,8 @@ public class LiftBar { */ public Map nmmsAllocate(@NotNull String waybill){ logger.info("新舱单查询分拨申请数据开始"); - Map map = logic.nmmsService.getAllocate(waybill,0,10); + Feign_Allocate_Search feignAllocateSearch = new Feign_Allocate_Search(waybill,0,10); + Map map = logic.nmmsService.getAllocate(feignAllocateSearch); logger.info(""+map); return map; } diff --git a/src/main/java/com/sy/model/Feign_Allocate_Search.java b/src/main/java/com/sy/model/Feign_Allocate_Search.java new file mode 100644 index 0000000..bb1711e --- /dev/null +++ b/src/main/java/com/sy/model/Feign_Allocate_Search.java @@ -0,0 +1,13 @@ +package com.sy.model; + +public class Feign_Allocate_Search { + public String waybill; + public Integer pageIndex=0; + public Integer pageSize = 10; + + public Feign_Allocate_Search(String waybill, Integer pageIndex, Integer pageSize) { + this.waybill = waybill; + this.pageIndex = pageIndex; + this.pageSize = pageSize; + } +} diff --git a/src/main/java/com/sy/service/NmmsService.java b/src/main/java/com/sy/service/NmmsService.java index 3348b85..a359a2c 100644 --- a/src/main/java/com/sy/service/NmmsService.java +++ b/src/main/java/com/sy/service/NmmsService.java @@ -1,13 +1,11 @@ package com.sy.service; -import com.sy.service.impl.MessageServiceHystrix; +import com.sy.model.Feign_Allocate_Search; import com.sy.service.impl.NmmsServiceHystrix; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import java.util.Map; @@ -20,12 +18,8 @@ import java.util.Map; public interface NmmsService { @ResponseBody - @PostMapping("/Allocate/querypage_inportallocate") - Map getAllocate( - @RequestParam(value = "waybill", required = true) String waybill, - @RequestParam(value = "pageIndex", required = true,defaultValue = "0") int pageIndex, - @RequestParam(value = "pageSize", required = true,defaultValue = "10") int pageSize - ); + @PostMapping(value = "/Allocate/querypage_inportallocate") + Map getAllocate(@RequestBody Feign_Allocate_Search feignAllocateSearch); } diff --git a/src/main/java/com/sy/service/impl/NmmsServiceHystrix.java b/src/main/java/com/sy/service/impl/NmmsServiceHystrix.java index 3649909..f47c219 100644 --- a/src/main/java/com/sy/service/impl/NmmsServiceHystrix.java +++ b/src/main/java/com/sy/service/impl/NmmsServiceHystrix.java @@ -1,5 +1,6 @@ package com.sy.service.impl; +import com.sy.model.Feign_Allocate_Search; import com.sy.service.NmmsService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -13,8 +14,8 @@ public class NmmsServiceHystrix implements NmmsService { private static final Logger logger = LoggerFactory.getLogger(NmmsServiceHystrix.class); @Override - public Map<String, Object> getAllocate(String waybill, int pageIndex, int pageSize) { - logger.error("查询分拨申请数据失败,{}",waybill); + public Map<String, Object> getAllocate(Feign_Allocate_Search feignAllocateSearch) { + logger.error("feign查询分拨申请数据失败,{}",feignAllocateSearch.waybill); return new HashMap<>(); } } diff --git a/src/main/java/com/sy/service/impl/WeightCheckHandleServiceImpl.java b/src/main/java/com/sy/service/impl/WeightCheckHandleServiceImpl.java index f2af1b8..e7ae934 100644 --- a/src/main/java/com/sy/service/impl/WeightCheckHandleServiceImpl.java +++ b/src/main/java/com/sy/service/impl/WeightCheckHandleServiceImpl.java @@ -101,11 +101,17 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { boolean flag = false; double result= 0.00; double result1= 0.00; + double result2= 0.00; + double emptyOut= 0.00; if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){ //进场过磅重量+带货重量 = 出场过磅重量 result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); //todo:这里没有加空车离场判定,暂时不加,进口提货业务空车离场走空车验放判定系统. + result2 = Double.parseDouble(df.format(Math.abs((inWt - grossWt)) / grossWt)); + + //个别原因不提货了,空车离场 + emptyOut = Double.parseDouble(df.format(Math.abs((wt - grossWt)) / grossWt)); //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 result1 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt)); @@ -119,11 +125,11 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { flag = true; } -// //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 -// if (result1 <= range) { -// -// return true; -// } + //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 + if (result1 <= range || result2 <= range || emptyOut <= range) { + + return true; + } return flag; } diff --git a/src/main/java/com/sy/task/TaskAnalysis.java b/src/main/java/com/sy/task/TaskAnalysis.java index dbd1ed7..bdb4736 100644 --- a/src/main/java/com/sy/task/TaskAnalysis.java +++ b/src/main/java/com/sy/task/TaskAnalysis.java @@ -74,7 +74,7 @@ public class TaskAnalysis { private void threadJbob(File file,CountDownLatch latch,String transToCfps,ThreadPoolExecutor threadPool){ try{ AnalysisRoute analysisRoute=new AnalysisRoute(); - String message = com.sy.utils.FileTool.readfile(file); + String message = com.sy.utils.FileTool.readfile(file,"UTF-8"); analysisRoute.setMessage(message); threadPool.execute(analysisRoute); FileUtils.moveFileToDirectory(file,new File("bw/handled/"),true);