|
@@ -1394,8 +1394,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ turbineInfoDayService.saveOrUpdateBatch(interest);
|
|
|
+ turbineInfoDayService.saveOrUpdateBatch(update);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1537,8 +1537,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ turbineInfoDayService.saveOrUpdateBatch(interest);
|
|
|
+ turbineInfoDayService.saveOrUpdateBatch(update);
|
|
|
|
|
|
|
|
|
|
|
@@ -1546,6 +1546,73 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public void ambientTemperature() {
|
|
|
+
|
|
|
+ DateTime timeNow = DateUtil.beginOfDay(new Date());
|
|
|
+
|
|
|
+ DateTime timeBegin = DateUtil.offsetDay(timeNow, -1);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ QueryWrapper<PointInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("uniform_code", "AI072");
|
|
|
+
|
|
|
+ List<PointInfo> pointInfos = getEntity("AI072", "turbine");
|
|
|
+
|
|
|
+
|
|
|
+ List<TurbineInfoDay > interest = new ArrayList<>();
|
|
|
+
|
|
|
+ List<TurbineInfoDay > update = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ for (PointInfo turbine : pointInfos) {
|
|
|
+ List<PointData> pointDatas = adapter.getHistorySnap(goldenUri(), turbine.getPointKey(), timeBegin.getTime(), timeNow.getTime(), 10);
|
|
|
+
|
|
|
+ double avgCutInWindSpeed = 0;
|
|
|
+ for (PointData pointData : pointDatas) {
|
|
|
+ avgCutInWindSpeed += pointData.getValue();
|
|
|
+ }
|
|
|
+ avgCutInWindSpeed /= pointDatas.size();
|
|
|
+
|
|
|
+
|
|
|
+ String turbineId = turbine.getTurbineId();
|
|
|
+ Date jdkDate = timeBegin.toJdkDate();
|
|
|
+ System.out.println(turbineId + " " + jdkDate);
|
|
|
+ QueryWrapper<TurbineInfoDay> turbineInfoDayQueryWrapper = new QueryWrapper<>();
|
|
|
+ turbineInfoDayQueryWrapper.eq("turbine_id", turbine.getTurbineId());
|
|
|
+ turbineInfoDayQueryWrapper.eq("record_date", timeBegin.toJdkDate());
|
|
|
+ TurbineInfoDay one = turbineInfoDayService.getOne(turbineInfoDayQueryWrapper);
|
|
|
+ System.out.println(one);
|
|
|
+ if (one == null) {
|
|
|
+ TurbineInfoDay turbineInfoDay = new TurbineInfoDay();
|
|
|
+ turbineInfoDay.setTurbineId(turbine.getTurbineId());
|
|
|
+ turbineInfoDay.setRecordDate(timeBegin.toJdkDate());
|
|
|
+ turbineInfoDay.setHjwd(avgCutInWindSpeed);
|
|
|
+ System.out.println(turbineInfoDay);
|
|
|
+ interest.add(turbineInfoDay);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ one.setHjwd(avgCutInWindSpeed);
|
|
|
+ System.out.println(one);
|
|
|
+ update.add(one);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ turbineInfoDayService.saveOrUpdateBatch(interest);
|
|
|
+ turbineInfoDayService.saveOrUpdateBatch(update);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|