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
7f77896b
Commit
7f77896b
authored
Jan 03, 2025
by
Smile
Committed by
wux
Jan 09, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员等级修改,1.定时任务从高等级往下匹配,2.可手动设置等级
parent
8fe46b79
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
28 deletions
+39
-28
MemberUserLevelDetailsController.java
.../admin/levelDetails/MemberUserLevelDetailsController.java
+19
-13
MemberUserController.java
...le/member/controller/admin/user/MemberUserController.java
+4
-4
userLevelDetailsTask.java
...iocoder/yudao/module/member/job/userLevelDetailsTask.java
+4
-3
MemberUserLevelDetailsBackVO.java
...ber/vo/userLevelDetails/MemberUserLevelDetailsBackVO.java
+2
-2
MemberUserLevelDetailsMapper.xml
...in/resources/mapper/user/MemberUserLevelDetailsMapper.xml
+5
-5
messages_en.properties
yudao-server/src/main/resources/i18n/messages_en.properties
+3
-1
messages_fr.properties
yudao-server/src/main/resources/i18n/messages_fr.properties
+2
-0
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/admin/levelDetails/MemberUserLevelDetailsController.java
View file @
7f77896b
...
...
@@ -50,28 +50,34 @@ public class MemberUserLevelDetailsController {
@ApiOperation
(
"更新等级详情"
)
public
CommonResult
<
Boolean
>
update
(
@Valid
@RequestBody
MemberUserLevelDetailsQueryVO
reqVO
)
{
Long
id
=
reqVO
.
getId
();
MemberUserLevelDetailsDO
memberUserLevelDetailsDO
=
memberUserLevelDetailsService
.
getById
(
id
);
if
(
memberUserLevelDetailsDO
==
null
)
{
return
error
(
ErrorCodeConstants
.
LEVEL_DETAILs_NOT_EXISTS
);
MemberUserLevelDetailsDO
memberUserLevelDetailsDO
;
if
(
reqVO
.
getId
()
!=
null
){
memberUserLevelDetailsDO
=
memberUserLevelDetailsService
.
getById
(
reqVO
.
getId
());
if
(
memberUserLevelDetailsDO
==
null
)
{
return
error
(
ErrorCodeConstants
.
LEVEL_DETAILs_NOT_EXISTS
);
}
}
else
{
memberUserLevelDetailsDO
=
new
MemberUserLevelDetailsDO
();
}
LambdaQueryWrapper
<
MemberUserLevelConfigDO
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
MemberUserLevelConfigDO:
:
getLevel
,
reqVO
.
getLevel
());
// 执行查询
MemberUserLevelConfigDO
configDO
=
memberUserLevelConfigMapper
.
selectOne
(
wrapper
);
if
(
configDO
==
null
){
return
error
(
ErrorCodeConstants
.
LEVEL_RULE_NOT_EXISTS
);
MemberUserLevelConfigDO
configDO
=
new
MemberUserLevelConfigDO
();
if
(
memberUserLevelDetailsDO
.
getConfigId
()!=
null
){
configDO
=
memberUserLevelConfigMapper
.
selectById
(
memberUserLevelDetailsDO
.
getConfigId
());
if
(
configDO
==
null
)
{
return
error
(
ErrorCodeConstants
.
LEVEL_RULE_NOT_EXISTS
);
}
if
(
configDO
.
getLevel
().
equals
(
reqVO
.
getLevel
())){
memberUserLevelDetailsDO
.
setConfigId
(
null
);
}
}
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
memberUserLevelDetailsDO
.
setLevel
(
reqVO
.
getLevel
());
memberUserLevelDetailsDO
.
setMemberId
(
reqVO
.
getMemberId
());
memberUserLevelDetailsDO
.
setValidityPeriod
(
reqVO
.
getValidityPeriod
());
memberUserLevelDetailsDO
.
setSpecificSettings
(
reqVO
.
getSpecificSettings
());
memberUserLevelDetailsDO
.
setRemarks
(
reqVO
.
getRemarks
());
memberUserLevelDetailsDO
.
setConfigId
(
configDO
.
getId
());
memberUserLevelDetailsDO
.
setUpdateTime
(
new
Date
());
memberUserLevelDetailsDO
.
setUpdater
(
String
.
valueOf
(
loginUser
.
getId
()));
memberUserLevelDetailsService
.
updateById
(
memberUserLevelDetailsDO
);
memberUserLevelDetailsService
.
saveOrUpdate
(
memberUserLevelDetailsDO
);
//添加操作日志
MemberUserLevelOperateLogDO
memberUserLevelOperateLogDo
=
MemberUserLevelOperateLogDO
.
builder
()
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/admin/user/MemberUserController.java
View file @
7f77896b
...
...
@@ -153,9 +153,9 @@ public class MemberUserController {
queryWrapper
.
eq
(
"member_id"
,
user
.
getId
());
MemberUserLevelDetailsDO
memberUserLevelDetailsDO
=
memberUserLevelDetailsMapper
.
selectOne
(
queryWrapper
);
MemberUserScoreLevelVO
scoreLevelVO
;
if
(
memberUserLevelDetailsDO
!=
null
)
{
if
(
memberUserLevelDetailsDO
!=
null
&&
memberUserLevelDetailsDO
.
getConfigId
()
!=
null
)
{
MemberUserLevelConfigDO
realLevel
=
memberUserLevelConfigService
.
getById
(
memberUserLevelDetailsDO
.
getConfigId
());
scoreLevelVO
=
MemberUserScoreLevelVO
.
builder
().
memberId
(
user
.
getId
())
scoreLevelVO
=
MemberUserScoreLevelVO
.
builder
().
memberId
(
user
.
getId
())
.
memberCode
(
user
.
getMemberCode
())
.
holdScore
(
user
.
getHoldScore
())
.
expiredScore
(
user
.
getExpiredScore
())
...
...
@@ -164,7 +164,7 @@ public class MemberUserController {
.
levelName
(
realLevel
.
getName
())
.
level
(
realLevel
.
getLevel
())
.
build
();
}
else
{
}
else
{
scoreLevelVO
=
MemberUserScoreLevelVO
.
builder
().
memberId
(
user
.
getId
())
.
memberCode
(
user
.
getMemberCode
())
.
holdScore
(
user
.
getHoldScore
())
...
...
@@ -172,7 +172,7 @@ public class MemberUserController {
.
usedScore
(
user
.
getUsedScore
())
.
levelIcon
(
null
)
.
levelName
(
null
)
.
level
(
null
)
.
level
(
memberUserLevelDetailsDO
!=
null
?
memberUserLevelDetailsDO
.
getLevel
():
null
)
.
build
();
}
// MemberUserLevelConfigBaseRespVO userScoreLevelVO = memberUserLevelConfigService.getLevelByCount(user.getTotalScore());
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/job/userLevelDetailsTask.java
View file @
7f77896b
...
...
@@ -26,6 +26,7 @@ import org.springframework.context.annotation.Lazy;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -67,7 +68,7 @@ public class userLevelDetailsTask implements JobHandler {
if
(
CollectionUtils
.
isEmpty
(
todoList
))
{
return
"success"
;
}
else
{
todoList
.
forEach
(
userLevelConfigDO
->
{
todoList
.
stream
().
sorted
(
Comparator
.
comparing
(
MemberUserLevelConfigDO:
:
getLevel
).
reversed
()).
forEach
(
userLevelConfigDO
->
{
log
.
info
(
"规则名称:{}"
,
userLevelConfigDO
.
getRuleNumber
());
MemberUserScoreLogQueryVO
memberUserScoreLogQueryVO
=
new
MemberUserScoreLogQueryVO
();
LambdaQuery
<
MemberUserScoreLogDO
>
memberUserScoreLogDoLambdaQuery
=
new
LambdaQuery
<>();
...
...
@@ -196,7 +197,7 @@ public class userLevelDetailsTask implements JobHandler {
memberUserLevelOperateService
.
save
(
memberUserLevelOperateLogDo
);
log
.
info
(
"客户等级小于当前等级,等级详情进入升级操作,规则id:{},用户id:{}"
,
memberUserLevelConfigDO
.
getRuleNumber
(),
memberId
);
return
true
;
}
else
if
(
memberUserLevelDetailsBackVO
.
getLevel
()==
memberUserLevelConfigDO
.
getLevel
()&&
!
memberUserLevelDetailsBackVO
.
getRuleNumber
().
equals
(
memberUserLevelConfigDO
.
getRuleNumber
())){
}
else
if
(
memberUserLevelDetailsBackVO
.
getLevel
()==
memberUserLevelConfigDO
.
getLevel
()&&
memberUserLevelDetailsBackVO
.
getConfigId
()!=
null
&&!
memberUserLevelDetailsBackVO
.
getConfigId
().
equals
(
memberUserLevelConfigDO
.
getId
())){
//级别相同比较sort顺序
MemberUserLevelConfigDO
memberUserLevelConfigOldDo
=
memberUserLevelConfigService
.
getById
(
memberUserLevelDetailsBackVO
.
getConfigId
());
if
(
memberUserLevelConfigOldDo
.
getSort
()>
memberUserLevelConfigDO
.
getSort
()){
...
...
@@ -288,7 +289,7 @@ public class userLevelDetailsTask implements JobHandler {
memberUserLevelOperateService
.
save
(
memberUserLevelOperateLogDo
);
log
.
info
(
"客户等级小于当前等级,等级详情进入升级操作,规则id:{},用户id:{}"
,
memberUserLevelConfigDO
.
getRuleNumber
(),
memberId
);
return
true
;
}
else
if
(
memberUserLevelDetailsBackVO
.
getLevel
()==
memberUserLevelConfigDO
.
getLevel
()&&
!
memberUserLevelDetailsBackVO
.
getRuleNumber
().
equals
(
memberUserLevelConfigDO
.
getRuleNumber
())){
}
else
if
(
memberUserLevelDetailsBackVO
.
getLevel
()==
memberUserLevelConfigDO
.
getLevel
()&&
memberUserLevelDetailsBackVO
.
getConfigId
()!=
null
&&!
memberUserLevelDetailsBackVO
.
getConfigId
().
equals
(
memberUserLevelConfigDO
.
getId
())){
//级别相同比较sort顺序
MemberUserLevelConfigDO
memberUserLevelConfigOldDo
=
memberUserLevelConfigService
.
getById
(
memberUserLevelDetailsBackVO
.
getConfigId
());
if
(
memberUserLevelConfigOldDo
.
getSort
()>
memberUserLevelConfigDO
.
getSort
()){
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/userLevelDetails/MemberUserLevelDetailsBackVO.java
View file @
7f77896b
...
...
@@ -23,8 +23,8 @@ public class MemberUserLevelDetailsBackVO {
@ApiModelProperty
(
value
=
"会员等级配置id"
)
private
Long
configId
;
@ApiModelProperty
(
value
=
"会员
等级配置
编号"
)
private
String
ruleNumber
;
@ApiModelProperty
(
value
=
"会员编号"
)
private
String
memberCode
;
@ApiModelProperty
(
value
=
"会员id"
)
private
Long
memberId
;
...
...
yudao-module-member/yudao-module-member-impl/src/main/resources/mapper/user/MemberUserLevelDetailsMapper.xml
View file @
7f77896b
...
...
@@ -7,7 +7,7 @@
SELECT
muld.id as id,
muld.config_id as configId,
mu
lc.rule_number as ruleNumber
,
mu
.code as memberCode
,
muld.member_id as memberId,
muld.updater as updater,
muld.remarks as remarks,
...
...
@@ -17,8 +17,8 @@
muld.validity_period as validityPeriod,
muld.specific_settings as specificSettings
FROM member_user_level_details muld
left join member_user
_level_config mulc
on muld.
config_id =mulc
.id
left join member_user
mu
on muld.
member_id =mu
.id
where 1=1
and muld.member_id = #{query.memberId}
order by muld.create_time desc
...
...
@@ -27,8 +27,8 @@
<select
id=
"getPageCount"
resultType=
"java.lang.Integer"
>
select count(*)
FROM member_user_level_details muld
left join member_user
_level_config mulc
on muld.
config_id =mulc
.id
left join member_user
mu
on muld.
member_id =mu
.id
where 1=1
and muld.member_id = #{query.memberId}
</select>
...
...
yudao-server/src/main/resources/i18n/messages_en.properties
View file @
7f77896b
...
...
@@ -1058,7 +1058,9 @@ currency.not.exist = currency not exist
date.format.error
=
date format error, for example : 2024-01-01 12:11:11
redeem.cancel.status.error
=
record status must be redeeming
level.bound.range.error
=
upper count must greater than lower count
level.bound.range.conflict
=
score range exist conflict
level.bound.range.conflict
=
score range exist conflict'
level.rule.not.exists
=
Membership level rule does not exist
level.details.not.exists
=
Membership level details do not exist
score.operate.idempotent.error
=
idempotent key conflict
score.rule.not.exists
=
score rule not exists
...
...
yudao-server/src/main/resources/i18n/messages_fr.properties
View file @
7f77896b
...
...
@@ -1057,6 +1057,8 @@ date.format.error=Format de date incorrect, format correct : 2024-01-01 12:11:11
redeem.cancel.status.error
=
Seules les enregistrements avec un statut "en
\u
00E9change" peuvent
\u
00EAtre annul
\u
00E9s
level.bound.range.error
=
La valeur sup
\u
00E9rieure doit
\u
00EAtre sup
\u
00E9rieure
\u
00E0 la valeur inf
\u
00E9rieure
level.bound.range.conflict
=
Conflit dans la plage des points de fid
\u
00E9lit
\u
00E9
level.rule.not.exists
=
La r
\u
00E8gle du niveau de membre n'existe pas
level.details.not.exists
=
Les d
\u
00E9tails du niveau de membre n'existent pas
score.operate.idempotent.error
=
Conflit de cl
\u
00E9 idempotente
score.rule.not.exists
=
La r
\u
00E8gle de points n'existe pas
...
...
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