From e6e7f338cd6f239c6b6835eca6da8c3d1d267a47 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Fri, 27 Sep 2024 14:52:33 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IWarehouseRetentionRecordService.java | 12 +-- .../WarehouseRetentionRecordServiceImpl.java | 90 +++++++++---------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java index eec34acab..0770f5160 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java @@ -100,12 +100,12 @@ public interface IWarehouseRetentionRecordService extends BaseService getRetentionPackageByType(@Param("retentionId") Long retentionId,@Param("type") Integer type); -// /** -// * 后台批量进行滞留 -// * @param warehouseRetentionScanEntities -// * @return -// */ -// R saveBatchRetentionList(List warehouseRetentionScanEntities); + /** + * 后台批量进行滞留 + * @param warehouseRetentionScanEntities + * @return + */ + R saveBatchRetentionList(List warehouseRetentionScanEntities); /** * 进行回库扫描 diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java index 1c45127fe..9dbdd7252 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java @@ -403,51 +403,51 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl warehouseRetentionScanEntities) { -// AtomicBoolean saveFlah = new AtomicBoolean(false); -// if (!warehouseRetentionScanEntities.isEmpty()) { -// List deliveryIds = warehouseRetentionScanEntities.stream().map(WarehouseRetentionScanEntity::getDeliveryId).distinct().collect(Collectors.toList()); -// //查询出该滞留任务是否存在 -// List retentionScanEntityList = warehouseRetentionScanService.list(Wrappers.query().lambda() -// .in(WarehouseRetentionScanEntity::getDeliveryId, deliveryIds) -// ); -// if (!retentionScanEntityList.isEmpty()) { -// String collect = retentionScanEntityList.stream().filter(f -> -// warehouseRetentionScanEntities.stream().map(w -> w.getOrderPackageCode()) -// .collect(Collectors.toList()) -// .contains(f.getOrderPackageCode())) -// .map(WarehouseRetentionScanEntity::getOrderPackageCode).collect(Collectors.joining(",")); -// if (Objects.isNull(collect)) { -// return R.fail(collect + "重复滞留"); -// } -// } -// for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : warehouseRetentionScanEntities) { -// -// //进行滞留逻辑处理 -// switch (warehouseRetentionScanEntity.getConditions()) { -// case 1: -// //订制品 -// saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getConditions())); -// break; -// case 2: -// //库存品 -// saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationInventory(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId())); -// break; -// case 3: -// //零担 -// saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationZeroPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getRetentionQuantity(), warehouseRetentionScanEntity.getOrderId())); -// break; -// default: -// log.error(">>>>> rs.getConditions()={}", warehouseRetentionScanEntity.getConditions()); -// } -// //进行滞留信息的保存 -// warehouseRetentionScanService.save(Func.copy(warehouseRetentionScanEntity, WarehouseRetentionScanEntity.class)); -// } -// } -// return R.success("操作成功"); -// } + @Override + @Transactional + public R saveBatchRetentionList(List warehouseRetentionScanEntities) { + AtomicBoolean saveFlah = new AtomicBoolean(false); + if (!warehouseRetentionScanEntities.isEmpty()) { + List deliveryIds = warehouseRetentionScanEntities.stream().map(WarehouseRetentionScanEntity::getDeliveryId).distinct().collect(Collectors.toList()); + //查询出该滞留任务是否存在 + List retentionScanEntityList = warehouseRetentionScanService.list(Wrappers.query().lambda() + .in(WarehouseRetentionScanEntity::getDeliveryId, deliveryIds) + ); + if (!retentionScanEntityList.isEmpty()) { + String collect = retentionScanEntityList.stream().filter(f -> + warehouseRetentionScanEntities.stream().map(w -> w.getOrderPackageCode()) + .collect(Collectors.toList()) + .contains(f.getOrderPackageCode())) + .map(WarehouseRetentionScanEntity::getOrderPackageCode).collect(Collectors.joining(",")); + if (Objects.isNull(collect)) { + return R.fail(collect + "重复滞留"); + } + } + for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : warehouseRetentionScanEntities) { + + //进行滞留逻辑处理 + switch (warehouseRetentionScanEntity.getConditions()) { + case 1: + //订制品 + saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getConditions(),warehouseRetentionScanEntity.getRetentionType())); + break; + case 2: + //库存品 + saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationInventory(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId())); + break; + case 3: + //零担 + saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationZeroPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getRetentionQuantity(), warehouseRetentionScanEntity.getOrderId())); + break; + default: + log.error(">>>>> rs.getConditions()={}", warehouseRetentionScanEntity.getConditions()); + } + //进行滞留信息的保存 + warehouseRetentionScanService.save(Func.copy(warehouseRetentionScanEntity, WarehouseRetentionScanEntity.class)); + } + } + return R.success("操作成功"); + } @Override public R scanRetention(WarehouseRetentionScanDTO warehouseRetentionScanDTO) {