Forráskód Böngészése

环比 添加top参数

wangxingwang 6 éve
szülő
commit
1201e8a93e

+ 1 - 1
src/main/java/com/yihu/quota/controller/QuotaController.java

@ -172,7 +172,7 @@ public class QuotaController extends BaseController {
            String denominatorFilter = filters;
            if (StringUtils.isNotEmpty(esConfig.getGrowthFlag())) {
                resultList = baseStatistsService.getGrowthByQuota(dimension, filters, esConfig, dateType);
                resultList = baseStatistsService.getGrowthByQuota(dimension, filters, esConfig, dateType, top);
            } else {
                if(tjQuota.getResultGetType().equals("1")){
                    //普通指标直接查询

+ 3 - 3
src/main/java/com/yihu/quota/service/quota/BaseStatistsService.java

@ -1151,7 +1151,7 @@ public class BaseStatistsService {
        if (StringUtils.isNotEmpty(esConfig.getGrowthFlag())) {
            //增幅运算(环比和同比)
            result = getGrowthByQuota(dimension, filters, esConfig, dateType);
            result = getGrowthByQuota(dimension, filters, esConfig, dateType, top);
        } else {
            if (StringUtils.isNotEmpty(esConfig.getDateComparisonType())) {
                //时间条件处理
@ -1507,7 +1507,7 @@ public class BaseStatistsService {
     * @return
     * @throws Exception
     */
    public List<Map<String, Object>> getGrowthByQuota(String dimension, String filters, EsConfig esConfig, String dateType) throws Exception {
    public List<Map<String, Object>> getGrowthByQuota(String dimension, String filters, EsConfig esConfig, String dateType, String top) throws Exception {
        List<Map<String, Object>>  resultList = new LinkedList<>();
        String startQuotaDate = "";
        String endQuotaDate = "";
@ -1615,7 +1615,7 @@ public class BaseStatistsService {
                molecularFilter += " and " + noDateFilter;
                denominatorFilter += " and " + noDateFilter;
            }
            List<Map<String, Object>> moleList = getSimpleQuotaReport(esConfig.getMolecular(), molecularFilter,dimension ,false , null);
            List<Map<String, Object>> moleList = getSimpleQuotaReport(esConfig.getMolecular(), molecularFilter,dimension ,false , top);
            List<Map<String, Object>> denoList =  getSimpleQuotaReport(esConfig.getDenominator(),denominatorFilter,dimension,false, null);
            resultList = divisionPercent(dimension, moleList, denoList, 1, 100);
            return resultList;