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