Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
ms
soss
Commits
fd318436
Commit
fd318436
authored
Apr 24, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f19ff496
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
soss-system/src/main/java/com/soss/system/service/impl/CouponUserServiceImpl.java
+2
-0
No files found.
soss-system/src/main/java/com/soss/system/service/impl/CouponUserServiceImpl.java
View file @
fd318436
...
@@ -213,6 +213,7 @@ public class CouponUserServiceImpl implements ICouponUserService {
...
@@ -213,6 +213,7 @@ public class CouponUserServiceImpl implements ICouponUserService {
List
<
OrderDetail
>
fitOrderDetails
=
orderDetails
.
stream
().
filter
(
orderDetail
->
fitCouponGoodsIdList
.
contains
(
orderDetail
.
getGoodsId
())).
collect
(
Collectors
.
toList
());
List
<
OrderDetail
>
fitOrderDetails
=
orderDetails
.
stream
().
filter
(
orderDetail
->
fitCouponGoodsIdList
.
contains
(
orderDetail
.
getGoodsId
())).
collect
(
Collectors
.
toList
());
BigDecimal
fitGoodsAmount
=
fitOrderDetails
.
stream
().
map
(
OrderDetail:
:
getAmountShould
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
fitGoodsAmount
=
fitOrderDetails
.
stream
().
map
(
OrderDetail:
:
getAmountShould
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
fitGoodsOrigDiscount
=
fitOrderDetails
.
stream
().
map
(
OrderDetail:
:
getOrigDiscount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
fitGoodsOrigDiscount
=
fitOrderDetails
.
stream
().
map
(
OrderDetail:
:
getOrigDiscount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
log
.
info
(
"fitGoodsOrigDiscount:{}, fitGoodsAmount:{}"
,
fitGoodsOrigDiscount
,
fitGoodsAmount
);
if
(
couponVo
.
getPriceLimit
()
!=
null
&&
couponVo
.
getPriceLimit
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
&&
couponVo
.
getPriceLimit
().
compareTo
(
fitGoodsAmount
)
>
0
)
{
if
(
couponVo
.
getPriceLimit
()
!=
null
&&
couponVo
.
getPriceLimit
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
&&
couponVo
.
getPriceLimit
().
compareTo
(
fitGoodsAmount
)
>
0
)
{
if
(
couponVo
.
getType
().
equals
(
CouponCategoryType
.
DISCOUNT
.
getType
()))
{
// 折扣
if
(
couponVo
.
getType
().
equals
(
CouponCategoryType
.
DISCOUNT
.
getType
()))
{
// 折扣
couponVo
.
setNotFitableDesc
(
"未达到满减要求"
);
couponVo
.
setNotFitableDesc
(
"未达到满减要求"
);
...
@@ -260,6 +261,7 @@ public class CouponUserServiceImpl implements ICouponUserService {
...
@@ -260,6 +261,7 @@ public class CouponUserServiceImpl implements ICouponUserService {
private
void
wrapperCouponAmount
(
CouponVo
couponVo
,
List
<
OrderDetail
>
fitOrderDetails
,
BigDecimal
fitGoodsAmount
,
BigDecimal
fitGoodsOrigDiscount
)
{
private
void
wrapperCouponAmount
(
CouponVo
couponVo
,
List
<
OrderDetail
>
fitOrderDetails
,
BigDecimal
fitGoodsAmount
,
BigDecimal
fitGoodsOrigDiscount
)
{
Map
<
Long
,
BigDecimal
>
couponAmountMap
=
new
HashMap
<>();
Map
<
Long
,
BigDecimal
>
couponAmountMap
=
new
HashMap
<>();
log
.
info
(
"couponVo, getOrderLimit:{}, getType:{}"
,
couponVo
.
getOrderLimit
(),
couponVo
.
getType
());
if
(
couponVo
.
getOrderLimit
()
!=
null
&&
couponVo
.
getOrderLimit
())
{
// 单杯
if
(
couponVo
.
getOrderLimit
()
!=
null
&&
couponVo
.
getOrderLimit
())
{
// 单杯
OrderDetail
orderDetail
=
fitOrderDetails
.
stream
().
max
(
Comparator
.
comparing
(
OrderDetail:
:
getUnitPrice
)).
get
();
OrderDetail
orderDetail
=
fitOrderDetails
.
stream
().
max
(
Comparator
.
comparing
(
OrderDetail:
:
getUnitPrice
)).
get
();
BigDecimal
discountAmount
=
orderDetail
.
getUnitPrice
();
BigDecimal
discountAmount
=
orderDetail
.
getUnitPrice
();
...
...
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