|
@@ -3,8 +3,10 @@ package com.gyee.impala.common.spring;
|
|
|
|
|
|
import com.gyee.impala.model.master.*;
|
|
|
import com.gyee.impala.model.master.diagnose.Diagnosepoint;
|
|
|
+import com.gyee.impala.model.master.diagnose.Diagnosetrainhistory;
|
|
|
import com.gyee.impala.service.master.*;
|
|
|
import com.gyee.impala.service.master.diagnose.DiagnosepointService;
|
|
|
+import com.gyee.impala.service.master.diagnose.DiagnosetrainhistoryService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.core.annotation.Order;
|
|
@@ -31,6 +33,8 @@ public class InitialRunner implements CommandLineRunner {
|
|
|
private EquipmentmodelService modelService;
|
|
|
@Autowired
|
|
|
private DiagnosepointService diagnosepointService;
|
|
|
+ @Autowired
|
|
|
+ private DiagnosetrainhistoryService diagnosetrainhistoryService;
|
|
|
|
|
|
/**场站所有信息**/
|
|
|
public static List<Windpowerstation> wpList = new ArrayList<>();
|
|
@@ -58,6 +62,11 @@ public class InitialRunner implements CommandLineRunner {
|
|
|
/** 故障诊断 训练需要的测点**/
|
|
|
public static Map<String, Map<String, List<Diagnosepoint>>> mapPoint = new HashMap<>();
|
|
|
|
|
|
+ /*** 故障训练历史模型 */
|
|
|
+ public static Map<String, List<Diagnosetrainhistory>> historyModelMap = new HashMap<>();
|
|
|
+ public static List<Diagnosetrainhistory> historyList = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void run(String... args){
|
|
@@ -67,6 +76,7 @@ public class InitialRunner implements CommandLineRunner {
|
|
|
cacheKnowCategory();
|
|
|
cacheEquipmentModel();
|
|
|
cacheDiagnosePoint();
|
|
|
+ cacheHistory();
|
|
|
|
|
|
System.out.println(">>>>>>>>>>>>>>>数据缓存完成<<<<<<<<<<<<<<");
|
|
|
}
|
|
@@ -132,4 +142,12 @@ public class InitialRunner implements CommandLineRunner {
|
|
|
List<Diagnosepoint> points = diagnosepointService.getDiagnosepointList();
|
|
|
mapPoint = points.stream().collect(Collectors.groupingBy(Diagnosepoint::getStationen, Collectors.groupingBy(Diagnosepoint::getModel)));
|
|
|
}
|
|
|
+
|
|
|
+ public void cacheHistory(){
|
|
|
+ historyModelMap.clear();
|
|
|
+ historyList.clear();
|
|
|
+ List<Diagnosetrainhistory> historyList = diagnosetrainhistoryService.getListAll();
|
|
|
+ historyModelMap = historyList.stream().collect(Collectors.groupingBy(Diagnosetrainhistory::getModel));
|
|
|
+
|
|
|
+ }
|
|
|
}
|