diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java index c2c84e910..199b06d08 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java @@ -137,10 +137,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl packageAllowCount ? packageAllowCount : packageAllowCount - 1; if (packageAllowCount < taskNumber) { - return R.fail("拆单包件数量不足,请重新填写,目前可拆单数量:" + tipNumber); - } - if (packageAllCount <= taskNumber) { - return R.fail("拆单数需要小于订单总数量,请重新填写,目前可拆单数量:" + tipNumber); + return R.fail("拆单包件数量不足,请重新填写,目前可拆单数量:" + packageAllowCount); } taskLock(stockArticleId, () -> { @@ -272,7 +267,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaQuery() .in(DistributionParcelListEntity::getOrderPackageCode, packageCodes) - .ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()) + .eq(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue()) .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) .eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) .eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue()) @@ -977,15 +972,19 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaQuery() .in(DistributionParcelListEntity::getStockArticleId, stockArticleId) - .ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()) + .eq(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue()) .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) .eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) .eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue()) .eq(DistributionParcelListEntity::getIsTransfer, 0) ); + + return allowCount >= splitOrderAllCount ? allowCount - 1 : allowCount; } public long getSplitOrderAllCount(Long stockArticleId) { @@ -1020,10 +1019,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl