mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 01:01:52 +08:00
【功能修复】MALL:优惠劵的折扣计算不正确
This commit is contained in:
parent
ad22a9d516
commit
3d9ec1966f
@ -90,7 +90,7 @@ public class TradeCouponPriceCalculator implements TradePriceCalculator {
|
|||||||
if (PromotionDiscountTypeEnum.PRICE.getType().equals(coupon.getDiscountType())) { // 减价
|
if (PromotionDiscountTypeEnum.PRICE.getType().equals(coupon.getDiscountType())) { // 减价
|
||||||
return coupon.getDiscountPrice();
|
return coupon.getDiscountPrice();
|
||||||
} else if (PromotionDiscountTypeEnum.PERCENT.getType().equals(coupon.getDiscountType())) { // 打折
|
} else if (PromotionDiscountTypeEnum.PERCENT.getType().equals(coupon.getDiscountType())) { // 打折
|
||||||
int couponPrice = totalPayPrice * coupon.getDiscountPercent() / 100;
|
int couponPrice = totalPayPrice - (totalPayPrice * coupon.getDiscountPercent() / 100);
|
||||||
return coupon.getDiscountLimitPrice() == null ? couponPrice
|
return coupon.getDiscountLimitPrice() == null ? couponPrice
|
||||||
: Math.min(couponPrice, coupon.getDiscountLimitPrice()); // 优惠上限
|
: Math.min(couponPrice, coupon.getDiscountLimitPrice()); // 优惠上限
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user