mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-29 18:58:05 +08:00
[Fix-16680][ApiServer] Query project list paging error (#16681)
This commit is contained in:
parent
9a58ecae99
commit
ea268d6031
@ -391,13 +391,18 @@ public class ProjectServiceImpl extends BaseServiceImpl implements ProjectServic
|
||||
project.setPerm(Constants.DEFAULT_ADMIN_PERMISSION);
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isEmpty(projectList)) {
|
||||
result.setData(pageInfo);
|
||||
putMsg(result, Status.SUCCESS);
|
||||
return result;
|
||||
}
|
||||
List<User> userList = userMapper.selectByIds(projectList.stream()
|
||||
.map(Project::getUserId).distinct().collect(Collectors.toList()));
|
||||
Map<Integer, String> userMap = userList.stream().collect(Collectors.toMap(User::getId, User::getUserName));
|
||||
List<ProjectWorkflowDefinitionCount> projectWorkflowDefinitionCountList =
|
||||
workflowDefinitionMapper.queryProjectWorkflowDefinitionCountByProjectCodes(
|
||||
projectList.stream().map(Project::getCode).distinct().collect(Collectors.toList()));
|
||||
Map<Long, Integer> projectWorkflowDefinitionCountMap = projectWorkflowDefinitionCountList.stream()
|
||||
List<Long> projectCodes = projectList.stream().map(Project::getCode).distinct().collect(Collectors.toList());
|
||||
Map<Long, Integer> projectWorkflowDefinitionCountMap = workflowDefinitionMapper
|
||||
.queryProjectWorkflowDefinitionCountByProjectCodes(projectCodes)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(ProjectWorkflowDefinitionCount::getProjectCode,
|
||||
ProjectWorkflowDefinitionCount::getCount));
|
||||
for (Project project : projectList) {
|
||||
|
Loading…
Reference in New Issue
Block a user