瀏覽代碼

撤回后,从我的申请中删除

dzx 1 年之前
父節點
當前提交
ddf444f47f
共有 1 個文件被更改,包括 134 次插入10 次删除
  1. 134 10
      src/main/java/com/xjrsoft/module/workflow/service/impl/WorkflowExecuteServiceImpl.java

+ 134 - 10
src/main/java/com/xjrsoft/module/workflow/service/impl/WorkflowExecuteServiceImpl.java

@@ -24,7 +24,17 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.yulichang.toolkit.MPJWrappers;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.constant.GlobalConstant;
-import com.xjrsoft.common.enums.*;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.enums.FormTemplateType;
+import com.xjrsoft.common.enums.WorkflowApproveType;
+import com.xjrsoft.common.enums.WorkflowAutoAgreeType;
+import com.xjrsoft.common.enums.WorkflowIsPrevChooseNextType;
+import com.xjrsoft.common.enums.WorkflowIsRecycleType;
+import com.xjrsoft.common.enums.WorkflowMultiInstanceFinishType;
+import com.xjrsoft.common.enums.WorkflowMultiInstanceType;
+import com.xjrsoft.common.enums.WorkflowNoHandlerType;
+import com.xjrsoft.common.enums.WorkflowRelationAuthType;
+import com.xjrsoft.common.enums.YesOrNoEnum;
 import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
@@ -47,13 +57,112 @@ import com.xjrsoft.module.system.entity.Stamp;
 import com.xjrsoft.module.system.service.IFileService;
 import com.xjrsoft.module.system.service.IStampService;
 import com.xjrsoft.module.workflow.constant.WorkflowConstant;
