AcqGoodsSeatSchedule.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. */
  25. @Scheduled(cron = "${jobs.schedule.seat}")
  26. public void timerUp() {
  27. logger.info("==================== 库位货物数据::监控数据读取开始 ====================");
  28. String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
  29. logger.info("--- 任务开始时间: {}", begDateTime);
  30. acqGoodsSeatBiz.task();
  31. String endDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
  32. logger.info("--- 任务结束时间: {}", endDateTime);
  33. logger.info("==================== 库位货物数据::监控数据读取结束 ====================");
  34. }
  35. }