Commit 08ee7371 authored by 喻春霖's avatar 喻春霖

fixed

parent 1a752c42
...@@ -218,16 +218,33 @@ public class LogStatisticsController { ...@@ -218,16 +218,33 @@ public class LogStatisticsController {
} }
List<StatItem> result = new ArrayList<>(); List<StatItem> result = new ArrayList<>();
StatItem item1 = new StatItem(); if (month !=null){
item1.setName("2020-01"); List<String> list = authLogService.distinct("yearMonthDay", param);
item1.setCount(1000); if (CollectionUtils.isNotEmpty(list)){
StatItem item2 = new StatItem(); for (String ym : list) {
item2.setName("2020-02"); param.put("yearMonthDay",ym);
item2.setCount(1000); long count = authLogService.count(param);
result.add(item1); StatItem item = new StatItem();
result.add(item2); item.setName(ym);
item.setCount(count);
result.add(item);
}
}
}else {
List<String> list = authLogService.distinct("yearMonth", param);
if (CollectionUtils.isNotEmpty(list)){
for (String ym : list) {
param.put("yearMonth",ym);
long count = authLogService.count(param);
StatItem item = new StatItem();
item.setName(ym);
item.setCount(count);
result.add(item);
}
}
}
result.sort(Comparator.comparing(StatItem::getName));
return MapMessage.successMessage().add("data", result); return MapMessage.successMessage().add("data", result);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment