fix: 修复优惠金额判断逻辑,>=0时使用
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -121,8 +121,8 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
BigDecimal discountRate = order.getDiscountRate();
|
BigDecimal discountRate = order.getDiscountRate();
|
||||||
BigDecimal discountMoney = request.getDiscountMoney();
|
BigDecimal discountMoney = request.getDiscountMoney();
|
||||||
|
|
||||||
// 优先使用优惠金额,如果没有填则用折扣率计算
|
// 如果优惠金额大于0,直接使用;否则用折扣率计算
|
||||||
if (discountMoney != null && discountMoney.compareTo(BigDecimal.ZERO) > 0) {
|
if (discountMoney != null && discountMoney.compareTo(BigDecimal.ZERO) >= 0) {
|
||||||
discountAmount = discountMoney;
|
discountAmount = discountMoney;
|
||||||
} else {
|
} else {
|
||||||
// 折扣率默认100,即不打折
|
// 折扣率默认100,即不打折
|
||||||
@@ -358,8 +358,8 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
BigDecimal discountRate = order.getDiscountRate();
|
BigDecimal discountRate = order.getDiscountRate();
|
||||||
BigDecimal discountMoney = order.getDiscountMoney();
|
BigDecimal discountMoney = order.getDiscountMoney();
|
||||||
|
|
||||||
// 优先使用优惠金额,如果没有填则用折扣率计算
|
// 如果优惠金额大于等于0,直接使用;否则用折扣率计算
|
||||||
if (discountMoney != null && discountMoney.compareTo(BigDecimal.ZERO) > 0) {
|
if (discountMoney != null && discountMoney.compareTo(BigDecimal.ZERO) >= 0) {
|
||||||
discountAmount = discountMoney;
|
discountAmount = discountMoney;
|
||||||
} else {
|
} else {
|
||||||
if (discountRate == null) {
|
if (discountRate == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user