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
f20c071f
Commit
f20c071f
authored
Oct 31, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改会员等级滚动降级定时任务
parent
3b58b84a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+10
-8
No files found.
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
f20c071f
...
...
@@ -625,12 +625,7 @@ public class RedisTask {
//判断会员进度是否大于扣除进度
}
else
if
(
consumerMember
.
getMembershipProgress
().
compareTo
(
sum
[
0
].
abs
())
>=
0
)
{
//会员进度减去扣除进度
BigDecimal
subtract
=
BigDecimal
.
ZERO
;
if
(
sum
[
0
].
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
subtract
=
consumerMember
.
getMembershipProgress
().
add
(
sum
[
0
]);
}
else
if
(
sum
[
0
].
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
subtract
=
consumerMember
.
getMembershipProgress
().
subtract
(
sum
[
0
]);
}
BigDecimal
subtract
=
consumerMember
.
getMembershipProgress
().
subtract
(
sum
[
0
]);
// consumerMember.setMembershipProgress(subtract);
// if (consumerMember.getMembershipProgress().compareTo(BigDecimal.valueOf(memberConfig.getLimitRequirements())) < 0) {
//等级降一级
...
...
@@ -640,13 +635,20 @@ public class RedisTask {
//转Map limitRequirements,MemberConfig
Map
<
Long
,
MemberConfig
>
configMap
=
memberConfigService
.
list
(
new
LambdaQueryWrapper
<
MemberConfig
>()
.
orderByDesc
(
MemberConfig:
:
getMembershipLevel
)).
stream
().
collect
(
Collectors
.
toMap
(
MemberConfig:
:
getMembershipLevel
,
Function
.
identity
()));
//Map根
//判断subtract小于当前等级的积分,并大于下一等级的积分
for
(
Map
.
Entry
<
Long
,
MemberConfig
>
entry
:
configMap
.
entrySet
())
{
if
(
subtract
.
compareTo
(
BigDecimal
.
valueOf
(
entry
.
getValue
().
getLimitRequirements
()))
<
0
&&
subtract
.
compareTo
(
BigDecimal
.
valueOf
(
configMap
.
get
(
entry
.
getKey
()
-
1
).
getLimitRequirements
()))
>
=
0
if
(
subtract
.
compareTo
(
BigDecimal
.
valueOf
(
entry
.
getValue
().
getLimitRequirements
()))
>
0
&&
subtract
.
compareTo
(
BigDecimal
.
valueOf
(
configMap
.
get
(
entry
.
getKey
()
+
1
).
getLimitRequirements
()))
<
=
0
&&
entry
.
getKey
().
compareTo
(
Collections
.
min
(
configMap
.
keySet
()))
>
0
)
{
consumerMember
.
setMembershipLevel
(
entry
.
getKey
());
consumerMember
.
setMembershipProgress
(
subtract
);
updateList
.
add
(
consumerMember
);
return
;
}
else
if
(
subtract
.
compareTo
(
BigDecimal
.
valueOf
(
configMap
.
get
(
Collections
.
min
(
configMap
.
keySet
())).
getLimitRequirements
()))
<=
0
)
{
consumerMember
.
setMembershipLevel
(
Collections
.
min
(
configMap
.
keySet
()));
consumerMember
.
setMembershipProgress
(
subtract
);
updateList
.
add
(
consumerMember
);
return
;
}
}
...
...
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