提交 51ac3f55 authored 作者: liruixin's avatar liruixin

Merge branch 'v5.5_settlement_20231011' into release

# Conflicts: # performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java
......@@ -49,7 +49,15 @@ public class OrderChildFreightInfoVO {
@ApiModelProperty(value = "总运费(元)", example = "1.23")
private BigDecimal totalFreight;
public BigDecimal getTotalFreight() {
return freightPrice.multiply(weight).setScale(2, RoundingMode.HALF_UP);
BigDecimal totalFreight = freightPrice.multiply(weight);
if (unloadNet != null){
totalFreight = freightPrice.multiply(unloadNet.compareTo(loadNet) < 0? unloadNet : loadNet);
BigDecimal dif = unloadNet.subtract(weight);
if (dif.compareTo(BigDecimal.ZERO) < 0){
totalFreight = totalFreight.add(lossPrice.multiply(dif));
}
}
return totalFreight.setScale(2, RoundingMode.HALF_UP);
}
@ApiModelProperty(value = "亏吨扣款(元)", example = "1.23")
......
......@@ -157,7 +157,15 @@ public class OrderChildVO {
@ApiModelProperty(value = "总运费(元)", example = "1.23")
private BigDecimal totalFreight;
public BigDecimal getTotalFreight() {
return freightPrice.multiply(weight).setScale(2, RoundingMode.HALF_UP);
BigDecimal totalFreight = freightPrice.multiply(weight);
if (unloadNet != null){
totalFreight = freightPrice.multiply(unloadNet.compareTo(loadNet) < 0? unloadNet : loadNet);
BigDecimal dif = unloadNet.subtract(weight);
if (dif.compareTo(BigDecimal.ZERO) < 0){
totalFreight = totalFreight.add(lossPrice.multiply(dif));
}
}
return totalFreight.setScale(2, RoundingMode.HALF_UP);
}
}
\ No newline at end of file
......@@ -158,8 +158,12 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
* 运单拉运吨数计算
*/
public BigDecimal orderChildWeightCalc(OrderChild orderChild){
if (orderChild.getLoadNet() == null) {return orderChild.getTruckLoad();}
else {return orderChild.getLoadNet();}
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();
}
/**
......@@ -168,6 +172,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
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());
if (dif.compareTo(BigDecimal.ZERO) < 0){
totalFreight = totalFreight.add(orderChild.getLossPrice().multiply(dif));
......
......@@ -1453,12 +1453,15 @@ public class OrderChildServiceImpl implements OrderChildService {
carrierOrderChildDetailVO.setChildLogs(orderChildLogStruct.convert(orderChildLog));
//应付运费
BigDecimal payableFreight = BigDecimal.ZERO;
if (Objects.nonNull(orderChild.getLoadNet())) {
payableFreight = orderChild.getLoadNet().multiply(orderChild.getFreightPrice()).setScale(0,
BigDecimal.ROUND_HALF_UP);
BigDecimal payableFreight = orderChild.getFreightPrice().multiply(orderChild.getWeight());
if (orderChild.getUnloadNet() != null){
payableFreight = orderChild.getFreightPrice()
.multiply(orderChild.getUnloadNet().compareTo(orderChild.getLoadNet()) < 0? orderChild.getUnloadNet() : orderChild.getLoadNet())
.setScale(0,BigDecimal.ROUND_HALF_UP);
}
//亏吨扣款(元)
BigDecimal lossDeduction = BigDecimal.ZERO;
if (Objects.nonNull(orderChild.getLoadNet()) && Objects.nonNull(orderChild.getUnloadNet())) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论