From 438b6be5ea9ed484b50a45a0f210b80180473491 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期二, 11 二月 2025 11:51:45 +0800
Subject: [PATCH] dnc与mdc部门进行整合 使用Mdc部门进行处理  修改所属部门为所属车间  修改yml文件数据库地址

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
index ad9d45f..1937aa0 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
@@ -1,5 +1,6 @@
 package org.jeecg.modules.mdc.service.impl;
 
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -260,6 +261,7 @@
             if (equipmentList != null && !equipmentList.isEmpty()) {
                 for (MdcEquipment mdcEquipment : equipmentList) {
                     MdcEquipmentTree tree = new MdcEquipmentTree().convert(mdcEquipment);
+
                     tree.setParentId(mdcEquipmentTree.getKey());
                     mdcEquipmentTree.getChildren().add(tree);
                 }
@@ -293,7 +295,7 @@
 
 
     @Override
-    public List<MdcEquipmentTree> loadTreeListByProduction(String userId) {
+    public List<MdcEquipmentTree> loadTreeListByProduction(String userId,String type) {
         //鑾峰彇鎵�鏈変骇绾挎暟鎹�
         List<MdcProduction> productionList = mdcProductionService.list(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()).orderByAsc(MdcProduction::getProductionOrder));
         //鏍规嵁鐢ㄦ埛id鑾峰彇鎷ユ湁鐨勪骇绾夸俊鎭泦鍚�
@@ -310,7 +312,7 @@
         //缁勮浜х嚎璁惧鏍�
         List<MdcEquipmentTree> treeList = FindsEquipmentProductionUtil.wrapEquipmentProductionTreeList(list);
         //濉厖璁惧鏁版嵁
-        FillEquipmentByProduction(treeList);
+        FillEquipmentByProduction(treeList,type);
         return treeList;
     }
 
@@ -609,19 +611,21 @@
     /**
      * 浜х嚎璁惧鏍戝~鍏呰澶囨暟鎹�
      */
-    private void FillEquipmentByProduction(List<MdcEquipmentTree> treeList) {
+    private void FillEquipmentByProduction(List<MdcEquipmentTree> treeList,String type) {
         for (MdcEquipmentTree mdcEquipmentTree : treeList) {
-            List<MdcEquipment> equipmentList = this.baseMapper.queryByProductionId(mdcEquipmentTree.getKey());
+            List<MdcEquipment> equipmentList = this.baseMapper.queryByProductionId(mdcEquipmentTree.getKey(),type);
             if (equipmentList != null && !equipmentList.isEmpty()) {
                 for (MdcEquipment mdcEquipment : equipmentList) {
                     MdcEquipmentTree tree = new MdcEquipmentTree().convert(mdcEquipment);
                     tree.setParentId(mdcEquipmentTree.getKey());
+                    tree.setEntity(mdcEquipment);
+                    tree.setType(2);
                     mdcEquipmentTree.getChildren().add(tree);
                 }
                 mdcEquipmentTree.setLeaf(false);
             }
             if (!mdcEquipmentTree.getChildren().isEmpty()) {
-                FillEquipmentByProduction(mdcEquipmentTree.getChildren());
+                FillEquipmentByProduction(mdcEquipmentTree.getChildren(),type);
             }
         }
     }
@@ -816,7 +820,7 @@
      * @return
      */
     @Override
-    public List<MdcEquipmentTree> loadTreeListByProductionIds(String ids) {
+    public List<MdcEquipmentTree> loadTreeListByProductionIds(String ids,String type) {
         List<String> productionIds = Arrays.asList(ids.split(","));
         //鑾峰彇鎵�鏈変骇绾挎暟鎹�
         List<MdcProduction> productionList = mdcProductionService.list(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()).orderByAsc(MdcProduction::getProductionOrder));
@@ -832,7 +836,7 @@
         //缁勮浜х嚎璁惧鏍�
         List<MdcEquipmentTree> treeList = FindsEquipmentProductionUtil.wrapEquipmentProductionTreeList(list);
         //濉厖璁惧鏁版嵁
-        FillEquipmentByProduction(treeList);
+        FillEquipmentByProduction(treeList,type);
         return treeList;
     }
 

--
Gitblit v1.9.3