| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.github.biyanwen.EasyCsv; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Component |
| | | @Configuration |
| | | @EnableScheduling |
| | | public class ScheduleConfig { |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | |
| | | @Scheduled(cron = "${email.times}") |
| | | public void autoCalcData() { |
| | | if (enableEmail) { |
| | | //emailService.calcData(); |
| | | System.out.println("${email.times}"); |
| | | //System.out.println("${email.times}"); |
| | | logger.info("***************** 开始数据预警计算 *****************" + "\n"); |
| | | emailService.calcData(); |
| | | logger.info("***************** 数据预警计算完成 *****************" + "\n"); |
| | | } |
| | | } |
| | | } |