作者 xudada

空车业务类型过卡校验

... ... @@ -215,6 +215,15 @@ public class LiftBar {
// 出场校验根据业务类型
logger.info("[进出场申请]-业务类型为:"+list.getCocode()+list.getBusinesstype());
switch (list.getBusinesstype()){
case "空车业务":
if(logic.weightCheckHandleService.checkEmpty(growssWt,selfWt)){
checkResult=true;
}else{
logger.error("[空车业务]-出场重量未通过校验:"+GROWSSEXCETION);
logic.sendBw(info,false,GROWSSEXCETION,list,listinfos);
return false;
}
break;
case "出口转关":
case "出口送货":
if (logic.weightCheckHandleService.checkExportDownLoading(growssWt, Double.parseDouble(ve.getSelfWt()), goodsWt,inWt)){
... ...
... ... @@ -47,4 +47,13 @@ public interface WeightCheckHandleService {
* @return 返回校验结果 true 通过,false 不通过
*/
boolean checkAllocateOrDispatch(double grossWt, double wt, double goodsWt,double inWt);
/**
* 空车业务重量校验
* 过磅重量 = 车备案自重
* @param grossWt 地磅称重,也称出场过磅重量
* @param wt 车辆自重
* 误差计算方式 (过磅重量 - 车备案重量) / 过磅重量 与 误差比对,超过误差则不放行
* @return 返回校验结果 true 通过,false 不通过
*/
boolean checkEmpty(double grossWt,double wt);
}
... ...
... ... @@ -179,6 +179,23 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService {
}
return flag;
}
/**
* 判断备案车重与地磅称重是否在合理范围
*
* @param grossWt
* @param wt
* @return
*/
@Override
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));
if (reult <= valueDob()) {
flag = true;
}
return flag;
}
/**
* 判断备案车重与运单重量和地磅称重是否在合理范围
... ...