forked from github/dataease
fix(数据集): 修复数据集预览总数问题
This commit is contained in:
parent
426cacb149
commit
535d6f8770
@ -231,20 +231,21 @@ public class DatasetDataManage {
|
|||||||
map.put("allFields", fieldList);
|
map.put("allFields", fieldList);
|
||||||
}
|
}
|
||||||
map.put("sql", Base64.getEncoder().encodeToString(querySQL.getBytes()));
|
map.put("sql", Base64.getEncoder().encodeToString(querySQL.getBytes()));
|
||||||
map.put("total", getDatasetTotal(datasetGroupInfoDTO, SqlUtils.rebuildSQL(SQLProvider.createQuerySQL(sqlMeta, false, false, needOrder), sqlMeta, crossDs, dsMap)));
|
String replaceSql = SqlUtils.rebuildSQL(SQLProvider.createQuerySQL(sqlMeta, false, false, needOrder), sqlMeta, crossDs, dsMap);
|
||||||
|
map.put("total", getDatasetTotal(datasetGroupInfoDTO, replaceSql, null));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDatasetTotal(Long datasetGroupId) throws Exception {
|
public Long getDatasetTotal(Long datasetGroupId) throws Exception {
|
||||||
DatasetGroupInfoDTO dto = datasetGroupManage.getForCount(datasetGroupId);
|
DatasetGroupInfoDTO dto = datasetGroupManage.getForCount(datasetGroupId);
|
||||||
if (StringUtils.equalsIgnoreCase(dto.getNodeType(), "dataset")) {
|
if (StringUtils.equalsIgnoreCase(dto.getNodeType(), "dataset")) {
|
||||||
return getDatasetTotal(dto, null);
|
return getDatasetTotal(dto, null, new ChartExtRequest());
|
||||||
}
|
}
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDatasetTotal(DatasetGroupInfoDTO datasetGroupInfoDTO, String s) throws Exception {
|
public Long getDatasetTotal(DatasetGroupInfoDTO datasetGroupInfoDTO, String s, ChartExtRequest request) throws Exception {
|
||||||
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(datasetGroupInfoDTO, null);
|
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(datasetGroupInfoDTO, request);
|
||||||
Map<Long, DatasourceSchemaDTO> dsMap = (Map<Long, DatasourceSchemaDTO>) sqlMap.get("dsMap");
|
Map<Long, DatasourceSchemaDTO> dsMap = (Map<Long, DatasourceSchemaDTO>) sqlMap.get("dsMap");
|
||||||
|
|
||||||
String sql;
|
String sql;
|
||||||
|
Loading…
Reference in New Issue
Block a user