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
c5bdf2c1
Commit
c5bdf2c1
authored
Dec 27, 2024
by
Smile
Committed by
wux
Dec 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员等级详情及会员定时任务
parent
97cd4723
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
499 additions
and
0 deletions
+499
-0
ErrorCodeConstants.java
...iocoder/yudao/module/member/enums/ErrorCodeConstants.java
+1
-0
MemberUserLevelDetailsController.java
.../admin/levelDetails/MemberUserLevelDetailsController.java
+89
-0
MemberUserLevelDetailsDO.java
...bject/memberUserLevelDetail/MemberUserLevelDetailsDO.java
+37
-0
MemberUserLevelDetailsMapper.java
.../mysql/userLevelDetails/MemberUserLevelDetailsMapper.java
+22
-0
UserLevelConfigExpireTask.java
...er/yudao/module/member/job/UserLevelConfigExpireTask.java
+53
-0
userLevelDetailsTask.java
...iocoder/yudao/module/member/job/userLevelDetailsTask.java
+67
-0
MemberUserLevelDetailsService.java
...r/service/levelDetails/MemberUserLevelDetailsService.java
+21
-0
MemberUserLevelDetailsServiceImpl.java
...rvice/levelDetails/MemberUserLevelDetailsServiceImpl.java
+53
-0
MemberUserScoreLevelVO.java
...ao/module/member/vo/userLevel/MemberUserScoreLevelVO.java
+2
-0
MemberUserLevelDetailsBackVO.java
...ber/vo/userLevelDetails/MemberUserLevelDetailsBackVO.java
+54
-0
MemberUserLevelDetailsCreateReq.java
.../vo/userLevelDetails/MemberUserLevelDetailsCreateReq.java
+30
-0
MemberUserLevelDetailsQueryVO.java
...er/vo/userLevelDetails/MemberUserLevelDetailsQueryVO.java
+35
-0
MemberUserLevelDetailsMapper.xml
...in/resources/mapper/user/MemberUserLevelDetailsMapper.xml
+34
-0
messages_zh.properties
yudao-server/src/main/resources/i18n/messages_zh.properties
+1
-0
No files found.
yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java
View file @
c5bdf2c1
...
...
@@ -72,4 +72,5 @@ public interface ErrorCodeConstants {
ErrorCode
USER_ADDRESS_FIELD_ERROR
=
new
ErrorCode
(
1004008027
,
"user.address.field.error"
);
ErrorCode
SCORE_RULE_CUSTOMERSIDE_ERROR
=
new
ErrorCode
(
1004008028
,
"score.rule.customer.side.error"
);
ErrorCode
LEVEL_RULE_NOT_EXISTS
=
new
ErrorCode
(
1004008028
,
"level.rule.not.exists"
);
ErrorCode
LEVEL_DETAILs_NOT_EXISTS
=
new
ErrorCode
(
1004008028
,
"level.details.not.exists"
);
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/admin/levelDetails/MemberUserLevelDetailsController.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
controller
.
admin
.
levelDetails
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.security.core.LoginUser
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.module.member.dal.dataobject.level.MemberUserLevelConfigDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.levelOperatLog.MemberUserLevelOperateLogDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.memberUserLevelDetail.MemberUserLevelDetailsDO
;
import
cn.iocoder.yudao.module.member.dal.mysql.memberUserLevel.MemberUserLevelConfigMapper
;
import
cn.iocoder.yudao.module.member.enums.ErrorCodeConstants
;
import
cn.iocoder.yudao.module.member.service.levelDetails.MemberUserLevelDetailsService
;
import
cn.iocoder.yudao.module.member.service.levelOperateLog.MemberUserLevelOperateLogService
;
import
cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsBackVO
;
import
cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsQueryVO
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
java.util.Date
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
error
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
@Validated
@RestController
@Api
(
tags
=
"管理后台 - 会员等级详情记录"
)
@RequestMapping
(
"/member/level-details"
)
public
class
MemberUserLevelDetailsController
{
@Resource
private
MemberUserLevelDetailsService
memberUserLevelDetailsService
;
@Resource
private
MemberUserLevelOperateLogService
memberUserLevelOperateLogService
;
@Resource
private
MemberUserLevelConfigMapper
memberUserLevelConfigMapper
;
@PostMapping
(
"/page"
)
@ApiOperation
(
"获得等级详情分页"
)
//@PreAuthorize("@ss.hasPermission('member:user-level-log:query')")
public
CommonResult
<
PageResult
<
MemberUserLevelDetailsBackVO
>>
page
(
@Valid
@RequestBody
MemberUserLevelDetailsQueryVO
query
)
{
PageResult
<
MemberUserLevelDetailsBackVO
>
pageResult
=
memberUserLevelDetailsService
.
getPage
(
query
);
return
success
(
pageResult
);
}
@PutMapping
(
"/update"
)
@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
);
}
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
);
}
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
memberUserLevelDetailsDO
.
setLevel
(
reqVO
.
getLevel
());
memberUserLevelDetailsDO
.
setValidityPeriod
(
configDO
.
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
);
//添加操作日志
MemberUserLevelOperateLogDO
memberUserLevelOperateLogDo
=
MemberUserLevelOperateLogDO
.
builder
()
.
configId
(
memberUserLevelDetailsDO
.
getConfigId
())
.
configName
(
configDO
.
getName
())
.
memberId
(
memberUserLevelDetailsDO
.
getMemberId
())
.
operator
(
loginUser
.
getNickname
())
.
remarks
(
memberUserLevelDetailsDO
.
getRemarks
())
.
level
(
memberUserLevelDetailsDO
.
getLevel
())
.
operateType
(
3
)
.
build
();
memberUserLevelOperateLogService
.
save
(
memberUserLevelOperateLogDo
);
return
success
(
true
);
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/memberUserLevelDetail/MemberUserLevelDetailsDO.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
dataobject
.
memberUserLevelDetail
;
import
cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.*
;
/**
* @author Smile
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName
(
"member_user_level_details"
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
public
class
MemberUserLevelDetailsDO
extends
BaseDO
{
/**
* 主键
*/
@TableId
private
Long
id
;
private
Long
configId
;
private
Long
memberId
;
private
Integer
level
;
private
Integer
validityPeriod
;
private
Boolean
specificSettings
;
private
String
remarks
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/userLevelDetails/MemberUserLevelDetailsMapper.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
dal
.
mysql
.
userLevelDetails
;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper
;
import
cn.iocoder.yudao.module.member.dal.dataobject.memberUserLevelDetail.MemberUserLevelDetailsDO
;
import
cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsBackVO
;
import
cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsQueryVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 会员等级详情 Mapper
* @author Smile
*/
@Mapper
public
interface
MemberUserLevelDetailsMapper
extends
AbstractMapper
<
MemberUserLevelDetailsDO
>
{
List
<
MemberUserLevelDetailsBackVO
>
getPageDetailsList
(
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
,
@Param
(
"query"
)
MemberUserLevelDetailsQueryVO
query
);
int
getPageCount
(
@Param
(
"query"
)
MemberUserLevelDetailsQueryVO
query
);
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/job/UserLevelConfigExpireTask.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
job
;
import
cn.iocoder.yudao.framework.common.util.date.DateUtils
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.quartz.core.handler.JobHandler
;
import
cn.iocoder.yudao.module.member.dal.dataobject.level.MemberUserLevelConfigDO
;
import
cn.iocoder.yudao.module.member.enums.MemberLevelStatusEnum
;
import
cn.iocoder.yudao.module.member.service.level.MemberUserLevelConfigService
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
/**
* 会员等级规则过期定时任务
* @author Smile
*/
@Component
@Slf4j
public
class
UserLevelConfigExpireTask
implements
JobHandler
{
/**
* 会员等级规则的过期时间为每日的0点整
* 任务每天0点整运行,扫描当天0点过期的积分进行状态修改
* @param param 参数
* @return
* @throws Exception
*/
@Resource
private
MemberUserLevelConfigService
memberUserLevelConfigService
;
@Override
public
String
execute
(
String
param
)
throws
Exception
{
log
.
info
(
"level config expire task running"
);
LambdaQuery
<
MemberUserLevelConfigDO
>
userLevelConfigDOLambdaQuery
=
new
LambdaQuery
<>();
userLevelConfigDOLambdaQuery
.
eq
(
MemberUserLevelConfigDO:
:
getStatus
,
MemberLevelStatusEnum
.
ENABLED
.
getValue
());
userLevelConfigDOLambdaQuery
.
le
(
MemberUserLevelConfigDO:
:
getEndTime
,
DateUtils
.
getNextNDayStart
(
new
Date
(),
0
));
List
<
MemberUserLevelConfigDO
>
todoList
=
memberUserLevelConfigService
.
selectList
(
userLevelConfigDOLambdaQuery
);
log
.
info
(
"level config expire task, to expire rule count :{}"
,
todoList
.
size
());
if
(
CollectionUtils
.
isEmpty
(
todoList
))
{
return
"success"
;
}
else
{
todoList
.
forEach
(
userLevelConfigDO
->
{
userLevelConfigDO
.
setStatus
(
MemberLevelStatusEnum
.
EXPIRED
.
getValue
());
memberUserLevelConfigService
.
updateById
(
userLevelConfigDO
);
});
}
return
"success"
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/job/userLevelDetailsTask.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
job
;
import
cn.iocoder.yudao.framework.common.util.date.DateUtils
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.quartz.core.handler.JobHandler
;
import
cn.iocoder.yudao.module.member.dal.dataobject.level.MemberUserLevelConfigDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.score.MemberUserScoreDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.scoreLog.MemberUserScoreLogDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO
;
import
cn.iocoder.yudao.module.member.dal.redis.scoreRule.ScoreRuleRedisDao
;
import
cn.iocoder.yudao.module.member.enums.MemberLevelStatusEnum
;
import
cn.iocoder.yudao.module.member.enums.ScoreRuleStatusEnum
;
import
cn.iocoder.yudao.module.member.service.level.MemberUserLevelConfigService
;
import
cn.iocoder.yudao.module.member.service.score.MemberUserScoreService
;
import
cn.iocoder.yudao.module.member.service.scoreLog.MemberUserScoreLogService
;
import
cn.iocoder.yudao.module.member.service.scoreRule.ScoreRuleService
;
import
cn.iocoder.yudao.module.member.service.user.MemberUserService
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
/**
* 会员等级详情定时任务
*/
@Component
@Slf4j
public
class
userLevelDetailsTask
implements
JobHandler
{
/**
* 每天凌晨00:00AM和12:00AM 分别执行一次
* @param param 参数
* @return
* @throws Exception
*/
@Resource
private
MemberUserLevelConfigService
memberUserLevelConfigService
;
@Resource
private
MemberUserService
userService
;
@Resource
private
MemberUserScoreLogService
memberUserScoreLogService
;
@Override
public
String
execute
(
String
param
)
throws
Exception
{
log
.
info
(
"level config expire task running"
);
LambdaQuery
<
MemberUserLevelConfigDO
>
userLevelConfigDoLambdaQuery
=
new
LambdaQuery
<>();
userLevelConfigDoLambdaQuery
.
eq
(
MemberUserLevelConfigDO:
:
getStatus
,
MemberLevelStatusEnum
.
ENABLED
.
getValue
());
List
<
MemberUserLevelConfigDO
>
todoList
=
memberUserLevelConfigService
.
selectList
(
userLevelConfigDoLambdaQuery
);
log
.
info
(
"level config expire task, to expire rule count :{}"
,
todoList
.
size
());
if
(
CollectionUtils
.
isEmpty
(
todoList
))
{
return
"success"
;
}
else
{
todoList
.
forEach
(
userLevelConfigDO
->
{
LambdaQuery
<
MemberUserScoreLogDO
>
memberUserScoreLogDoLambdaQuery
=
new
LambdaQuery
<>();
//获取满足条件的所有用户
if
(
userLevelConfigDO
.
getStartDate
()!=
null
){
memberUserScoreLogDoLambdaQuery
.
ge
(
MemberUserScoreLogDO:
:
getCreateTime
,
userLevelConfigDO
.
getStartDate
());
}
else
{
memberUserScoreLogDoLambdaQuery
.
ge
(
MemberUserScoreLogDO:
:
getCreateTime
,
DateUtils
.
getNextNDayStart
(
new
Date
(),
-(
userLevelConfigDO
.
getAccumulationPeriod
())));
}
});
}
return
"success"
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/levelDetails/MemberUserLevelDetailsService.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
service
.
levelDetails
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.service.IService
;
import
cn.iocoder.yudao.module.member.dal.dataobject.memberUserLevelDetail.MemberUserLevelDetailsDO
;
import
cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsBackVO
;
import
cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsQueryVO
;
import
javax.validation.Valid
;
/**
* 会员等级详情 Service 接口
*
* @author Smile
*/
public
interface
MemberUserLevelDetailsService
extends
IService
<
MemberUserLevelDetailsDO
>
{
PageResult
<
MemberUserLevelDetailsBackVO
>
getPage
(
MemberUserLevelDetailsQueryVO
query
);
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/levelDetails/MemberUserLevelDetailsServiceImpl.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
service
.
levelDetails
;
import
cn.hutool.core.lang.generator.SnowflakeGenerator
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.module.member.dal.dataobject.level.MemberUserLevelConfigDO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.memberUserLevelDetail.MemberUserLevelDetailsDO
;
import
cn.iocoder.yudao.module.member.dal.mysql.memberUserLevel.MemberUserLevelConfigMapper
;
import
cn.iocoder.yudao.module.member.dal.mysql.userLevelDetails.MemberUserLevelDetailsMapper
;
import
cn.iocoder.yudao.module.member.enums.ErrorCodeConstants
;
import
cn.iocoder.yudao.module.member.service.level.MemberUserLevelConfigService
;
import
cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsBackVO
;
import
cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsQueryVO
;
import
cn.iocoder.yudao.module.system.api.user.AdminUserApi
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
error
;
/**
* 会员等级详情 Service 实现类
*
* @author Smile
*/
@Service
@Validated
public
class
MemberUserLevelDetailsServiceImpl
extends
AbstractService
<
MemberUserLevelDetailsMapper
,
MemberUserLevelDetailsDO
>
implements
MemberUserLevelDetailsService
{
@Resource
private
MemberUserLevelDetailsMapper
userLevelDetailsMapper
;
@Resource
private
AdminUserApi
adminUserApi
;
@Override
public
PageResult
<
MemberUserLevelDetailsBackVO
>
getPage
(
MemberUserLevelDetailsQueryVO
query
)
{
int
start
=
(
query
.
getPageNo
()
-
1
)
*
query
.
getPageSize
();
int
size
=
query
.
getPageSize
();
List
<
MemberUserLevelDetailsBackVO
>
list
=
userLevelDetailsMapper
.
getPageDetailsList
(
start
,
size
,
query
);
list
.
stream
().
forEach
(
item
->
{
item
.
setUpdaterName
(
adminUserApi
.
getUser
(
Long
.
valueOf
(
item
.
getUpdater
())).
getNickname
());
}
);
int
total
=
userLevelDetailsMapper
.
getPageCount
(
query
);
return
new
PageResult
<>(
list
,
total
,
query
.
getPageSize
(),
query
.
getPageNo
(),
(
total
+
query
.
getPageSize
()
-
1
)
/
query
.
getPageSize
());
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/userLevel/MemberUserScoreLevelVO.java
View file @
c5bdf2c1
...
...
@@ -25,6 +25,8 @@ public class MemberUserScoreLevelVO {
private
Integer
expiredScore
;
@ApiModelProperty
(
value
=
"会员等级名称"
)
private
String
levelName
;
@ApiModelProperty
(
value
=
"会员等级"
)
private
Integer
level
;
@ApiModelProperty
(
value
=
"会员等级图标"
)
private
String
levelIcon
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/userLevelDetails/MemberUserLevelDetailsBackVO.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
userLevelDetails
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
/**
* @author Smile
*/
@Data
@ApiModel
(
"管理后台 - 会员等级详情 VO"
)
public
class
MemberUserLevelDetailsBackVO
{
@ApiModelProperty
(
value
=
"详情id"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
id
;
@ApiModelProperty
(
value
=
"会员等级配置id"
)
private
Long
configId
;
@ApiModelProperty
(
value
=
"会员等级配置编号"
)
private
String
ruleNumber
;
@ApiModelProperty
(
value
=
"会员id"
)
private
Long
memberId
;
@ApiModelProperty
(
value
=
"等级"
)
private
Integer
level
;
@ApiModelProperty
(
value
=
"等级有效期"
)
private
Integer
validityPeriod
;
@ApiModelProperty
(
value
=
"等级特殊设置"
)
private
Boolean
specificSettings
;
@ApiModelProperty
(
value
=
"更新原因"
)
private
String
remarks
;
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@ApiModelProperty
(
value
=
"最后更新时间"
,
required
=
true
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"最后更新人"
)
private
String
updater
;
@ApiModelProperty
(
value
=
"最后更新人名称"
)
private
String
updaterName
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/userLevelDetails/MemberUserLevelDetailsCreateReq.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
userLevelDetails
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Builder
;
import
lombok.Data
;
/**
* @author Smile
*/
@Data
@Builder
public
class
MemberUserLevelDetailsCreateReq
{
@ApiModelProperty
(
value
=
"会员等级配置id"
)
private
Long
configId
;
@ApiModelProperty
(
value
=
"会员id"
)
private
Long
memberId
;
@ApiModelProperty
(
value
=
"等级"
)
private
Integer
level
;
@ApiModelProperty
(
value
=
"等级有效期"
)
private
Integer
validityPeriod
;
@ApiModelProperty
(
value
=
"等级特殊设置"
)
private
Boolean
specificSettings
;
@ApiModelProperty
(
value
=
"更新原因"
)
private
String
remarks
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/userLevelDetails/MemberUserLevelDetailsQueryVO.java
0 → 100644
View file @
c5bdf2c1
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
userLevelDetails
;
import
cn.iocoder.yudao.framework.common.pojo.PageParam
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author Smile
*/
@Data
@ApiModel
(
"管理后台 - 会员等级详情查询 VO"
)
public
class
MemberUserLevelDetailsQueryVO
extends
PageParam
{
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"会员id"
)
private
Long
memberId
;
@ApiModelProperty
(
value
=
"会员等级配置id"
)
private
Long
configId
;
@ApiModelProperty
(
value
=
"会员等级配置编号"
)
private
String
ruleNumber
;
@ApiModelProperty
(
value
=
"等级"
)
private
Integer
level
;
@ApiModelProperty
(
value
=
"等级有效期"
)
private
Integer
validityPeriod
;
@ApiModelProperty
(
value
=
"等级特殊设置"
)
private
Boolean
specificSettings
;
@ApiModelProperty
(
value
=
"更新原因"
)
private
String
remarks
;
}
yudao-module-member/yudao-module-member-impl/src/main/resources/mapper/user/MemberUserLevelDetailsMapper.xml
0 → 100644
View file @
c5bdf2c1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.iocoder.yudao.module.member.dal.mysql.userLevelDetails.MemberUserLevelDetailsMapper"
>
<select
id=
"getPageDetailsList"
resultType=
"cn.iocoder.yudao.module.member.vo.userLevelDetails.MemberUserLevelDetailsBackVO"
>
SELECT
muld.id as id,
muld.config_id as configId,
mulc.rule_number as ruleNumber ,
muld.member_id as memberId,
muld.updater as updater,
muld.remarks as remarks,
muld.update_time as updateTime ,
muld.`level` as level,
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
where 1=1
and muld.member_id = #{query.memberId}
order by muld.create_time desc
limit #{start}, #{size}
</select>
<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
where 1=1
and muld.member_id = #{query.memberId}
</select>
</mapper>
yudao-server/src/main/resources/i18n/messages_zh.properties
View file @
c5bdf2c1
...
...
@@ -1060,6 +1060,7 @@ redeem.cancel.status.error = \u5151\u6362\u4E2D\u72B6\u6001\u7684\u8BB0\u5F55\u6
level.bound.range.error
=
\u
4E0A
\u
754C
\u6570\u
503C
\u
5FC5
\u
987B
\u5927\u
4E8E
\u
4E0B
\u
754C
\u6570\u
503C
level.bound.range.conflict
=
\u
79EF
\u5206\u8303\u
56F4
\u
5B58
\u5728\u
51B2
\u
7A81
level.rule.not.exists
=
\u
4F1A
\u5458\u
7B49
\u
7EA7
\u
89C4
\u5219\u
4E0D
\u
5B58
\u5728
level.details.not.exists
=
\u
4F1A
\u5458\u
7B49
\u
7EA7
\u
8BE6
\u
60C5
\u
4E0D
\u
5B58
\u5728
score.operate.idempotent.error
=
\u
5E42
\u
7B49key
\u
51B2
\u
7A81
score.rule.not.exists
=
\u
79EF
\u5206\u
89C4
\u5219\u
4E0D
\u
5B58
\u5728
...
...
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