|
@@ -3,14 +3,16 @@ package com.qmth.distributed.print.business.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
|
+import com.qmth.distributed.print.business.activiti.custom.service.DefaultInstanceConvertToMultiInstance;
|
|
|
|
+import com.qmth.distributed.print.business.activiti.custom.service.MultiWorkFlow;
|
|
import com.qmth.distributed.print.business.bean.flow.CustomFlowDto;
|
|
import com.qmth.distributed.print.business.bean.flow.CustomFlowDto;
|
|
|
|
+import com.qmth.distributed.print.business.bean.flow.CustomFlowPropertyDto;
|
|
import com.qmth.distributed.print.business.bean.flow.CustomFlowSaveDto;
|
|
import com.qmth.distributed.print.business.bean.flow.CustomFlowSaveDto;
|
|
|
|
+import com.qmth.distributed.print.business.bean.flow.link.FlowTaskLink;
|
|
|
|
+import com.qmth.distributed.print.business.bean.flow.link.FlowTaskNode;
|
|
import com.qmth.distributed.print.business.bean.result.*;
|
|
import com.qmth.distributed.print.business.bean.result.*;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
-import com.qmth.distributed.print.business.enums.CustomFlowDynamicBuildEnum;
|
|
+import com.qmth.distributed.print.business.enums.*;
|
|
-import com.qmth.distributed.print.business.enums.CustomFlowTypeEnum;
|
|
|
|
-import com.qmth.distributed.print.business.enums.ExamStatusEnum;
|
|
|
|
-import com.qmth.distributed.print.business.enums.FlowModelEnum;
|
|
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
|
|
import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
@@ -18,7 +20,6 @@ import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
-import com.qmth.teachcloud.common.service.CommonCacheService;
|
|
|
|
import com.qmth.teachcloud.common.service.SysOrgService;
|
|
import com.qmth.teachcloud.common.service.SysOrgService;
|
|
import com.qmth.teachcloud.common.service.SysUserService;
|
|
import com.qmth.teachcloud.common.service.SysUserService;
|
|
import com.qmth.teachcloud.common.util.RedisUtil;
|
|
import com.qmth.teachcloud.common.util.RedisUtil;
|
|
@@ -46,6 +47,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
|
+import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -108,7 +110,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
TExamTaskFlowService tExamTaskFlowService;
|
|
TExamTaskFlowService tExamTaskFlowService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
- CommonCacheService commonCacheService;
|
|
+ MultiWorkFlow multiWorkFlow;
|
|
|
|
|
|
|
|
|
|
* 注册流程
|
|
* 注册流程
|
|
@@ -134,6 +136,18 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
builder.deploy();
|
|
builder.deploy();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ * 上传流程文件
|
|
|
|
+ *
|
|
|
|
+ * @param file
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void uploadDeployment(File file) throws IOException {
|
|
|
|
+ DeploymentBuilder builder = repositoryService.createDeployment();
|
|
|
|
+ builder.addInputStream(file.getName(), new FileInputStream(file));
|
|
|
|
+ builder.deploy();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
* 根据流程key开启一个流程
|
|
* 根据流程key开启一个流程
|
|
*
|
|
*
|
|
@@ -326,6 +340,9 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
|
|
|
|
|
|
|
TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(SystemConstant.convertIdToLong(processInstanceId), examTask.getSchoolId());
|
|
TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(SystemConstant.convertIdToLong(processInstanceId), examTask.getSchoolId());
|
|
|
|
+ if (Objects.isNull(tfFlowApprove)) {
|
|
|
|
+ tfFlowApprove = new TFFlowApprove(sysUser.getSchoolId(), sysUser.getOrgId(), SystemConstant.convertIdToLong(processInstanceId), sysUser.getId(), FlowStatusEnum.END, sysUser.getId(), FlowModelEnum.SYSTEM);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
TFFlowApproveLog tfFlowApproveLog = tfFlowApproveLogService.findByFlowId(SystemConstant.convertIdToLong(processInstanceId));
|
|
TFFlowApproveLog tfFlowApproveLog = tfFlowApproveLogService.findByFlowId(SystemConstant.convertIdToLong(processInstanceId));
|
|
@@ -341,31 +358,36 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
if (Objects.isNull(tfFlowApproveLog)) {
|
|
if (Objects.isNull(tfFlowApproveLog)) {
|
|
tfFlowApproveLog = new TFFlowApproveLog(sysUser.getSchoolId(), sysUser.getOrgId(), SystemConstant.convertIdToLong(processInstanceId), examTask.getId(), sysUser.getId(), sysUser.getId());
|
|
tfFlowApproveLog = new TFFlowApproveLog(sysUser.getSchoolId(), sysUser.getOrgId(), SystemConstant.convertIdToLong(processInstanceId), examTask.getId(), sysUser.getId(), sysUser.getId());
|
|
}
|
|
}
|
|
-
|
|
+
|
|
- if (Objects.nonNull(processDefinitionEntity) && (processDefinitionEntity.getKey().contains(SystemConstant.GDYKDX_FLOW_KEY)
|
|
+
|
|
- || processDefinitionEntity.getKey().contains(SystemConstant.GDYKDX_SUB_FLOW_KEY))) {
|
|
+
|
|
- if (setupEnum == FlowApproveSetupEnum.SUBMIT) {
|
|
+
|
|
- this.assignSubmit(task, sysUser, tfFlowApprove, tfFlowLog, map);
|
|
+
|
|
- } else if (setupEnum == FlowApproveSetupEnum.PRIMARY_APPROVE) {
|
|
+
|
|
- this.directorApprove(task, sysUser, tfFlowApprove, tfFlowApproveLog, tfFlowLog, remark, processDefinitionEntity, map);
|
|
+
|
|
- } else if (setupEnum == FlowApproveSetupEnum.SECOND_APPROVE) {
|
|
+
|
|
- this.presidentApprove(task, sysUser, tfFlowApprove, tfFlowApproveLog, tfFlowLog, remark, map, objectMap, processInstanceId);
|
|
+
|
|
- } else if (setupEnum == FlowApproveSetupEnum.THREE_APPROVE) {
|
|
+
|
|
- this.teacherApprove(task, sysUser, tfFlowApprove, tfFlowApproveLog, tfFlowLog, remark, map);
|
|
+
|
|
- } else if (setupEnum == FlowApproveSetupEnum.FOUR_APPROVE) {
|
|
+
|
|
- this.printApprove(task, sysUser, tfFlowApprove, tfFlowApproveLog, tfFlowLog, remark, map);
|
|
+
|
|
- }
|
|
+
|
|
- }
|
|
+
|
|
- else if (Objects.nonNull(processDefinitionEntity) && processDefinitionEntity.getKey().contains(SystemConstant.JXZYY_FLOW_KEY)) {
|
|
+
|
|
- if (setupEnum == FlowApproveSetupEnum.SUBMIT) {
|
|
+
|
|
- this.assignSubmit(task, sysUser, tfFlowApprove, tfFlowLog, map);
|
|
+
|
|
- } else if (setupEnum == FlowApproveSetupEnum.PRIMARY_APPROVE) {
|
|
+
|
|
- this.directorApprove(task, sysUser, tfFlowApprove, tfFlowApproveLog, tfFlowLog, remark, processDefinitionEntity, map);
|
|
+
|
|
- }
|
|
+
|
|
- } else {
|
|
+
|
|
- throw ExceptionResultEnum.ERROR.exception("未配置流程学校code");
|
|
+
|
|
- }
|
|
+
|
|
}
|
|
}
|
|
|
|
+ tfFlowApprove.setStatus(FlowStatusEnum.AUDITING);
|
|
|
|
+ tfFlowApprove.setSetup(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup());
|
|
|
|
+ tfFlowLog.setApproveSetup(FlowApproveSetupEnum.PRIMARY_APPROVE.getSetup());
|
|
|
|
+ tfFlowLog.setApproveOperation(FlowApproveOperationEnum.SUBMIT);
|
|
|
|
+
|
|
tfFlowApprove.updateInfo(sysUser.getId());
|
|
tfFlowApprove.updateInfo(sysUser.getId());
|
|
tfFlowApproveLog.updateInfo(sysUser.getId());
|
|
tfFlowApproveLog.updateInfo(sysUser.getId());
|
|
tfFlowApprove.setApproveId(sysUser.getId());
|
|
tfFlowApprove.setApproveId(sysUser.getId());
|
|
@@ -1413,112 +1435,118 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public void dynamicBuildBpmn(CustomFlowSaveDto customFlowSaveDto, String id) throws IOException {
|
|
public void dynamicBuildBpmn(CustomFlowSaveDto customFlowSaveDto, String id) throws IOException {
|
|
- BasicSchool basicSchool = commonCacheService.schoolCache(customFlowSaveDto.getSchoolId());
|
|
|
|
-
|
|
|
|
BpmnModel model = new BpmnModel();
|
|
BpmnModel model = new BpmnModel();
|
|
Process process = new Process();
|
|
Process process = new Process();
|
|
model.addProcess(process);
|
|
model.addProcess(process);
|
|
- id = basicSchool.getCode() + "_" + id;
|
|
|
|
process.setId(id);
|
|
process.setId(id);
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
List<CustomFlowDto> customFlowLists = customFlowSaveDto.getCustomFlowLists();
|
|
List<CustomFlowDto> customFlowLists = customFlowSaveDto.getCustomFlowLists();
|
|
Map<CustomFlowTypeEnum, CustomFlowDto> customFlowTypeEnumCustomFlowDtoMap = new HashMap<>();
|
|
Map<CustomFlowTypeEnum, CustomFlowDto> customFlowTypeEnumCustomFlowDtoMap = new HashMap<>();
|
|
- String firstProcessId = null, lastProcessId = null;
|
|
+ FlowTaskLink flowTaskLink = new FlowTaskLink();
|
|
- LinkedList processLinkedList = new LinkedList();
|
|
+ Map<String, Object> flowVarMap = new HashMap<>();
|
|
for (int i = 0; i < customFlowLists.size(); i++) {
|
|
for (int i = 0; i < customFlowLists.size(); i++) {
|
|
CustomFlowDto customFlowDto = customFlowLists.get(i);
|
|
CustomFlowDto customFlowDto = customFlowLists.get(i);
|
|
|
|
+ FlowTaskNode node = new FlowTaskNode(customFlowDto);
|
|
|
|
+ flowTaskLink.add(node);
|
|
switch (customFlowDto.getType()) {
|
|
switch (customFlowDto.getType()) {
|
|
- case START:
|
|
+ case START:
|
|
if (customFlowTypeEnumCustomFlowDtoMap.containsKey(CustomFlowTypeEnum.START)) {
|
|
if (customFlowTypeEnumCustomFlowDtoMap.containsKey(CustomFlowTypeEnum.START)) {
|
|
throw ExceptionResultEnum.ERROR.exception("流程只能有一个开始节点!");
|
|
throw ExceptionResultEnum.ERROR.exception("流程只能有一个开始节点!");
|
|
} else {
|
|
} else {
|
|
customFlowTypeEnumCustomFlowDtoMap.computeIfAbsent(CustomFlowTypeEnum.START, v -> customFlowDto);
|
|
customFlowTypeEnumCustomFlowDtoMap.computeIfAbsent(CustomFlowTypeEnum.START, v -> customFlowDto);
|
|
}
|
|
}
|
|
|
|
+ customFlowDto.setFlowTaskId(CustomFlowDynamicBuildEnum.START.getId());
|
|
process.addFlowElement(createStartEvent());
|
|
process.addFlowElement(createStartEvent());
|
|
break;
|
|
break;
|
|
- case PROCESS:
|
|
+ case PROCESS:
|
|
- if (Objects.isNull(firstProcessId)) {
|
|
+ customFlowDto.setFlowTaskId(CustomFlowDynamicBuildEnum.USER_TASK.getId() + i);
|
|
- firstProcessId = CustomFlowDynamicBuildEnum.USER_TASK.getId() + i;
|
|
+ CustomFlowPropertyDto customFlowPropertyDto = customFlowDto.getProperty();
|
|
|
|
+ List<String> approveUserIds = new ArrayList<>();
|
|
|
|
+ List<String> copyUserIds = new ArrayList<>();
|
|
|
|
+ if (Objects.nonNull(customFlowDto.getProperty())) {
|
|
|
|
+
|
|
|
|
+ switch (customFlowPropertyDto.getApproveUserType()) {
|
|
|
|
+ case USER:
|
|
|
|
+ if (Objects.nonNull(customFlowPropertyDto.getApproveUsers()) && customFlowPropertyDto.getApproveUsers().size() > 0) {
|
|
|
|
+ approveUserIds.addAll(customFlowPropertyDto.getApproveUsers().stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList()));
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case ROLE:
|
|
|
|
+ if (Objects.nonNull(customFlowPropertyDto.getApproveRoles()) && customFlowPropertyDto.getApproveRoles().size() > 0) {
|
|
|
|
+ List<SysUser> sysUserList = sysUserService.findByRoleIds(customFlowPropertyDto.getApproveRoles().stream().map(x -> x.getId()).collect(Collectors.toList()));
|
|
|
|
+ approveUserIds.addAll(sysUserList.stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList()));
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch (customFlowPropertyDto.getMultipleUserApproveType()) {
|
|
|
|
+ case ORDER:
|
|
|
|
+ case ALL:
|
|
|
|
+ flowVarMap.computeIfAbsent(DefaultInstanceConvertToMultiInstance.DEFAULT_ASSIGNEE_LIST + i, v -> approveUserIds);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch (customFlowPropertyDto.getRejectType()) {
|
|
|
|
+ case PREV:
|
|
|
|
+ break;
|
|
|
|
+ case START:
|
|
|
|
+ break;
|
|
|
|
+ case PREV_ALL:
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch (customFlowPropertyDto.getRejectResubmitType()) {
|
|
|
|
+ case NORMAL:
|
|
|
|
+ break;
|
|
|
|
+ case PREV_STEP:
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Objects.nonNull(customFlowPropertyDto.getCopyForUsers())) {
|
|
|
|
+ copyUserIds.addAll(customFlowPropertyDto.getCopyForUsers().stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList()));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- lastProcessId = CustomFlowDynamicBuildEnum.USER_TASK.getId() + i;
|
|
+
|
|
- process.addFlowElement(createUserTask(lastProcessId, customFlowDto.getContent(), null));
|
|
+ process.addFlowElement(createUserTask(CustomFlowDynamicBuildEnum.USER_TASK.getId() + i, "审批人", approveUserIds, customFlowPropertyDto.getMultipleUserApproveType()));
|
|
|
|
+
|
|
break;
|
|
break;
|
|
- case END:
|
|
+ case END:
|
|
if (customFlowTypeEnumCustomFlowDtoMap.containsKey(CustomFlowTypeEnum.END)) {
|
|
if (customFlowTypeEnumCustomFlowDtoMap.containsKey(CustomFlowTypeEnum.END)) {
|
|
throw ExceptionResultEnum.ERROR.exception("流程只能有一个结束节点!");
|
|
throw ExceptionResultEnum.ERROR.exception("流程只能有一个结束节点!");
|
|
} else {
|
|
} else {
|
|
customFlowTypeEnumCustomFlowDtoMap.computeIfAbsent(CustomFlowTypeEnum.END, v -> customFlowDto);
|
|
customFlowTypeEnumCustomFlowDtoMap.computeIfAbsent(CustomFlowTypeEnum.END, v -> customFlowDto);
|
|
}
|
|
}
|
|
|
|
+ customFlowDto.setFlowTaskId(CustomFlowDynamicBuildEnum.END.getId());
|
|
process.addFlowElement(createEndEvent());
|
|
process.addFlowElement(createEndEvent());
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- process.addFlowElement(createSequenceFlow(CustomFlowTypeEnum.START.name(), firstProcessId, "", ""));
|
|
+
|
|
- process.addFlowElement(createSequenceFlow(lastProcessId, CustomFlowTypeEnum.END.name(), "", ""));
|
|
+ for (int i = 1; i < flowTaskLink.size() - 1; i++) {
|
|
|
|
+ FlowTaskNode flowTaskNode = flowTaskLink.get(i);
|
|
|
|
+ process.addFlowElement(createSequenceFlow(flowTaskNode.getBefore().getTask().getFlowTaskId(), flowTaskNode.getTask().getFlowTaskId(), "", ""));
|
|
|
|
+ }
|
|
|
|
+ process.addFlowElement(createSequenceFlow(flowTaskLink.getLast().getBefore().getTask().getFlowTaskId(), flowTaskLink.getLast().getTask().getFlowTaskId(), "", ""));
|
|
|
|
|
|
|
|
|
|
new BpmnAutoLayout(model).execute();
|
|
new BpmnAutoLayout(model).execute();
|
|
|
|
|
|
Deployment deployment = repositoryService.createDeployment().addBpmnModel(id + "-dynamic-model.bpmn", model)
|
|
Deployment deployment = repositoryService.createDeployment().addBpmnModel(id + "-dynamic-model.bpmn", model)
|
|
.name(id + "-multiple process deployment").deploy();
|
|
.name(id + "-multiple process deployment").deploy();
|
|
|
|
+
|
|
|
|
|
|
- ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(id);
|
|
+ ProcessInstance processInstance = flowVarMap.size() > 0 ? runtimeService.startProcessInstanceByKey(id, flowVarMap) : runtimeService.startProcessInstanceByKey(id);
|
|
|
|
+
|
|
|
|
|
|
InputStream processDiagram = repositoryService.getProcessDiagram(processInstance.getProcessDefinitionId());
|
|
InputStream processDiagram = repositoryService.getProcessDiagram(processInstance.getProcessDefinitionId());
|
|
FileUtils.copyInputStreamToFile(processDiagram, new File("target" + File.separator + id + "-multiple-process-diagram.png"));
|
|
FileUtils.copyInputStreamToFile(processDiagram, new File("target" + File.separator + id + "-multiple-process-diagram.png"));
|
|
@@ -1526,8 +1554,9 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ File file = new File("target" + File.separator + id + "-multiple-process.bpmn");
|
|
InputStream processBpmn = repositoryService.getResourceAsStream(deployment.getId(), id + "-dynamic-model.bpmn");
|
|
InputStream processBpmn = repositoryService.getResourceAsStream(deployment.getId(), id + "-dynamic-model.bpmn");
|
|
- FileUtils.copyInputStreamToFile(processBpmn, new File("target" + File.separator + id + "-multiple-process.bpmn"));
|
|
+ FileUtils.copyInputStreamToFile(processBpmn, file);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1537,7 +1566,8 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
*/
|
|
*/
|
|
protected StartEvent createStartEvent() {
|
|
protected StartEvent createStartEvent() {
|
|
StartEvent startEvent = new StartEvent();
|
|
StartEvent startEvent = new StartEvent();
|
|
- startEvent.setId(CustomFlowTypeEnum.START.name());
|
|
+ startEvent.setId(CustomFlowDynamicBuildEnum.START.getId());
|
|
|
|
+ startEvent.setName(CustomFlowDynamicBuildEnum.START.getTitle());
|
|
return startEvent;
|
|
return startEvent;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1548,7 +1578,8 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
*/
|
|
*/
|
|
protected EndEvent createEndEvent() {
|
|
protected EndEvent createEndEvent() {
|
|
EndEvent endEvent = new EndEvent();
|
|
EndEvent endEvent = new EndEvent();
|
|
- endEvent.setId(CustomFlowTypeEnum.END.name());
|
|
+ endEvent.setId(CustomFlowDynamicBuildEnum.END.getId());
|
|
|
|
+ endEvent.setName(CustomFlowDynamicBuildEnum.END.getTitle());
|
|
return endEvent;
|
|
return endEvent;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1566,6 +1597,87 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
return userTask;
|
|
return userTask;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ * @param id 对应我们画流程图中节点任务id
|
|
|
|
+ * @param name 节点任务名称
|
|
|
|
+ * @param assignees 任务的执行者(这一块自行决定是否添加每一环节的执行者,若是动态分配的话,可以不用传值)
|
|
|
|
+ * @param customFlowMultipleUserApproveTypeEnum
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ protected UserTask createUserTask(String id, String name, List<String> assignees, CustomFlowMultipleUserApproveTypeEnum customFlowMultipleUserApproveTypeEnum) {
|
|
|
|
+ UserTask userTask = new UserTask();
|
|
|
|
+ userTask.setName(name);
|
|
|
|
+ userTask.setId(id);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ boolean isSequential = false;
|
|
|
|
+ if (customFlowMultipleUserApproveTypeEnum == CustomFlowMultipleUserApproveTypeEnum.ORDER) {
|
|
|
|
+ userTask = multiWorkFlow.createMultiInstanceLoopCharacteristics(userTask, !isSequential);
|
|
|
|
+ } else if (customFlowMultipleUserApproveTypeEnum == CustomFlowMultipleUserApproveTypeEnum.ALL) {
|
|
|
|
+ userTask = multiWorkFlow.createMultiInstanceLoopCharacteristics(userTask, isSequential);
|
|
|
|
+ } else {
|
|
|
|
+ userTask.setCandidateUsers(assignees);
|
|
|
|
+ }
|
|
|
|
+ return userTask;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
* @param id 网关id
|
|
* @param id 网关id
|
|
* @return
|
|
* @return
|