Browse Source

调整计算

xieshengjie 2 years ago
parent
commit
46561fe1a4

+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -43,6 +43,9 @@ public class CacheContext implements CommandLineRunner {
     private IProEconEquipmentmodelService proEconEquipmentmodelService;
 
     @Resource
+    private IProEconWtPowerCurveFittingService proEconWtPowerCurveFittingService;
+
+    @Resource
     private IProBasicWindturbinePowerService proBasicWindturbinePowerService;
     @Resource
     private RedisService redisService;
@@ -446,6 +449,19 @@ public class CacheContext implements CommandLineRunner {
         statusMap = JSONObject.parseObject(sszzt, new TypeReference<Map<String,List<ProBasicStatusPoint>>>() {
         });
 
+        List<ProEconWtPowerCurveFitting> econWtPowerCurveFittings = proEconWtPowerCurveFittingService.list();
+        if (StringUtils.isNotNull(econWtPowerCurveFittings)){
+            econWtPowerCurveFittings.stream().forEach(curveFitting->{
+                if (curveFittingPowerMap.containsKey(curveFitting.getWindturbineId())){
+                    curveFittingPowerMap.get(curveFitting.getWindturbineId()).put(curveFitting.getSpeed(),curveFitting);
+                }else {
+                    Map<Double,ProEconWtPowerCurveFitting> powerMap = new HashMap<>();
+                    powerMap.put(curveFitting.getSpeed(),curveFitting);
+                    curveFittingPowerMap.put(curveFitting.getWindturbineId(),powerMap);
+                }
+            });
+        }
+
 
 
         logger.info("缓存结束------------------------------------------------------------");