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(); } }