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
79eafc43
Commit
79eafc43
authored
Oct 26, 2020
by
xiaoer.li@freemud.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
b4d22ae8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingEquallyService.java
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/AdditionSharingService.java
+8
-11
shopping-cart-application-service/src/test/java/cn.freemud/service/CartTest.java
+0
-0
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingEquallyService.java
View file @
79eafc43
...
@@ -121,7 +121,7 @@ public class CalculationSharingEquallyService {
...
@@ -121,7 +121,7 @@ public class CalculationSharingEquallyService {
/**
/**
* 加价购商品
* 加价购商品
*/
*/
additionSharingService
.
equally
(
shoppingCartInfoRequestVo
,
shoppingCartGoodsDto
,
discountResult
,
premiumExchangeActivity
);
additionSharingService
.
equally
(
shoppingCartInfoRequestVo
,
shoppingCartGoodsDto
,
discountResult
,
premiumExchangeActivity
,
shoppingCartGoodsResponseVo
);
/**
/**
* 积分抵扣
* 积分抵扣
*/
*/
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/AdditionSharingService.java
View file @
79eafc43
...
@@ -231,7 +231,8 @@ public class AdditionSharingService {
...
@@ -231,7 +231,8 @@ public class AdditionSharingService {
public
void
equally
(
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
public
void
equally
(
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
,
ShoppingCartGoodsDto
shoppingCartGoodsDto
,
ShoppingCartGoodsDto
shoppingCartGoodsDto
,
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
discountResult
,
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
discountResult
,
CreateOrderVo
.
PremiumExchangeActivity
premiumExchangeActivity
)
{
,
CreateOrderVo
.
PremiumExchangeActivity
premiumExchangeActivity
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
)
{
if
(
discountResult
==
null
||
CollectionUtils
.
isEmpty
(
discountResult
.
getGoods
())
||
premiumExchangeActivity
==
null
||
CollectionUtils
.
isEmpty
(
premiumExchangeActivity
.
getProducts
()))
{
if
(
discountResult
==
null
||
CollectionUtils
.
isEmpty
(
discountResult
.
getGoods
())
||
premiumExchangeActivity
==
null
||
CollectionUtils
.
isEmpty
(
premiumExchangeActivity
.
getProducts
()))
{
return
;
return
;
...
@@ -254,11 +255,10 @@ public class AdditionSharingService {
...
@@ -254,11 +255,10 @@ public class AdditionSharingService {
}
}
log
.
info
(
"getProductsVoMap:{}"
,
JSON
.
toJSONString
(
getProductsVoMap
));
log
.
info
(
"getProductsVoMap:{}"
,
JSON
.
toJSONString
(
getProductsVoMap
));
// 获取计算返回的价格
// 获取计算返回的价格
Long
originalTotalAmount
=
shoppingCartGoods
Dt
o
.
getOriginalTotalAmount
();
Long
originalTotalAmount
=
shoppingCartGoods
ResponseV
o
.
getOriginalTotalAmount
();
Long
totalAmount
=
shoppingCartGoodsDto
.
getTotalAmount
();
//
Long totalAmount = shoppingCartGoodsDto.getTotalAmount();
Long
totalDiscountAmount
=
shoppingCartGoodsDto
.
getTotalDiscountAmount
();
//
Long totalDiscountAmount = shoppingCartGoodsDto.getTotalDiscountAmount();
//加价换购活动总优惠
//加价换购活动总优惠
Long
currenttotalDiscountAmount
=
0L
;
for
(
CreateOrderVo
.
PremiumExchangeActivity
.
Product
product
:
premiumExchangeActivity
.
getProducts
())
{
for
(
CreateOrderVo
.
PremiumExchangeActivity
.
Product
product
:
premiumExchangeActivity
.
getProducts
())
{
String
goodsId
=
StringUtils
.
isEmpty
(
product
.
getSkuId
())
?
product
.
getSpuId
()
:
product
.
getSkuId
();
String
goodsId
=
StringUtils
.
isEmpty
(
product
.
getSkuId
())
?
product
.
getSpuId
()
:
product
.
getSkuId
();
...
@@ -267,15 +267,15 @@ public class AdditionSharingService {
...
@@ -267,15 +267,15 @@ public class AdditionSharingService {
continue
;
continue
;
}
}
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
hgGood
=
manyHgs
.
stream
().
filter
(
d
->
goodsId
.
equals
(
d
.
getGoodsId
())).
findFirst
().
orElse
(
null
);
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
hgGood
=
manyHgs
.
stream
().
filter
(
d
->
goodsId
.
equals
(
d
.
getGoodsId
())).
findFirst
().
orElse
(
null
);
if
(
hgGood
==
null
)
{
if
(
hgGood
==
null
)
{
continue
;
continue
;
}
}
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
this
.
getCartGoodsDetailDto
(
product
,
getProductsVo
,
goodsId
,
hgGood
);
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoodsDetailDto
=
this
.
getCartGoodsDetailDto
(
product
,
getProductsVo
,
goodsId
,
hgGood
);
shoppingCartGoodsDto
.
getProducts
().
add
(
cartGoodsDetailDto
);
shoppingCartGoodsDto
.
getProducts
().
add
(
cartGoodsDetailDto
);
//2.计算优惠价格
//2.计算优惠价格
originalTotalAmount
+=
getProductsVo
.
getFinalPrice
();
originalTotalAmount
+=
getProductsVo
.
getFinalPrice
();
totalDiscountAmount
+=
cartGoodsDetailDto
.
getTotalDiscountAmount
();
//
totalDiscountAmount += cartGoodsDetailDto.getTotalDiscountAmount();
currenttotalDiscountAmount
+=
cartGoodsDetailDto
.
getTotalDiscountAmount
();
//
currenttotalDiscountAmount += cartGoodsDetailDto.getTotalDiscountAmount();
// 3.设置商品行优惠明细
// 3.设置商品行优惠明细
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
sendActivity
=
hgGood
.
getDiscounts
().
get
(
0
);
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
sendActivity
=
hgGood
.
getDiscounts
().
get
(
0
);
ActivityDiscountsDto
activityDiscountsDto
=
new
ActivityDiscountsDto
();
ActivityDiscountsDto
activityDiscountsDto
=
new
ActivityDiscountsDto
();
...
@@ -319,6 +319,4 @@ public class AdditionSharingService {
...
@@ -319,6 +319,4 @@ public class AdditionSharingService {
cartGoodsDetailDto
.
setExtraList
(
cartGoodsExtraList
);
cartGoodsDetailDto
.
setExtraList
(
cartGoodsExtraList
);
return
cartGoodsDetailDto
;
return
cartGoodsDetailDto
;
}
}
}
}
\ No newline at end of file
shopping-cart-application-service/src/test/java/cn.freemud/service/CartTest.java
View file @
79eafc43
This diff is collapsed.
Click to expand it.
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