Commit c2c0c8fd authored by 赵啸非's avatar 赵啸非

添加首页统计报表

parent ef5922d8
......@@ -68,7 +68,7 @@ public class HomeStatInfo {
/**
* 小程序近30日访问统计报表
*/
private List<Map<String, Integer>> accessStatList;
private List<Map<String, Object>> accessStatList;
/**
* 发送卡片总量
......
......@@ -208,20 +208,21 @@ public class CompanyServiceImpl extends AbstractCRUDServiceImpl<CompanyDao, Comp
homeStatInfo.setNewsDistributionList(newsCategoryList);
//近三十天访问记录
List<Map<String, Integer>> dayAccessList = new ArrayList<>();
List<Map<String, Object>> dayAccessList = new ArrayList<>();
DateTime beforeDay = DateUtil.offsetDay(new Date(), -30);
for (int i = 0; i < 30; i++) {
DateTime curDate = DateUtil.offsetDay(beforeDay, i);
Map<String, Integer> map = new HashMap<>();
map.put(curDate.toDateStr(), 0);
Map<String, Object> map = new HashMap<>();
map.put("dateStr",curDate.toDateStr());
map.put("nums", 0);
StaffRecordQuery staffRecordQuery = new StaffRecordQuery();
staffRecordQuery.setCreateTimeStart(curDate.toDateStr());
staffRecordQuery.setCreateTimeEnd(curDate.toDateStr());
List<StaffRecordEntity> staffRecordEntities = staffRecordService.find(staffRecordQuery, context);
if (!ObjectUtils.isEmpty(staffRecordEntities)) {
int sum = staffRecordEntities.stream().mapToInt(item -> item.getSumViews()).sum();
map.put(curDate.toDateStr(), sum);
map.put("nums", sum);
}
dayAccessList.add(map);
}
......
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