【同步】BOOT 和 CLOUD 的功能

This commit is contained in:
YunaiV
2024-07-28 23:23:53 +08:00
parent dff3e8b666
commit e5c1ce7640
3 changed files with 94 additions and 34 deletions

View File

@@ -90,7 +90,7 @@ public class TradeCouponPriceCalculator implements TradePriceCalculator {
if (PromotionDiscountTypeEnum.PRICE.getType().equals(coupon.getDiscountType())) { // 减价
return coupon.getDiscountPrice();
} 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
: Math.min(couponPrice, coupon.getDiscountLimitPrice()); // 优惠上限
}