注释user表会员到期字段

This commit is contained in:
wuchunlei
2025-01-22 13:45:57 +08:00
parent 6ac28ccf8a
commit 0235c31e82

View File

@@ -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));
// }
}