| | |
| | | |
| | | @Override |
| | | public CouponTemplateVO getHomeActivityEffectAlert(QueryActivityEffectCouponDTO dto) { |
| | | dto.setUserId(SecurityUtils.getUserId()); |
| | | |
| | | // 存在用户是空的情况 |
| | | final CouponTemplateVO homeActivityEffectAlert = couponTemplateMapperCustom.getHomeActivityEffectAlert(dto); |
| | | if(null!=homeActivityEffectAlert){ |
| | | // 查看当前已经领取了几张 |
| | | final Integer getCnt = couponRecordService.getUserGainCouponRecordAmountByUserId(homeActivityEffectAlert.getId(), SecurityUtils.getUserId()); |
| | | // 如果当前领取的数量小于限制领取的数量的时候,可以再次领取 |
| | | if(null!=homeActivityEffectAlert.getGetLimit() && null!=getCnt |
| | | && homeActivityEffectAlert.getGetLimit().compareTo(getCnt)>0){ |
| | | if(null!=homeActivityEffectAlert ){ |
| | | if(StringUtils.isNotBlank(SecurityUtils.getUserId()) ){ |
| | | // 查看当前已经领取了几张 |
| | | final Integer getCnt = couponRecordService.getUserGainCouponRecordAmountByUserId(homeActivityEffectAlert.getId(), SecurityUtils.getUserId()); |
| | | // 如果当前领取的数量小于限制领取的数量的时候,可以再次领取 |
| | | if(null!=homeActivityEffectAlert.getGetLimit() && null!=getCnt |
| | | && homeActivityEffectAlert.getGetLimit().compareTo(getCnt)>0){ |
| | | return homeActivityEffectAlert; |
| | | } |
| | | }else{ |
| | | return homeActivityEffectAlert; |
| | | } |
| | | } |