mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-21 02:25:56 +08:00
update 调整会签类型转换异常
This commit is contained in:
parent
6273bde2f0
commit
8fd1fa53d1
@ -1,5 +1,6 @@
|
||||
package org.dromara.workflow.flowable.cmd;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.flowable.common.engine.impl.interceptor.Command;
|
||||
import org.flowable.common.engine.impl.interceptor.CommandContext;
|
||||
@ -51,10 +52,14 @@ public class DeleteSequenceMultiInstanceCmd implements Command<Void> {
|
||||
ExecutionEntityManager executionEntityManager = CommandContextUtil.getExecutionEntityManager();
|
||||
ExecutionEntity entity = executionEntityManager.findById(executionId);
|
||||
// 设置流程变量
|
||||
List<Long> userIds = (List<Long>) entity.getVariable(assigneeList);
|
||||
List<Long> userIds = new ArrayList<>();
|
||||
List<Object> variable = (List<Object>) entity.getVariable(assigneeList);
|
||||
for (Object o : variable) {
|
||||
userIds.add(Long.valueOf(o.toString()));
|
||||
}
|
||||
List<Long> userIdList = new ArrayList<>();
|
||||
userIds.forEach(e -> {
|
||||
Long userId = assignees.stream().filter(id -> id.equals(e)).findFirst().orElse(null);
|
||||
Long userId = assignees.stream().filter(id -> ObjectUtil.equals(id, e)).findFirst().orElse(null);
|
||||
if (userId == null) {
|
||||
userIdList.add(e);
|
||||
}
|
||||
|
||||
@ -36,7 +36,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipInputStream;
|
||||
@ -295,18 +294,26 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
||||
InputStream inputStream = file.getInputStream();
|
||||
Deployment deployment;
|
||||
if (FlowConstant.ZIP.equals(suffix)) {
|
||||
// zip
|
||||
deployment = repositoryService.createDeployment()
|
||||
.tenantId(TenantHelper.getTenantId())
|
||||
.addZipInputStream(new ZipInputStream(inputStream)).name(processName).key(processKey).category(categoryCode).deploy();
|
||||
} else if (Arrays.asList(ResourceNameUtil.BPMN_RESOURCE_SUFFIXES).contains(filename)) {
|
||||
// xml 或 bpmn
|
||||
} else {
|
||||
String[] list = ResourceNameUtil.BPMN_RESOURCE_SUFFIXES;
|
||||
boolean flag = false;
|
||||
for (String str : list) {
|
||||
if (filename.contains(str)) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
deployment = repositoryService.createDeployment()
|
||||
.tenantId(TenantHelper.getTenantId())
|
||||
.addInputStream(filename, inputStream).name(processName).key(processKey).category(categoryCode).deploy();
|
||||
} else {
|
||||
throw new ServiceException("文件类型上传错误!");
|
||||
}
|
||||
}
|
||||
// 更新分类
|
||||
ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult();
|
||||
repositoryService.setProcessDefinitionCategory(definition.getId(), categoryCode);
|
||||
|
||||
@ -492,7 +492,13 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||
*/
|
||||
@Override
|
||||
public boolean addMultiInstanceExecution(AddMultiBo addMultiBo) {
|
||||
Task task = taskService.createTaskQuery().taskId(addMultiBo.getTaskId()).taskTenantId(TenantHelper.getTenantId()).taskCandidateOrAssigned(String.valueOf(LoginHelper.getUserId())).singleResult();
|
||||
TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
taskQuery.taskId(addMultiBo.getTaskId());
|
||||
taskQuery.taskTenantId(TenantHelper.getTenantId());
|
||||
if (!LoginHelper.isSuperAdmin() && !LoginHelper.isTenantAdmin()) {
|
||||
taskQuery.taskCandidateOrAssigned(String.valueOf(LoginHelper.getUserId()));
|
||||
}
|
||||
Task task = taskQuery.singleResult();
|
||||
if (ObjectUtil.isEmpty(task)) {
|
||||
throw new ServiceException(FlowConstant.MESSAGE_CURRENT_TASK_IS_NULL);
|
||||
}
|
||||
@ -535,7 +541,13 @@ public class ActTaskServiceImpl implements IActTaskService {
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteMultiInstanceExecution(DeleteMultiBo deleteMultiBo) {
|
||||
Task task = taskService.createTaskQuery().taskId(deleteMultiBo.getTaskId()).taskTenantId(TenantHelper.getTenantId()).taskCandidateOrAssigned(String.valueOf(LoginHelper.getUserId())).singleResult();
|
||||
TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
taskQuery.taskId(deleteMultiBo.getTaskId());
|
||||
taskQuery.taskTenantId(TenantHelper.getTenantId());
|
||||
if (!LoginHelper.isSuperAdmin() && !LoginHelper.isTenantAdmin()) {
|
||||
taskQuery.taskCandidateOrAssigned(String.valueOf(LoginHelper.getUserId()));
|
||||
}
|
||||
Task task = taskQuery.singleResult();
|
||||
if (ObjectUtil.isEmpty(task)) {
|
||||
throw new ServiceException(FlowConstant.MESSAGE_CURRENT_TASK_IS_NULL);
|
||||
}
|
||||
|
||||
@ -99,13 +99,16 @@ public class WorkflowUserServiceImpl implements IWorkflowUserService {
|
||||
if (multiInstance == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Long> assigneeList = null;
|
||||
List<Long> assigneeList = new ArrayList<>();
|
||||
if (multiInstance.getType() instanceof SequentialMultiInstanceBehavior) {
|
||||
assigneeList = (List<Long>) runtimeService.getVariable(task.getExecutionId(), multiInstance.getAssigneeList());
|
||||
List<Object> variable = (List<Object>) runtimeService.getVariable(task.getExecutionId(), multiInstance.getAssigneeList());
|
||||
for (Object o : variable) {
|
||||
assigneeList.add(Long.valueOf(o.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
if (multiInstance.getType() instanceof SequentialMultiInstanceBehavior) {
|
||||
List<Long> userIds = StreamUtils.filter(assigneeList, e -> !e.toString().equals(task.getAssignee()));
|
||||
List<Long> userIds = StreamUtils.filter(assigneeList, e -> !String.valueOf(e).equals(task.getAssignee()));
|
||||
List<SysUserVo> sysUsers = null;
|
||||
if (CollectionUtil.isNotEmpty(userIds)) {
|
||||
sysUsers = sysUserMapper.selectVoBatchIds(userIds);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user