Ver código fonte

添加风向统一编码

shilin 2 anos atrás
pai
commit
c1c30d4a5e

+ 12 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -95,7 +95,7 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String,List<ProBasicEquipment>> wpwtmap = new HashMap<>();
     public static Map<String,List<ProBasicEquipment>> pjwtmap = new HashMap<>();
     public static Map<String,List<ProBasicEquipment>> lnwtmap = new HashMap<>();
-
+    public static List<ProBasicWeatherStation> wsls=new ArrayList<>();
 
     public static Map<String,List<ProBasicEquipment>> sqwtmap = new HashMap<>();
     public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = new HashMap<>();// 风电机测点AI表
@@ -127,7 +127,7 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, Map<Double,ProBasicModelPowerRd>> theoreticalPowerMap = new HashMap<>(); //理论,保证功率
     public static Map<String, Map<Double,ProEconWtPowerCurveFitting>> curveFittingPowerMap = new HashMap<>(); //自算,最优功率
     public static Map<String,List<ProBasicStatusPoint>> statusMap = new HashMap<>();
-
+    public static Map<String,Map<String, ProBasicPowerstationPoint>> wspointmap =new HashMap<>();
     @Override
     public void run(String... args) throws Exception {
         logger.info("缓存开始------------------------------------------------------------");
@@ -135,6 +135,7 @@ public class CacheContext implements CommandLineRunner {
 
         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());
 
         theoreticalPowerList= proBasicModelPowerRdService.list();
         equipmentmodels = proEconEquipmentmodelService.list();
@@ -254,6 +255,15 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
+        wsls.stream().forEach(p->{
+
+
+            String wsString = redisService.get(p.getId());
+            Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(wsString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
+            });
+            wspointmap.put(p.getId(),stringWindpowerstationpointnewMap);
+
+        });
 
         wtls = proBasicEquipmentService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId()) && i.getIsable()==1).collect(Collectors.toList());
         logger.info(wtls.size()+"");