feat: 增加根据数据集ID获取count接口

This commit is contained in:
junjun 2023-11-16 11:49:44 +08:00
parent 9c41375c6b
commit 25a7e54610
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;
}