From f2f8241dd52ef12ec109f6f4f0f13042055338ac Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 14 二月 2025 14:55:56 +0800
Subject: [PATCH] 修改指派设备 修改设备结构树权限 优化查询 优化排序

---
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProductInfoServiceImpl.java |  582 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 478 insertions(+), 104 deletions(-)

diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProductInfoServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProductInfoServiceImpl.java
index 5163cf5..c7867fa 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProductInfoServiceImpl.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProductInfoServiceImpl.java
@@ -1,7 +1,9 @@
 package org.jeecg.modules.dnc.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.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.shiro.SecurityUtils;
@@ -11,6 +13,7 @@
 import org.jeecg.modules.dnc.exception.ExceptionCast;
 import org.jeecg.modules.dnc.mapper.ProductInfoMapper;
 
+import org.jeecg.modules.dnc.response.*;
 import org.jeecg.modules.dnc.service.*;
 import org.jeecg.modules.dnc.service.support.ProductTreeWrapper;
 import org.jeecg.modules.dnc.ucenter.Department;
@@ -18,15 +21,11 @@
 import org.jeecg.modules.dnc.utils.ValidateUtil;
 
 import org.jeecg.modules.dnc.entity.*;
+import org.jeecg.modules.system.entity.MdcProduction;
 import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.service.IMdcProductionService;
 import org.jeecg.modules.system.service.ISysUserService;
 
-import org.jeecg.modules.dnc.response.ComponentInfoCode;
-import org.jeecg.modules.dnc.response.PartsInfoCode;
-import org.jeecg.modules.dnc.response.ProductInfoCode;
-import org.jeecg.modules.dnc.response.UcenterCode;
-import org.jeecg.modules.dnc.response.CommonCode;
-import org.jeecg.modules.dnc.response.CommonGenericTree;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
@@ -71,6 +70,14 @@
     private IDocInfoService docInfoService;
     @Autowired
     private INcLogInfoService iNcLogInfoService;
+    @Autowired
+    private IWorkStepDepartmentService workStepDepartmentService;
+    @Autowired
+    private IProcessionDepartmentService processionDepartmentService;
+    @Autowired
+    private IMdcProductionService mdcProductionService;
+    @Autowired
+    private IDocRelativeService iDocRelativeService;
 
     @Override
     @Transactional(rollbackFor = {Exception.class})
@@ -165,7 +172,6 @@
 
     @Override
     public List<CommonGenericTree> loadProductTree(String userId) {
-        //todo 缈昏瘧鍒涘缓浜轰慨鏀逛汉
         //浜у搧
         List<ProductInfo> productInfoList = getByUserPerms(userId);
         if(productInfoList == null || productInfoList.isEmpty())
@@ -232,6 +238,11 @@
         if(processStreams != null && !processStreams.isEmpty())
             ExceptionCast.cast(ProductInfoCode.PRODUCT_PROCESS_EXIST);
         boolean b = productPermissionService.deleteByProductId(id);
+        //楠岃瘉鏄惁瀛樺湪鏂囨。
+        List<DocRelative> docRelativeList=iDocRelativeService.list(new QueryWrapper<DocRelative>().eq("attribution_type","1").eq("attribution_id",id));
+        if (!docRelativeList.isEmpty()){
+            ExceptionCast.cast(ProductInfoCode.PRODUCT_DOC_EXIST);
+        }
         if(!b)
             ExceptionCast.cast(CommonCode.FAIL);
         b = productDepartmentService.deleteByProductId(id);
@@ -243,18 +254,6 @@
         b = permissionStreamService.deleteDepartPermsByProductId(id);
         if(!b)
             ExceptionCast.cast(CommonCode.FAIL);
-        b = docInfoService.deleteByProductId(id);
-        if(!b)
-            ExceptionCast.cast(CommonCode.FAIL);
-        //娣诲姞鏃ュ織
-        NcLogInfo ncLogInfo = new NcLogInfo();
-        //妯″潡
-        ncLogInfo.setModuleInfo("浜у搧缁撴瀯鏍�");
-        //绫诲瀷
-        ncLogInfo.setOperateType(4);
-        //鏃ュ織鍐呭
-        ncLogInfo.setLogContent("浜у搧鍚嶇О锛�"+productInfo.getProductName());
-        iNcLogInfoService.saveLogNcInfos(ncLogInfo);
         return super.removeById(id);
     }
 
@@ -271,25 +270,33 @@
             if(productInfo == null)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_NOT_EXIST);
             PermissionStream permission = permissionStreamService.getByProductIdAndUserId(paramId, userId);
-            if(permission == null)
-                return false;
-            return true;
+            return permission != null;
         }else if(nodeType == 2) {
             ComponentInfo componentInfo = componentInfoService.getById(paramId);
             if(componentInfo == null)
                 ExceptionCast.cast(ComponentInfoCode.COMPONENT_NOT_EXIST);
             PermissionStream permission = permissionStreamService.getByComponentIdAndUserId(componentInfo.getProductId(), paramId, userId);
-            if(permission == null)
-                return false;
-            return true;
+            return permission != null;
         }else if(nodeType == 3) {
             PartsInfo partsInfo = partsInfoService.getById(paramId);
             if(partsInfo == null)
                 ExceptionCast.cast(PartsInfoCode.PARTS_NOT_EXIST);
             PermissionStream permission = permissionStreamService.getByPartsIdAndUserId(partsInfo.getProductId(), partsInfo.getComponentId(), paramId, userId);
-            if(permission == null)
-                return false;
-            return true;
+            return permission != null;
+        }else if (nodeType == 5) {
+            ProcessStream processStream=processStreamService.getById(paramId);
+            if(processStream == null)
+                ExceptionCast.cast(ProcessInfoCode.PROCESS_NOT_EXIST);
+            PermissionStream permission = permissionStreamService.getByProcessIdAndUserId(processStream.getProductId(),processStream.getComponentId()
+                        ,processStream.getPartsId(),processStream.getProcessId(),userId);
+            return permission != null;
+        }else if (nodeType == 6){
+            WorkStep workStep=workStepService.getById(paramId);
+            if(workStep == null)
+                ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST);
+            PermissionStream permission = permissionStreamService.getByStepIdAndUserId(workStep.getProductId(),workStep.getComponentId()
+                    ,workStep.getPartsId(),workStep.getProcessId(),workStep.getId(),userId);
+            return permission != null;
         }
         return false;
     }
