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");
|
}
|
|
}
|