zhangjinjun пре 6 година
родитељ
комит
94b2417d8c
1 измењених фајлова са 15 додато и 13 уклоњено
  1. 15 13
      src/main/java/com/yihu/quota/service/view/ViewService.java

+ 15 - 13
src/main/java/com/yihu/quota/service/view/ViewService.java

@ -165,19 +165,21 @@ public class ViewService extends BaseJpaService<View, ViewDao> {
            } else {
            } else {
                // 视图展示为数值类型的场合
                // 视图展示为数值类型的场合
                // 如果有多个多维数据集时,添加指标的过滤条件,指定其数据来自哪个多维数据集。
                // 如果有多个多维数据集时,添加指标的过滤条件,指定其数据来自哪个多维数据集。
                for (ViewQuota quota : viewQuotaList) {
                    ViewQuotaFilter indexFilter = new ViewQuotaFilter();
                    indexFilter.setDimensionCode("_index");
                    indexFilter.setCompareType("and");
                    indexFilter.setCompareType("belong");
                    indexFilter.setFilterValue(quota.getEsIndex());
                    quota.getQuotaFilterList().add(indexFilter);
                    ViewQuotaFilter typeFilter = new ViewQuotaFilter();
                    typeFilter.setDimensionCode("_type");
                    typeFilter.setCompareType("and");
                    typeFilter.setCompareType("belong");
                    typeFilter.setFilterValue(quota.getEsType());
                    quota.getQuotaFilterList().add(typeFilter);
                if (indexCount > 1) {
                    for (ViewQuota quota : viewQuotaList) {
                        ViewQuotaFilter indexFilter = new ViewQuotaFilter();
                        indexFilter.setDimensionCode("_index");
                        indexFilter.setCompareType("and");
                        indexFilter.setCompareType("belong");
                        indexFilter.setFilterValue(quota.getEsIndex());
                        quota.getQuotaFilterList().add(indexFilter);
                        ViewQuotaFilter typeFilter = new ViewQuotaFilter();
                        typeFilter.setDimensionCode("_type");
                        typeFilter.setCompareType("and");
                        typeFilter.setCompareType("belong");
                        typeFilter.setFilterValue(quota.getEsType());
                        quota.getQuotaFilterList().add(typeFilter);
                    }
                }
                }
                // 因为该场合没有行/列维度,直接对指标聚合。
                // 因为该场合没有行/列维度,直接对指标聚合。
                List<AbstractAggregationBuilder> quotaAggList = this.gatherQuotaMetricsAgg(viewQuotaList, null);
                List<AbstractAggregationBuilder> quotaAggList = this.gatherQuotaMetricsAgg(viewQuotaList, null);