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/DocRelativeServiceImpl.java |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocRelativeServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocRelativeServiceImpl.java
index 2944228..3322582 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocRelativeServiceImpl.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocRelativeServiceImpl.java
@@ -19,6 +19,9 @@
 
 import org.jeecg.modules.dnc.utils.file.FileUtilS;
 import org.apache.commons.lang3.StringUtils;
+import org.jeecg.modules.mdc.entity.MdcEquipment;
+import org.jeecg.modules.mdc.service.IMdcEquipmentService;
+import org.jeecg.modules.system.service.IMdcProductionService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -39,6 +42,10 @@
     private String localFilePath;
     @Autowired
     private IDncPassLogService dncPassLogService;
+    @Autowired
+    private IMdcEquipmentService iMdcEquipmentService;
+    @Autowired
+    private IMdcProductionService iMdcProductionService;
 
 
     @Override
@@ -80,11 +87,12 @@
 
         if (b && docRel) {
             DocInfo info = docInfoMapper.selectById(docId);
-            DeviceInfo deviceInfo = deviceInfoService.getById(attrId);
-            List<String> strings =  deviceGroupService.findListParentTreeAll(deviceInfo.getGroupId());
+            //todo 淇敼涓簃dc璁惧
+            MdcEquipment mdcEquipment=iMdcEquipmentService.getById(attrId);
+            List<String> strings =  iMdcProductionService.findListParentTreeAll(mdcEquipment.getId());
             if (strings != null && !strings.isEmpty()) {
                 String path = StringUtils.join(strings.toArray(), "/");
-                boolean deleteFile = FileUtilS.deleteFilePathZip(path + "/"+ deviceInfo.getDeviceNo(),
+                boolean deleteFile = FileUtilS.deleteFilePathZip(path + "/"+ mdcEquipment.getEquipmentId(),
                         info.getDocName(), info.getDocSuffix());
                 if (!deleteFile) {
                     return false;
@@ -110,8 +118,8 @@
                 //澶勭悊鏂囦欢鍚嶇О  鏂囦欢璺緞
 
                 NcTxtFilePathInfo ncTxt = new NcTxtFilePathInfo();
-                ncTxt.setEquipmentId(deviceInfo.getDeviceNo());
-                ncTxt.setFilePath(path + "/"+ deviceInfo.getDeviceNo() + "/" );
+                ncTxt.setEquipmentId(mdcEquipment.getEquipmentId());
+                ncTxt.setFilePath(path + "/"+ mdcEquipment.getEquipmentId() + "/" );
                 ncTxt.setFileTxtName("02A"+DateUtil.format(DateUtil.getNow(),DateUtil.STR_YEARMONTHDAY)+sequence);
                 ncTxt.setOrigFileName(info.getDocName());
                 ncTxt.setOrigFileSuffix(info.getDocSuffix());
@@ -150,7 +158,7 @@
 
     @Override
     @Transactional(rollbackFor = {Exception.class})
-    public List<DeviceInfo> findDeviceByDocId(String docId) {
+    public List<MdcEquipment> findDeviceByDocId(String docId) {
         if(!ValidateUtil.validateString(docId))
             ExceptionCast.cast(CommonCode.INVALID_PARAM);
         return super.getBaseMapper().findDeviceByDocId(docId);

--
Gitblit v1.9.3