|
@@ -27,104 +27,145 @@ public class CacheContext implements CommandLineRunner {
|
|
|
private static final Logger log = LoggerFactory.getLogger(CacheContext.class);
|
|
|
|
|
|
@Autowired
|
|
|
- private IWindturbineService windturbineService;
|
|
|
+ private IProBasicEquipmentService proBasicEquipmentService;
|
|
|
@Autowired
|
|
|
- private IWindpowerstationService windpowerstationService;
|
|
|
+ private IProBasicPowerstationService proBasicPowerstationService;
|
|
|
@Autowired
|
|
|
- private IProjectService projectService;
|
|
|
+ private IProBasicProjectService proBasicProjectService;
|
|
|
@Autowired
|
|
|
- private ILineService lineService;
|
|
|
+ private IProBasicLineService proBasicLineService;
|
|
|
@Autowired
|
|
|
- private IEquipmentmodelService equipmentmodelService;
|
|
|
+ private IProEconEquipmentmodelService proEconEquipmentmodelService;
|
|
|
@Autowired
|
|
|
- private IWindturbinetestingpointaiService windturbineTestingAiService;
|
|
|
+ private IProBasicEquipmentPointService proBasicEquipmentPointService;
|
|
|
@Autowired
|
|
|
- private IWindpowerstationtestingpointService windpowerstationtestingpointService;
|
|
|
+ private IProBasicPowerstationPointService proBasicPowerstationPointService;
|
|
|
|
|
|
- public static Map<String, Windturbine> wtmap = new HashMap<String, Windturbine>(); // 风电机MAP
|
|
|
+ public static Map<String, ProBasicEquipment> wtmap = new HashMap<String, ProBasicEquipment>(); // 风电机MAP
|
|
|
|
|
|
|
|
|
- public static Map<String, Windpowerstation> wpmap = new HashMap<>();
|
|
|
+ public static Map<String, ProBasicPowerstation> wpmap = new HashMap<>();
|
|
|
|
|
|
- public static List<Windpowerstation> wpls = new ArrayList<Windpowerstation>(); // 风电场LIST集合
|
|
|
+ public static List<ProBasicPowerstation> wpls = new ArrayList<ProBasicPowerstation>(); // 风电场LIST集合
|
|
|
|
|
|
- public static List<Windturbine> wtls = new ArrayList<Windturbine>(); // 风电机LIST集合
|
|
|
+ public static List<ProBasicEquipment> wtls = new ArrayList<ProBasicEquipment>(); // 风电机LIST集合
|
|
|
|
|
|
- public static Map<String, Map<String, Windturbinetestingpointai>> wtpAimap = new HashMap<>();// 风电机测点AI表
|
|
|
+ public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = new HashMap<>();// 风电机测点AI表
|
|
|
|
|
|
- public static Map<String,Map<String, Windpowerstationtestingpoint>> wppointmap =new HashMap<>();
|
|
|
+ public static Map<String,Map<String, ProBasicPowerstationPoint>> wppointmap =new HashMap<>();
|
|
|
|
|
|
- public static List<Project> projects = new ArrayList<>();
|
|
|
+ public static List<ProBasicProject> projects = new ArrayList<>();
|
|
|
|
|
|
- public static List<Line> lines = new ArrayList<>();
|
|
|
+ public static List<ProBasicLine> lines = new ArrayList<>();
|
|
|
|
|
|
- public static Map<String, List<Windturbine>> wtsmap = new HashMap<String, List<Windturbine>>(); // 风电场MAP风电机LIST集合
|
|
|
-
|
|
|
- public static List<Equipmentmodel> mlls = new ArrayList<Equipmentmodel>();// 风电机模型LIST集合
|
|
|
- public static Map<String, Equipmentmodel> mlmap = new HashMap<String, Equipmentmodel>();// 风电机模型
|
|
|
+ public static Map<String, List<ProBasicEquipment>> wtsmap = new HashMap<String, List<ProBasicEquipment>>(); // 风电场MAP风电机LIST集合
|
|
|
+ public static Map<String, ProBasicProject> pjmap = new HashMap<String, ProBasicProject>(); // 项目MAP
|
|
|
+ public static Map<String, ProBasicLine> lnmap = new HashMap<String, ProBasicLine>(); // 线路MAP
|
|
|
+ public static List<ProEconEquipmentmodel> mlls = new ArrayList<ProEconEquipmentmodel>();// 风电机模型LIST集合
|
|
|
+ public static Map<String, ProEconEquipmentmodel> mlmap = new HashMap<String, ProEconEquipmentmodel>();// 风电机模型
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
|
|
|
|
log.info("-------------------------------缓存开始--------------------------------------");
|
|
|
+ // hpmap=healthpointsService.findAllMap();
|
|
|
+ wpls = proBasicPowerstationService.list();
|
|
|
|
|
|
- wpls = windpowerstationService.list();
|
|
|
- wpls.stream().filter(i->i.getId().endsWith("FDC")).forEach(i->{
|
|
|
- wpmap.put(i.getId(),i);
|
|
|
- });
|
|
|
+//
|
|
|
+// wpls.stream().filter(i->i.getId().endsWith("FDC")).forEach(i->{
|
|
|
+// wpmap.put(i.getId(),i);
|
|
|
+// });
|
|
|
+//
|
|
|
+// projects = proBasicProjectService.list();
|
|
|
+//
|
|
|
+// lines = proBasicLineService.list();
|
|
|
+//
|
|
|
+// wtls = proBasicEquipmentService.list();
|
|
|
+//
|
|
|
+// mlls = proEconEquipmentmodelService.list();
|
|
|
+// if (!mlls.isEmpty()) {
|
|
|
+// for (ProEconEquipmentmodel model : mlls) {
|
|
|
+// mlmap.put(model.getId(), model);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- projects = projectService.list();
|
|
|
|
|
|
- lines = lineService.list();
|
|
|
+ List<ProBasicPowerstation> wptempls = proBasicPowerstationService.list();
|
|
|
+
|
|
|
+ //和风只部署芳山风电场
|
|
|
+ // wptempls.stream().filter(i->i.getId().equals("FS_FDC")).forEach(i->{
|
|
|
+ wptempls.stream().forEach(i->{
|
|
|
+ wpls.add(i);
|
|
|
+ wpmap.put(i.getId(),i);
|
|
|
+ });
|
|
|
|
|
|
- wtls = windturbineService.list();
|
|
|
+ List<ProBasicProject> pjtempls = proBasicProjectService.list();
|
|
|
|
|
|
- mlls = equipmentmodelService.list();
|
|
|
+ if (!pjtempls.isEmpty()) {
|
|
|
+ pjtempls.stream().filter(i->wpmap.containsKey(i.getWindpowerstationId())).forEach(i->{
|
|
|
+ projects.add(i);
|
|
|
+ pjmap.put(i.getId(),i);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ List<ProBasicLine> templines = proBasicLineService.list();
|
|
|
+ if (!templines.isEmpty()) {
|
|
|
+ templines.stream().filter(i->pjmap.containsKey(i.getProjectId())).forEach(i->{
|
|
|
+ lines.add(i);
|
|
|
+ lnmap.put(i.getId(),i);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ List<ProBasicEquipment> wttempls =proBasicEquipmentService.list();
|
|
|
+ if (!wttempls.isEmpty()) {
|
|
|
+ wttempls.stream().filter(i->wpmap.containsKey(i.getWindpowerstationId())).forEach(i->{
|
|
|
+ wtls.add(i);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ mlls = proEconEquipmentmodelService.list();
|
|
|
if (!mlls.isEmpty()) {
|
|
|
- for (Equipmentmodel model : mlls) {
|
|
|
+ for (ProEconEquipmentmodel model : mlls) {
|
|
|
mlmap.put(model.getId(), model);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (!wtls.isEmpty()) {
|
|
|
- List<Windturbine> list = null;
|
|
|
- for (Windturbine wt : wtls) {
|
|
|
+ List<ProBasicEquipment> list = null;
|
|
|
+ for (ProBasicEquipment wt : wtls) {
|
|
|
wtmap.put(wt.getId(), wt);
|
|
|
- if (wtsmap.containsKey(wt.getWindpowerstationid())) {
|
|
|
- list = wtsmap.get(wt.getWindpowerstationid());
|
|
|
+ if (wtsmap.containsKey(wt.getWindpowerstationId())) {
|
|
|
+ list = wtsmap.get(wt.getWindpowerstationId());
|
|
|
list.add(wt);
|
|
|
} else {
|
|
|
- list = new ArrayList<Windturbine>();
|
|
|
+ list = new ArrayList<ProBasicEquipment>();
|
|
|
list.add(wt);
|
|
|
- wtsmap.put(wt.getWindpowerstationid(), list);
|
|
|
+ wtsmap.put(wt.getWindpowerstationId(), list);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<Windturbinetestingpointai> WindturbinetestingpointaiList = windturbineTestingAiService.list();
|
|
|
- Map<String, Windturbinetestingpointai> map = null;
|
|
|
+ List<ProBasicEquipmentPoint> WindturbinetestingpointaiList = proBasicEquipmentPointService.list();
|
|
|
+ Map<String, ProBasicEquipmentPoint> map = null;
|
|
|
|
|
|
if(WindturbinetestingpointaiList != null && !WindturbinetestingpointaiList.isEmpty()){
|
|
|
- for(Windturbinetestingpointai mp : WindturbinetestingpointaiList){
|
|
|
- if(wtpAimap.containsKey(mp.getWindturbineid())){
|
|
|
- map = wtpAimap.get(mp.getWindturbineid());
|
|
|
- map.put(mp.getUniformcode(), mp);
|
|
|
+ for(ProBasicEquipmentPoint mp : WindturbinetestingpointaiList){
|
|
|
+ if(wtpAimap.containsKey(mp.getWindturbineId())){
|
|
|
+ map = wtpAimap.get(mp.getWindturbineId());
|
|
|
+ map.put(mp.getUniformCode(), mp);
|
|
|
}else{
|
|
|
- map = new HashMap<String, Windturbinetestingpointai>();
|
|
|
- map.put(mp.getUniformcode(), mp);
|
|
|
- wtpAimap.put(mp.getWindturbineid(), map);
|
|
|
+ map = new HashMap<>();
|
|
|
+ map.put(mp.getUniformCode(), mp);
|
|
|
+ wtpAimap.put(mp.getWindturbineId(), map);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- List<Windpowerstationtestingpoint> wplist = windpowerstationtestingpointService.list();
|
|
|
- for (Windpowerstationtestingpoint Windpowerstationtestingpoint : wplist) {
|
|
|
- if (wppointmap.containsKey(Windpowerstationtestingpoint.getWindpowerstationid())){
|
|
|
- wppointmap.get(Windpowerstationtestingpoint.getWindpowerstationid()).put(Windpowerstationtestingpoint.getUniformcode(),Windpowerstationtestingpoint);
|
|
|
+ List<ProBasicPowerstationPoint> wplist = proBasicPowerstationPointService.list();
|
|
|
+ for (ProBasicPowerstationPoint ProBasicPowerstationPoint : wplist) {
|
|
|
+ if (wppointmap.containsKey(ProBasicPowerstationPoint.getWindpowerstationId())){
|
|
|
+ wppointmap.get(ProBasicPowerstationPoint.getWindpowerstationId()).put(ProBasicPowerstationPoint.getUniformCode(),ProBasicPowerstationPoint);
|
|
|
}else{
|
|
|
- Map<String,Windpowerstationtestingpoint> wpmap = new HashMap<>();
|
|
|
- wpmap.put(Windpowerstationtestingpoint.getUniformcode(),Windpowerstationtestingpoint);
|
|
|
- wppointmap.put(Windpowerstationtestingpoint.getWindpowerstationid(),wpmap);
|
|
|
+ Map<String,ProBasicPowerstationPoint> wpmap = new HashMap<>();
|
|
|
+ wpmap.put(ProBasicPowerstationPoint.getUniformCode(),ProBasicPowerstationPoint);
|
|
|
+ wppointmap.put(ProBasicPowerstationPoint.getWindpowerstationId(),wpmap);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -151,13 +192,13 @@ public class CacheContext implements CommandLineRunner {
|
|
|
//
|
|
|
// if(windturbinetestingpointList != null && !windturbinetestingpointList.isEmpty()){
|
|
|
// for(Windturbinetestingpoint mp : windturbinetestingpointList){
|
|
|
-// if(wtpAimap.containsKey(mp.getWindturbineid())){
|
|
|
-// map = wtpAimap.get(mp.getWindturbineid());
|
|
|
-// map.put(mp.getUniformcode(), mp);
|
|
|
+// if(wtpAimap.containsKey(mp.getWindturbineId())){
|
|
|
+// map = wtpAimap.get(mp.getWindturbineId());
|
|
|
+// map.put(mp.getUniformCode(), mp);
|
|
|
// }else{
|
|
|
// map = new HashMap<String, Windturbinetestingpoint>();
|
|
|
-// map.put(mp.getUniformcode(), mp);
|
|
|
-// wtpAimap.put(mp.getWindturbineid(), map);
|
|
|
+// map.put(mp.getUniformCode(), mp);
|
|
|
+// wtpAimap.put(mp.getWindturbineId(), map);
|
|
|
// }
|
|
|
// }
|
|
|
// }
|