SalsDetailTask.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package com.kmall.admin.task;
  2. import com.kmall.admin.service.SalesDetailService;
  3. import org.apache.commons.logging.Log;
  4. import org.apache.commons.logging.LogFactory;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.scheduling.annotation.EnableAsync;
  7. import org.springframework.scheduling.annotation.EnableScheduling;
  8. import org.springframework.scheduling.annotation.Scheduled;
  9. import org.springframework.stereotype.Component;
  10. /**
  11. * 线下订单数据推送接口
  12. */
  13. @Component("salsDetailTask")
  14. @EnableScheduling
  15. @EnableAsync
  16. public class SalsDetailTask {
  17. private static Log logger = LogFactory.getLog(SalsDetailTask.class);
  18. @Autowired
  19. private SalesDetailService salesDetailService;
  20. /**
  21. * 每天向eccs推送销售明细数据
  22. */
  23. @Scheduled(cron = "0 30 0 * * ?")
  24. public void pushSalesDetailData() {
  25. logger.info(">>>>>>>>>>>>>>>>>>>>pushSalesDetailData is start ");
  26. salesDetailService.pushSalesDetailData();
  27. logger.info(">>>>>>>>>>>>>>>>>>>>pushSalesDetailData is end ");
  28. }
  29. /**
  30. * 每天向eccs重推销售明细数据
  31. */
  32. @Scheduled(cron = "0 30 0 * * ?")
  33. public void pushSalesDetailDataAgain() {
  34. logger.info(">>>>>>>>>>>>>>>>>>>>pushSalesDetailDataAgain is start ");
  35. salesDetailService.pushSalesDetailDataAgain();
  36. logger.info(">>>>>>>>>>>>>>>>>>>>pushSalesDetailDataAgain is end ");
  37. }
  38. }