Ver código fonte

优化后台计算算法

shilin 1 ano atrás
pai
commit
988d3fbe5a

+ 8 - 3
realtime/datatraining-server/src/main/java/com/gyee/datatraining/init/CacheContext.java

@@ -1,6 +1,7 @@
 package com.gyee.datatraining.init;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.datatraining.model.auto.*;
 import com.gyee.datatraining.service.auto.*;
 import org.slf4j.Logger;
@@ -159,7 +160,10 @@ public class CacheContext implements CommandLineRunner {
                 }
             }
         }
-        List<ProBasicEquipmentPoint> WindturbinetestingpointnewList = proBasicEquipmentPointService.list();
+
+        QueryWrapper<ProBasicEquipmentPoint> queryWrapper = new QueryWrapper<>();
+        queryWrapper.like("windpowerstation_id","FDC");
+        List<ProBasicEquipmentPoint> WindturbinetestingpointnewList = proBasicEquipmentPointService.list(queryWrapper);
         Map<String, ProBasicEquipmentPoint> map = null;
 
         if(WindturbinetestingpointnewList != null && !WindturbinetestingpointnewList.isEmpty()){
@@ -175,8 +179,9 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
-
-        List<ProBasicPowerstationPoint> wplist = proBasicPowerstationPointService.list();
+        QueryWrapper<ProBasicPowerstationPoint> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.like("windpowerstation_id","FDC");
+        List<ProBasicPowerstationPoint> wplist = proBasicPowerstationPointService.list(queryWrapper2);
         for (ProBasicPowerstationPoint ProBasicPowerstationPoint : wplist) {
             if (wppointmap.containsKey(ProBasicPowerstationPoint.getWindpowerstationId())){
                 wppointmap.get(ProBasicPowerstationPoint.getWindpowerstationId()).put(ProBasicPowerstationPoint.getUniformCode(),ProBasicPowerstationPoint);

+ 3 - 3
realtime/datatraining-server/src/main/java/com/gyee/datatraining/util/realtimesource/timeseries/JsonObjectHelper.java

@@ -40,7 +40,7 @@ public class JsonObjectHelper {
             pointData.setPointTime(ts / 1000);
             pointData.setPointValue(pointValue);
             pointData.setPointValueInDouble(Double.parseDouble(pointValue));
-            System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
+//            System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
             result.add(pointData);
         }
         return result;
@@ -68,7 +68,7 @@ public class JsonObjectHelper {
             pointData.setPointTime(ts / 1000);
             pointData.setPointValue(pointValue);
             pointData.setPointValueInDouble(Double.parseDouble(pointValue));
-            System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
+ //           System.out.println("key= " + tagName + ", ts = " + ts + ", value = " + pointValue);
             result.add(pointData);
         }
         return result;
@@ -120,7 +120,7 @@ public class JsonObjectHelper {
             pointData.setPointValue(pointValue);
             pointData.setPointValueInDouble(Double.parseDouble(pointValue));
             pointData.setPointTime(ts/1000);
-            System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
+//            System.out.println("key= " + key + ", ts = " + ts + ", value = " + pointValue);
             result.add(pointData);
         }
         return result;