| | |
| | | // 优惠券已领取数量 |
| | | int couponId = ucService.count(new QueryWrapper<UserCoupon>().eq("couponId", coupon.getId())); |
| | | // 用户已领取该优惠券数量 |
| | | int count = ucService.count(new QueryWrapper<UserCoupon>().eq("couponId", coupon.getId() |
| | | ).eq("userId", userId)); |
| | | int count = ucService.count(new QueryWrapper<UserCoupon>().eq("couponId", coupon.getId()).eq("userId", userId)); |
| | | if (couponId >= quantityIssued) { |
| | | continue; |
| | | } |
| | |
| | | coupon.setIllustrate(dataVo.getIllustrate()); |
| | | coupon.setDistributionMethod(dataVo.getDistributionMethod()); |
| | | coupon.setRedemptionMethod(dataVo.getExchangeMethod()); |
| | | if (dataVo.getExchangeMethod() != null) { |
| | | if (dataVo.getExchangeMethod() != null&&dataVo.getDistributionMethod()!=4) { |
| | | switch (dataVo.getExchangeMethod()) { |
| | | case 1: |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | |
| | | } |
| | | return true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | } |