From 862ce715220e822a883468b36cfdd040af71d03d Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期二, 05 八月 2025 23:37:17 +0800
Subject: [PATCH] 修改文件检验与启动指派流程

---
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocInfoServiceImpl.java |   38 ++++++++++++++++++++++++++++++++++----
 1 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocInfoServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocInfoServiceImpl.java
index a32370c..97e0f46 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocInfoServiceImpl.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DocInfoServiceImpl.java
@@ -28,6 +28,9 @@
 import org.jeecg.modules.dnc.utils.file.FileUtilS;
 import org.jeecg.modules.dncFlow.entity.DispatchFile;
 import org.jeecg.modules.dncFlow.service.IDispatchFileService;
+import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness;
+import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService;
+import org.jeecg.modules.flowable.service.IFlowTaskService;
 import org.jeecg.modules.mdc.entity.MdcEquipment;
 import org.jeecg.modules.mdc.service.IMdcEquipmentService;
 import org.jeecg.modules.system.entity.SysParams;
@@ -78,6 +81,10 @@
     @Autowired
     @Lazy
     private IGuideCardBatchService guideCardBatchService;
+    @Autowired
+    private IFlowMyBusinessService flowMyBusinessService;
+    @Autowired
+    private IFlowTaskService flowTaskService;
 
     /*澶囦唤澶勭悊*/
     @Override
@@ -94,10 +101,15 @@
             ExceptionCast.cast(DocumentCode.DOC_CLASS_ERROR);
         String fileName = FileUtilS.getFilenameNonSuffix(file.getOriginalFilename());
         String fileNameAll = file.getOriginalFilename();
-        DocInfo en = findByAttrAndDocName(fileName, uploadRequest.getAttributionType(), uploadRequest.getAttributionId());
+        List<DocInfo> docInfoList = super.getBaseMapper().findByAttrAndDocName(fileName, uploadRequest.getAttributionType(), uploadRequest.getAttributionId());
         //閽堝瀛樺湪鐨勫鐞�
-        if(en != null)
-            ExceptionCast.cast(DocumentCode.DOC_IS_EXIST);
+        if(docInfoList != null){
+            docInfoList.forEach(item->{
+                if (item.getClassificationId().equals(docClass.getClassificationId())) {
+                    ExceptionCast.cast(DocumentCode.DOC_IS_EXIST);
+                }
+            });
+        }
         FileUploadResult fileUploadResult = FileUtilS.uploadFile(file);
         if(fileUploadResult == null)
             ExceptionCast.cast(DocumentCode.DOC_UPLOAD_ERROR);
@@ -342,10 +354,20 @@
     @Override
     @Transactional(rollbackFor = {Exception.class})
     public boolean addDocInfoAnalysisSmwNcService(String pathFile,File fileRec){
-        //todo 绋嬪簭鍥炰紶
+        //纭瑙f瀽鐩綍
         return true;
     }
 
+    /**
+     * 鏂囨。瑙f瀽
+     * todo 淇敼鍒涘缓鏂囦欢鍏宠仈鍏崇郴锛屾敼鎴愬浐瀹歞ocId锛屽幓闄ゅ垱寤篋ocInfo
+     * @param equipmentId
+     * @param fileRec
+     * @param fileNameSuffix
+     * @param fileNameNew
+     * @param filePath
+     * @return
+     */
     @Override
     @Transactional(rollbackFor = {Exception.class})
     public boolean addDocInfoRecService(String equipmentId,File fileRec,String fileNameSuffix,String fileNameNew,String filePath ) {
@@ -462,6 +484,14 @@
         b = docRelativeService.deleteByDocId(id);
         if(!b)
             ExceptionCast.cast(CommonCode.FAIL);
+        //寮哄埗缁撴潫娴佺▼ 鍒犻櫎鐢ㄦ埛鐨勬寰呭姙浠诲姟
+        List<DispatchFile> dispatchFiles=dispatchFileService.list(new QueryWrapper<DispatchFile>().eq("doc_id",id));
+        if (dispatchFiles != null && !dispatchFiles.isEmpty()) {
+            FlowMyBusiness flowMyBusiness = flowMyBusinessService.selectByDataId(dispatchFiles.get(0).getId());
+            if (flowMyBusiness != null) {
+                flowTaskService.end(flowMyBusiness.getProcessInstanceId(), "鍒犻櫎鏂囨。");
+            }
+        }
         return super.removeById(id);
     }
 

--
Gitblit v1.9.3