|
@@ -5,10 +5,10 @@ import com.gyee.benchmarkingweb.model.auto.*;
|
|
|
import com.gyee.benchmarkingweb.service.auto.*;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -25,18 +25,20 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(CacheContext.class);
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private IWindturbineService windturbineService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private IWindpowerstationService windpowerstationService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private IProjectService projectService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private ILineService lineService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private IWindturbinetestingpointaiService windturbineTestingAiService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private IWindpowerstationtestingpointService windpowerstationtestingpointService;
|
|
|
+ @Resource
|
|
|
+ private IEquipmentmodelService equipmentmodelService;
|
|
|
|
|
|
public static Map<String, List<Windturbine>> wtmap = new HashMap<>();
|
|
|
|
|
@@ -60,6 +62,8 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
public static Map<String,Project> promap = new HashMap<>();
|
|
|
|
|
|
+ public static Map<String,Equipmentmodel> equipmentmodelMap = new HashMap<>();
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
@@ -125,6 +129,10 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ equipmentmodelService.list().forEach(i->{
|
|
|
+ equipmentmodelMap.put(i.getId(),i);
|
|
|
+ });
|
|
|
+
|
|
|
log.info("-------------------------------缓存结束--------------------------------------");
|
|
|
}
|
|
|
}
|