|
@@ -8,6 +8,8 @@ import org.slf4j.LoggerFactory;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
|
|
+import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
|
+import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
@@ -22,6 +24,8 @@ import java.util.concurrent.TimeUnit;
|
|
*/
|
|
*/
|
|
@SpringBootApplication
|
|
@SpringBootApplication
|
|
@EnableFeignClients
|
|
@EnableFeignClients
|
|
|
|
+@EnableScheduling // 启用定时任务调度
|
|
|
|
+@EnableAsync // 启用异步执行
|
|
@MapperScan({"com.gyee.generation.mapper"})
|
|
@MapperScan({"com.gyee.generation.mapper"})
|
|
public class GenerationMain {
|
|
public class GenerationMain {
|
|
|
|
|
|
@@ -32,68 +36,68 @@ public class GenerationMain {
|
|
System.out.println("启动完成");
|
|
System.out.println("启动完成");
|
|
|
|
|
|
// /*************************风机历史计算服务**************************/
|
|
// /*************************风机历史计算服务**************************/
|
|
- Calendar c1 = Calendar.getInstance();
|
|
|
|
-
|
|
|
|
- c1.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
|
- ReCalSevice reCalSevice = SpringUtils.getBean("reCalSevice");
|
|
|
|
-
|
|
|
|
- Calendar c = Calendar.getInstance();
|
|
|
|
- Logger logger = LoggerFactory.getLogger(GenerationMain.class);
|
|
|
|
-
|
|
|
|
- // //重算风机
|
|
|
|
- reCalSevice.calWt(c.getTime());
|
|
|
|
-
|
|
|
|
- while (true) {
|
|
|
|
-
|
|
|
|
- Date begin = new Date();
|
|
|
|
- Date end = null;
|
|
|
|
- SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
- logger.info(df.format(c.getTime()).toString());
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- EquipmentInfo1Service equipmentInfo1Service = SpringUtils.getBean("equipmentInfo1Service");
|
|
|
|
- EquipmentInfo2Service equipmentInfo2Service = SpringUtils.getBean("equipmentInfo2Service");
|
|
|
|
- EquipmentInfo3Service equipmentInfo3Service = SpringUtils.getBean("equipmentInfo3Service");
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- equipmentInfo1Service.calEquipmentInfoDay(begin);
|
|
|
|
- logger.info("equipmentInfo1Service完成一次!。。。。。。");
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- equipmentInfo2Service.calEquipmentInfoDay(begin);
|
|
|
|
- logger.info("equipmentInfo2Service完成一次!。。。。。。");
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- equipmentInfo3Service.calEquipmentInfoDay(begin);
|
|
|
|
- logger.info("equipmentInfo3Service完成一次!。。。。。。");
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- logger.info("equipmentInfo5Service开始!。。。。。。");
|
|
|
|
- EquipmentInfo5Service equipmentInfo5Service = SpringUtils.getBean("equipmentInfo5Service");
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- EquipmentInfo4Service equipmentInfo4Service = SpringUtils.getBean("equipmentInfo4Service");
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- equipmentInfo5Service.calEquipmentInfoDay(begin);
|
|
|
|
- logger.info("equipmentInfo5Service完成一次!。。。。。。");
|
|
|
|
- logger.info("equipmentInfo4Service开始!。。。。。。");
|
|
|
|
- equipmentInfo4Service.calEquipmentInfoDay(begin);
|
|
|
|
- logger.info("equipmentInfo4Service完成一次!。。。。。。");
|
|
|
|
-
|
|
|
|
- WtAlysisDayService wtAlysisDayService = SpringUtils.getBean("wtAlysisDayService");
|
|
|
|
-
|
|
|
|
- EquipmentInfoDayTopService equipmentInfoDayTopService = SpringUtils.getBean("equipmentInfoDayTopService");
|
|
|
|
- equipmentInfoDayTopService.calEquipmentInfoDayTop(begin);
|
|
|
|
- equipmentInfoDayTopService.calEquipmentInfoMonthTop(begin);
|
|
|
|
- equipmentInfoDayTopService.calEquipmentInfoYearTop(begin);
|
|
|
|
-
|
|
|
|
- TimeUnit.SECONDS.sleep(3);
|
|
|
|
- logger.info("wtAlysisyService开始!。。。。。。");
|
|
|
|
- wtAlysisDayService.calEquipmentInfoDay(begin);
|
|
|
|
- logger.info("wtAlysisyService完成!。。。。。。");
|
|
|
|
- end = new Date();
|
|
|
|
- logger.info(df.format(end).toString());
|
|
|
|
- logger.info("完成一次!。。。。。。");
|
|
|
|
- logger.info("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
|
|
|
|
-
|
|
|
|
- TimeUnit.MINUTES.sleep(15);
|
|
|
|
- }
|
|
|
|
|
|
+// Calendar c1 = Calendar.getInstance();
|
|
|
|
+//
|
|
|
|
+// c1.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
|
+// ReCalSevice reCalSevice = SpringUtils.getBean("reCalSevice");
|
|
|
|
+//
|
|
|
|
+// Calendar c = Calendar.getInstance();
|
|
|
|
+// Logger logger = LoggerFactory.getLogger(GenerationMain.class);
|
|
|
|
+//
|
|
|
|
+// // //重算风机
|
|
|
|
+// reCalSevice.calWt(c.getTime());
|
|
|
|
+//
|
|
|
|
+// while (true) {
|
|
|
|
+//
|
|
|
|
+// Date begin = new Date();
|
|
|
|
+// Date end = null;
|
|
|
|
+// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+// logger.info(df.format(c.getTime()).toString());
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// EquipmentInfo1Service equipmentInfo1Service = SpringUtils.getBean("equipmentInfo1Service");
|
|
|
|
+// EquipmentInfo2Service equipmentInfo2Service = SpringUtils.getBean("equipmentInfo2Service");
|
|
|
|
+// EquipmentInfo3Service equipmentInfo3Service = SpringUtils.getBean("equipmentInfo3Service");
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// equipmentInfo1Service.calEquipmentInfoDay(begin);
|
|
|
|
+// logger.info("equipmentInfo1Service完成一次!。。。。。。");
|
|
|
|
+// TimeUnit.SECONDS.sleep(3);
|
|
|
|
+// equipmentInfo2Service.calEquipmentInfoDay(begin);
|
|
|
|
+// logger.info("equipmentInfo2Service完成一次!。。。。。。");
|
|
|
|
+// TimeUnit.SECONDS.sleep(3);
|
|
|
|
+// equipmentInfo3Service.calEquipmentInfoDay(begin);
|
|
|
|
+// logger.info("equipmentInfo3Service完成一次!。。。。。。");
|
|
|
|
+// TimeUnit.SECONDS.sleep(3);
|
|
|
|
+// logger.info("equipmentInfo5Service开始!。。。。。。");
|
|
|
|
+// EquipmentInfo5Service equipmentInfo5Service = SpringUtils.getBean("equipmentInfo5Service");
|
|
|
|
+// TimeUnit.SECONDS.sleep(3);
|
|
|
|
+// EquipmentInfo4Service equipmentInfo4Service = SpringUtils.getBean("equipmentInfo4Service");
|
|
|
|
+// TimeUnit.SECONDS.sleep(3);
|
|
|
|
+// equipmentInfo5Service.calEquipmentInfoDay(begin);
|
|
|
|
+// logger.info("equipmentInfo5Service完成一次!。。。。。。");
|
|
|
|
+// logger.info("equipmentInfo4Service开始!。。。。。。");
|
|
|
|
+// equipmentInfo4Service.calEquipmentInfoDay(begin);
|
|
|
|
+// logger.info("equipmentInfo4Service完成一次!。。。。。。");
|
|
|
|
+//
|
|
|
|
+// WtAlysisDayService wtAlysisDayService = SpringUtils.getBean("wtAlysisDayService");
|
|
|
|
+//
|
|
|
|
+// EquipmentInfoDayTopService equipmentInfoDayTopService = SpringUtils.getBean("equipmentInfoDayTopService");
|
|
|
|
+// equipmentInfoDayTopService.calEquipmentInfoDayTop(begin);
|
|
|
|
+// equipmentInfoDayTopService.calEquipmentInfoMonthTop(begin);
|
|
|
|
+// equipmentInfoDayTopService.calEquipmentInfoYearTop(begin);
|
|
|
|
+//
|
|
|
|
+// TimeUnit.SECONDS.sleep(3);
|
|
|
|
+// logger.info("wtAlysisyService开始!。。。。。。");
|
|
|
|
+// wtAlysisDayService.calEquipmentInfoDay(begin);
|
|
|
|
+// logger.info("wtAlysisyService完成!。。。。。。");
|
|
|
|
+// end = new Date();
|
|
|
|
+// logger.info(df.format(end).toString());
|
|
|
|
+// logger.info("完成一次!。。。。。。");
|
|
|
|
+// logger.info("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
|
|
|
|
+//
|
|
|
|
+// TimeUnit.MINUTES.sleep(15);
|
|
|
|
+// }
|
|
//
|
|
//
|
|
// /*************************风机历史计算服务**************************/
|
|
// /*************************风机历史计算服务**************************/
|
|
//
|
|
//
|