From 80b45283b41a76653e51078c0a0f91265e816731 Mon Sep 17 00:00:00 2001 From: "HUOJIN\\92525" <925258474@qq.com> Date: Mon, 15 Jul 2024 09:38:20 +0800 Subject: [PATCH] no message --- .../businessdata/service/impl/MlsServiceImpl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/youchain-system/src/main/java/com/youchain/businessdata/service/impl/MlsServiceImpl.java b/youchain-system/src/main/java/com/youchain/businessdata/service/impl/MlsServiceImpl.java index 1ad2106..e717b10 100644 --- a/youchain-system/src/main/java/com/youchain/businessdata/service/impl/MlsServiceImpl.java +++ b/youchain-system/src/main/java/com/youchain/businessdata/service/impl/MlsServiceImpl.java @@ -24,9 +24,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; -import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; +import java.util.concurrent.CompletableFuture; @Service @RequiredArgsConstructor @@ -426,7 +427,7 @@ public class MlsServiceImpl implements MlsService { if (inventoryListFuture.join().isEmpty()) { throw new RuntimeException("无库存信息!"); } - + List errorMsgList = new ArrayList<>(); inventoryListFuture.thenAccept((result) -> { //目标点 /*Point endPoint = redisObjectUtils.getObjectFromCache("ckjbk", () -> pointService.findByCode(null, BaseStatus.FREE, null, "出库接驳口", null), @@ -441,7 +442,8 @@ public class MlsServiceImpl implements MlsService { Point endPoint; List pointList = pointRepository.findByAreaAndStatus("出库接驳口", BaseStatus.FREE); if (pointList.size() < 1) { - throw new RuntimeException("无空闲缓存位!"); + errorMsgList.add(inv.getItemKey().getPropC1() + "标签分配无空闲缓存位!"); + continue; /* 出库接驳口无空闲库位,更新状态重新分配*/ /*pointList = pointRepository.findByAreaAndStatus("出库接驳口", BaseStatus.USED); for (Point p : pointList) { @@ -507,6 +509,7 @@ public class MlsServiceImpl implements MlsService { // 批量生成任务 if (!taskToCreate.isEmpty()) { batchCreateOrUpdate.batchCreate(taskToCreate); + } }, executor); @@ -515,6 +518,10 @@ public class MlsServiceImpl implements MlsService { executor.shutdown(); }); + if (!errorMsgList.isEmpty()) { + throw new RuntimeException(errorMsgList.toString()); + } + }