|
@@ -1,16 +1,11 @@
|
|
|
package com.ruoyi.web.controller;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.collection.ListUtil;
|
|
|
-import cn.hutool.core.date.DateField;
|
|
|
-import cn.hutool.core.date.DateRange;
|
|
|
-import cn.hutool.core.date.DateTime;
|
|
|
-import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.collection.*;
|
|
|
+import cn.hutool.core.date.*;
|
|
|
import cn.hutool.core.lang.Dict;
|
|
|
import cn.hutool.core.text.StrBuilder;
|
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
|
-import cn.hutool.core.util.NumberUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.core.util.*;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.ruoyi.quartz.handler.IJobHandler;
|
|
@@ -35,10 +30,10 @@ import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-@Service
|
|
|
//@Service
|
|
|
+@Service
|
|
|
public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
- private static Logger logger = LoggerFactory.getLogger(JavaFunctionJobHandler.class);
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(JavaFunctionJobHandler.class);
|
|
|
|
|
|
@Resource
|
|
|
private AdapterApi adapter;
|
|
@@ -271,12 +266,22 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+// public URI taosUri() {
|
|
|
+// return URI.create("http://172.16.12.101:8012/ts");
|
|
|
+// }
|
|
|
+//
|
|
|
+// public URI goldenUri() {
|
|
|
+// return URI.create("http://172.16.12.103:8011/ts");
|
|
|
+// }
|
|
|
+
|
|
|
public URI taosUri() {
|
|
|
- return URI.create("http://172.16.12.101:8012/ts");
|
|
|
+// return URI.create("http://10.220.1.8:8011/ts");
|
|
|
+ return URI.create("http://127.0.0.1:8011/ts");
|
|
|
}
|
|
|
|
|
|
public URI goldenUri() {
|
|
|
- return URI.create("http://172.16.12.103:8011/ts");
|
|
|
+// return URI.create("http://10.220.1.8:8011/ts");
|
|
|
+ return URI.create("http://127.0.0.1:8011/ts");
|
|
|
}
|
|
|
|
|
|
public Map<String, String> getEntityMap(String uniformCode, String institutionType) {
|
|
@@ -589,7 +594,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
.eq(ProBasicProjectPlan::getMonth, String.valueOf(begin.month() + 1));
|
|
|
List<ProBasicProjectPlan> plantList = proBasicProjectPlanService.list(wrapperPlan);
|
|
|
for (DateTime date : range) {
|
|
|
-
|
|
|
+ System.out.println();
|
|
|
}
|
|
|
DateTime end = DateUtil.endOfMonth(month);
|
|
|
DateTime beginTq = DateUtil.offset(begin, DateField.YEAR, -1);
|
|
@@ -798,7 +803,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<StationInfoDay> list = getStationinfoByDate(time0);
|
|
|
Map<String, StationInfoDay> dayMap = list.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
|
|
|
CalcCache.swdlTime.forEach((key, ts) -> {
|
|
|
- int swdl = 0;
|
|
|
+ int swdl;
|
|
|
PointData data1, data0;
|
|
|
double ll = (double) (time.getTime() - ts) / 23 * 60 * 60 * 1000;
|
|
|
if (ts > 0 && (ll > 23 && ll < 25)) {
|
|
@@ -834,7 +839,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
}
|
|
|
});
|
|
|
for (StationInfoDay day : list) {
|
|
|
- int swdl = 0;
|
|
|
+ int swdl;
|
|
|
if (day.getSwdl() > day.getRfdl()) {
|
|
|
PointInfo info = map.get(day.getStationId());
|
|
|
Long l = CalcCache.swdlTime.get(info.getPointKey());
|
|
@@ -958,12 +963,12 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
List<PointInfo> entity = getEntity("Z-ZXYG-JX", "meter");
|
|
|
entity = entity.stream().filter(e -> !"".equals(e.getProjectId())).collect(Collectors.toList());
|
|
|
- getSectionDataByEntity(entity,goldenUri(), time0, time);
|
|
|
+ getSectionDataByEntity(entity, goldenUri(), time0, time);
|
|
|
Map<String, PointInfo> swdlMap = entity.stream().collect(Collectors.toMap(PointInfo::getLineId, Function.identity()));
|
|
|
List<LineInfoDay> byDate = getLineinfoByDate(time0, entity);
|
|
|
String lineId;
|
|
|
PointInfo swdlPi;
|
|
|
- int v = 0;
|
|
|
+ int v;
|
|
|
for (LineInfoDay day : byDate) {
|
|
|
lineId = day.getLineId();
|
|
|
swdlPi = swdlMap.get(lineId);
|
|
@@ -1094,7 +1099,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<LineInfoDay> byDate = getLineinfoByDate2(time0, entity);
|
|
|
String lineId;
|
|
|
PointInfo swdlPi;
|
|
|
- int v = 0;
|
|
|
+ int v;
|
|
|
for (LineInfoDay day : byDate) {
|
|
|
lineId = day.getLineId();
|
|
|
swdlPi = swdlMap.get(lineId);
|
|
@@ -1309,7 +1314,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
DateTime time0 = DateUtil.offsetDay(time, -1);
|
|
|
|
|
|
List<PointInfo> entity = getEntity("AI121", "turbine");
|
|
|
- getZeroNextData(entity, time0, time);
|
|
|
+// getZeroNextData(entity, time0, time);
|
|
|
+ getSectionDataByEntity(entity, goldenUri(), time0, time);
|
|
|
Map<String, PointInfo> turMap = entity.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
|
|
|
Map<String, String> fsMap = getEntityMap("AI066", "turbine");
|
|
|
|
|
@@ -1564,16 +1570,23 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
Map<String, EquipmentModel> map = equipmentModelService.map();
|
|
|
Double capacity = map.get(ztInfo.getSpare()).getPowerProduction();
|
|
|
List<PointData> zts = ztInfo.getPointDatas();
|
|
|
+ boolean b = false;
|
|
|
+ if (ylzsgds != null && CollUtil.isNotEmpty(ylzsgds)) b = true;
|
|
|
for (int i = 0; i < fss.size(); i++) {
|
|
|
double ssgl = gls.get(i).getValue();
|
|
|
double ssfs = fss.get(i).getValue();
|
|
|
- double ylzsgd = ylzsgds.get(i).getValue();
|
|
|
|
|
|
if (czxd.get(i).isBooleanValue() && ssgl < capacity * 0.9) {
|
|
|
if (ssfs >= 12) {
|
|
|
zts.get(i).setDoubleValue(8.0);
|
|
|
}
|
|
|
- if (ylzsgd != 0 && ylzsgd < 17.3) {//降出力
|
|
|
+ if (b) {
|
|
|
+ double ylzsgd = ylzsgds.get(i).getValue();
|
|
|
+ if (ylzsgd != 0 && ylzsgd < 17.3) {//降出力
|
|
|
+ zts.get(i).setDoubleValue(8.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (calcQfzt(ssgl, CalcCache.fitcoef.get(ztInfo.getTurbineId()).get(ssfs)) >= 3) {
|
|
|
zts.get(i).setDoubleValue(8.0);
|
|
|
}
|
|
|
}
|
|
@@ -1698,6 +1711,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
entity.addAll(entity2);
|
|
|
entity.addAll(entity4);
|
|
|
entity.addAll(entity6);
|
|
|
+ if (CollUtil.isEmpty(entity)) return entity;
|
|
|
List<String> keys = entity.stream().map(PointInfo::getPointKey).collect(Collectors.toList());
|
|
|
Map<String, PointData> latest = adapter.getHistorySection(goldenUri(), String.join(",", keys), start.getTime());
|
|
|
|
|
@@ -2165,9 +2179,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
public void getLatestByEntity(List<PointInfo> entity, URI uri) {
|
|
|
String collect = entity.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
|
|
|
Map<String, PointData> latest = adapter.getLatest(uri, collect);
|
|
|
- entity.forEach(e -> {
|
|
|
- e.setPointDatas(Collections.singletonList(latest.get(e.getPointKey())));
|
|
|
- });
|
|
|
+ entity.forEach(e -> e.setPointDatas(Collections.singletonList(latest.get(e.getPointKey()))));
|
|
|
}
|
|
|
|
|
|
public void getLatestByEntity(List<PointInfo> entity) {
|
|
@@ -2330,9 +2342,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
mapTurbineValues.remove(key);
|
|
|
}
|
|
|
}
|
|
|
- mapTurbineValues.forEach((k1, v) -> {
|
|
|
- sum.updateAndGet(v1 -> v1 + v);
|
|
|
- });
|
|
|
+ mapTurbineValues.forEach((k1, v) -> sum.updateAndGet(v1 -> v1 + v));
|
|
|
|
|
|
//如果值为空则置0
|
|
|
if (sum.get() == 0) {
|
|
@@ -2355,9 +2365,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
mapTurbineValues2.remove(key);
|
|
|
}
|
|
|
}
|
|
|
- mapTurbineValues2.forEach((k2, v) -> {
|
|
|
- sum.updateAndGet(v1 -> v1 + v);
|
|
|
- });
|
|
|
+ mapTurbineValues2.forEach((k2, v) -> sum.updateAndGet(v1 -> v1 + v));
|
|
|
|
|
|
if (sum.get() == 0) {
|
|
|
avgCutOutWindSpeed = 0;
|
|
@@ -2404,8 +2412,136 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //算额定风速
|
|
|
public void calcGlqxnh_edfs() {
|
|
|
+
|
|
|
+ //date当天零点
|
|
|
+ Date end = DateUtil.beginOfDay(new Date()).toJdkDate();
|
|
|
+ //date昨天零点
|
|
|
+ Date start = DateUtil.offsetDay(end, -1).toJdkDate();
|
|
|
+
|
|
|
+ //风速
|
|
|
+ List<PointInfo> entityFs = getEntity("AI066", "turbine");
|
|
|
+ //功率
|
|
|
+ List<PointInfo> entityGl = getEntity("AI114", "turbine");
|
|
|
+ Map<String, PointInfo> glMap = entityGl.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
|
|
|
+
|
|
|
+ Map<String, EquipmentModel> map = equipmentModelService.map();
|
|
|
+
|
|
|
+// List<PointInfo> entity = new ArrayList<>();
|
|
|
+// List<PointInfo> entity0 = getEntity("MX000", "state");
|
|
|
+// List<PointInfo> entity1 = getEntity("MX001", "state");
|
|
|
+// List<PointInfo> entity2 = getEntity("MX002", "state");
|
|
|
+// List<PointInfo> entity4 = getEntity("MX004", "state");
|
|
|
+// List<PointInfo> entity6 = getEntity("MX006", "state");
|
|
|
+// entity.addAll(entity0);
|
|
|
+// entity.addAll(entity1);
|
|
|
+// entity.addAll(entity2);
|
|
|
+// entity.addAll(entity4);
|
|
|
+// entity.addAll(entity6);
|
|
|
+// List<String> keys = entity.stream().map(PointInfo::getPointKey).collect(Collectors.toList());
|
|
|
+// Map<String, PointData> latest = adapter.getHistorySection(goldenUri(), String.join(",", keys), start.getTime());
|
|
|
+// Map<String, Map<String, PointInfo>> wtUcPis = entity.stream().collect(Collectors.groupingBy(PointInfo::getTurbineId, Collectors.toMap(PointInfo::getUniformCode, Function.identity())));
|
|
|
+
|
|
|
+ List<PointInfo> entityAiZt = getEntity("AI422", "state");
|
|
|
+ Map<String, PointInfo> aiztMap = entityAiZt.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
|
|
|
+ List<StateAi> list = stateAiService.list();
|
|
|
+ Map<String, Map<Integer, Integer>> collectAi = list.stream().collect(Collectors.groupingBy(
|
|
|
+ StateAi::getModel, Collectors.toMap(StateAi::getOriginalState, StateAi::getMappingState)));
|
|
|
+
|
|
|
+// Map<String, Map<Double,Double>> fitMap = new HashMap<>();
|
|
|
+ int i = 0;
|
|
|
+ for (PointInfo ef : entityFs) {
|
|
|
+ String wtId = ef.getTurbineId();
|
|
|
+ PointInfo glInfo = glMap.get(wtId);
|
|
|
+ getSnapDataByEntity(ef, start, end, 60);
|
|
|
+ getSnapDataByEntity(glInfo, start, end, 60);
|
|
|
+ List<PointData> peek = ef.getPointDatas().stream().peek(pd -> pd.setDoubleValue(
|
|
|
+ NumberUtil.round(pd.getValue(), 2).doubleValue())).collect(Collectors.toList());
|
|
|
+ ef.setPointDatas(peek);
|
|
|
+
|
|
|
+ try {
|
|
|
+// PointInfo turbineZt = calcTurbineDizt2(wtUcPis.get(wtId), latest, start, end, 60);
|
|
|
+ PointInfo turbineAizt = calcTurbineAizt2(aiztMap.get(wtId), collectAi, start, end, 60);
|
|
|
+ Map<Double, Double> fit = new TreeMap<>();
|
|
|
+ double capacity = 2000;
|
|
|
+// if (turbineZt != null) {
|
|
|
+// System.out.println("数据处理拟合");
|
|
|
+// capacity = map.get(turbineZt.getSpare()).getPowerProduction();
|
|
|
+// fit = dataProcessAndFit(ef, glInfo, turbineZt, CalcCache.bzgl.get(turbineZt.getSpare()), capacity);
|
|
|
+//// fitMap.put(wtId, fit);
|
|
|
+// turbineZt.setPointDatas(null);
|
|
|
+// }
|
|
|
+ if (turbineAizt != null) {
|
|
|
+ System.out.println("数据处理拟合");
|
|
|
+ capacity = map.get(turbineAizt.getSpare()).getPowerProduction();
|
|
|
+ fit = dataProcessAndFit(ef, glInfo, turbineAizt, CalcCache.bzgl.get(turbineAizt.getSpare()), capacity);
|
|
|
+// fitMap.put(wtId, fit);
|
|
|
+ turbineAizt.setPointDatas(null);
|
|
|
+ }
|
|
|
+ ef.setPointDatas(null);
|
|
|
+ glInfo.setPointDatas(null);
|
|
|
+
|
|
|
+ //存redis
|
|
|
+// stringRedisTemplate.opsForValue().set("glqxnh:" + end.getMonth() + ":" + wtId, JSON.toJSONString(fit));
|
|
|
+ System.out.println("拟合曲线的大小"+fit.size()+":"+wtId);
|
|
|
+
|
|
|
+
|
|
|
+ //符合条件的风速和
|
|
|
+ List<Double> listDouble = new ArrayList<>();
|
|
|
+ //遍历fit集合,取出值与capacity相等的key
|
|
|
+ if (!fit.isEmpty()) {
|
|
|
+ for (double key : fit.keySet()) {
|
|
|
+ Double v = fit.get(key);
|
|
|
+ //如果v-capacity的值小于10大于-10,则把key加入listDouble
|
|
|
+ if ((Math.abs(v - capacity) <= 10) && Math.abs(v - capacity) >= -10) {
|
|
|
+ listDouble.add(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //取出listDouble的值求平均值
|
|
|
+ double agValue = 0;
|
|
|
+ if (!listDouble.isEmpty()) {
|
|
|
+ for (Double aDouble : listDouble) {
|
|
|
+ agValue += aDouble;
|
|
|
+ }
|
|
|
+ agValue = agValue / listDouble.size();
|
|
|
+ }
|
|
|
+ System.out.println("wtId:" + wtId + "agValue平均额定风速:" + agValue);
|
|
|
+
|
|
|
+
|
|
|
+ //存入数据库
|
|
|
+ System.out.println(wtId + " " + start);
|
|
|
+ QueryWrapper<TurbineInfoDay> turbineInfoDayQueryWrapper = new QueryWrapper<>();
|
|
|
+ turbineInfoDayQueryWrapper.eq("turbine_id", wtId);
|
|
|
+ turbineInfoDayQueryWrapper.eq("record_date", start);
|
|
|
+ TurbineInfoDay one = turbineInfoDayService.getOne(turbineInfoDayQueryWrapper);
|
|
|
+ System.out.println(one);
|
|
|
+ if (one == null) {
|
|
|
+ TurbineInfoDay turbineInfoDay = new TurbineInfoDay();
|
|
|
+ turbineInfoDay.setTurbineId(wtId);
|
|
|
+ turbineInfoDay.setRecordDate(start);
|
|
|
+ turbineInfoDay.setEdfs(agValue);
|
|
|
+ System.out.println(turbineInfoDay);
|
|
|
+ turbineInfoDayService.save(turbineInfoDay);
|
|
|
+ } else {
|
|
|
+ one.setEdfs(agValue);
|
|
|
+ System.out.println(one);
|
|
|
+ turbineInfoDayService.updateById(one);
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch (Exception e) {
|
|
|
+ System.out.println(wtId + " " + start);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+// stringRedisTemplate.opsForValue().set("glqxnh", JSON.toJSONString(fitMap));
|
|
|
+ }
|
|
|
+
|
|
|
+ //算额定风速
|
|
|
+ public void calcGlqxnh_edfs2() {
|
|
|
//date当天零点
|
|
|
DateTime timeNow00 = DateUtil.beginOfDay(new Date());
|
|
|
//date昨天零点
|
|
@@ -3532,9 +3668,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<PointInfo> entity = getEntity(uniformCode, institutionType);
|
|
|
String collect = entity.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
|
|
|
Map<String, PointData> latest = adapter.getLatest(goldenUri(), collect);
|
|
|
- entity.forEach(e -> {
|
|
|
- e.setPointDatas(Collections.singletonList(latest.get(e.getPointKey())));
|
|
|
- });
|
|
|
+ entity.forEach(e -> e.setPointDatas(Collections.singletonList(latest.get(e.getPointKey()))));
|
|
|
return entity;
|
|
|
}
|
|
|
|
|
@@ -3551,6 +3685,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
entity.addAll(entity2);
|
|
|
entity.addAll(entity4);
|
|
|
entity.addAll(entity6);
|
|
|
+ if (entity.isEmpty()) return result;
|
|
|
String keys = entity.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
|
|
|
Map<String, PointData> latest = adapter.getLatest(goldenUri(), keys);
|
|
|
|
|
@@ -4369,6 +4504,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
//功率
|
|
|
List<PointInfo> entityGl = getEntity("AI114", "turbine");
|
|
|
Map<String, PointInfo> rawMapGl = getSnapDataByEntity(entityGl, goldenUri(), start, date, 15, PointInfo::getTurbineId);
|
|
|
+ entityGl.forEach(g -> g.getPointDatas().forEach(p -> p.setDoubleValue(p.getValue() * g.getCoef())));
|
|
|
//状态
|
|
|
List<PointInfo> entityZt = getEntity("MXZT", "turbine");
|
|
|
Map<String, PointInfo> rawMapZt = getRawDataByEntity(entityZt, taosUri(), start, date, PointInfo::getTurbineId);
|
|
@@ -4617,10 +4753,10 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
Map<String, PointInfo> mapAgc = entityAgc.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
|
|
|
//出线
|
|
|
List<PointInfo> entityCx = getEntity("AGC001", "booster");
|
|
|
- Map<String, PointInfo> statMapCx = getSnapDataByEntity(entityCx, goldenUri(), begin, end,15, PointInfo::getStationId);
|
|
|
+ Map<String, PointInfo> statMapCx = getSnapDataByEntity(entityCx, goldenUri(), begin, end, 15, PointInfo::getStationId);
|
|
|
//环境温度
|
|
|
List<PointInfo> entityHjwd = getEntity("AI072", "turbine");
|
|
|
- getSnapDataByEntity(entityHjwd, goldenUri(), begin, end,15);
|
|
|
+ getSnapDataByEntity(entityHjwd, goldenUri(), begin, end, 15);
|
|
|
Map<String, List<PointInfo>> hjwdsMap = entityHjwd.stream().collect(Collectors.groupingBy(PointInfo::getStationId));
|
|
|
//日发电量
|
|
|
List<PointInfo> entity = getEntity("Z-ZXYG-JX", "meter");
|
|
@@ -4653,7 +4789,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
double rfdl = fdlInfos.stream().mapToDouble(pi -> {
|
|
|
double v = (pi.getPointDatas().get(1).getValue() - pi.getPointDatas().get(0).getValue()) * pi.getCoef();
|
|
|
if (v < 0) v = 0;
|
|
|
- System.out.println(pi.getLineId()+","+v);
|
|
|
+ System.out.println(pi.getLineId() + "," + v);
|
|
|
return v;
|
|
|
}).sum();
|
|
|
if (rfdl >= 42400.0) rfdl = day.getPjgl() / 4.0;
|
|
@@ -5130,7 +5266,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
if (actualPower.size() < n) return 0;
|
|
|
double maxErrorPercentage = 0.0;
|
|
|
for (int i = 0; i < n; i++) {
|
|
|
- double errorPercentage = 0.0;
|
|
|
+ double errorPercentage;
|
|
|
if (predictPower.get(i) == 0) {
|
|
|
if (Math.abs(actualPower.get(i)) <= 0.03 * installCapacity) {
|
|
|
continue; // 不考核
|
|
@@ -5162,7 +5298,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
double totalError = 0.0;
|
|
|
int validPoints = 0;
|
|
|
for (int i = 0; i < n; i++) {
|
|
|
- double errorPercentage = 0.0;
|
|
|
+ double errorPercentage;
|
|
|
if (Math.abs(predictPower.get(i) - actualPower.get(i)) <= 0.03 * installCapacity) {
|
|
|
// 该点不计入误差计算
|
|
|
continue;
|
|
@@ -5178,8 +5314,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private Map<String, Double> fjhjwd = new HashMap<>();
|
|
|
- private Map<String, Double> fjfs = new HashMap<>();
|
|
|
+ private final Map<String, Double> fjhjwd = new HashMap<>();
|
|
|
+ private final Map<String, Double> fjfs = new HashMap<>();
|
|
|
|
|
|
public void calcStationPjfsHjwdMin(Date begin, Date end, String stId, StationInfoMin min) {
|
|
|
//风速
|
|
@@ -5441,7 +5577,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
}
|
|
|
|
|
|
private void setpjfs(StationInfoMin2 min2, PointInfo pi, int i) {
|
|
|
- double v = 0;
|
|
|
+ double v;
|
|
|
if (pi == null || pi.getPointDatas().isEmpty()) {
|
|
|
v = fjfs.getOrDefault(pi.getTurbineId(), 0.0);
|
|
|
} else {
|
|
@@ -5780,7 +5916,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
e0 += 15 * 60 * 1000;
|
|
|
}
|
|
|
}
|
|
|
- if (pi.getPointDatas().size() == 0) {
|
|
|
+ if (pi.getPointDatas().isEmpty()) {
|
|
|
b0 = e0;
|
|
|
e0 += 15 * 60 * 1000;
|
|
|
}
|
|
@@ -6144,4 +6280,48 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
System.out.println(DateUtil.formatDateTime(new Date(pd.getTs())) + "," + pd.getValue());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// public void calcTurbineJfplPjfxGlyzxxs(Date date) {
|
|
|
+// //静风频率,平均风向、功率一致性系数
|
|
|
+// //date当天零点
|
|
|
+// DateTime time = DateUtil.beginOfDay(date);
|
|
|
+// //date昨天零点
|
|
|
+// DateTime time0 = DateUtil.offsetDay(time, -1);
|
|
|
+//
|
|
|
+// List<PointInfo> entityFx = getEntity("AI066", "turbine");
|
|
|
+// getStatDataByEntity();
|
|
|
+// getZeroNextData(entity, time0, time);
|
|
|
+// Map<String, PointInfo> turMap = entity.stream().collect(Collectors.toMap(PointInfo::getTurbineId, Function.identity()));
|
|
|
+// Map<String, String> fsMap = getEntityMap("AI066", "turbine");
|
|
|
+//
|
|
|
+// Map<String, TurbineInfoDay> byDate = getTurbineinfoMap(time0, entity);
|
|
|
+//
|
|
|
+// TurbineInfoDay infoDay;
|
|
|
+// PointInfo rfdlPi;
|
|
|
+// String turbineId;
|
|
|
+// List<TurbineInfoDay> infoDays = new ArrayList<>();
|
|
|
+// DoubleStatData stat;
|
|
|
+// for (PointInfo info : entity) {
|
|
|
+// turbineId = info.getTurbineId();
|
|
|
+// infoDay = byDate.get(turbineId);
|
|
|
+//
|
|
|
+// rfdlPi = turMap.get(turbineId);
|
|
|
+// double v = (rfdlPi.getPointDatas().get(1).getValue() - rfdlPi.getPointDatas().get(0).getValue()) * rfdlPi.getCoef();
|
|
|
+// if (v < 0 || v > 1000000) {
|
|
|
+// v = 0;
|
|
|
+// } else if (v > 30000) {
|
|
|
+// v = v / (v % 30000 + 3);
|
|
|
+// }
|
|
|
+// infoDay.setRfdl(v);
|
|
|
+// stat = adapter.getHistoryStat(goldenUri(), fsMap.get(turbineId), time0.getTime(), time.getTime());
|
|
|
+// if (stat == null) {
|
|
|
+// infoDay.setPjfs(0.0);
|
|
|
+// } else {
|
|
|
+// infoDay.setPjfs(stat.getAvg().getValue());
|
|
|
+// }
|
|
|
+//
|
|
|
+// infoDays.add(infoDay);
|
|
|
+// }
|
|
|
+// turbineInfoDayService.saveOrUpdateBatch(infoDays);
|
|
|
+// }
|
|
|
}
|