Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
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
pseer
gxpt_ht
Commits
c79a080c
Commit
c79a080c
authored
Jan 16, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
团购券支持多套餐配置
parent
b533c833
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+12
-5
No files found.
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
c79a080c
...
...
@@ -257,11 +257,18 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
}
private
Boolean
checkPack
(
SConsumerCoupon
item
,
CouponRequest
couponRequest
,
List
<
SPack
>
sPacks
){
// if(Objects.nonNull(item.getPackageId())&&item.getPackageId().compareTo(couponRequest.getPackageId())!=0){
// SPack pack = sPacks.stream().filter(obj -> obj.getId().compareTo(item.getPackageId())==0).findFirst().orElse(null);
// item.setIsAvailable(AvailableEnum.UNAVAILABLE.getCode());
// item.setReason("优惠卷当前套餐不可用,【"+pack.getName()+"】套餐可用");
// }
if
(
couponRequest
.
getOrderMode
().
compareTo
(
BuyTypeEnum
.
PACK
.
getCode
())==
0
&&
StringUtils
.
isNotBlank
(
item
.
getPackIds
())&&
Objects
.
nonNull
(
couponRequest
.
getPackageId
())){
List
<
Long
>
confPackIds
=
Arrays
.
stream
(
item
.
getPackIds
().
split
(
","
)).
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
if
(!
confPackIds
.
contains
(
couponRequest
.
getPackageId
())){
List
<
SPack
>
packs
=
sPacks
.
stream
().
filter
(
obj
->
confPackIds
.
contains
(
obj
.
getId
())).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
packs
)){
List
<
String
>
packNames
=
packs
.
stream
().
map
(
SPack:
:
getName
).
distinct
().
collect
(
Collectors
.
toList
());
item
.
setIsAvailable
(
AvailableEnum
.
UNAVAILABLE
.
getCode
());
item
.
setReason
(
"优惠卷当前套餐不可用,【"
+
packNames
.
toString
()+
"】套餐可用"
);
}
}
}
return
item
.
getIsAvailable
()==
0
;
}
...
...
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