diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/order/OrderSplitStatusConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/order/OrderSplitStatusConstant.java new file mode 100644 index 000000000..7953b447a --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/order/OrderSplitStatusConstant.java @@ -0,0 +1,24 @@ +package org.springblade.common.constant.order; + + +import lombok.Getter; + +/** + * 订单拆单状态 + * 状态:0=无,1=进行中 + */ +@Getter +public enum OrderSplitStatusConstant { + + No("无",0), + InProgress("进行中",1); + + private final String name; + private final Integer value; + + OrderSplitStatusConstant(String name, Integer value) { + this.name = name; + this.value = value; + } + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java index ddf0681fb..b131a3808 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java @@ -454,6 +454,9 @@ public class DistributionStockArticleEntity extends TenantEntity { @ApiModelProperty(value = "备注") private String remark; + + @ApiModelProperty(value = "拆单状态") + private Integer splitStatus; /** /* * 未入库数量 *//* 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 c606a7598..fda556a3c 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 @@ -28,10 +28,7 @@ import com.logpm.distribution.vo.DistributionSplitOrderTaskVO; import com.logpm.distribution.vo.SplitPackageOrderVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springblade.common.constant.order.OrderReservationStatusConstant; -import org.springblade.common.constant.order.OrderSplitAllTaskStateConstant; -import org.springblade.common.constant.order.OrderSplitStateConstant; -import org.springblade.common.constant.order.OrderStatusConstant; +import org.springblade.common.constant.order.*; import org.springblade.common.constant.orderpackage.*; import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.base.BaseServiceImpl; @@ -160,11 +157,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl packageAllowCount ? packageAllowCount : packageAllowCount - 1; if (packageAllowCount < taskNumber) { - return R.fail("拆单包件数量不足,请重新填写,目前可拆单数量:" + (packageAllowCount - 1)); + return R.fail("拆单包件数量不足,请重新填写,目前可拆单数量:" + tipNumber); } - if (packageAllCount >= taskNumber) { - return R.fail("拆单数需要小于订单总数量,请重新填写,目前可拆单数量:" + (packageAllowCount - 1)); + if (packageAllCount <= taskNumber) { + return R.fail("拆单数需要小于订单总数量,请重新填写,目前可拆单数量:" + tipNumber); } taskLock(stockArticleId, () -> { @@ -191,6 +189,9 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaUpdate() + .eq(DistributionStockArticleEntity::getId, allTask.getStockArticleId()) + .set(DistributionStockArticleEntity::getSplitStatus, OrderSplitStatusConstant.No.getValue()) + ); + return R.success("success"); } @@ -823,6 +830,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaUpdate() + .eq(DistributionStockArticleEntity::getId, allTask.getStockArticleId()) + .set(DistributionStockArticleEntity::getSplitStatus, OrderSplitStatusConstant.No.getValue()) + ); + return R.success("success"); }