diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java index 34672a43a5..f575012f4c 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java @@ -210,6 +210,14 @@ public class DatasetDataManage { return map; } + public Long getDatasetTotal(Long datasetGroupId) throws Exception { + DatasetGroupInfoDTO dto = datasetGroupManage.get(datasetGroupId, null); + if (StringUtils.equalsIgnoreCase(dto.getNodeType(), "dataset")) { + return getDatasetTotal(dto); + } + return 0L; + } + public Long getDatasetTotal(DatasetGroupInfoDTO datasetGroupInfoDTO) throws Exception { Map sqlMap = datasetSQLManage.getUnionSQLForEdit(datasetGroupInfoDTO, null); String sql = (String) sqlMap.get("sql"); diff --git a/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetDataServer.java b/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetDataServer.java index 4298a46b0a..c6e41b1e4d 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetDataServer.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/server/DatasetDataServer.java @@ -46,4 +46,9 @@ public class DatasetDataServer implements DatasetDataApi { public List getFieldEnum(List ids) throws Exception { return datasetDataManage.getFieldEnum(ids); } + + @Override + public Long getDatasetCount(DatasetGroupInfoDTO datasetGroupInfoDTO) throws Exception { + return datasetDataManage.getDatasetTotal(datasetGroupInfoDTO.getId()); + } } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetDataApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetDataApi.java index eacb18c023..7b2213d534 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetDataApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/dataset/DatasetDataApi.java @@ -28,4 +28,7 @@ public interface DatasetDataApi { @PostMapping("enumValue") List getFieldEnum(@RequestBody List ids) throws Exception; + + @PostMapping("getDatasetCount") + Long getDatasetCount(@RequestBody DatasetGroupInfoDTO datasetGroupInfoDTO) throws Exception; }