|
@@ -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 {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|