forked from github/dataease
Merge pull request #6714 from dataease/pr@dev-v2@feat_api
feat: 增加根据数据集ID获取count接口
This commit is contained in:
commit
392e44290c
@ -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