RefreshTask.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package thyyxxk.wxservice_server.scheduled;
  2. import lombok.extern.slf4j.Slf4j;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.scheduling.annotation.Scheduled;
  5. import org.springframework.stereotype.Component;
  6. import thyyxxk.wxservice_server.service.AppointmentService;
  7. import thyyxxk.wxservice_server.utils.TradeVectorUtil;
  8. /**
  9. * @description: 各种定时刷新任务
  10. * @author: DingJie
  11. * @create: 2021/7/517:21
  12. */
  13. @Slf4j
  14. @Component
  15. public class RefreshTask {
  16. private final AppointmentService appointmentService;
  17. @Autowired
  18. public RefreshTask(AppointmentService appointmentService) {
  19. this.appointmentService = appointmentService;
  20. }
  21. @Scheduled(cron = "0 0 3 ? * SUN")
  22. public void autoRefreshMzClasses() {
  23. appointmentService.refreshMzClasses();
  24. }
  25. @Scheduled(cron = "0 0 5 * * ?")
  26. public void autoRefreshNightMzClasses() {
  27. appointmentService.refreshNightMzClasses();
  28. }
  29. @Scheduled(cron = "0 0 3 * * ?")
  30. public void clearRefundedVector() {
  31. TradeVectorUtil.clearRefundedVector();
  32. }
  33. }