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

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

# Conflicts: # performance-web/src/main/java/com/clx/performance/service/impl/OrderGoodsServiceImpl.java
...@@ -26,6 +26,11 @@ public class OrderExtractWeightVO { ...@@ -26,6 +26,11 @@ public class OrderExtractWeightVO {
@ApiModelProperty(value = "拉运吨数") @ApiModelProperty(value = "拉运吨数")
private BigDecimal transportWeight; private BigDecimal transportWeight;
@ApiModelProperty("可提取吨数")
private BigDecimal canExtractWeight;
@ApiModelProperty("平台承运吨数") @ApiModelProperty("平台承运吨数")
private BigDecimal platformCarryWeight; private BigDecimal platformCarryWeight;
......
...@@ -17,6 +17,7 @@ import com.clx.performance.service.OrderChildLogService; ...@@ -17,6 +17,7 @@ import com.clx.performance.service.OrderChildLogService;
import com.clx.performance.service.OrderGoodsService; import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.service.breakcontract.BreakContractDriverRecordService; import com.clx.performance.service.breakcontract.BreakContractDriverRecordService;
import com.clx.performance.service.child.OrderChildPostService; import com.clx.performance.service.child.OrderChildPostService;
import com.clx.performance.utils.spring.ApplicationContextUtils;
import com.clx.user.enums.driver.DriverInfoEnum; import com.clx.user.enums.driver.DriverInfoEnum;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
import com.msl.common.utils.DateUtils; import com.msl.common.utils.DateUtils;
...@@ -64,7 +65,6 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -64,7 +65,6 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
private final OrderChildPostService orderChildPostService; private final OrderChildPostService orderChildPostService;
private final OrderGoodsService orderGoodsService;
//根据货单最晚接单时间处理 //根据货单最晚接单时间处理
...@@ -123,8 +123,8 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -123,8 +123,8 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
continue; continue;
} }
OrderGoods orderGoods = optional.get(); OrderGoods orderGoods = optional.get();
BigDecimal residueTransportWeight = orderGoodsService.calcOrderGoodsResidueWeight BigDecimal residueTransportWeight = ApplicationContextUtils.getBean(OrderGoodsService.class).
(orderGoods.getExtractWeight(),orderGoods.getAlreadyTransportWeight()); calcOrderGoodsResidueWeight(orderGoods.getExtractWeight(),orderGoods.getAlreadyTransportWeight());;
if (residueTransportWeight.compareTo(BigDecimal.ZERO) == 0) { if (residueTransportWeight.compareTo(BigDecimal.ZERO) == 0) {
List<OrderChild> orderChildren = orderChildDao.selectInTransitOrderChildByOrderGoodsNo(orderGoodsNo); List<OrderChild> orderChildren = orderChildDao.selectInTransitOrderChildByOrderGoodsNo(orderGoodsNo);
......
...@@ -105,6 +105,8 @@ public class OrderGoodsDtsListener { ...@@ -105,6 +105,8 @@ public class OrderGoodsDtsListener {
|| //挂单中之后的状态的挂单运费发生变化 || //挂单中之后的状态的挂单运费发生变化
(after.getOrderGoodsStatus() >= OrderGoodsStatusEnum.Status.PAYING.getCode() && (after.getOrderGoodsStatus() >= OrderGoodsStatusEnum.Status.PAYING.getCode() &&
!Objects.equals(before.getPendingOrderFreight(),after.getPendingOrderFreight())) !Objects.equals(before.getPendingOrderFreight(),after.getPendingOrderFreight()))
//提取吨数发生变化
|| (after.getExtractWeight().compareTo(BigDecimal.ZERO) != 0)
) )
){ ){
isSend = true; isSend = true;
......
...@@ -168,6 +168,8 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -168,6 +168,8 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
@Override @Override
public OrderGoodsVO getOrderGoodsInfoByOrderGoodsNoForAPP(String orderGoodsNo) { public OrderGoodsVO getOrderGoodsInfoByOrderGoodsNoForAPP(String orderGoodsNo) {
OrderGoodsVO orderGoodsVO = orderGoodsDao.getOrderGoodsInfoByOrderGoodsNoForAPP(orderGoodsNo).map(orderGoodsStruct::convert).get(); OrderGoodsVO orderGoodsVO = orderGoodsDao.getOrderGoodsInfoByOrderGoodsNoForAPP(orderGoodsNo).map(orderGoodsStruct::convert).get();
BigDecimal residueWeight = this.calcOrderGoodsResidueWeight(orderGoodsVO.getExtractWeight(),
orderGoodsVO.getAlreadyTransportWeight());
String orderNo = orderGoodsVO.getOrderNo(); String orderNo = orderGoodsVO.getOrderNo();
FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(orderNo); FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(orderNo);
orderGoodsVO.setReveiveAddressAll(orderInfoFeign.getReveiveAddressAll()); orderGoodsVO.setReveiveAddressAll(orderInfoFeign.getReveiveAddressAll());
...@@ -176,13 +178,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -176,13 +178,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
orderGoodsVO.setUnloadEndTime(orderInfoFeign.getUnloadEndTime()); orderGoodsVO.setUnloadEndTime(orderInfoFeign.getUnloadEndTime());
orderGoodsVO.setLoadBeginTime(orderInfoFeign.getLoadBeginTime()); orderGoodsVO.setLoadBeginTime(orderInfoFeign.getLoadBeginTime());
orderGoodsVO.setLoadEndTime(orderInfoFeign.getLoadEndTime()); orderGoodsVO.setLoadEndTime(orderInfoFeign.getLoadEndTime());
orderGoodsVO.setResidueTransportWeight(BigDecimal.ZERO.compareTo(orderGoodsVO.getResidueTransportWeight()) > 0 ? BigDecimal.ZERO : orderGoodsVO.getResidueTransportWeight()); orderGoodsVO.setResidueTransportWeight(BigDecimal.ZERO.compareTo(residueWeight) > 0 ? BigDecimal.ZERO : residueWeight);
//货源地信息
orderGoodsVO.setSendContact(orderInfoFeign.getSendContact());
orderGoodsVO.setSendContactPhone(orderInfoFeign.getSendContactPhone());
orderGoodsVO.setSendWaitSystem(orderInfoFeign.getSendWaitSystem());
orderGoodsVO.setSendWaitSystemName(orderInfoFeign.getSendWaitSystemName());
orderGoodsVO.setSendWaitMode(orderInfoFeign.getSendWaitMode());
//获取订单配置的违约金方案 //获取订单配置的违约金方案
OwnerQuotationDetailVO quotationDetailVO = quotationService.getQuotationByOrderNo(orderNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); OwnerQuotationDetailVO quotationDetailVO = quotationService.getQuotationByOrderNo(orderNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
...@@ -241,9 +237,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -241,9 +237,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
item.setOverOrderWeight(1); item.setOverOrderWeight(1);
} }
} }
item.setResidueTransportWeight(item.getExtractWeight() item.setResidueTransportWeight(calcOrderGoodsResidueWeight(item.getExtractWeight(),item.getAlreadyTransportWeight()));
.subtract(Objects.nonNull(item.getAlreadyTransportWeight())
?item.getAlreadyTransportWeight():BigDecimal.ZERO));
}); });
} }
return page; return page;
...@@ -410,6 +404,11 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -410,6 +404,11 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
@Override @Override
public List<OrderGoodsFeignVO> getOrderGoodsListByOrderNo(String orderNo) { public List<OrderGoodsFeignVO> getOrderGoodsListByOrderNo(String orderNo) {
List<OrderGoods> list = orderGoodsDao.getOrderGoodsListByOrderNo(orderNo); List<OrderGoods> list = orderGoodsDao.getOrderGoodsListByOrderNo(orderNo);
if(CollectionUtils.isNotEmpty(list)){
list.forEach(item-> item.setResidueTransportWeight(this.calcOrderGoodsResidueWeight(item.getExtractWeight(),
item.getAlreadyTransportWeight())));
}
return orderGoodsStruct.convertList(list); return orderGoodsStruct.convertList(list);
} }
...@@ -824,9 +823,9 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -824,9 +823,9 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
public OrderGoodsEditVO findOrderGoodsById(Integer id) { public OrderGoodsEditVO findOrderGoodsById(Integer id) {
OrderGoodsEditVO result = new OrderGoodsEditVO(); OrderGoodsEditVO result = new OrderGoodsEditVO();
OrderGoodsVO orderGoodsVO = orderGoodsDao.findOrderGoodsById(id); OrderGoodsVO orderGoodsVO = orderGoodsDao.findOrderGoodsById(id);
orderGoodsVO.setResidueTransportWeight(orderGoodsVO.getExtractWeight() orderGoodsVO.setResidueTransportWeight(
.subtract(Objects.nonNull(orderGoodsVO.getAlreadyTransportWeight()) this.calcOrderGoodsResidueWeight(orderGoodsVO.getExtractWeight(),orderGoodsVO.getAlreadyTransportWeight())
?orderGoodsVO.getAlreadyTransportWeight():BigDecimal.ZERO)); );
String orderNo = orderGoodsVO.getOrderNo(); String orderNo = orderGoodsVO.getOrderNo();
FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(orderNo); FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(orderNo);
......
...@@ -47,10 +47,17 @@ public class OrderWeightServiceImpl implements OrderWeightService { ...@@ -47,10 +47,17 @@ public class OrderWeightServiceImpl implements OrderWeightService {
List<OrderGoods> orderGoodsList = orderGoodsDao.listByField(OrderGoods::getOrderNo, orderNo); List<OrderGoods> orderGoodsList = orderGoodsDao.listByField(OrderGoods::getOrderNo, orderNo);
if(CollectionUtils.isEmpty(orderGoodsList)){ 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()) return OrderExtractWeightVO.builder().transportWeight(orderInfo.getTransportWeight())
.truckDemand(orderInfo.getTruckDemand()) .truckDemand(orderInfo.getTruckDemand())
.ownCarryWeight(orderInfo.getOwnCarryWeight()).platformCarryWeight(orderInfo.getPlatformCarryWeight()) .ownCarryWeight(orderInfo.getOwnCarryWeight())
.ownCanExtractWeight(orderInfo.getOwnCarryWeight()).platCanExtractWeight(orderInfo.getPlatformCarryWeight()) .platformCarryWeight(orderInfo.getPlatformCarryWeight())
.ownCanExtractWeight(orderInfo.getOwnCarryWeight())
.platCanExtractWeight(orderInfo.getPlatformCarryWeight())
.canExtractWeight(canExtractWeight)
.build(); .build();
} }
//已发布的自有车辆吨数 //已发布的自有车辆吨数
...@@ -82,6 +89,9 @@ public class OrderWeightServiceImpl implements OrderWeightService { ...@@ -82,6 +89,9 @@ public class OrderWeightServiceImpl implements OrderWeightService {
.truckDemand(orderInfo.getTruckDemand()) .truckDemand(orderInfo.getTruckDemand())
.platformCarryWeight(orderInfo.getPlatformCarryWeight()) .platformCarryWeight(orderInfo.getPlatformCarryWeight())
.platCanExtractWeight(orderInfo.getTransportWeight().subtract(platOrderGoodsWeight)) .platCanExtractWeight(orderInfo.getTransportWeight().subtract(platOrderGoodsWeight))
.ownCarryWeight(BigDecimal.ZERO)
.ownCanExtractWeight(BigDecimal.ZERO)
.canExtractWeight(orderInfo.getTransportWeight().subtract(platOrderGoodsWeight))
.build(); .build();
} }
if(Objects.equals(orderInfo.getTruckDemand(), TruckDemandEnum.TruckType.OWNER_CAR.getCode())){ if(Objects.equals(orderInfo.getTruckDemand(), TruckDemandEnum.TruckType.OWNER_CAR.getCode())){
...@@ -89,6 +99,9 @@ public class OrderWeightServiceImpl implements OrderWeightService { ...@@ -89,6 +99,9 @@ public class OrderWeightServiceImpl implements OrderWeightService {
.truckDemand(orderInfo.getTruckDemand()) .truckDemand(orderInfo.getTruckDemand())
.ownCarryWeight(orderInfo.getOwnCarryWeight()) .ownCarryWeight(orderInfo.getOwnCarryWeight())
.ownCanExtractWeight(orderInfo.getTransportWeight().subtract(ownOrderGoodsWeight)) .ownCanExtractWeight(orderInfo.getTransportWeight().subtract(ownOrderGoodsWeight))
.platformCarryWeight(BigDecimal.ZERO)
.platCanExtractWeight(BigDecimal.ZERO)
.canExtractWeight(orderInfo.getTransportWeight().subtract(ownOrderGoodsWeight))
.build(); .build();
} }
if(Objects.equals(orderInfo.getTruckDemand(), TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode())){ if(Objects.equals(orderInfo.getTruckDemand(), TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode())){
...@@ -113,6 +126,7 @@ public class OrderWeightServiceImpl implements OrderWeightService { ...@@ -113,6 +126,7 @@ public class OrderWeightServiceImpl implements OrderWeightService {
.platformCarryWeight(orderInfo.getPlatformCarryWeight()) .platformCarryWeight(orderInfo.getPlatformCarryWeight())
.ownCanExtractWeight(ownCanExtractWeight) .ownCanExtractWeight(ownCanExtractWeight)
.platCanExtractWeight(platCanExtractWeight) .platCanExtractWeight(platCanExtractWeight)
.canExtractWeight(platCanExtractWeight.add(ownCanExtractWeight))
.build(); .build();
}else{ }else{
log.warn("订单号:{} 的用车需求未知",orderNo); log.warn("订单号:{} 的用车需求未知",orderNo);
......
...@@ -354,7 +354,6 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -354,7 +354,6 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
item.setGoodsName(data.getGoodsName()); item.setGoodsName(data.getGoodsName());
item.setSendOverStandard(data.getOverWeight()); item.setSendOverStandard(data.getOverWeight());
item.setTaskWeight(data.getTransportWeight()); item.setTaskWeight(data.getTransportWeight());
item.setPendingWeight(data.getTransportWeight().subtract(data.getResidueWeight()));
item.setTransportTimeSlot(DateUtils.formatDateTime(data.getTransportBeginTime()).get() + "至" + item.setTransportTimeSlot(DateUtils.formatDateTime(data.getTransportBeginTime()).get() + "至" +
DateUtils.formatDateTime(data.getTransportEndTime()).get()); DateUtils.formatDateTime(data.getTransportEndTime()).get());
...@@ -439,6 +438,7 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -439,6 +438,7 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
Set<String> seniorLogisticsManagerNameSet = new HashSet<>(); Set<String> seniorLogisticsManagerNameSet = new HashSet<>();
BigDecimal pendingOrderFreight = null; //最新的货单的司机运费,取消的也算 BigDecimal pendingOrderFreight = null; //最新的货单的司机运费,取消的也算
LocalDateTime firstPendingTime = null; //挂单时间,取消的也算 LocalDateTime firstPendingTime = null; //挂单时间,取消的也算
BigDecimal pendingWeight = BigDecimal.ZERO;
for(OrderGoods item : orderGoods){ for(OrderGoods item : orderGoods){
seniorLogisticsManagerNameSet.add(item.getSeniorLogisticsManagerName()); seniorLogisticsManagerNameSet.add(item.getSeniorLogisticsManagerName());
if(Objects.isNull(pendingOrderFreight)){ if(Objects.isNull(pendingOrderFreight)){
...@@ -446,12 +446,15 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -446,12 +446,15 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
} }
//最后一个挂单中的货单的挂单时间为最早的挂单时间 //最后一个挂单中的货单的挂单时间为最早的挂单时间
firstPendingTime = item.getPendingOrderTime(); firstPendingTime = item.getPendingOrderTime();
pendingWeight = pendingWeight.add(item.getExtractWeight());
} }
PerformanceProgress update = new PerformanceProgress(); PerformanceProgress update = new PerformanceProgress();
update.setId(optional.get().getId()); update.setId(optional.get().getId());
update.setSeniorLogisticsManagerName(JSON.toJSONString(new ArrayList<>(seniorLogisticsManagerNameSet))); update.setSeniorLogisticsManagerName(JSON.toJSONString(new ArrayList<>(seniorLogisticsManagerNameSet)));
update.setDriverFreightPrice(pendingOrderFreight); update.setDriverFreightPrice(pendingOrderFreight);
update.setPendingTime(firstPendingTime); update.setPendingTime(firstPendingTime);
update.setPendingWeight(pendingWeight);
performanceProgressDao.updateEntityByKey(update); performanceProgressDao.updateEntityByKey(update);
} }
//履约进度表----运单部分 //履约进度表----运单部分
......
...@@ -404,7 +404,7 @@ public class OrderGoodsSqlProvider { ...@@ -404,7 +404,7 @@ public class OrderGoodsSqlProvider {
public String calcOrderGoodsExtractWeightByOrderNoList(List<String> orderNoList){ public String calcOrderGoodsExtractWeightByOrderNoList(List<String> orderNoList){
String sql = new SQL() {{ String sql = new SQL() {{
SELECT("order_no,sum(extract_weight)"); SELECT("order_no,sum(extract_weight) extractWeight");
FROM("order_goods"); FROM("order_goods");
StringJoiner sj = new StringJoiner(",","order_no in (",")"); StringJoiner sj = new StringJoiner(",","order_no in (",")");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论