Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
17de5acd
Commit
17de5acd
authored
Dec 30, 2024
by
Smile
Committed by
wux
Dec 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员定时任务修改
parent
b8b3d77f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
1 deletion
+59
-1
userLevelDetailsTask.java
...iocoder/yudao/module/member/job/userLevelDetailsTask.java
+59
-1
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/job/userLevelDetailsTask.java
View file @
17de5acd
...
...
@@ -113,7 +113,7 @@ public class userLevelDetailsTask implements JobHandler {
if
(
addScore
>
reduceScore
){
int
score
=
addScore
-
reduceScore
;
log
.
info
(
"符合规则积分数量: {}"
,
score
);
if
(
score
>
userLevelConfigDO
.
getLowerCount
()){
if
(
score
>
=
userLevelConfigDO
.
getLowerCount
()){
//进入积分规则设置方法
//大于最低分,符合规则,查看是否有规则详情
Boolean
b
=
setConfigDetails
(
memberId
,
userLevelConfigDO
);
...
...
@@ -254,6 +254,64 @@ public class userLevelDetailsTask implements JobHandler {
return
true
;
}
}
}
else
{
//设置了不降级,只能升级
if
(
memberUserLevelDetailsBackVO
.
getLevel
()<
memberUserLevelConfigDO
.
getLevel
()){
//升级流程
//设置用户为admin
MemberUserLevelDetailsDO
memberUserLevelDetailsDO
=
new
MemberUserLevelDetailsDO
();
memberUserLevelDetailsDO
.
setId
(
memberUserLevelDetailsBackVO
.
getId
());
memberUserLevelDetailsDO
.
setMemberId
(
memberUserLevelDetailsBackVO
.
getMemberId
());
memberUserLevelDetailsDO
.
setLevel
(
memberUserLevelConfigDO
.
getLevel
());
memberUserLevelDetailsDO
.
setSpecificSettings
(
memberUserLevelDetailsBackVO
.
getSpecificSettings
());
memberUserLevelDetailsDO
.
setValidityPeriod
(
memberUserLevelConfigDO
.
getValidityPeriod
());
memberUserLevelDetailsDO
.
setRemarks
(
memberUserLevelConfigDO
.
getDescription
());
memberUserLevelDetailsDO
.
setConfigId
(
memberUserLevelConfigDO
.
getId
());
memberUserLevelDetailsDO
.
setUpdater
(
String
.
valueOf
(
user
.
getId
()));
memberUserLevelDetailsService
.
updateById
(
memberUserLevelDetailsDO
);
//插入一条日志 升级日志
MemberUserLevelOperateLogDO
memberUserLevelOperateLogDo
=
MemberUserLevelOperateLogDO
.
builder
()
.
configId
(
memberUserLevelDetailsDO
.
getConfigId
())
.
configName
(
memberUserLevelConfigDO
.
getName
())
.
memberId
(
memberUserLevelDetailsDO
.
getMemberId
())
.
operator
(
user
.
getNickname
())
.
remarks
(
memberUserLevelDetailsDO
.
getRemarks
())
.
level
(
memberUserLevelConfigDO
.
getLevel
())
.
operateType
(
1
)
.
build
();
memberUserLevelOperateService
.
save
(
memberUserLevelOperateLogDo
);
log
.
info
(
"客户等级小于当前等级,等级详情进入升级操作,规则id:{},用户id:{}"
,
memberUserLevelConfigDO
.
getRuleNumber
(),
memberId
);
return
true
;
}
else
if
(
memberUserLevelDetailsBackVO
.
getLevel
()==
memberUserLevelConfigDO
.
getLevel
()&&!
memberUserLevelDetailsBackVO
.
getRuleNumber
().
equals
(
memberUserLevelConfigDO
.
getRuleNumber
())){
//级别相同比较sort顺序
MemberUserLevelConfigDO
memberUserLevelConfigOldDo
=
memberUserLevelConfigService
.
getById
(
memberUserLevelDetailsBackVO
.
getConfigId
());
if
(
memberUserLevelConfigOldDo
.
getSort
()<
memberUserLevelConfigDO
.
getSort
()){
//降级流程
//设置用户为admin
MemberUserLevelDetailsDO
memberUserLevelDetailsDO
=
new
MemberUserLevelDetailsDO
();
memberUserLevelDetailsDO
.
setId
(
memberUserLevelDetailsBackVO
.
getId
());
memberUserLevelDetailsDO
.
setMemberId
(
memberUserLevelDetailsBackVO
.
getMemberId
());
memberUserLevelDetailsDO
.
setLevel
(
memberUserLevelConfigDO
.
getLevel
());
memberUserLevelDetailsDO
.
setSpecificSettings
(
memberUserLevelDetailsBackVO
.
getSpecificSettings
());
memberUserLevelDetailsDO
.
setValidityPeriod
(
memberUserLevelConfigDO
.
getValidityPeriod
());
memberUserLevelDetailsDO
.
setRemarks
(
memberUserLevelConfigDO
.
getDescription
());
memberUserLevelDetailsDO
.
setConfigId
(
memberUserLevelConfigDO
.
getId
());
memberUserLevelDetailsDO
.
setUpdater
(
String
.
valueOf
(
user
.
getId
()));
memberUserLevelDetailsService
.
updateById
(
memberUserLevelDetailsDO
);
//插入一条日志 升级日志
MemberUserLevelOperateLogDO
memberUserLevelOperateLogDo
=
MemberUserLevelOperateLogDO
.
builder
()
.
configId
(
memberUserLevelDetailsDO
.
getConfigId
())
.
configName
(
memberUserLevelConfigDO
.
getName
())
.
memberId
(
memberUserLevelDetailsDO
.
getMemberId
())
.
operator
(
user
.
getNickname
())
.
remarks
(
memberUserLevelDetailsDO
.
getRemarks
())
.
level
(
memberUserLevelConfigDO
.
getLevel
())
.
operateType
(
2
)
.
build
();
memberUserLevelOperateService
.
save
(
memberUserLevelOperateLogDo
);
}
}
}
}
return
false
;
...
...
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