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
e0e6cb33
Commit
e0e6cb33
authored
Oct 28, 2020
by
huiyang.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
麦咖啡随单购卡优惠 1
parent
8c017d41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+15
-12
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
e0e6cb33
...
...
@@ -177,12 +177,11 @@ public class CouponDiscountCalculation {
// 匹配随单购悦享卡
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
discount
=
discounts
.
stream
().
filter
(
t
->
(
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
t
.
getType
())
&&
mccafeUniversalCouponCode
.
equals
(
t
.
getActivityCode
()))).
findFirst
().
orElse
(
null
);
for
(
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoods
:
shoppingCartGoodsDto
.
getProducts
())
{
if
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
())
==
null
)
{
continue
;
}
//商品券商品
if
(
StringUtils
.
isNotEmpty
(
cartGoods
.
getCouponCode
())
||
discount
!=
null
)
{
if
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
())
==
null
)
{
continue
;
}
if
(
StringUtils
.
isNotEmpty
(
cartGoods
.
getCouponCode
())
)
{
List
<
ActivityDiscountsDto
>
productActivityDiscountsDtos
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
discounts
))
{
for
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Discount
couponDiscount
:
discounts
)
{
...
...
@@ -202,12 +201,18 @@ public class CouponDiscountCalculation {
}
}
}
if
(
discount
!=
null
)
{
}
cartGoods
.
setCustomerCode
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getArtNo
());
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
list
=
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getDiscounts
();
if
(
CollectionUtils
.
isNotEmpty
(
list
)
&&
discount
!=
null
)
{
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
goodsDiscount
=
list
.
stream
().
filter
(
t
->
(
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
t
.
getType
())
&&
mccafeUniversalCouponCode
.
equals
(
t
.
getActivityCode
()))).
findFirst
().
orElse
(
null
);
if
(
goodsDiscount
!=
null
){
List
<
ActivityDiscountsDto
>
productActivityDiscountsDtos
=
new
ArrayList
<>();
ActivityDiscountsDto
activityDiscountsDto
=
new
ActivityDiscountsDto
();
activityDiscountsDto
.
setActivityCode
(
d
iscount
.
getActivityCode
());
activityDiscountsDto
.
setActivityName
(
d
iscount
.
getActivityName
());
activityDiscountsDto
.
setActivityType
(
d
iscount
.
getType
());
activityDiscountsDto
.
setDiscountAmount
(
0
-
discount
.
getDiscount
());
activityDiscountsDto
.
setActivityCode
(
goodsD
iscount
.
getActivityCode
());
activityDiscountsDto
.
setActivityName
(
goodsD
iscount
.
getActivityName
());
activityDiscountsDto
.
setActivityType
(
goodsD
iscount
.
getType
());
activityDiscountsDto
.
setDiscountAmount
(
0
-
goodsDiscount
.
getDiscount
().
intValue
());
activityDiscountsDto
.
setExtendType
(
discount
.
getExtendType
());
activityDiscountsDto
.
setTenderId
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getArtNo
());
productActivityDiscountsDtos
.
add
(
activityDiscountsDto
);
...
...
@@ -215,8 +220,6 @@ public class CouponDiscountCalculation {
cartGoods
.
setSalePrice
(
0L
);
cartGoods
.
setActivityDiscountsDtos
(
productActivityDiscountsDtos
);
}
cartGoods
.
setCustomerCode
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getArtNo
());
}
}
...
...
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