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