AcqGoodsMoveSchedule.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.emato.cus.supervise.schedule;
  2. import com.emato.cus.supervise.biz.acqGoodsMoveSchedule.up.AcqGoodsMoveUpBiz;
  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. * 货物库位移动数据 计划任务
  13. * @author zengjunlin
  14. * @version 1.0
  15. * 2018-02-03 15:18
  16. */
  17. @Configuration
  18. @EnableScheduling
  19. public class AcqGoodsMoveSchedule {
  20. private static final Logger logger = LoggerFactory.getLogger(AcqGoodsMoveSchedule.class);
  21. @Autowired
  22. private AcqGoodsMoveUpBiz acqGoodsMoveUpBiz;
  23. /**
  24. * 货物库位移动数据
  25. */
  26. //每月1号开始,每天12,18点执行各1次,共2次
  27. @Scheduled(cron = "0 0 12,18 1/1 * ?")
  28. public void timerUp() {
  29. logger.info("==================== 货物库位移动数据:上架:监控数据读取开始 ====================");
  30. String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
  31. logger.info("--- 任务开始时间: {}", begDateTime);
  32. acqGoodsMoveUpBiz.task();
  33. String endDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
  34. logger.info("--- 任务结束时间: {}", endDateTime);
  35. logger.info("==================== 货物库位移动数据:上架:监控数据读取结束 ====================");
  36. }
  37. }