Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
5e290a4d
Commit
5e290a4d
authored
3 years ago
by
张辰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cron topic report
parent
d29ce8f9
master
bugfix_0311_blacklist
dev
v2.3.1
1 merge request
!65
V2.3.1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
ConJobManager.java
.../main/java/com/tanpu/community/manager/ConJobManager.java
+23
-0
TopicReportService.java
...om/tanpu/community/service/quartz/TopicReportService.java
+16
-0
application-test.yml
community-service/src/main/resources/application-test.yml
+5
-0
No files found.
community-service/src/main/java/com/tanpu/community/manager/ConJobManager.java
View file @
5e290a4d
package
com
.
tanpu
.
community
.
manager
;
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.service.quartz.TopicReportService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -27,6 +28,9 @@ public class ConJobManager {
...
@@ -27,6 +28,9 @@ public class ConJobManager {
@Autowired
@Autowired
private
RecommendService
recommendService
;
private
RecommendService
recommendService
;
@Autowired
private
TopicReportService
topicReportService
;
/**
/**
* 定时统计 话题 访问数据,并刷到redis
* 定时统计 话题 访问数据,并刷到redis
*/
*/
...
@@ -61,4 +65,23 @@ public class ConJobManager {
...
@@ -61,4 +65,23 @@ public class ConJobManager {
public
void
clearRankLog
()
{
public
void
clearRankLog
()
{
rankLogService
.
clearRankLog
();
rankLogService
.
clearRankLog
();
}
}
/**
* 每个工作日早上09:30汇报 topic数据
*/
@Scheduled
(
cron
=
"0 30 9 ? * *"
)
public
void
reportTopicWeekday
()
{
log
.
info
(
"reportTopicWeekday start"
);
topicReportService
.
reportTopicWeekday
();
}
/**
* 每周六早上09:00汇报 topic数据
*/
@Scheduled
(
cron
=
"0 0 9 ? * SAT"
)
public
void
reportTopicSaturday
()
{
log
.
info
(
"reportTopicSaturday start"
);
topicReportService
.
reportTopicSaturday
();
}
}
}
This diff is collapsed.
Click to expand it.
community-service/src/main/java/com/tanpu/community/service/quartz/TopicReportService.java
View file @
5e290a4d
...
@@ -50,6 +50,13 @@ public class TopicReportService {
...
@@ -50,6 +50,13 @@ public class TopicReportService {
// 每个工作日早上09:30汇报
// 每个工作日早上09:30汇报
public
static
String
content_report_topic_weekday
=
"话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 昨日新增成员: %s, 昨日新增讨论"
;
public
static
String
content_report_topic_weekday
=
"话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 昨日新增成员: %s, 昨日新增讨论"
;
public
void
reportTopicWeekday
()
{
public
void
reportTopicWeekday
()
{
// 跳过双休日
Date
now
=
new
Date
();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
now
);
int
w
=
cal
.
get
(
Calendar
.
DAY_OF_WEEK
)
-
1
;
if
(
w
==
6
||
w
==
7
)
return
;
List
<
TopicEntity
>
topics
=
topicService
.
queryTopicNeedReport
();
List
<
TopicEntity
>
topics
=
topicService
.
queryTopicNeedReport
();
for
(
TopicEntity
topic
:
topics
)
{
for
(
TopicEntity
topic
:
topics
)
{
// 当前总成员
// 当前总成员
...
@@ -80,6 +87,15 @@ public class TopicReportService {
...
@@ -80,6 +87,15 @@ public class TopicReportService {
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
Date
date
=
new
Date
();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
int
w
=
cal
.
get
(
Calendar
.
DAY_OF_WEEK
)
-
1
;
System
.
out
.
println
(
w
);
}
// 每周六早上09:00汇报
// 每周六早上09:00汇报
public
static
String
content_report_topic_saturday
=
"话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 截至本周五新增成员: %s, 昨日新增讨论"
;
public
static
String
content_report_topic_saturday
=
"话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 截至本周五新增成员: %s, 昨日新增讨论"
;
public
void
reportTopicSaturday
()
{
public
void
reportTopicSaturday
()
{
...
...
This diff is collapsed.
Click to expand it.
community-service/src/main/resources/application-test.yml
View file @
5e290a4d
...
@@ -101,6 +101,11 @@ recommend:
...
@@ -101,6 +101,11 @@ recommend:
tmpfile
:
tmpfile
:
dir
:
/data/tmp
dir
:
/data/tmp
wxcp
:
topicreport
:
agentId
:
1000025
corpId
:
IC6Hpbct4OrYzacDnzXqSRC17vrpNwDZ1HZvFef1QQc
logging.level.com.tanpu
:
debug
logging.level.com.tanpu
:
debug
tanpu
:
tanpu
:
...
...
This diff is collapsed.
Click to expand it.
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