提交 c3a8dd7d authored 作者: liruixin's avatar liruixin

运费计算公式修改

上级 f2dfaa1a
......@@ -64,6 +64,7 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
.set(OrderChild::getUnloadTime, item.getUnloadTime())
.set(OrderChild::getPoundStatus, item.getPoundStatus())
.set(OrderChild::getWeight, item.getWeight())
.set(OrderChild::getFreight, item.getFreight())
.set(OrderChild::getStatus, item.getStatus())
);
......
......@@ -156,26 +156,18 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
* 运单拉运吨数计算
*/
public BigDecimal orderChildWeightCalc(OrderChild orderChild){
if (orderChild.getUnloadNet() != null) {
return orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet();
}
if (orderChild.getLoadNet() != null) {return orderChild.getLoadNet();}
return orderChild.getTruckLoad();
}
/**
* 运费计算
*/
public BigDecimal orderChildFreightCalc(OrderChild orderChild){
BigDecimal totalFreight = orderChild.getFreightPrice().multiply(orderChild.getWeight());
if (orderChild.getUnloadNet() != null){
totalFreight = orderChild.getFreightPrice().multiply(orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet());
BigDecimal dif = orderChild.getUnloadNet().subtract(orderChild.getWeight());
BigDecimal totalFreight = orderChild.getFreightPrice().multiply(orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet());
BigDecimal dif = orderChild.getUnloadNet().subtract(orderChild.getLoadNet());
if (dif.compareTo(BigDecimal.ZERO) < 0){
totalFreight = totalFreight.add(orderChild.getLossPrice().multiply(dif));
}
}
return totalFreight.setScale(0, RoundingMode.HALF_UP);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论