This commit is contained in:
linfso 2024-04-29 17:57:29 +08:00
parent 3dfef50536
commit 3de5779fc2

View File

@ -461,7 +461,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
public void calcSettledWeight(EmisWaybill emisWaybill) throws CalcException {
if (
StringUtils.isAnyEmpty(emisWaybill.getProductType(), emisWaybill.getTransLineType())
StringUtils.isEmpty(emisWaybill.getProductType())
|| emisWaybill.getBillWeight() == null
|| emisWaybill.getTotalVolume() == null
)
@ -473,12 +473,17 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
double billWeight=emisWaybill.getBillWeight().doubleValue();
double totalVolume=emisWaybill.getTotalVolume().doubleValue();
// 获取产品信息
EmisTransProduct emisTransProduct = getTransProductByCode(emisWaybill.getProductType());
// 获取泡重比,计算体积重量
EmisTransLine emisTransLine= getTransLineByCode(emisWaybill.getTransLineType());
EmisTransLine emisTransLine= getTransLineByCode(emisTransProduct.getTransLineCode());
double volumeWeight=0.0D;
if(!StringUtils.isEmpty(emisTransLine.getMeterRate())) {
volumeWeight=totalVolume * (1000000 / Double.valueOf(emisTransLine.getMeterRate()));
}else{
volumeWeight=billWeight;
}
emisWaybill.setVolumeWeight(BigDecimal.valueOf(volumeWeight));
@ -486,7 +491,6 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
double maxWeight = Math.max(billWeight,volumeWeight);
// 取重方式
EmisTransProduct emisTransProduct = getTransProductByCode(emisWaybill.getProductType());
String carryType=emisTransProduct.getCarryType();
double setteldWeight = WaybillHelper.calcSettledWeight(maxWeight,carryType);