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
e3948c41
Commit
e3948c41
authored
Dec 04, 2020
by
孙昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sunyu::update::add new class shoppingCartMccafeAdapter for commbox-product calculate price
parent
24654fa6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+1
-2
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartMccafeAdapter.java
+0
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
+5
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
e3948c41
...
...
@@ -261,8 +261,7 @@ public class ShoppingCartConvertAdapter {
Long
discountAmount
=
totalDiscountAmount
-
cartGoods
.
getProductGroupList
().
stream
().
mapToLong
(
product
->
(
product
.
getOriginalPrice
()
-
product
.
getFinalPrice
())
*
product
.
getQty
()).
sum
()
*
cartGoods
.
getQty
();
// 当前套餐(固定搭配)总原价
// Long totalOriginalPrice = cartGoods.getProductComboList().stream().mapToLong(cart -> cart.getQty() * cart.getOriginalPrice()).sum() * cartGoods.getQty();
Long
totalOriginalPrice
=
cartGoods
.
getProductComboList
().
stream
().
mapToLong
(
cart
->
cart
.
getQty
()
*
cart
.
getFinalPrice
()).
sum
()
*
cartGoods
.
getQty
();
Long
totalOriginalPrice
=
cartGoods
.
getProductComboList
().
stream
().
mapToLong
(
cart
->
cart
.
getQty
()
*
cart
.
getOriginalPrice
()).
sum
()
*
cartGoods
.
getQty
();
Integer
tempDiscount
=
0
;
for
(
CartGoods
.
ComboxGoods
comboxGoods
:
comboxGoodsList
)
{
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
new
ShoppingCartGoodsDto
.
CartGoodsDetailDto
();
...
...
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartMccafeAdapter.java
0 → 100644
View file @
e3948c41
This diff is collapsed.
Click to expand it.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/SetMealCalculation.java
View file @
e3948c41
package
cn
.
freemud
.
service
.
impl
.
mcoffee
.
calculation
;
import
cn.freemud.adapter.ShoppingCartConvertAdapter
;
import
cn.freemud.adapter.ShoppingCartMccafeAdapter
;
import
cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto
;
import
cn.freemud.entities.dto.UserLoginInfoDto
;
import
cn.freemud.entities.dto.activity.ActivityDiscountsDto
;
...
...
@@ -38,6 +39,8 @@ public class SetMealCalculation {
@Autowired
private
ShoppingCartConvertAdapter
shoppingCartConvertAdapter
;
@Autowired
private
ShoppingCartMccafeAdapter
shoppingCartMccafeAdapter
;
public
void
updateShoppingCartGoodsDiscount
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
calculationDiscountResult
,
List
<
CartGoods
>
cartGoodsList
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
)
{
...
...
@@ -133,11 +136,11 @@ public class SetMealCalculation {
int
productGroupDiscountAmount
=
cartGoods
.
getProductGroupList
().
stream
().
mapToInt
(
t
->
t
.
getFinalPrice
().
intValue
()
*
t
.
getQty
()).
sum
();
// totalDiscountAmount += discountAmount - productGroupDiscountAmount * cartGoods.getQty();
// 添加套餐父商品
ShoppingCartGoodsDto
.
CartGoodsDetailDto
parentCartGoods
=
shoppingCart
Convert
Adapter
.
convertCartGoods2DetailGoods
(
cartGoods
,
apportionGoods
,
duplicateGoodsMap
);
ShoppingCartGoodsDto
.
CartGoodsDetailDto
parentCartGoods
=
shoppingCart
Mccafe
Adapter
.
convertCartGoods2DetailGoods
(
cartGoods
,
apportionGoods
,
duplicateGoodsMap
);
// parentCartGoods.setTotalDiscountAmount(parentCartGoods.getTotalDiscountAmount()+ cartGoods.getOriginalAmount().intValue() - cartGoods.getAmount().intValue());
// parentCartGoods.getActivityDiscountsDtos().add(getActivityDiscountsDto(discountAmount - productGroupDiscountAmount * cartGoods.getQty()));
// 添加套餐固定商品&可选商品: 做均摊
parentCartGoods
.
setComboProducts
(
shoppingCart
Convert
Adapter
.
convertComboxGoods2DetailGoods
(
cartGoods
,
parentCartGoods
.
getTotalDiscountAmount
()));
parentCartGoods
.
setComboProducts
(
shoppingCart
Mccafe
Adapter
.
convertComboxGoods2DetailGoods
(
cartGoods
,
parentCartGoods
.
getTotalDiscountAmount
()));
cartGoodsDetailDtos
.
add
(
parentCartGoods
);
}
}
...
...
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