mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 13:32:18 +08:00
fix(X-Pack): 阈值告警-表格场景仅根据第一页数据判断
This commit is contained in:
committed by
fit2cloud-chenyw
parent
9a004e1878
commit
00c1700544
@@ -224,19 +224,33 @@ public class ChartViewManege {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return list.stream().map(ele -> {
|
||||
ChartViewDTO dto = transRecord2DTO(ele);
|
||||
return dto;
|
||||
return transRecord2DTO(ele);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public ChartViewDTO getChart(Long id, String resourceTable) throws Exception {
|
||||
public ChartViewDTO getChart(Long id, String resourceTable, boolean forThreshold) throws Exception {
|
||||
ChartViewDTO details = getDetails(id, resourceTable);
|
||||
if (details == null) {
|
||||
return null;
|
||||
}
|
||||
if (forThreshold) {
|
||||
ChartExtRequest chartExtRequest = details.getChartExtRequest();
|
||||
if (chartExtRequest == null) {
|
||||
chartExtRequest = new ChartExtRequest();
|
||||
chartExtRequest.setResultMode("all");
|
||||
chartExtRequest.setResultCount(1000);
|
||||
chartExtRequest.setGoPage(1L);
|
||||
chartExtRequest.setPageSize(50000L);
|
||||
}
|
||||
details.setChartExtRequest(chartExtRequest);
|
||||
}
|
||||
return chartDataManage.calcData(details);
|
||||
}
|
||||
|
||||
public ChartViewDTO getChart(Long id, String resourceTable) throws Exception {
|
||||
return getChart(id, resourceTable, false);
|
||||
}
|
||||
|
||||
public Map<String, List<ChartViewFieldDTO>> listByDQ(Long id, Long chartId, ChartViewDTO chartViewDTO) {
|
||||
QueryWrapper<CoreDatasetTableField> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("dataset_group_id", id);
|
||||
|
||||
@@ -252,7 +252,7 @@ public class ChartViewThresholdManage {
|
||||
String thresholdRules = request.getThresholdRules();
|
||||
Long chartId = request.getChartId();
|
||||
try {
|
||||
ChartViewDTO chart = chartViewManege.getChart(chartId, request.getResourceTable());
|
||||
ChartViewDTO chart = chartViewManege.getChart(chartId, request.getResourceTable(), true);
|
||||
Map<String, Object> data = null;
|
||||
if (ObjectUtils.isEmpty(chart) || MapUtils.isEmpty(data = chart.getData())) {
|
||||
return new ThresholdCheckVO(false, null, "查询图表异常!", null);
|
||||
|
||||
Reference in New Issue
Block a user