!122 【修复】多租户使用同一个流程标识key时查询报错

Merge pull request !122 from 今晚打老虎/master-jdk17
This commit is contained in:
芋道源码 2024-06-22 06:24:20 +00:00 committed by Gitee
commit 7295b6a10d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 2 deletions

View File

@ -262,7 +262,9 @@ public class BpmModelServiceImpl implements BpmModelService {
} }
private Model getModelByKey(String key) { private Model getModelByKey(String key) {
return repositoryService.createModelQuery().modelKey(key).singleResult(); return repositoryService.createModelQuery()
.modelTenantId(FlowableUtils.getTenantId())
.modelKey(key).singleResult();
} }
@Override @Override

View File

@ -79,7 +79,9 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ
@Override @Override
public ProcessDefinition getActiveProcessDefinition(String key) { public ProcessDefinition getActiveProcessDefinition(String key) {
return repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).active().singleResult(); return repositoryService.createProcessDefinitionQuery()
.processDefinitionTenantId(FlowableUtils.getTenantId())
.processDefinitionKey(key).active().singleResult();
} }
@Override @Override
@ -172,6 +174,7 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ
@Override @Override
public PageResult<ProcessDefinition> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageVO) { public PageResult<ProcessDefinition> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageVO) {
ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery(); ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
query.processDefinitionTenantId(FlowableUtils.getTenantId());
if (StrUtil.isNotBlank(pageVO.getKey())) { if (StrUtil.isNotBlank(pageVO.getKey())) {
query.processDefinitionKey(pageVO.getKey()); query.processDefinitionKey(pageVO.getKey());
} }