| | |
| | | @Resource |
| | | private CouponCityService cityService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询注册赠送优惠券 判断当前优惠券限领数量 |
| | |
| | | // 优惠券已领取数量 |
| | | 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; |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<CouponPackageResp>> queryAppuserCouponList(CouponPackageReq req) { |
| | | public ResultUtil<List<CouponPackageResp>> queryCouponPackage(CouponPackageReq req) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | |
| | | 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())); |
| | | break; |
| | | |
| | | case 2: |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | break; |
| | | case 3: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | break; |
| | |
| | | } |
| | | return true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | } |