Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
f0bbc2e2
Commit
f0bbc2e2
authored
Jul 15, 2022
by
胡敬轩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
华莱士&百事抽奖活动 判断订单金额和商品是否满足活动
parent
4e11a9aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
+47
-0
No files found.
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
View file @
f0bbc2e2
...
...
@@ -82,6 +82,18 @@ public class OrderAdapterServiceImpl {
@Value
(
"${weixin.pay.success.goods:}"
)
private
String
weixinPayGoods
;
//华莱士百事抽奖 一次性活动,结束即可删除 格式(商户号,用逗号分割):2690,2581
@Value
(
"${baishi.activity.partner:2581,2692,2690}"
)
private
String
baishiActivityPartner
;
//华莱士百事抽奖 一次性活动,结束即可删除 格式(商户号,用逗号分割):2690,2581
@Value
(
"${baishi.activity.amount:10000000000}"
)
private
Integer
baishiActivityAmount
;
//华莱士百事抽奖 一次性活动,结束即可删除 格式(商户号@商品,用逗号分割):13981711,34343345
@Value
(
"${baishi.activity.good:}"
)
private
String
baishiActivityGood
;
private
final
String
PAY_SUCCESS_KEY
=
"pay_success_key:"
;
/**
...
...
@@ -612,4 +624,39 @@ public class OrderAdapterServiceImpl {
return
ResponseUtil
.
success
(
respVo
);
}
private
boolean
canJoinActivity
(
String
partnerId
,
List
<
ProductBeanV1
>
productList
,
Integer
payAmount
){
List
<
String
>
partnerList
=
Arrays
.
asList
(
baishiActivityPartner
.
split
(
","
));
if
(!
partnerList
.
contains
(
partnerId
)){
return
false
;
}
if
(
payAmount
>=
baishiActivityAmount
){
return
true
;
}
List
<
String
>
goodsList
=
Arrays
.
asList
(
baishiActivityGood
.
split
(
","
));
if
(
CollectionUtils
.
isNotEmpty
(
goodsList
)
&&
CollectionUtils
.
isNotEmpty
(
productList
)){
return
productList
.
stream
().
anyMatch
(
productBeanV1
->
{
boolean
mainProduct
=
goodsList
.
contains
(
StringUtils
.
isBlank
(
productBeanV1
.
getSpecification
())?
productBeanV1
.
getProductId
():
productBeanV1
.
getSpecification
());
if
(
mainProduct
){
return
true
;
}
if
(
CollectionUtils
.
isNotEmpty
(
productBeanV1
.
getSendProduct
())){
boolean
sendProduct
=
productBeanV1
.
getSendProduct
().
stream
().
anyMatch
(
send
->
goodsList
.
contains
(
StringUtils
.
isBlank
(
send
.
getSpecification
())?
send
.
getProductId
():
send
.
getSpecification
()));
if
(
sendProduct
){
return
true
;
}
}
if
(
CollectionUtils
.
isNotEmpty
(
productBeanV1
.
getComboProduct
())){
boolean
comboProduct
=
productBeanV1
.
getComboProduct
().
stream
().
anyMatch
(
combo
->
goodsList
.
contains
(
StringUtils
.
isBlank
(
combo
.
getSpecification
())?
combo
.
getProductId
():
combo
.
getSpecification
()));
if
(
comboProduct
){
return
true
;
}
}
return
false
;
});
}
return
false
;
}
}
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