From ac2e2b5af3726ee64dc37c3ebf26989a0346f22a Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期六, 07 十一月 2026 19:16:05 +0800
Subject: [PATCH] feat(feedback): 优化报工审批流程并增加报工人校验

---
 yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteServiceImpl.java |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteServiceImpl.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteServiceImpl.java
index 552161e..ab77e2e 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteServiceImpl.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteServiceImpl.java
@@ -180,11 +180,13 @@
         if (CollUtil.isEmpty(productList)) {
             throw exception(PRO_ROUTE_LAST_OUTPUT_INVALID, processList.get(processList.size() - 1).getProcessId());
         }
-        Set<Long> boundItemIds = productList.stream().map(MesProRouteProductDO::getItemId).collect(Collectors.toSet());
         Set<Long> finishedItemIds = productList.stream()
                 .map(MesProRouteProductDO::getItemId)
                 .filter(itemId -> isItemUnderCategory(itemId, "FG"))
                 .collect(Collectors.toSet());
+        if (finishedItemIds.size() != productList.size()) {
+            throw exception(PRO_ROUTE_PRODUCT_ITEM_TYPE_INVALID);
+        }
         MesProRouteProcessDO lastProcess = processList.stream()
                 .max(Comparator.comparing(MesProRouteProcessDO::getSort)).orElseThrow();
         for (MesProRouteProcessDO process : processList) {
@@ -196,12 +198,6 @@
                     throw exception(PRO_ROUTE_LAST_OUTPUT_INVALID, process.getProcessId());
                 }
                 continue;
-            }
-            for (Long outputId : outputIds) {
-                if (!boundItemIds.contains(outputId)) {
-                    MesMdItemDO item = itemService.validateItemExists(outputId);
-                    throw exception(PRO_ROUTE_PROCESS_OUTPUT_NOT_BOUND, item.getName());
-                }
             }
             if (last) {
                 if (finishedItemIds.isEmpty() || !outputIds.equals(finishedItemIds)) {

--
Gitblit v1.9.3