记得上下班打卡 | 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
3174514d
Commit
3174514d
authored
Jun 24, 2022
by
zhanggb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:POS机代领券:部分商品券时+返回spuIds;
parent
d8baa4eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
GoblinCouponController.java
...net/service/goblin/controller/GoblinCouponController.java
+13
-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 @
3174514d
...
@@ -140,15 +140,26 @@ public class GoblinCouponController {
...
@@ -140,15 +140,26 @@ public class GoblinCouponController {
if
(!
CollectionUtils
.
isEmpty
(
userCouponVos
))
{
if
(!
CollectionUtils
.
isEmpty
(
userCouponVos
))
{
List
<
GoblinUserCouponVo
>
userCouponVoList
=
userCouponVos
.
stream
().
filter
(
vo
->
vo
.
getStoreCouponId
().
equals
(
storeCouponId
)).
collect
(
Collectors
.
toList
());
List
<
GoblinUserCouponVo
>
userCouponVoList
=
userCouponVos
.
stream
().
filter
(
vo
->
vo
.
getStoreCouponId
().
equals
(
storeCouponId
)).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
userCouponVoList
)
&&
userCouponVoList
.
size
()
>=
storeCouponVo
.
getReceiveLimit
())
{
if
(!
CollectionUtils
.
isEmpty
(
userCouponVoList
)
&&
userCouponVoList
.
size
()
>=
storeCouponVo
.
getReceiveLimit
())
{
// 用户已领取该券且领取数量已达上限时,根据已领取券的状态判断返回(如果已使用提示用,未使用则正常返回)
Optional
<
GoblinUserCouponVo
>
userCouponVoOptional
=
userCouponVoList
.
stream
().
filter
(
vo
->
vo
.
getState
().
equals
(
1
)).
findAny
();
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
();
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
(
storeCouponVo
.
getStock
().
equals
(
0
)
||
goblinRedisUtils
.
getStoreCouponStock
(
storeCouponId
)
>
0
)
{
if
(
goblinCouponService
.
receiveCoupon
(
uid
,
userCouponVos
,
storeCouponVo
))
{
if
(
goblinCouponService
.
receiveCoupon
(
uid
,
userCouponVos
,
storeCouponVo
))
{
List
<
GoblinUserCouponVo
>
userCouponVoList
=
userCouponVos
.
stream
()
List
<
GoblinUserCouponVo
>
userCouponVoList
=
userCouponVos
.
stream
()
.
filter
(
vo
->
vo
.
getStoreCouponId
().
equals
(
storeCouponId
)
&&
vo
.
getState
().
equals
(
1
)).
collect
(
Collectors
.
toList
());
.
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
);
userCouponVo
.
setSpuIds
(
goblinRedisUtils
.
getStoreCouponSpuIds
(
storeCouponId
));
return
ResponseDto
.
success
(
userCouponVo
);
}
}
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140053"
));
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