|
@@ -110,4 +110,43 @@ public class AnalysisSynthesizeServiceImpl {
|
|
|
result.forEach(e -> e.setCompany(userService.findDeptByDeptId(e.getCompany()).getName()));
|
|
|
return PageListUtils.getPages(queryData.getPageNo(),queryData.getPageSize(),result);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 各板块访问量分布(UV)
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> moduleUserUniqueVisits(String type) {
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ int year = calendar.get(Calendar.YEAR);
|
|
|
+ List<AlbumDetailVisitsVo> moduleUserVisitsVo = new ArrayList<>();
|
|
|
+ if ("total".equals(type)){
|
|
|
+ moduleUserVisitsVo = analysisSynthesizeMapper.moduleUserUniqueVisits(null,null);
|
|
|
+ } else if ("year".equals(type)) {
|
|
|
+ moduleUserVisitsVo = analysisSynthesizeMapper.moduleUserUniqueVisits(DateUtils.format(DateUtils.getFirstOfYear(year)),
|
|
|
+ DateUtils.format(DateUtils.getLastOfYear(year)));
|
|
|
+ } else if ("month".equals(type)) {
|
|
|
+ int month = calendar.get(Calendar.MONTH);
|
|
|
+ String firstOfMonth = DateUtils.getFirstOfMonth(year, month + 1, 15);
|
|
|
+ String lastOfMonth = DateUtils.getLastOfMonth(year, month + 1, 15);
|
|
|
+ moduleUserVisitsVo = analysisSynthesizeMapper.moduleUserUniqueVisits(firstOfMonth, lastOfMonth);
|
|
|
+ }
|
|
|
+ Map<String, Object> result = new LinkedHashMap<>();
|
|
|
+ moduleUserVisitsVo.forEach(e -> {
|
|
|
+ if (e.getName().equals("搜索服务")){
|
|
|
+ result.put("search",e.getValue());
|
|
|
+ result.put("searchPercentage",e.getPercentage());
|
|
|
+ } else if (e.getName().equals("知识仓库")){
|
|
|
+ result.put("knowledge",e.getValue());
|
|
|
+ result.put("knowledgePercentage",e.getPercentage());
|
|
|
+ } else if (e.getName().equals("知识地图")){
|
|
|
+ result.put("map",e.getValue());
|
|
|
+ result.put("mapPercentage",e.getPercentage());
|
|
|
+ } else if (e.getName().equals("知识专辑")){
|
|
|
+ result.put("album",e.getValue());
|
|
|
+ result.put("albumPercentage",e.getPercentage());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|