|
@@ -98,36 +98,6 @@ public class AnalysisCommonServiceImpl {
|
|
|
DateUtils.format(DateUtils.getLastOfYear(year)));
|
|
|
//统计每月各个系统的搜索访问量
|
|
|
List<LablesVo> lablesVoList = new ArrayList<>();
|
|
|
- for (int i = 1; i <= 12; i++) {
|
|
|
- LablesVo lablesVo = new LablesVo();
|
|
|
- List<Map<String, Object>> values = new ArrayList<>();
|
|
|
- lablesVo.setName(i + "月");
|
|
|
- //查询出全部的业务系统名称
|
|
|
- List<String> platformList = PlatformConst.platformList();
|
|
|
- //获取每月的第一天和最后一天
|
|
|
- String firstOfMonth = DateUtils.getFirstOfMonth(year, i, 15);
|
|
|
- String lastOfMonth = DateUtils.getLastOfMonth(year, i, 15);
|
|
|
- Integer sumByMonth = pvLogMapper.selectSearchVisitHistogramByMonth(firstOfMonth, lastOfMonth, null);
|
|
|
- //根据月份查询各个业务系统访问量
|
|
|
- platformList.forEach(e -> {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- Integer count = pvLogMapper.selectSearchVisitHistogramByMonth(firstOfMonth, lastOfMonth, e);
|
|
|
- map.put("legend", e);
|
|
|
- map.put("value", count);
|
|
|
- if (sumByMonth == 0) {
|
|
|
- map.put("percentage", 0.0000);
|
|
|
- } else {
|
|
|
- double sum = count / (sumByMonth.doubleValue());
|
|
|
- BigDecimal bd = new BigDecimal(sum);
|
|
|
- double f1 = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
- map.put("percentage", f1);
|
|
|
- }
|
|
|
- values.add(map);
|
|
|
- });
|
|
|
- lablesVo.setValues(values);
|
|
|
- lablesVoList.add(lablesVo);
|
|
|
- }
|
|
|
- //返回值
|
|
|
searchVisitHistogramVo.setTotal(yearTotal);
|
|
|
searchVisitHistogramVo.setLables(lablesVoList);
|
|
|
return searchVisitHistogramVo;
|