|
@@ -87,11 +87,11 @@ public class CacheContext implements CommandLineRunner {
|
|
|
private IProEconAlarmRuleService proEconAlarmRuleService;
|
|
|
@Resource
|
|
|
private IProEconAlarmTypeService proEconAlarmTypeService;
|
|
|
- public static Map<String,Map<String, ProBasicPowerstationPoint>> weatherwppointmap =new HashMap<>();
|
|
|
- public static List<ProBasicWeatherStation> weawpls = new ArrayList<>();
|
|
|
- public static Map<String,Map<String,ProBasicEquipment>> cmwtmap = new HashMap<>();
|
|
|
- public static Map<String,List<ProBasicEquipment>> rgwtlsmap = new HashMap<>();
|
|
|
- public static Map<String,List<ProBasicEquipment>> cmwtlsmap = new HashMap<>();
|
|
|
+ public static Map<String, Map<String, ProBasicPowerstationPoint>> weatherwppointmap = new HashMap<>();
|
|
|
+ public static List<ProBasicWeatherStation> weawpls = new ArrayList<>();
|
|
|
+ public static Map<String, Map<String, ProBasicEquipment>> cmwtmap = new HashMap<>();
|
|
|
+ public static Map<String, List<ProBasicEquipment>> rgwtlsmap = new HashMap<>();
|
|
|
+ public static Map<String, List<ProBasicEquipment>> cmwtlsmap = new HashMap<>();
|
|
|
public static Map<String, List<ProEconAlarmRule>> alarmRulesMap = new HashMap<>();
|
|
|
public static List<ProBasicEquipment> wtls = new ArrayList<>();
|
|
|
public static List<ProBasicEquipment> wt_fjls = new ArrayList<>();
|
|
@@ -172,28 +172,30 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static List<ProEconAlarmConfiguration> wtalarmls = new ArrayList<>();
|
|
|
public static List<ProEconAlarmConfiguration> customalarmls = new ArrayList<>();
|
|
|
public static Map<String, Map<String, ProBasicStatusPoint>> pointdismap = new HashMap<>();
|
|
|
- public static Map<String,List<ProEconAlarmRule>> ctAlarmMap=new HashMap<>();
|
|
|
- public static Map<String,List<ProEconAlarmConfiguration>> wtAlarmMap=new HashMap<>();
|
|
|
- public static Map<String,ProEconAlarmConfiguration> alarmMap=new HashMap<>();
|
|
|
+ public static Map<String, List<ProEconAlarmRule>> ctAlarmlsMap = new HashMap<>();
|
|
|
|
|
|
- public static List<AlarmVo> alarmWtList=new ArrayList<>();
|
|
|
- public static Map<String,AlarmVo> alarmWtMap=new HashMap<>();
|
|
|
+ public static Map<String, ProEconAlarmRule> ctAlarmMap = new HashMap<>();
|
|
|
+ public static Map<String, List<ProEconAlarmConfiguration>> wtAlarmMap = new HashMap<>();
|
|
|
+ public static Map<String, ProEconAlarmConfiguration> alarmMap = new HashMap<>();
|
|
|
|
|
|
- public static List<AlarmVo> alarmBtList=new ArrayList<>();
|
|
|
- public static Map<String,AlarmVo> alarmBtMap=new HashMap<>();
|
|
|
+ public static List<AlarmVo> alarmWtList = new ArrayList<>();
|
|
|
+ public static Map<String, AlarmVo> alarmWtMap = new HashMap<>();
|
|
|
+
|
|
|
+ public static List<AlarmVo> alarmBtList = new ArrayList<>();
|
|
|
+ public static Map<String, AlarmVo> alarmBtMap = new HashMap<>();
|
|
|
+
|
|
|
+ public static List<AlarmVo> alarmCtList = new ArrayList<>();
|
|
|
+ public static Map<String, AlarmVo> alarmCtMap = new HashMap<>();
|
|
|
+ public static Map<String, ProEconAlarmType> alarmTypeMap = new HashMap<>();
|
|
|
+ public static List<ProEconAlarmType> alarmTypeList = new ArrayList<>();
|
|
|
+ public static Map<String, Set<ProEconEquipmentmodel>> wpByEmMap = new HashMap<>();
|
|
|
|
|
|
- public static List<AlarmVo> alarmCtList=new ArrayList<>();
|
|
|
- public static Map<String,AlarmVo> alarmCtMap=new HashMap<>();
|
|
|
- public static Map<String,ProEconAlarmType> alarmTypeMap=new HashMap<>();
|
|
|
- public static List<ProEconAlarmType> alarmTypeList=new ArrayList<>();
|
|
|
- public static Map<String,Set<ProEconEquipmentmodel>> wpByEmMap=new HashMap<>();
|
|
|
@Override
|
|
|
|
|
|
public void run(String... args) throws Exception {
|
|
|
logger.info("缓存开始------------------------------------------------------------");
|
|
|
|
|
|
|
|
|
-
|
|
|
List<String> runWpids = Arrays.asList(runWindpowerstation.split(","));
|
|
|
logger.info(runWpids.get(0) + "------------------" + runWpids.size());
|
|
|
wsls = proBasicWeatherStationService.list().stream().filter(i -> runWpids.contains(i.getWindpowerstationId()) && i.getIsAble() == 1).collect(Collectors.toList());
|
|
@@ -376,7 +378,6 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
wtmap.put(wt.getId(), wt);
|
|
|
|
|
|
wtstandardmap.put(wt.getId(), wt.getId());
|
|
@@ -386,58 +387,57 @@ public class CacheContext implements CommandLineRunner {
|
|
|
wtpAimap.put(wt.getId(), stringWindturbinetestingpointnewMap);
|
|
|
|
|
|
|
|
|
-
|
|
|
- if (wpwtmap.containsKey(wt.getWindpowerstationId())){
|
|
|
+ if (wpwtmap.containsKey(wt.getWindpowerstationId())) {
|
|
|
wpwtmap.get(wt.getWindpowerstationId()).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicEquipment> wps = new ArrayList<>();
|
|
|
wps.add(wt);
|
|
|
- wpwtmap.put(wt.getWindpowerstationId(),wps);
|
|
|
+ wpwtmap.put(wt.getWindpowerstationId(), wps);
|
|
|
}
|
|
|
|
|
|
- if (pjwtmap.containsKey(wt.getProjectId())){
|
|
|
+ if (pjwtmap.containsKey(wt.getProjectId())) {
|
|
|
pjwtmap.get(wt.getProjectId()).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicEquipment> pjs = new ArrayList<>();
|
|
|
pjs.add(wt);
|
|
|
- pjwtmap.put(wt.getProjectId(),pjs);
|
|
|
+ pjwtmap.put(wt.getProjectId(), pjs);
|
|
|
}
|
|
|
- if (lnwtmap.containsKey(wt.getLineId())){
|
|
|
+ if (lnwtmap.containsKey(wt.getLineId())) {
|
|
|
lnwtmap.get(wt.getLineId()).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicEquipment> lnls = new ArrayList<>();
|
|
|
lnls.add(wt);
|
|
|
- lnwtmap.put(wt.getLineId(),lnls);
|
|
|
+ lnwtmap.put(wt.getLineId(), lnls);
|
|
|
}
|
|
|
- if (cmwtlsmap.containsKey(wt.getCompanyId())){
|
|
|
+ if (cmwtlsmap.containsKey(wt.getCompanyId())) {
|
|
|
cmwtlsmap.get(wt.getCompanyId()).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicEquipment> cmls = new ArrayList<>();
|
|
|
cmls.add(wt);
|
|
|
- cmwtlsmap.put(wt.getCompanyId(),cmls);
|
|
|
+ cmwtlsmap.put(wt.getCompanyId(), cmls);
|
|
|
}
|
|
|
- if (rgwtlsmap.containsKey(wt.getRegionId())){
|
|
|
+ if (rgwtlsmap.containsKey(wt.getRegionId())) {
|
|
|
rgwtlsmap.get(wt.getRegionId()).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicEquipment> rgls = new ArrayList<>();
|
|
|
rgls.add(wt);
|
|
|
- rgwtlsmap.put(wt.getRegionId(),rgls);
|
|
|
+ rgwtlsmap.put(wt.getRegionId(), rgls);
|
|
|
}
|
|
|
|
|
|
- if (sqwtmap.containsKey(wt.getSquareId())){
|
|
|
+ if (sqwtmap.containsKey(wt.getSquareId())) {
|
|
|
sqwtmap.get(wt.getSquareId()).add(wt);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
List<ProBasicEquipment> lnls = new ArrayList<>();
|
|
|
lnls.add(wt);
|
|
|
- sqwtmap.put(wt.getSquareId(),lnls);
|
|
|
+ sqwtmap.put(wt.getSquareId(), lnls);
|
|
|
}
|
|
|
|
|
|
- if (cmwtmap.containsKey(wt.getCompanyId())){
|
|
|
- cmwtmap.get(wt.getCompanyId()).put(wt.getId(),wt);
|
|
|
- }else {
|
|
|
- Map<String,ProBasicEquipment> map=new HashMap<>();
|
|
|
- map.put(wt.getId(),wt);
|
|
|
- cmwtmap.put(wt.getCompanyId(),map);
|
|
|
+ if (cmwtmap.containsKey(wt.getCompanyId())) {
|
|
|
+ cmwtmap.get(wt.getCompanyId()).put(wt.getId(), wt);
|
|
|
+ } else {
|
|
|
+ Map<String, ProBasicEquipment> map = new HashMap<>();
|
|
|
+ map.put(wt.getId(), wt);
|
|
|
+ cmwtmap.put(wt.getCompanyId(), map);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -493,7 +493,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
subwpls = proBasicSubStationService.list().stream().filter(i -> runWpids.contains(i.getWindpowerstationId()) && i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
subwpls.stream().forEach(sub -> {
|
|
|
|
|
|
- subwpmap.put(sub.getId(),sub);
|
|
|
+ subwpmap.put(sub.getId(), sub);
|
|
|
String subString = redisService.get(sub.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
@@ -610,45 +610,52 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
|
|
|
|
|
|
- List<ProEconAlarmRule> customls =proEconAlarmRuleService.list();
|
|
|
+ List<ProEconAlarmRule> customls = proEconAlarmRuleService.list();
|
|
|
|
|
|
- if(!customls.isEmpty())
|
|
|
- {
|
|
|
- customls=customls.stream().filter(i ->null !=i.getEnable() && i.getEnable()).collect(Collectors.toList());
|
|
|
+ if (!customls.isEmpty()) {
|
|
|
+ customls = customls.stream().filter(i -> null != i.getEnable() && i.getEnable()).collect(Collectors.toList());
|
|
|
}
|
|
|
- List<ProEconAlarmRule> wtCustomls=new ArrayList<>();
|
|
|
- List<ProEconAlarmRule> btCustomls=new ArrayList<>();
|
|
|
+ List<ProEconAlarmRule> wtCustomls = new ArrayList<>();
|
|
|
+ List<ProEconAlarmRule> btCustomls = new ArrayList<>();
|
|
|
|
|
|
- if(!customls.isEmpty())
|
|
|
- {
|
|
|
- for(ProEconAlarmRule vo: customls)
|
|
|
- {
|
|
|
- StringBuilder sb=new StringBuilder();
|
|
|
+ if (!customls.isEmpty()) {
|
|
|
+ for (ProEconAlarmRule vo : customls) {
|
|
|
+
|
|
|
+ ctAlarmMap.put(vo.getId(),vo);
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
sb.append(vo.getStationId()).append(vo.getModelId());
|
|
|
- if(StringUtils.notEmp(vo.getCategory()))
|
|
|
- {
|
|
|
- if(vo.getCategory().equals(AlarmCustomType.WT.getCode()))
|
|
|
- {
|
|
|
- if(ctAlarmMap.containsKey(String.valueOf(sb)))
|
|
|
- {
|
|
|
- List<ProEconAlarmRule> ls=ctAlarmMap.get(String.valueOf(sb));
|
|
|
+ if (StringUtils.notEmp(vo.getCategory())) {
|
|
|
+
|
|
|
+
|
|
|
+ if (vo.getCategory().equals(AlarmCustomType.WT.getCode())) {
|
|
|
+ if (ctAlarmlsMap.containsKey(String.valueOf(sb))) {
|
|
|
+ List<ProEconAlarmRule> ls = ctAlarmlsMap.get(String.valueOf(sb));
|
|
|
ls.add(vo);
|
|
|
- }else
|
|
|
- {
|
|
|
- List<ProEconAlarmRule> ls=new ArrayList<>();
|
|
|
+ } else {
|
|
|
+ List<ProEconAlarmRule> ls = new ArrayList<>();
|
|
|
ls.add(vo);
|
|
|
- ctAlarmMap.put(String.valueOf(sb),ls);
|
|
|
+ ctAlarmlsMap.put(String.valueOf(sb), ls);
|
|
|
}
|
|
|
wtCustomls.add(vo);
|
|
|
- }else if(vo.getCategory().equals(AlarmCustomType.BT.getCode()))
|
|
|
- {
|
|
|
+ }
|
|
|
+ if (vo.getCategory().equals(AlarmCustomType.IN.getCode())) {
|
|
|
+ if (ctAlarmlsMap.containsKey(String.valueOf(sb))) {
|
|
|
+ List<ProEconAlarmRule> ls = ctAlarmlsMap.get(String.valueOf(sb));
|
|
|
+ ls.add(vo);
|
|
|
+ } else {
|
|
|
+ List<ProEconAlarmRule> ls = new ArrayList<>();
|
|
|
+ ls.add(vo);
|
|
|
+ ctAlarmlsMap.put(String.valueOf(sb), ls);
|
|
|
+ }
|
|
|
+ wtCustomls.add(vo);
|
|
|
+ } else if (vo.getCategory().equals(AlarmCustomType.BT.getCode())) {
|
|
|
btCustomls.add(vo);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- alarmRulesMap.put(AlarmCustomType.WT.getCode(),wtCustomls);
|
|
|
- alarmRulesMap.put(AlarmCustomType.BT.getCode(),btCustomls);
|
|
|
+ alarmRulesMap.put(AlarmCustomType.WT.getCode(), wtCustomls);
|
|
|
+ alarmRulesMap.put(AlarmCustomType.BT.getCode(), btCustomls);
|
|
|
|
|
|
|
|
|
List<ProEconAlarmConfiguration> templs = proEconAlarmConfigurationService.list().stream().filter(i -> i.getEnable()).collect(Collectors.toList());
|
|
@@ -656,19 +663,17 @@ public class CacheContext implements CommandLineRunner {
|
|
|
for (ProEconAlarmConfiguration alarm : templs) {
|
|
|
if (alarm.getAlarmType().equals(AlarmTypeValue.WT.getCode())) {
|
|
|
wtalarmls.add(alarm);
|
|
|
- alarmMap.put(alarm.getId(),alarm);
|
|
|
- StringBuilder sb=new StringBuilder();
|
|
|
+ alarmMap.put(alarm.getId(), alarm);
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
sb.append(alarm.getStationId()).append(alarm.getModelId());
|
|
|
|
|
|
- if(wtAlarmMap.containsKey(String.valueOf(sb)))
|
|
|
- {
|
|
|
- List<ProEconAlarmConfiguration> ls=wtAlarmMap.get(String.valueOf(sb));
|
|
|
+ if (wtAlarmMap.containsKey(String.valueOf(sb))) {
|
|
|
+ List<ProEconAlarmConfiguration> ls = wtAlarmMap.get(String.valueOf(sb));
|
|
|
ls.add(alarm);
|
|
|
- }else
|
|
|
- {
|
|
|
- List<ProEconAlarmConfiguration> ls=new ArrayList<>();
|
|
|
+ } else {
|
|
|
+ List<ProEconAlarmConfiguration> ls = new ArrayList<>();
|
|
|
ls.add(alarm);
|
|
|
- wtAlarmMap.put(String.valueOf(sb),ls);
|
|
|
+ wtAlarmMap.put(String.valueOf(sb), ls);
|
|
|
}
|
|
|
} else if (alarm.getAlarmType().equals(AlarmTypeValue.BT.getCode())) {
|
|
|
btalarmls.add(alarm);
|
|
@@ -677,44 +682,39 @@ public class CacheContext implements CommandLineRunner {
|
|
|
}
|
|
|
}
|
|
|
wtls.forEach(wt -> {
|
|
|
- if(wpByEmMap.containsKey(wt.getWindpowerstationId()))
|
|
|
- {
|
|
|
- Set<ProEconEquipmentmodel> set=wpByEmMap.get(wt.getWindpowerstationId());
|
|
|
- if(modelMap.containsKey(wt.getModelId()))
|
|
|
- {
|
|
|
- ProEconEquipmentmodel model=modelMap.get(wt.getModelId());
|
|
|
+ if (wpByEmMap.containsKey(wt.getWindpowerstationId())) {
|
|
|
+ Set<ProEconEquipmentmodel> set = wpByEmMap.get(wt.getWindpowerstationId());
|
|
|
+ if (modelMap.containsKey(wt.getModelId())) {
|
|
|
+ ProEconEquipmentmodel model = modelMap.get(wt.getModelId());
|
|
|
set.add(model);
|
|
|
}
|
|
|
|
|
|
- }else
|
|
|
- { Set<ProEconEquipmentmodel> set=new HashSet<>();
|
|
|
- if(modelMap.containsKey(wt.getModelId()))
|
|
|
- {
|
|
|
- ProEconEquipmentmodel model=modelMap.get(wt.getModelId());
|
|
|
+ } else {
|
|
|
+ Set<ProEconEquipmentmodel> set = new HashSet<>();
|
|
|
+ if (modelMap.containsKey(wt.getModelId())) {
|
|
|
+ ProEconEquipmentmodel model = modelMap.get(wt.getModelId());
|
|
|
set.add(model);
|
|
|
}
|
|
|
- wpByEmMap.put(wt.getWindpowerstationId(),set);
|
|
|
+ wpByEmMap.put(wt.getWindpowerstationId(), set);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
- weawpls = proBasicWeatherStationService.list().stream().filter(i-> i.getIsAble()==1).collect(Collectors.toList());
|
|
|
- weawpls.stream().forEach(weather->{
|
|
|
+ weawpls = proBasicWeatherStationService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
+ weawpls.stream().forEach(weather -> {
|
|
|
|
|
|
String subString = redisService.get(weather.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- weatherwppointmap.put(weather.getId(),stringWindpowerstationpointnewMap);
|
|
|
+ weatherwppointmap.put(weather.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
- alarmTypeList= proEconAlarmTypeService.list();
|
|
|
+ alarmTypeList = proEconAlarmTypeService.list();
|
|
|
|
|
|
- if(!alarmTypeList.isEmpty())
|
|
|
- {
|
|
|
- for(ProEconAlarmType at:alarmTypeList)
|
|
|
- {
|
|
|
- alarmTypeMap.put(at.getNemCode(),at);
|
|
|
+ if (!alarmTypeList.isEmpty()) {
|
|
|
+ for (ProEconAlarmType at : alarmTypeList) {
|
|
|
+ alarmTypeMap.put(at.getNemCode(), at);
|
|
|
}
|
|
|
}
|
|
|
|