Compare commits

...

2 Commits

  1. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

20
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

@ -28,6 +28,7 @@ import org.springblade.common.constant.order.OrderSplitAllTaskStateConstant;
import org.springblade.common.constant.order.OrderSplitStateConstant; import org.springblade.common.constant.order.OrderSplitStateConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageSplitStateConstant; import org.springblade.common.constant.orderpackage.OrderPackageSplitStateConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.exception.CustomerException; import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
@ -228,12 +229,14 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
int finishNumber = existsList.size() - cancelIds.size(); int finishNumber = existsList.size() - cancelIds.size();
addNumber -= finishNumber; addNumber -= finishNumber;
distributionSplitOrderDetailService.update(Wrappers.<DistributionSplitOrderDetailEntity>lambdaUpdate() if (!cancelIds.isEmpty()){
.in(DistributionSplitOrderDetailEntity::getId, cancelIds) distributionSplitOrderDetailService.update(Wrappers.<DistributionSplitOrderDetailEntity>lambdaUpdate()
.set(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue()) .in(DistributionSplitOrderDetailEntity::getId, cancelIds)
.set(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, task.getId()) .set(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue())
.set(DistributionSplitOrderDetailEntity::getSplitOrderAllTaskId, task.getSplitOrderAllTaskId()) .set(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, task.getId())
); .set(DistributionSplitOrderDetailEntity::getSplitOrderAllTaskId, task.getSplitOrderAllTaskId())
);
}
} }
ArrayList<DistributionSplitOrderDetailEntity> details = new ArrayList<>(); ArrayList<DistributionSplitOrderDetailEntity> details = new ArrayList<>();
@ -621,7 +624,8 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
DistributionStockArticleEntity originalOrder = distributionStockArticleService.getById(task.getStockArticleId()); DistributionStockArticleEntity originalOrder = distributionStockArticleService.getById(task.getStockArticleId());
originalOrder.setTotalNumber(originalOrder.getTotalNumber() - packageList.size()); originalOrder.setTotalNumber(originalOrder.getTotalNumber() - packageList.size());
originalOrder.setHandQuantity(originalOrder.getHandQuantity() - packageList.size()); originalOrder.setHandQuantity(Math.max(originalOrder.getHandQuantity() - packageList.size(), 0));
originalOrder.setIncomingNum(Math.max(originalOrder.getIncomingNum() - packageList.size(), 0));
distributionStockArticleService.updateById(originalOrder); distributionStockArticleService.updateById(originalOrder);
DistributionStockArticleEntity newOrder = distributionStockArticleService.getById(task.getNewStockArticleId()); DistributionStockArticleEntity newOrder = distributionStockArticleService.getById(task.getNewStockArticleId());
@ -632,6 +636,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
} }
newOrder.setTotalNumber(packageList.size()); newOrder.setTotalNumber(packageList.size());
newOrder.setHandQuantity(packageList.size()); newOrder.setHandQuantity(packageList.size());
newOrder.setIncomingNum(packageList.size());
if (newOrder.getId() != null) { if (newOrder.getId() != null) {
distributionStockArticleService.updateById(newOrder); distributionStockArticleService.updateById(newOrder);
}else{ }else{
@ -913,6 +918,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
if (!details.isEmpty()){ if (!details.isEmpty()){
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>lambdaQuery() List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getOrderPackageCode, details.stream().map(DistributionSplitOrderDetailEntity::getOrderPackageCode).collect(Collectors.toList())) .in(DistributionParcelListEntity::getOrderPackageCode, details.stream().map(DistributionSplitOrderDetailEntity::getOrderPackageCode).collect(Collectors.toList()))
.eq(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue())
); );
res = list.stream().map(distributionParcelListEntity -> { res = list.stream().map(distributionParcelListEntity -> {

Loading…
Cancel
Save