作者 朱兆平

离场货物重量取离场申请数据

@@ -198,6 +198,11 @@ public class LiftBar { @@ -198,6 +198,11 @@ public class LiftBar {
198 logger.info("车辆装载货物为:"+list.getCocode()); 198 logger.info("车辆装载货物为:"+list.getCocode());
199 checkResult=true; 199 checkResult=true;
200 }else { 200 }else {
  201 + /**
  202 + * 因为货代老是进场后修改提货运单信息,造成申请单的进场货重与离场货重不匹配
  203 + * 进口提货,货物重量取进场提货的货物重量
  204 + */
  205 + goodsWt = Double.parseDouble(list.getRemark());
201 // 出场校验根据业务类型 206 // 出场校验根据业务类型
202 logger.info("[进出场申请]-业务类型为:"+list.getCocode()+list.getBusinesstype()); 207 logger.info("[进出场申请]-业务类型为:"+list.getCocode()+list.getBusinesstype());
203 switch (list.getBusinesstype()){ 208 switch (list.getBusinesstype()){
@@ -104,6 +104,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { @@ -104,6 +104,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService {
104 double result1= 0.00; 104 double result1= 0.00;
105 double result2= 0.00; 105 double result2= 0.00;
106 double emptyOut= 0.00; 106 double emptyOut= 0.00;
  107 + double goodCheckResult= 0.00;
107 if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){ 108 if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){
108 //进场过磅重量+带货重量 = 出场过磅重量 109 //进场过磅重量+带货重量 = 出场过磅重量
109 result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); 110 result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt));
@@ -116,8 +117,12 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { @@ -116,8 +117,12 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService {
116 117
117 //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 118 //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭
118 result1 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt)); 119 result1 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt));
  120 +
  121 + //货重误差
  122 + goodCheckResult = Double.parseDouble(df.format(Math.abs((grossWt-inWt-goodsWt)) / goodsWt));
119 } 123 }
120 double range = valueDob(); 124 double range = valueDob();
  125 + logger.info("[WEIGHT-CHECK]-实际离场拉货重量:{},申请离场拉货重量:{},货重差值:{},货重误差:{}",grossWt-inWt,goodsWt,grossWt-inWt-goodsWt,goodCheckResult);
121 logger.info("[WEIGHT-CHECK]-进出场比对差值:{},提货离场差值:{},进出场比对重量差:{}",result,result1,Math.abs(inWt - grossWt)); 126 logger.info("[WEIGHT-CHECK]-进出场比对差值:{},提货离场差值:{},进出场比对重量差:{}",result,result1,Math.abs(inWt - grossWt));
122 127
123 128
  1 +package com.sy.service.impl;
  2 +
  3 +import com.sy.service.WeightCheckHandleService;
  4 +import org.junit.jupiter.api.Test;
  5 +import org.junit.runner.RunWith;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.boot.test.context.SpringBootTest;
  8 +import org.springframework.test.context.junit4.SpringRunner;
  9 +
  10 +import static org.junit.jupiter.api.Assertions.*;
  11 +
  12 +@SpringBootTest
  13 +class WeightCheckHandleServiceImplTest {
  14 +
  15 + @Autowired
  16 + WeightCheckHandleService weightCheckHandleService;
  17 +
  18 + @Test
  19 + void checkExportDownLoading() {
  20 + }
  21 +
  22 + @Test
  23 + void checkImportDlv() {
  24 + weightCheckHandleService.checkImportDlv(27870,19000,6245,19620);
  25 + }
  26 +
  27 + @Test
  28 + void checkAllocateOrDispatch() {
  29 + }
  30 +}