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 discountMoney = request.getDiscountMoney();
|
||||
|
||||
// 优先使用优惠金额,如果没有填则用折扣率计算
|
||||
if (discountMoney != null && discountMoney.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// 如果优惠金额大于0,直接使用;否则用折扣率计算
|
||||
if (discountMoney != null && discountMoney.compareTo(BigDecimal.ZERO) >= 0) {
|
||||
discountAmount = discountMoney;
|
||||
} else {
|
||||
// 折扣率默认100,即不打折
|
||||
@@ -358,8 +358,8 @@ public class OrderServiceImpl implements OrderService {
|
||||
BigDecimal discountRate = order.getDiscountRate();
|
||||
BigDecimal discountMoney = order.getDiscountMoney();
|
||||
|
||||
// 优先使用优惠金额,如果没有填则用折扣率计算
|
||||
if (discountMoney != null && discountMoney.compareTo(BigDecimal.ZERO) > 0) {
|
||||
// 如果优惠金额大于等于0,直接使用;否则用折扣率计算
|
||||
if (discountMoney != null && discountMoney.compareTo(BigDecimal.ZERO) >= 0) {
|
||||
discountAmount = discountMoney;
|
||||
} else {
|
||||
if (discountRate == null) {
|
||||
|
||||
Reference in New Issue
Block a user