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

fixed

parent 1a752c42
......@@ -218,16 +218,33 @@ public class LogStatisticsController {
}
List<StatItem> result = new ArrayList<>();
StatItem item1 = new StatItem();
item1.setName("2020-01");
item1.setCount(1000);
StatItem item2 = new StatItem();
item2.setName("2020-02");
item2.setCount(1000);
result.add(item1);
result.add(item2);
if (month !=null){
List<String> list = authLogService.distinct("yearMonthDay", param);
if (CollectionUtils.isNotEmpty(list)){
for (String ym : list) {
param.put("yearMonthDay",ym);
long count = authLogService.count(param);
StatItem item = new StatItem();
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);
}
......
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