...
|
...
|
@@ -58,7 +58,8 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
* @param wt 车辆自重
|
|
|
* @param goodsWt 货物总重
|
|
|
* @param inWt 进场过磅重量
|
|
|
* 误差计算方式 (应该出场重量 - 出场重量) / 出场重量 与 误差比对,超过误差则不放行
|
|
|
* 误差计算方式 (应该出场重量 - 出场重量) / 出场重量 与 误差比对,超过误差则不放行(规则取消)
|
|
|
* 误差计算方式 (应该出场重量 - 出场重量) / 货物重量 与 误差比对,超过误差则不放行(新规)
|
|
|
* @return 返回校验结果 true 通过,false 不通过
|
|
|
*/
|
|
|
@Override
|
...
|
...
|
@@ -83,7 +84,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){
|
|
|
result = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt));
|
|
|
|
|
|
result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt));
|
|
|
result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / wt));
|
|
|
|
|
|
log.info("[WEIGHT-CHECK]-进出场比对差值:{},空车出场差值:{},进出场比对重量差:{},空车比对重量差:{}",result,result2,Math.abs(inWt - goodsWt - grossWt),Math.abs(grossWt-wt));
|
|
|
}
|
...
|
...
|
@@ -107,7 +108,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){
|
|
|
//空车入场判定,入场重量-车辆备案重量
|
|
|
emptyIN = Double.parseDouble(df.format(Math.abs((wt - grossWt)) / grossWt));
|
|
|
emptyIN = Double.parseDouble(df.format(Math.abs((wt - grossWt)) / wt));
|
|
|
|
|
|
double range = valueDob();
|
|
|
|
...
|
...
|
@@ -141,7 +142,8 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
double goodCheckResult= 0.00;
|
|
|
if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){
|
|
|
//进场过磅重量+带货重量 = 出场过磅重量
|
|
|
result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt));
|
|
|
// result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt));
|
|
|
result = Double.parseDouble(df.format(Math.abs((grossWt-wt-goodsWt)) / goodsWt));
|
|
|
|
|
|
//带货提货,不提货判定,非空车离场
|
|
|
result2 = Double.parseDouble(df.format(Math.abs((inWt - grossWt)) / grossWt));
|
...
|
...
|
@@ -207,9 +209,10 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
//带货出,入场重量+带货重量 = 离场重量
|
|
|
result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt));
|
|
|
//带货出,用车辆备案重量对碰,车辆备案重量+带货重量 = 离场重量
|
|
|
result4 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt));
|
|
|
// result4 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt));
|
|
|
result4 = Double.parseDouble(df.format(Math.abs((grossWt-wt-goodsWt)) / goodsWt));
|
|
|
//空车出,过磅重量 = 车辆备案重量
|
|
|
result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt));
|
|
|
result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / wt));
|
|
|
//卸货出,入场重量-卸货重量 = 离场重量
|
|
|
result3 = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt));
|
|
|
System.out.println("进场提货离场差值:"+result);
|
...
|
...
|
@@ -218,7 +221,11 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
System.out.println("备案重量进场装载货物离场差值:"+result4);
|
|
|
}
|
|
|
double range = valueDob();
|
|
|
if (result <= range || result2 <= range || result3 <= range || result4 <= range) {
|
|
|
if (result2 <= range
|
|
|
// || result <= range
|
|
|
// || result3 <= range
|
|
|
|| result4 <= range
|
|
|
) {
|
|
|
flag = true;
|
|
|
}
|
|
|
return flag;
|
...
|
...
|
@@ -234,7 +241,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { |
|
|
public boolean checkEmpty(double grossWt, double wt) {
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
boolean flag=false;
|
|
|
double reult = Double.parseDouble(df.format(Math.abs((grossWt - wt)) / grossWt));
|
|
|
double reult = Double.parseDouble(df.format(Math.abs((grossWt - wt)) / wt));
|
|
|
if (reult <= valueDob()) {
|
|
|
flag = true;
|
|
|
}
|
...
|
...
|
|