AcqInventoryInfo.java 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.emato.cus.supervise.schedule;
  2. import com.emato.cus.supervise.biz.acqInventoryInfo.AcqInventoryInfoBiz;
  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-01 16:24
  15. */
  16. @Configuration
  17. @EnableScheduling
  18. public class AcqInventoryInfo {
  19. private static final Logger logger = LoggerFactory.getLogger(AcqInventoryInfo.class);
  20. @Autowired
  21. private AcqInventoryInfoBiz acqInventoryInfoBiz;
  22. /**
  23. * 货物库存数据
  24. */
  25. //每月1号开始,每天12,22点各1次,共2次
  26. //@Scheduled(cron = "0 0 12,22 1/1 * ?")
  27. @Scheduled(cron = "10/10 * * * * ? ")
  28. public void timer() {
  29. logger.info("==================== 货物库存数据::监控数据读取开始 ====================");
  30. String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
  31. logger.info("--- 任务开始时间: {}", begDateTime);
  32. acqInventoryInfoBiz.task();
  33. String endDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
  34. logger.info("--- 任务结束时间: {}", endDateTime);
  35. logger.info("==================== 货物库存数据::监控数据读取结束 ====================");
  36. }
  37. }