记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
董敬伟
liquidnet-bus-v1
Commits
6c81df7a
Commit
6c81df7a
authored
Jul 14, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_fetched_coupon_spuIds' into dev_0716_online
parents
9d240cfd
d6624b43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
GoblinCouponController.java
...net/service/goblin/controller/GoblinCouponController.java
+17
-2
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinCouponController.java
View file @
6c81df7a
...
...
@@ -140,15 +140,30 @@ public class GoblinCouponController {
if
(!
CollectionUtils
.
isEmpty
(
userCouponVos
))
{
List
<
GoblinUserCouponVo
>
userCouponVoList
=
userCouponVos
.
stream
().
filter
(
vo
->
vo
.
getStoreCouponId
().
equals
(
storeCouponId
)).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
userCouponVoList
)
&&
userCouponVoList
.
size
()
>=
storeCouponVo
.
getReceiveLimit
())
{
// 用户已领取该券且领取数量已达上限时,根据已领取券的状态判断返回(如果已使用提示用,未使用则正常返回)
Optional
<
GoblinUserCouponVo
>
userCouponVoOptional
=
userCouponVoList
.
stream
().
filter
(
vo
->
vo
.
getState
().
equals
(
1
)).
findAny
();
return
userCouponVoOptional
.
map
(
ResponseDto:
:
success
).
orElseGet
(()
->
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140054"
)));
// return userCouponVoOptional.map(ResponseDto::success).orElseGet(() -> ResponseDto.failure(ErrorMapping.get("140054")));
if
(
userCouponVoOptional
.
isPresent
())
{
GoblinUserCouponVo
userCouponVo
=
userCouponVoOptional
.
get
();
if
(
StringUtils
.
equals
(
"1"
,
userCouponVo
.
getUseScope
()))
{
userCouponVo
.
setSpuIds
(
goblinRedisUtils
.
getStoreCouponSpuIds
(
storeCouponId
));
}
return
ResponseDto
.
success
(
userCouponVo
);
}
else
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140054"
));
}
}
}
if
(
storeCouponVo
.
getStock
().
equals
(
0
)
||
goblinRedisUtils
.
getStoreCouponStock
(
storeCouponId
)
>
0
)
{
if
(
goblinCouponService
.
receiveCoupon
(
uid
,
userCouponVos
,
storeCouponVo
))
{
List
<
GoblinUserCouponVo
>
userCouponVoList
=
userCouponVos
.
stream
()
.
filter
(
vo
->
vo
.
getStoreCouponId
().
equals
(
storeCouponId
)
&&
vo
.
getState
().
equals
(
1
)).
collect
(
Collectors
.
toList
());
return
ResponseDto
.
success
(
userCouponVoList
.
get
(
0
));
// return ResponseDto.success(userCouponVoList.get(0));
GoblinUserCouponVo
userCouponVo
=
userCouponVoList
.
get
(
0
);
if
(
StringUtils
.
equals
(
"1"
,
userCouponVo
.
getUseScope
()))
{
userCouponVo
.
setSpuIds
(
goblinRedisUtils
.
getStoreCouponSpuIds
(
storeCouponId
));
}
return
ResponseDto
.
success
(
userCouponVo
);
}
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140053"
));
}
...
...
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