-import com.xjrsoft.module.workflow.dto.*;
-import com.xjrsoft.module.workflow.entity.*;
-import com.xjrsoft.module.workflow.mapper.*;
-import com.xjrsoft.module.workflow.model.*;
-import com.xjrsoft.module.workflow.service.*;
+import com.xjrsoft.module.workflow.dto.AddOrSubSignDto;
+import com.xjrsoft.module.workflow.dto.ApproveDto;
+import com.xjrsoft.module.workflow.dto.ApproveMultiDto;
+import com.xjrsoft.module.workflow.dto.ApproveMultiInfoDto;
+import com.xjrsoft.module.workflow.dto.ApproveRecordListDto;
+import com.xjrsoft.module.workflow.dto.ApproveUserDto;
+import com.xjrsoft.module.workflow.dto.ApproveUserMultiDto;
+import com.xjrsoft.module.workflow.dto.CirculatedTaskPageDto;
+import com.xjrsoft.module.workflow.dto.DeployDto;
+import com.xjrsoft.module.workflow.dto.DraftPageDto;
+import com.xjrsoft.module.workflow.dto.FinishedTaskPageDto;
+import com.xjrsoft.module.workflow.dto.FormFinishedTaskDto;
+import com.xjrsoft.module.workflow.dto.GetAssigneeDto;
+import com.xjrsoft.module.workflow.dto.LaunchDto;
+import com.xjrsoft.module.workflow.dto.LaunchRelationTaskDto;
+import com.xjrsoft.module.workflow.dto.MonitorPageDto;
+import com.xjrsoft.module.workflow.dto.MoveRecycleDto;
+import com.xjrsoft.module.workflow.dto.MyExaminePageDto;
+import com.xjrsoft.module.workflow.dto.MyProcessPageDto;
+import com.xjrsoft.module.workflow.dto.PendingTaskPageDto;
+import com.xjrsoft.module.workflow.dto.ReLaunchDto;
+import com.xjrsoft.module.workflow.dto.RecycleDeleteDto;
+import com.xjrsoft.module.workflow.dto.RecycleProcessPageDto;
+import com.xjrsoft.module.workflow.dto.RejectNodeDto;
+import com.xjrsoft.module.workflow.dto.RelationTaskInfoDto;
+import com.xjrsoft.module.workflow.dto.RelationTaskPageDto;
+import com.xjrsoft.module.workflow.dto.RestartDto;
+import com.xjrsoft.module.workflow.dto.SaveDraftDto;
+import com.xjrsoft.module.workflow.dto.SetAssigneeDto;
+import com.xjrsoft.module.workflow.dto.SetSuspendedDto;
+import com.xjrsoft.module.workflow.dto.TransferDto;
+import com.xjrsoft.module.workflow.dto.UpdateDraftDto;
+import com.xjrsoft.module.workflow.dto.WithdrawDto;
+import com.xjrsoft.module.workflow.entity.WorkflowApproveRecord;
+import com.xjrsoft.module.workflow.entity.WorkflowCirculated;
+import com.xjrsoft.module.workflow.entity.WorkflowDelegate;
+import com.xjrsoft.module.workflow.entity.WorkflowDraft;
+import com.xjrsoft.module.workflow.entity.WorkflowExtra;
+import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
+import com.xjrsoft.module.workflow.entity.WorkflowRecord;
+import com.xjrsoft.module.workflow.entity.WorkflowSchema;
+import com.xjrsoft.module.workflow.entity.WorkflowSchemaHistory;
+import com.xjrsoft.module.workflow.entity.XjrWorkflowOperateRecord;
+import com.xjrsoft.module.workflow.mapper.WorkflowDelegateMapper;
+import com.xjrsoft.module.workflow.mapper.WorkflowExtraMapper;
+import com.xjrsoft.module.workflow.mapper.WorkflowRecordMapper;
+import com.xjrsoft.module.workflow.mapper.WorkflowSchemaHistoryMapper;
+import com.xjrsoft.module.workflow.mapper.WorkflowSchemaMapper;
+import com.xjrsoft.module.workflow.mapper.XjrWorkflowExtraMapper;
+import com.xjrsoft.module.workflow.mapper.XjrWorkflowOperateRecordMapper;
+import com.xjrsoft.module.workflow.model.ApiConfig;
+import com.xjrsoft.module.workflow.model.ApiRequestParamsConfig;
+import com.xjrsoft.module.workflow.model.AuthConfig;
+import com.xjrsoft.module.workflow.model.ButtonConfig;
+import com.xjrsoft.module.workflow.model.FormAssignmentConfig;
+import com.xjrsoft.module.workflow.model.FormConfig;
+import com.xjrsoft.module.workflow.model.MemberConfig;
+import com.xjrsoft.module.workflow.model.ProcessParamConfig;
+import com.xjrsoft.module.workflow.model.RelationProcessConfig;
+import com.xjrsoft.module.workflow.model.StartNodeConfig;
+import com.xjrsoft.module.workflow.model.UserTaskConfig;
+import com.xjrsoft.module.workflow.model.WorkflowSchemaConfig;
+import com.xjrsoft.module.workflow.service.IWorkflowApproveRecordService;
+import com.xjrsoft.module.workflow.service.IWorkflowCirculatedService;
+import com.xjrsoft.module.workflow.service.IWorkflowDraftService;
+import com.xjrsoft.module.workflow.service.IWorkflowExecuteService;
+import com.xjrsoft.module.workflow.service.IWorkflowExtraService;
+import com.xjrsoft.module.workflow.service.IWorkflowFormRelationService;
+import com.xjrsoft.module.workflow.service.IWorkflowRecordService;
+import com.xjrsoft.module.workflow.service.IXjrWorkflowOperateRecordService;
 import com.xjrsoft.module.workflow.utils.WorkFlowUtil;
