StockTask.java 523 B

123456789101112131415161718192021
  1. package com.uas.eis.task;
  2. import com.uas.eis.service.StockService;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.scheduling.annotation.Scheduled;
  5. import org.springframework.stereotype.Component;
  6. /**
  7. * Created by luhg on 2018/4/24.
  8. * 出入库定时任务
  9. */
  10. @Component
  11. public class StockTask {
  12. @Autowired
  13. StockService stockService;
  14. @Scheduled(cron = "0 0/3 * * * ?")
  15. public void autoPost() {
  16. stockService.autoPost(); //出入库定时过账
  17. }
  18. }