Merge pull request #6714 from dataease/pr@dev-v2@feat_api

feat: 增加根据数据集ID获取count接口
This commit is contained in:
Junjun 2023-11-16 11:52:33 +08:00 committed by GitHub
commit 392e44290c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -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<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(datasetGroupInfoDTO, null);
String sql = (String) sqlMap.get("sql");

View File

@ -46,4 +46,9 @@ public class DatasetDataServer implements DatasetDataApi {
public List<String> getFieldEnum(List<Long> ids) throws Exception {
return datasetDataManage.getFieldEnum(ids);
}
@Override
public Long getDatasetCount(DatasetGroupInfoDTO datasetGroupInfoDTO) throws Exception {
return datasetDataManage.getDatasetTotal(datasetGroupInfoDTO.getId());
}
}

View File

@ -28,4 +28,7 @@ public interface DatasetDataApi {
@PostMapping("enumValue")
List<String> getFieldEnum(@RequestBody List<Long> ids) throws Exception;
@PostMapping("getDatasetCount")
Long getDatasetCount(@RequestBody DatasetGroupInfoDTO datasetGroupInfoDTO) throws Exception;
}