package cn.com.lzt.userwage.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.userwage.service.UserPayrollServiceI; @Service("userWageTask") public class UserWageTask implements Job{ public void userPayroll(){ long start = System.currentTimeMillis(); org.jeecgframework.core.util.LogUtil.info("===================工资核算定时任务开始==================="); try { System.out.println("===================工资核算定时任务开始"+new Date()); UserPayrollServiceI userPayrollServiceI = ApplicationContextUtil .getContext().getBean(UserPayrollServiceI.class); userPayrollServiceI.userPayrollOverride(); System.out.println("===================工资核算定时任务结束"+new Date()); } catch (Exception e) { e.printStackTrace(); org.jeecgframework.core.util.LogUtil.trace(e.getMessage(), e); } 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 { userPayroll(); } }