ssm框架的定时任务

破产用户统计,破产1次,2次,3次
于每天23.57分开始执行定时任务。

@Component
public static BrokenTask{
private static final Log log=LogFactory.getLog(BrokenCountTask.class);
@Secheduled(cron=”00 57 23 * *?”)
public void saveYyBrokenCount(){
if(!GameConfig.DATATASK_ON)return;
log.debug(“开始计算破产数据:”+new Date());
if(brokenMap==null){
log.error(“查询破产次数出错”);
return;
}
YyBrokenCountVo vo=new YyBrokenCountVo();
vo.setRq();
vo.setOneTimes(brokenmap.get(“oneTimes”));
vo.setTwoTimes(brokenmap.get(“TwoTimes”));
vo.setThreeTimes(brokenmap.get(“threeTimes”));
brokenCountService.insertVO(vo);
}
}

你可能感兴趣的:(定时任务)