wangxingwang hace 6 años
padre
commit
9f1af053cd

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

@ -1974,7 +1974,7 @@ public class BaseStatistsService {
        String start = "", end = "";
        StringBuffer sb = new StringBuffer();
        List<String> xData = new ArrayList<>(); // x轴坐标
        List<String> yData = new ArrayList<>(); // x轴坐标对应的值
        List<Map<String, Object>> yData = new ArrayList<>(); // x轴坐标对应的值
        // 设置查询时间范围
        if (StringUtils.isNotEmpty(time)) {
            SimpleDateFormat dfs = new SimpleDateFormat("yyyy-MM-dd'T'23:59:59'Z'");
@ -2000,7 +2000,9 @@ public class BaseStatistsService {
        List<Map<String, Object>> list = elasticsearchUtil.excuteDataModel(sb.toString());
        list.forEach(one -> {
            xData.add((one.get("date_histogram(field=quotaDate,interval=month)") + "").substring(0,7));
            yData.add(one.get("COUNT(*)") + "");
            Map<String, Object> map = new HashMap<>();
            map.put((one.get("date_histogram(field=quotaDate,interval=month)") + "").substring(0,7), one.get("COUNT(*)"));
            yData.add(map);
        });
        envelop.setSuccessFlg(true);
        envelop.setObj(xData);