优惠券折扣条件判断不可能同时成立

Signed-off-by: Fxz <2235602974@qq.com>
This commit is contained in:
Fxz 2022-08-27 06:07:44 +00:00 committed by Gitee
parent 8387e03254
commit daed961a99
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -190,7 +190,7 @@ public class CouponServiceImpl extends AbstractPromotionsServiceImpl<CouponMappe
}
//打折优惠券大于10折
boolean discountCoupon = (promotions.getCouponType().equals(CouponTypeEnum.DISCOUNT.name())
&& (promotions.getCouponDiscount() < 0 && promotions.getCouponDiscount() > 10));
&& (promotions.getCouponDiscount() < 0 || promotions.getCouponDiscount() > 10));
if (discountCoupon) {
throw new ServiceException(ResultCode.COUPON_DISCOUNT_ERROR);
}