lyh
2025-04-02 0990dd4a4a52a6d26ff4d640980206fbff392dfb
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
     */