Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
0d730371
Commit
0d730371
authored
Oct 30, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加自动增加月卡时长定时任务
parent
e58da9e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+25
-0
No files found.
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
0d730371
...
...
@@ -802,6 +802,31 @@ public class RedisTask {
logger
.
debug
(
"AutomaticallyMonthlyCard:自动结束月卡结束"
);
}
//每日00:00:00增加时长
@XxlJob
(
"AutoMonthlyCardTime"
)
public
void
AutoMonthlyCardTime
()
{
logger
.
debug
(
"AutoMonthlyCardTime:自动增加月卡时长开始"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
MONTHLY_CARD
.
getValue
()
+
"*"
);
if
(
keys
.
size
()
==
0
)
return
;
List
<
ConsumerMonthlyCard
>
consumerMonthlyCards
=
new
ArrayList
<>();
String
monthlyCardTime
=
sysConfigService
.
selectConfigByKey
(
"monthlyCardTime"
);
keys
.
stream
().
forEach
(
key
->
{
String
value
=
redisUtil
.
get
(
String
.
valueOf
(
key
));
JSONObject
jsonObject
=
new
JSONObject
(
value
);
Date
expirationTime
=
jsonObject
.
getDate
(
"expirationTime"
);
Long
consumerMonthlyCardId
=
jsonObject
.
getLong
(
"consumerMonthlyCardId"
);
if
(
expirationTime
.
getTime
()
>
new
Date
().
getTime
())
{
ConsumerMonthlyCard
consumerMonthlyCard
=
new
ConsumerMonthlyCard
();
consumerMonthlyCard
.
setFreeDuration
(
new
BigDecimal
(
monthlyCardTime
));
consumerMonthlyCard
.
setId
(
consumerMonthlyCardId
);
consumerMonthlyCards
.
add
(
consumerMonthlyCard
);
}
});
if
(!
CollectionUtils
.
isEmpty
(
consumerMonthlyCards
))
consumerMonthlyCardService
.
updateBatchById
(
consumerMonthlyCards
);
logger
.
debug
(
"AutoMonthlyCardTime:自动增加月卡时长结束"
);
}
@XxlJob
(
"AutomaticallySecondaryCard"
)
public
void
AutomaticallySecondaryCard
()
{
logger
.
debug
(
"AutomaticallySecondaryCard:自动结束次卡开始"
);
...
...
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