Commit 881e69bc by 吴星煌

数据统计的定时任务,暂定每五分钟一次

parent 484f5ce2
......@@ -40,4 +40,10 @@ public class ImStatistics extends BaseEntity {
@ApiModelProperty("总成员数")
private Integer groupMember;
@ApiModelProperty("创建")
private LocalDateTime createTime;
@ApiModelProperty("修改")
private LocalDateTime updateTime;
}
......@@ -37,7 +37,7 @@ public class OverviewScheduled {
//统计数据统计中的数据并存入im_statistics表
@Scheduled(cron = "0 0 1 1-31 1-12 ? ")
@Scheduled(cron = "0 0/5 * * * ? ")
public void statisticsData(){
log.info("正在记录前一天的数据统计");
List<ImApplication> imApplicationList = imApplicationService.list();
......@@ -57,7 +57,7 @@ public class OverviewScheduled {
userStatistics.setFkAppid(appId);
userStatistics.setTime(LocalDateTime.now().minusDays(1));
userStatistics.setType(1);
imStatisticsService.save(userStatistics);
imStatisticsService.saveOrUpdate(userStatistics);
//统计活跃群组数量并保存
List<Long> ids = imMessageService.list(new LambdaQueryWrapper<ImMessage>()
......@@ -86,7 +86,7 @@ public class OverviewScheduled {
groupStatistics.setTime(LocalDateTime.now().minusDays(1));
groupStatistics.setType(2);
groupStatistics.setGroupMember(groupMember);
imStatisticsService.save(groupStatistics);
imStatisticsService.saveOrUpdate(groupStatistics);
log.info("数据保存结果为{}",imStatisticsService);
}
......
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