|
@@ -240,7 +240,7 @@ public class LifeDiscountCouponStoreFriendServiceImpl extends ServiceImpl<LifeDi
|
|
|
// 设置查询条件:优惠券的ID等于当前遍历到的优惠券ID
|
|
// 设置查询条件:优惠券的ID等于当前遍历到的优惠券ID
|
|
|
queryWrapper.eq(LifeDiscountCoupon::getId, coupon.getCouponId());
|
|
queryWrapper.eq(LifeDiscountCoupon::getId, coupon.getCouponId());
|
|
|
// 设置查询条件:优惠券的结束日期大于等于当前日期,即优惠券在有效期内
|
|
// 设置查询条件:优惠券的结束日期大于等于当前日期,即优惠券在有效期内
|
|
|
- queryWrapper.ge(LifeDiscountCoupon::getEndDate, currentDate);
|
|
|
|
|
|
|
+ queryWrapper.ge(LifeDiscountCoupon::getValidDate, currentDate);
|
|
|
// 设置查询条件:优惠券还有库存
|
|
// 设置查询条件:优惠券还有库存
|
|
|
queryWrapper.gt(LifeDiscountCoupon::getSingleQty, 0);
|
|
queryWrapper.gt(LifeDiscountCoupon::getSingleQty, 0);
|
|
|
|
|
|
|
@@ -263,7 +263,7 @@ public class LifeDiscountCouponStoreFriendServiceImpl extends ServiceImpl<LifeDi
|
|
|
// 设置该优惠券的领取时间为当前时间
|
|
// 设置该优惠券的领取时间为当前时间
|
|
|
lifeDiscountCouponUser.setReceiveTime(new Date());
|
|
lifeDiscountCouponUser.setReceiveTime(new Date());
|
|
|
// 设置该优惠券的过期时间为优惠券本身的结束日期
|
|
// 设置该优惠券的过期时间为优惠券本身的结束日期
|
|
|
- lifeDiscountCouponUser.setExpirationTime(lifeDiscountCoupon.getEndDate());
|
|
|
|
|
|
|
+ lifeDiscountCouponUser.setExpirationTime(lifeDiscountCoupon.getValidDate());
|
|
|
// 设置该优惠券的状态为待使用
|
|
// 设置该优惠券的状态为待使用
|
|
|
lifeDiscountCouponUser.setStatus(Integer.parseInt(DiscountCouponEnum.WAITING_USED.getValue()));
|
|
lifeDiscountCouponUser.setStatus(Integer.parseInt(DiscountCouponEnum.WAITING_USED.getValue()));
|
|
|
// 将该用户优惠券记录插入到数据库中
|
|
// 将该用户优惠券记录插入到数据库中
|