From 418d29b85d943f57b5600d84acf9cf6ca0ce9173 Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期四, 17 七月 2025 09:46:29 +0800
Subject: [PATCH] 工作流关闭

---
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessStreamServiceImpl.java |   43 ++++++++++++++++++++++++++++++++-----------
 1 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessStreamServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessStreamServiceImpl.java
index bb050d9..4140b4b 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessStreamServiceImpl.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessStreamServiceImpl.java
@@ -19,6 +19,8 @@
 import org.jeecg.modules.dnc.response.*;
 import org.jeecg.modules.dnc.service.*;
 import org.jeecg.modules.dnc.utils.ValidateUtil;
+import org.jeecg.modules.mdc.entity.MdcEquipment;
+import org.jeecg.modules.mdc.service.IMdcEquipmentService;
 import org.jeecg.modules.system.entity.MdcProduction;
 import org.jeecg.modules.system.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,8 +41,7 @@
     @Autowired
     private IProcessSpecVersionService processSpecVersionService;
     @Autowired
-    @Lazy
-    private IDeviceInfoService deviceInfoService;
+    private IMdcEquipmentService mdcEquipmentService;
     @Autowired
     private IPermissionStreamNewService permissionStreamNewService;
     @Autowired
@@ -60,7 +61,6 @@
     private IDocInfoService docInfoService;
     @Autowired
     private IDeviceTypeService deviceTypeService;
-
     @Override
     @Transactional(rollbackFor = {Exception.class})
     public boolean addProcessStream(ProcessStream stream) {
@@ -176,8 +176,8 @@
         boolean b = super.updateById(stream);
         //鍚屾淇敼缁撴瀯鏍�
         ProductMix productMix = productMixService.getById(Long.parseLong(id));
-        productMix.setName(stream.getProcessName());
-        productMix.setCode(stream.getProcessCode());
+        productMix.setTreeName(stream.getProcessName());
+        productMix.setTreeCode(stream.getProcessCode());
         productMixService.updateById(productMix);
         if(!b)
             ExceptionCast.cast(CommonCode.FAIL);
@@ -259,8 +259,8 @@
     public List<ProcessStream> validateDeviceProcessInfo(String pnCode, String deviceNo) {
         if(!ValidateUtil.validateString(pnCode) || !ValidateUtil.validateString(deviceNo))
             ExceptionCast.cast(CommonCode.INVALID_PARAM);
-        DeviceInfo deviceInfo = deviceInfoService.getByDeviceNo(deviceNo);
-        if(deviceInfo == null)
+        MdcEquipment mdcEquipment = mdcEquipmentService.findEquipmentNameByEquipmentId(deviceNo);
+        if(mdcEquipment == null)
             ExceptionCast.cast(DeviceCode.DEVICE_NOT_EXIST);
         PermissionStream stream = componentInfoService.validateComponentOrPartsPnCode(pnCode);
         if(stream == null)
@@ -498,8 +498,8 @@
                 List<String> id =new ArrayList<>();
                 id.add(treeInfoRequest.getAttributionId());
                 treeInfoRequest.setProcessIds(id);
-                List<DocInfo> processSpecVersions = workStepService.getByWorkStepOtherFile(treeInfoRequest);
-                docInfos.addAll(processSpecVersions);
+                List<DocInfo> workSteps = workStepService.getByWorkStepOtherFile(treeInfoRequest);
+                docInfos.addAll(workSteps);
             }
         }
         return docInfos;
@@ -540,10 +540,10 @@
             List<DeviceType> deviceTypeList = deviceTypeService.getDeviceTypeByAttribution(processIds,
                     DocAttributionTypeEnum.PROCESS.getCode(),treeInfoRequest.getDeviceManagementName(),treeInfoRequest.getDeviceManagementCode());
             if (deviceTypeList != null && !deviceTypeList.isEmpty()) {
-                List<String> deviceManagementIds=deviceTypeList.stream().map(DeviceType::getId).collect(Collectors.toList());
+                List<String> deviceTypeIds=deviceTypeList.stream().map(DeviceType::getId).collect(Collectors.toList());
                 DocInfoQueryRequest docQuery = new DocInfoQueryRequest();
                 BeanUtil.copyProperties(treeInfoRequest,docQuery);
-                docQuery.setAttributionIds(String.join(",",deviceManagementIds));
+                docQuery.setAttributionIds(String.join(",",deviceTypeIds));
                 docQuery.setDocClassCode("NC");
                 docQuery.setAttributionType(DocAttributionTypeEnum.PROCESS.getCode());
                 docInfos=docInfoService.findListByDocQuery(docQuery);
@@ -554,10 +554,31 @@
                 treeInfoRequest.setProcessIds(id);
                 List<DocInfo> docInfoList = workStepService.getByWorkStepNCFile(treeInfoRequest);
                 docInfos.addAll(docInfoList);
+            }else {
+                treeInfoRequest.setProcessIds(processIds);
+                List<DocInfo> docInfoList = workStepService.getByWorkStepNCFile(treeInfoRequest);
+                docInfos.addAll(docInfoList);
             }
             return docInfos;
         }
         return null;
     }
 
+    @Override
+    public boolean assignPermission(Object entity, Collection<SysUser> userList, boolean isAdd){
+        if (isAdd) {
+            return assignAddUser((ProcessStream) entity, userList);
+        } else {
+            return assignRemoveUser((ProcessStream) entity, userList);
+        }
+    }
+    @Override
+    public boolean assignDepartPermission(Object entity, Collection<MdcProduction> departments, boolean isAdd) {
+        if (isAdd) {
+            return assignAddDepart((ProcessStream) entity, departments);
+        } else {
+            return assignRemoveDepart((ProcessStream) entity, departments);
+        }
+    }
+
 }

--
Gitblit v1.9.3