mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
feat: 增加根据数据集ID获取count接口
This commit is contained in:
parent
9c41375c6b
commit
25a7e54610
@ -210,6 +210,14 @@ public class DatasetDataManage {
|
|||||||
return map;
|
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 {
|
public Long getDatasetTotal(DatasetGroupInfoDTO datasetGroupInfoDTO) throws Exception {
|
||||||
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(datasetGroupInfoDTO, null);
|
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(datasetGroupInfoDTO, null);
|
||||||
String sql = (String) sqlMap.get("sql");
|
String sql = (String) sqlMap.get("sql");
|
||||||
|
@ -46,4 +46,9 @@ public class DatasetDataServer implements DatasetDataApi {
|
|||||||
public List<String> getFieldEnum(List<Long> ids) throws Exception {
|
public List<String> getFieldEnum(List<Long> ids) throws Exception {
|
||||||
return datasetDataManage.getFieldEnum(ids);
|
return datasetDataManage.getFieldEnum(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getDatasetCount(DatasetGroupInfoDTO datasetGroupInfoDTO) throws Exception {
|
||||||
|
return datasetDataManage.getDatasetTotal(datasetGroupInfoDTO.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,4 +28,7 @@ public interface DatasetDataApi {
|
|||||||
|
|
||||||
@PostMapping("enumValue")
|
@PostMapping("enumValue")
|
||||||
List<String> getFieldEnum(@RequestBody List<Long> ids) throws Exception;
|
List<String> getFieldEnum(@RequestBody List<Long> ids) throws Exception;
|
||||||
|
|
||||||
|
@PostMapping("getDatasetCount")
|
||||||
|
Long getDatasetCount(@RequestBody DatasetGroupInfoDTO datasetGroupInfoDTO) throws Exception;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user