From 0990dd4a4a52a6d26ff4d640980206fbff392dfb Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期三, 02 四月 2025 09:19:07 +0800
Subject: [PATCH] 修改产品结构树,修改审签功能

---
 lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/DispatchFileServiceImpl.java |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/DispatchFileServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/DispatchFileServiceImpl.java
index 6ffcbf9..f52a1f8 100644
--- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/DispatchFileServiceImpl.java
+++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/DispatchFileServiceImpl.java
@@ -4,6 +4,7 @@
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.beanutils.BeanUtils;
 import org.apache.shiro.SecurityUtils;
 import org.flowable.common.engine.api.FlowableException;
 import org.flowable.engine.TaskService;
@@ -37,6 +38,7 @@
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.lang.reflect.InvocationTargetException;
 import java.util.*;
 
 /**
@@ -230,6 +232,7 @@
      * @return
      */
     @Override
+    @Transactional
     public Result<?> auditDispatchFile(DispatchFileFlowTaskVo dispatchFileFlowTaskVo) {
         try {
             // 鍙傛暟鏍¢獙
@@ -302,6 +305,36 @@
     }
 
     /**
+     * 鎵归噺瀹℃壒鎿嶄綔
+     * @param dispatchFileFlowTaskVo
+     * @return
+     */
+    @Override
+    @Transactional
+    public Result<?> auditBatchDispatchFile(DispatchFileFlowTaskVo dispatchFileFlowTaskVo) throws InvocationTargetException, IllegalAccessException {
+        if (dispatchFileFlowTaskVo.getTaskIds()==null || dispatchFileFlowTaskVo.getTaskIds().isEmpty()) {
+            return Result.error(CommonCode.INVALID_PARAM.toString());
+        }
+        if (dispatchFileFlowTaskVo.getTaskIds().contains(",")){
+            String[] taskIds = dispatchFileFlowTaskVo.getTaskIds().split(",");
+            for (String taskId : taskIds) {
+                FlowMyBusiness flowMyBusiness=flowMyBusinessService.getOne(new QueryWrapper<FlowMyBusiness>().eq("task_id",taskId));
+                DispatchFileFlowTaskVo dispatchFileFlowTaskVoNew=new DispatchFileFlowTaskVo();
+                BeanUtils.copyProperties(dispatchFileFlowTaskVoNew, dispatchFileFlowTaskVo);
+                dispatchFileFlowTaskVoNew.setTaskId(taskId);
+                dispatchFileFlowTaskVoNew.setDataId(flowMyBusiness.getDataId());
+                dispatchFileFlowTaskVoNew.setInstanceId(flowMyBusiness.getProcessInstanceId());
+                if (dispatchFileFlowTaskVo.getTargetKey().equals("task_prepare")){
+                    reStartDispatchFile(dispatchFileFlowTaskVoNew);
+                }else {
+                    auditDispatchFile(dispatchFileFlowTaskVoNew);
+                }
+            }
+        }
+        return Result.OK("鎿嶄綔鎴愬姛");
+    }
+
+    /**
      * 鏌ヨ瀹$鍩烘湰淇℃伅
      * @param id
      */

--
Gitblit v1.9.3