Commit 7786233ae82e3fdb32ec78342ca061bc0cd36ad2
1 parent
e2168499
【修复】BPM:多租户使用同一个流程标识 key 时查询报错
Showing
2 changed files
with
7 additions
and
2 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmModelServiceImpl.java
| @@ -262,7 +262,9 @@ public class BpmModelServiceImpl implements BpmModelService { | @@ -262,7 +262,9 @@ public class BpmModelServiceImpl implements BpmModelService { | ||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | private Model getModelByKey(String key) { | 264 | private Model getModelByKey(String key) { |
| 265 | - return repositoryService.createModelQuery().modelKey(key).singleResult(); | 265 | + return repositoryService.createModelQuery() |
| 266 | + .modelTenantId(FlowableUtils.getTenantId()) | ||
| 267 | + .modelKey(key).singleResult(); | ||
| 266 | } | 268 | } |
| 267 | 269 | ||
| 268 | @Override | 270 | @Override |
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/definition/BpmProcessDefinitionServiceImpl.java
| @@ -79,7 +79,9 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ | @@ -79,7 +79,9 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ | ||
| 79 | 79 | ||
| 80 | @Override | 80 | @Override |
| 81 | public ProcessDefinition getActiveProcessDefinition(String key) { | 81 | public ProcessDefinition getActiveProcessDefinition(String key) { |
| 82 | - return repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).active().singleResult(); | 82 | + return repositoryService.createProcessDefinitionQuery() |
| 83 | + .processDefinitionTenantId(FlowableUtils.getTenantId()) | ||
| 84 | + .processDefinitionKey(key).active().singleResult(); | ||
| 83 | } | 85 | } |
| 84 | 86 | ||
| 85 | @Override | 87 | @Override |
| @@ -172,6 +174,7 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ | @@ -172,6 +174,7 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ | ||
| 172 | @Override | 174 | @Override |
| 173 | public PageResult<ProcessDefinition> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageVO) { | 175 | public PageResult<ProcessDefinition> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageVO) { |
| 174 | ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery(); | 176 | ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery(); |
| 177 | + query.processDefinitionTenantId(FlowableUtils.getTenantId()); | ||
| 175 | if (StrUtil.isNotBlank(pageVO.getKey())) { | 178 | if (StrUtil.isNotBlank(pageVO.getKey())) { |
| 176 | query.processDefinitionKey(pageVO.getKey()); | 179 | query.processDefinitionKey(pageVO.getKey()); |
| 177 | } | 180 | } |