Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
2d32c860
Commit
2d32c860
authored
Sep 05, 2024
by
macro
Browse files
解决优惠券使用门槛为小数的精度丢失问题
parent
c6a225ff
Changes
1
Show whitespace changes
Inline
Side-by-side
mall-portal/src/main/java/com/macro/mall/portal/service/impl/UmsMemberCouponServiceImpl.java
View file @
2d32c860
...
...
@@ -129,7 +129,7 @@ public class UmsMemberCouponServiceImpl implements UmsMemberCouponService {
//判断是否满足优惠起点
//计算购物车商品的总价
BigDecimal
totalAmount
=
calcTotalAmount
(
cartItemList
);
if
(
now
.
before
(
endTime
)&&
totalAmount
.
subtract
(
minPoint
).
in
tValue
()>=
0
){
if
(
now
.
before
(
endTime
)&&
totalAmount
.
subtract
(
minPoint
).
floa
tValue
()>=
0
){
enableList
.
add
(
couponHistoryDetail
);
}
else
{
disableList
.
add
(
couponHistoryDetail
);
...
...
@@ -142,7 +142,7 @@ public class UmsMemberCouponServiceImpl implements UmsMemberCouponService {
productCategoryIds
.
add
(
categoryRelation
.
getProductCategoryId
());
}
BigDecimal
totalAmount
=
calcTotalAmountByproductCategoryId
(
cartItemList
,
productCategoryIds
);
if
(
now
.
before
(
endTime
)&&
totalAmount
.
in
tValue
()>
0
&&
totalAmount
.
subtract
(
minPoint
).
in
tValue
()>=
0
){
if
(
now
.
before
(
endTime
)&&
totalAmount
.
floa
tValue
()>
0
&&
totalAmount
.
subtract
(
minPoint
).
floa
tValue
()>=
0
){
enableList
.
add
(
couponHistoryDetail
);
}
else
{
disableList
.
add
(
couponHistoryDetail
);
...
...
@@ -155,7 +155,7 @@ public class UmsMemberCouponServiceImpl implements UmsMemberCouponService {
productIds
.
add
(
productRelation
.
getProductId
());
}
BigDecimal
totalAmount
=
calcTotalAmountByProductId
(
cartItemList
,
productIds
);
if
(
now
.
before
(
endTime
)&&
totalAmount
.
in
tValue
()>
0
&&
totalAmount
.
subtract
(
minPoint
).
in
tValue
()>=
0
){
if
(
now
.
before
(
endTime
)&&
totalAmount
.
floa
tValue
()>
0
&&
totalAmount
.
subtract
(
minPoint
).
floa
tValue
()>=
0
){
enableList
.
add
(
couponHistoryDetail
);
}
else
{
disableList
.
add
(
couponHistoryDetail
);
...
...
Write
Preview
Supports
Markdown
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