折扣券 除100
This commit is contained in:
@@ -432,8 +432,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
}
|
}
|
||||||
thresholdCalculate(orderDetails, isAllFoods, couponFoodIds, coupon.getFullAmount());
|
thresholdCalculate(orderDetails, isAllFoods, couponFoodIds, coupon.getFullAmount());
|
||||||
if (type == 3) {
|
if (type == 3) {
|
||||||
BigDecimal rate = new BigDecimal(record.getDiscountRate());
|
BigDecimal rate = new BigDecimal(100 - record.getDiscountRate());
|
||||||
rateAmount.setPrice(rate.multiply(totalAmount.getPrice().subtract(tempAmount.getPrice()).subtract(prodCouponAmount.getPrice())).setScale(2, RoundingMode.DOWN));
|
rateAmount.setPrice(rate.multiply(totalAmount.getPrice().subtract(tempAmount.getPrice()).subtract(prodCouponAmount.getPrice()))
|
||||||
|
.divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN));
|
||||||
if (coupon.getMaxDiscountAmount().compareTo(BigDecimal.ZERO) > 0 && rateAmount.getPrice().compareTo(coupon.getMaxDiscountAmount()) > 0) {
|
if (coupon.getMaxDiscountAmount().compareTo(BigDecimal.ZERO) > 0 && rateAmount.getPrice().compareTo(coupon.getMaxDiscountAmount()) > 0) {
|
||||||
rateAmount.setPrice(coupon.getMaxDiscountAmount());
|
rateAmount.setPrice(coupon.getMaxDiscountAmount());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user