Commit 56e2886c 56e2886cbb0f10625e0dfdbec2ceb9005b2902c5 by 张云鹏

内容访问统计

1 parent 138d81f3
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
33 <!--代码生成器--> 33 <!--代码生成器-->
34 <dependency> 34 <dependency>
35 <groupId>com.topdraw</groupId> 35 <groupId>com.topdraw</groupId>
36 <artifactId>cronos-system</artifactId> 36 <artifactId>cronos-common</artifactId>
37 <version>1.1.0</version> 37 <version>1.2.1</version>
38 </dependency> 38 </dependency>
39 39
40 <!--Mysql依赖包,版本差异,需单独引入--> 40 <!--Mysql依赖包,版本差异,需单独引入-->
......
1 package com.topdraw; 1 package com.topdraw;
2 2
3 import com.topdraw.base.BaseRepositoryFactory; 3 import com.topdraw.base.BaseRepositoryFactory;
4 import com.topdraw.utils.SpringContextHolder; 4 import com.topdraw.modules.utils.SpringContextHolder;
5 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.boot.SpringApplication; 6 import org.springframework.boot.SpringApplication;
7 import org.springframework.boot.autoconfigure.SpringBootApplication; 7 import org.springframework.boot.autoconfigure.SpringBootApplication;
......
...@@ -3,7 +3,7 @@ package com.topdraw.business.module.activitybtn.all.service.impl; ...@@ -3,7 +3,7 @@ package com.topdraw.business.module.activitybtn.all.service.impl;
3 import com.topdraw.business.module.activitybtn.all.domain.ActTplParamClick; 3 import com.topdraw.business.module.activitybtn.all.domain.ActTplParamClick;
4 import com.topdraw.business.module.activitybtn.all.repository.ActivityBtnPvUvRepository; 4 import com.topdraw.business.module.activitybtn.all.repository.ActivityBtnPvUvRepository;
5 import com.topdraw.business.module.activitybtn.all.service.ActivityBtnPvUvService; 5 import com.topdraw.business.module.activitybtn.all.service.ActivityBtnPvUvService;
6 import com.topdraw.utils.ValidationUtil; 6 import com.topdraw.modules.utils.ValidationUtil;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
9 import org.springframework.transaction.annotation.Propagation; 9 import org.springframework.transaction.annotation.Propagation;
......
...@@ -3,7 +3,7 @@ package com.topdraw.business.module.activitybtn.day.service.impl; ...@@ -3,7 +3,7 @@ package com.topdraw.business.module.activitybtn.day.service.impl;
3 import com.topdraw.business.module.activitybtn.day.domain.ActTplParamClickDay; 3 import com.topdraw.business.module.activitybtn.day.domain.ActTplParamClickDay;
4 import com.topdraw.business.module.activitybtn.day.repository.ActivityBtnPvUvDayRepository; 4 import com.topdraw.business.module.activitybtn.day.repository.ActivityBtnPvUvDayRepository;
5 import com.topdraw.business.module.activitybtn.day.service.ActivityBtnPvUvDayService; 5 import com.topdraw.business.module.activitybtn.day.service.ActivityBtnPvUvDayService;
6 import com.topdraw.utils.ValidationUtil; 6 import com.topdraw.modules.utils.ValidationUtil;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
9 import org.springframework.transaction.annotation.Propagation; 9 import org.springframework.transaction.annotation.Propagation;
......
...@@ -3,7 +3,7 @@ package com.topdraw.business.module.activitybtn.hour.service.impl; ...@@ -3,7 +3,7 @@ package com.topdraw.business.module.activitybtn.hour.service.impl;
3 import com.topdraw.business.module.activitybtn.hour.domain.ActTplParamClickHour; 3 import com.topdraw.business.module.activitybtn.hour.domain.ActTplParamClickHour;
4 import com.topdraw.business.module.activitybtn.hour.repository.ActivityBtnPvUvHourRepository; 4 import com.topdraw.business.module.activitybtn.hour.repository.ActivityBtnPvUvHourRepository;
5 import com.topdraw.business.module.activitybtn.hour.service.ActivityBtnPvUvHourService; 5 import com.topdraw.business.module.activitybtn.hour.service.ActivityBtnPvUvHourService;
6 import com.topdraw.utils.ValidationUtil; 6 import com.topdraw.modules.utils.ValidationUtil;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
9 import org.springframework.transaction.annotation.Propagation; 9 import org.springframework.transaction.annotation.Propagation;
......
...@@ -3,7 +3,7 @@ package com.topdraw.business.module.content.all.service.impl; ...@@ -3,7 +3,7 @@ package com.topdraw.business.module.content.all.service.impl;
3 import com.topdraw.business.module.content.all.domain.ContentPVUV; 3 import com.topdraw.business.module.content.all.domain.ContentPVUV;
4 import com.topdraw.business.module.content.all.repository.ContentPVUVRepository; 4 import com.topdraw.business.module.content.all.repository.ContentPVUVRepository;
5 import com.topdraw.business.module.content.all.service.ContentPVUVService; 5 import com.topdraw.business.module.content.all.service.ContentPVUVService;
6 import com.topdraw.utils.ValidationUtil; 6 import com.topdraw.modules.utils.ValidationUtil;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
9 import org.springframework.transaction.annotation.Transactional; 9 import org.springframework.transaction.annotation.Transactional;
......
...@@ -3,7 +3,7 @@ package com.topdraw.business.module.content.day.service.impl; ...@@ -3,7 +3,7 @@ package com.topdraw.business.module.content.day.service.impl;
3 import com.topdraw.business.module.content.day.domain.ContentPVUVDay; 3 import com.topdraw.business.module.content.day.domain.ContentPVUVDay;
4 import com.topdraw.business.module.content.day.repository.ContentPVUVDayRepository; 4 import com.topdraw.business.module.content.day.repository.ContentPVUVDayRepository;
5 import com.topdraw.business.module.content.day.service.ContentPVUVDayService; 5 import com.topdraw.business.module.content.day.service.ContentPVUVDayService;
6 import com.topdraw.utils.ValidationUtil; 6 import com.topdraw.modules.utils.ValidationUtil;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
9 import org.springframework.transaction.annotation.Transactional; 9 import org.springframework.transaction.annotation.Transactional;
......
...@@ -3,7 +3,7 @@ package com.topdraw.business.module.content.hour.service.impl; ...@@ -3,7 +3,7 @@ package com.topdraw.business.module.content.hour.service.impl;
3 import com.topdraw.business.module.content.hour.domain.ContentPVUVHour; 3 import com.topdraw.business.module.content.hour.domain.ContentPVUVHour;
4 import com.topdraw.business.module.content.hour.repository.ContentPVUVHourRepository; 4 import com.topdraw.business.module.content.hour.repository.ContentPVUVHourRepository;
5 import com.topdraw.business.module.content.hour.service.ContentPVUVHourService; 5 import com.topdraw.business.module.content.hour.service.ContentPVUVHourService;
6 import com.topdraw.utils.ValidationUtil; 6 import com.topdraw.modules.utils.ValidationUtil;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
9 import org.springframework.transaction.annotation.Transactional; 9 import org.springframework.transaction.annotation.Transactional;
......
...@@ -108,9 +108,6 @@ public class TemplateParamValue implements Serializable { ...@@ -108,9 +108,6 @@ public class TemplateParamValue implements Serializable {
108 @Column(name = "page_code") 108 @Column(name = "page_code")
109 private String pageCode; 109 private String pageCode;
110 110
111 @Column(name = "page_title")
112 private String pageTitle;
113
114 //展现形式 111 //展现形式
115 @Column(name = "display_form") 112 @Column(name = "display_form")
116 private Integer displayForm; 113 private Integer displayForm;
......
1 package com.topdraw.business.module.uv.all.service.impl; 1 package com.topdraw.business.module.uv.all.service.impl;
2 2
3 import com.topdraw.business.module.uv.all.domain.PvUv; 3 import com.topdraw.business.module.uv.all.domain.PvUv;
4 import com.topdraw.utils.ValidationUtil; 4 import com.topdraw.modules.utils.ValidationUtil;
5 import com.topdraw.utils.FileUtil; 5 import com.topdraw.modules.utils.FileUtil;
6 import com.topdraw.business.module.uv.all.repository.PvUvRepository; 6 import com.topdraw.business.module.uv.all.repository.PvUvRepository;
7 import com.topdraw.business.module.uv.all.service.PvUvService; 7 import com.topdraw.business.module.uv.all.service.PvUvService;
8 import com.topdraw.business.module.uv.all.service.dto.PvUvDTO; 8 import com.topdraw.business.module.uv.all.service.dto.PvUvDTO;
...@@ -16,9 +16,9 @@ import org.springframework.dao.EmptyResultDataAccessException; ...@@ -16,9 +16,9 @@ import org.springframework.dao.EmptyResultDataAccessException;
16 import org.springframework.data.domain.Page; 16 import org.springframework.data.domain.Page;
17 import org.springframework.data.domain.Pageable; 17 import org.springframework.data.domain.Pageable;
18 import org.springframework.util.Assert; 18 import org.springframework.util.Assert;
19 import com.topdraw.utils.PageUtil; 19 import com.topdraw.modules.utils.PageUtil;
20 import com.topdraw.utils.QueryHelp; 20 import com.topdraw.modules.utils.QueryHelp;
21 import com.topdraw.utils.StringUtils; 21 import com.topdraw.modules.utils.StringUtils;
22 22
23 import java.util.List; 23 import java.util.List;
24 import java.util.Map; 24 import java.util.Map;
......
1 package com.topdraw.business.module.uv.day.service.impl; 1 package com.topdraw.business.module.uv.day.service.impl;
2 2
3 import com.topdraw.business.module.uv.day.domain.PvUvDay; 3 import com.topdraw.business.module.uv.day.domain.PvUvDay;
4 import com.topdraw.utils.ValidationUtil; 4 import com.topdraw.modules.utils.ValidationUtil;
5 import com.topdraw.utils.FileUtil; 5 import com.topdraw.modules.utils.FileUtil;
6 import com.topdraw.business.module.uv.day.repository.PvUvDayRepository; 6 import com.topdraw.business.module.uv.day.repository.PvUvDayRepository;
7 import com.topdraw.business.module.uv.day.service.PvUvDayService; 7 import com.topdraw.business.module.uv.day.service.PvUvDayService;
8 import com.topdraw.business.module.uv.day.service.dto.PvUvDayDTO; 8 import com.topdraw.business.module.uv.day.service.dto.PvUvDayDTO;
...@@ -16,9 +16,9 @@ import org.springframework.dao.EmptyResultDataAccessException; ...@@ -16,9 +16,9 @@ import org.springframework.dao.EmptyResultDataAccessException;
16 import org.springframework.data.domain.Page; 16 import org.springframework.data.domain.Page;
17 import org.springframework.data.domain.Pageable; 17 import org.springframework.data.domain.Pageable;
18 import org.springframework.util.Assert; 18 import org.springframework.util.Assert;
19 import com.topdraw.utils.PageUtil; 19 import com.topdraw.modules.utils.PageUtil;
20 import com.topdraw.utils.QueryHelp; 20 import com.topdraw.modules.utils.QueryHelp;
21 import com.topdraw.utils.StringUtils; 21 import com.topdraw.modules.utils.StringUtils;
22 22
23 import java.util.List; 23 import java.util.List;
24 import java.util.Map; 24 import java.util.Map;
......
1 package com.topdraw.business.module.uv.hour.service.impl; 1 package com.topdraw.business.module.uv.hour.service.impl;
2 2
3 import com.topdraw.business.module.uv.hour.domain.PvUvHour; 3 import com.topdraw.business.module.uv.hour.domain.PvUvHour;
4 import com.topdraw.utils.ValidationUtil; 4 import com.topdraw.modules.utils.ValidationUtil;
5 import com.topdraw.utils.FileUtil; 5 import com.topdraw.modules.utils.FileUtil;
6 import com.topdraw.business.module.uv.hour.repository.PvUvHourRepository; 6 import com.topdraw.business.module.uv.hour.repository.PvUvHourRepository;
7 import com.topdraw.business.module.uv.hour.service.PvUvHourService; 7 import com.topdraw.business.module.uv.hour.service.PvUvHourService;
8 import com.topdraw.business.module.uv.hour.service.dto.PvUvHourDTO; 8 import com.topdraw.business.module.uv.hour.service.dto.PvUvHourDTO;
...@@ -16,9 +16,9 @@ import org.springframework.dao.EmptyResultDataAccessException; ...@@ -16,9 +16,9 @@ import org.springframework.dao.EmptyResultDataAccessException;
16 import org.springframework.data.domain.Page; 16 import org.springframework.data.domain.Page;
17 import org.springframework.data.domain.Pageable; 17 import org.springframework.data.domain.Pageable;
18 import org.springframework.util.Assert; 18 import org.springframework.util.Assert;
19 import com.topdraw.utils.PageUtil; 19 import com.topdraw.modules.utils.PageUtil;
20 import com.topdraw.utils.QueryHelp; 20 import com.topdraw.modules.utils.QueryHelp;
21 import com.topdraw.utils.StringUtils; 21 import com.topdraw.modules.utils.StringUtils;
22 22
23 import java.util.List; 23 import java.util.List;
24 import java.util.Map; 24 import java.util.Map;
......
...@@ -7,7 +7,7 @@ import com.topdraw.business.module.activitybtn.day.service.ActivityBtnPvUvDaySer ...@@ -7,7 +7,7 @@ import com.topdraw.business.module.activitybtn.day.service.ActivityBtnPvUvDaySer
7 import com.topdraw.business.module.activitybtn.hour.domain.ActTplParamClickHour; 7 import com.topdraw.business.module.activitybtn.hour.domain.ActTplParamClickHour;
8 import com.topdraw.business.module.activitybtn.hour.service.ActivityBtnPvUvHourService; 8 import com.topdraw.business.module.activitybtn.hour.service.ActivityBtnPvUvHourService;
9 import com.topdraw.util.TimestampUtil; 9 import com.topdraw.util.TimestampUtil;
10 import com.topdraw.utils.RedisUtils; 10 import com.topdraw.modules.utils.RedisUtils;
11 import lombok.extern.slf4j.Slf4j; 11 import lombok.extern.slf4j.Slf4j;
12 import org.apache.commons.collections4.CollectionUtils; 12 import org.apache.commons.collections4.CollectionUtils;
13 import org.apache.commons.lang3.StringUtils; 13 import org.apache.commons.lang3.StringUtils;
......
...@@ -7,15 +7,9 @@ import com.topdraw.business.module.content.day.service.ContentPVUVDayService; ...@@ -7,15 +7,9 @@ import com.topdraw.business.module.content.day.service.ContentPVUVDayService;
7 import com.topdraw.business.module.content.hour.domain.ContentPVUVHour; 7 import com.topdraw.business.module.content.hour.domain.ContentPVUVHour;
8 import com.topdraw.business.module.content.hour.service.ContentPVUVHourService; 8 import com.topdraw.business.module.content.hour.service.ContentPVUVHourService;
9 import com.topdraw.business.module.template.service.TemplateParamValueService; 9 import com.topdraw.business.module.template.service.TemplateParamValueService;
10 import com.topdraw.business.module.uv.all.domain.PvUv;
11 import com.topdraw.business.module.uv.all.service.PvUvService;
12 import com.topdraw.business.module.uv.day.domain.PvUvDay;
13 import com.topdraw.business.module.uv.day.service.PvUvDayService;
14 import com.topdraw.business.module.uv.hour.domain.PvUvHour;
15 import com.topdraw.business.module.uv.hour.service.PvUvHourService;
16 import com.topdraw.util.TimestampUtil; 10 import com.topdraw.util.TimestampUtil;
17 import com.topdraw.utils.RedisUtils; 11 import com.topdraw.modules.utils.RedisUtils;
18 import com.topdraw.utils.StringUtils; 12 import com.topdraw.modules.utils.StringUtils;
19 import lombok.extern.slf4j.Slf4j; 13 import lombok.extern.slf4j.Slf4j;
20 import org.apache.commons.collections4.CollectionUtils; 14 import org.apache.commons.collections4.CollectionUtils;
21 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
...@@ -52,21 +46,25 @@ public class ContentCalculateTask { ...@@ -52,21 +46,25 @@ public class ContentCalculateTask {
52 //循环所有内容, 46 //循环所有内容,
53 Map<Object, Object> allContents = this.getAllContents(); 47 Map<Object, Object> allContents = this.getAllContents();
54 Set<Object> contentCodes = allContents.keySet(); 48 Set<Object> contentCodes = allContents.keySet();
55 List<Long> btnIds = contentCodes.stream().map(item -> {return Long.parseLong(item.toString().split("#")[0]);}).collect(Collectors.toList()); 49 // log.info("all content codes: {}", contentCodes);
56 Map<Long, String> btnNames = templateParamValueService.btnNames(btnIds);
57 //查询btn name集合 50 //查询btn name集合
58 if (CollectionUtils.isNotEmpty(contentCodes)) { 51 if (CollectionUtils.isNotEmpty(contentCodes)) {
52 List<Long> btnIds = contentCodes.stream().map(item -> {return Long.parseLong(item.toString().split("#")[0]);}).collect(Collectors.toList());
53 Map<Long, String> btnNames = templateParamValueService.btnNames(btnIds);
59 for (Object item : contentCodes) { 54 for (Object item : contentCodes) {
60 String key = String.valueOf(item); 55 String key = String.valueOf(item);
56 // log.info("now content: {}", key);
61 String[] split = key.split("#"); 57 String[] split = key.split("#");
62 if (split.length < 2) { 58 if (split.length < 2) {
63 continue; 59 continue;
64 } 60 }
65 Long btnId = Long.parseLong(split[0]); 61 Long btnId = Long.parseLong(split[0]);
66 String contentCode = split[1]; 62 String contentCode = split[1];
67 String name = allContents.get(item).toString(); 63 Object contentName = allContents.get(key);
64 // log.info("content name: {}", contentName);
65 String name = contentName != null ? contentName.toString() : "";
68 name = StringUtils.isNotEmpty(name) ? name : btnNames.get(btnId); 66 name = StringUtils.isNotEmpty(name) ? name : btnNames.get(btnId);
69 67 // log.info("final key: {}, name: {}", key, name);
70 String day = LocalDate.now().toString(); 68 String day = LocalDate.now().toString();
71 Integer hour = LocalDateTime.now().getHour(); 69 Integer hour = LocalDateTime.now().getHour();
72 70
......
...@@ -7,7 +7,7 @@ import com.topdraw.business.module.uv.day.service.PvUvDayService; ...@@ -7,7 +7,7 @@ import com.topdraw.business.module.uv.day.service.PvUvDayService;
7 import com.topdraw.business.module.uv.hour.domain.PvUvHour; 7 import com.topdraw.business.module.uv.hour.domain.PvUvHour;
8 import com.topdraw.business.module.uv.hour.service.PvUvHourService; 8 import com.topdraw.business.module.uv.hour.service.PvUvHourService;
9 import com.topdraw.util.TimestampUtil; 9 import com.topdraw.util.TimestampUtil;
10 import com.topdraw.utils.RedisUtils; 10 import com.topdraw.modules.utils.RedisUtils;
11 import lombok.extern.slf4j.Slf4j; 11 import lombok.extern.slf4j.Slf4j;
12 import org.apache.commons.collections4.CollectionUtils; 12 import org.apache.commons.collections4.CollectionUtils;
13 import org.apache.commons.lang3.StringUtils; 13 import org.apache.commons.lang3.StringUtils;
......
1 package com.topdraw.redis.config; 1 package com.topdraw.redis.config;
2 2
3 import com.topdraw.modules.utils.StringUtils;
3 import lombok.extern.slf4j.Slf4j; 4 import lombok.extern.slf4j.Slf4j;
4 import org.apache.commons.lang.StringUtils;
5 import org.apache.commons.pool2.impl.GenericObjectPoolConfig; 5 import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
6 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.beans.factory.annotation.Qualifier; 7 import org.springframework.beans.factory.annotation.Qualifier;
......