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