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
a046c2ff
Commit
a046c2ff
authored
Jul 02, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
总优惠金额 新增 活动满减配送费 优惠金额
Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent
41d984ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
+6
-5
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
View file @
a046c2ff
...
@@ -105,11 +105,12 @@ public class CalculationCommonService {
...
@@ -105,11 +105,12 @@ public class CalculationCommonService {
// 需要算上配送券的优惠金额
// 需要算上配送券的优惠金额
Integer
discountAmount
=
0
;
Integer
discountAmount
=
0
;
if
(
CollectionUtils
.
isNotEmpty
(
discountResult
.
getDiscounts
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
discountResult
.
getDiscounts
()))
{
// 过滤出配送券金额
// 过滤出配送券金额 和 满减配送费活动金额
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Discount
discount
=
discountResult
.
getDiscounts
().
stream
().
filter
(
c
->
c
.
getType
()
!=
null
&&
c
.
getType
().
compareTo
(
ActivityTypeEnum
.
TYPE_34
.
getCode
())
==
0
).
findFirst
().
orElse
(
null
);
double
sum
=
discountResult
.
getDiscounts
().
stream
()
if
(
discount
!=
null
)
{
.
filter
(
c
->
c
.
getType
()
!=
null
&&
(
c
.
getType
().
compareTo
(
ActivityTypeEnum
.
TYPE_34
.
getCode
())
==
0
||
c
.
getType
().
compareTo
(
ActivityTypeEnum
.
TYPE_14
.
getCode
())
==
0
))
discountAmount
=
discount
.
getDiscount
();
.
mapToDouble
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Discount
::
getDiscount
)
}
.
sum
();
discountAmount
=
Double
.
valueOf
(
sum
).
intValue
();
}
}
shoppingCartGoodsResponseVo
.
setTotalDiscountAmount
(
discountResult
.
getTotalDiscountAmount
()
+
discountAmount
);
shoppingCartGoodsResponseVo
.
setTotalDiscountAmount
(
discountResult
.
getTotalDiscountAmount
()
+
discountAmount
);
}
}
...
...
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