郑永安
2023-06-19 2fcd97552d16718cc7997629fd637a73a5a4483f
src/main/java/com/gk/firework/Scheduls/ReportTask/HistoryStockRobot.java
对比新文件
@@ -0,0 +1,28 @@
package com.gk.firework.Scheduls.ReportTask;
import com.gk.firework.Service.HistoryStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
@EnableScheduling
@ConditionalOnProperty(prefix = "historystock.robot",name = "enabled",havingValue = "true")
public class HistoryStockRobot {
    @Autowired
    private HistoryStockService historyStockService;
    /**
     * @Description: 历史库存数据保留到新表-historystock
     */
    @Scheduled(cron = "0 0 4 * * ?")
//    @Scheduled(cron = "0/20 * * * * ?")
    public void hisStockPersisting() {
        historyStockService.hisStockPersisting();
    }
}