| | |
| | | .orderByDesc(TAppUserVipDetail::getStartTime).list(); |
| | | //判断sendNum是否包括当前月份 |
| | | for (TAppUserVipDetail recentDetail : recentDetails) { |
| | | if (recentDetail.getSendMonth()!=null&&recentDetail.getSendMonth().contains(monthNum+"")){ |
| | | //如果包含,则不执行操作 |
| | | continue; |
| | | }else { |
| | | //如果不包含,则更新sendNum,并且赠送优惠卷 |
| | | TAppUserVipDetail byId = tAppUserVipDetailService.getById(recentDetail.getId()); |
| | | if (byId==null){ |
| | | byId.setSendMonth(byId.getSendMonth()+monthNum); |
| | | }else{ |
| | | byId.setSendMonth(","+byId.getSendMonth()+monthNum); |
| | | } |
| | | |
| | | |
| | | tAppUserVipDetailService.updateById(byId); |
| | | //赠送优惠卷 |
| | | tAppUserVipDetailService.giveVipCoupun(recentDetail.getAppUserId(), recentDetail.getVipId()); |
| | | } |
| | | tAppUserVipDetailService.giveVipCoupun(recentDetail.getAppUserId(), recentDetail.getVipId(),recentDetail.getId(),monthNum); |
| | | |
| | | |
| | | } |
| | | } catch (Exception e) { |