|
@@ -1,8 +1,12 @@
|
|
package com.gyee.analysis.init;
|
|
package com.gyee.analysis.init;
|
|
|
|
|
|
|
|
|
|
-import com.gyee.analysis.model.auto.*;
|
|
|
|
-import com.gyee.analysis.service.*;
|
|
|
|
|
|
+import com.gyee.analysis.model.auto.Meterpoint;
|
|
|
|
+import com.gyee.analysis.model.auto.Project;
|
|
|
|
+import com.gyee.analysis.model.auto.Windpowerstation;
|
|
|
|
+import com.gyee.analysis.service.IMeterpointService;
|
|
|
|
+import com.gyee.analysis.service.IProjectService;
|
|
|
|
+import com.gyee.analysis.service.IWindpowerstationService;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.boot.CommandLineRunner;
|
|
import org.springframework.boot.CommandLineRunner;
|
|
@@ -21,45 +25,45 @@ import java.util.stream.Collectors;
|
|
@Component
|
|
@Component
|
|
public class CacheContext implements CommandLineRunner {
|
|
public class CacheContext implements CommandLineRunner {
|
|
private Logger logger= LoggerFactory.getLogger(CacheContext.class);
|
|
private Logger logger= LoggerFactory.getLogger(CacheContext.class);
|
|
- @Resource
|
|
|
|
- private IWindturbinetestingpointaiService windturbinetestingpointai2Service;
|
|
|
|
- @Resource
|
|
|
|
- private IWindpowerstationtestingpointService windpowerstationtestingpoint2Service;
|
|
|
|
|
|
+// @Resource
|
|
|
|
+// private IWindturbinetestingpointaiService windturbinetestingpointai2Service;
|
|
|
|
+// @Resource
|
|
|
|
+// private IWindpowerstationtestingpointService windpowerstationtestingpoint2Service;
|
|
@Resource
|
|
@Resource
|
|
private IProjectService projectService;
|
|
private IProjectService projectService;
|
|
@Resource
|
|
@Resource
|
|
private IWindpowerstationService windpowerstationService;
|
|
private IWindpowerstationService windpowerstationService;
|
|
@Resource
|
|
@Resource
|
|
private IMeterpointService meterpoint2Service;
|
|
private IMeterpointService meterpoint2Service;
|
|
- @Resource
|
|
|
|
- private IAnalysiswindtargetService analysiswindtargetService;
|
|
|
|
-
|
|
|
|
- public static Map<String, Map<String, Windturbinetestingpointai>> wtpointMap = new HashMap<>();
|
|
|
|
|
|
+// @Resource
|
|
|
|
+// private IAnalysiswindtargetService analysiswindtargetService;
|
|
|
|
|
|
- public static Map<String,List<Windturbinetestingpointai>> wtpmap = new HashMap<>();
|
|
|
|
-
|
|
|
|
- public static Map<String,Map<String, Windpowerstationtestingpoint>> wppointmap =new HashMap<>();
|
|
|
|
|
|
+// public static Map<String, Map<String, Windturbinetestingpointai>> wtpointMap = new HashMap<>();
|
|
|
|
+//
|
|
|
|
+// public static Map<String,List<Windturbinetestingpointai>> wtpmap = new HashMap<>();
|
|
|
|
+//
|
|
|
|
+// public static Map<String,Map<String, Windpowerstationtestingpoint>> wppointmap =new HashMap<>();
|
|
|
|
|
|
public static List<Project> projects = new ArrayList<>();
|
|
public static List<Project> projects = new ArrayList<>();
|
|
|
|
|
|
public static List<Windpowerstation> stations = new ArrayList<>();
|
|
public static List<Windpowerstation> stations = new ArrayList<>();
|
|
|
|
|
|
- public static Map<String,Windpowerstation> wpmaps = new HashMap<>();
|
|
|
|
|
|
+// public static Map<String,Windpowerstation> wpmaps = new HashMap<>();
|
|
|
|
|
|
- public static Map<String,String> wpmap = new HashMap<>();
|
|
|
|
|
|
+// public static Map<String,String> wpmap = new HashMap<>();
|
|
|
|
|
|
public static Map<String,Meterpoint> meterMap = new HashMap<>();
|
|
public static Map<String,Meterpoint> meterMap = new HashMap<>();
|
|
-
|
|
|
|
|
|
+//
|
|
public static Map<String,List<Meterpoint>> wpmeterMap = new HashMap<>();
|
|
public static Map<String,List<Meterpoint>> wpmeterMap = new HashMap<>();
|
|
|
|
|
|
- public static List<Analysiswindtarget> targetlist = new ArrayList<>();
|
|
|
|
|
|
+// public static List<Analysiswindtarget> targetlist = new ArrayList<>();
|
|
|
|
|
|
- public static Map<String,Project> projectMap = new HashMap<>();
|
|
|
|
|
|
+// public static Map<String,Project> projectMap = new HashMap<>();
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void run(String... args) throws Exception {
|
|
public void run(String... args) throws Exception {
|
|
|
|
|
|
- targetlist = analysiswindtargetService.list();
|
|
|
|
|
|
+// targetlist = analysiswindtargetService.list();
|
|
|
|
|
|
for (Meterpoint meterpoint2 : meterpoint2Service.list()) {
|
|
for (Meterpoint meterpoint2 : meterpoint2Service.list()) {
|
|
meterMap.put(meterpoint2.getId(),meterpoint2);
|
|
meterMap.put(meterpoint2.getId(),meterpoint2);
|
|
@@ -73,37 +77,37 @@ public class CacheContext implements CommandLineRunner {
|
|
}
|
|
}
|
|
|
|
|
|
projects = projectService.list().stream().sorted(Comparator.comparing(Project::getOrdernum)).collect(Collectors.toList());
|
|
projects = projectService.list().stream().sorted(Comparator.comparing(Project::getOrdernum)).collect(Collectors.toList());
|
|
- for (Project project : projects) {
|
|
|
|
- projectMap.put(project.getId(),project);
|
|
|
|
- }
|
|
|
|
|
|
+// for (Project project : projects) {
|
|
|
|
+// projectMap.put(project.getId(),project);
|
|
|
|
+// }
|
|
stations = windpowerstationService.list();
|
|
stations = windpowerstationService.list();
|
|
- for (Windpowerstation station : stations) {
|
|
|
|
- wpmap.put(station.getId(),station.getName());
|
|
|
|
- wpmaps.put(station.getId(),station);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<Windturbinetestingpointai> wtplist = windturbinetestingpointai2Service.list();
|
|
|
|
- for (Windturbinetestingpointai pointai : wtplist) {
|
|
|
|
- if (wtpointMap.containsKey(pointai.getWindturbineid())){
|
|
|
|
- wtpointMap.get(pointai.getWindturbineid()).put(pointai.getUniformcode(),pointai);
|
|
|
|
- }else{
|
|
|
|
- Map<String, Windturbinetestingpointai> map = new HashMap<>();
|
|
|
|
- map.put(pointai.getUniformcode(),pointai);
|
|
|
|
- wtpointMap.put(pointai.getWindturbineid(),map);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //----------------------------------------------------------------------------------------------------
|
|
|
|
- List<Windpowerstationtestingpoint> wplist = windpowerstationtestingpoint2Service.list();
|
|
|
|
- for (Windpowerstationtestingpoint windpowerstationtestingpoint2 : wplist) {
|
|
|
|
- if (wppointmap.containsKey(windpowerstationtestingpoint2.getWindpowerstationid())){
|
|
|
|
- wppointmap.get(windpowerstationtestingpoint2.getWindpowerstationid()).put(windpowerstationtestingpoint2.getUniformcode(),windpowerstationtestingpoint2);
|
|
|
|
- }else{
|
|
|
|
- Map<String,Windpowerstationtestingpoint> map = new HashMap<>();
|
|
|
|
- map.put(windpowerstationtestingpoint2.getUniformcode(),windpowerstationtestingpoint2);
|
|
|
|
- wppointmap.put(windpowerstationtestingpoint2.getWindpowerstationid(),map);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// for (Windpowerstation station : stations) {
|
|
|
|
+// wpmap.put(station.getId(),station.getName());
|
|
|
|
+// wpmaps.put(station.getId(),station);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// List<Windturbinetestingpointai> wtplist = windturbinetestingpointai2Service.list();
|
|
|
|
+// for (Windturbinetestingpointai pointai : wtplist) {
|
|
|
|
+// if (wtpointMap.containsKey(pointai.getWindturbineid())){
|
|
|
|
+// wtpointMap.get(pointai.getWindturbineid()).put(pointai.getUniformcode(),pointai);
|
|
|
|
+// }else{
|
|
|
|
+// Map<String, Windturbinetestingpointai> map = new HashMap<>();
|
|
|
|
+// map.put(pointai.getUniformcode(),pointai);
|
|
|
|
+// wtpointMap.put(pointai.getWindturbineid(),map);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// //----------------------------------------------------------------------------------------------------
|
|
|
|
+// List<Windpowerstationtestingpoint> wplist = windpowerstationtestingpoint2Service.list();
|
|
|
|
+// for (Windpowerstationtestingpoint windpowerstationtestingpoint2 : wplist) {
|
|
|
|
+// if (wppointmap.containsKey(windpowerstationtestingpoint2.getWindpowerstationid())){
|
|
|
|
+// wppointmap.get(windpowerstationtestingpoint2.getWindpowerstationid()).put(windpowerstationtestingpoint2.getUniformcode(),windpowerstationtestingpoint2);
|
|
|
|
+// }else{
|
|
|
|
+// Map<String,Windpowerstationtestingpoint> map = new HashMap<>();
|
|
|
|
+// map.put(windpowerstationtestingpoint2.getUniformcode(),windpowerstationtestingpoint2);
|
|
|
|
+// wppointmap.put(windpowerstationtestingpoint2.getWindpowerstationid(),map);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|