无关风月
2024-08-24 80835bcc12f4788c1a88da61e623b362e57f1cb1
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/task/TaskUtil.java
@@ -39,23 +39,10 @@
                    .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) {