From 3c9fc40e620ce844c28416a9e195a786034d164f Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期二, 21 十月 2025 10:16:19 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java
index 00bf92e..4517683 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpGoodsServiceImpl.java
@@ -411,6 +411,14 @@
                 tErpGoodsUnits.stream().filter(t -> t.getId().equals(tErpGoods.getPackingUnitId())).findFirst().ifPresent(t -> tErpGoods.setPackingUnitName(t.getUnitName()));
             }
         }
+
+        List<String> typeIds = records.stream().map(TErpGoods::getTypeId).collect(Collectors.toList());
+        if(!typeIds.isEmpty()){
+            List<TErpGoodsType> tErpGoodsTypes = erpGoodsTypeMapper.selectBatchIds(typeIds);
+            for (TErpGoods tErpGoods : records) {
+                tErpGoodsTypes.stream().filter(t -> t.getId().equals(tErpGoods.getTypeId())).findFirst().ifPresent(t -> tErpGoods.setTypeName(t.getTypeName()));
+            }
+        }
         page.setRecords( records);
         return page;
     }

--
Gitblit v1.7.1