diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index 6af3dd11c..9b8937230 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -1034,6 +1034,19 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); //将这些包件还原成可操作状态 Integer num = distributionParcelListService.restorePakcageByIds(packageIds); + log.info("######################取消自提单释放包件>>>>>:{}",num); + ids.forEach(id ->{ + //查询自提单存在的零担订单 + List reservationZeroPackageEntities = distributionZeroPackageService.list(Wrappers.query().lambda() + .eq(DistributionReservationZeroPackageEntity::getReservationId, id) + .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "2") + ); + if (Func.isNotEmpty(reservationZeroPackageEntities)){ + List collect = reservationZeroPackageEntities.stream().map(DistributionReservationZeroPackageEntity::getStockArticleId).distinct().collect(Collectors.toList()); + //释放零担资源 + distributionZeroPackageService.recoverZeroPackage(id,collect); + } + }); //维护订单状态 String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(",")); distributionStockArticleService.maintenanceOrderInfo(orderCodes, myCurrentWarehouse.getId()); @@ -1058,7 +1071,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl updateWrapper = new UpdateWrapper<>(); updateWrapper.lambda() - .set(DistributionDeliveryDetailsEntity::getInventoryStatus, 3) + .set(DistributionDeliveryDetailsEntity::getInventoryStatus, 2) .set(DistributionDeliveryDetailsEntity::getQuantity, 0) .in(DistributionDeliveryDetailsEntity::getBillLadingId, ids); distributionDeliveryDetailsService.update(updateWrapper);