注释user表会员到期字段
This commit is contained in:
@@ -21,26 +21,26 @@ public class SysTask {
|
||||
private MyUserService userService;
|
||||
|
||||
//
|
||||
@Scheduled(cron = "0 0 2 ? * * ")
|
||||
public void run() throws InterruptedException {
|
||||
|
||||
List<MyUserEntity> users = userService.getBaseMapper().selectList(new QueryWrapper<>());
|
||||
for (MyUserEntity user : users) {
|
||||
Date vipValidtime = user.getVipValidtime();
|
||||
Date date = new Date();
|
||||
long times = date.getTime() - vipValidtime.getTime();
|
||||
|
||||
if (times <= 0) {
|
||||
String vip = user.getVip();
|
||||
if (vip.equals("1")) {
|
||||
user.setVip("0");
|
||||
userService.save(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// System.out.println(Thread.currentThread().getName()+"=====>>>>>使用cron {}"+(System.currentTimeMillis()/1000));
|
||||
}
|
||||
// @Scheduled(cron = "0 0 2 ? * * ")
|
||||
// public void run() throws InterruptedException {
|
||||
//
|
||||
// List<MyUserEntity> users = userService.getBaseMapper().selectList(new QueryWrapper<>());
|
||||
// for (MyUserEntity user : users) {
|
||||
// Date vipValidtime = user.getVipValidtime();
|
||||
// Date date = new Date();
|
||||
// long times = date.getTime() - vipValidtime.getTime();
|
||||
//
|
||||
// if (times <= 0) {
|
||||
// String vip = user.getVip();
|
||||
// if (vip.equals("1")) {
|
||||
// user.setVip("0");
|
||||
// userService.save(user);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//// System.out.println(Thread.currentThread().getName()+"=====>>>>>使用cron {}"+(System.currentTimeMillis()/1000));
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user