MyScheduledTask.java 741 B

12345678910111213141516171819202122232425262728
  1. package com.huimv.produce.task;
  2. import com.huimv.produce.produce.service.IWeight;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.scheduling.annotation.Scheduled;
  5. import org.springframework.stereotype.Component;
  6. import java.text.ParseException;
  7. /**
  8. * @Project : huimv.shiwan
  9. * @Package : com.huimv.biosafety.uface.controller
  10. * @Description : TODO
  11. * @Version : 1.0
  12. * @Author : ZhuoNing
  13. * @Create : 2020-12-25
  14. **/
  15. @Component
  16. public class MyScheduledTask {
  17. @Autowired
  18. private IWeight iWeight;
  19. // @Scheduled(cron = "0 0/10 * * * ?")
  20. // @Scheduled(cron = "0/10 * * * * ?")
  21. public void scheduledTask1() throws ParseException {
  22. iWeight.autoGenerateDayWeight();
  23. }
  24. }