Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
aa8e86e7
Commit
aa8e86e7
authored
Jun 25, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试环境不发送专场通知
parent
8ba04be1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SpecialPerformanceNoticeJob.java
.../java/com/wwdz/ch/wx/job/SpecialPerformanceNoticeJob.java
+8
-0
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SpecialPerformanceNoticeJob.java
View file @
aa8e86e7
...
@@ -78,6 +78,9 @@ public class SpecialPerformanceNoticeJob {
...
@@ -78,6 +78,9 @@ public class SpecialPerformanceNoticeJob {
@Autowired
@Autowired
UserDao
userDao
;
UserDao
userDao
;
@Value
(
"${spring.profiles.active}"
)
private
String
env
;
private
final
static
String
SPECIAL_PERFORMANCE_URL
=
"/pages/saleSpecialList/index"
;
private
final
static
String
SPECIAL_PERFORMANCE_URL
=
"/pages/saleSpecialList/index"
;
/**
/**
...
@@ -85,6 +88,7 @@ public class SpecialPerformanceNoticeJob {
...
@@ -85,6 +88,7 @@ public class SpecialPerformanceNoticeJob {
*/
*/
@Scheduled
(
fixedDelay
=
1000
*
60
*
10
)
@Scheduled
(
fixedDelay
=
1000
*
60
*
10
)
public
void
execute
()
{
public
void
execute
()
{
RLock
lock
=
redissonClient
.
getLock
(
SPECIAL_PERFORMANCE_SEND_MSG_KEY
);
RLock
lock
=
redissonClient
.
getLock
(
SPECIAL_PERFORMANCE_SEND_MSG_KEY
);
if
(!
lock
.
tryLock
())
{
if
(!
lock
.
tryLock
())
{
logger
.
warn
(
"专场即将开始通知任务,当前服务实例获取锁成功: {} 获取锁失败,锁被占用不执行"
,
Thread
.
currentThread
().
getId
());
logger
.
warn
(
"专场即将开始通知任务,当前服务实例获取锁成功: {} 获取锁失败,锁被占用不执行"
,
Thread
.
currentThread
().
getId
());
...
@@ -109,6 +113,10 @@ public class SpecialPerformanceNoticeJob {
...
@@ -109,6 +113,10 @@ public class SpecialPerformanceNoticeJob {
SpecialPerformance
specialPerformance
=
specialPerformanceList
.
get
(
0
);
SpecialPerformance
specialPerformance
=
specialPerformanceList
.
get
(
0
);
String
abortStartKey
=
SPECIAL_PERFORMANCE_START_NOTICE_KEY
+
specialPerformance
.
getId
();
String
abortStartKey
=
SPECIAL_PERFORMANCE_START_NOTICE_KEY
+
specialPerformance
.
getId
();
if
(!
redisUtils
.
hasKey
(
abortStartKey
))
{
if
(!
redisUtils
.
hasKey
(
abortStartKey
))
{
if
(
"dev"
.
equals
(
env
))
{
logger
.
info
(
">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行专场即将开始通知任务<<<<<<<<<<<<<<<<<<<<<"
);
return
;
}
logger
.
info
(
"当前即将开始的专场id:{}, 名称为 {} "
,
specialPerformance
.
getId
(),
specialPerformance
.
getTitle
());
logger
.
info
(
"当前即将开始的专场id:{}, 名称为 {} "
,
specialPerformance
.
getId
(),
specialPerformance
.
getTitle
());
//发送短信通知
//发送短信通知
String
url
=
wxAppletApi
.
getUrlLink
(
SPECIAL_PERFORMANCE_URL
,
"specialId="
+
specialPerformance
.
getId
());
String
url
=
wxAppletApi
.
getUrlLink
(
SPECIAL_PERFORMANCE_URL
,
"specialId="
+
specialPerformance
.
getId
());
...
...
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