From b0a3c888fc4a052a675074ffbe72d84f54591d0b Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 9 Jan 2024 19:52:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=BA=93=E5=AD=98=E5=93=81?= =?UTF-8?q?=E5=B7=A5=E9=9E=A5=E5=AE=8C=E5=96=84=E3=80=81=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E8=A3=85=E8=BD=A6=E7=BB=B4=E6=8A=A4=E5=AE=A2=E6=88=B7=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...stributionCancelReservationPackageDTO.java | 2 +- .../DistributionReservationServiceImpl.java | 43 ++++++++++++++++++- .../impl/DistributionSignforServiceImpl.java | 5 +++ 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionCancelReservationPackageDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionCancelReservationPackageDTO.java index a4232118b..9041b407a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionCancelReservationPackageDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionCancelReservationPackageDTO.java @@ -64,7 +64,7 @@ public class DistributionCancelReservationPackageDTO { /** * 库存品包件ID */ - private Long inventoryPackageId; + private String inventoryPackageIds; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 60befb169..e76bae8eb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -3541,10 +3541,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl 0){ - reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); - }else { reservationEntity.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue()); } + if (signingNum == 0){ + reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue()); + } } this.updateById(reservationEntity); @@ -3603,6 +3604,44 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl disStockListDetailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionCancelReservationPackageDTO.getReservationId()); + if (Func.isNotEmpty(disStockListDetailEntities)){ + for (String invenPackageId : invenPackageIds) { + List inventory = disStockListDetailEntities.stream().filter(inven -> inven.getId().equals(Long.parseLong(invenPackageId))).collect(Collectors.toList()); + if (Func.isNotEmpty(inventory) &&inventory.size() == 1){ + DisStockListDetailEntity disStockListDetailEntity = inventory.get(0); + if (disStockListDetailEntity.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue()) + ||disStockListDetailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())){ + log.info(method+"检测当前取消包件存在装车或者签收操作:inventoryPackageId{}",disStockListDetailEntity.getId()); + throw new RuntimeException("包件存在装车、签收,无法进行取消"); + } + //库存品配送包件的取消操作 + disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue()); + disStockListDetailService.updateById(disStockListDetailEntity); + //维护对应预约的配送库存品品类数据 + distributionReservationStocklistService.maintenanceReservationStockList(distributionCancelReservationPackageDTO.getReservationId()); + //进行冻结数量的扣减 + distributionStockListMapper.decreaseStockListQuantityOccupied(disStockListDetailEntity.getStockListId(),disStockListDetailEntity.getNum()); + }else { + log.error(method+"库存品包件信息异常");; + throw new RuntimeException("库存品包件信息异常"); + } + + } + }else { + log.error(method+"预约单没有库存品包件"); + return R.fail("此预约任务无库存品包件...."); + } + break; + default: //维护预约单状态 this.maintenanceReservationInfo(distributionCancelReservationPackageDTO.getReservationId()); //维护预约单数量 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 0b74915f2..16607332e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -521,6 +521,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl