From a93443c567baa376b58a18aec6c98b29d381ff8a Mon Sep 17 00:00:00 2001 From: kilo Date: Sun, 15 Oct 2023 13:50:07 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=85=8D=E9=80=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=8C=85=E4=BB=B6=E4=BF=A1=E6=81=AFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionDeliveryListMapper.java | 7 +++ .../mapper/DistributionDeliveryListMapper.xml | 12 +++++ .../mapper/DistributionReservationMapper.xml | 1 + .../mapper/DistributionSignforMapper.xml | 2 +- .../DistributionDeliveryListServiceImpl.java | 20 +++++--- .../DistributionReservationServiceImpl.java | 51 +++++++++++-------- 6 files changed, 63 insertions(+), 30 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java index 0eb9ee8eb..ad335777f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java @@ -395,4 +395,11 @@ public interface DistributionDeliveryListMapper extends BaseMapper selectReservationStockByDeliveryId(@Param("delivaryListId") Long id); + + /** + * + * @param deliveryId + * @return + */ + List getReservationStockArticleByDeliveryId(@Param("delivaryListId") Long deliveryId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index fb98a8f2a..bc71db52b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -1552,5 +1552,17 @@ INNER JOIN logpm_distribution_reservation_stockarticle As ldrs ON ldrs.reservation_id = ldr.id WHERE lddl.id = #{delivaryListId} + 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); //设置订单可用数量为 From bc03126561387a872d2bfcd6209a32f0330c12d7 Mon Sep 17 00:00:00 2001 From: kilo Date: Sun, 15 Oct 2023 15:12:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B4=A7=E4=BD=8D=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 @@