| | |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | LocalDateTime localDateTime = LocalDateTime.now().minusDays(7); |
| | | long between = ChronoUnit.DAYS.between(LocalDateTime.now(),localDateTime); |
| | | System.err.println(between); |
| | | } |
| | | @Scheduled(cron = "0 0 7 * * ?") |
| | | public void taskSivenDay() { |
| | | try { |
| | |
| | | for (AppUser appUser : list) { |
| | | if (appUser.getVipExpireTime()!=null && appUser.getVipExpireTime().isAfter(now)){ |
| | | // 计算两个now和time的天数差 |
| | | long between = ChronoUnit.DAYS.between(appUser.getVipExpireTime(), now); |
| | | if (between<=7){ |
| | | long between = ChronoUnit.DAYS.between(now,appUser.getVipExpireTime()); |
| | | if (between<=7 &&between>=0){ |
| | | NoticeRecord noticeRecord = new NoticeRecord(); |
| | | noticeRecord.setAppUserId(appUser.getId()); |
| | | noticeRecord.setReadStatus(1); |
| | |
| | | } |
| | | AppUserTree one = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, appUser.getId()) |
| | | .eq(AppUserTree::getSowAgain, 2).one(); |
| | | if(one.getTaskOne()==2||one.getTaskTwo()==2){ |
| | | if(one!=null&&(one.getTaskOne()==2||one.getTaskTwo()==2)){ |
| | | NoticeRecord noticeRecord = new NoticeRecord(); |
| | | noticeRecord.setAppUserId(appUser.getId()); |
| | | noticeRecord.setReadStatus(1); |