|
@ -137,24 +137,23 @@ public class AggregationBuildHandler {
|
|
|
cloumnList.add("合计_count_result");
|
|
|
cloumnList.add("性别_terms");
|
|
|
|
|
|
View view = viewDao.findByCode(viewCode);
|
|
|
// 视图各组组内顶层行维度(升序)
|
|
|
List<ViewDimension> groupTopRowDimensionList = viewDimensionDao.getGroupTopRowDimensionList(view.getId());
|
|
|
view.setGroupTopRowDimensionList(groupTopRowDimensionList);
|
|
|
// 视图各组组内其他行维度(升序)
|
|
|
Map<Integer, List<ViewDimension>> groupOtherRowDimensionsMap = new HashMap<>(16);
|
|
|
for (ViewDimension viewDimension : groupTopRowDimensionList) {
|
|
|
rowList.add(viewDimension.getDimensionCode());
|
|
|
List<ViewDimension> otherRowDimensionList = viewDimensionDao.getGroupOtherRowDimensionList(view.getId(), viewDimension.getGroupRow());
|
|
|
for (ViewDimension otherViewDimension : otherRowDimensionList) {
|
|
|
rowList.add(otherViewDimension.getDimensionCode());
|
|
|
}
|
|
|
}
|
|
|
// 视图列维度(升序)
|
|
|
List<ViewDimension> colDimensionList = viewDimensionDao.getColDimensionList(view.getId());
|
|
|
for (ViewDimension colViewDimension : colDimensionList) {
|
|
|
cloumnList.add(colViewDimension.getDimensionCode());
|
|
|
}
|
|
|
// View view = viewDao.findByCode(viewCode);
|
|
|
// // 视图各组组内顶层行维度(升序)
|
|
|
// List<ViewDimension> groupTopRowDimensionList = viewDimensionDao.getGroupTopRowDimensionList(view.getId());
|
|
|
// // 视图各组组内其他行维度(升序)
|
|
|
// Map<Integer, List<ViewDimension>> groupOtherRowDimensionsMap = new HashMap<>(16);
|
|
|
// for (ViewDimension viewDimension : groupTopRowDimensionList) {
|
|
|
// rowList.add(viewDimension.getDimensionCode());
|
|
|
// List<ViewDimension> otherRowDimensionList = viewDimensionDao.getGroupOtherRowDimensionList(view.getId(), viewDimension.getGroupRow());
|
|
|
// for (ViewDimension otherViewDimension : otherRowDimensionList) {
|
|
|
// rowList.add(otherViewDimension.getDimensionCode());
|
|
|
// }
|
|
|
// }
|
|
|
// // 视图列维度(升序)
|
|
|
// List<ViewDimension> colDimensionList = viewDimensionDao.getColDimensionList(view.getId());
|
|
|
// for (ViewDimension colViewDimension : colDimensionList) {
|
|
|
// cloumnList.add(colViewDimension.getDimensionCode());
|
|
|
// }
|
|
|
|
|
|
List<Map<String, Object>> resultList = new LinkedList<Map<String, Object>>();
|
|
|
//合计行数据处理
|
|
@ -254,7 +253,9 @@ public class AggregationBuildHandler {
|
|
|
InternalAvg valueCount = (InternalAvg) aggregation;
|
|
|
value = valueCount.getValue();
|
|
|
}
|
|
|
map.put(key, value);
|
|
|
if(value != null){
|
|
|
map.put(key, value);
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@ -268,7 +269,12 @@ public class AggregationBuildHandler {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
while (gradeBucket.hasNext()) {
|
|
|
Terms.Bucket b = gradeBucket.next();
|
|
|
String subVal = aggCode+ "-" + b.getKey();
|
|
|
String subVal = "";
|
|
|
if(b.getKeyAsString() !=null){
|
|
|
subVal = aggCode+ "-" + b.getKeyAsString();
|
|
|
}else {
|
|
|
subVal = aggCode+ "-" + b.getKey();
|
|
|
}
|
|
|
for(Aggregation aggregation : b.getAggregations().asList()){
|
|
|
if (aggregation instanceof InternalValueCount) {
|
|
|
InternalValueCount valueCount = (InternalValueCount) aggregation;
|