提交 62e89676 authored 作者: 李瑞鑫's avatar 李瑞鑫

Merge branch 'v28.8_carrier_exercise_optimization_20241010' into master_jdk17

# Conflicts: # performance-api/src/main/java/com/clx/performance/vo/pc/CarrierOrderChildDetailVO.java
...@@ -217,4 +217,8 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int ...@@ -217,4 +217,8 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int
int countTakeByOrderGoodsNo(String orderGoodsNo); int countTakeByOrderGoodsNo(String orderGoodsNo);
int countLoadByOrderGoodsNo(String orderGoodsNo); int countLoadByOrderGoodsNo(String orderGoodsNo);
Long countNotCancelOrderChild(List<String> cancelOrderGoodsNo);
Long queryNoCancelChildByOrderGoodsNo(String orderGoodsNo, Integer code);
} }
...@@ -108,8 +108,11 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int ...@@ -108,8 +108,11 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int
List<OrderGoods> listAfterCreatedByOrderNo(String orderNo); List<OrderGoods> listAfterCreatedByOrderNo(String orderNo);
List<OrderGoods> listAllByOrderNo(String orderNo);
void batchUpdateOrderGoodsPaying(List<OrderGoods> updateOrderGoods); void batchUpdateOrderGoodsPaying(List<OrderGoods> updateOrderGoods);
void batchCancelOrderGoodsWeight(List<OrderGoodsCancelWeightDTO> cancelOrderGoodsList); void batchCancelOrderGoodsWeight(List<OrderGoodsCancelWeightDTO> cancelOrderGoodsList);
boolean updateExtractWeightAndNeedTruckNum(String orderGoodsNo, BigDecimal extractWeight, Integer needTruckNum);
} }
...@@ -721,4 +721,19 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild, ...@@ -721,4 +721,19 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
public int countLoadByOrderGoodsNo(String orderGoodsNo) { public int countLoadByOrderGoodsNo(String orderGoodsNo) {
return baseMapper.countLoadByOrderGoodsNo(orderGoodsNo); return baseMapper.countLoadByOrderGoodsNo(orderGoodsNo);
} }
@Override
public Long countNotCancelOrderChild(List<String> cancelOrderGoodsNo) {
LambdaQueryWrapper<OrderChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(OrderChild :: getOrderGoodsNo,cancelOrderGoodsNo);
queryWrapper.le(OrderChild :: getStatus,OrderChildEnum.Status.COMPLETE.getCode());
return baseMapper.selectCount(queryWrapper);
}
@Override
public Long queryNoCancelChildByOrderGoodsNo(String orderGoodsNo, Integer status) {
return baseMapper.selectCount(lQrWrapper().eq(OrderChild::getOrderGoodsNo,orderGoodsNo)
.lt(ObjectUtil.isNotEmpty(status),OrderChild::getStatus, status)
);
}
} }
...@@ -294,6 +294,15 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, ...@@ -294,6 +294,15 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
); );
} }
@Override
public List<OrderGoods> listAllByOrderNo(String orderNo) {
return baseMapper.selectList(lQrWrapper().eq(OrderGoods::getOrderNo, orderNo)
.ne(OrderGoods::getOrderGoodsStatus,OrderGoodsStatusEnum.Status.CREATED.getCode())
.orderByDesc(OrderGoods :: getPendingOrderTime)
);
}
@Override @Override
public void batchUpdateOrderGoodsPaying(List<OrderGoods> updateOrderGoods) { public void batchUpdateOrderGoodsPaying(List<OrderGoods> updateOrderGoods) {
baseMapper.batchUpdateOrderGoodsPaying(updateOrderGoods); baseMapper.batchUpdateOrderGoodsPaying(updateOrderGoods);
...@@ -303,4 +312,14 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, ...@@ -303,4 +312,14 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
public void batchCancelOrderGoodsWeight(List<OrderGoodsCancelWeightDTO> cancelOrderGoodsList) { public void batchCancelOrderGoodsWeight(List<OrderGoodsCancelWeightDTO> cancelOrderGoodsList) {
baseMapper.batchCancelOrderGoodsWeight(cancelOrderGoodsList); baseMapper.batchCancelOrderGoodsWeight(cancelOrderGoodsList);
} }
@Override
public boolean updateExtractWeightAndNeedTruckNum(String orderGoodsNo, BigDecimal extractWeight,
Integer needTruckNum) {
return update(lUdWrapper()
.in(OrderGoods::getOrderGoodsNo, orderGoodsNo)
.set(OrderGoods::getExtractWeight, extractWeight)
.set(OrderGoods :: getNeedTruckNum,needTruckNum)
);
}
} }
...@@ -67,7 +67,6 @@ public class OrderGoodsDtsListener { ...@@ -67,7 +67,6 @@ public class OrderGoodsDtsListener {
public void syncPerformanceProgress(OrderGoods before,OrderGoods after, Integer updateType) { public void syncPerformanceProgress(OrderGoods before,OrderGoods after, Integer updateType) {
boolean isSend = false; boolean isSend = false;
if(after.getOrderGoodsStatus() >= OrderGoodsStatusEnum.Status.PAYING.getCode()){
if(Objects.equals(updateType,DtsOperationTypeEnum.INSERT.getCode())){ if(Objects.equals(updateType,DtsOperationTypeEnum.INSERT.getCode())){
isSend = true; isSend = true;
} }
...@@ -76,6 +75,7 @@ public class OrderGoodsDtsListener { ...@@ -76,6 +75,7 @@ public class OrderGoodsDtsListener {
|| !Objects.equals(before.getSeniorLogisticsManagerId(),after.getSeniorLogisticsManagerId()) || !Objects.equals(before.getSeniorLogisticsManagerId(),after.getSeniorLogisticsManagerId())
|| !Objects.equals(before.getExtractWeight(),after.getExtractWeight()) || !Objects.equals(before.getExtractWeight(),after.getExtractWeight())
|| !Objects.equals(before.getPendingOrderFreight(),after.getPendingOrderFreight()) || !Objects.equals(before.getPendingOrderFreight(),after.getPendingOrderFreight())
|| !Objects.equals(before.getNeedTruckNum(),after.getNeedTruckNum())
)){ )){
isSend = true; isSend = true;
} }
...@@ -87,7 +87,6 @@ public class OrderGoodsDtsListener { ...@@ -87,7 +87,6 @@ public class OrderGoodsDtsListener {
log.info("结束发送同步履约进度表消息,订单号:{},货单号:{}", after.getOrderNo(),after.getOrderGoodsNo()); log.info("结束发送同步履约进度表消息,订单号:{},货单号:{}", after.getOrderNo(),after.getOrderGoodsNo());
} }
} }
}
//保存货单调价记录 //保存货单调价记录
public void sendSaveOrderGoodsAdjustmentPriceMessage(OrderGoods before,OrderGoods after, Integer updateType){ public void sendSaveOrderGoodsAdjustmentPriceMessage(OrderGoods before,OrderGoods after, Integer updateType){
......
...@@ -39,7 +39,6 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> { ...@@ -39,7 +39,6 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@Update(" update order_goods set " + @Update(" update order_goods set " +
" already_transport_weight = already_transport_weight - #{residueWeight}," + " already_transport_weight = already_transport_weight - #{residueWeight}," +
" extract_weight = already_transport_weight," +
"order_goods_status = #{orderGoodsStatus} " + "order_goods_status = #{orderGoodsStatus} " +
" where id = #{id}") " where id = #{id}")
void updateOrderGoodsWeightAlreadyAndStatus(@Param("id") Integer id, @Param("residueWeight") BigDecimal residueWeight, @Param("orderGoodsStatus") Integer orderGoodsStatus); void updateOrderGoodsWeightAlreadyAndStatus(@Param("id") Integer id, @Param("residueWeight") BigDecimal residueWeight, @Param("orderGoodsStatus") Integer orderGoodsStatus);
......
...@@ -97,6 +97,12 @@ public class PerformanceProgress implements HasKey<Integer> { ...@@ -97,6 +97,12 @@ public class PerformanceProgress implements HasKey<Integer> {
@Schema(description="挂单吨数") @Schema(description="挂单吨数")
private BigDecimal pendingWeight; private BigDecimal pendingWeight;
@TableField("pending_truck")
@ApiModelProperty("挂单车数")
private Integer pendingTruck;
@TableField("ordered_truck_num") @TableField("ordered_truck_num")
@Schema(description="接单车数") @Schema(description="接单车数")
private Integer orderedTruckNum; private Integer orderedTruckNum;
......
...@@ -2591,29 +2591,31 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -2591,29 +2591,31 @@ public class OrderChildServiceImpl implements OrderChildService {
// 组装表头 // 组装表头
List<ExcelField> fieldList = new ArrayList<>(); List<ExcelField> fieldList = new ArrayList<>();
fieldList.add(new ExcelField(0, "序号", "index", 2000)); fieldList.add(new ExcelField(0, "序号", "index", 2000));
fieldList.add(new ExcelField(1, "运单编号", "childNo", 5000)); fieldList.add(new ExcelField(1, "发货地址", "sendAddress", 10000));
fieldList.add(new ExcelField(2, "车牌号", "truckNo", 5000)); fieldList.add(new ExcelField(2, "收货地址", "receiveAddress", 10000));
fieldList.add(new ExcelField(3, "运单状态", "status", 5000));
fieldList.add(new ExcelField(4, "货单编号", "goodsOrderNo", 5000)); fieldList.add(new ExcelField(3, "运单编号", "childNo", 5000));
fieldList.add(new ExcelField(4, "车牌号", "truckNo", 5000));
fieldList.add(new ExcelField(5, "货物名称", "goodsName", 5000)); fieldList.add(new ExcelField(5, "运单状态", "status", 5000));
fieldList.add(new ExcelField(6, "司机姓名", "driverName", 5000)); fieldList.add(new ExcelField(6, "货单编号", "goodsOrderNo", 5000));
fieldList.add(new ExcelField(7, "手机号", "phone", 5000));
fieldList.add(new ExcelField(8, "运费单价", "frightPrice", 5000)); fieldList.add(new ExcelField(7, "货物名称", "goodsName", 5000));
fieldList.add(new ExcelField(8, "司机姓名", "driverName", 5000));
fieldList.add(new ExcelField(9, "装车毛重", "loadRough", 5000)); fieldList.add(new ExcelField(9, "手机号", "phone", 5000));
fieldList.add(new ExcelField(10, "装车皮重", "loadTare", 5000)); fieldList.add(new ExcelField(10, "运费单价", "frightPrice", 5000));
fieldList.add(new ExcelField(11, "装车净重", "loadNet", 5000));
fieldList.add(new ExcelField(12, "卸车毛重", "loadRough", 5000)); fieldList.add(new ExcelField(11, "装车毛重", "loadRough", 5000));
fieldList.add(new ExcelField(13, "卸车皮重", "loadTare", 5000)); fieldList.add(new ExcelField(12, "装车皮重", "loadTare", 5000));
fieldList.add(new ExcelField(14, "卸车净重", "unloadNet", 5000)); fieldList.add(new ExcelField(13, "装车净重", "loadNet", 5000));
fieldList.add(new ExcelField(14, "卸车毛重", "loadRough", 5000));
fieldList.add(new ExcelField(15, "卸车皮重", "loadTare", 5000));
fieldList.add(new ExcelField(15, "接单时间", "payTime", 5000)); fieldList.add(new ExcelField(16, "卸车净重", "unloadNet", 5000));
fieldList.add(new ExcelField(16, "完成时间", "finishTime", 5000));
fieldList.add(new ExcelField(17, "磅单审核通过时间", "poundAuditTime", 5000));
fieldList.add(new ExcelField(18, "发货地址", "sendAddress", 10000)); fieldList.add(new ExcelField(17, "接单时间", "payTime", 5000));
fieldList.add(new ExcelField(19, "收货地址", "receiveAddress", 10000)); fieldList.add(new ExcelField(18, "完成时间", "finishTime", 5000));
fieldList.add(new ExcelField(19, "磅单审核通过时间", "poundAuditTime", 5000));
fieldList.add(new ExcelField(20, "订单编号", "orderNo", 10000)); fieldList.add(new ExcelField(20, "订单编号", "orderNo", 10000));
fieldList.add(new ExcelField(21, "订单来源", "orderSourceMsg", 10000)); fieldList.add(new ExcelField(21, "订单来源", "orderSourceMsg", 10000));
...@@ -2626,6 +2628,8 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -2626,6 +2628,8 @@ public class OrderChildServiceImpl implements OrderChildService {
List<ExcelData> rowData = new ArrayList<>(); List<ExcelData> rowData = new ArrayList<>();
rowData.add(new ExcelData(i+1)); rowData.add(new ExcelData(i+1));
rowData.add(new ExcelData(dto.getSendAddress()));
rowData.add(new ExcelData(dto.getReceiveAddress()));
rowData.add(new ExcelData(dto.getChildNo())); rowData.add(new ExcelData(dto.getChildNo()));
rowData.add(new ExcelData(dto.getTruckNo())); rowData.add(new ExcelData(dto.getTruckNo()));
if(Objects.isNull(dto.getStatus())){ if(Objects.isNull(dto.getStatus())){
...@@ -2650,8 +2654,7 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -2650,8 +2654,7 @@ public class OrderChildServiceImpl implements OrderChildService {
rowData.add(new ExcelData(dto.getPayTime())); rowData.add(new ExcelData(dto.getPayTime()));
rowData.add(new ExcelData(dto.getFinishTime())); rowData.add(new ExcelData(dto.getFinishTime()));
rowData.add(new ExcelData(dto.getPoundAuditTime())); rowData.add(new ExcelData(dto.getPoundAuditTime()));
rowData.add(new ExcelData(dto.getSendAddress()));
rowData.add(new ExcelData(dto.getReceiveAddress()));
rowData.add(new ExcelData(dto.getOrderNo())); rowData.add(new ExcelData(dto.getOrderNo()));
rowData.add(new ExcelData(dto.getOrderSourceMsg(), "-")); rowData.add(new ExcelData(dto.getOrderSourceMsg(), "-"));
...@@ -2736,6 +2739,8 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -2736,6 +2739,8 @@ public class OrderChildServiceImpl implements OrderChildService {
carrierOrderChildDetailVO.setSendDetailAddress(sendAddress.getAddress()); carrierOrderChildDetailVO.setSendDetailAddress(sendAddress.getAddress());
carrierOrderChildDetailVO.setReceiveDetailAddress(receiveAddress.getAddress()); carrierOrderChildDetailVO.setReceiveDetailAddress(receiveAddress.getAddress());
Result<FeignOrderInfoVO> result = orderFeign.getOrderInfo(orderChild.getOrderNo());
carrierOrderChildDetailVO.setCooperativeCompaniesName(result.getData().getCooperativeCompaniesName());
return carrierOrderChildDetailVO; return carrierOrderChildDetailVO;
} }
......
...@@ -21,8 +21,6 @@ import com.clx.performance.dao.*; ...@@ -21,8 +21,6 @@ import com.clx.performance.dao.*;
import com.clx.performance.dto.OrderGoodsBindTruckNumDTO; import com.clx.performance.dto.OrderGoodsBindTruckNumDTO;
import com.clx.performance.dto.OrderGoodsCancelDTO; import com.clx.performance.dto.OrderGoodsCancelDTO;
import com.clx.performance.enums.*; import com.clx.performance.enums.*;
import com.clx.performance.enums.settle.SettlementOrderChildRiskEnum;
import com.clx.performance.enums.settle.SettlementOwnerEnum;
import com.clx.performance.enums.settle.SettlementWayEnum; import com.clx.performance.enums.settle.SettlementWayEnum;
import com.clx.performance.extranal.order.QuotationService; import com.clx.performance.extranal.order.QuotationService;
import com.clx.performance.extranal.user.DriverService; import com.clx.performance.extranal.user.DriverService;
...@@ -49,7 +47,6 @@ import com.clx.performance.vo.pc.DriverFreightPriceVO; ...@@ -49,7 +47,6 @@ import com.clx.performance.vo.pc.DriverFreightPriceVO;
import com.clx.performance.vo.pc.OrderGoodsEditVO; import com.clx.performance.vo.pc.OrderGoodsEditVO;
import com.clx.performance.vo.pc.OrderGoodsPendingVO; import com.clx.performance.vo.pc.OrderGoodsPendingVO;
import com.clx.performance.vo.pc.OrderGoodsVO; import com.clx.performance.vo.pc.OrderGoodsVO;
import com.clx.performance.vo.pc.carrier.settle.SettlementOrderChildRiskVO;
import com.clx.user.enums.driver.DriverInfoEnum; import com.clx.user.enums.driver.DriverInfoEnum;
import com.clx.user.feign.UserClxFeign; import com.clx.user.feign.UserClxFeign;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
...@@ -161,6 +158,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -161,6 +158,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
orderGoodsVO.setReveiveAddressAll(orderInfoFeign.getReveiveAddressAll()); orderGoodsVO.setReveiveAddressAll(orderInfoFeign.getReveiveAddressAll());
orderGoodsVO.setSendAddressAll(orderInfoFeign.getSendAddressAll()); orderGoodsVO.setSendAddressAll(orderInfoFeign.getSendAddressAll());
orderGoodsVO.setDispatchedOrders(truckList.size()); orderGoodsVO.setDispatchedOrders(truckList.size());
orderGoodsVO.setCooperativeCompaniesName(orderInfoFeign.getCooperativeCompaniesName());
return orderGoodsVO; return orderGoodsVO;
} }
...@@ -722,9 +720,14 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -722,9 +720,14 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
OrderGoods orderGoods = dto.getOrderGoods(); OrderGoods orderGoods = dto.getOrderGoods();
List<String> childNoList = dto.getChildNoList(); List<String> childNoList = dto.getChildNoList();
//查询该货单下未取消的运单数量
Long noCancelChildCount = orderChildDao.queryNoCancelChildByOrderGoodsNo(orderGoods.getOrderGoodsNo(),
OrderChildEnum.Status.DRIVER_CANCEL.getCode());
List<OrderChild> orderChildList = orderChildDao.selectResidueWeightByOrderGoodsNo(orderGoods.getOrderGoodsNo(), List<OrderChild> orderChildList = orderChildDao.selectResidueWeightByOrderGoodsNo(orderGoods.getOrderGoodsNo(),
OrderChildEnum.Status.DRIVER_CANCEL.getCode(), dto.getOrderGoodsCancelParam().getTruckList()); OrderChildEnum.Status.DRIVER_CANCEL.getCode(), dto.getOrderGoodsCancelParam().getTruckList());
Long needTruckNum = 0L;
if (CollectionUtils.isNotEmpty(orderChildList)) { if (CollectionUtils.isNotEmpty(orderChildList)) {
List<OrderChild> filterOrderChildList = orderChildList.stream(). List<OrderChild> filterOrderChildList = orderChildList.stream().
filter(item -> item.getStatus() < OrderChildEnum.Status.LOAD.getCode()).collect(Collectors.toList()); filter(item -> item.getStatus() < OrderChildEnum.Status.LOAD.getCode()).collect(Collectors.toList());
...@@ -743,16 +746,32 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -743,16 +746,32 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
OrderChildEnum.Status.PLATFORM_CANCEL.getCode(),"系统取消", OrderChildEnum.Status.PLATFORM_CANCEL.getCode(),"系统取消",
now, now, childNoList); now, now, childNoList);
orderChildList.removeAll(filterOrderChildList); orderChildList.removeAll(filterOrderChildList);
if (CollectionUtil.isNotEmpty(orderChildList)) { //此次不能取消的运单不为空 || 货单下的未取消的运单数 大于 已经取消的运单数
if (CollectionUtil.isNotEmpty(orderChildList) || noCancelChildCount > filterOrderChildList.size()) {
dto.setOrderGoodsStatus(OrderGoodsStatusEnum.Status.COMPLETED.getCode()); dto.setOrderGoodsStatus(OrderGoodsStatusEnum.Status.COMPLETED.getCode());
} }
needTruckNum = noCancelChildCount-filterOrderChildList.size();
} }
orderGoodsTruckBindDao.updateOrderGoodsBindStatus(orderGoods.getOrderGoodsNo(), OrderGoodsTruckBindEnum.Status.CANCEL.getCode()); orderGoodsTruckBindDao.updateOrderGoodsBindStatus(orderGoods.getOrderGoodsNo(), OrderGoodsTruckBindEnum.Status.CANCEL.getCode());
orderGoodsDao.updateOrderGoodsSetAlreadyWeightAndStatus(sum, dto.getOrderGoodsStatus(), orderGoods.getId()); orderGoodsDao.updateOrderGoodsSetAlreadyWeightAndStatus(sum, dto.getOrderGoodsStatus(), orderGoods.getId());
if(Objects.equals(dto.getOrderGoodsStatus(),OrderGoodsStatusEnum.Status.COMPLETED.getCode())){
updateCompleteNeedTruck(orderGoods.getOrderGoodsNo(),
orderGoods.getAlreadyTransportWeight().subtract(sum),needTruckNum.intValue());
}
} }
//更新取消变成完结的货单的需要车辆数和提取量
public void updateCompleteNeedTruck(String orderGoodsNo,BigDecimal extractWeight,Integer needTruckNum){
log.info("更新货单的需要车辆数和提取量,货单号:{},提取吨数:{},需要车数:{}",orderGoodsNo,extractWeight,needTruckNum);
boolean flag = orderGoodsDao.updateExtractWeightAndNeedTruckNum(orderGoodsNo,extractWeight,needTruckNum);
log.info("更新货单的需要车辆数和提取量,货单号:{},更新结果:{}",orderGoodsNo,flag);
}
private void cancelOperateTwoTypeStrategy(OrderGoodsCancelDTO dto) { private void cancelOperateTwoTypeStrategy(OrderGoodsCancelDTO dto) {
String now = DateUtils.formatDateTime(LocalDateTime.now()).get(); String now = DateUtils.formatDateTime(LocalDateTime.now()).get();
OrderGoods orderGoods = dto.getOrderGoods(); OrderGoods orderGoods = dto.getOrderGoods();
...@@ -761,6 +780,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -761,6 +780,7 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
BigDecimal childResidueWeight = BigDecimal.ZERO; BigDecimal childResidueWeight = BigDecimal.ZERO;
int needTruckNum = 0;
if (CollectionUtils.isNotEmpty(orderChildList)) { if (CollectionUtils.isNotEmpty(orderChildList)) {
List<OrderChild> filterOrderChildList = orderChildList.stream().filter(item -> item.getStatus() < OrderChildEnum.Status.ARRIVE_SEND.getCode()).collect(Collectors.toList()); List<OrderChild> filterOrderChildList = orderChildList.stream().filter(item -> item.getStatus() < OrderChildEnum.Status.ARRIVE_SEND.getCode()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(filterOrderChildList)) { if (CollectionUtils.isNotEmpty(filterOrderChildList)) {
...@@ -780,11 +800,16 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea ...@@ -780,11 +800,16 @@ public class OrderGoodsServiceImpl implements OrderGoodsService, InitializingBea
} }
orderChildList.removeAll(filterOrderChildList); orderChildList.removeAll(filterOrderChildList);
if (CollectionUtil.isNotEmpty(orderChildList)) { if (CollectionUtil.isNotEmpty(orderChildList)) {
needTruckNum = orderChildList.size();
dto.setOrderGoodsStatus(OrderGoodsStatusEnum.Status.COMPLETED.getCode()); dto.setOrderGoodsStatus(OrderGoodsStatusEnum.Status.COMPLETED.getCode());
} }
} }
orderGoodsTruckBindDao.updateOrderGoodsBindStatus(orderGoods.getOrderGoodsNo(), OrderGoodsTruckBindEnum.Status.CANCEL.getCode()); orderGoodsTruckBindDao.updateOrderGoodsBindStatus(orderGoods.getOrderGoodsNo(), OrderGoodsTruckBindEnum.Status.CANCEL.getCode());
orderGoodsDao.updateOrderGoodsWeightAlreadyAndStatus(orderGoods.getId(),childResidueWeight,OrderGoodsStatusEnum.Status.COMPLETED.getCode()); orderGoodsDao.updateOrderGoodsWeightAlreadyAndStatus(orderGoods.getId(),childResidueWeight,dto.getOrderGoodsStatus());
if(Objects.equals(dto.getOrderGoodsStatus(),OrderGoodsStatusEnum.Status.COMPLETED.getCode())){
updateCompleteNeedTruck(orderGoods.getOrderGoodsNo(),
orderGoods.getAlreadyTransportWeight().subtract(childResidueWeight),needTruckNum);
}
} }
private void cancelOperateOneTypeStrategy(OrderGoodsCancelDTO dto) { private void cancelOperateOneTypeStrategy(OrderGoodsCancelDTO dto) {
......
...@@ -461,7 +461,7 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -461,7 +461,7 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
throw new ServiceSystemException(ResultEnum.DATA_NOT_FIND); throw new ServiceSystemException(ResultEnum.DATA_NOT_FIND);
} }
//根据挂单时间倒序排序 //根据挂单时间倒序排序
List<OrderGoods> orderGoods = orderGoodsDao.listAfterCreatedByOrderNo(data.getOrderNo()); List<OrderGoods> orderGoods = orderGoodsDao.listAllByOrderNo(data.getOrderNo());
if(CollectionUtils.isEmpty(orderGoods)){ if(CollectionUtils.isEmpty(orderGoods)){
return; return;
} }
...@@ -469,7 +469,13 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -469,7 +469,13 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
BigDecimal pendingOrderFreight = null; //最新的货单的司机运费,取消的也算 BigDecimal pendingOrderFreight = null; //最新的货单的司机运费,取消的也算
LocalDateTime firstPendingTime = null; //挂单时间,取消的也算 LocalDateTime firstPendingTime = null; //挂单时间,取消的也算
BigDecimal pendingWeight = BigDecimal.ZERO; BigDecimal pendingWeight = BigDecimal.ZERO;
Integer pendingTruck = calcPendingTruck(orderGoods);
for(OrderGoods item : orderGoods){ for(OrderGoods item : orderGoods){
//只有挂单车数统计所有货单的
if(Objects.equals(item.getOrderGoodsStatus(),OrderGoodsStatusEnum.Status.CREATED.getCode())){
continue;
}
seniorLogisticsManagerNameSet.add(item.getSeniorLogisticsManagerName()); seniorLogisticsManagerNameSet.add(item.getSeniorLogisticsManagerName());
if(Objects.isNull(pendingOrderFreight)){ if(Objects.isNull(pendingOrderFreight)){
pendingOrderFreight = item.getPendingOrderFreight(); pendingOrderFreight = item.getPendingOrderFreight();
...@@ -486,9 +492,22 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -486,9 +492,22 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
update.setDriverFreightPrice(pendingOrderFreight); update.setDriverFreightPrice(pendingOrderFreight);
update.setPendingTime(firstPendingTime); update.setPendingTime(firstPendingTime);
update.setPendingWeight(pendingWeight); update.setPendingWeight(pendingWeight);
update.setPendingTruck(pendingTruck);
performanceProgressDao.updateEntityByKey(update); performanceProgressDao.updateEntityByKey(update);
} }
//统计挂单车数
public Integer calcPendingTruck(List<OrderGoods> orderGoods){
int totalNeedTruck = 0;
for (OrderGoods item : orderGoods) {
if(!Objects.equals(item.getOrderGoodsStatus(), OrderGoodsStatusEnum.Status.CANCEL.getCode())){
totalNeedTruck = totalNeedTruck + item.getNeedTruckNum();
}
}
return totalNeedTruck;
}
//计算履约进度表货单的挂单吨数 //计算履约进度表货单的挂单吨数
@Override @Override
public BigDecimal calcPendingWeight(OrderGoods item){ public BigDecimal calcPendingWeight(OrderGoods item){
...@@ -627,6 +646,8 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -627,6 +646,8 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
rowData.add(new ExcelData(vo.getTaskWeight())); rowData.add(new ExcelData(vo.getTaskWeight()));
} else if (item.getCode().equals("pendingWeight")) { } else if (item.getCode().equals("pendingWeight")) {
rowData.add(new ExcelData(vo.getPendingWeight())); rowData.add(new ExcelData(vo.getPendingWeight()));
}else if (item.getCode().equals("pendingTruck")) {
rowData.add(new ExcelData(vo.getPendingTruck()));
} }
else if (item.getCode().equals("orderedTruckNum")) { else if (item.getCode().equals("orderedTruckNum")) {
......
...@@ -133,6 +133,9 @@ public class CarrierOrderChildDetailVO { ...@@ -133,6 +133,9 @@ public class CarrierOrderChildDetailVO {
@Schema(description = "目的地详细地址") @Schema(description = "目的地详细地址")
private String receiveDetailAddress; private String receiveDetailAddress;
@Schema(description = "贸易商名称")
private String cooperativeCompaniesName;
@Schema(description = "订单来源") @Schema(description = "订单来源")
private Integer orderSource; private Integer orderSource;
private String orderSourceMsg; private String orderSourceMsg;
......
...@@ -241,4 +241,8 @@ public class OrderGoodsVO { ...@@ -241,4 +241,8 @@ public class OrderGoodsVO {
@Schema(description="已拉运车数") @Schema(description="已拉运车数")
private Integer alreadyTransportTruckAmount; private Integer alreadyTransportTruckAmount;
@ApiModelProperty(value = "贸易商名称")
private String cooperativeCompaniesName;
} }
\ No newline at end of file
...@@ -95,6 +95,9 @@ public class PerformanceProgressVO{ ...@@ -95,6 +95,9 @@ public class PerformanceProgressVO{
@Schema(description="挂单吨数") @Schema(description="挂单吨数")
private BigDecimal pendingWeight; private BigDecimal pendingWeight;
@ApiModelProperty("挂单车数")
private Integer pendingTruck;
@Schema(description="接单车数") @Schema(description="接单车数")
private Integer orderedTruckNum; private Integer orderedTruckNum;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论