From a70731ffad9f4481bf3c934ee5e38e5c2c1becf8 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期五, 14 三月 2025 13:11:00 +0800
Subject: [PATCH] 修改原材料查询树

---
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java |   17 +----------------
 1 files changed, 1 insertions(+), 16 deletions(-)

diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
index d3acb91..e42e414 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
@@ -91,26 +91,11 @@
             throw new ErrorException("闆朵欢鍙蜂负" + partNo + "鐨勫師鏉愭枡娌℃湁瀵瑰簲鐨勬爣鍑嗗簱閰嶇疆");
         }
         RawMaterialStandardTreeDto rawMaterialStandardTreeDto = new RawMaterialStandardTreeDto();
-        Set<String> sampleTypeValues = new HashSet<>();
         for (FactoryDto factoryDto : factoryDtos) {
             for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) {
                 for (SampleTypeDto sampleTypeDto : laboratoryDto.getChildren()) {
                     if (sampleTypeDto.getChildren().size() == 0) {
-                        sampleTypeValues.add(sampleTypeDto.getValue());
-                    }
-                }
-            }
-        }
-        // 鎵归噺鏌ヨ鎵�鏈� sampleTypeDto 鐨勬暟鎹�
-        List<SampleDto> standardList = standardTreeMapper.getStandardTree3Batch(sampleTypeValues);
-        Map<String, List<SampleDto>> standardTreeMap = standardList.stream().collect(Collectors.groupingBy(SampleDto::getValue));
-
-        for (FactoryDto factoryDto : factoryDtos) {
-            for (LaboratoryDto laboratoryDto : factoryDto.getChildren()) {
-                for (SampleTypeDto sampleTypeDto : laboratoryDto.getChildren()) {
-                    List<SampleDto> standardTreeList = standardTreeMap.get(sampleTypeDto.getValue());
-                    if (sampleTypeDto.getChildren().size() == 0) {
-                        sampleTypeDto.getChildren().addAll(standardTreeList);
+                        sampleTypeDto.setChildren(standardTreeMapper.getStandardTree3(sampleTypeDto.getValue()));
                     }
                     // 鍒ゆ柇缁戝畾鐨勬槸鍚︽槸褰撳墠闆朵欢鍙�
                     if (sampleTypeDto.getPartNo() != null && sampleTypeDto.getPartNo().equals(partNo)) {

--
Gitblit v1.9.3