Commit 3d9ec1966f97f5deaac5a5b1ef2efaec1a2dca3c

Authored by YunaiV
1 parent ad22a9d5

【功能修复】MALL:优惠劵的折扣计算不正确

yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeCouponPriceCalculator.java
... ... @@ -90,7 +90,7 @@ public class TradeCouponPriceCalculator implements TradePriceCalculator {
90 90 if (PromotionDiscountTypeEnum.PRICE.getType().equals(coupon.getDiscountType())) { // 减价
91 91 return coupon.getDiscountPrice();
92 92 } else if (PromotionDiscountTypeEnum.PERCENT.getType().equals(coupon.getDiscountType())) { // 打折
93   - int couponPrice = totalPayPrice * coupon.getDiscountPercent() / 100;
  93 + int couponPrice = totalPayPrice - (totalPayPrice * coupon.getDiscountPercent() / 100);
94 94 return coupon.getDiscountLimitPrice() == null ? couponPrice
95 95 : Math.min(couponPrice, coupon.getDiscountLimitPrice()); // 优惠上限
96 96 }
... ...