Authored by wangshusheng

定时任务修改

... ... @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.yoho.activity.common.utils.PropertiesUtil;
import com.yoho.activity.queue.service.ILuckyUserService;
/**
... ... @@ -22,26 +23,20 @@ public class SendUserAwardTimer {
static Logger log = LoggerFactory.getLogger(SendUserAwardTimer.class);
@Value("${is_task_enable}")
private String taskFlag = "true";
public String getTaskFlag() {
return taskFlag;
}
public void setTaskFlag(String taskFlag) {
this.taskFlag = taskFlag;
}
@Autowired
private ILuckyUserService luckyUserService;
@Scheduled(fixedDelay = 600 * 1000)
public void sendAwardToLuckyUser() {
if("true".equals(taskFlag)){
// 对中奖表中的所有记录做发放
luckyUserService.sendAwardToLuckyUser(null);
boolean execute = PropertiesUtil.getExecuteTask();
if (!execute) {
log.info("properties is false exit task");
return;
}
// 对中奖表中的所有记录做发放
luckyUserService.sendAwardToLuckyUser(null);
}
}
... ...