|
@@ -138,9 +138,9 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
List<String> approveUserIds,
|
|
|
String approveRemark,
|
|
|
Map<String, Object> map) {
|
|
|
- List<String> approveIdList = new ArrayList<>();
|
|
|
- if (CollectionUtils.isEmpty(approveUserIds) && approve == FlowApprovePassEnum.START || approve == FlowApprovePassEnum.DRAFT || approve == FlowApprovePassEnum.PASS) {
|
|
|
- approveIdList.add("123");//否则是当前登录用户
|
|
|
+ if (CollectionUtils.isEmpty(approveUserIds) && (approve == FlowApprovePassEnum.START || approve == FlowApprovePassEnum.DRAFT || approve == FlowApprovePassEnum.PASS)) {
|
|
|
+ approveUserIds = new ArrayList<>();
|
|
|
+ approveUserIds.add("123");//否则是当前登录用户
|
|
|
}
|
|
|
String processFlowId = null;
|
|
|
TFCustomFlowEntity tfCustomFlowEntity = null;
|
|
@@ -151,11 +151,11 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
TFCustomFlow tfCustomFlow = tfCustomFlowService.getOne(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getFlowDeploymentId, flowDeploymentId));
|
|
|
Optional.ofNullable(tfCustomFlow.getFlowProcessVar()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有部署数据!"));
|
|
|
|
|
|
- map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + 1, approveIdList);
|
|
|
+ map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + 1, approveUserIds);
|
|
|
ProcessInstance processInstance = runtimeService.startProcessInstanceById(tfCustomFlow.getFlowDefinitionId(), map);
|
|
|
processFlowId = processInstance.getId();
|
|
|
tfCustomFlowEntity = new TFCustomFlowEntity(tfCustomFlow.getId(), null);
|
|
|
- tfFlowApprove = new TFFlowApprove(null, Long.parseLong(approveIdList.get(approveIdList.size() - 1)), FlowStatusEnum.valueOf(approve.name()), null);
|
|
|
+ tfFlowApprove = new TFFlowApprove(null, Long.parseLong(approveUserIds.get(approveUserIds.size() - 1)), FlowStatusEnum.valueOf(approve.name()), null);
|
|
|
flowResult = JSONObject.parseObject(tfCustomFlow.getFlowProcessVar(), FlowResult.class);
|
|
|
} else if (Objects.nonNull(taskId)) {
|
|
|
taskTemp = taskService.createTaskQuery().taskId(String.valueOf(taskId)).singleResult();
|
|
@@ -213,7 +213,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
//流程流水日志
|
|
|
TFFlowLog tfFlowLog = new TFFlowLog(null, Long.parseLong(task.getAssignee()), null,
|
|
|
currFlowTaskResult.getSetup(), Long.parseLong(processFlowId),
|
|
|
- Long.parseLong(task.getId()), tfCustomFlowEntity.getId(), approveIdList.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
|
|
|
+ Long.parseLong(task.getId()), tfCustomFlowEntity.getId(), approveUserIds.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
|
|
|
if (approve == FlowApprovePassEnum.PASS || approve == FlowApprovePassEnum.DRAFT || approve == FlowApprovePassEnum.START) {
|
|
|
currSetup = currSetup == setupMap.size() - 1 ? 0 : currSetup + 1;
|
|
|
nextFlowTaskResult = this.getNextFlowTaskResult(nrOfCompletedInstances,
|
|
@@ -235,7 +235,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
map,
|
|
|
approve,
|
|
|
approveRemark);
|
|
|
- map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + nextFlowTaskResult.getSetup(), approveIdList);
|
|
|
+ map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + nextFlowTaskResult.getSetup(), approveUserIds);
|
|
|
} else if (approve == FlowApprovePassEnum.REJECT || approve == FlowApprovePassEnum.CANCEL) {
|
|
|
currSetup = currSetup - 1;
|
|
|
nextFlowTaskResult = this.getNextFlowTaskResult(nrOfCompletedInstances,
|
|
@@ -256,7 +256,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
approveRemark);
|
|
|
}
|
|
|
map.put(SystemConstant.APPROVE, nextFlowTaskResult.getTaskKey());
|
|
|
- map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + nextFlowTaskResult.getSetup(), approveIdList);
|
|
|
+ map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + nextFlowTaskResult.getSetup(), approveUserIds);
|
|
|
if (Objects.nonNull(formDataFlowTaskResult) && Objects.equals(task.getTaskDefinitionKey(), formDataFlowTaskResult.getTaskKey())) {
|
|
|
setupMap.put(task.getTaskDefinitionKey(), formDataFlowTaskResult);
|
|
|
}
|