Authored by Lixiaodi

增加点击数统计功能

... ... @@ -41,8 +41,8 @@ public class UnionClickCountDayTask {
// 防止交错执行
private Lock lock = new ReentrantLock();
// 每天00:05分执行
@Scheduled(cron = "* 05 0 * * ?")
// 每天01:30分执行
@Scheduled(cron = "* 30 1 * * ?")
//@Scheduled(cron = "* 0/2 * * * ?")
public void run() {
... ... @@ -155,7 +155,7 @@ public class UnionClickCountDayTask {
}
// 把统计结果放到表里
logger.info("UnionClickCountDayTask run start to insert map.size={}", map.size());
String dayId = formatDay.format(new Date(begin * 1000L));
String dayId = formatDay.format(new Date(end * 1000L - 1));
int successCount = 0;
int failedCount = 0;
for (Map.Entry<String, UnionClickCount> entry : map.entrySet()) {
... ... @@ -170,7 +170,8 @@ public class UnionClickCountDayTask {
bean.setCreateTime((int) (System.currentTimeMillis() / 1000));
bean.setComb(dayId + "_" + bean.getUnionType() + "_" + bean.getClientType());
logger.info("UnionClickCountDayTask insert bean={}", bean);
logger.info("UnionClickCountDayTask insert bean={}", bean.getComb() + " : " + bean.getNum());
unionClickCountDayMapper.insert(bean);
successCount++;
count += info.getNum();
... ...