UserWageTask.java 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package cn.com.lzt.userwage.timeTask;
  2. import java.util.Date;
  3. import org.jeecgframework.core.util.ApplicationContextUtil;
  4. import org.quartz.Job;
  5. import org.quartz.JobExecutionContext;
  6. import org.quartz.JobExecutionException;
  7. import org.springframework.stereotype.Service;
  8. import cn.com.lzt.userwage.service.UserPayrollServiceI;
  9. @Service("userWageTask")
  10. public class UserWageTask implements Job{
  11. public void userPayroll(){
  12. long start = System.currentTimeMillis();
  13. org.jeecgframework.core.util.LogUtil.info("===================工资核算定时任务开始===================");
  14. try {
  15. System.out.println("===================工资核算定时任务开始"+new Date());
  16. UserPayrollServiceI userPayrollServiceI = ApplicationContextUtil
  17. .getContext().getBean(UserPayrollServiceI.class);
  18. userPayrollServiceI.userPayrollOverride();
  19. System.out.println("===================工资核算定时任务结束"+new Date());
  20. } catch (Exception e) {
  21. e.printStackTrace();
  22. org.jeecgframework.core.util.LogUtil.trace(e.getMessage(), e);
  23. }
  24. org.jeecgframework.core.util.LogUtil.info("===================工资核算定时任务结束===================");
  25. long end = System.currentTimeMillis();
  26. long times = end - start;
  27. org.jeecgframework.core.util.LogUtil.info("总耗时"+times+"毫秒");
  28. }
  29. @Override
  30. public void execute(JobExecutionContext arg0) throws JobExecutionException {
  31. userPayroll();
  32. }
  33. }