|
|
|
@ -2236,6 +2236,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public void changeOrderReservationStatus(DistributionStockArticleDTO stockArticleDTO) { |
|
|
|
|
Long id = stockArticleDTO.getId(); |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = Func.copy(stockArticleDTO, DistributionStockArticleEntity.class); |
|
|
|
@ -2258,9 +2259,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
List<DistributionParcelNumberEntity> parcelNumberEntities = distributionParcelNumberService.list(Wrappers.<DistributionParcelNumberEntity>query().lambda() |
|
|
|
|
.eq(DistributionParcelNumberEntity::getStockArticleId, stockArticleDTO.getId())); |
|
|
|
|
AtomicInteger unavailableNum = new AtomicInteger(); |
|
|
|
|
parcelNumberEntities.forEach(p -> { |
|
|
|
|
unavailableNum.getAndAdd(p.getOutboundQuantity() + p.getDeliveryQuantity()); |
|
|
|
|
}); |
|
|
|
|
// parcelNumberEntities.forEach(p -> {
|
|
|
|
|
// unavailableNum.getAndAdd(p.getOutboundQuantity() + p.getDeliveryQuantity());
|
|
|
|
|
// });
|
|
|
|
|
if (Func.isNotEmpty(parcelNumberEntities)){ |
|
|
|
|
int sum = parcelNumberEntities.stream().mapToInt(p -> p.getOutboundQuantity() + p.getDeliveryQuantity()).sum(); |
|
|
|
|
unavailableNum.getAndAdd(sum); |
|
|
|
|
log.info("################零担包件当前不可用数量:{}",sum); |
|
|
|
|
} |
|
|
|
|
if (unavailableNum.get() == stockArticleDTO.getHandQuantity()) { |
|
|
|
|
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
} else if (unavailableNum.get() < stockArticleDTO.getHandQuantity()) { |
|
|
|
|