Skip to content

Commit

Permalink
Merge pull request #9718 from dataease/pr@dev-v2@perf_user_origin
Browse files Browse the repository at this point in the history
Pr@dev v2@perf user origin
  • Loading branch information
fit2cloud-chenyw committed May 18, 2024
2 parents 426cacb + aba8ec5 commit b31fcbb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,21 @@ public Map<String, Object> previewDataWithLimit(DatasetGroupInfoDTO datasetGroup
map.put("allFields", fieldList);
}
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;
}

public Long getDatasetTotal(Long datasetGroupId) throws Exception {
DatasetGroupInfoDTO dto = datasetGroupManage.getForCount(datasetGroupId);
if (StringUtils.equalsIgnoreCase(dto.getNodeType(), "dataset")) {
return getDatasetTotal(dto, null);
return getDatasetTotal(dto, null, new ChartExtRequest());
}
return 0L;
}

public Long getDatasetTotal(DatasetGroupInfoDTO datasetGroupInfoDTO, String s) throws Exception {
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(datasetGroupInfoDTO, null);
public Long getDatasetTotal(DatasetGroupInfoDTO datasetGroupInfoDTO, String s, ChartExtRequest request) throws Exception {
Map<String, Object> sqlMap = datasetSQLManage.getUnionSQLForEdit(datasetGroupInfoDTO, request);
Map<Long, DatasourceSchemaDTO> dsMap = (Map<Long, DatasourceSchemaDTO>) sqlMap.get("dsMap");

String sql;
Expand Down
2 changes: 1 addition & 1 deletion de-xpack
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ public class UserGridVO {
private Long createTime;
@Schema(description = "系统变量")
private String sysVariable;
@Schema(description = "用户来源")
private Integer origin;
}

0 comments on commit b31fcbb

Please sign in to comment.