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
3425faaf
Commit
3425faaf
authored
Jul 24, 2024
by
zhaobiyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员积分总览接口
parent
bdfc06c2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
105 additions
and
13 deletions
+105
-13
MemberUserScoreController.java
...ller/admin/memberUserScore/MemberUserScoreController.java
+4
-6
MemberUserScoreMapper.java
...mber/dal/mysql/memberUserScore/MemberUserScoreMapper.java
+8
-0
MemberUserScoreServiceImpl.java
...r/service/memberUserScore/MemberUserScoreServiceImpl.java
+11
-2
MemberUserScoreBackVO.java
...dule/member/vo/memberUserScore/MemberUserScoreBackVO.java
+7
-3
MemberUserScoreQueryVO.java
...ule/member/vo/memberUserScore/MemberUserScoreQueryVO.java
+3
-2
MemberUserScoreMapper.xml
.../src/main/resources/mapper/user/MemberUserScoreMapper.xml
+72
-0
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/
api
/memberUserScore/MemberUserScoreController.java
→
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/
controller/admin
/memberUserScore/MemberUserScoreController.java
View file @
3425faaf
package
cn
.
iocoder
.
yudao
.
module
.
member
.
api
.
memberUserScore
;
package
cn
.
iocoder
.
yudao
.
module
.
member
.
controller
.
admin
.
memberUserScore
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
...
...
@@ -12,9 +12,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
...
...
@@ -30,10 +28,10 @@ public class MemberUserScoreController {
@Resource
private
MemberUserScoreService
userScoreService
;
@
Ge
tMapping
(
"/page"
)
@
Pos
tMapping
(
"/page"
)
@ApiOperation
(
"获得会员积分分页"
)
@PreAuthorize
(
"@ss.hasPermission('member:user-score:query')"
)
public
CommonResult
<
PageResult
<
MemberUserScoreBackVO
>>
getUserScorePage
(
@Valid
MemberUserScoreQueryVO
query
,
PageVO
page
)
{
public
CommonResult
<
PageResult
<
MemberUserScoreBackVO
>>
getUserScorePage
(
@Valid
@RequestBody
MemberUserScoreQueryVO
query
,
PageVO
page
)
{
PageResult
<
MemberUserScoreBackVO
>
pageResult
=
userScoreService
.
getUserScorePage
(
query
,
page
);
return
success
(
pageResult
);
}
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/memberUserScore/MemberUserScoreMapper.java
View file @
3425faaf
...
...
@@ -2,7 +2,12 @@ package cn.iocoder.yudao.module.member.dal.mysql.memberUserScore;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper
;
import
cn.iocoder.yudao.module.member.dal.dataobject.memberUserScore.MemberUserScoreDO
;
import
cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreBackVO
;
import
cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreQueryVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 会员积分 Mapper
...
...
@@ -11,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
MemberUserScoreMapper
extends
AbstractMapper
<
MemberUserScoreDO
>
{
List
<
MemberUserScoreBackVO
>
getUserScoreList
(
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
,
@Param
(
"query"
)
MemberUserScoreQueryVO
query
);
int
countUserScore
(
@Param
(
"query"
)
MemberUserScoreQueryVO
query
);
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/memberUserScore/MemberUserScoreServiceImpl.java
View file @
3425faaf
...
...
@@ -2,11 +2,13 @@ package cn.iocoder.yudao.module.member.service.memberUserScore;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.member.dal.dataobject.memberUserScore.MemberUserScoreDO
;
import
cn.iocoder.yudao.module.member.dal.mysql.memberUserScore.MemberUserScoreMapper
;
import
cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreBackVO
;
import
cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreQueryVO
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -44,8 +46,15 @@ public class MemberUserScoreServiceImpl extends AbstractService<MemberUserScoreM
@Override
public
PageResult
<
MemberUserScoreBackVO
>
getUserScorePage
(
MemberUserScoreQueryVO
query
,
PageVO
page
)
{
PageResult
<
MemberUserScoreBackVO
>
pageResult
=
new
PageResult
<>();
return
pageResult
;
IPage
<
MemberUserScoreBackVO
>
mpPage
=
MyBatisUtils
.
buildPage
(
page
);
page
.
setPage
(
query
.
getPageNo
());
page
.
setRows
(
query
.
getPageSize
());
int
start
=
(
page
.
getPage
()
-
1
)
*
page
.
getRows
();
int
size
=
page
.
getRows
();
List
<
MemberUserScoreBackVO
>
list
=
userScoreMapper
.
getUserScoreList
(
start
,
size
,
query
);
int
total
=
userScoreMapper
.
countUserScore
(
query
);
return
new
PageResult
<>(
list
,
total
,
mpPage
.
getSize
(),
page
.
getPage
(),
(
total
+
mpPage
.
getSize
()
-
1
)
/
mpPage
.
getSize
());
}
@Override
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/memberUserScore/MemberUserScoreBackVO.java
View file @
3425faaf
...
...
@@ -17,9 +17,13 @@ public class MemberUserScoreBackVO {
@ApiModelProperty
(
value
=
"会员昵称"
)
private
String
nickname
;
@ApiModelProperty
(
value
=
"联系方式"
)
private
String
areaCodeMobile
;
@ApiModelProperty
(
value
=
"国家"
)
private
String
countryName
;
private
String
areaCode
;
@ApiModelProperty
(
value
=
"手机号"
)
private
String
mobile
;
@ApiModelProperty
(
value
=
"国家(中文)"
)
private
String
countryNameZh
;
@ApiModelProperty
(
value
=
"国家(英文)"
)
private
String
countryNameEn
;
@ApiModelProperty
(
value
=
"当前积分"
)
private
Integer
holdScore
;
@ApiModelProperty
(
value
=
"已兑换积分"
)
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/memberUserScore/MemberUserScoreQueryVO.java
View file @
3425faaf
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
memberUserScore
;
import
cn.iocoder.yudao.framework.common.pojo.PageParam
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -14,11 +15,11 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
*/
@Data
@ApiModel
(
"管理后台 - 会员积分查询 VO"
)
public
class
MemberUserScoreQueryVO
{
public
class
MemberUserScoreQueryVO
extends
PageParam
{
@ApiModelProperty
(
value
=
"关键词"
)
private
String
key
;
@ApiModelProperty
(
value
=
"国家"
)
private
String
country
;
private
Integer
country
;
@ApiModelProperty
(
value
=
"当前积分"
)
private
Integer
holdScore
;
@ApiModelProperty
(
value
=
"当前积分操作"
)
...
...
yudao-module-member/yudao-module-member-impl/src/main/resources/mapper/user/MemberUserScoreMapper.xml
0 → 100644
View file @
3425faaf
<?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.memberUserScore.MemberUserScoreMapper"
>
<select
id=
"getUserScoreList"
resultType=
"cn.iocoder.yudao.module.member.vo.memberUserScore.MemberUserScoreBackVO"
>
select
mu.id,
mu.nickname,
mu.area_code as areaCode,
mu.mobile,
re.title_zh as countryNameZh,
re.title_en as countryNameEn,
mus.hold_score as holdScore,
mus.used_score as usedScore,
mu.create_time as createTime
from member_user mu
left join member_user_score mus on mus.member_id = mu.id
left join ecw_region re on re.id = mu.country
where 1 = 1
<include
refid=
"scoreCondition"
/>
order by mu.id
limit #{start}, #{size}
</select>
<select
id=
"countUserScore"
resultType=
"java.lang.Integer"
>
select
count(*)
from member_user mu
left join member_user_score mus on mus.member_id = mu.id
left join ecw_region re on re.id = mu.country
where 1 = 1
<include
refid=
"scoreCondition"
/>
</select>
<sql
id=
"scoreCondition"
>
<if
test=
"query.key != null and query.key != ''"
>
and (mu.nickname like '%${query.key}%' or mu.mobile like '%${query.key}%')
</if>
<if
test=
"query.country != null"
>
and mu.country = #{query.country}
</if>
<if
test=
"query.memberCreateTimeStart != null "
>
and mu.create_time
>
= #{query.memberCreateTimeStart}
</if>
<if
test=
"query.memberCreateTimeStart != null "
>
and mu.create_time
<
= #{query.memberCreateTimeEnd}
</if>
<if
test=
"query.usedScore != null and query.usedScoreOperate != null"
>
<!--1:大于 2:等于 3:小于-->
<if
test=
"query.usedScoreOperate == 1"
>
and mus.used_score
>
#{query.usedScore}
</if>
<if
test=
"query.usedScoreOperate == 2"
>
and mus.used_score = #{query.usedScore}
</if>
<if
test=
"query.usedScoreOperate == 3"
>
and mus.used_score
<
#{query.usedScore}
</if>
</if>
<if
test=
"query.holdScore != null and query.holdScoreOperate != null"
>
<!--1:大于 2:等于 3:小于-->
<if
test=
"query.holdScoreOperate == 1"
>
and mus.hold_score
>
#{query.holdScore}
</if>
<if
test=
"query.holdScoreOperate == 2"
>
and mus.hold_score = #{query.holdScore}
</if>
<if
test=
"query.holdScoreOperate == 3"
>
and mus.hold_score
<
#{query.holdScore}
</if>
</if>
</sql>
</mapper>
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