mirror of
https://github.com/YunaiV/ruoyi-vue-pro.git
synced 2025-10-30 18:16:57 +08:00
修复用户领取不限发放数量的优惠券时的校验错误
This commit is contained in:
@ -284,7 +284,8 @@ public class CouponServiceImpl implements CouponService {
|
|||||||
}
|
}
|
||||||
// 校验发放数量不能过小(仅在 CouponTakeTypeEnum.USER 用户领取时)
|
// 校验发放数量不能过小(仅在 CouponTakeTypeEnum.USER 用户领取时)
|
||||||
if (CouponTakeTypeEnum.isUser(couponTemplate.getTakeType())
|
if (CouponTakeTypeEnum.isUser(couponTemplate.getTakeType())
|
||||||
&& ObjUtil.notEqual(couponTemplate.getTakeLimitCount(), CouponTemplateDO.TAKE_LIMIT_COUNT_MAX) // 非不限制
|
&& ObjUtil.notEqual(couponTemplate.getTakeLimitCount(), CouponTemplateDO.TAKE_LIMIT_COUNT_MAX) // 校验不限制领取数
|
||||||
|
&& ObjUtil.notEqual(couponTemplate.getTotalCount(), CouponTemplateDO.TOTAL_COUNT_MAX) // 校验不限制发放数量
|
||||||
&& couponTemplate.getTakeCount() + userIds.size() > couponTemplate.getTotalCount()) {
|
&& couponTemplate.getTakeCount() + userIds.size() > couponTemplate.getTotalCount()) {
|
||||||
throw exception(COUPON_TEMPLATE_NOT_ENOUGH);
|
throw exception(COUPON_TEMPLATE_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user