diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java index 8124ed9656..379af645df 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkerGroupServiceImpl.java @@ -185,6 +185,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro List workerGroups = getWorkerGroups(true); List resultDataList = new ArrayList<>(); + int total = 0; if (CollectionUtils.isNotEmpty(workerGroups)) { List searchValDataList = new ArrayList<>(); @@ -198,7 +199,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro } else { searchValDataList = workerGroups; } - + total = searchValDataList.size(); if (fromIndex < searchValDataList.size()) { if (toIndex > searchValDataList.size()) { toIndex = searchValDataList.size(); @@ -208,7 +209,7 @@ public class WorkerGroupServiceImpl extends BaseServiceImpl implements WorkerGro } PageInfo pageInfo = new PageInfo<>(pageNo, pageSize); - pageInfo.setTotal(resultDataList.size()); + pageInfo.setTotal(total); pageInfo.setTotalList(resultDataList); result.setData(pageInfo);