|
|
@@ -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;
|
|
|
@@ -37,6 +47,8 @@ import com.xjrsoft.module.form.mapper.FormTemplateMapper;
|
|
|
import com.xjrsoft.module.form.service.IFormExecuteService;
|
|
|
import com.xjrsoft.module.magicapi.service.IMagicApiService;
|
|
|
import com.xjrsoft.module.magicapi.vo.MagicApiInfoVo;
|
|
|
+import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
|
|
|
+import com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedMapper;
|
|
|
import com.xjrsoft.module.organization.entity.User;
|
|
|
import com.xjrsoft.module.organization.entity.UserRoleRelation;
|
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
|
@@ -45,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;
|
|
|
@@ -61,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;
|
|
|
@@ -83,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;
|
|
|
@@ -149,6 +275,8 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
*/
|
|
|
private static final String DB_FIELD_XML_PREFIX = "xml";
|
|
|
|
|
|
+ private final OfficialDocumentReceivedMapper officialdocumentreceivedmapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public boolean deploy(DeployDto dto) {
|
|
|
@@ -378,7 +506,14 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
Optional<FormTemplate> templateOp = formTemplates.stream().filter(f -> Objects.equals(f.getId(), formConfig.getFormId())).findFirst();
|
|
|
templateOp.ifPresent(t -> formInfoVo.setFormJson(t.getFormJson()));
|
|
|
}
|
|
|
-
|
|
|
+ if(formInfoVo.getFormData().containsKey("document_level") && formInfoVo.getFormData().containsKey("emergency_level")){
|
|
|
+ Object id = formInfoVo.getFormData().get("id");
|
|
|
+ OfficialDocumentReceived received = officialdocumentreceivedmapper.selectById(id.toString());
|
|
|
+ if(received != null){
|
|
|
+ formInfoVo.getFormData().computeIfAbsent("document_level", k -> received.getDocumentLevel());
|
|
|
+ formInfoVo.getFormData().computeIfAbsent("emergency_level", k -> received.getEmergencyLevel());
|
|
|
+ }
|
|
|
+ }
|
|
|
formInfoVos.add(formInfoVo);
|
|
|
}
|
|
|
vo.setFormInfos(formInfoVos);
|
|
|
@@ -608,6 +743,9 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
if (!taskNodeConfigMap.isPresent()) {
|
|
|
throw new MyException("找不到当前节点的配置信息!");
|
|
|
}
|
|
|
+ if(taskNodeConfigMap.get().get("styleType") != null){
|
|
|
+ vo.setStyleType(Integer.parseInt(taskNodeConfigMap.get().get("styleType").toString()));
|
|
|
+ }
|
|
|
|
|
|
UserTaskConfig userTaskConfig = Convert.convert(UserTaskConfig.class, taskNodeConfigMap.get());
|
|
|
|
|
|
@@ -1825,6 +1963,8 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
approveRecord.setStartUserId(MapUtil.getLong(variableMaps, WorkflowConstant.PROCESS_START_USER_ID_KEY));
|
|
|
approveRecord.setApproveUserPostId(user.getPostId());
|
|
|
approveRecord.setApproveType(dto.getApprovedType());
|
|
|
+
|
|
|
+ approveRecord.setShowNode(userTaskConfig.getShowNode());
|
|
|
approveRecord.setApproveResult(buttonConfig.getButtonName());
|
|
|
|
|
|
approveRecordService.save(approveRecord);
|
|
|
@@ -1928,6 +2068,15 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
//新增流程自定义发起流程记录
|
|
|
XjrWorkflowOperateRecord xjrWorkflowOperateRecord = new XjrWorkflowOperateRecord();
|
|
|
xjrWorkflowOperateRecord.setNodeId(task.getId());
|
|
|
+ if(userTaskConfig.getShowNode() != null){
|
|
|
+ if(userTaskConfig.getShowNode()){
|
|
|
+ xjrWorkflowOperateRecord.setShowNode(1);
|
|
|
+ }else{
|
|
|
+ xjrWorkflowOperateRecord.setShowNode(0);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ xjrWorkflowOperateRecord.setShowNode(1);
|
|
|
+ }
|
|
|
xjrWorkflowOperateRecord.setNodeName(task.getName());
|
|
|
xjrWorkflowOperateRecord.setNodeType(WorkflowConstant.USER_TASK_TYPE_NAME);
|
|
|
xjrWorkflowOperateRecord.setProcessId(task.getProcessInstanceId());
|
|
|
@@ -3381,8 +3530,11 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
vo.setProcessId(e.getProcessId());
|
|
|
vo.setProcessName(e.getProcessName());
|
|
|
vo.setIsApproval(0);
|
|
|
- Integer taskCount = workflowRecordMapper.getTaskCount(e.getTaskId());
|
|
|
- if(taskCount > 1){
|
|
|
+ List<WorkflowApproveRecord> list = approveRecordService.list(
|
|
|
+ new QueryWrapper<WorkflowApproveRecord>().lambda()
|
|
|
+ .eq(WorkflowApproveRecord::getProcessId, e.getProcessId())
|
|
|
+ );
|
|
|
+ if(list.size() > 0){
|
|
|
vo.setIsApproval(1);
|
|
|
}
|
|
|
//如果是已经完成的任务 默认是100进度
|
|
|
@@ -3683,6 +3835,86 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean newWithdraw(WithdrawDto dto) {
|
|
|
+
|
|
|
+ HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(dto.getProcessId()).singleResult();
|
|
|
+
|
|
|
+ User user = StpUtil.getTokenSession().get(GlobalConstant.LOGIN_USER_INFO_KEY, new User());
|
|
|
+
|
|
|
+ if (historicProcessInstance.getEndTime() != null) {
|
|
|
+ throw new MyException("流程已经结束 无法撤回!");
|
|
|
+ }
|
|
|
+ //如果是简单流程 无多实例 无网关等组件 默认可以根据审批时间
|
|
|
+
|
|
|
+ //获取到当前活动的实例
|
|
|
+// ActivityInstance activityInstance = runtimeService.getActivityInstance(dto.getProcessId());
|
|
|
+
|
|
|
+ //获取当前活动的任务信息
|
|
|
+ List<WorkflowExtra> workflowExtras = workflowExtraMapper.selectList(Wrappers.lambdaQuery(WorkflowExtra.class).in(WorkflowExtra::getProcessId, dto.getProcessId()));
|
|
|
+ //找到当前流程的 任务开始时间 最大值 为当前审批节点
|
|
|
+ WorkflowExtra workflowExtra = workflowExtras.stream()
|
|
|
+ .filter(e -> e.getProcessId().equals(dto.getProcessId()))
|
|
|
+ .max(Comparator.comparing(WorkflowExtra::getStartTime)).orElse(new WorkflowExtra());
|
|
|
+ //新增流程发起流程记录
|
|
|
+ WorkflowRecord record = new WorkflowRecord();
|
|
|
+ record.setNodeId(workflowExtra.getTaskId());
|
|
|
+ record.setNodeName(workflowExtra.getTaskName());
|
|
|
+ record.setNodeType(workflowExtra.getTaskName());
|
|
|
+ record.setProcessId(dto.getProcessId());
|
|
|
+ record.setSchemaId(workflowExtra.getSchemaId());
|
|
|
+ record.setNodeMultiType(WorkflowMultiInstanceType.NONE.getCode());
|
|
|
+ record.setRecordTime(LocalDateTime.now());
|
|
|
+
|
|
|
+ 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 查出数据
|
|
|
+ WorkflowSchema workflowSchema = workflowSchemaMapper.selectOne(Wrappers.lambdaQuery(WorkflowSchema.class).eq(WorkflowSchema::getId, historicVariableInstance.getValue()));
|
|
|
+
|
|
|
+ //获取到整个流程模板的配置
|
|
|
+ WorkflowSchemaConfig workflowSchemaConfig = JSONUtil.toBean(workflowSchema.getJsonContent(), WorkflowSchemaConfig.class);
|
|
|
+ List<Object> allFormConfigs = workflowSchemaConfig.getChildNodeConfig().stream().filter(x -> x.containsKey("formConfigs")).map(x -> x.get("formConfigs")).collect(Collectors.toList());
|
|
|
+ List<FormConfig> formConfigs = new ArrayList<>();
|
|
|
+
|
|
|
+ for (Object allFormConfig : allFormConfigs) {
|
|
|
+ List<FormConfig> thisNodeFormConfigs = Convert.toList(FormConfig.class, allFormConfig);
|
|
|
+ for (FormConfig thisNodeFormConfig : thisNodeFormConfigs) {
|
|
|
+ if (formConfigs.stream().noneMatch(x -> x.getKey().equals(thisNodeFormConfig.getKey()))) {
|
|
|
+ formConfigs.add(thisNodeFormConfig);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] allFormKey = formConfigs.stream().map(FormConfig::getKey).toArray(String[]::new);
|
|
|
+ List<HistoricVariableInstance> list = historyService.createHistoricVariableInstanceQuery().processInstanceId(dto.getProcessId()).variableNameIn(allFormKey).list();
|
|
|
+ for (FormConfig formConfig : formConfigs) {
|
|
|
+
|
|
|
+ RelationFormInfoVo formInfoVo = new RelationFormInfoVo();
|
|
|
+ formInfoVo.setFormType(formConfig.getFormType());
|
|
|
+ formInfoVo.setFormConfig(formConfig);
|
|
|
+
|
|
|
+ if (formConfig.getFormType() == FormTemplateType.CUSTOM.getCode() || formConfig.getFormType() == FormTemplateType.SYSTEM.getCode()) {
|
|
|
+ Optional<HistoricVariableInstance> thisFormData = list.stream().filter(x -> x.getName().equals(formConfig.getKey())).findFirst();
|
|
|
+
|
|
|
+ thisFormData.ifPresent(data -> {
|
|
|
+ Map<String, Object> formData = Convert.toMap(String.class, Object.class, data.getValue());
|
|
|
+ WorkflowDraft draft = new WorkflowDraft();
|
|
|
+ draft.setSchemaId(workflowSchema.getId());
|
|
|
+ draft.setDataId(formData.get("id").toString());
|
|
|
+ draft.setFormData(JSONUtil.toJsonStr(formData));
|
|
|
+ draft.setTaskId(workflowExtra.getTaskId());
|
|
|
+ workflowDraftService.save(draft);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public boolean saveDraft(SaveDraftDto dto) {
|
|
|
|
|
|
@@ -4410,6 +4642,13 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
recordListVo.setNodeName(workflowOperateRecord.getNodeName());
|
|
|
recordListVo.setComment(workflowOperateRecord.getOperateInfo());
|
|
|
recordListVo.setStartTime(workflowOperateRecord.getRecordTime());
|
|
|
+
|
|
|
+ if(workflowOperateRecord.getShowNode() != null && workflowOperateRecord.getShowNode() == 0){
|
|
|
+ recordListVo.setShowNode(false);
|
|
|
+ }else if(workflowOperateRecord.getShowNode() != null && workflowOperateRecord.getShowNode() == 1){
|
|
|
+ recordListVo.setShowNode(true);
|
|
|
+ }
|
|
|
+
|
|
|
recordListVo.setCirculateMessage(workflowOperateRecord.getCirculateMessage());
|
|
|
recordListVos.add(recordListVo);
|
|
|
}
|
|
|
@@ -5494,21 +5733,30 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
List<UserDefinedProcessRecordListVo> userDefinedProcessRecordListVos = new ArrayList<>();
|
|
|
for (ProcessRecordListVo p : processRecordListVos) {
|
|
|
String comment = p.getComment();
|
|
|
+ String approveComment = "";
|
|
|
+ if(!"".equals(comment) && comment != null){
|
|
|
+ approveComment = comment.substring(comment.indexOf("审批内容:")+5).replaceAll(", 未达到会签完成条件", "");
|
|
|
+ }
|
|
|
+
|
|
|
String[] commentArr = comment.split(",");
|
|
|
if (commentArr.length > 1) {
|
|
|
String[] approveUserNameArr = commentArr[0].split(":");
|
|
|
String[] approveResultArr = commentArr[1].split(":");
|
|
|
+ if(approveResultArr.length > 1 && "驳回".equals(approveResultArr[1])){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
String[] approveCommentArr = commentArr[2].split(":");
|
|
|
- userDefinedProcessRecordListVos.add(new UserDefinedProcessRecordListVo() {{
|
|
|
- setNodeType(p.getNodeType());
|
|
|
- setNodeName(p.getNodeName());
|
|
|
- setComment(p.getComment());
|
|
|
- setStartTime(p.getStartTime());
|
|
|
- setCirculateMessage(p.getCirculateMessage());
|
|
|
- setApproveUserName(approveUserNameArr.length > 1 ? approveUserNameArr[1] : "");
|
|
|
- setApproveResult(approveResultArr.length > 1 ? approveResultArr[1] : "");
|
|
|
- setApproveComment(approveCommentArr.length > 1 ? approveCommentArr[1] : "");
|
|
|
- }});
|
|
|
+ UserDefinedProcessRecordListVo recordListVo = new UserDefinedProcessRecordListVo();
|
|
|
+ recordListVo.setNodeType(p.getNodeType());
|
|
|
+ recordListVo.setShowNode(p.getShowNode());
|
|
|
+ recordListVo.setNodeName(p.getNodeName());
|
|
|
+ recordListVo.setComment(p.getComment());
|
|
|
+ recordListVo.setStartTime(p.getStartTime());
|
|
|
+ recordListVo.setCirculateMessage(p.getCirculateMessage());
|
|
|
+ recordListVo.setApproveUserName(approveUserNameArr.length > 1 ? approveUserNameArr[1] : "");
|
|
|
+ recordListVo.setApproveResult(approveResultArr.length > 1 ? approveResultArr[1] : "");
|
|
|
+ recordListVo.setApproveComment(approveComment);
|
|
|
+ userDefinedProcessRecordListVos.add(recordListVo);
|
|
|
}
|
|
|
|
|
|
if (p.getNodeName().equals("开始节点")) {
|
|
|
@@ -5516,6 +5764,7 @@ public class WorkflowExecuteServiceImpl implements IWorkflowExecuteService {
|
|
|
setNodeType(p.getNodeType());
|
|
|
setComment(p.getComment());
|
|
|
setStartTime(p.getStartTime());
|
|
|
+ setShowNode(false);
|
|
|
setCirculateMessage(p.getCirculateMessage());
|
|
|
setNodeName("流程发起");
|
|
|
setApproveResult("发起");
|