满折优惠活动+满折优惠券价格计算不正确。

This commit is contained in:
lifenlong 2021-07-20 19:27:37 +08:00
parent d6d0afa23a
commit 6a13351bc3
2 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, Mem
if (coupon.getPublishNum() != 0 && coupon.getReceivedNum() >= coupon.getPublishNum()) {
throw new ServiceException(ResultCode.COUPON_NUM_INSUFFICIENT_ERROR);
}
if (haveCoupons >= coupon.getCouponLimitNum()) {
if (!coupon.getCouponLimitNum().equals(0) && haveCoupons >= coupon.getCouponLimitNum()) {
throw new ServiceException("此优惠券最多领取" + coupon.getCouponLimitNum() + "");
}
}

View File

@ -484,8 +484,8 @@ public class PromotionPriceServiceImpl implements PromotionPriceService {
goodsSkuPromotionPrice.setTotalDiscountPrice(distributeDiscountTotalPrice);
//单品成交价
double finalPrice = CurrencyUtil.sub(goodsSkuPromotionPrice.getTotalOriginalPrice(), distributeDiscountTotalPrice);
goodsSkuPromotionPrice.setFinalePrice(finalPrice);
goodsSkuPromotionPrice.setTotalFinalePrice(CurrencyUtil.mul(finalPrice, goodsSkuPromotionPrice.getNumber()));
goodsSkuPromotionPrice.setFinalePrice(CurrencyUtil.div(finalPrice, goodsSkuPromotionPrice.getNumber()));
goodsSkuPromotionPrice.setTotalFinalePrice(finalPrice);
fullDiscount.setPromotionName(PromotionTypeEnum.FULL_DISCOUNT.name());
goodsSkuPromotionPrice.getJoinPromotion().add(fullDiscount);