@@ -325,7 +332,7 @@
     }
 
     @Override
-    public List<Department> getDepartPermsList(Integer nodeType, String paramId) {
+    public List<MdcProduction> getDepartPermsList(Integer nodeType, String paramId) {
         if(!ValidateUtil.validateInteger(nodeType) || !ValidateUtil.validateString(paramId))
             return null;
         if(nodeType == 1) {
@@ -334,13 +341,19 @@
             return componentDepartmentService.getDepartPermsByComponentId(paramId);
         }else if(nodeType == 3) {
             return partsDepartmentService.getDepartPermsByPartsId(paramId);
-        }else {
+        }else if(nodeType == 5) {
+            return processionDepartmentService.getDepartPermsByProcessId(paramId);
+        }else if(nodeType == 6) {
+            return workStepDepartmentService.getDepartPermsByStepId(paramId);
+        }
+        //todo 灏佽鏍戠姸缁撴瀯
+        else {
             return null;
         }
     }
 
     @Override
-    public List<Department> getDepartNonPermsList(Integer nodeType, String paramId) {
+    public List<MdcProduction> getDepartNonPermsList(Integer nodeType, String paramId) {
         if(!ValidateUtil.validateInteger(nodeType) || !ValidateUtil.validateString(paramId))
             return null;
         if(nodeType == 1) {
@@ -349,7 +362,13 @@
             return componentDepartmentService.getDepartNonPermsByComponentId(paramId);
         }else if(nodeType == 3) {
             return partsDepartmentService.getDepartNonPermsByProductId(paramId);
-        }else {
+        }else if(nodeType == 5) {
+            return processionDepartmentService.getDepartNonPermsByProcessId(paramId);
+        }else if(nodeType == 6) {
+            return workStepDepartmentService.getDepartNonPermsByStepId(paramId);
+        }
+        //todo 灏佽鏍戠姸缁撴瀯
+        else {
             return null;
         }
     }
@@ -773,7 +792,7 @@
 
     /**
      * 寰呬紭鍖� TODO
-     * @param nodeType 1 浜у搧 2 閮ㄤ欢 3 闆朵欢
+     * @param nodeType 1 浜у搧 2 閮ㄤ欢 3 闆朵欢 5 宸ュ簭 6 宸ユ
      * @param paramId 浜у搧鏍戣妭鐐筰d
      * @param relativeFlag 1 鏄� 2 鍚�
      * @param departmentIds 娣诲姞閮ㄩ棬ids
@@ -789,10 +808,30 @@
             ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_NONE);
         List<String> ids = new ArrayList<>(departmentIds.length);
         Collections.addAll(ids, departmentIds);
-        Collection<Department> departList = departmentService.listByIds(ids);
-        if(departList == null || departList.isEmpty() || departList.size() != departmentIds.length)
+        Collection<MdcProduction> mdcProductionList=mdcProductionService.listByIds(ids);
+        if(mdcProductionList == null || mdcProductionList.isEmpty() || mdcProductionList.size() != departmentIds.length)
             ExceptionCast.cast(CommonCode.INVALID_PARAM);
-        if(nodeType == 3) {
+        if(nodeType == 6) {
+            //澶勭悊宸ユ
+            WorkStep workStep=workStepService.getById(paramId);
+            if (workStep == null)
+                ExceptionCast.cast(PartsInfoCode.PARTS_NOT_EXIST);
+            boolean b = checkProductPerm(6, workStep.getId());
+            if (!b) {
+                ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
+            }
+            return workStepService.assignAddDepart(workStep, mdcProductionList);
+        }else if(nodeType == 5) {
+            //澶勭悊宸ュ簭
+            ProcessStream processStream = processStreamService.getById(paramId);
+            if (processStream == null)
+                ExceptionCast.cast(PartsInfoCode.PARTS_NOT_EXIST);
+            boolean b = checkProductPerm(5, processStream.getProcessId());
+            if (!b) {
+                ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
+            }
+            return processStreamService.assignAddDepart(processStream, mdcProductionList);
+        }else if(nodeType == 3) {
             //澶勭悊闆朵欢
             PartsInfo partsInfo = partsInfoService.getById(paramId);
             if(partsInfo == null)
@@ -801,7 +840,7 @@
             if(!b) {
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
             }
-            return partsInfoService.assignAddDepart(partsInfo, departList);
+            return partsInfoService.assignAddDepart(partsInfo, mdcProductionList);
         }else if(nodeType == 1) {
             //澶勭悊浜у搧
             ProductInfo productInfo = super.getById(paramId);
@@ -810,7 +849,7 @@
             boolean b1 = checkProductPerm(1, productInfo.getProductId());
             if(!b1)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
-            b1 = this.assignAddDepartment(productInfo, departList);
+            b1 = this.assignAddDepartment(productInfo, mdcProductionList);
             if(!b1)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
             if(relativeFlag == 1) {
@@ -819,9 +858,14 @@
                 //鏈�缁堜繚瀛樻潈闄愭暟鎹垵濮嬪寲
                 List<ComponentDepartment> componentPermissionList = new ArrayList<>();
                 List<PartsDepartment> partsPermissionList = new ArrayList<>();
+                List<ProcessionDepartment> processionPermissionList = new ArrayList<>();
+                List<WorkStepDepartment> workStepDepartmentList=new ArrayList<>();
                 List<PermissionStream> permissionStreamList = new ArrayList<>();
                 //澶勭悊瀛愰儴浠�
                 List<String> componentIds = new ArrayList<>();
+                List<String> partsIds= new ArrayList<>();
+                List<String> ProcessionIds= new ArrayList<>();
+                List<String> workStepIds= new ArrayList<>();
                 PermissionStream s;
 
                 Map<String, ComponentDepartment> componentPermissionMap = new HashMap<>();
@@ -834,9 +878,9 @@
                 for(ComponentInfo c : componentInfoList){
                     componentIds.add(c.getComponentId());
                     componentInfoMap.put(c.getComponentId(), c);
-                    for(Department u : departList){
-                        key = c.getComponentId() + "," + u.getDepartId();
-                        cp = new ComponentDepartment(c.getComponentId(), u.getDepartId());
+                    for(MdcProduction mdcProduction : mdcProductionList){
+                        key = c.getComponentId() + "," + mdcProduction.getId();
+                        cp = new ComponentDepartment(c.getComponentId(), mdcProduction.getId());
                         componentPermissionMap.put(key, cp);
                     }
                 }
@@ -867,15 +911,15 @@
                 if(partsInfoList != null && !partsInfoList.isEmpty()) {
                     Map<String, PartsDepartment> partsPermissionHashMap = new HashMap<>();
                     Map<String, PartsInfo> partsInfoMap = new HashMap<>();
-                    List<String> partsIds = new ArrayList<>();
+                    partsIds = new ArrayList<>();
                     PartsDepartment pp;
                     PartsInfo ptInfo;
                     for(PartsInfo p : partsInfoList){
                         partsIds.add(p.getPartsId());
                         partsInfoMap.put(p.getPartsId(), p);
-                        for(Department u : departList){
-                            key = p.getPartsId() + "," + u.getDepartId();
-                            pp = new PartsDepartment(p.getPartsId(), u.getDepartId());
+                        for(MdcProduction mdcProduction : mdcProductionList){
+                            key = p.getPartsId() + "," + mdcProduction.getId();
+                            pp = new PartsDepartment(p.getPartsId(), mdcProduction.getId());
                             partsPermissionHashMap.put(key, pp);
                         }
                     }
@@ -905,11 +949,105 @@
                     }
                 }
 
+                //鏌ヨ宸ュ簭宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                List<ProcessStream> processStreamList = processStreamService.getByComponentIdList(productInfo.getProductId(),componentIds,partsIds);
+                if(processStreamList != null && !processStreamList.isEmpty()) {
+                    Map<String, ProcessionDepartment> processionDepartmentHashMap = new HashMap<>();
+                    Map<String, ProcessStream> processStreamMap = new HashMap<>();
+                    ProcessionIds = new ArrayList<>();
+                    ProcessionDepartment pp;
+                    ProcessStream processStream;
+                    for(ProcessStream p : processStreamList){
+                        ProcessionIds.add(p.getProcessId());
+                        processStreamMap.put(p.getProcessId(), p);
+                        for(MdcProduction mdcProduction : mdcProductionList){
+                            key = p.getPartsId() + "," + mdcProduction.getId();
+                            pp = new ProcessionDepartment(p.getProcessId(), mdcProduction.getId());
+                            processionDepartmentHashMap.put(key, pp);
+                        }
+                    }
+
+                    //鏌ヨ宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                    List<ProcessionDepartment> processionDepartmentList = processionDepartmentService.getByPartsIdsAndDepartIds(ProcessionIds, ids);
+                    if(processionDepartmentList != null && !processionDepartmentList.isEmpty()){
+                        //韪㈠嚭鏉冮檺鏁版嵁
+                        for(ProcessionDepartment processionDepartment : processionDepartmentList){
+                            key = processionDepartment.getProcessId() + "," + processionDepartment.getDepartId();
+                            if(processionDepartmentHashMap.containsKey(key)){
+                                processionDepartmentHashMap.remove(key);
+                            }
+                        }
+                    }
+
+                    for(Map.Entry<String, ProcessionDepartment> entry : processionDepartmentHashMap.entrySet()){
+                        pp = entry.getValue();
+                        processionPermissionList.add(pp);
+                        processStream = processStreamMap.get(pp.getProcessId());
+                        s = new PermissionStream();
+                        s.setProductId(processStream.getProductId());
+                        s.setComponentId(processStream.getComponentId());
+                        s.setPartsId(processStream.getPartsId());
+                        s.setProcessId(processStream.getProcessId());
+                        s.setDepartId(pp.getDepartId());
+                        permissionStreamList.add(s);
+                    }
+                }
+                //鏌ヨ宸ユ宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                List<WorkStep> workStepList = workStepService.getByProcessIds(productInfo.getProductId(),ProcessionIds);
+                if(workStepList != null && !workStepList.isEmpty()) {
+                    Map<String, WorkStepDepartment> workStepDepartmentHashMap = new HashMap<>();
+                    Map<String, WorkStep> workStepHashMap = new HashMap<>();
+                    workStepIds = new ArrayList<>();
+                    WorkStepDepartment ws;
+                    WorkStep workStep;
+                    for(WorkStep w : workStepList){
+                        workStepIds.add(w.getId());
+                        workStepHashMap.put(w.getId(), w);
+                        for(MdcProduction mdcProduction : mdcProductionList){
+                            key = w.getId() + "," + mdcProduction.getId();
+                            ws = new WorkStepDepartment(w.getId(), mdcProduction.getId());
+                            workStepDepartmentHashMap.put(key, ws);
+                        }
+                    }
+
+                    //鏌ヨ宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                    List<WorkStepDepartment> workStepDepartments = workStepDepartmentService.getByPartsIdsAndDepartIds(workStepIds, ids);
+                    if(workStepDepartments != null && !workStepDepartments.isEmpty()){
+                        //韪㈠嚭鏉冮檺鏁版嵁
+                        for(WorkStepDepartment workStepDepartment : workStepDepartments){
+                            key = workStepDepartment.getStepId() + "," + workStepDepartment.getDepartId();
+                            if(workStepDepartmentHashMap.containsKey(key)){
+                                workStepDepartmentHashMap.remove(key);
+                            }
+                        }
+                    }
+
+                    for(Map.Entry<String, WorkStepDepartment> entry : workStepDepartmentHashMap.entrySet()){
+                        ws = entry.getValue();
+                        workStepDepartmentList.add(ws);
+                        workStep = workStepHashMap.get(ws.getStepId());
+                        s = new PermissionStream();
+                        s.setProductId(workStep.getProductId());
+                        s.setComponentId(workStep.getComponentId());
+                        s.setPartsId(workStep.getPartsId());
+                        s.setProcessId(workStep.getProcessId());
+                        s.setStepId(workStep.getId());
+                        s.setDepartId(ws.getDepartId());
+                        permissionStreamList.add(s);
+                    }
+                }
+
                 if(!componentPermissionList.isEmpty()){
                     componentDepartmentService.saveBatch(componentPermissionList);
                 }
                 if(!partsPermissionList.isEmpty()){
                     partsDepartmentService.saveBatch(partsPermissionList);
+                }
+                if(!processionPermissionList.isEmpty()){
+                    processionDepartmentService.saveBatch(processionPermissionList);
+                }
+                if (!workStepDepartmentList.isEmpty()) {
+                    workStepDepartmentService.saveBatch(workStepDepartmentList);
                 }
                 if(!permissionStreamList.isEmpty()){
                     permissionStreamService.saveBatch(permissionStreamList);
@@ -923,7 +1061,7 @@
             boolean b1 = checkProductPerm(2, componentInfo.getComponentId());
             if(!b1)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
-            b1 = componentInfoService.assignAddDepart(componentInfo, departList);
+            b1 = componentInfoService.assignAddDepart(componentInfo, mdcProductionList);
             if(!b1)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
             if(relativeFlag == 1) {
@@ -933,10 +1071,15 @@
                 //鏈�缁堜繚瀛樻潈闄愭暟鎹垵濮嬪寲
                 List<ComponentDepartment> componentPermissionList = new ArrayList<>();
                 List<PartsDepartment> partsPermissionList = new ArrayList<>();
+                List<ProcessionDepartment> processionPermissionList = new ArrayList<>();
+                List<WorkStepDepartment> workStepDepartmentList=new ArrayList<>();
                 List<PermissionStream> permissionStreamList = new ArrayList<>();
                 //澶勭悊瀛愰儴浠�
                 PermissionStream s;
-
+                List<String> componentIds = new ArrayList<>();
+                List<String> partsIds= new ArrayList<>();
+                List<String> ProcessionIds= new ArrayList<>();
+                List<String> workStepIds= new ArrayList<>();
                 Map<String, ComponentDepartment> componentPermissionMap = new HashMap<>();
                 Map<String, ComponentInfo> componentInfoMap = new HashMap<>();
 
@@ -944,35 +1087,37 @@
                 String key;
                 ComponentDepartment cp;
                 ComponentInfo cpInfo;
-                for(ComponentInfo c : childrenList){
-                    componentIdList.add(c.getComponentId());
-                    componentInfoMap.put(c.getComponentId(), c);
-                    for(Department u : departList){
-                        key = c.getComponentId() + "," + u.getDepartId();
-                        cp = new ComponentDepartment(c.getComponentId(), u.getDepartId());
-                        componentPermissionMap.put(key, cp);
-                    }
-                }
-                //鏌ヨ宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
-                List<ComponentDepartment> existList = componentDepartmentService.getByComponentIdsAndDepartIds(componentIdList, ids);
-                if(existList != null && !existList.isEmpty()){
-                    //韪㈠嚭鏉冮檺鏁版嵁
-                    for(ComponentDepartment permission : existList){
-                        key = permission.getComponentId() + "," + permission.getDepartId();
-                        if(componentPermissionMap.containsKey(key)){
-                            componentPermissionMap.remove(key);
+                if(childrenList != null && !childrenList.isEmpty()) {
+                    for (ComponentInfo c : childrenList) {
+                        componentIdList.add(c.getComponentId());
+                        componentInfoMap.put(c.getComponentId(), c);
+                        for (MdcProduction mdcProduction : mdcProductionList) {
+                            key = c.getComponentId() + "," + mdcProduction.getId();
+                            cp = new ComponentDepartment(c.getComponentId(), mdcProduction.getId());
+                            componentPermissionMap.put(key, cp);
                         }
                     }
-                }
-                for(Map.Entry<String, ComponentDepartment> entry : componentPermissionMap.entrySet()){
-                    cp = entry.getValue();
-                    componentPermissionList.add(cp);
-                    cpInfo = componentInfoMap.get(cp.getComponentId());
-                    s = new PermissionStream();
-                    s.setProductId(cpInfo.getProductId());
-                    s.setComponentId(cpInfo.getComponentId());
-                    s.setDepartId(cp.getDepartId());
-                    permissionStreamList.add(s);
+                    //鏌ヨ宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                    List<ComponentDepartment> existList = componentDepartmentService.getByComponentIdsAndDepartIds(componentIdList, ids);
+                    if (existList != null && !existList.isEmpty()) {
+                        //韪㈠嚭鏉冮檺鏁版嵁
+                        for (ComponentDepartment permission : existList) {
+                            key = permission.getComponentId() + "," + permission.getDepartId();
+                            if (componentPermissionMap.containsKey(key)) {
+                                componentPermissionMap.remove(key);
+                            }
+                        }
+                    }
+                    for (Map.Entry<String, ComponentDepartment> entry : componentPermissionMap.entrySet()) {
+                        cp = entry.getValue();
+                        componentPermissionList.add(cp);
+                        cpInfo = componentInfoMap.get(cp.getComponentId());
+                        s = new PermissionStream();
+                        s.setProductId(cpInfo.getProductId());
+                        s.setComponentId(cpInfo.getComponentId());
+                        s.setDepartId(cp.getDepartId());
+                        permissionStreamList.add(s);
+                    }
                 }
 
                 //澶勭悊瀛愰浂浠�
@@ -981,15 +1126,15 @@
                 if(partsInfoList != null && !partsInfoList.isEmpty()) {
                     Map<String, PartsDepartment> partsPermissionHashMap = new HashMap<>();
                     Map<String, PartsInfo> partsInfoMap = new HashMap<>();
-                    List<String> partsIds = new ArrayList<>();
+                    partsIds = new ArrayList<>();
                     PartsDepartment pp;
                     PartsInfo ptInfo;
                     for(PartsInfo p : partsInfoList){
                         partsIds.add(p.getPartsId());
                         partsInfoMap.put(p.getPartsId(), p);
-                        for(Department u : departList){
-                            key = p.getPartsId() + "," + u.getDepartId();
-                            pp = new PartsDepartment(p.getPartsId(), u.getDepartId());
+                        for(MdcProduction mdcProduction : mdcProductionList){
+                            key = p.getPartsId() + "," + mdcProduction.getId();
+                            pp = new PartsDepartment(p.getPartsId(), mdcProduction.getId());
                             partsPermissionHashMap.put(key, pp);
                         }
                     }
@@ -1019,11 +1164,105 @@
                     }
                 }
 
+                //鏌ヨ宸ュ簭宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                List<ProcessStream> processStreamList = processStreamService.getByComponentIdList(componentInfo.getProductId(),componentIds,partsIds);
+                if(processStreamList != null && !processStreamList.isEmpty()) {
+                    Map<String, ProcessionDepartment> processionDepartmentHashMap = new HashMap<>();
+                    Map<String, ProcessStream> processStreamMap = new HashMap<>();
+                    ProcessionIds = new ArrayList<>();
+                    ProcessionDepartment pp;
+                    ProcessStream processStream;
+                    for(ProcessStream p : processStreamList){
+                        ProcessionIds.add(p.getProcessId());
+                        processStreamMap.put(p.getProcessId(), p);
+                        for(MdcProduction mdcProduction : mdcProductionList){
+                            key = p.getPartsId() + "," + mdcProduction.getId();
+                            pp = new ProcessionDepartment(p.getProcessId(), mdcProduction.getId());
+                            processionDepartmentHashMap.put(key, pp);
+                        }
+                    }
+
+                    //鏌ヨ宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                    List<ProcessionDepartment> processionDepartmentList = processionDepartmentService.getByPartsIdsAndDepartIds(ProcessionIds, ids);
+                    if(processionDepartmentList != null && !processionDepartmentList.isEmpty()){
+                        //韪㈠嚭鏉冮檺鏁版嵁
+                        for(ProcessionDepartment processionDepartment : processionDepartmentList){
+                            key = processionDepartment.getProcessId() + "," + processionDepartment.getDepartId();
+                            if(processionDepartmentHashMap.containsKey(key)){
+                                processionDepartmentHashMap.remove(key);
+                            }
+                        }
+                    }
+
+                    for(Map.Entry<String, ProcessionDepartment> entry : processionDepartmentHashMap.entrySet()){
+                        pp = entry.getValue();
+                        processionPermissionList.add(pp);
+                        processStream = processStreamMap.get(pp.getProcessId());
+                        s = new PermissionStream();
+                        s.setProductId(processStream.getProductId());
+                        s.setComponentId(processStream.getComponentId());
+                        s.setPartsId(processStream.getPartsId());
+                        s.setProcessId(processStream.getProcessId());
+                        s.setDepartId(pp.getDepartId());
+                        permissionStreamList.add(s);
+                    }
+                }
+                //鏌ヨ宸ユ宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                List<WorkStep> workStepList = workStepService.getByProcessIds(componentInfo.getProductId(),ProcessionIds);
+                if(workStepList != null && !workStepList.isEmpty()) {
+                    Map<String, WorkStepDepartment> workStepDepartmentHashMap = new HashMap<>();
+                    Map<String, WorkStep> workStepHashMap = new HashMap<>();
+                    workStepIds = new ArrayList<>();
+                    WorkStepDepartment ws;
+                    WorkStep workStep;
+                    for(WorkStep w : workStepList){
+                        workStepIds.add(w.getId());
+                        workStepHashMap.put(w.getId(), w);
+                        for(MdcProduction mdcProduction : mdcProductionList){
+                            key = w.getId() + "," + mdcProduction.getId();
+                            ws = new WorkStepDepartment(w.getId(), mdcProduction.getId());
+                            workStepDepartmentHashMap.put(key, ws);
+                        }
+                    }
+
+                    //鏌ヨ宸插瓨鍦ㄧ殑鏉冮檺鏁版嵁
+                    List<WorkStepDepartment> workStepDepartments = workStepDepartmentService.getByPartsIdsAndDepartIds(workStepIds, ids);
+                    if(workStepDepartments != null && !workStepDepartments.isEmpty()){
+                        //韪㈠嚭鏉冮檺鏁版嵁
+                        for(WorkStepDepartment workStepDepartment : workStepDepartments){
+                            key = workStepDepartment.getStepId() + "," + workStepDepartment.getDepartId();
+                            if(workStepDepartmentHashMap.containsKey(key)){
+                                workStepDepartmentHashMap.remove(key);
+                            }
+                        }
+                    }
+
+                    for(Map.Entry<String, WorkStepDepartment> entry : workStepDepartmentHashMap.entrySet()){
+                        ws = entry.getValue();
+                        workStepDepartmentList.add(ws);
+                        workStep = workStepHashMap.get(ws.getStepId());
+                        s = new PermissionStream();
+                        s.setProductId(workStep.getProductId());
+                        s.setComponentId(workStep.getComponentId());
+                        s.setPartsId(workStep.getPartsId());
+                        s.setProcessId(workStep.getProcessId());
+                        s.setStepId(workStep.getId());
+                        s.setDepartId(ws.getDepartId());
+                        permissionStreamList.add(s);
+                    }
+                }
+
                 if(!componentPermissionList.isEmpty()){
                     componentDepartmentService.saveBatch(componentPermissionList);
                 }
                 if(!partsPermissionList.isEmpty()){
                     partsDepartmentService.saveBatch(partsPermissionList);
+                }
+                if(!processionPermissionList.isEmpty()){
+                    processionDepartmentService.saveBatch(processionPermissionList);
+                }
+                if (!workStepDepartmentList.isEmpty()) {
+                    workStepDepartmentService.saveBatch(workStepDepartmentList);
                 }
                 if(!permissionStreamList.isEmpty()){
                     permissionStreamService.saveBatch(permissionStreamList);
@@ -1036,7 +1275,7 @@
 
     /**
      * 寰呬紭鍖� TODO
-     * @param nodeType 1 浜у搧 2 閮ㄤ欢 3 闆朵欢
+     * @param nodeType 1 浜у搧 2 閮ㄤ欢 3 闆朵欢 5 宸ュ簭 6 宸ユ
      * @param paramId 浜у搧鏍戣妭鐐筰d
      * @param relativeFlag 1 鏄� 2 鍚�
      * @param departmentIds 绉婚櫎閮ㄩ棬ids
@@ -1052,10 +1291,30 @@
             ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_NONE);
         List<String> ids = new ArrayList<>(departmentIds.length);
         Collections.addAll(ids, departmentIds);
-        Collection<Department> departList = departmentService.listByIds(ids);
-        if(departList == null || departList.isEmpty() || departList.size() != departmentIds.length)
+        Collection<MdcProduction> mdcProductionList=mdcProductionService.listByIds(ids);
+        if(mdcProductionList == null || mdcProductionList.isEmpty() || mdcProductionList.size() != departmentIds.length)
             ExceptionCast.cast(CommonCode.INVALID_PARAM);
-        if(nodeType == 3) {
+        if(nodeType == 6) {
+            //澶勭悊宸ユ
+            WorkStep workStep=workStepService.getById(paramId);
+            if (workStep == null)
+                ExceptionCast.cast(PartsInfoCode.PARTS_NOT_EXIST);
+            boolean b = checkProductPerm(6, workStep.getId());
+            if (!b) {
+                ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
+            }
+            return workStepService.assignRemoveDepart(workStep, mdcProductionList);
+        }else if(nodeType == 5) {
+            //澶勭悊宸ュ簭
+            ProcessStream processStream = processStreamService.getById(paramId);
+            if (processStream == null)
+                ExceptionCast.cast(PartsInfoCode.PARTS_NOT_EXIST);
+            boolean b = checkProductPerm(5, processStream.getProcessId());
+            if (!b) {
+                ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
+            }
+            return processStreamService.assignRemoveDepart(processStream, mdcProductionList);
+        }else if(nodeType == 3) {
             //澶勭悊闆朵欢
             PartsInfo partsInfo = partsInfoService.getById(paramId);
             if(partsInfo == null)
@@ -1064,7 +1323,7 @@
             if(!b) {
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
             }
-            return partsInfoService.assignRemoveDepart(partsInfo, departList);
+            return partsInfoService.assignRemoveDepart(partsInfo, mdcProductionList);
         }else if(nodeType == 1) {
             //澶勭悊浜у搧
             ProductInfo productInfo = super.getById(paramId);
@@ -1073,7 +1332,7 @@
             boolean b1 = checkProductPerm(1, productInfo.getProductId());
             if(!b1)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
-            b1 = this.assignRemoveDepartment(productInfo, departList);
+            b1 = this.assignRemoveDepartment(productInfo, mdcProductionList);
             if(!b1)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
             if(relativeFlag == 1) {
@@ -1082,8 +1341,13 @@
                 //鎬昏闇�瑕佸垹闄ょ殑鏁版嵁淇℃伅
                 List<ComponentDepartment> componentPermissionList = new ArrayList<>();
                 List<PartsDepartment> partsPermissionList = new ArrayList<>();
+                List<ProcessionDepartment> processionPermissionList = new ArrayList<>();
+                List<WorkStepDepartment> workStepDepartmentList=new ArrayList<>();
                 List<PermissionStream> permissionStreamList = new ArrayList<>();
                 List<ComponentInfo> componentInfoList = componentInfoService.getByProductId(productInfo.getProductId());
+                List<String> partsIds= new ArrayList<>();
+                List<String> ProcessionIds= new ArrayList<>();
+                List<String> workStepIds= new ArrayList<>();
                 if(componentInfoList != null && !componentInfoList.isEmpty()) {
                     for(ComponentInfo componentInfo : componentInfoList){
                         componentIds.add(componentInfo.getComponentId());
@@ -1097,7 +1361,7 @@
 
                 //澶勭悊浜у搧 涓嬬殑闆朵欢
                 List<PartsInfo> partsInfoList = partsInfoService.getByComponentIdList(productInfo.getProductId(), componentIds);
-                List<String> partsIds = new ArrayList<>();
+                partsIds = new ArrayList<>();
                 if(partsInfoList != null && !partsInfoList.isEmpty()) {
                     for(PartsInfo partsInfo : partsInfoList){
                         partsIds.add(partsInfo.getPartsId());
@@ -1109,11 +1373,45 @@
                     }
                 }
 
+                //澶勭悊宸ュ簭
+                List<ProcessStream> processStreamList=processStreamService.getByComponentIdList(productInfo.getProductId(), componentIds,partsIds);
+                ProcessionIds = new ArrayList<>();
+                if(processStreamList != null && !processStreamList.isEmpty()) {
+                    for(ProcessStream processStream : processStreamList){
+                        ProcessionIds.add(processStream.getProcessId());
+                    }
+                    processionPermissionList = processionDepartmentService.getByPartsIdsAndDepartIds(ProcessionIds, ids);
+                    List<PermissionStream> existPermissionList = permissionStreamService.getByPartsIdsAndDepartIds(ProcessionIds, ids);
+                    if(existPermissionList != null && !existPermissionList.isEmpty()){
+                        permissionStreamList.addAll(existPermissionList);
+                    }
+                }
+
+                //澶勭悊宸ユ
+                List<WorkStep> workStepList=workStepService.getByProcessIds(productInfo.getProductId(), ProcessionIds);
+                workStepIds = new ArrayList<>();
+                if(workStepList != null && !workStepList.isEmpty()) {
+                    for(WorkStep workStep : workStepList){
+                        workStepIds.add(workStep.getId());
+                    }
+                    workStepDepartmentList = workStepDepartmentService.getByPartsIdsAndDepartIds(workStepIds, ids);
+                    List<PermissionStream> existPermissionList = permissionStreamService.getByPartsIdsAndDepartIds(workStepIds, ids);
+                    if(existPermissionList != null && !existPermissionList.isEmpty()){
+                        permissionStreamList.addAll(existPermissionList);
+                    }
+                }
+
                 if(componentPermissionList != null && !componentPermissionList.isEmpty()){
                     componentDepartmentService.removeByCollection(componentPermissionList);
                 }
                 if(partsPermissionList != null && !partsPermissionList.isEmpty()){
                     partsDepartmentService.removeByCollection(partsPermissionList);
+                }
+                if(processionPermissionList != null && !processionPermissionList.isEmpty()){
+                    processionDepartmentService.removeByCollection(processionPermissionList);
+                }
+                if(workStepDepartmentList != null && !workStepDepartmentList.isEmpty()){
+                    workStepDepartmentService.removeByCollection(workStepDepartmentList);
                 }
                 if(permissionStreamList != null && !permissionStreamList.isEmpty()){
                     permissionStreamService.removeByCollection(permissionStreamList);
@@ -1127,7 +1425,7 @@
             boolean b1 = checkProductPerm(2, componentInfo.getComponentId());
             if(!b1)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
-            b1 = componentInfoService.assignRemoveDepart(componentInfo, departList);
+            b1 = componentInfoService.assignRemoveDepart(componentInfo, mdcProductionList);
             if(!b1)
                 ExceptionCast.cast(ProductInfoCode.PRODUCT_USER_PERM_ERROR);
             if(relativeFlag == 1) {
@@ -1135,8 +1433,12 @@
                 //鎬昏闇�瑕佸垹闄ょ殑鏁版嵁淇℃伅
                 List<ComponentDepartment> componentPermissionList = new ArrayList<>();
                 List<PartsDepartment> partsPermissionList = new ArrayList<>();
+                List<ProcessionDepartment> processionPermissionList = new ArrayList<>();
+                List<WorkStepDepartment> workStepDepartmentList=new ArrayList<>();
                 List<PermissionStream> permissionStreamList = new ArrayList<>();
-
+                List<String> partsIds= new ArrayList<>();
+                List<String> ProcessionIds= new ArrayList<>();
+                List<String> workStepIds= new ArrayList<>();
                 List<ComponentInfo> childrenList = componentInfoService.getByParentId(componentInfo.getComponentId());
                 if(childrenList != null && !childrenList.isEmpty()) {
                     for(ComponentInfo cpn : childrenList){
@@ -1152,7 +1454,7 @@
                 //澶勭悊浜у搧 涓嬬殑闆朵欢
                 componentIdList.add(componentInfo.getComponentId());
                 List<PartsInfo> partsInfoList = partsInfoService.getByComponentIdList(componentInfo.getProductId(), componentIdList);
-                List<String> partsIds = new ArrayList<>();
+                partsIds = new ArrayList<>();
                 if(partsInfoList != null && !partsInfoList.isEmpty()) {
                     for(PartsInfo partsInfo : partsInfoList){
                         partsIds.add(partsInfo.getPartsId());
@@ -1164,11 +1466,45 @@
                     }
                 }
 
+                //澶勭悊宸ュ簭
+                List<ProcessStream> processStreamList=processStreamService.getByComponentIdList(componentInfo.getProductId(), componentIdList,partsIds);
+                ProcessionIds = new ArrayList<>();
+                if(processStreamList != null && !processStreamList.isEmpty()) {
+                    for(ProcessStream processStream : processStreamList){
+                        ProcessionIds.add(processStream.getProcessId());
+                    }
+                    processionPermissionList = processionDepartmentService.getByPartsIdsAndDepartIds(ProcessionIds, ids);
+                    List<PermissionStream> existPermissionList = permissionStreamService.getByPartsIdsAndDepartIds(ProcessionIds, ids);
+                    if(existPermissionList != null && !existPermissionList.isEmpty()){
+                        permissionStreamList.addAll(existPermissionList);
+                    }
+                }
+
+                //澶勭悊宸ユ
+                List<WorkStep> workStepList=workStepService.getByProcessIds(componentInfo.getProductId(), ProcessionIds);
+                workStepIds = new ArrayList<>();
+                if(workStepList != null && !workStepList.isEmpty()) {
+                    for(WorkStep workStep : workStepList){
+                        workStepIds.add(workStep.getId());
+                    }
+                    workStepDepartmentList = workStepDepartmentService.getByPartsIdsAndDepartIds(workStepIds, ids);
+                    List<PermissionStream> existPermissionList = permissionStreamService.getByPartsIdsAndDepartIds(workStepIds, ids);
+                    if(existPermissionList != null && !existPermissionList.isEmpty()){
+                        permissionStreamList.addAll(existPermissionList);
+                    }
+                }
+
                 if(componentPermissionList != null && !componentPermissionList.isEmpty()){
                     componentDepartmentService.removeByCollection(componentPermissionList);
                 }
                 if(partsPermissionList != null && !partsPermissionList.isEmpty()){
                     partsDepartmentService.removeByCollection(partsPermissionList);
+                }
+                if(processionPermissionList != null && !processionPermissionList.isEmpty()){
+                    processionDepartmentService.removeByCollection(processionPermissionList);
+                }
+                if(workStepDepartmentList != null && !workStepDepartmentList.isEmpty()){
+                    workStepDepartmentService.removeByCollection(workStepDepartmentList);
                 }
                 if(permissionStreamList != null && !permissionStreamList.isEmpty()){
                     permissionStreamService.removeByCollection(permissionStreamList);
@@ -1255,23 +1591,23 @@
 
     @Override
     @Transactional(rollbackFor = {Exception.class})
-    public boolean assignAddDepartment(ProductInfo productInfo, Collection<Department> departmentList) {
+    public boolean assignAddDepartment(ProductInfo productInfo, Collection<MdcProduction> departmentList) {
         if(productInfo == null || departmentList == null || departmentList.isEmpty())
             ExceptionCast.cast(CommonCode.INVALID_PARAM);
         List<ProductDepartment> productDepartmentList = new ArrayList<>();
         List<PermissionStream> permissionStreamList = new ArrayList<>();
         departmentList.forEach(item -> {
-            ProductDepartment en = productDepartmentService.getByProductIdAndDepartId(productInfo.getProductId(), item.getDepartId());
+            ProductDepartment en = productDepartmentService.getByProductIdAndDepartId(productInfo.getProductId(), item.getId());
             if(en == null) {
                 en = new ProductDepartment();
-                en.setDepartId(item.getDepartId());
+                en.setDepartId(item.getId());
                 en.setProductId(productInfo.getProductId());
                 productDepartmentList.add(en);
             }
-            PermissionStream stream = permissionStreamService.getByProductIdAndDepartId(productInfo.getProductId(), item.getDepartId());
+            PermissionStream stream = permissionStreamService.getByProductIdAndDepartId(productInfo.getProductId(), item.getId());
             if(stream == null) {
                 stream = new PermissionStream();
-                stream.setDepartId(item.getDepartId());
+                stream.setDepartId(item.getId());
                 stream.setProductId(productInfo.getProductId());
                 permissionStreamList.add(stream);
             }
@@ -1293,17 +1629,17 @@
 
     @Override
     @Transactional(rollbackFor = {Exception.class})
-    public boolean assignRemoveDepartment(ProductInfo productInfo, Collection<Department> departmentList) {
+    public boolean assignRemoveDepartment(ProductInfo productInfo, Collection<MdcProduction> departmentList) {
         if(productInfo == null || departmentList == null || departmentList.isEmpty())
             ExceptionCast.cast(CommonCode.INVALID_PARAM);
         List<ProductDepartment> productDepartmentList = new ArrayList<>();
         List<PermissionStream> permissionStreamList = new ArrayList<>();
         departmentList.forEach(item -> {
-            ProductDepartment en = productDepartmentService.getByProductIdAndDepartId(productInfo.getProductId(), item.getDepartId());
+            ProductDepartment en = productDepartmentService.getByProductIdAndDepartId(productInfo.getProductId(), item.getId());
             if(en != null) {
                 productDepartmentList.add(en);
             }
-            PermissionStream stream = permissionStreamService.getByProductIdAndDepartId(productInfo.getProductId(), item.getDepartId());
+            PermissionStream stream = permissionStreamService.getByProductIdAndDepartId(productInfo.getProductId(), item.getId());
             if(stream != null) {
                 permissionStreamList.add(stream);
             }
@@ -1326,21 +1662,32 @@
     @Override
     public List<String> getDepartIdsByParams(Integer nodeType, String paramId) {
         List<String> departIds = new ArrayList<>();
-        if(nodeType == 2) {
-            ComponentInfo en = componentInfoService.getById(paramId);
-            if(en == null)
+        //5-宸ュ簭
+        if(nodeType == 5) {
+            ProcessStream processStream= processStreamService.getById(paramId);
+            if(processStream == null)
                 return null;
-            List<PermissionStream> permissionStreamList = permissionStreamService.getByComponentId(en.getProductId(), en.getComponentId());
+            List<PermissionStream> permissionStreamList = permissionStreamService.list(new QueryWrapper<PermissionStream>()
+                    .eq(StrUtil.isNotEmpty(processStream.getProductId()),"product_id", processStream.getProductId())
+                    .eq(StrUtil.isNotEmpty(processStream.getComponentId()),"component_id",processStream.getComponentId())
+                    .eq(StrUtil.isNotEmpty(processStream.getPartsId()),"parts_id", processStream.getPartsId())
+                    .eq(StrUtil.isNotEmpty(processStream.getProcessId()),"process_id",processStream.getProcessId()));
             if(permissionStreamList == null || permissionStreamList.isEmpty())
                 return null;
             permissionStreamList.forEach(item -> {
                 departIds.add(item.getDepartId());
             });
-        }else if(nodeType == 3) {
-            PartsInfo en = partsInfoService.getById(paramId);
-            if(en == null)
+            //6-宸ユ
+        }else if(nodeType == 6) {
+            WorkStep workStep = workStepService.getById(paramId);
+            if(workStep == null)
                 return null;
-            List<PermissionStream> permissionStreamList = permissionStreamService.getByPartsId(en.getProductId(), en.getComponentId(), en.getPartsId());
+            List<PermissionStream> permissionStreamList = permissionStreamService.list(new QueryWrapper<PermissionStream>()
+                    .eq(StrUtil.isNotEmpty(workStep.getProductId()),"product_id", workStep.getProductId())
+                    .eq(StrUtil.isNotEmpty(workStep.getComponentId()),"component_id",workStep.getComponentId())
+                    .eq(StrUtil.isNotEmpty(workStep.getPartsId()),"parts_id", workStep.getPartsId())
+                    .eq(StrUtil.isNotEmpty(workStep.getProcessId()),"process_id",workStep.getProcessId())
+                    .eq(StrUtil.isNotEmpty(workStep.getId()),"step_id", workStep.getId()));
             if(permissionStreamList == null || permissionStreamList.isEmpty())
                 return null;
             permissionStreamList.forEach(item -> {
@@ -1349,6 +1696,10 @@
         }else {
             return null;
         }
+        //鍘婚噸
+        Set<String> set = new HashSet<>(departIds);
+        departIds.clear();
+        departIds.addAll(set);
         return departIds;
     }
 
@@ -1570,4 +1921,27 @@
 
         return ProductTreeWrapper.loadTree(productInfoList, componentExtList, partsInfos,processStreams,workSteps);
     }
+
+    @Override
+    public boolean deleteProductTree(String id, Integer type){
+        switch (type) {
+            //浜у搧
+            case 1:
+                return deleteProductInfo(id);
+            //閮ㄩ棬
+            case 2:
+                return componentInfoService.deleteComponentInfo(id);
+            //闆朵欢
+            case 3:
+                return partsInfoService.deletePartsInfo(id);
+            //宸ュ簭
+            case 5:
+                return processStreamService.deleteProcessStream(id);
+            //宸ユ
+            case 6:
+                return workStepService.deleteWorkStep(id);
+            default:
+        }
+        return false;
+    }
 }

--
Gitblit v1.9.3