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
9f5793d4
Commit
9f5793d4
authored
Dec 13, 2020
by
刘鹏飞
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/feature/coco-payGift-刘鹏飞' into qa
parents
7f5d2fca
2f0a068d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
16 deletions
+34
-16
shopping-cart-application-service/src/main/java/cn/freemud/service/shoppingCart/impl/CocoShoppingCartRelationServiceImpl.java
+34
-16
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/shoppingCart/impl/CocoShoppingCartRelationServiceImpl.java
View file @
9f5793d4
...
...
@@ -104,8 +104,6 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
return
;
}
List
<
CartGoods
>
halfProduct
=
new
ArrayList
<>();
for
(
int
x
=
0
;
x
<
products
.
size
()
;
x
++){
...
...
@@ -129,6 +127,13 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
continue
;
}
// 限时特检的现单价获取促销的现单价
// 商品是否参加特价
boolean
cutFlag
=
hashCutActive
(
goodsDiscountsMap
,
product
);
if
(
cutFlag
){
product
.
setFinalPrice
(
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()).
getNowPrice
());
}
newProducts
.
add
(
product
);
}
shoppingCartGoodsResponseVo
.
setProducts
(
newProducts
);
...
...
@@ -278,20 +283,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
// 商品是否参加特价
boolean
cutFlag
=
false
;
if
(
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
())
!=
null
){
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
goods
=
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
());
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
goodsDiscountsList
=
goods
.
getDiscounts
();
if
(
goodsDiscountsList
!=
null
&&
!
goodsDiscountsList
.
isEmpty
()){
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
gd
:
goodsDiscountsList
){
if
(
ObjectUtils
.
equals
(
gd
.
getType
(),
ActivityTypeEnum
.
TYPE_2
.
getCode
())){
cutFlag
=
true
;
break
;
}
}
}
}
boolean
cutFlag
=
hashCutActive
(
goodsDiscountsMap
,
product
);
if
(
cutFlag
){
product
.
setFinalPrice
(
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
()).
getNowPrice
());
}
...
...
@@ -322,4 +314,30 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
shoppingCartGoodsResponseVo
.
setProducts
(
newProducts
);
}
/**
* 判断商品是否参加了限时特价
* @param goodsDiscountsMap
* @param product
* @return
*/
public
Boolean
hashCutActive
(
Map
<
String
,
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
>
goodsDiscountsMap
,
CartGoods
product
){
boolean
cutFlag
=
false
;
if
(
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
())
!=
null
){
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
goods
=
goodsDiscountsMap
.
get
(
product
.
getCartGoodsUid
());
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
goodsDiscountsList
=
goods
.
getDiscounts
();
if
(
goodsDiscountsList
!=
null
&&
!
goodsDiscountsList
.
isEmpty
()){
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
gd
:
goodsDiscountsList
){
if
(
ObjectUtils
.
equals
(
gd
.
getType
(),
ActivityTypeEnum
.
TYPE_2
.
getCode
())){
cutFlag
=
true
;
break
;
}
}
}
}
return
cutFlag
;
}
}
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