...
|
...
|
@@ -3,7 +3,8 @@ package com.sy.service.impl; |
|
|
import com.sy.logic.LiftBar;
|
|
|
import com.sy.service.WeightCheckHandleService;
|
|
|
import com.sy.utils.FileTool;
|
|
|
import org.apache.log4j.Logger;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
...
|
...
|
@@ -12,8 +13,7 @@ import java.text.ParseException; |
|
|
|
|
|
@Service
|
|
|
public class WeightCheckHandleServiceImpl implements WeightCheckHandleService {
|
|
|
|
|
|
private static final Logger logger = Logger.getLogger(WeightCheckHandleServiceImpl.class);
|
|
|
private static final Logger logger = LoggerFactory.getLogger(LiftBar.class);
|
|
|
|
|
|
//从配置文件中读取货物重差可控范围
|
|
|
private static String checkWt = FileTool.readProperties("grossWt");
|
...
|
...
|
@@ -73,9 +73,10 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
double result2= 0.0;
|
|
|
if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){
|
|
|
result = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt));
|
|
|
System.out.println("进出场比对差值:"+result);
|
|
|
|
|
|
result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt));
|
|
|
System.out.println("空车出场差值:"+result2);
|
|
|
|
|
|
logger.info("[WEIGHT-CHECK]-进出场比对差值:{},空车出场差值:{},进出场比对重量差:{},空车比对重量差:{}",result,result2,Math.abs(inWt - goodsWt - grossWt),Math.abs(grossWt-wt));
|
|
|
}
|
|
|
double range = valueDob();
|
|
|
if (result <= range || result2 <= range) {
|
...
|
...
|
@@ -117,8 +118,8 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
result1 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt));
|
|
|
}
|
|
|
double range = valueDob();
|
|
|
System.out.println("进出场差值:"+result);
|
|
|
System.out.println("提货离场差值:"+result1);
|
|
|
logger.info("[WEIGHT-CHECK]-进出场比对差值:{},提货离场差值:{},进出场比对重量差:{}",result,result1,Math.abs(inWt - grossWt));
|
|
|
|
|
|
|
|
|
if (result <= range) {
|
|
|
|
...
|
...
|
@@ -148,7 +149,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
*/
|
|
|
@Override
|
|
|
public boolean checkAllocateOrDispatch(double grossWt, double wt, double goodsWt,double inWt){
|
|
|
//todo:调拨分拨中的第二.三...场站的如卡口判断 都应该以带货入场进行判定.离场都应该已空车进行判定.
|
|
|
//todo:调拨分拨中的第二.三...场站的如卡口判断 都应该以带货入场进行判定.离场都应该以空车进行判定.
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
boolean flag = false;
|
|
|
//载货离场判定
|
...
|
...
|
|