|
|
@@ -1,8 +1,11 @@
|
|
|
+/*
|
|
|
package com.ruoyi;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.text.StrBuilder;
|
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
@@ -27,7 +30,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-@Service
|
|
|
+//@Service
|
|
|
public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
@Resource
|
|
|
@@ -54,6 +57,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
private ITurbineInfoMinService turbineInfoMinService;
|
|
|
@Resource
|
|
|
private IStationInfoMinService stationInfoMinService;
|
|
|
+ @Resource
|
|
|
+ private IProBasicProjectPlanService proBasicProjectPlanService;
|
|
|
|
|
|
@Override
|
|
|
public void execute() throws Exception {
|
|
|
@@ -465,6 +470,64 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
stationInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
}
|
|
|
|
|
|
+ public void calcStationRjhfdl(Date month) {
|
|
|
+ DateTime begin = DateUtil.beginOfMonth(month);
|
|
|
+ DateTime end = DateUtil.endOfMonth(month);
|
|
|
+ DateTime beginTq = DateUtil.offset(begin, DateField.YEAR, -1);
|
|
|
+ DateTime endTq = DateUtil.offset(end, DateField.YEAR, -1);
|
|
|
+
|
|
|
+ QueryWrapper<StationInfoDay> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.lambda().between(StationInfoDay::getRecordDate, begin, end);
|
|
|
+ List<StationInfoDay> days = stationInfoDayService.list(wrapper);
|
|
|
+ Map<String, Map<String, StationInfoDay>> dayMap = new HashMap<>();
|
|
|
+ if (CollUtil.isNotEmpty(days)) {
|
|
|
+ dayMap = days.stream().collect(Collectors.groupingBy(StationInfoDay::getStationId,
|
|
|
+ Collectors.toMap(sid -> DateUtil.date(sid.getRecordDate()).toString(), Function.identity())));
|
|
|
+ }
|
|
|
+ wrapper.clear();
|
|
|
+ wrapper.lambda().between(StationInfoDay::getRecordDate, beginTq, endTq);
|
|
|
+ List<StationInfoDay> sids = stationInfoDayService.list(wrapper);
|
|
|
+ Map<String, List<StationInfoDay>> sidMap;
|
|
|
+ if (CollUtil.isNotEmpty(sids)) {
|
|
|
+ sidMap = sids.stream().collect(Collectors.groupingBy(StationInfoDay::getStationId));
|
|
|
+ } else {
|
|
|
+ sidMap = null;
|
|
|
+ }
|
|
|
+ QueryWrapper<ProBasicProjectPlan> wrapperPlan = new QueryWrapper<>();
|
|
|
+ wrapperPlan.lambda().eq(ProBasicProjectPlan::getYear, String.valueOf(begin.year()))
|
|
|
+ .eq(ProBasicProjectPlan::getMonth, String.valueOf(begin.month() + 1));
|
|
|
+ List<ProBasicProjectPlan> plantList = proBasicProjectPlanService.list(wrapperPlan);
|
|
|
+
|
|
|
+ for (ProBasicProjectPlan plan : plantList) {
|
|
|
+ String stId = plan.getWindpowerstationId();
|
|
|
+ Map<String, StationInfoDay> daym = dayMap.get(stId);
|
|
|
+ if (daym == null) daym = new HashMap<>();
|
|
|
+ if (sidMap == null) {
|
|
|
+ for (StationInfoDay day : daym.values()) {
|
|
|
+ day.setJhfdl(plan.getGeneratingCapacity() / daym.size());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //去年月发电量
|
|
|
+ List<StationInfoDay> sidList = sidMap.get(stId);
|
|
|
+ double rfdlSum = sidList.stream().mapToDouble(StationInfoDay::getRfdl).sum();
|
|
|
+ double v = plan.getGeneratingCapacity() / rfdlSum;
|
|
|
+ for (StationInfoDay sid : sidList) {
|
|
|
+ DateTime time = DateUtil.offset(sid.getRecordDate(), DateField.YEAR, 1);
|
|
|
+ StationInfoDay day = daym.get(time.toString());
|
|
|
+ if (day == null) {
|
|
|
+ day = new StationInfoDay();
|
|
|
+ day.setStationId(stId);
|
|
|
+ day.setRecordDate(time);
|
|
|
+ days.add(day);
|
|
|
+ }
|
|
|
+ day.setJhfdl(v * sid.getRfdl());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ stationInfoDayService.saveOrUpdateBatch(days);
|
|
|
+ }
|
|
|
+
|
|
|
public void calcStationZhcyRfDlSameDay() {
|
|
|
//date当天零点
|
|
|
DateTime time0 = DateUtil.beginOfDay(DateUtil.date());
|
|
|
@@ -1166,7 +1229,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
turbineInfoDayService.saveOrUpdateBatch(infoDays);
|
|
|
}
|
|
|
|
|
|
- /*public void calcTurbine5s(Date date) {
|
|
|
+ */
|
|
|
+/*public void calcTurbine5s(Date date) {
|
|
|
//date当天零点
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|
|
|
//date昨天零点
|
|
|
@@ -1220,7 +1284,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
infoDays.add(infoDay);
|
|
|
}
|
|
|
turbineInfoDayService.saveOrUpdateBatch(infoDays);
|
|
|
- }*/
|
|
|
+ }*//*
|
|
|
+
|
|
|
|
|
|
//此处加公式
|
|
|
public void calcStationSspjfs() {
|
|
|
@@ -1256,12 +1321,15 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
getSnapDataByEntity(entityGl, time0, time, 15);
|
|
|
|
|
|
List<PointInfo> ztMapMap = calcTurbineZt(time0, time, entityFs, entityGl);
|
|
|
- Map<String, Map<String, PointInfo>> ztMapMapInfos = ztMapMap.stream().collect(Collectors.groupingBy(PointInfo::getStationId, Collectors.toMap(PointInfo::getTurbineId, Function.identity())));
|
|
|
+ Map<String, Map<String, PointInfo>> ztMapMapInfos = ztMapMap.stream().collect(
|
|
|
+ Collectors.groupingBy(PointInfo::getStationId, Collectors.toMap(PointInfo::getTurbineId, Function.identity())));
|
|
|
Map<String, TurbineInfoDay> dayMap = getTurbineinfoMap(time0, entityFs);
|
|
|
|
|
|
List<TurbineInfoDay> infoDays = new ArrayList<>();
|
|
|
- Map<String, Map<String, List<PointData>>> fsMapMap = entityFs.stream().collect(Collectors.groupingBy(PointInfo::getStationId, Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas)));
|
|
|
- Map<String, Map<String, List<PointData>>> glMapMap = entityGl.stream().collect(Collectors.groupingBy(PointInfo::getStationId, Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas)));
|
|
|
+ Map<String, Map<String, List<PointData>>> fsMapMap = entityFs.stream().collect(Collectors.groupingBy(PointInfo::getStationId,
|
|
|
+ Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas)));
|
|
|
+ Map<String, Map<String, List<PointData>>> glMapMap = entityGl.stream().collect(Collectors.groupingBy(PointInfo::getStationId,
|
|
|
+ Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas)));
|
|
|
|
|
|
ztMapMapInfos.forEach((stId, ztMapInfo) -> ztMapInfo.forEach((wtId, ztInfo) -> {
|
|
|
//0 待机,1 手动停机,2 正常发电,3 发电降出力,4 故障,5 故障受累,6 检修,7 检修受累,8 限电降出力,
|
|
|
@@ -1279,7 +1347,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
} else {
|
|
|
infoDay.setXnss(loss.get("xnss"));
|
|
|
}
|
|
|
- infoDay.setLlfdl(infoDay.getRfdl() + infoDay.getJhjxss() + infoDay.getFjhjxss() + infoDay.getXdss() + infoDay.getSlss() + infoDay.getXnss());
|
|
|
+ infoDay.setLlfdl(infoDay.getRfdl() + infoDay.getJhjxss() + infoDay.getFjhjxss() +
|
|
|
+ infoDay.getXdss() + infoDay.getSlss() + infoDay.getXnss());
|
|
|
infoDays.add(infoDay);
|
|
|
}));
|
|
|
turbineInfoDayService.saveOrUpdateBatch(infoDays);
|
|
|
@@ -1290,7 +1359,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<PointInfo> turbineZt = calcTurbineDizt(start, end, 15);
|
|
|
List<PointInfo> turbineAizt = calcTurbineAizt(start, end, 15);
|
|
|
turbineZt.addAll(turbineAizt);
|
|
|
- Map<String, Map<String, PointInfo>> ztMapMap = turbineZt.stream().collect(Collectors.groupingBy(PointInfo::getStationId, Collectors.toMap(PointInfo::getTurbineId, Function.identity())));
|
|
|
+ Map<String, Map<String, PointInfo>> ztMapMap = turbineZt.stream().collect(Collectors.groupingBy(PointInfo::getStationId,
|
|
|
+ Collectors.toMap(PointInfo::getTurbineId, Function.identity())));
|
|
|
|
|
|
//AGC
|
|
|
List<PointInfo> entityAgc = getEntity("AGC002", "booster");
|
|
|
@@ -1304,9 +1374,12 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
Map<String, PointInfo> collectAgc = entityAgc.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
|
|
|
Map<String, PointInfo> collectCx = entityCx.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
|
|
|
- Map<String, Map<String, List<PointData>>> collectYlzsgd = entityYlzsgd.stream().collect(Collectors.groupingBy(PointInfo::getStationId, Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas)));
|
|
|
- Map<String, Map<String, PointInfo>> fsMapMap = fsInfos.stream().collect(Collectors.groupingBy(PointInfo::getStationId, Collectors.toMap(PointInfo::getTurbineId, Function.identity())));
|
|
|
- Map<String, Map<String, List<PointData>>> glMapMap = glInfos.stream().collect(Collectors.groupingBy(PointInfo::getStationId, Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas)));
|
|
|
+ Map<String, Map<String, List<PointData>>> collectYlzsgd = entityYlzsgd.stream().collect(Collectors.groupingBy(PointInfo::getStationId,
|
|
|
+ Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas)));
|
|
|
+ Map<String, Map<String, PointInfo>> fsMapMap = fsInfos.stream().collect(Collectors.groupingBy(PointInfo::getStationId,
|
|
|
+ Collectors.toMap(PointInfo::getTurbineId, Function.identity())));
|
|
|
+ Map<String, Map<String, List<PointData>>> glMapMap = glInfos.stream().collect(Collectors.groupingBy(PointInfo::getStationId,
|
|
|
+ Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas)));
|
|
|
|
|
|
ztMapMap.forEach((stId, ztMap) -> {
|
|
|
PointInfo agcInfo = collectAgc.get(stId);
|
|
|
@@ -1315,7 +1388,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
Map<String, List<PointData>> pdsZsglMap = new HashMap<>();
|
|
|
ztMap.forEach((wtId, zt) -> {
|
|
|
- List<PointData> peek = fsMap.get(wtId).getPointDatas().stream().peek(pd -> pd.setDoubleValue(NumberUtil.round(pd.getValue() > 25 ? 25.0 : pd.getValue(), 2).doubleValue())).collect(Collectors.toList());
|
|
|
+ List<PointData> peek = fsMap.get(wtId).getPointDatas().stream().peek(pd -> pd.setDoubleValue(NumberUtil.round(pd.getValue() > 25 ? 25.0
|
|
|
+ : pd.getValue(), 2).doubleValue())).collect(Collectors.toList());
|
|
|
fsMap.get(wtId).setPointDatas(peek);
|
|
|
List<PointData> zsglSnap = fsMap.get(wtId).getPointDatas().stream().map(pd -> {
|
|
|
Double v = CalcCache.fitcoef.get(wtId).get(pd.getValue());
|
|
|
@@ -1335,23 +1409,23 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
cxInfo.setPointDatas(cxc);
|
|
|
|
|
|
//风机风速、功率->场站风速、功率
|
|
|
- // List<PointData> firstFs = new ArrayList<>();
|
|
|
- // List<PointData> firstGl = new ArrayList<>();
|
|
|
+// List<PointData> firstFs = new ArrayList<>();
|
|
|
+// List<PointData> firstGl = new ArrayList<>();
|
|
|
List<PointData> firstZsgl = new ArrayList<>();
|
|
|
double v1, v2, v3;
|
|
|
for (int i = 0; i < agcInfo.getPointDatas().size(); i++) {
|
|
|
int finalI = i;
|
|
|
- long ts = start.getTime() + i * 15000;
|
|
|
- // v1 = fsMap.values().stream().mapToDouble(pds -> pds.getPointDatas().get(finalI).getValue()).average().orElse(0.0);
|
|
|
- // v2 = glMap.values().stream().mapToDouble(pds -> pds.getPointDatas().get(finalI).getValue()).sum();
|
|
|
+ long ts = start.getTime() + i * 15000L;
|
|
|
+// v1 = fsMap.values().stream().mapToDouble(pds -> pds.getPointDatas().get(finalI).getValue()).average().orElse(0.0);
|
|
|
+// v2 = glMap.values().stream().mapToDouble(pds -> pds.getPointDatas().get(finalI).getValue()).sum();
|
|
|
v3 = pdsZsglMap.values().stream().mapToDouble(pds -> pds.get(finalI).getValue()).sum();
|
|
|
- // firstFs.add(new PointData(ts, v1));
|
|
|
- // firstGl.add(new PointData(ts, v2));
|
|
|
+// firstFs.add(new PointData(ts, v1));
|
|
|
+// firstGl.add(new PointData(ts, v2));
|
|
|
firstZsgl.add(new PointData(ts, v3));
|
|
|
}
|
|
|
|
|
|
List<PointData> czxd = calcStationXd2(agcInfo, cxInfo.getPointDatas(), firstZsgl);
|
|
|
- String ybj = "GJNY_SXGS_FSG_F_WT_0013_EQ,GJNY_SXGS_FSG_F_WT_0042_EQ,GJNY_SXGS_FSG_F_WT_0062_EQ,GJNY_SXGS_FSG_F_WT_0064_EQ";
|
|
|
+ String ybj = "GJNY_SXGS_XZ_F_WT_0013_EQ,GJNY_SXGS_XZ_F_WT_0023_EQ,GJNY_SXGS_XZ_F_WT_0027_EQ,GJNY_SXGS_XZ_F_WT_0034_EQ,GJNY_SXGS_XZ_F_WT_0044_EQ,GJNY_SXGS_XZ_F_WT_0060_EQ,GJNY_SXGS_XZ_F_WT_0062_EQ,GJNY_SXGS_FSG_F_WT_0005_EQ,GJNY_SXGS_FSG_F_WT_0006_EQ,GJNY_SXGS_FSG_F_WT_0038_EQ,GJNY_SXGS_FSG_F_WT_0039_EQ,GJNY_SXGS_ZZ_F_WT_0008_EQ,GJNY_SXGS_ZZ_F_WT_0015_EQ,GJNY_SXGS_ZZ_F_WT_0022_EQ,GJNY_SXGS_ZZ_F_WT_0046_EQ,GJNY_SXGS_ZZ_F_WT_0049_EQ,GJNY_SXGS_CSL_F_WT_0003_EQ,GJNY_SXGS_CSL_F_WT_0012_EQ,GJNY_SXGS_CSL_F_WT_0023_EQ,GJNY_SXGS_JSL_F_WT_0002_EQ,GJNY_SXGS_JSL_F_WT_0003_EQ,GJNY_SXGS_JSL_F_WT_0028_EQ,GJNY_SXGS_JSL_F_WT_0047_EQ,GJNY_SXGS_JSL_F_WT_0070_EQ,GJNY_SXGS_JSL_F_WT_0094_EQ,GJNY_SXGS_LJS_F_WT_0002_EQ,GJNY_SXGS_LJS_F_WT_0011_EQ,GJNY_SXGS_LJS_F_WT_0030_EQ,GJNY_SXGS_LJS_F_WT_0033_EQ";
|
|
|
ztMap.forEach((wtId, ztInfo) -> {
|
|
|
if (ybj.contains(wtId)) return;
|
|
|
List<PointData> fss = fsMap.get(wtId).getPointDatas();
|
|
|
@@ -1364,6 +1438,14 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
return turbineZt;
|
|
|
}
|
|
|
|
|
|
+ public List<PointData> calcTurbineSimpleZt(Date start, Date end, Integer interval, String tbId) {
|
|
|
+ List<PointInfo> turbineZt = calcTurbineDizt(start, end, interval, tbId);
|
|
|
+ List<PointInfo> turbineAizt = calcTurbineAizt(start, end, interval, tbId);
|
|
|
+ turbineZt.addAll(turbineAizt);
|
|
|
+ Map<String, List<PointData>> collect = turbineZt.stream().collect(Collectors.toMap(PointInfo::getTurbineId, PointInfo::getPointDatas));
|
|
|
+ return collect.get(tbId);//.stream().map(PointData::getValue).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
public void calcTurbineXd(PointInfo ztInfo, List<PointData> gls, List<PointData> fss, List<PointData> ylzsgds, List<PointData> czxd) {
|
|
|
Map<String, EquipmentModel> map = equipmentModelService.map();
|
|
|
Double capacity = map.get(ztInfo.getSpare()).getPowerProduction();
|
|
|
@@ -1473,6 +1555,23 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
return entityAiZt;
|
|
|
}
|
|
|
|
|
|
+ public List<PointInfo> calcTurbineAizt(Date start, Date end, int interval, String tbId) {
|
|
|
+ List<PointInfo> entityAiZt = getEntity("AI422", "state");
|
|
|
+ entityAiZt = entityAiZt.stream().filter(e -> tbId.equals(e.getTurbineId())).collect(Collectors.toList());
|
|
|
+ List<StateAi> list = stateAiService.list();
|
|
|
+ Map<String, Map<Integer, Integer>> collectAi = list.stream().collect(Collectors.groupingBy(StateAi::getModel, Collectors.toMap(StateAi::getOriginalState, StateAi::getMappingState)));
|
|
|
+ getSnapDataByEntity(entityAiZt, start, end, interval);
|
|
|
+ for (PointInfo info : entityAiZt) {
|
|
|
+ List<PointData> peek = info.getPointDatas().stream().peek(pd -> {
|
|
|
+ Integer m = collectAi.get(info.getSpare()).get((int) pd.getValue());
|
|
|
+ if (m == null) m = 2;
|
|
|
+ pd.setDoubleValue(m);
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ info.setPointDatas(peek);
|
|
|
+ }
|
|
|
+ return entityAiZt;
|
|
|
+ }
|
|
|
+
|
|
|
public List<PointInfo> calcTurbineDizt(Date start, Date end, int interval) {
|
|
|
List<PointInfo> entity = new ArrayList<>();
|
|
|
List<PointInfo> entity0 = getEntity("MX000", "state");
|
|
|
@@ -1524,6 +1623,62 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
return entity0;
|
|
|
}
|
|
|
|
|
|
+ public List<PointInfo> calcTurbineDizt(Date start, Date end, int interval, String tbId) {
|
|
|
+ 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");
|
|
|
+ entity0 = entity0.stream().filter(e -> tbId.equals(e.getTurbineId())).collect(Collectors.toList());
|
|
|
+ entity1 = entity1.stream().filter(e -> tbId.equals(e.getTurbineId())).collect(Collectors.toList());
|
|
|
+ entity2 = entity2.stream().filter(e -> tbId.equals(e.getTurbineId())).collect(Collectors.toList());
|
|
|
+ entity4 = entity4.stream().filter(e -> tbId.equals(e.getTurbineId())).collect(Collectors.toList());
|
|
|
+ entity6 = entity6.stream().filter(e -> tbId.equals(e.getTurbineId())).collect(Collectors.toList());
|
|
|
+ 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())));
|
|
|
+ wtUcPis.forEach((wtId, map) -> {
|
|
|
+ map.forEach((uc, pi) -> {
|
|
|
+ List<PointData> raw = adapter.getHistoryRaw(goldenUri(), pi.getPointKey(), start.getTime(), end.getTime());
|
|
|
+ List<PointData> ds = boolPointDatasFull(latest.get(pi.getPointKey()).isBooleanValue(), raw, start.getTime(), end.getTime(), interval);
|
|
|
+ pi.setPointDatas(ds);
|
|
|
+ ThreadUtil.sleep(5);
|
|
|
+ });
|
|
|
+ List<PointData> mx000 = map.get("MX000").getPointDatas();
|
|
|
+ PointData data0;
|
|
|
+ for (int i = 0; i < mx000.size(); i++) {
|
|
|
+ data0 = mx000.get(i);
|
|
|
+ if (data0.getValue() == 1.0) {
|
|
|
+ data0.setDoubleValue(0.0);
|
|
|
+ data0.setBooleanValue(false);
|
|
|
+ } else if (map.get("MX001").getPointDatas().get(i).getValue() == 1.0) {
|
|
|
+ data0.setDoubleValue(1.0);
|
|
|
+ } else if (map.get("MX002").getPointDatas().get(i).getValue() == 1.0) {
|
|
|
+ data0.setDoubleValue(2.0);
|
|
|
+ } else if (map.get("MX004").getPointDatas().get(i).getValue() == 1.0) {
|
|
|
+ data0.setDoubleValue(4.0);
|
|
|
+ } else if (map.get("MX006").getPointDatas().get(i).getValue() == 1.0) {
|
|
|
+ data0.setDoubleValue(6.0);
|
|
|
+ } else {
|
|
|
+ // System.out.println(wtId + data0.getTs() + ":di无对应状态!");
|
|
|
+ data0.setDoubleValue(2.0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.get("MX001").setPointDatas(null);
|
|
|
+ map.get("MX002").setPointDatas(null);
|
|
|
+ map.get("MX004").setPointDatas(null);
|
|
|
+ map.get("MX006").setPointDatas(null);
|
|
|
+ });
|
|
|
+ return entity0;
|
|
|
+ }
|
|
|
+
|
|
|
public PointInfo calcTurbineAizt2(PointInfo entityAiZt, Map<String, Map<Integer, Integer>> collectAi, Date start, Date end, int interval) {
|
|
|
if (entityAiZt == null) return null;
|
|
|
getSnapDataByEntity(entityAiZt, start, end, interval);
|
|
|
@@ -3011,6 +3166,18 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
}
|
|
|
//此处加公式
|
|
|
|
|
|
+ public Map<String, Double> calcRealtimeTurbineZt(String stId) {
|
|
|
+
|
|
|
+ List<PointInfo> turbineZt = calcRealtimeTurbineDizt();
|
|
|
+ List<PointInfo> turbineAizt = calcRealtimeTurbineAizt();
|
|
|
+ turbineZt.addAll(turbineAizt);
|
|
|
+ Map<String, Double> collect = turbineZt.stream().filter(zt -> zt.getStationId().equals(stId)).peek(t -> {
|
|
|
+ if (t.getPointDatas().get(0).getTs() + 35 * 60 * 1000 <= DateUtil.date().getTime()) {
|
|
|
+ t.getPointDatas().get(0).setDoubleValue(12.0);
|
|
|
+ }
|
|
|
+ }).collect(Collectors.toMap(PointInfo::getTurbineId, pi -> pi.getPointDatas().get(0).getValue()));
|
|
|
+ return collect;
|
|
|
+ }
|
|
|
// 计算每种状态的总持续时间
|
|
|
public void calcTurbineStateMin(Date date) {
|
|
|
//date当天零点
|
|
|
@@ -3302,7 +3469,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
return iszqxd;
|
|
|
}
|
|
|
|
|
|
- /*public void calcStationSwGwCyRdl(Date date) {
|
|
|
+ */
|
|
|
+/*public void calcStationSwGwCyRdl(Date date) {
|
|
|
//date当天零点
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|
|
|
//date昨天零点
|
|
|
@@ -3338,7 +3506,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
info.setCydl(cydl);
|
|
|
}
|
|
|
stationInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
- }*/
|
|
|
+ }*//*
|
|
|
+
|
|
|
|
|
|
public void writeReportPool5SPjfsLlfdlZtsj(Date date) {
|
|
|
//date当天零点
|
|
|
@@ -3796,6 +3965,28 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
turbineInfoMinService.saveOrUpdateBatch(mins);
|
|
|
}
|
|
|
|
|
|
+ public void calcTurbineSsfsQx(Date date) {
|
|
|
+ DateTime date0 = DateUtil.beginOfDay(date);
|
|
|
+ DateTime date1 = DateUtil.endOfDay(date);
|
|
|
+ //风速
|
|
|
+ List<PointInfo> entityFs = getEntity("AI066", "turbine");
|
|
|
+ List<String> fjs = Arrays.asList("GJNY_SXGS_FSG_F_WT_0040_EQ", "GJNY_SXGS_FSG_F_WT_0047_EQ");
|
|
|
+ entityFs = entityFs.stream().filter(e -> fjs.contains(e.getTurbineId())).collect(Collectors.toList());
|
|
|
+ getSnapDataByEntity(entityFs, date0, date1, 60);
|
|
|
+ int i = 0;
|
|
|
+ for (PointInfo et : entityFs) {
|
|
|
+ StrBuilder sb = new StrBuilder();
|
|
|
+ StrBuilder sb1 = new StrBuilder();
|
|
|
+ for (PointData v : et.getPointDatas()) {
|
|
|
+ sb.append(v.getValue()).append(",");
|
|
|
+ sb1.append(i).append(",");
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ System.out.println(sb1);
|
|
|
+ System.out.println(sb);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void calcStationLlglKyglSjglAgcMin(Date date, int granularity) {
|
|
|
date = DateUtil.beginOfMinute(date);
|
|
|
DateTime start = DateUtil.offsetMinute(date, -granularity);
|
|
|
@@ -3833,3 +4024,4 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
|
|
|
|
|
|
+*/
|