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
f9a5bf3b
Commit
f9a5bf3b
authored
Dec 07, 2020
by
刘鹏飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coco将半价商品放到后边显示
parent
22780b18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
shopping-cart-application-service/src/main/java/cn/freemud/service/shoppingCart/impl/CocoShoppingCartRelationServiceImpl.java
+5
-2
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/shoppingCart/impl/CocoShoppingCartRelationServiceImpl.java
View file @
f9a5bf3b
...
@@ -80,6 +80,8 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
...
@@ -80,6 +80,8 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
if
(
products
==
null
||
products
.
isEmpty
()){
if
(
products
==
null
||
products
.
isEmpty
()){
return
;
return
;
}
}
List
<
CartGoods
>
halfProduct
=
new
ArrayList
<>();
products
.
forEach
(
product
->
{
products
.
forEach
(
product
->
{
Integer
num
=
0
;
Integer
num
=
0
;
// 商品优惠的金额
// 商品优惠的金额
...
@@ -95,7 +97,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
...
@@ -95,7 +97,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
discountAmount
=
discount
.
getDiscount
();
discountAmount
=
discount
.
getDiscount
();
Long
newPrice
=
product
.
getOriginalPrice
()
-
discountAmount
;
Long
newPrice
=
product
.
getOriginalPrice
()
-
discountAmount
;
CartGoods
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
newPrice
);
CartGoods
cartGoods
=
buildNewLine
(
product
,
ActivityTypeEnum
.
TYPE_53
.
getCode
(),
1
,
newPrice
);
newProducts
.
add
(
cartGoods
);
halfProduct
.
add
(
cartGoods
);
}
}
}
}
Integer
newQty
=
product
.
getQty
()
-
num
;
Integer
newQty
=
product
.
getQty
()
-
num
;
...
@@ -106,6 +108,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
...
@@ -106,6 +108,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
product
.
setQty
(
newQty
);
product
.
setQty
(
newQty
);
newProducts
.
add
(
product
);
newProducts
.
add
(
product
);
}
}
newProducts
.
addAll
(
halfProduct
);
});
});
...
@@ -155,7 +158,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
...
@@ -155,7 +158,7 @@ public class CocoShoppingCartRelationServiceImpl implements ShoppingCartRelation
newCartGoods
.
setSkuName
(
cgs
.
getSkuName
());
newCartGoods
.
setSkuName
(
cgs
.
getSkuName
());
newCartGoods
.
setClassificationId
(
cgs
.
getClassificationId
());
newCartGoods
.
setClassificationId
(
cgs
.
getClassificationId
());
newCartGoods
.
setClassificationName
(
cgs
.
getClassificationName
());
newCartGoods
.
setClassificationName
(
cgs
.
getClassificationName
());
newCartGoods
.
setActivityType
(
activityType
);
//
newCartGoods.setActivityType(activityType);
newCartGoods
.
setQty
(
qty
);
newCartGoods
.
setQty
(
qty
);
return
newCartGoods
;
return
newCartGoods
;
...
...
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