From 184e9d1d4ce1c33a47e5cc66478b10539a2cc4e7 Mon Sep 17 00:00:00 2001
From: zhanghl <253316343@qq.com>
Date: 星期二, 20 五月 2025 15:32:08 +0800
Subject: [PATCH] 完善钣金计划大表

---
 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java
index 6da9ad7..5bb509d 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlate/ApsPlateProcessShopStatServiceImpl.java
@@ -266,8 +266,7 @@
                 .toList();
 
         // 鑾峰彇璁″垝鍒楄〃鍜岀姸鎬佸垪琛�
-        List<ApsPlatePlan> planList = Optional.ofNullable(apsPlatePlanMapper.selectApsPlatePlanList(platePlan))
-                .orElse(Collections.emptyList());
+        List<ApsPlateProcessShopPlanStat> planList = apsPlateProcessShopStatMapper.selectPlatePlanBaseTable();
 
         List<ApsPlateProcessShopStat> shopStates = Optional.ofNullable(apsPlateProcessShopStatMapper.selectApsPlateProcessShopStatList(new ApsPlateProcessShopStat()))
                 .orElse(Collections.emptyList());
@@ -281,26 +280,22 @@
         List<SysDictData> documentStatusDic = DictUtils.getDictCache("aps_document_status");
 
         // 鏋勫缓缁撴灉鍒楄〃
-        List<ApsPlateProcessShopPlanStat> shopPlanStats = planList.stream()
-                .map(plan -> {
-                    ApsPlateProcessShopPlanStat shopPlanStat = new ApsPlateProcessShopPlanStat();
-                    BeanUtils.copyProperties(plan, shopPlanStat); // 纭繚鐩爣瀵硅薄鏄悎娉曠殑鍗曚釜瀵硅薄瀹炰緥
-
+        planList.forEach(
+                 plan -> {
                     // 鏍规嵁 docNo 鑾峰彇瀵瑰簲鐨� shopStatList
                     List<ApsPlateProcessShopStat> shopStatList = shopStatesByDocNo.getOrDefault(plan.getDocumentNumber(), Collections.emptyList());
-                    shopPlanStat.setDeptPlans(shopStatList);
+                    plan.setDeptPlans(shopStatList);
                     if (businessTypeDic != null) {
                         businessTypeDic.stream().filter(x -> x.getDictValue().equals(plan.getBusinessType())).findFirst()
-                                .ifPresent(sysDictData -> shopPlanStat.setBusinessType(sysDictData.getDictLabel()));
+                                .ifPresent(sysDictData -> plan.setBusinessType(sysDictData.getDictLabel()));
                     }
                     if (documentStatusDic != null) {
                         documentStatusDic.stream().filter(x->x.getDictValue().equals(plan.getDocumentStatus()))
-                                .findFirst().ifPresent(sysDictData -> shopPlanStat.setDocumentStatus(sysDictData.getDictLabel()));
+                                .findFirst().ifPresent(sysDictData -> plan.setDocumentStatus(sysDictData.getDictLabel()));
                     }
-                    return shopPlanStat;
-                }).toList();
+        });
         // 鏋勫缓杩斿洖缁撴灉
-        AjaxResult success = AjaxResult.success(shopPlanStats);
+        AjaxResult success = AjaxResult.success(planList);
         success.put("shopNames", shopList);
         return success;
     }

--
Gitblit v1.9.3