diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml
index 59148dcff..c6e236721 100644
--- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml
+++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml
@@ -136,8 +136,8 @@
+
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
index 2c1d5ae5d..07e2e74a1 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
@@ -576,6 +576,7 @@
logpm_distribution_reservation_package AS ldrp
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
+ ldrp.packet_bar_status in ('1','3')
and ldrp.reservation_id = #{reservationId}
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
index b64b031cb..2540b991c 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
@@ -565,7 +565,7 @@
ldrs.reservation_num reservationNum,
ldrs.stock_article_id stockArticleId,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.scan_status !=1 and ldl.signfor_state =2) signforNub,
- (SELECT COALESCE(COUNT(*), 0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.scan_status !=1 ) loadingNub
+ (SELECT COALESCE(COUNT(*), 0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.scan_status !=1 and ldl.reservation_id = ldr.id) loadingNub
FROM
logpm_distribution_reservation ldr
join logpm_distribution_reservation_stockarticle ldrs on ldr.id = ldrs.reservation_id
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
index 74c17e652..5cc28f842 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
@@ -3245,6 +3245,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationStockarticleEntityList = baseMapper.getReservationStockArticleByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId());
+ if (Func.isEmpty(reservationStockarticleEntityList)) {
+ log.error("配送任务订单查询异常:{}", reservationStockarticleEntityList);
+ return null;
+ }
+
List loadscanEntities = distributionLoadscanMapper.selectList(Wrappers.query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionDeliveryInfoDTO.getDeliveryId())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
@@ -3253,9 +3259,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl k2));
}
ArrayList distributionParcelListVOS = new ArrayList<>();
- for (DistributionStockArticleVO distributionStockArticleVO : deliveryStockArticleInfo) {
- if (distributionStockArticleVO.getIsZero().equals(IsOrNoConstant.no.getValue())) {
- List parcelListEntityList = baseMapper.getPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId(), distributionStockArticleVO.getId());
+ for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) {
+ if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
+ List parcelListEntityList = distributionReservationMapper.getReservationPackage(reservationStockarticleEntity.getReservationId(), reservationStockarticleEntity.getStockArticleId());
List parcelListVOList = DistributionParcelListWrapper.build().listVO(parcelListEntityList);
for (DistributionParcelListVO distributionParcelListVO : parcelListVOList) {
if (Func.isNotEmpty(loadingDataMap)) {
@@ -3277,9 +3283,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListEntityList = baseMapper.getPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId(), distributionStockArticleVO.getId());
- List zeroParcelListEntityList = baseMapper.getZeroPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId(), distributionStockArticleVO.getId());
+ } else if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
+ List parcelListEntityList = distributionReservationMapper.getReservationPackage(reservationStockarticleEntity.getReservationId(), reservationStockarticleEntity.getStockArticleId());
+ List zeroParcelListEntityList = baseMapper.getZeroPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId(), reservationStockarticleEntity.getStockArticleId());
List zeroParcelListVOList = DistributionParcelListWrapper.build().listVO(zeroParcelListEntityList);
for (DistributionParcelListVO parcelListVO : zeroParcelListVOList) {
if (Func.isNotEmpty(loadingDataMap)) {
@@ -3302,7 +3308,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl {
- if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) {
- DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
- distributionReservationPackageEntity.setReservationId(reservationId);
- distributionReservationPackageEntity.setParceListId(p.getId());
- distributionReservationPackageEntity.setStockArticleId(s.getId());
- distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
- //维护订单下包件信息
- distributionReservationPackageService.save(distributionReservationPackageEntity);
- //此时订单下的所有包件都处于预约状态,可用数为0
- packageNum.getAndAdd(p.getQuantity());
- //修改订单下的包件状态
+ if (p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){
+ if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) {
+ DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
+ distributionReservationPackageEntity.setReservationId(reservationId);
+ distributionReservationPackageEntity.setParceListId(p.getId());
+ distributionReservationPackageEntity.setStockArticleId(s.getId());
+ distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
+ //维护订单下包件信息
+ distributionReservationPackageService.save(distributionReservationPackageEntity);
+ //此时订单下的所有包件都处于预约状态,可用数为0
+ packageNum.getAndAdd(p.getQuantity());
+ //修改订单下的包件状态
// p.setOrderPackageReservationStatus();
- p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
- distributionParcelListService.updateById(p);
+ p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
+ distributionParcelListService.updateById(p);
+ }
}
+
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
});
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
@@ -2688,16 +2691,20 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl {
- DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
- distributionReservationPackageEntity.setReservationId(reservationId);
- distributionReservationPackageEntity.setParceListId(p.getId());
- distributionReservationPackageEntity.setStockArticleId(s.getId());
- distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
- distributionReservationPackageService.save(distributionReservationPackageEntity);
- packageNum.getAndAdd(p.getQuantity());
- p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
+ if (!p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){
+ if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())){
+ DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
+ distributionReservationPackageEntity.setReservationId(reservationId);
+ distributionReservationPackageEntity.setParceListId(p.getId());
+ distributionReservationPackageEntity.setStockArticleId(s.getId());
+ distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
+ distributionReservationPackageService.save(distributionReservationPackageEntity);
+ packageNum.getAndAdd(p.getQuantity());
+ p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
// p.setBrandId(p.getBrandId());
- distributionParcelListService.updateById(p);
+ distributionParcelListService.updateById(p);
+ }
+ }
});
// s.setReservationStatus(ServiceConstant.ORDER_RESERVATION_STATE_PART);
//设置订单可用数量为