|
@@ -1,164 +1,164 @@
|
|
|
-package com.gyee.generation.task;
|
|
|
-
|
|
|
-import com.gyee.generation.service.*;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
-import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
-import org.springframework.scheduling.annotation.Scheduled;
|
|
|
-import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-import java.util.Date;
|
|
|
-
|
|
|
-@Component
|
|
|
-@EnableAsync // 启用异步方法执行
|
|
|
-public class AnalysisTask {
|
|
|
- private static final Logger logger = LoggerFactory.getLogger(AnalysisTask.class);
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private PowerCurveFittingByTimeService powerCurveFittingByTimeService;
|
|
|
- @Autowired
|
|
|
- private InputOrOutPutService inputOrOutPutService;
|
|
|
- @Autowired
|
|
|
- private WindturbineGoodnessService windturbineGoodnessService;
|
|
|
- @Autowired
|
|
|
- private EquipmentInfo3Service equipmentInfo3Service;
|
|
|
- @Autowired
|
|
|
- private EquipmentInfo2Service equipmentInfo2Service;
|
|
|
- @Autowired
|
|
|
- private EquipmentInfo4Service equipmentInfo4Service;
|
|
|
- @Autowired
|
|
|
- private EquipmentInfo1Service equipmentInfo1Service;
|
|
|
-
|
|
|
- @Resource
|
|
|
- @Qualifier("taskScheduler") // 指定使用特定的 TaskScheduler
|
|
|
- private ThreadPoolTaskScheduler taskScheduler;
|
|
|
- // 每日1点 - 日曲线偏差
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 0 1 * * ?")
|
|
|
- public void rqxpc() {
|
|
|
- try {
|
|
|
- logger.info("日曲线偏差开始运行");
|
|
|
-
|
|
|
- Date date = new Date();
|
|
|
- powerCurveFittingByTimeService.cureFittingDay(date, "NX_FGS_HA_FDC_STA");
|
|
|
- logger.info("日曲线偏差运行完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("日曲线偏差运行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 每日1点10分 - 月曲线偏差
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 10 1 * * ?")
|
|
|
- public void yqxpc() {
|
|
|
- try {
|
|
|
- logger.info("月曲线偏差开始运行");
|
|
|
- Date date = new Date();
|
|
|
- powerCurveFittingByTimeService.cureFittingMonth(date, "0", null);
|
|
|
- logger.info("月曲线偏差运行完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("月曲线偏差运行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 每5分钟 - 切入切出状态切换记录
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 0/5 * * * ?")
|
|
|
- public void qrqc() {
|
|
|
- try {
|
|
|
- logger.info("切入切出状态切换记录调度程序执行开始");
|
|
|
- inputOrOutPutService.inputOrOutputSpeed(new Date());
|
|
|
- logger.info("切入切出状态切换记录调度任务处理完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("切入切出状态切换记录调度任务执行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 每日1点 - 切入切出统计
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 0 1 * * ?")
|
|
|
- public void qrqctool() {
|
|
|
- try {
|
|
|
- logger.info("切入切出统计调度程序执行开始");
|
|
|
- inputOrOutPutService.inputOrOutput(new Date());
|
|
|
- logger.info("切入切出统计调度任务处理完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("切入切出统计调度任务执行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 每日2点 - 功率一致性系数和拟合优度统计
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 0 2 * * ?")
|
|
|
- public void glyzx() {
|
|
|
- try {
|
|
|
- logger.info("功率一致性系数和拟合优度统计调度程序执行开始");
|
|
|
- windturbineGoodnessService.calWindturbineGoodness(new Date());
|
|
|
- logger.info("功率一致性系数和拟合优度统计调度任务处理完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("功率一致性系数和拟合优度统计调度任务执行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 每15分钟 - 设备指标2
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
- public void sbzb1() {
|
|
|
- try {
|
|
|
- logger.info("设备指标1调度程序执行开始");
|
|
|
- Date date = new Date();
|
|
|
- equipmentInfo1Service.calEquipmentInfoDay(date);
|
|
|
- logger.info("设备指标1调度程序执行完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("设备指标1调度任务执行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 每15分钟 - 设备指标2
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
- public void sbzb2() {
|
|
|
- try {
|
|
|
- logger.info("设备指标2调度程序执行开始");
|
|
|
- Date date = new Date();
|
|
|
- equipmentInfo2Service.calEquipmentInfoDay(date);
|
|
|
- logger.info("设备指标2调度程序执行完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("设备指标2调度任务执行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 每15分钟 - 设备指标3
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
- public void sbzb3() {
|
|
|
- try {
|
|
|
- logger.info("设备指标3调度程序执行开始");
|
|
|
- Date date = new Date();
|
|
|
- equipmentInfo3Service.calEquipmentInfoDay(date);
|
|
|
- logger.info("设备指标3调度程序执行完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("设备指标3调度任务执行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 每15分钟 - 设备指标4
|
|
|
- @Async
|
|
|
- @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
- public void sbzb4() {
|
|
|
- try {
|
|
|
- logger.info("设备指标4调度程序执行开始");
|
|
|
- Date date = new Date();
|
|
|
- equipmentInfo4Service.calEquipmentInfoDay(date);
|
|
|
- logger.info("设备指标4调度程序执行完成");
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("设备指标4调度任务执行失败", e);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+//package com.gyee.generation.task;
|
|
|
+//
|
|
|
+//import com.gyee.generation.service.*;
|
|
|
+//import org.slf4j.Logger;
|
|
|
+//import org.slf4j.LoggerFactory;
|
|
|
+//
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+//import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+//import org.springframework.scheduling.annotation.Async;
|
|
|
+//import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
+//import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+//import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
|
|
+//import org.springframework.stereotype.Component;
|
|
|
+//
|
|
|
+//import javax.annotation.Resource;
|
|
|
+//import java.util.Date;
|
|
|
+//
|
|
|
+//@Component
|
|
|
+//@EnableAsync // 启用异步方法执行
|
|
|
+//public class AnalysisTask {
|
|
|
+// private static final Logger logger = LoggerFactory.getLogger(AnalysisTask.class);
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// private PowerCurveFittingByTimeService powerCurveFittingByTimeService;
|
|
|
+// @Autowired
|
|
|
+// private InputOrOutPutService inputOrOutPutService;
|
|
|
+// @Autowired
|
|
|
+// private WindturbineGoodnessService windturbineGoodnessService;
|
|
|
+// @Autowired
|
|
|
+// private EquipmentInfo3Service equipmentInfo3Service;
|
|
|
+// @Autowired
|
|
|
+// private EquipmentInfo2Service equipmentInfo2Service;
|
|
|
+// @Autowired
|
|
|
+// private EquipmentInfo4Service equipmentInfo4Service;
|
|
|
+// @Autowired
|
|
|
+// private EquipmentInfo1Service equipmentInfo1Service;
|
|
|
+//
|
|
|
+// @Resource
|
|
|
+// @Qualifier("taskScheduler") // 指定使用特定的 TaskScheduler
|
|
|
+// private ThreadPoolTaskScheduler taskScheduler;
|
|
|
+// // 每日1点 - 日曲线偏差
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 0 1 * * ?")
|
|
|
+// public void rqxpc() {
|
|
|
+// try {
|
|
|
+// logger.info("日曲线偏差开始运行");
|
|
|
+//
|
|
|
+// Date date = new Date();
|
|
|
+// powerCurveFittingByTimeService.cureFittingDay(date, "NX_FGS_HA_FDC_STA");
|
|
|
+// logger.info("日曲线偏差运行完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("日曲线偏差运行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 每日1点10分 - 月曲线偏差
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 10 1 * * ?")
|
|
|
+// public void yqxpc() {
|
|
|
+// try {
|
|
|
+// logger.info("月曲线偏差开始运行");
|
|
|
+// Date date = new Date();
|
|
|
+// powerCurveFittingByTimeService.cureFittingMonth(date, "0", null);
|
|
|
+// logger.info("月曲线偏差运行完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("月曲线偏差运行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 每5分钟 - 切入切出状态切换记录
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 0/5 * * * ?")
|
|
|
+// public void qrqc() {
|
|
|
+// try {
|
|
|
+// logger.info("切入切出状态切换记录调度程序执行开始");
|
|
|
+// inputOrOutPutService.inputOrOutputSpeed(new Date());
|
|
|
+// logger.info("切入切出状态切换记录调度任务处理完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("切入切出状态切换记录调度任务执行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 每日1点 - 切入切出统计
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 0 1 * * ?")
|
|
|
+// public void qrqctool() {
|
|
|
+// try {
|
|
|
+// logger.info("切入切出统计调度程序执行开始");
|
|
|
+// inputOrOutPutService.inputOrOutput(new Date());
|
|
|
+// logger.info("切入切出统计调度任务处理完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("切入切出统计调度任务执行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 每日2点 - 功率一致性系数和拟合优度统计
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 0 2 * * ?")
|
|
|
+// public void glyzx() {
|
|
|
+// try {
|
|
|
+// logger.info("功率一致性系数和拟合优度统计调度程序执行开始");
|
|
|
+// windturbineGoodnessService.calWindturbineGoodness(new Date());
|
|
|
+// logger.info("功率一致性系数和拟合优度统计调度任务处理完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("功率一致性系数和拟合优度统计调度任务执行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 每15分钟 - 设备指标2
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
+// public void sbzb1() {
|
|
|
+// try {
|
|
|
+// logger.info("设备指标1调度程序执行开始");
|
|
|
+// Date date = new Date();
|
|
|
+// equipmentInfo1Service.calEquipmentInfoDay(date);
|
|
|
+// logger.info("设备指标1调度程序执行完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("设备指标1调度任务执行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 每15分钟 - 设备指标2
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
+// public void sbzb2() {
|
|
|
+// try {
|
|
|
+// logger.info("设备指标2调度程序执行开始");
|
|
|
+// Date date = new Date();
|
|
|
+// equipmentInfo2Service.calEquipmentInfoDay(date);
|
|
|
+// logger.info("设备指标2调度程序执行完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("设备指标2调度任务执行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 每15分钟 - 设备指标3
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
+// public void sbzb3() {
|
|
|
+// try {
|
|
|
+// logger.info("设备指标3调度程序执行开始");
|
|
|
+// Date date = new Date();
|
|
|
+// equipmentInfo3Service.calEquipmentInfoDay(date);
|
|
|
+// logger.info("设备指标3调度程序执行完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("设备指标3调度任务执行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// // 每15分钟 - 设备指标4
|
|
|
+// @Async
|
|
|
+// @Scheduled(cron = "0 0/15 * * * ?")
|
|
|
+// public void sbzb4() {
|
|
|
+// try {
|
|
|
+// logger.info("设备指标4调度程序执行开始");
|
|
|
+// Date date = new Date();
|
|
|
+// equipmentInfo4Service.calEquipmentInfoDay(date);
|
|
|
+// logger.info("设备指标4调度程序执行完成");
|
|
|
+// } catch (Exception e) {
|
|
|
+// logger.error("设备指标4调度任务执行失败", e);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//}
|