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
22df8817
Commit
22df8817
authored
Oct 12, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(reward): 更新礼品修改
parent
8dc3c3eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
26 deletions
+11
-26
RewardServiceImpl.java
...yudao/module/reward/service/reward/RewardServiceImpl.java
+10
-7
RewardUpdateReqVO.java
...oder/yudao/module/reward/vo/reward/RewardUpdateReqVO.java
+1
-19
No files found.
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/reward/RewardServiceImpl.java
View file @
22df8817
...
...
@@ -135,6 +135,13 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
throw
exception
(
REWARD_NOT_EXISTS
);
}
RewardDO
updateObj
=
new
RewardDO
();
// 此处为了兼容前端传值
List
<
RewardCreateReqVO
.
NodeAndPoints
>
nodeIds
=
updateReqVO
.
getNodeIds
();
if
(
CollectionUtil
.
isEmpty
(
nodeIds
))
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
RewardCreateReqVO
.
NodeAndPoints
nodeAndPoints
=
nodeIds
.
get
(
0
);
//未启用可编辑所有内容
if
(
rewardDO
.
getStatus
()
==
RewardStatusEnum
.
DISABLED
.
getValue
())
{
// 校验领取方式
...
...
@@ -150,19 +157,15 @@ public class RewardServiceImpl extends AbstractService<RewardMapper, RewardDO> i
}
else
{
throw
exception
(
REWARD_START_OR_END_TIME_NOT_ALLOW
);
}
List
<
RewardUpdateReqVO
.
NodeAndPoints
>
nodeIds
=
updateReqVO
.
getNodeIds
();
if
(
CollectionUtil
.
isEmpty
(
nodeIds
))
{
throw
exception
(
REWARD_NODE_AND_POINTS_LIST_ERROR
);
}
RewardUpdateReqVO
.
NodeAndPoints
nodeAndPoints
=
nodeIds
.
get
(
0
);
updateObj
=
RewardConvert
.
INSTANCE
.
convert
(
updateReqVO
);
updateObj
.
setPointsRequire
(
nodeAndPoints
.
getPoints
());
updateObj
.
setNodeId
(
nodeAndPoints
.
getNodeId
());
updateObj
.
setNodeId
(
nodeAndPoints
.
getWareHouses
().
get
(
0
));
updateObj
.
setQuantityRemain
(
nodeAndPoints
.
getQuantityRemain
());
//已启用可编辑剩余数量和备注
}
else
if
(
rewardDO
.
getStatus
()
==
RewardStatusEnum
.
ENABLED
.
getValue
())
{
updateObj
.
setId
(
updateReqVO
.
getId
());
updateObj
.
setQuantityRemain
(
updateReqVO
.
getQuantityRemain
());
updateObj
.
setQuantityRemain
(
nodeAndPoints
.
getQuantityRemain
());
updateObj
.
setRemarkEn
(
updateReqVO
.
getRemarkEn
());
updateObj
.
setRemarkFr
(
updateReqVO
.
getRemarkFr
());
updateObj
.
setRemarkZh
(
updateReqVO
.
getRemarkZh
());
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/vo/reward/RewardUpdateReqVO.java
View file @
22df8817
...
...
@@ -44,19 +44,9 @@ public class RewardUpdateReqVO {
@ApiModelProperty
(
value
=
"法文礼品图片"
)
private
String
imgFr
;
//@ApiModelProperty(value = "兑换所需积分")
//@Min(value = 0)
//private Integer pointsRequire;
//@ApiModelProperty(value = "兑换网点")
//private Integer nodeId;
@ApiModelProperty
(
value
=
"兑换网点和积分列表"
,
required
=
true
)
@NotNull
(
message
=
"兑换网点列表不能为空"
)
private
List
<
RewardUpdateReqVO
.
NodeAndPoints
>
nodeIds
;
@ApiModelProperty
(
value
=
"剩余数量"
)
@Min
(
value
=
0
)
private
Integer
quantityRemain
;
private
List
<
RewardCreateReqVO
.
NodeAndPoints
>
nodeIds
;
@ApiModelProperty
(
value
=
"活动开始时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
...
...
@@ -84,12 +74,4 @@ public class RewardUpdateReqVO {
@ApiModelProperty
(
value
=
"法文备注"
)
@Size
(
max
=
500
,
message
=
"法文备注长度不能超过500"
)
private
String
remarkFr
;
@Data
public
static
class
NodeAndPoints
{
@ApiModelProperty
(
value
=
"兑换网点"
)
private
Integer
nodeId
;
@ApiModelProperty
(
value
=
"兑换网点对应积分"
)
private
Integer
points
;
}
}
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