Explorar o código

平均环境温度

malijun hai 5 meses
pai
achega
761b70c0c4
Modificáronse 1 ficheiros con 5 adicións e 11 borrados
  1. 5 11
      ruoyi-admin/src/test/java/com/ruoyi/Test.java

+ 5 - 11
ruoyi-admin/src/test/java/com/ruoyi/Test.java

@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ruoyi.ucp.entity.*;
+import com.ruoyi.ucp.feign.AdapterApi;
 import com.ruoyi.ucp.service.ITurbineInfoDayService;
 import com.ruoyi.ucp.util.CalcCache;
 import org.junit.runner.RunWith;
@@ -25,6 +26,9 @@ import java.util.stream.Collectors;
 @SpringBootTest
 @RunWith(SpringRunner.class)
 public class Test {
+
+    @Resource
+    private AdapterApi adapter;
     @Resource
     private JavaFunctionJobHandler javaFunctionJobHandler;
     @Resource
@@ -53,11 +57,9 @@ public class Test {
         List<PointInfo> pointInfos = javaFunctionJobHandler.getEntity("AI072", "turbine");
 
 
-
         //遍历pointInfos
         for (PointInfo turbine : pointInfos) {
-            //取出pointData
-            List<PointData> pointDatas = turbine.getPointDatas();
+            List<PointData> pointDatas = adapter.getHistorySnap(javaFunctionJobHandler.goldenUri(), turbine.getPointKey(), timeBegin.getTime(), timeNow.getTime(), 10);
             //遍历pointDatas,取出数据算平均值
             double avgCutInWindSpeed = 0;
             for (PointData pointData : pointDatas) {
@@ -65,8 +67,6 @@ public class Test {
             }
             avgCutInWindSpeed /= pointDatas.size();
 
-
-
             //存入数据库
             String turbineId = turbine.getTurbineId();
             Date jdkDate = timeBegin.toJdkDate();
@@ -90,15 +90,9 @@ public class Test {
             }
 
 
-
         }
 
 
-
-
-
-
-
     }
 }