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
b26018b6
Commit
b26018b6
authored
Dec 15, 2020
by
刘鹏飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/feature/coco-payGift-刘鹏飞' into qa
parents
7d42bedb
b33ad0f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
13 deletions
+25
-13
shopping-cart-application-service/src/main/java/cn/freemud/service/shoppingCart/impl/CocoShoppingCartRelationServiceImpl.java
+25
-13
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/shoppingCart/impl/CocoShoppingCartRelationServiceImpl.java
View file @
b26018b6
...
...
@@ -277,7 +277,28 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
List
<
CartGoods
>
halfProduct
=
new
ArrayList
<>();
for
(
int
x
=
0
;
x
<
products
.
size
()
;
x
++){
CartGoods
product
=
products
.
get
(
x
);
// 小料信息
if
(
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
())
==
null
){
continue
;
}
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
>
smallMaterial
=
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()).
getSmallMaterial
();
Integer
smallMaterialOriTotal
=
0
;
Long
halfSmallMaterialOriTotal
=
0L
;
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
sm
:
smallMaterial
){
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
smDiscounts
=
sm
.
getDiscounts
();
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
smDiscount
:
smDiscounts
){
if
(
ObjectUtils
.
equals
(
smDiscount
.
getType
(),
ActivityTypeEnum
.
TYPE_53
.
getCode
())){
halfSmallMaterialOriTotal
=
halfSmallMaterialOriTotal
+
smDiscount
.
getSignleDiscount
();
}
}
smallMaterialOriTotal
=
smallMaterialOriTotal
+
sm
.
getOriginalPrice
();
}
// 商品的单价 = 商品单价+小料单价
Long
originalPrice
=
(
new
Long
(
smallMaterialOriTotal
)
+
product
.
getOriginalPrice
());
// 要添加的半价行数量,该字段从促销返回
Integer
num
=
0
;
// 商品优惠的金额
...
...
@@ -292,7 +313,9 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
// 第二件优惠活动,在点餐页需要给优惠商品单独显示一行
// 复制商品加到购物车
discountAmount
=
discount
.
getDiscount
();
Long
newPrice
=
product
.
getOriginalPrice
()
-
discountAmount
;
// 现单价 = 商品原单价+小料原单价-商品现单价小料现单价
Long
newPrice
=
originalPrice
-
discountAmount
-
halfSmallMaterialOriTotal
;
// 构建半价行
CartGoods
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
newPrice
,
product
.
getGoodsId
());
halfProduct
.
add
(
cartGoods
);
...
...
@@ -328,19 +351,8 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
product
.
setGoodsId
(
null
);
}
ApiLog
.
info
(
"coco小料"
,
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()),
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()).
getSmallMaterial
());
// 小料信息
if
(
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
())
==
null
){
continue
;
}
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
>
smallMaterial
=
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()).
getSmallMaterial
();
Integer
smallMaterialOriTotal
=
0
;
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
sm
:
smallMaterial
){
smallMaterialOriTotal
=
smallMaterialOriTotal
+
sm
.
getOriginalPrice
();
}
// 商品的单价 = 商品单价+小料单价
product
.
setOriginalPrice
(
new
Long
(
smallMaterialOriTotal
)
+
product
.
getOriginalPrice
()
);
product
.
setOriginalPrice
(
originalPrice
);
// 商品现单价 = 商品现单价+小料现单价
product
.
setFinalPrice
(
new
Long
(
smallMaterialOriTotal
)
+
product
.
getFinalPrice
());
...
...
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