AcqGoodsSeatSchedule.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package com.emato.cus.supervise.schedule;
  2. import com.emato.cus.supervise.biz.acqGoodsSeat.AcqGoodsSeatBiz;
  3. import com.emato.cus.supervise.util.LocalDateTimeUtils;
  4. import org.slf4j.Logger;
  5. import org.slf4j.LoggerFactory;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.context.annotation.Configuration;
  8. import org.springframework.scheduling.annotation.EnableScheduling;
  9. import org.springframework.scheduling.annotation.Scheduled;
  10. /**
  11. * 库位货物数据 计划任务
  12. * @author zengjunlin
  13. * @version 1.0
  14. * 2018-02-03 16:18
  15. */
  16. @Configuration
  17. @EnableScheduling
  18. public class AcqGoodsSeatSchedule {
  19. private static final Logger logger = LoggerFactory.getLogger(AcqGoodsSeatSchedule.class);
  20. @Autowired
  21. private AcqGoodsSeatBiz acqGoodsSeatBiz;
  22. /**
  23. * 库位货物数据
  24. * 每30分钟1次
  25. */
  26. //每月1号开始,每天10,12,15,18,22点各1次,共5次
  27. @Scheduled(cron = "0 0 10,12,15,18,22 1/1 * ?")
  28. // @Scheduled(cron = "0 0/1 * * * ? ")
  29. public void timerUp() {
  30. logger.info("==================== 库位货物数据::监控数据读取开始 ====================");
  31. String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
  32. logger.info("--- 任务开始时间: {}", begDateTime);
  33. acqGoodsSeatBiz.task();
  34. String endDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
  35. logger.info("--- 任务结束时间: {}", endDateTime);
  36. logger.info("==================== 库位货物数据::监控数据读取结束 ====================");
  37. }
  38. }