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
61f1d8de
Commit
61f1d8de
authored
Mar 30, 2021
by
孙昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::update monthCard2.0 cartGoods amount
parent
87caad29
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+5
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
61f1d8de
...
@@ -158,15 +158,19 @@ public class CouponDiscountCalculation {
...
@@ -158,15 +158,19 @@ public class CouponDiscountCalculation {
}
}
//商品券商品
//商品券商品
if
(
StringUtils
.
isNotBlank
(
cartGoods
.
getCouponCode
())
||
discountMon
!=
null
)
{
if
(
StringUtils
.
isNotBlank
(
cartGoods
.
getCouponCode
())
||
discountMon
!=
null
)
{
cartGoods
.
setAmount
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getRealAmount
());
//先将商品券商品最终售价设置为 原价
cartGoods
.
setAmount
(
cartGoods
.
getOriginalAmount
());
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
discountsNew
=
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getDiscounts
();
List
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
discountsNew
=
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getDiscounts
();
if
(
CollectionUtils
.
isNotEmpty
(
discountsNew
))
{
if
(
CollectionUtils
.
isNotEmpty
(
discountsNew
))
{
log
.
info
(
"couponDiscountCalculation:{}"
,
discountsNew
);
log
.
info
(
"couponDiscountCalculation:{}"
,
discountsNew
);
//这里过滤掉了 月享卡2.0,因为月享卡2.0商品不用展示划线价,故显示原价
Optional
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
targetDiscount
=
discountsNew
.
stream
()
Optional
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
targetDiscount
=
discountsNew
.
stream
()
.
filter
(
t
->
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
t
.
getType
())
||
ActivityTypeEnum
.
TYPE_37
.
getCode
().
equals
(
t
.
getType
())).
findFirst
();
.
filter
(
t
->
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
t
.
getType
())
||
ActivityTypeEnum
.
TYPE_37
.
getCode
().
equals
(
t
.
getType
())).
findFirst
();
if
(
null
!=
targetDiscount
&&
targetDiscount
.
isPresent
())
{
if
(
null
!=
targetDiscount
&&
targetDiscount
.
isPresent
())
{
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
goodsDiscount
=
targetDiscount
.
get
();
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
goodsDiscount
=
targetDiscount
.
get
();
cartGoods
.
setCouponName
(
goodsDiscount
.
getActivityName
());
cartGoods
.
setCouponName
(
goodsDiscount
.
getActivityName
());
//普通商品券 和月享卡1.0的 商品最终售价更新为促销返回价格
cartGoods
.
setAmount
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getRealAmount
());
}
}
}
}
}
}
...
...
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