Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
881e69bc
Commit
881e69bc
authored
Jun 10, 2022
by
吴星煌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据统计的定时任务,暂定每五分钟一次
parent
484f5ce2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
core/src/main/java/com/wecloud/im/entity/ImStatistics.java
+6
-0
scheduled/src/main/java/io/geekidea/springbootplus/scheduled/OverviewScheduled.java
+3
-3
No files found.
core/src/main/java/com/wecloud/im/entity/ImStatistics.java
View file @
881e69bc
...
@@ -40,4 +40,10 @@ public class ImStatistics extends BaseEntity {
...
@@ -40,4 +40,10 @@ public class ImStatistics extends BaseEntity {
@ApiModelProperty
(
"总成员数"
)
@ApiModelProperty
(
"总成员数"
)
private
Integer
groupMember
;
private
Integer
groupMember
;
@ApiModelProperty
(
"创建"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"修改"
)
private
LocalDateTime
updateTime
;
}
}
scheduled/src/main/java/io/geekidea/springbootplus/scheduled/OverviewScheduled.java
View file @
881e69bc
...
@@ -37,7 +37,7 @@ public class OverviewScheduled {
...
@@ -37,7 +37,7 @@ public class OverviewScheduled {
//统计数据统计中的数据并存入im_statistics表
//统计数据统计中的数据并存入im_statistics表
@Scheduled
(
cron
=
"0 0
1 1-31 1-12
? "
)
@Scheduled
(
cron
=
"0 0
/5 * * *
? "
)
public
void
statisticsData
(){
public
void
statisticsData
(){
log
.
info
(
"正在记录前一天的数据统计"
);
log
.
info
(
"正在记录前一天的数据统计"
);
List
<
ImApplication
>
imApplicationList
=
imApplicationService
.
list
();
List
<
ImApplication
>
imApplicationList
=
imApplicationService
.
list
();
...
@@ -57,7 +57,7 @@ public class OverviewScheduled {
...
@@ -57,7 +57,7 @@ public class OverviewScheduled {
userStatistics
.
setFkAppid
(
appId
);
userStatistics
.
setFkAppid
(
appId
);
userStatistics
.
setTime
(
LocalDateTime
.
now
().
minusDays
(
1
));
userStatistics
.
setTime
(
LocalDateTime
.
now
().
minusDays
(
1
));
userStatistics
.
setType
(
1
);
userStatistics
.
setType
(
1
);
imStatisticsService
.
save
(
userStatistics
);
imStatisticsService
.
save
OrUpdate
(
userStatistics
);
//统计活跃群组数量并保存
//统计活跃群组数量并保存
List
<
Long
>
ids
=
imMessageService
.
list
(
new
LambdaQueryWrapper
<
ImMessage
>()
List
<
Long
>
ids
=
imMessageService
.
list
(
new
LambdaQueryWrapper
<
ImMessage
>()
...
@@ -86,7 +86,7 @@ public class OverviewScheduled {
...
@@ -86,7 +86,7 @@ public class OverviewScheduled {
groupStatistics
.
setTime
(
LocalDateTime
.
now
().
minusDays
(
1
));
groupStatistics
.
setTime
(
LocalDateTime
.
now
().
minusDays
(
1
));
groupStatistics
.
setType
(
2
);
groupStatistics
.
setType
(
2
);
groupStatistics
.
setGroupMember
(
groupMember
);
groupStatistics
.
setGroupMember
(
groupMember
);
imStatisticsService
.
save
(
groupStatistics
);
imStatisticsService
.
save
OrUpdate
(
groupStatistics
);
log
.
info
(
"数据保存结果为{}"
,
imStatisticsService
);
log
.
info
(
"数据保存结果为{}"
,
imStatisticsService
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment