|
@@ -59,6 +59,7 @@ public class ZhiBiaoCalculation {
|
|
|
|
|
|
//定义切入风速map集合
|
|
|
HashMap<String, HashMap<String, Double>> mapIn = new HashMap<>();
|
|
|
+
|
|
|
//定义切出风速集合
|
|
|
HashMap<String, HashMap<String, Double>> mapOut = new HashMap<>();
|
|
|
|
|
@@ -66,6 +67,9 @@ public class ZhiBiaoCalculation {
|
|
|
//遍历每台风机,取出每台风机的pointDatas
|
|
|
for (PointInfo turbine : turbineZt) {
|
|
|
|
|
|
+ mapIn.put(turbine.getTurbineId(), new HashMap<>();
|
|
|
+ mapOut.put(turbine.getTurbineId(), new HashMap<>();
|
|
|
+
|
|
|
List<PointData> pointDatas = turbine.getPointDatas();
|
|
|
|
|
|
//风速测点key
|
|
@@ -107,9 +111,9 @@ public class ZhiBiaoCalculation {
|
|
|
// System.out.println(turbine.getTurbineId() + "切入风速" + avgCutInWindSpeed);
|
|
|
|
|
|
//存入map集合,外层key为turbineId,内层key为ts1,value为平均切入风速
|
|
|
- mapIn.put(turbine.getTurbineId(), new HashMap<String, Double>() {{
|
|
|
- put(String.valueOf(ts1), avgCutInWindSpeed);
|
|
|
- }});
|
|
|
+
|
|
|
+ mapIn.get(turbine.getTurbineId()).put(String.valueOf(ts1), avgCutInWindSpeed);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//切出
|
|
@@ -124,10 +128,8 @@ public class ZhiBiaoCalculation {
|
|
|
// System.out.println(turbine.getTurbineId() + "切出风速" + avgCutOutWindSpeed);
|
|
|
|
|
|
//存入map集合,外层key为turbineId,内层key为ts2,value为平均切出风速
|
|
|
- mapOut.put(turbine.getTurbineId(), new HashMap<String, Double>() {{
|
|
|
- put(String.valueOf(ts2), avgCutOutWindSpeed);
|
|
|
- }});
|
|
|
- }
|
|
|
+
|
|
|
+ mapOut.get(turbine.getTurbineId()).put(String.valueOf(ts2), avgCutOutWindSpeed);
|
|
|
}
|
|
|
//遍历map集合,取出每个风机的所有切入风速,算一个平均值
|
|
|
HashMap<String, Double> mapTurbineValues = mapIn.get(turbine.getTurbineId());
|
|
@@ -142,7 +144,7 @@ public class ZhiBiaoCalculation {
|
|
|
mapTurbineValues.remove(key);
|
|
|
}
|
|
|
}
|
|
|
- mapTurbineValues.forEach((k, v) -> {
|
|
|
+ mapTurbineValues.forEach((k1, v) -> {
|
|
|
sum.updateAndGet(v1 -> v1 + v);
|
|
|
});
|
|
|
|
|
@@ -167,7 +169,7 @@ public class ZhiBiaoCalculation {
|
|
|
mapTurbineValues2.remove(key);
|
|
|
}
|
|
|
}
|
|
|
- mapTurbineValues2.forEach((k, v) -> {
|
|
|
+ mapTurbineValues2.forEach((k2, v) -> {
|
|
|
sum.updateAndGet(v1 -> v1 + v);
|
|
|
});
|
|
|
|
|
@@ -194,11 +196,11 @@ public class ZhiBiaoCalculation {
|
|
|
turbineInfoDay.setRecordDate(timeBegin.toJdkDate());
|
|
|
turbineInfoDay.setXfqrfs(avgCutInWindSpeed);
|
|
|
System.out.println(turbineInfoDay);
|
|
|
- turbineInfoDayService.save(turbineInfoDay);
|
|
|
+// turbineInfoDayService.save(turbineInfoDay);
|
|
|
}else {
|
|
|
one.setXfqrfs(avgCutInWindSpeed);
|
|
|
System.out.println(one);
|
|
|
- turbineInfoDayService.updateById(one);
|
|
|
+// turbineInfoDayService.updateById(one);
|
|
|
}
|
|
|
|
|
|
// turbineInfoDayService.saveOrUpdate(one);
|