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
9fd2a13e
Commit
9fd2a13e
authored
Aug 02, 2024
by
zhaobiyan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature_member_score_zby' into feature_member_score
parents
9807479d
1e64c640
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
40 deletions
+44
-40
RedeemRewardController.java
...eward/controller/admin/redeem/RedeemRewardController.java
+4
-4
RewardRedeemService.java
...dao/module/reward/service/redeem/RewardRedeemService.java
+2
-2
RewardRedeemServiceImpl.java
...module/reward/service/redeem/RewardRedeemServiceImpl.java
+38
-34
No files found.
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/controller/admin/redeem/RedeemRewardController.java
View file @
9fd2a13e
...
@@ -86,14 +86,14 @@ public class RedeemRewardController {
...
@@ -86,14 +86,14 @@ public class RedeemRewardController {
@PostMapping
(
"record/cancel/check"
)
@PostMapping
(
"record/cancel/check"
)
@ApiOperation
(
"撤销检查"
)
@ApiOperation
(
"撤销检查"
)
public
CommonResult
<
RedeemCancelCheckRespVO
>
cancelCheck
(
@Valid
@RequestBody
RewardRedeemUpdateReqVO
reqVO
)
{
public
CommonResult
<
RedeemCancelCheckRespVO
>
cancelCheck
(
@Valid
@RequestBody
List
<
Long
>
ids
)
{
return
success
(
rewardRedeemService
.
cancelCheck
(
reqVO
));
return
success
(
rewardRedeemService
.
cancelCheck
(
ids
));
}
}
@PostMapping
(
"record/cancel"
)
@PostMapping
(
"record/cancel"
)
@ApiOperation
(
"撤销"
)
@ApiOperation
(
"撤销"
)
public
CommonResult
<
Boolean
>
cancel
(
@Valid
@RequestBody
RewardRedeemUpdateReqVO
reqVO
)
{
public
CommonResult
<
Boolean
>
cancel
(
@Valid
@RequestBody
List
<
Long
>
ids
)
{
return
success
(
rewardRedeemService
.
cancel
(
reqVO
));
return
success
(
rewardRedeemService
.
cancel
(
ids
));
}
}
@PostMapping
(
"record/import/template"
)
@PostMapping
(
"record/import/template"
)
...
...
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/redeem/RewardRedeemService.java
View file @
9fd2a13e
...
@@ -34,7 +34,7 @@ public interface RewardRedeemService extends IService<RewardRedeemDO> {
...
@@ -34,7 +34,7 @@ public interface RewardRedeemService extends IService<RewardRedeemDO> {
RecordInfoImportRespVO
recordImport
(
List
<
RedeemInfoImportExcelVO
>
dataList
);
RecordInfoImportRespVO
recordImport
(
List
<
RedeemInfoImportExcelVO
>
dataList
);
Boolean
cancel
(
RewardRedeemUpdateReqVO
reqVO
);
Boolean
cancel
(
List
<
Long
>
ids
);
RedeemCancelCheckRespVO
cancelCheck
(
RewardRedeemUpdateReqVO
reqVO
);
RedeemCancelCheckRespVO
cancelCheck
(
List
<
Long
>
ids
);
}
}
yudao-module-reward/yudao-module-reward-impl/src/main/java/cn/iocoder/yudao/module/reward/service/redeem/RewardRedeemServiceImpl.java
View file @
9fd2a13e
...
@@ -208,7 +208,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
...
@@ -208,7 +208,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
@Override
@Override
public
RecordInfoImportRespVO
recordImport
(
List
<
RedeemInfoImportExcelVO
>
dataList
)
{
public
RecordInfoImportRespVO
recordImport
(
List
<
RedeemInfoImportExcelVO
>
dataList
)
{
if
(
CollectionUtils
.
isEmpty
(
dataList
))
{
if
(
CollectionUtils
.
isEmpty
(
dataList
))
{
return
RecordInfoImportRespVO
.
builder
().
build
();
return
RecordInfoImportRespVO
.
builder
().
redeemIdFailedMap
(
Collections
.
emptyMap
()).
build
();
}
}
if
(
dataList
.
size
()
>
MAX_IMPORT_RECORD_COUNT
)
{
if
(
dataList
.
size
()
>
MAX_IMPORT_RECORD_COUNT
)
{
throw
exception
(
ErrorCodeConstants
.
REDEEM_IMPORT_MAX_COUNT
,
MAX_IMPORT_RECORD_COUNT
);
throw
exception
(
ErrorCodeConstants
.
REDEEM_IMPORT_MAX_COUNT
,
MAX_IMPORT_RECORD_COUNT
);
...
@@ -241,17 +241,20 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
...
@@ -241,17 +241,20 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
return
rewardRedeemDO
;
return
rewardRedeemDO
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
this
.
updateBatchById
(
saveDataList
);
this
.
updateBatchById
(
saveDataList
);
return
RecordInfoImportRespVO
.
builder
().
build
();
return
RecordInfoImportRespVO
.
builder
().
redeemIdFailedMap
(
Collections
.
emptyMap
()).
build
();
}
}
@Override
@Override
@Transactional
public
Boolean
cancel
(
List
<
Long
>
ids
)
{
public
Boolean
cancel
(
RewardRedeemUpdateReqVO
reqVO
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
}
ids
.
forEach
(
id
->
{
//取消兑换 状态改为已取消 回退扣减的积分 ,如果存在已过期的积分,则直接过期
//取消兑换 状态改为已取消 回退扣减的积分 ,如果存在已过期的积分,则直接过期
if
(
reqVO
.
getId
()
==
null
)
{
if
(
id
==
null
)
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
}
}
RewardRedeemDO
rewardRedeemDO
=
this
.
getById
(
reqVO
.
getId
()
);
RewardRedeemDO
rewardRedeemDO
=
this
.
getById
(
id
);
if
(
rewardRedeemDO
==
null
)
{
if
(
rewardRedeemDO
==
null
)
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
}
}
...
@@ -259,7 +262,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
...
@@ -259,7 +262,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
throw
exception
(
ErrorCodeConstants
.
REDEEM_CANCEL_STATUS_ERROR
);
throw
exception
(
ErrorCodeConstants
.
REDEEM_CANCEL_STATUS_ERROR
);
}
}
LambdaUpdateWrapper
<
RewardRedeemDO
>
updateWrapper
=
Wrappers
.
lambdaUpdate
();
LambdaUpdateWrapper
<
RewardRedeemDO
>
updateWrapper
=
Wrappers
.
lambdaUpdate
();
updateWrapper
.
eq
(
RewardRedeemDO:
:
getId
,
reqVO
.
getId
()
);
updateWrapper
.
eq
(
RewardRedeemDO:
:
getId
,
id
);
updateWrapper
.
eq
(
RewardRedeemDO:
:
getStatus
,
RewardRedeemStatusEnum
.
REDEEMING
.
getValue
());
updateWrapper
.
eq
(
RewardRedeemDO:
:
getStatus
,
RewardRedeemStatusEnum
.
REDEEMING
.
getValue
());
updateWrapper
.
set
(
RewardRedeemDO:
:
getStatus
,
RewardRedeemStatusEnum
.
CANCELED
.
getValue
());
updateWrapper
.
set
(
RewardRedeemDO:
:
getStatus
,
RewardRedeemStatusEnum
.
CANCELED
.
getValue
());
boolean
updateSuccess
=
this
.
update
(
null
,
updateWrapper
);
boolean
updateSuccess
=
this
.
update
(
null
,
updateWrapper
);
...
@@ -267,23 +270,24 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
...
@@ -267,23 +270,24 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
throw
exception
(
ErrorCodeConstants
.
REDEEM_CANCEL_STATUS_ERROR
);
throw
exception
(
ErrorCodeConstants
.
REDEEM_CANCEL_STATUS_ERROR
);
}
}
Map
<
String
,
Object
>
extParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
extParam
=
new
HashMap
<>();
extParam
.
put
(
"redeemId"
,
reqVO
.
getId
()
);
extParam
.
put
(
"redeemId"
,
id
);
memberUserScoreApi
.
operateScore
(
MemberUserScoreOperateReqDTO
.
builder
()
memberUserScoreApi
.
operateScore
(
MemberUserScoreOperateReqDTO
.
builder
()
.
memberId
(
rewardRedeemDO
.
getMemberId
())
.
memberId
(
rewardRedeemDO
.
getMemberId
())
.
sourceType
(
ScoreSourceTypeEnum
.
EXCHANGE_REWARD_CANCEL
)
.
sourceType
(
ScoreSourceTypeEnum
.
EXCHANGE_REWARD_CANCEL
)
.
scoreCount
(
rewardRedeemDO
.
getScoreCount
())
.
scoreCount
(
rewardRedeemDO
.
getScoreCount
())
.
extParam
(
extParam
)
.
extParam
(
extParam
)
.
releationId
(
String
.
valueOf
(
reqVO
.
getId
()
))
.
releationId
(
String
.
valueOf
(
id
))
.
build
());
.
build
());
});
return
true
;
return
true
;
}
}
@Override
@Override
public
RedeemCancelCheckRespVO
cancelCheck
(
RewardRedeemUpdateReqVO
reqVO
)
{
public
RedeemCancelCheckRespVO
cancelCheck
(
List
<
Long
>
ids
)
{
if
(
reqVO
.
getId
()
==
null
)
{
if
(
CollectionUtils
.
isEmpty
(
ids
)
)
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
}
}
RewardRedeemDO
rewardRedeemDO
=
this
.
getById
(
reqVO
.
getId
(
));
RewardRedeemDO
rewardRedeemDO
=
this
.
getById
(
ids
.
get
(
0
));
if
(
rewardRedeemDO
==
null
)
{
if
(
rewardRedeemDO
==
null
)
{
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
throw
exception
(
ErrorCodeConstants
.
REWARD_REDEEM_NOT_EXIST
);
}
}
...
@@ -291,7 +295,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
...
@@ -291,7 +295,7 @@ public class RewardRedeemServiceImpl extends AbstractService<RewardRedeemMapper,
throw
exception
(
ErrorCodeConstants
.
REDEEM_CANCEL_STATUS_ERROR
);
throw
exception
(
ErrorCodeConstants
.
REDEEM_CANCEL_STATUS_ERROR
);
}
}
List
<
ReleationScoreExpireInfoDTO
>
scoreExpireInfo
=
memberUserScoreApi
List
<
ReleationScoreExpireInfoDTO
>
scoreExpireInfo
=
memberUserScoreApi
.
getScoreExpireInfo
(
String
.
valueOf
(
reqVO
.
getId
(
)),
ScoreSourceTypeEnum
.
EXCHANGE_REWARD
);
.
getScoreExpireInfo
(
String
.
valueOf
(
ids
.
get
(
0
)),
ScoreSourceTypeEnum
.
EXCHANGE_REWARD
);
int
totalExpireScore
=
scoreExpireInfo
.
stream
().
filter
(
e
->
e
.
getExpireDate
()
!=
null
&&
e
.
getExpireDate
().
compareTo
(
new
Date
())
<
0
)
int
totalExpireScore
=
scoreExpireInfo
.
stream
().
filter
(
e
->
e
.
getExpireDate
()
!=
null
&&
e
.
getExpireDate
().
compareTo
(
new
Date
())
<
0
)
.
mapToInt
(
ReleationScoreExpireInfoDTO:
:
getScoreCount
).
sum
();
.
mapToInt
(
ReleationScoreExpireInfoDTO:
:
getScoreCount
).
sum
();
return
RedeemCancelCheckRespVO
.
builder
().
expireCount
(
totalExpireScore
).
build
();
return
RedeemCancelCheckRespVO
.
builder
().
expireCount
(
totalExpireScore
).
build
();
...
...
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