Browse Source

Merge branch 'dev' into pre-production

pre-production
pref_mail@163.com 3 days ago
parent
commit
cc98a45950
  1. 24
      blade-biz-common/src/main/java/org/springblade/common/constant/order/OrderSplitStatusConstant.java
  2. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java
  3. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

24
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;
}
}

3
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;
/**
/* * 未入库数量
*//*

27
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<Distr
.map(DistributionSplitOrderTaskEntity::getTaskNumber)
.mapToInt(Integer::intValue)
.sum();
long tipNumber = packageAllCount > 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 BaseServiceImpl<Distr
save(distributionSplitOrderTaskEntity);
distributionSplitOrderLogService.record(distributionSplitOrderTaskEntity, "创建拆单任务", AuthUtil.getUser().getUserName());
}
distributionStockArticle.setSplitStatus(OrderSplitStatusConstant.InProgress.getValue());
distributionStockArticleService.save(distributionStockArticle);
});
} catch (Exception e) {
@ -793,6 +794,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
distributionSplitOrderAllTaskService.updateById(allTask);
list.forEach(this::cancelTask);
distributionStockArticleService.update(
Wrappers.<DistributionStockArticleEntity>lambdaUpdate()
.eq(DistributionStockArticleEntity::getId, allTask.getStockArticleId())
.set(DistributionStockArticleEntity::getSplitStatus, OrderSplitStatusConstant.No.getValue())
);
return R.success("success");
}
@ -823,6 +830,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.finish.getValue())
).forEach(this::packageTransfer);
distributionStockArticleService.update(
Wrappers.<DistributionStockArticleEntity>lambdaUpdate()
.eq(DistributionStockArticleEntity::getId, allTask.getStockArticleId())
.set(DistributionStockArticleEntity::getSplitStatus, OrderSplitStatusConstant.No.getValue())
);
return R.success("success");
}

Loading…
Cancel
Save