From 2166b1661ca1e94fae6e4631799a9997418bff43 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期四, 26 六月 2025 11:40:37 +0800
Subject: [PATCH] 基础数据,产线,班次,班组

---
 src/main/java/org/jeecg/modules/system/util/FindsProductionsChildrenUtil.java |   55 ++++++++++++++++++++++++++-----------------------------
 1 files changed, 26 insertions(+), 29 deletions(-)

diff --git a/src/main/java/org/jeecg/modules/system/util/FindsProductionsChildrenUtil.java b/src/main/java/org/jeecg/modules/system/util/FindsProductionsChildrenUtil.java
index 3857c1d..541d32d 100644
--- a/src/main/java/org/jeecg/modules/system/util/FindsProductionsChildrenUtil.java
+++ b/src/main/java/org/jeecg/modules/system/util/FindsProductionsChildrenUtil.java
@@ -2,9 +2,9 @@
 
 import cn.hutool.core.util.StrUtil;
 import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.system.entity.MdcProduction;
-import org.jeecg.modules.system.model.MdcProductionTreeModel;
-import org.jeecg.modules.system.model.ProductionIdModel;
+import org.jeecg.modules.base.entity.Factory;
+import org.jeecg.modules.base.model.FactoryTreeModel;
+import org.jeecg.modules.base.model.FactoryIdModel;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -21,17 +21,14 @@
      * queryTreeList鐨勫瓙鏂规硶 ====1=====
      * 璇ユ柟娉曟槸s灏哅dcProduction绫诲瀷鐨刲ist闆嗗悎杞崲鎴怣dcProductionTreeModel绫诲瀷鐨勯泦鍚�
      */
-    public static List<MdcProductionTreeModel> wrapTreeDataToTreeList(List<MdcProduction> recordList) {
-        List<ProductionIdModel> idList = new ArrayList<>();
-        List<MdcProductionTreeModel> records = new ArrayList<>();
+    public static List<FactoryTreeModel> wrapTreeDataToTreeList(List<Factory> recordList) {
+        List<FactoryIdModel> idList = new ArrayList<>();
+        List<FactoryTreeModel> records = new ArrayList<>();
         for (int i = 0; i < recordList.size(); i++) {
-            MdcProduction mdcProduction = recordList.get(i);
-            if (StrUtil.isEmpty(mdcProduction.getDescription())){
-                mdcProduction.setDescription("");
-            }
-            records.add(new MdcProductionTreeModel(mdcProduction));
+            Factory factory = recordList.get(i);
+            records.add(new FactoryTreeModel(factory));
         }
-        List<MdcProductionTreeModel> tree = findChildren(records, idList);
+        List<FactoryTreeModel> tree = findChildren(records, idList);
         setEmptyChildrenAsNull(tree);
         return tree;
     }
@@ -40,14 +37,14 @@
      * queryTreeList鐨勫瓙鏂规硶 ====1=====
      * 璇ユ柟娉曟槸鎵惧埌骞跺皝瑁呴《绾х埗绫荤殑鑺傜偣鍒癟reeList闆嗗悎
      */
-    public static List<MdcProductionTreeModel> findChildren(List<MdcProductionTreeModel> recordList, List<ProductionIdModel> productionIdList) {
-        List<MdcProductionTreeModel> treeList = new ArrayList<>();
+    public static List<FactoryTreeModel> findChildren(List<FactoryTreeModel> recordList, List<FactoryIdModel> productionIdList) {
+        List<FactoryTreeModel> treeList = new ArrayList<>();
         for (int i = 0; i < recordList.size(); i++) {
-            MdcProductionTreeModel branch = recordList.get(i);
+            FactoryTreeModel branch = recordList.get(i);
             if (oConvertUtils.isEmpty(branch.getParentId())) {
                 treeList.add(branch);
-                ProductionIdModel productionIdModel = new ProductionIdModel().convert(branch);
-                productionIdList.add(productionIdModel);
+                FactoryIdModel factoryIdModel = new FactoryIdModel().convert(branch);
+                productionIdList.add(factoryIdModel);
             }
         }
         getGrandChildren(treeList, recordList, productionIdList);
@@ -58,15 +55,15 @@
      * queryTreeList鐨勫瓙鏂规硶====3====
      *璇ユ柟娉曟槸鎵惧埌椤剁骇鐖剁被涓嬬殑鎵�鏈夊瓙鑺傜偣闆嗗悎骞跺皝瑁呭埌TreeList闆嗗悎
      */
-    private static void getGrandChildren(List<MdcProductionTreeModel> treeList, List<MdcProductionTreeModel> recordList, List<ProductionIdModel> idList) {
+    private static void getGrandChildren(List<FactoryTreeModel> treeList, List<FactoryTreeModel> recordList, List<FactoryIdModel> idList) {
         for (int i = 0; i < treeList.size(); i++) {
-            MdcProductionTreeModel model = treeList.get(i);
-            ProductionIdModel idModel = idList.get(i);
+            FactoryTreeModel model = treeList.get(i);
+            FactoryIdModel idModel = idList.get(i);
             for (int i1 = 0; i1 < recordList.size(); i1++) {
-                MdcProductionTreeModel m = recordList.get(i1);
+                FactoryTreeModel m = recordList.get(i1);
                 if (m.getParentId() != null && m.getParentId().equals(model.getId())) {
                     model.getChildren().add(m);
-                    ProductionIdModel pim = new ProductionIdModel().convert(m);
+                    FactoryIdModel pim = new FactoryIdModel().convert(m);
                     idModel.setSelectable(false);
                     idModel.getChildren().add(pim);
                 }
@@ -79,9 +76,9 @@
      * queryTreeList鐨勫瓙鏂规硶 ====4====
      * 璇ユ柟娉曟槸灏嗗瓙鑺傜偣涓虹┖鐨凩ist闆嗗悎璁剧疆涓篘ull鍊�
      */
-    private static void setEmptyChildrenAsNull(List<MdcProductionTreeModel> treeList) {
+    private static void setEmptyChildrenAsNull(List<FactoryTreeModel> treeList) {
         for (int i = 0; i < treeList.size(); i++) {
-            MdcProductionTreeModel model = treeList.get(i);
+            FactoryTreeModel model = treeList.get(i);
             if (model.getChildren().size() == 0) {
                 model.setChildren(null);
                 model.setLeaf(true);
@@ -95,12 +92,12 @@
     /**
      * 鑾峰彇 DepartIdModel
      */
-    public static List<ProductionIdModel> wrapTreeDataToProductionIdTreeList(List<MdcProduction> recordList) {
-        List<ProductionIdModel> idList = new ArrayList<>();
-        List<MdcProductionTreeModel> records = new ArrayList<>();
+    public static List<FactoryIdModel> wrapTreeDataToProductionIdTreeList(List<Factory> recordList) {
+        List<FactoryIdModel> idList = new ArrayList<>();
+        List<FactoryTreeModel> records = new ArrayList<>();
         for (int i = 0; i < recordList.size(); i++) {
-            MdcProduction mdcProduction = recordList.get(i);
-            records.add(new MdcProductionTreeModel(mdcProduction));
+            Factory factory = recordList.get(i);
+            records.add(new FactoryTreeModel(factory));
         }
         findChildren(records, idList);
         return idList;

--
Gitblit v1.9.3