作者 朱兆平

分拨业务查询优化,进场提货增加指令判定

... ... @@ -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>
... ...
... ... @@ -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{
... ...
... ... @@ -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 {
... ...
... ... @@ -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;
}
... ...
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;
}
}
... ...
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);
}
... ...
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<>();
}
}
... ...
... ... @@ -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;
}
... ...
... ... @@ -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);
... ...