From c06fab29ca7826a6dc9736c1ba8ce1e26a11c829 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期四, 06 三月 2025 15:57:08 +0800
Subject: [PATCH] 新增层级结构工艺规程版本、结构树表、新权限表 修改原有权限验证 删除原有代码

---
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocRelativeServiceImpl.java |   34 ++++++----------------------------
 1 files changed, 6 insertions(+), 28 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 2463c9b..b53fc4a 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
@@ -3,8 +3,6 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.modules.dnc.entity.DeviceInfo;
-import org.jeecg.modules.dnc.entity.DncPassLog;
 import org.jeecg.modules.dnc.entity.DocInfo;
 import org.jeecg.modules.dnc.entity.DocRelative;
 import org.jeecg.modules.dnc.exception.ExceptionCast;
@@ -40,8 +38,6 @@
     private IDeviceGroupService deviceGroupService;
     @Value("${securedoc.localFilePath}")
     private String localFilePath;
-    @Autowired
-    private IDncPassLogService dncPassLogService;
     @Autowired
     private IMdcEquipmentService iMdcEquipmentService;
     @Autowired
@@ -88,39 +84,21 @@
         if (b && docRel) {
             DocInfo info = docInfoMapper.selectById(docId);
             //todo 淇敼涓簃dc璁惧
-            DeviceInfo deviceInfo = deviceInfoService.getById(attrId);
-            List<String> strings =  deviceGroupService.findListParentTreeAll(deviceInfo.getGroupId());
+            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;
                 }
-                DncPassLog dncPassLog = dncPassLogService.findDayTime(DateUtil.format(DateUtil.getNow(),DateUtil.STR_YEARMONTHDAY));
-                Integer fileTxt = 0, fileNc =0;
-                if (dncPassLog !=null) {
-                    fileTxt = dncPassLog.getSequenceNumber() + 1;
-                    fileNc = fileTxt + 1;
-                } else {
-                    fileTxt =  1;
-                    fileNc = fileTxt + 1;
-                }
-                String sequence = String.format("%06d",fileTxt);
-                DncPassLog passInfoNc = new DncPassLog();
-                passInfoNc.setSequenceNumber(fileNc);
-                passInfoNc.setSequenceOrder(sequence);
-                passInfoNc.setDayTime(DateUtil.format(DateUtil.getNow(),DateUtil.STR_YEARMONTHDAY));
-                passInfoNc.setPassType("02");
-                passInfoNc.setPassName(info.getDocName()+"."+info.getDocSuffix());
-                passInfoNc.setCreateTime(DateUtil.getNow());
-                dncPassLogService.save(passInfoNc);
                 //澶勭悊鏂囦欢鍚嶇О  鏂囦欢璺緞
 
                 NcTxtFilePathInfo ncTxt = new NcTxtFilePathInfo();
-                ncTxt.setEquipmentId(deviceInfo.getDeviceNo());
-                ncTxt.setFilePath(path + "/"+ deviceInfo.getDeviceNo() + "/" );
-                ncTxt.setFileTxtName("02A"+DateUtil.format(DateUtil.getNow(),DateUtil.STR_YEARMONTHDAY)+sequence);
+                ncTxt.setEquipmentId(mdcEquipment.getEquipmentId());
+                ncTxt.setFilePath(path + "/"+ mdcEquipment.getEquipmentId() + "/" );
+                ncTxt.setFileTxtName("02A"+DateUtil.format(DateUtil.getNow(),DateUtil.STR_YEARMONTHDAY));
                 ncTxt.setOrigFileName(info.getDocName());
                 ncTxt.setOrigFileSuffix(info.getDocSuffix());
                 ncTxt.setFileAddOrDelete(2);

--
Gitblit v1.9.3