| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package cn.com.lzt.overtimestats.timetask;
- import java.util.Date;
- import org.jeecgframework.core.util.ApplicationContextUtil;
- import org.quartz.Job;
- import org.quartz.JobExecutionContext;
- import org.quartz.JobExecutionException;
- import org.springframework.stereotype.Service;
- import cn.com.lzt.overtimestats.service.OvertimeStatsServiceI;
- /**
- *
- * @ClassName:SmsSendTask 加班统计定时任务类
- * @Description: TODO
- * @author zhijia.wang
- * @date 2017-11-16 20:11:35
- *
- */
- @Service("overtimeStatisticsTask")
- public class OvertimeStatisticsTask implements Job{
-
- /*@Scheduled(cron="0 0/1 * * * ?")*/
- public void overtimeStatistics() {
- long start = System.currentTimeMillis();
- org.jeecgframework.core.util.LogUtil.info("===================加班统计定时任务开始===================");
- try {
- System.out.println("===================加班统计定时任务开始"+new Date());
-
- OvertimeStatsServiceI overtimeStatsServiceI = ApplicationContextUtil
- .getContext().getBean(OvertimeStatsServiceI.class);
-
- overtimeStatsServiceI.overtimeStatsTaskData();
- System.out.println("===================加班统计定时任务结束"+new Date());
- } catch (Exception e) {
- e.printStackTrace();
- }
- org.jeecgframework.core.util.LogUtil.info("===================加班统计定时任务结束===================");
- long end = System.currentTimeMillis();
- long times = end - start;
- org.jeecgframework.core.util.LogUtil.info("总耗时"+times+"毫秒");
- }
-
- @Override
- public void execute(JobExecutionContext arg0) throws JobExecutionException {
- overtimeStatistics();
- }
-
- }
|