李宇
2021-01-28 2f52e8c752122625f189ae7657e621db0d6d253c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.nanometer.smartlab.api.schedule;
 
import com.nanometer.smartlab.service.SysUserService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import java.util.Date;
 
@Component
public class UserPointSchedule {
    private static Logger logger = Logger.getLogger(UserPointSchedule.class);
    @Lazy
    @Autowired
    private SysUserService sysUserService;
 
    @Scheduled(cron = "0 0 12 * * ?")
    public void updateUserPoint() {
        logger.info("updateUserPoint start,and now is "+new Date());
        sysUserService.updateUserPointBySelective(20000,null);
        logger.info("updateUserPoint end");
    }
 
}