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
debe06cc
Commit
debe06cc
authored
Dec 09, 2020
by
缪晖
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20201208_collageOrder_miaohui' into 'qa'
Update TimeSalePromotionService.java See merge request
!72
parents
79625d9c
967ad5ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/TimeSalePromotionService.java
+3
-3
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/TimeSalePromotionService.java
View file @
debe06cc
...
...
@@ -98,12 +98,12 @@ public class TimeSalePromotionService implements IPromotionService {
// 商品实际享受优惠的数量: key:skuId; value:实际数量
Map
<
String
,
Integer
>
numberMap
=
new
HashMap
<>();
Map
<
String
,
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
>
goodsMap
=
goodsList
.
parallelStream
()
.
collect
(
Collectors
.
toMap
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
::
get
GoodsI
d
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
.
collect
(
Collectors
.
toMap
(
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
::
get
CartGoodsUi
d
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
for
(
ShoppingCartGoodsDto
.
CartGoodsDetailDto
cartGoods
:
shoppingCartGoodsDto
.
getProducts
())
{
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
goods
;
// 特价商品没有匹配 或 加价购商品 直接跳出循环
if
((
goods
=
goodsMap
.
get
(
cartGoods
.
get
SkuI
d
()))
==
null
||
ObjectUtils
.
equals
(
ActivityTypeEnum
.
TYPE_81
.
getCode
(),
cartGoods
.
getActivityType
()))
{
if
((
goods
=
goodsMap
.
get
(
cartGoods
.
get
CartGoodsUi
d
()))
==
null
||
ObjectUtils
.
equals
(
ActivityTypeEnum
.
TYPE_81
.
getCode
(),
cartGoods
.
getActivityType
()))
{
continue
;
}
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
goodsDiscount
=
getGoodsDiscount
(
goods
.
getDiscounts
(),
Arrays
.
asList
(
ActivityTypeEnum
.
TYPE_21
.
getCode
(),
ActivityTypeEnum
.
TYPE_2
.
getCode
()));
...
...
@@ -116,7 +116,7 @@ public class TimeSalePromotionService implements IPromotionService {
}
Integer
actualGoodsNumber
=
numberMap
.
get
(
cartGoods
.
getSkuId
());
if
(
actualGoodsNumber
>
0
)
{
Long
totalDiscountAmount
=
cartGoods
.
getQty
()
>
actualGoodsNumber
?
goods
Discount
.
getDiscount
()
*
actualGoodsNumber
/
goodsDiscount
.
getActualGoodsNumber
()
:
goodsDiscount
.
getDiscount
()
*
cartGoods
.
getQty
()
/
goodsDiscount
.
getActualGoodsNumber
();
Long
totalDiscountAmount
=
cartGoods
.
getQty
()
>
actualGoodsNumber
?
goods
.
getDiscountAmount
()
*
actualGoodsNumber
/
goods
.
getActualGoodsNumber
()
:
goods
.
getDiscountAmount
()
*
cartGoods
.
getQty
()
/
goods
.
getActualGoodsNumber
();
ActivityDiscountsDto
activityDiscountsDto
=
new
ActivityDiscountsDto
();
activityDiscountsDto
.
setActivityCode
(
goodsDiscount
.
getActivityCode
());
activityDiscountsDto
.
setActivityName
(
goodsDiscount
.
getActivityName
());
...
...
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