|
@ -148,24 +148,17 @@ public class AggregationBuildHandler {
|
|
|
* @param map 聚合查询结果
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String, Object>> tableDataParsing(String viewCode ,Map<String, Aggregation> map){
|
|
|
public List<Map<String, Object>> tableDataParsing(View view,Map<String, Aggregation> map){
|
|
|
// List<String> rowList = new LinkedList<>();
|
|
|
// rowList.add("town_terms");
|
|
|
// rowList.add("total");
|
|
|
// List<String> cloumnList = new ArrayList<>();
|
|
|
// cloumnList.add("total_count_result");
|
|
|
// cloumnList.add("sex_terms");
|
|
|
|
|
|
View view = viewDao.findByCode(viewCode);
|
|
|
if(view == null){
|
|
|
logger.debug("视图不存在");
|
|
|
return null;
|
|
|
}
|
|
|
List<String> rowList = getRowDimensionList(view.getId());
|
|
|
List<String> cloumnList = getColumnDimensionList(view.getId());
|
|
|
|
|
|
List<ViewQuota> viewQuotas = viewQuotaDao.findByViewId(view.getId());
|
|
|
// List<ViewQuotaFilter> viewFilters = viewQuotaFilterDao.findByRelationId(view.getId());
|
|
|
Map<String, Object> quotaMap = new HashMap<>();
|
|
|
for(ViewQuota viewQuota :viewQuotas){
|
|
|
List<ViewQuotaFilter> viewQuotaFilters = viewQuotaFilterDao.findByRelationId(viewQuota.getId());
|
|
@ -254,13 +247,8 @@ public class AggregationBuildHandler {
|
|
|
* @param map 聚合查询结果
|
|
|
* @return
|
|
|
*/
|
|
|
public Map<String, Object> numericalDataParsing(String viewCode ,Map<String, Aggregation> map){
|
|
|
public Map<String, Object> numericalDataParsing(View view,Map<String, Aggregation> map){
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
View view = viewDao.findByCode(viewCode);
|
|
|
if(view == null){
|
|
|
logger.debug("视图不存在");
|
|
|
return null;
|
|
|
}
|
|
|
List<ViewQuota> viewQuotas = viewQuotaDao.findByViewId(view.getId());
|
|
|
Map<String, Object> quotaMap = new HashMap<>();
|
|
|
for(ViewQuota viewQuota :viewQuotas){
|
|
@ -294,7 +282,7 @@ public class AggregationBuildHandler {
|
|
|
* @param map 聚合查询结果
|
|
|
* @return
|
|
|
*/
|
|
|
public Option ehartDataParsing(String viewCode ,Map<String, Aggregation> map){
|
|
|
public Option ehartDataParsing(View view,Map<String, Aggregation> map){
|
|
|
Option option = null;
|
|
|
ReportOption reportOption = new ReportOption();
|
|
|
List<String> xDataList = new LinkedList<>();
|
|
@ -304,7 +292,6 @@ public class AggregationBuildHandler {
|
|
|
|
|
|
List<String> rowList = new LinkedList<>();
|
|
|
rowList.add("town_terms");
|
|
|
View view = viewDao.findByCode(viewCode);
|
|
|
// rowList = getRowDimensionList(view.getId());
|
|
|
if(rowList.size() != 1){
|
|
|
logger.debug("图表型指标维度配置有误");
|