Browse Source

[Fix-16680][ApiServer] Query project list paging error (#16681)

dev
veli.yang 2 months ago committed by GitHub
parent
commit
ea268d6031
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java

13
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java

@ -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…
Cancel
Save