提交 9be88cf9 authored 作者: 刘海泉's avatar 刘海泉

Merge remote-tracking branch 'origin/v20.8_add_sub_weight_20240805' into test

Former-commit-id: 6f3c62e2
......@@ -26,6 +26,11 @@ public class OrderExtractWeightVO {
@ApiModelProperty(value = "拉运吨数")
private BigDecimal transportWeight;
@ApiModelProperty("可提取吨数")
private BigDecimal canExtractWeight;
@ApiModelProperty("平台承运吨数")
private BigDecimal platformCarryWeight;
......
......@@ -47,12 +47,17 @@ public class OrderWeightServiceImpl implements OrderWeightService {
List<OrderGoods> orderGoodsList = orderGoodsDao.listByField(OrderGoods::getOrderNo, orderNo);
if(CollectionUtils.isEmpty(orderGoodsList)){
BigDecimal canExtractWeight = Objects.nonNull(orderInfo.getPlatformCarryWeight())?
orderInfo.getPlatformCarryWeight():BigDecimal.ZERO.add(
Objects.nonNull(orderInfo.getOwnCarryWeight())?
orderInfo.getOwnCarryWeight():BigDecimal.ZERO);
return OrderExtractWeightVO.builder().transportWeight(orderInfo.getTransportWeight())
.truckDemand(orderInfo.getTruckDemand())
.ownCarryWeight(orderInfo.getOwnCarryWeight())
.platformCarryWeight(orderInfo.getPlatformCarryWeight())
.ownCanExtractWeight(orderInfo.getOwnCarryWeight())
.platCanExtractWeight(orderInfo.getPlatformCarryWeight())
.canExtractWeight(canExtractWeight)
.build();
}
//已发布的自有车辆吨数
......@@ -86,6 +91,7 @@ public class OrderWeightServiceImpl implements OrderWeightService {
.platCanExtractWeight(orderInfo.getTransportWeight().subtract(platOrderGoodsWeight))
.ownCarryWeight(BigDecimal.ZERO)
.ownCanExtractWeight(BigDecimal.ZERO)
.canExtractWeight(orderInfo.getTransportWeight().subtract(platOrderGoodsWeight))
.build();
}
if(Objects.equals(orderInfo.getTruckDemand(), TruckDemandEnum.TruckType.OWNER_CAR.getCode())){
......@@ -95,6 +101,7 @@ public class OrderWeightServiceImpl implements OrderWeightService {
.ownCanExtractWeight(orderInfo.getTransportWeight().subtract(ownOrderGoodsWeight))
.platformCarryWeight(BigDecimal.ZERO)
.platCanExtractWeight(BigDecimal.ZERO)
.canExtractWeight(orderInfo.getTransportWeight().subtract(ownOrderGoodsWeight))
.build();
}
if(Objects.equals(orderInfo.getTruckDemand(), TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode())){
......@@ -119,6 +126,7 @@ public class OrderWeightServiceImpl implements OrderWeightService {
.platformCarryWeight(orderInfo.getPlatformCarryWeight())
.ownCanExtractWeight(ownCanExtractWeight)
.platCanExtractWeight(platCanExtractWeight)
.canExtractWeight(platCanExtractWeight.add(ownCanExtractWeight))
.build();
}else{
log.warn("订单号:{} 的用车需求未知",orderNo);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论