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
5de05ec2
Commit
5de05ec2
authored
Aug 16, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/feature_member_score_zhangfeng' into feature_member_score
parents
86e0d0bb
f1e1f168
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
RewardRedeemServiceImpl.java
...module/reward/service/redeem/RewardRedeemServiceImpl.java
+21
-6
No files found.
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/redeem/RewardRedeemServiceImpl.java
View file @
5de05ec2
...
...
@@ -94,25 +94,39 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
@Override
public
Boolean
updateRecord
(
RewardRedeemUpdateReqVO
request
)
{
updateValidateParam
(
request
);
Long
rewardId
=
updateValidateParam
(
request
);
RewardDO
rewardDO
=
rewardService
.
getById
(
rewardId
);
if
(
rewardDO
==
null
)
{
throw
exception
(
ErrorCodeConstants
.
REWARD_NOT_EXISTS
);
}
if
(!
Arrays
.
asList
(
rewardDO
.
getPickMethod
().
split
(
","
)).
contains
(
request
.
getRedeemType
().
toString
()))
{
throw
exception
(
ErrorCodeConstants
.
REWARD_PICK_METHOD_NOT_ALLOW
);
}
LambdaUpdateWrapper
<
RewardRedeemDO
>
wrapper
=
Wrappers
.
lambdaUpdate
();
wrapper
.
eq
(
RewardRedeemDO:
:
getId
,
request
.
getId
());
wrapper
.
set
(
RewardRedeemDO:
:
getRedeemType
,
request
.
getRedeemType
());
wrapper
.
set
(
RewardRedeemDO:
:
getExpenses
,
request
.
getExpenses
());
wrapper
.
set
(
RewardRedeemDO:
:
getCurrency
,
request
.
getCurrency
());
wrapper
.
set
(
RewardRedeemDO:
:
getRecipientName
,
request
.
getRecipientName
());
wrapper
.
set
(
RewardRedeemDO:
:
getRecipientAddress
,
request
.
getRecipientAddress
());
wrapper
.
set
(
RewardRedeemDO:
:
getRecipientPhoneNum
,
request
.
getRecipientPhoneNum
());
wrapper
.
set
(
RewardRedeemDO:
:
getRedeemer
,
request
.
getRedeemer
());
wrapper
.
set
(
RewardRedeemDO:
:
getRedemptionTime
,
request
.
getRedemptionTime
());
wrapper
.
set
(
RewardRedeemDO:
:
getCourierCompany
,
request
.
getCourierCompany
());
wrapper
.
set
(
RewardRedeemDO:
:
getExpressNo
,
request
.
getExpressNo
());
wrapper
.
set
(
RewardRedeemDO:
:
getExpressDate
,
request
.
getExpressDate
());
wrapper
.
set
(
RewardRedeemDO:
:
getExpressSender
,
request
.
getExpressSender
());
wrapper
.
set
(
RewardRedeemDO:
:
getAnnex
,
request
.
getAnnex
());
wrapper
.
set
(
RewardRedeemDO:
:
getRemark
,
request
.
getRemark
());
wrapper
.
set
(
RewardRedeemDO:
:
getUpdater
,
SecurityFrameworkUtils
.
getLoginUserId
());
wrapper
.
set
(
RewardRedeemDO:
:
getUpdateTime
,
new
Date
());
if
(
request
.
getRedeemType
()
==
RewardPickMethedEnum
.
SELF_PICKUP
.
getValue
())
{
wrapper
.
set
(
RewardRedeemDO:
:
getRecipientAddress
,
""
);
wrapper
.
set
(
RewardRedeemDO:
:
getCourierCompany
,
null
);
wrapper
.
set
(
RewardRedeemDO:
:
getExpressNo
,
null
);
wrapper
.
set
(
RewardRedeemDO:
:
getExpressDate
,
null
);
}
else
{
wrapper
.
set
(
StringUtils
.
isNotBlank
(
request
.
getRecipientAddress
()),
RewardRedeemDO:
:
getRecipientAddress
,
request
.
getRecipientAddress
());
wrapper
.
set
(
RewardRedeemDO:
:
getCourierCompany
,
request
.
getCourierCompany
());
wrapper
.
set
(
RewardRedeemDO:
:
getExpressNo
,
request
.
getExpressNo
());
wrapper
.
set
(
RewardRedeemDO:
:
getExpressDate
,
request
.
getExpressDate
());
}
rewardRedeemMapper
.
update
(
null
,
wrapper
);
return
true
;
}
...
...
@@ -461,7 +475,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
return
true
;
}
private
void
updateValidateParam
(
RewardRedeemUpdateReqVO
request
)
{
private
Long
updateValidateParam
(
RewardRedeemUpdateReqVO
request
)
{
RewardRedeemDO
rewardRedeemDO
=
getById
(
request
.
getId
());
if
(
rewardRedeemDO
==
null
)
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
...
...
@@ -469,5 +483,6 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
if
(
rewardRedeemDO
.
getStatus
()
!=
RewardRedeemStatusEnum
.
REDEEMING
.
getValue
())
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_STATUS_ERROR
);
}
return
rewardRedeemDO
.
getRewardId
();
}
}
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