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
1a4865c1
Commit
1a4865c1
authored
Aug 12, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/feature_member_score' into dev
parents
8783a621
3d4559a6
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
79 additions
and
36 deletions
+79
-36
AppMemberUserScoreInfoRespVO.java
...roller/app/userScore/vo/AppMemberUserScoreInfoRespVO.java
+4
-0
MemberUserScoreServiceImpl.java
...dule/member/service/score/MemberUserScoreServiceImpl.java
+2
-0
ErrorCodeConstants.java
...iocoder/yudao/module/reward/enums/ErrorCodeConstants.java
+1
-0
RewardController.java
...dule/reward/controller/admin/reward/RewardController.java
+1
-1
RewardDO.java
...r/yudao/module/reward/dal/dataobject/reward/RewardDO.java
+1
-1
RewardService.java
...der/yudao/module/reward/service/reward/RewardService.java
+1
-1
RewardServiceImpl.java
...yudao/module/reward/service/reward/RewardServiceImpl.java
+46
-24
RewardBackVO.java
...n/iocoder/yudao/module/reward/vo/reward/RewardBackVO.java
+1
-1
RewardCreateReqVO.java
...oder/yudao/module/reward/vo/reward/RewardCreateReqVO.java
+19
-7
RewardUpdateReqVO.java
...oder/yudao/module/reward/vo/reward/RewardUpdateReqVO.java
+1
-1
messages_en.properties
yudao-server/src/main/resources/i18n/messages_en.properties
+1
-0
messages_zh.properties
yudao-server/src/main/resources/i18n/messages_zh.properties
+1
-0
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/app/userScore/vo/AppMemberUserScoreInfoRespVO.java
View file @
1a4865c1
...
...
@@ -23,4 +23,8 @@ public class AppMemberUserScoreInfoRespVO {
private
Integer
totalScore
;
@ApiModelProperty
(
value
=
"会员等级名称"
)
private
String
levelName
;
@ApiModelProperty
(
value
=
"积分范围 下界"
)
private
Integer
lowerCount
;
@ApiModelProperty
(
value
=
"积分范围 上界"
)
private
Integer
upperCount
;
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/score/MemberUserScoreServiceImpl.java
View file @
1a4865c1
...
...
@@ -125,6 +125,8 @@ public class MemberUserScoreServiceImpl extends AbstractService<MemberUserScoreM
MemberUserLevelConfigBaseRespVO
level
=
memberUserLevelConfigService
.
getLevelByCount
(
userScoreTotal
);
if
(
level
!=
null
)
{
infoRespVO
.
setLevelName
(
level
.
getName
());
infoRespVO
.
setLowerCount
(
level
.
getLowerCount
());
infoRespVO
.
setUpperCount
(
level
.
getUpperCount
());
}
return
infoRespVO
;
}
...
...
yudao-module-reward/yudao-module-reward-api/src/main/java/cn/iocoder/yudao/module/reward/enums/ErrorCodeConstants.java
View file @
1a4865c1
...
...
@@ -28,5 +28,6 @@ public interface ErrorCodeConstants {
ErrorCode
REWARD_REDEEM_VERIFY_BACK_STATUS
=
new
ErrorCode
(
1001011022
,
"reward.redeem.verify.back.status"
);
ErrorCode
REDEEM_IMPORT_MAX_COUNT
=
new
ErrorCode
(
1001011023
,
"redeem.import.max.count"
);
ErrorCode
REDEEM_CANCEL_STATUS_ERROR
=
new
ErrorCode
(
1001011024
,
"redeem.cancel.status.error"
);
ErrorCode
REWARD_NODE_AND_POINTS_LIST_ERROR
=
new
ErrorCode
(
1001011025
,
"reward.node.and.points.list.error"
);
}
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/controller/admin/reward/RewardController.java
View file @
1a4865c1
...
...
@@ -41,7 +41,7 @@ public class RewardController {
@ApiOperation
(
"创建礼品"
)
@Idempotent
(
timeout
=
3
)
@PreAuthorize
(
"@ss.hasPermission('ecw:giftManagement:add')"
)
public
CommonResult
<
L
ong
>
create
(
@Valid
@RequestBody
RewardCreateReqVO
createReqVO
)
{
public
CommonResult
<
L
ist
<
Long
>
>
create
(
@Valid
@RequestBody
RewardCreateReqVO
createReqVO
)
{
return
success
(
rewardService
.
create
(
createReqVO
));
}
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/dal/dataobject/reward/RewardDO.java
View file @
1a4865c1
...
...
@@ -63,7 +63,7 @@ public class RewardDO extends BaseDO {
/**
* 兑换网点
*/
private
String
nodeId
;
private
Integer
nodeId
;
/**
* 已兑换次数
*/
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/reward/RewardService.java
View file @
1a4865c1
...
...
@@ -24,7 +24,7 @@ public interface RewardService extends IService<RewardDO> {
* @param createReqVO 创建信息
* @return 编号
*/
L
ong
create
(
@Valid
RewardCreateReqVO
createReqVO
);
L
ist
<
Long
>
create
(
@Valid
RewardCreateReqVO
createReqVO
);
/**
* 更新礼品
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/reward/RewardServiceImpl.java
View file @
1a4865c1
...
...
@@ -47,7 +47,34 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
private
MemberUserApi
memberUserApi
;
@Override
public
Long
create
(
RewardCreateReqVO
createReqVO
)
{
public
List
<
Long
>
create
(
RewardCreateReqVO
createReqVO
)
{
verifyCreateVO
(
createReqVO
);
// 插入
RewardDO
rewardDO
=
RewardConvert
.
INSTANCE
.
convert
(
createReqVO
);
// 剩余数量若没传给默认值0
if
(
rewardDO
.
getQuantityRemain
()
==
null
)
{
rewardDO
.
setQuantityRemain
(
0
);
}
ArrayList
<
Long
>
ids
=
new
ArrayList
<>();
for
(
RewardCreateReqVO
.
NodeAndPoints
nodeId
:
createReqVO
.
getNodeIds
())
{
rewardDO
.
setNodeId
(
nodeId
.
getNodeId
());
rewardDO
.
setPointsRequire
(
nodeId
.
getPoints
());
rewardDO
.
setCode
(
generateRewardCode
());
//如果插入失败,重新生成code再次插入
try
{
rewardMapper
.
insert
(
rewardDO
);
}
catch
(
Exception
e
)
{
rewardDO
.
setCode
(
generateRewardCode
());
rewardMapper
.
insert
(
rewardDO
);
}
ids
.
add
(
rewardDO
.
getId
());
rewardDO
.
setId
(
null
);
}
// 返回
return
ids
;
}
private
void
verifyCreateVO
(
RewardCreateReqVO
createReqVO
)
{
//活动开始时间不能比活动结束时间晚,活动结束时间不能比当前时间早
if
(
ObjectUtils
.
allNotNull
(
createReqVO
.
getStartTime
(),
createReqVO
.
getEndTime
()))
{
if
(
createReqVO
.
getStartTime
().
after
((
createReqVO
.
getEndTime
()))
||
createReqVO
.
getEndTime
().
before
(
Date
.
from
(
Instant
.
now
())))
{
...
...
@@ -61,22 +88,20 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
if
(
createReqVO
.
getStatus
()
!=
RewardStatusEnum
.
ENABLED
.
getValue
()
&&
createReqVO
.
getStatus
()
!=
RewardStatusEnum
.
DISABLED
.
getValue
())
{
throw
exception
(
REWARD_STATUS_NOT_ALLOW_CREATE
);
}
//
插入
RewardDO
rewardDO
=
RewardConvert
.
INSTANCE
.
convert
(
createReqVO
);
rewardDO
.
setCode
(
generateRewardCode
());
// 剩余数量若没传给默认值0
if
(
rewardDO
.
getQuantityRemain
()
==
null
)
{
rewardDO
.
setQuantityRemain
(
0
);
}
//如果插入失败,重新生成code再次插入
try
{
rewardMapper
.
insert
(
rewardDO
);
}
catch
(
Exception
e
)
{
rewardDO
.
setCode
(
generateRewardCode
());
rewardMapper
.
insert
(
rewardDO
);
//
校验节点和所需积分
List
<
RewardCreateReqVO
.
NodeAndPoints
>
nodeIds
=
createReqVO
.
getNodeIds
(
);
if
(
CollectionUtil
.
isEmpty
(
nodeIds
))
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
else
{
for
(
RewardCreateReqVO
.
NodeAndPoints
nodeId
:
nodeIds
)
{
if
(
nodeId
.
getPoints
()
==
null
||
nodeId
.
getNodeId
()
==
null
)
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
if
(
nodeId
.
getPoints
()
<=
0
||
nodeId
.
getNodeId
()
<=
0
)
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
}
}
// 返回
return
rewardDO
.
getId
();
}
@Override
...
...
@@ -170,8 +195,9 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
.
eq
(
query
.
getPointsRequireSymbol
()
==
QuantitativeRelationSymbolEnum
.
EQ
.
getValue
(),
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
())
.
lt
(
query
.
getPointsRequireSymbol
()
==
QuantitativeRelationSymbolEnum
.
LT
.
getValue
(),
RewardDO:
:
getPointsRequire
,
query
.
getPointsRequire
());
}
//领取方式,状态
lambdaQuery
.
eqIfPresent
(
RewardDO:
:
getPickMethod
,
query
.
getPickMethod
())
//兑换网点id,领取方式,状态
lambdaQuery
.
eqIfPresent
(
RewardDO:
:
getNodeId
,
query
.
getNodeId
())
.
eqIfPresent
(
RewardDO:
:
getPickMethod
,
query
.
getPickMethod
())
.
eqIfPresent
(
RewardDO:
:
getStatus
,
query
.
getStatus
());
//备注,模糊匹配三种语言
if
(
query
.
getRemark
()
!=
null
)
{
...
...
@@ -195,10 +221,6 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
PageResult
<
RewardDO
>
rewardDOPageResult
=
rewardMapper
.
selectPage
(
page
,
lambdaQuery
);
//校验是否过期
rewardDOPageResult
.
getList
().
forEach
(
this
::
validateExpire
);
// 过滤兑换网点
if
(
query
.
getNodeId
()
!=
null
)
{
rewardDOPageResult
.
getList
().
removeIf
(
rewardDO
->
!
Arrays
.
asList
(
rewardDO
.
getNodeId
().
split
(
","
)).
contains
(
query
.
getNodeId
().
toString
()));
}
return
rewardDOPageResult
;
}
...
...
@@ -295,9 +317,9 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
List
<
NodeRespDTO
>
nodes
=
null
;
// 如果用户没有填写国家或城市默认展示中国的礼品
if
(
user
.
getCity
()
==
null
||
user
.
getCountry
()
==
null
)
{
nodes
=
nodeApi
.
getNodesByCity
(
null
,
130L
);
nodes
=
nodeApi
.
getNodesByCity
(
null
,
130L
);
}
else
{
nodes
=
nodeApi
.
getNodesByCity
(
user
.
getCity
().
longValue
(),
null
);
nodes
=
nodeApi
.
getNodesByCity
(
user
.
getCity
().
longValue
(),
null
);
}
if
(
CollectionUtil
.
isNotEmpty
(
nodes
))
{
rewardDOLambdaQuery
.
in
(
RewardDO:
:
getNodeId
,
nodes
.
stream
().
map
(
NodeRespDTO:
:
getId
).
collect
(
Collectors
.
toList
()));
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/vo/reward/RewardBackVO.java
View file @
1a4865c1
...
...
@@ -58,7 +58,7 @@ public class RewardBackVO {
@ExcelProperty
(
"兑换网点"
)
@ApiModelProperty
(
value
=
"兑换网点"
,
required
=
true
)
private
String
nodeId
;
private
Integer
nodeId
;
@ExcelProperty
(
"已兑换次数"
)
@ApiModelProperty
(
value
=
"已兑换次数"
)
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/vo/reward/RewardCreateReqVO.java
View file @
1a4865c1
...
...
@@ -40,14 +40,18 @@ public class RewardCreateReqVO {
@ApiModelProperty
(
value
=
"法文礼品图片"
)
private
String
imgFr
;
@ApiModelProperty
(
value
=
"兑换所需积分"
,
required
=
true
)
@NotNull
(
message
=
"兑换所需积分不能为空"
)
@Min
(
value
=
0
)
private
Integer
pointsRequire
;
//@ApiModelProperty(value = "兑换所需积分", required = true)
//@NotNull(message = "兑换所需积分不能为空")
//@Min(value = 0)
//private Integer pointsRequire;
//@ApiModelProperty(value = "兑换网点", required = true)
//@NotNull(message = "兑换网点不能为空")
//private Integer nodeId;
@ApiModelProperty
(
value
=
"兑换网点"
,
required
=
true
)
@NotNull
(
message
=
"兑换网点不能为空"
)
private
String
nodeId
;
@ApiModelProperty
(
value
=
"兑换网点
和积分列表
"
,
required
=
true
)
@NotNull
(
message
=
"兑换网点
列表
不能为空"
)
private
List
<
NodeAndPoints
>
nodeIds
;
@ApiModelProperty
(
value
=
"剩余数量"
,
required
=
true
)
@NotNull
(
message
=
"剩余数量不能为空"
)
...
...
@@ -86,4 +90,12 @@ public class RewardCreateReqVO {
@ApiModelProperty
(
value
=
"礼品状态(1已启用,2未启用,3已关闭,4已过期)"
,
required
=
true
)
@NotNull
(
message
=
"礼品状态不能为空"
)
private
Integer
status
;
@Data
public
static
class
NodeAndPoints
{
@ApiModelProperty
(
value
=
"兑换网点"
)
private
Integer
nodeId
;
@ApiModelProperty
(
value
=
"兑换网点对应积分"
)
private
Integer
points
;
}
}
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/vo/reward/RewardUpdateReqVO.java
View file @
1a4865c1
...
...
@@ -48,7 +48,7 @@ public class RewardUpdateReqVO {
private
Integer
pointsRequire
;
@ApiModelProperty
(
value
=
"兑换网点"
)
private
String
nodeId
;
private
Integer
nodeId
;
@ApiModelProperty
(
value
=
"剩余数量"
)
@Min
(
value
=
0
)
...
...
yudao-server/src/main/resources/i18n/messages_en.properties
View file @
1a4865c1
...
...
@@ -1026,6 +1026,7 @@ reward.score.not.enough = user score not enough:{}
reward.count.not.enough
=
reward count not enough
reward.redeem.count.not.allow
=
bulk redemption is limited to a maximum of 10 pieces at a time
reward.redeem.allow.count.error
=
the number of redemptions allowed by the individual has been exceeded:{}
reward.node.and.points.list.error
=
reward node and points create error
redeem.import.max.count
=
allow maximum number of imports is {}
dict.unknown.error
=
Not in dict {0}: {1}
...
...
yudao-server/src/main/resources/i18n/messages_zh.properties
View file @
1a4865c1
...
...
@@ -1022,6 +1022,7 @@ reward.score.not.enough = \u79EF\u5206\u4E0D\u8DB3\uFF1A{}
reward.count.not.enough
=
\u
793C
\u
54C1
\u6570\u
91CF
\u
4E0D
\u
8DB3
reward.redeem.count.not.allow
=
\u6279\u
91CF
\u5151\u6362\u
6BCF
\u
6B21
\u6700\u
591A
\u5341\u6761
reward.redeem.allow.count.error
=
\u
5DF2
\u
8D85
\u
51FA
\u
4E2A
\u
4EBA
\u5141\u
8BB8
\u5151\u6362\u
6B21
\u6570\u
FF1A{}
reward.node.and.points.list.error
=
\u
521B
\u
5EFA
\u
793C
\u
54C1
\u
7F51
\u
70B9
\u6216\u6240\u9700\u
79EF
\u5206\u9519\u
8BEF
get.lock.failed
=
\u
670D
\u
52A1
\u
7E41
\u
5FD9
\u
FF0C
\u
8BF7
\u
7A0D
\u
540E
\u
91CD
\u
8BD5
reward.redeem.not.exist
=
\u
793C
\u
54C1
\u5151\u6362\u
8BB0
\u
5F55
\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