-import com.xjrsoft.module.workflow.vo.*;
+import com.xjrsoft.module.workflow.vo.AllRecordListVo;
+import com.xjrsoft.module.workflow.vo.ApproveMultiInfoVo;
+import com.xjrsoft.module.workflow.vo.ApproveMultiVo;
+import com.xjrsoft.module.workflow.vo.CirculatedTaskPageVo;
+import com.xjrsoft.module.workflow.vo.DraftInfoVo;
+import com.xjrsoft.module.workflow.vo.DraftPageVo;
+import com.xjrsoft.module.workflow.vo.FinishedTaskPageVo;
+import com.xjrsoft.module.workflow.vo.FinishedTaskVo;
+import com.xjrsoft.module.workflow.vo.FormFinishedTaskVo;
+import com.xjrsoft.module.workflow.vo.GetAssigneeVo;
+import com.xjrsoft.module.workflow.vo.GetCountVo;
+import com.xjrsoft.module.workflow.vo.HistoryTaskVo;
+import com.xjrsoft.module.workflow.vo.LaunchAndApproveVo;
+import com.xjrsoft.module.workflow.vo.MonitorPageVo;
+import com.xjrsoft.module.workflow.vo.MyProcessPageVo;
+import com.xjrsoft.module.workflow.vo.PendingTaskVo;
+import com.xjrsoft.module.workflow.vo.ProcessInfoVo;
+import com.xjrsoft.module.workflow.vo.ProcessRecordListVo;
+import com.xjrsoft.module.workflow.vo.RecycleProcessInfoVo;
+import com.xjrsoft.module.workflow.vo.RecycleProcessPageVo;
+import com.xjrsoft.module.workflow.vo.RejectNodeVo;
+import com.xjrsoft.module.workflow.vo.RelationFormInfoVo;
+import com.xjrsoft.module.workflow.vo.RelationTaskInfoVo;
+import com.xjrsoft.module.workflow.vo.RelationTaskPageVo;
+import com.xjrsoft.module.workflow.vo.RestartVo;
+import com.xjrsoft.module.workflow.vo.StartNodeFormInfoVo;
+import com.xjrsoft.module.workflow.vo.StartProcessInfoVo;
+import com.xjrsoft.module.workflow.vo.StartProcessRelationTaskVo;
+import com.xjrsoft.module.workflow.vo.TaskInfoRelationTaskVo;
+import com.xjrsoft.module.workflow.vo.TaskInfoVo;
+import com.xjrsoft.module.workflow.vo.UserDefinedProcessRecordListVo;
+import com.xjrsoft.module.workflow.vo.UserTaskFormInfoVo;
+import com.xjrsoft.module.workflow.vo.UserTaskInfoVo;
+import com.xjrsoft.module.workflow.vo.UserTaskRelationTaskVo;
+import com.xjrsoft.module.workflow.vo.WorkflowSchemaInfoVo;
 import lombok.AllArgsConstructor;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
@@ -63,7 +172,12 @@ import org.camunda.bpm.engine.HistoryService;
 import org.camunda.bpm.engine.RepositoryService;
 import org.camunda.bpm.engine.RuntimeService;
 import org.camunda.bpm.engine.TaskService;
-import org.camunda.bpm.engine.history.*;
+import org.camunda.bpm.engine.history.HistoricActivityInstance;
+import org.camunda.bpm.engine.history.HistoricProcessInstance;
+import org.camunda.bpm.engine.history.HistoricProcessInstanceQuery;
+import org.camunda.bpm.engine.history.HistoricTaskInstance;
+import org.camunda.bpm.engine.history.HistoricTaskInstanceQuery;
+import org.camunda.bpm.engine.history.HistoricVariableInstance;
 import org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity;
 import org.camunda.bpm.engine.impl.persistence.entity.TaskEntity;
 import org.camunda.bpm.engine.repository.Deployment;
@@ -85,7 +199,17 @@ import org.springframework.transaction.annotation.Transactional;
 import org.ssssssss.magicapi.core.service.MagicAPIService;
 
 import java.time.LocalDateTime;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -3738,11 +3862,11 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
         record.setSchemaId(workflowExtra.getSchemaId());
         record.setNodeMultiType(WorkflowMultiInstanceType.NONE.getCode());
         record.setRecordTime(LocalDateTime.now());
-        String oldTaskName = workflowExtra.getTaskName();
 
         runtimeService.deleteProcessInstance(historicProcessInstance.getId(), "【发起人:" + user.getName() + "】 将 【流程:" + historicProcessInstance.getProcessDefinitionName() + "】 撤回 到  开始节点!");
         //保存流程撤回信息
         workflowRecordMapper.insert(record);
+        workflowExtraMapper.delete(Wrappers.lambdaQuery(WorkflowExtra.class).in(WorkflowExtra::getProcessId, dto.getProcessId()));
 
         HistoricVariableInstance historicVariableInstance = historyService.createHistoricVariableInstanceQuery().processInstanceId(dto.getProcessId()).variableName(WorkflowConstant.PROCESS_SCHEMA_ID_KEY).singleResult();
         //排除xml 查出数据