燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2024-03-22 11088dfe711d9dd4208d8204bc06a91276e2d76a
src/main/java/com/yssh/config/ScheduleConfig.java
@@ -15,15 +15,15 @@
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());
@@ -46,11 +46,17 @@
   @Resource
   XlsReportService xlsReportService;
   @Resource
   EmailService emailService;
   @Value("${csv.voc_max}")
   private int vocMax = 96;
   @Value("${csv.cron_max}")
   private int cronMax = 48;
   @Value("${email.enable}")
   private Boolean enableEmail;
   private final static List<String> md5List = new ArrayList<>();
@@ -235,4 +241,14 @@
         }
      }
   }
   @Scheduled(cron = "${email.times}")
   public void autoCalcData() {
      if (enableEmail) {
         //System.out.println("${email.times}");
         logger.info("***************** 开始数据预警计算 *****************" + "\n");
         emailService.calcData();
         logger.info("***************** 数据预警计算完成 *****************" + "\n");
      }
   }
}