|
|
@@ -110,9 +110,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
private IProBasicModelPowerRdService proBasicModelPowerRdService;
|
|
|
@Resource
|
|
|
private IKkxfxService kkxfxService;
|
|
|
-
|
|
|
@Resource
|
|
|
- private IProEconEquipmentInfoDay5Service proEconEquipmentInfoDay5Service ;
|
|
|
+ private IProEconEquipmentInfoDay5Service proEconEquipmentInfoDay5Service;
|
|
|
|
|
|
@Override
|
|
|
public void execute() throws Exception {
|
|
|
@@ -2359,13 +2358,23 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
return collect.get(tbId);//.stream().map(PointData::getValue).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
+ // 查找最小值的方法
|
|
|
+ public int findMin(int... numbers) {
|
|
|
+ return Arrays.stream(numbers).min().getAsInt();
|
|
|
+ }
|
|
|
+
|
|
|
+ public <T> int findMin(List<T>... pdls) {
|
|
|
+ return Arrays.stream(pdls).mapToInt(pdl -> pdl != null ? pdl.size() : 0).min().getAsInt();
|
|
|
+ }
|
|
|
+
|
|
|
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();
|
|
|
List<PointData> zts = ztInfo.getPointDatas();
|
|
|
boolean b = false;
|
|
|
if (ylzsgds != null && CollUtil.isNotEmpty(ylzsgds)) b = true;
|
|
|
- for (int i = 0; i < fss.size(); i++) {
|
|
|
+ int min = findMin(fss, gls, czxd, zts);
|
|
|
+ for (int i = 0; i < min; i++) {
|
|
|
double ssgl = gls.get(i).getValue();
|
|
|
double ssfs = fss.get(i).getValue();
|
|
|
|
|
|
@@ -2870,7 +2879,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<StateAi> list = stateAiService.list();
|
|
|
Map<String, Map<Integer, Integer>> collectAi = list.stream().collect(Collectors.groupingBy(StateAi::getModel, Collectors.toMap(StateAi::getOriginalState, StateAi::getMappingState)));
|
|
|
|
|
|
- entityFs = entityFs.stream().filter(ef -> !CalcCache.keys.contains(ef.getTurbineId())).collect(Collectors.toList());
|
|
|
+ //entityFs = entityFs.stream().filter(ef -> !CalcCache.keys.contains(ef.getTurbineId())).collect(Collectors.toList());
|
|
|
for (PointInfo ef : entityFs) {
|
|
|
String wtId = ef.getTurbineId();
|
|
|
PointInfo glInfo = glMap.get(wtId);
|
|
|
@@ -4656,10 +4665,21 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|
|
|
//date昨天零点
|
|
|
DateTime time0 = DateUtil.offsetDay(time, -1);
|
|
|
+
|
|
|
+ List<PointInfo> turbineZt = calcRealtimeTurbineDizt();
|
|
|
+ List<PointInfo> turbineAizt = calcRealtimeTurbineAizt();
|
|
|
+ turbineZt.addAll(turbineAizt);
|
|
|
+ filterList(turbineZt, "NX_FGS_HA_F_WT_0034_EQ", PointInfo::getTurbineId);
|
|
|
+ //获取测点数据
|
|
|
+ getRawDataByEntity(turbineZt, taosUri(), time0, time);
|
|
|
+
|
|
|
//状态测点
|
|
|
List<PointInfo> entityMxzt = getEntity("MXZT", "turbine");
|
|
|
+ filterList(entityMxzt, "NX_FGS_HA_F_WT_0034_EQ", PointInfo::getTurbineId);
|
|
|
//获取测点数据
|
|
|
getRawDataByEntity(entityMxzt, taosUri(), time0, time);
|
|
|
+ List<PointData> datas = entityMxzt.get(0).getPointDatas();
|
|
|
+ List<PowerLosses> gzLosses = calcLossPeriods(datas, 4);
|
|
|
//风机信息表
|
|
|
Map<String, TurbineInfoDay> byDate = getTurbineinfoMap(time0, entityMxzt);
|
|
|
for (PointInfo info : entityMxzt) {
|
|
|
@@ -4683,7 +4703,8 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
infoDay.setXdcs(frequency.getOrDefault(8.0, 0L));
|
|
|
infoDay.setLxcs(frequency.getOrDefault(12.0, 0L));
|
|
|
}
|
|
|
- turbineInfoDayService.saveOrUpdateBatch(byDate.values());
|
|
|
+ //turbineInfoDayService.saveOrUpdateBatch(byDate.values());
|
|
|
+ System.out.println();
|
|
|
}
|
|
|
|
|
|
public void calcStationSwdl_by(DateTime begin, DateTime end) {
|
|
|
@@ -5124,6 +5145,36 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
//turbineInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
}
|
|
|
|
|
|
+ //依赖calcTurbineStateMin
|
|
|
+ public void calcTurbineJfplFxYxfssBll(DateTime begin, DateTime end) {
|
|
|
+ //风速
|
|
|
+ List<PointInfo> entityFs = getEntity("AI066", "turbine");
|
|
|
+ Map<String, PointInfo> rawDataFs = getRawDataByEntity(entityFs, goldenUri(), begin, end, PointInfo::getTurbineId);
|
|
|
+ //风向
|
|
|
+ List<PointInfo> entityFx = getEntity("DI1392", "turbine");
|
|
|
+ Map<String, PointInfo> rawDataFx = getRawDataByEntity(entityFx, goldenUri(), begin, end, PointInfo::getTurbineId);
|
|
|
+
|
|
|
+ List<TurbineInfoDay> byDate = getTurbineinfoByDate(begin);
|
|
|
+ for (TurbineInfoDay day : byDate) {
|
|
|
+ String tbId = day.getTurbineId();
|
|
|
+ List<PointData> pds = Optional.ofNullable(rawDataFs.get(tbId)).map(PointInfo::getPointDatas).orElse(Collections.emptyList());
|
|
|
+ long jfsc = calcDuration(pds, pd -> pd.getValue() < 3d);
|
|
|
+ day.setJfpl(jfsc / (1000 * 60 * 60 * 24d));
|
|
|
+
|
|
|
+ Long yf = calcMatchDuration(pds, pd -> pd.getValue() > 3d && pd.getValue() < 18d);
|
|
|
+ day.setYxfss(yf / (1000 * 60 * 60.0d));
|
|
|
+ //double yxfss = (24 * 60 - day.getJxMin() - day.getGzMin()) / 60;
|
|
|
+ //day.setYxfss(yxfss);
|
|
|
+ List<PointData> pdsFx = Optional.ofNullable(rawDataFx.get(tbId)).map(PointInfo::getPointDatas).orElse(Collections.emptyList());
|
|
|
+ double fx = pdsFx.stream().mapToDouble(PointData::getValue).average().orElse(0d);
|
|
|
+ day.setFx(fx);
|
|
|
+ //暴露率 = (运行小时 / 可用小时) × 100%
|
|
|
+ double bll = day.getYxMin() * 100 / (24 * 60 - day.getGzMin() - day.getJxMin());
|
|
|
+ day.setBll(bll);
|
|
|
+ }
|
|
|
+ turbineInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
+ }
|
|
|
+
|
|
|
public void calcTurbineRFDL(DateTime begin, DateTime end) {
|
|
|
List<PointInfo> entity = getEntity("AI121", "turbine");
|
|
|
getRawDataByEntity(entity, goldenUri(), begin, end);
|
|
|
@@ -5335,6 +5386,38 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
return lossPeriods;
|
|
|
}
|
|
|
|
|
|
+ public List<PowerLosses> calcLossPeriods(List<PointData> datas, int zt) {
|
|
|
+ List<PowerLosses> lossPeriods = new ArrayList<>();
|
|
|
+ PowerLosses currentPeriod = null;
|
|
|
+
|
|
|
+ Long ts = datas.get(0).getTs();
|
|
|
+ for (PointData data : datas) {
|
|
|
+ ts = data.getTs();
|
|
|
+ if (data.getValue() == zt) {
|
|
|
+ if (currentPeriod == null) {
|
|
|
+ currentPeriod = new PowerLosses();
|
|
|
+ currentPeriod.setStartTime(new Date(ts));
|
|
|
+ currentPeriod.setRecordDate(new Date(ts));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (currentPeriod != null) {
|
|
|
+ currentPeriod.setEndTime(new Date(ts));
|
|
|
+ currentPeriod.setXdss((currentPeriod.getEndTime().getTime()
|
|
|
+ - currentPeriod.getStartTime().getTime()) / 1000 / 60d);
|
|
|
+ lossPeriods.add(currentPeriod);
|
|
|
+ currentPeriod = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (currentPeriod != null) {
|
|
|
+ currentPeriod.setEndTime(new Date(ts));
|
|
|
+ currentPeriod.setXdss((currentPeriod.getEndTime().getTime()
|
|
|
+ - currentPeriod.getStartTime().getTime()) / 1000 / 60d);
|
|
|
+ lossPeriods.add(currentPeriod);
|
|
|
+ }
|
|
|
+ return lossPeriods;
|
|
|
+ }
|
|
|
+
|
|
|
public double divInfinite(Double a, Double b) {
|
|
|
if (a == null || b == null || b == 0) return 0;
|
|
|
return a / b;
|
|
|
@@ -5427,36 +5510,6 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
stationInfoDayService.saveOrUpdateBatch(sids);
|
|
|
}
|
|
|
|
|
|
- //依赖calcTurbineStateMin
|
|
|
- public void calcTurbineJfplFxYxfssBll(DateTime begin, DateTime end) {
|
|
|
- //风速
|
|
|
- List<PointInfo> entityFs = getEntity("AI066", "turbine");
|
|
|
- Map<String, PointInfo> rawDataFs = getRawDataByEntity(entityFs, goldenUri(), begin, end, PointInfo::getTurbineId);
|
|
|
- //风向
|
|
|
- List<PointInfo> entityFx = getEntity("DI1392", "turbine");
|
|
|
- Map<String, PointInfo> rawDataFx = getRawDataByEntity(entityFx, goldenUri(), begin, end, PointInfo::getTurbineId);
|
|
|
-
|
|
|
- List<TurbineInfoDay> byDate = getTurbineinfoByDate(begin);
|
|
|
- for (TurbineInfoDay day : byDate) {
|
|
|
- String tbId = day.getTurbineId();
|
|
|
- List<PointData> pds = Optional.ofNullable(rawDataFs.get(tbId)).map(PointInfo::getPointDatas).orElse(Collections.emptyList());
|
|
|
- long jfsc = calcDuration(pds, pd -> pd.getValue() < 3d);
|
|
|
- day.setJfpl(jfsc / (1000 * 60 * 60 * 24d));
|
|
|
-
|
|
|
- Long yf = calcMatchDuration(pds, pd -> pd.getValue() > 3d && pd.getValue() < 18d);
|
|
|
- day.setYxfss(yf / (1000 * 60 * 60.0d));
|
|
|
- //double yxfss = (24 * 60 - day.getJxMin() - day.getGzMin()) / 60;
|
|
|
- //day.setYxfss(yxfss);
|
|
|
- List<PointData> pdsFx = Optional.ofNullable(rawDataFx.get(tbId)).map(PointInfo::getPointDatas).orElse(Collections.emptyList());
|
|
|
- double fx = pdsFx.stream().mapToDouble(PointData::getValue).average().orElse(0d);
|
|
|
- day.setFx(fx);
|
|
|
- //暴露率 = (运行小时 / 可用小时) × 100%
|
|
|
- double bll = day.getYxMin() * 100 / (24 * 60 - day.getGzMin() - day.getJxMin());
|
|
|
- day.setBll(bll);
|
|
|
- }
|
|
|
- turbineInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
- }
|
|
|
-
|
|
|
public long calcDuration(List<PointData> pds, Function<PointData, Boolean> fun) {
|
|
|
if (CollUtil.isEmpty(pds)) return 0;
|
|
|
pds.sort(Comparator.comparingLong(PointData::getTs));
|
|
|
@@ -6512,12 +6565,14 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
data.setTs(l);
|
|
|
data.setTagName(llglMap.get(stId));
|
|
|
data.setDoubleValue(llgl);
|
|
|
- PointData data2 = new PointData();
|
|
|
- data2.setTs(l);
|
|
|
- data2.setTagName(zbzglMap.get(stId));
|
|
|
- data2.setDoubleValue(bzgl);
|
|
|
+ if (bzgl > sjgl * 0.5) {
|
|
|
+ PointData data2 = new PointData();
|
|
|
+ data2.setTs(l);
|
|
|
+ data2.setTagName(zbzglMap.get(stId));
|
|
|
+ data2.setDoubleValue(bzgl);
|
|
|
+ pds.add(data2);
|
|
|
+ }
|
|
|
pds.add(data);
|
|
|
- pds.add(data2);
|
|
|
sjglsjc.put(stId, l);
|
|
|
}
|
|
|
//adapter.writeHistoryBatch(taosUri(), pds);
|
|
|
@@ -8495,10 +8550,12 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<PointData> sjfdlr = adapter.getHistoryRaw(goldenUri(), "区域集控.惠安风场.二期.全场日总发电量", end.getTime() - 3 * 60 * 1000, end.getTime() + 1);
|
|
|
eijMap.get("区域集控.惠安风场.二期本期实际发电量").setStopCode(sjfdlr.stream().mapToDouble(PointData::getValue).max().orElse(0));
|
|
|
//proEconEquipmentInfoJsService.saveOrUpdateBatch(eijMap.values());
|
|
|
+ List<ProEconEquipmentInfoJs> js = eijMap.values().stream().filter(a -> a.getMeterName().contains("限电")).collect(Collectors.toList());
|
|
|
+ proEconEquipmentInfoJsService.saveOrUpdateBatch(js);
|
|
|
|
|
|
- List<StationInfoDay> byDate = getStationinfoByDate(begin.toJdkDate());
|
|
|
- byDate.get(0).setRfdlFj((eijMap.get("区域集控.惠安风场.二期本期实际发电量").getStopCode() + eijMap.get("区域集控.惠安风场.一期本期实际发电量").getStopCode()) * 1000);
|
|
|
- stationInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
+ //List<StationInfoDay> byDate = getStationinfoByDate(begin.toJdkDate());
|
|
|
+ //byDate.get(0).setRfdlFj((eijMap.get("区域集控.惠安风场.二期本期实际发电量").getStopCode() + eijMap.get("区域集控.惠安风场.一期本期实际发电量").getStopCode()) * 1000);
|
|
|
+ //stationInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
}
|
|
|
|
|
|
//计算惠安报表汇总实时
|
|
|
@@ -8926,6 +8983,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<TurbineInfoDay> tids = tidMap.get(stId);
|
|
|
double gzxh = tids.stream().mapToDouble(TurbineInfoDay::getGzMin).sum() / 60;
|
|
|
double gzcs = tids.stream().mapToDouble(tid -> tid.getGzcs().doubleValue()).sum();
|
|
|
+ if (gzcs == 0) gzcs = 1;
|
|
|
double mtbf = (betweenDay * tids.size() - gzxh) / gzcs;
|
|
|
double mttr = gzxh / gzcs;
|
|
|
//小时
|
|
|
@@ -9054,9 +9112,9 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
d.add(v / 240);
|
|
|
//System.out.println(v / 240);
|
|
|
kyglpds1.get(i).setDoubleValue(kygl);
|
|
|
- if (isTimeIn(DateUtil.parse("2025-05-13 10:21:00").getTime(), DateUtil.parse("2025-05-13 13:21:00").getTime(), time) || isTimeIn(DateUtil.parse("2025-05-13 17:32:00").getTime(), DateUtil.parse("2025-05-13 18:03:00").getTime(), time)) {
|
|
|
- System.out.println(DateUtil.formatDateTime(new Date(time)) + "," + kygl + "," + sjgl);
|
|
|
- }
|
|
|
+ //if (isTimeIn(DateUtil.parse("2025-05-13 10:21:00").getTime(), DateUtil.parse("2025-05-13 13:21:00").getTime(), time) || isTimeIn(DateUtil.parse("2025-05-13 17:32:00").getTime(), DateUtil.parse("2025-05-13 18:03:00").getTime(), time)) {
|
|
|
+ // System.out.println(DateUtil.formatDateTime(new Date(time)) + "," + kygl + "," + sjgl);
|
|
|
+ //}
|
|
|
}
|
|
|
//List<Long> tss = entityYg.get(0).getPointDatas().stream().map(v -> v.getTs()).collect(Collectors.toList());
|
|
|
List<PowerLosses> losses = calcLossPeriods(d, tss);
|
|
|
@@ -9082,6 +9140,43 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
example.setVisible(true);
|
|
|
}
|
|
|
|
|
|
+ public void calcCzFjxd(DateTime begin, DateTime end) {
|
|
|
+ //风速
|
|
|
+ List<PointInfo> entityFs = getEntity("AI066", "turbine");
|
|
|
+ filterList(entityFs, "NX_FGS_HA_F_WT_0029_EQ", PointInfo::getTurbineId);
|
|
|
+ getSnapDataByEntity(entityFs, begin, end, 15);
|
|
|
+ XYSeries seriesZs = new XYSeries("实际功率");
|
|
|
+ speedProcess(entityFs);
|
|
|
+ List<PointData> fss = entityFs.get(0).getPointDatas();
|
|
|
+ fss.forEach(pd -> seriesZs.add(pd.getTs(), CalcCache.fitcoef.get("NX_FGS_HA_F_WT_0029_EQ").get(pd.getValue())));
|
|
|
+ //功率
|
|
|
+ List<PointInfo> entityGl = getEntity("AI114", "turbine");
|
|
|
+ filterList(entityGl, "NX_FGS_HA_F_WT_0029_EQ", PointInfo::getTurbineId);
|
|
|
+ getSnapDataByEntity(entityGl, begin, end, 15);
|
|
|
+
|
|
|
+ XYSeries seriesCx = new XYSeries("理论功率");
|
|
|
+ List<PointData> gls = entityGl.get(0).getPointDatas();
|
|
|
+ for (int i = 0; i < fss.size(); i++) {
|
|
|
+ System.out.println(CalcCache.fitcoef.get("NX_FGS_HA_F_WT_0029_EQ").get(fss.get(i).getValue()) + "," + gls.get(i).getValue());
|
|
|
+ }
|
|
|
+ gls.forEach(pd -> seriesCx.add(calcTime(pd.getTs()), pd.getValue()));
|
|
|
+ TimeSeriesChart example = new TimeSeriesChart("分析限电", seriesZs, seriesCx);
|
|
|
+ example.setSize(1280, 600);
|
|
|
+ example.setLocationRelativeTo(null);
|
|
|
+ example.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
|
|
+ example.setVisible(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void speedProcess(List<PointInfo> entityFs) {
|
|
|
+ entityFs.forEach(pi -> pi.getPointDatas().forEach(pd -> pd.setDoubleValue(NumberUtil.round(out2Out(pd.getValue(), 0d, 25d), 2).doubleValue())));
|
|
|
+ }
|
|
|
+
|
|
|
+ public double out2Out(double value, double min, double max) {
|
|
|
+ if (value < min) value = min;
|
|
|
+ if (value > max) value = max;
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+
|
|
|
public void abc(Date begin) {
|
|
|
////指标保存表
|
|
|
//QueryWrapper<ProEconEquipmentInfoJs> eijWrapper = new QueryWrapper<>();
|
|
|
@@ -9362,7 +9457,7 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
tid.setSlss(tid.getSlss() * zssXs);
|
|
|
tid.setLlfdl(tid.getRfdl() + tid.getXdss() + tid.getFjhjxss() + tid.getJhjxss() + tid.getXnss());
|
|
|
});
|
|
|
- //turbineInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
+ turbineInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
}
|
|
|
|
|
|
public double getValueByTagName(List<PointData> dataList, String tagName) {
|
|
|
@@ -9813,16 +9908,17 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
public void getDatas(DateTime begin, DateTime end) {
|
|
|
//AGC
|
|
|
List<PointInfo> entityAgc = getEntity("AGC002", "booster");
|
|
|
- getSnapDataByEntity(entityAgc, begin, end, 15);
|
|
|
+ //getSnapDataByEntity(entityAgc, begin, end, 15);
|
|
|
CalcCache.pointInfosMap.put("推送-booster-AGC-snap15s", entityAgc);
|
|
|
//出线
|
|
|
List<PointInfo> entityCx = getEntity("AGC020", "booster");
|
|
|
- getSnapDataByEntity(entityCx, begin, end, 15);
|
|
|
+ //getSnapDataByEntity(entityCx, begin, end, 15);
|
|
|
CalcCache.pointInfosMap.put("推送-booster-出线-snap15s", entityCx);
|
|
|
//可用功率
|
|
|
- List<PointData> kyglpds = adapter.getHistorySnap(goldenUri(), "区域集控.惠安风场.升压站.中车风机设备信息.可用发电功率", begin.getTime(), end.getTime(), 15);
|
|
|
+ List<PointData> kyglpds1 = adapter.getHistorySnap(goldenUri(), "区域集控.惠安风场.升压站.中车风机设备信息.可用发电功率", begin.getTime(), end.getTime(), 15);
|
|
|
List<PointData> kyglpds2 = adapter.getHistorySnap(goldenUri(), "区域集控.惠安风场.升压站.联合动力能管信息.可用发电功率", begin.getTime(), end.getTime(), 15);
|
|
|
- CollUtil.forEach(kyglpds, (pd, i) -> pd.setDoubleValue(pd.getValue() + kyglpds2.get(i).getValue()));
|
|
|
+ List<PointData> kyglpds = addPointDatas(kyglpds1, kyglpds2);
|
|
|
+
|
|
|
CalcCache.pointDatasMap.put("推送-booster-可用功率-snap15s", kyglpds);
|
|
|
//风速
|
|
|
List<PointInfo> entityFs = getEntity("AI066", "turbine");
|
|
|
@@ -9837,6 +9933,25 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
CalcCache.pointInfosMap.put("推送-turbine-状态-snap15s", ztMapMap);
|
|
|
}
|
|
|
|
|
|
+ private List<PointData> addPointDatas(List<PointData> kyglpds, List<PointData> kyglpds2) {
|
|
|
+ if (kyglpds == null && kyglpds2 == null) return new ArrayList<>();
|
|
|
+ if (kyglpds == null) return kyglpds2;
|
|
|
+ if (kyglpds2 == null) return kyglpds;
|
|
|
+ if (kyglpds.size() > kyglpds2.size()) {
|
|
|
+ for (int i = 0; i < kyglpds2.size(); i++) {
|
|
|
+ PointData data = kyglpds.get(i);
|
|
|
+ data.setDoubleValue(data.getValue() + kyglpds2.get(i).getValue());
|
|
|
+ }
|
|
|
+ return kyglpds;
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < kyglpds.size(); i++) {
|
|
|
+ PointData data = kyglpds2.get(i);
|
|
|
+ data.setDoubleValue(data.getValue() + kyglpds.get(i).getValue());
|
|
|
+ }
|
|
|
+ return kyglpds2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public List<PointInfo> calcTurbineZt(Date start, Date end) {
|
|
|
List<PointInfo> turbineZt = calcTurbineDizt(start, end, 15);
|
|
|
List<PointInfo> turbineAizt = calcTurbineAizt(start, end, 15);
|
|
|
@@ -9935,15 +10050,15 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
//性能损失电量
|
|
|
double xnssdlValue = 0;
|
|
|
//拟合优度
|
|
|
-// double nhydValue = 0;
|
|
|
+ // double nhydValue = 0;
|
|
|
//功率一致性系数
|
|
|
-// double glyzxxsValue = 0;
|
|
|
+ // double glyzxxsValue = 0;
|
|
|
//利用小时
|
|
|
double lyxsValue = 0;
|
|
|
//设备可利用率
|
|
|
double sbklylValue = 0;
|
|
|
//等效可利用系数
|
|
|
-// double dxkyxsValue = 0;
|
|
|
+ // double dxkyxsValue = 0;
|
|
|
//有效风时数
|
|
|
double yxfssValue = 0;
|
|
|
//风速
|
|
|
@@ -10004,32 +10119,32 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
xnssdlValue = Math.max(0, Math.min(10, xnssdlValue));
|
|
|
}
|
|
|
|
|
|
-// value = 0.0;
|
|
|
-// value = top.getDaynhyd();
|
|
|
-// //拟合优度
|
|
|
-// if (value <= 15) {
|
|
|
-// nhydValue = 0;
|
|
|
-// } else if (value >= 80) {
|
|
|
-// nhydValue = m;
|
|
|
-// } else {
|
|
|
-// temp = d * (size - top.getMonthnhyd());
|
|
|
-// nhydValue = StringUtils.round(temp, 0);
|
|
|
-// top.setYearnhyd(nhydValue);
|
|
|
-// }
|
|
|
+ // value = 0.0;
|
|
|
+ // value = top.getDaynhyd();
|
|
|
+ // //拟合优度
|
|
|
+ // if (value <= 15) {
|
|
|
+ // nhydValue = 0;
|
|
|
+ // } else if (value >= 80) {
|
|
|
+ // nhydValue = m;
|
|
|
+ // } else {
|
|
|
+ // temp = d * (size - top.getMonthnhyd());
|
|
|
+ // nhydValue = StringUtils.round(temp, 0);
|
|
|
+ // top.setYearnhyd(nhydValue);
|
|
|
+ // }
|
|
|
|
|
|
//功率一致性系数
|
|
|
-// value = 0.0;
|
|
|
-// value = top.getDayglyzxxs();
|
|
|
-//
|
|
|
-// if (value <= 15) {
|
|
|
-// glyzxxsValue = 0;
|
|
|
-// } else if (value >= 80) {
|
|
|
-// glyzxxsValue = m;
|
|
|
-// } else {
|
|
|
-// temp = d * (size - top.getMonthglyzxxs());
|
|
|
-// glyzxxsValue = StringUtils.round(temp, 0);
|
|
|
-// top.setYearglyzxxs(glyzxxsValue);
|
|
|
-// }
|
|
|
+ // value = 0.0;
|
|
|
+ // value = top.getDayglyzxxs();
|
|
|
+ //
|
|
|
+ // if (value <= 15) {
|
|
|
+ // glyzxxsValue = 0;
|
|
|
+ // } else if (value >= 80) {
|
|
|
+ // glyzxxsValue = m;
|
|
|
+ // } else {
|
|
|
+ // temp = d * (size - top.getMonthglyzxxs());
|
|
|
+ // glyzxxsValue = StringUtils.round(temp, 0);
|
|
|
+ // top.setYearglyzxxs(glyzxxsValue);
|
|
|
+ // }
|
|
|
|
|
|
//利用小时
|
|
|
value = (null != top.getLyxs()) ? top.getLyxs() : 0.0;
|
|
|
@@ -10078,18 +10193,18 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
|
|
|
//等效可用系数
|
|
|
-// value = 0.0;
|
|
|
-// value = top.getDaydxkyxs();
|
|
|
-//
|
|
|
-// if (value < 90) {
|
|
|
-// dxkyxsValue = 0;
|
|
|
-// } else if (value >= 99.8) {
|
|
|
-// dxkyxsValue = m;
|
|
|
-// } else {
|
|
|
-// temp = d * (size - top.getMonthdxkyxs());
|
|
|
-// dxkyxsValue = StringUtils.round(temp, 0);
|
|
|
-// top.setYeardxkyxs(dxkyxsValue);
|
|
|
-// }
|
|
|
+ // value = 0.0;
|
|
|
+ // value = top.getDaydxkyxs();
|
|
|
+ //
|
|
|
+ // if (value < 90) {
|
|
|
+ // dxkyxsValue = 0;
|
|
|
+ // } else if (value >= 99.8) {
|
|
|
+ // dxkyxsValue = m;
|
|
|
+ // } else {
|
|
|
+ // temp = d * (size - top.getMonthdxkyxs());
|
|
|
+ // dxkyxsValue = StringUtils.round(temp, 0);
|
|
|
+ // top.setYeardxkyxs(dxkyxsValue);
|
|
|
+ // }
|
|
|
|
|
|
//有效风时数
|
|
|
value = (null != top.getYxfss()) ? top.getYxfss() : 0.0;
|
|
|
@@ -10626,5 +10741,122 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public void calcProjectMonthInfo(DateTime begin, DateTime end) {
|
|
|
+ if (end.equals(DateUtil.endOfMonth(begin))) {
|
|
|
+ begin = DateUtil.beginOfMonth(begin);
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String select = SqlUtil.getSelectAvg("klyl") + SqlUtil.getSelectSum("jx_min,jhjxss,gz_min,gzss,gzcs,yx_min");
|
|
|
+ ITurbineInfoDayService turbineInfoDayService = (ITurbineInfoDayService) serviceGroup.getService(TurbineInfoDay.class);
|
|
|
+ List<TurbineInfoDay> tidsQc0 = turbineInfoDayService.getDatasByPartSelects(end, DatePart.MONTH, select, "project_id");
|
|
|
+ List<TurbineInfoDay> tidsCz0 = turbineInfoDayService.getDatasByPartSelects(end, DatePart.MONTH, select, "station_id");
|
|
|
+ List<PointInfo> entitySt = getEntity("AGC001", "station");
|
|
|
+ List<StationInfoMonth> stationMonth = getStationinfoByMonth(begin, entitySt);
|
|
|
+ List<ProjectInfoMonth> projectMonth = getProjectinfoByMonth(begin, "entityPj");
|
|
|
+ Map<String, TurbineInfoDay> tidsQc = list2Map(tidsQc0, TurbineInfoDay::getProjectId);
|
|
|
+ Map<String, TurbineInfoDay> tidsCz = list2Map(tidsCz0, TurbineInfoDay::getStationId);
|
|
|
+
|
|
|
+ IService<ProjectInfoMonth> projectInfoMonthService = serviceGroup.getService(ProjectInfoMonth.class);
|
|
|
+ for (ProjectInfoMonth month : projectMonth) {
|
|
|
+ TurbineInfoDay day = tidsQc.get(month.getProjectId());
|
|
|
+ double bll = day.getYxMin() * 100 / (24 * 60 * 25 * end.dayOfMonth() - day.getGzMin() - day.getJxMin());
|
|
|
+ month.setBll(bll);
|
|
|
+ month.setJxsc(day.getJxMin() / 60);
|
|
|
+ month.setJxss(day.getJhjxss());
|
|
|
+ month.setGzsc(day.getGzMin() / 60);
|
|
|
+ month.setGzss(day.getGzss());
|
|
|
+ month.setGzcs(day.getGzcs());
|
|
|
+ month.setSbklyl(day.getKlyl());
|
|
|
+ }
|
|
|
+ projectInfoMonthService.saveOrUpdateBatch(projectMonth);
|
|
|
+ IService<StationInfoMonth> stationInfoMonthService = serviceGroup.getService(StationInfoMonth.class);
|
|
|
+ for (StationInfoMonth month : stationMonth) {
|
|
|
+ TurbineInfoDay day = tidsCz.get(month.getStationId());
|
|
|
+ double bll = day.getYxMin() * 100 / (24 * 60 * 50 * end.dayOfMonth() - day.getGzMin() - day.getJxMin());
|
|
|
+ month.setBll(bll);
|
|
|
+ month.setJxsc(day.getJxMin() / 60);
|
|
|
+ month.setJxss(day.getJhjxss() / 1000);
|
|
|
+ month.setGzsc(day.getGzMin() / 60);
|
|
|
+ month.setGzss(day.getGzss() / 1000);
|
|
|
+ month.setGzcs(day.getGzcs());
|
|
|
+ month.setSbklyl(day.getKlyl());
|
|
|
+ }
|
|
|
+ stationInfoMonthService.saveOrUpdateBatch(stationMonth);
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<StationInfoMonth> getStationinfoByMonth(Date date) {
|
|
|
+ QueryWrapper<StationInfoMonth> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.eq("record_date", date);
|
|
|
+ IService<StationInfoMonth> stationInfoMonthIService = serviceGroup.getService(StationInfoMonth.class);
|
|
|
+ return stationInfoMonthService.list(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<StationInfoMonth> getStationinfoByMonth(Date date, List<PointInfo> entity) {
|
|
|
+ List<StationInfoMonth> list = getStationinfoByMonth(date);
|
|
|
+ if (CollUtil.isEmpty(list)) {
|
|
|
+ entity.forEach(pi -> {
|
|
|
+ StationInfoMonth day = new StationInfoMonth();
|
|
|
+ day.setStationId(pi.getStationId());
|
|
|
+ day.setRecordDate(date);
|
|
|
+ list.add(day);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, StationInfoMonth> getStationinfoByMonth(Date date, Function<StationInfoMonth, String> fun) {
|
|
|
+ List<StationInfoMonth> month = getStationinfoByMonth(date);
|
|
|
+ return month.stream().collect(Collectors.toMap(fun, Function.identity()));
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<ProjectInfoMonth> getProjectinfoByMonth(Date date) {
|
|
|
+ QueryWrapper<ProjectInfoMonth> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.eq("record_date", date);
|
|
|
+ IService<ProjectInfoMonth> projectInfoMonthService = serviceGroup.getService(ProjectInfoMonth.class);
|
|
|
+ return projectInfoMonthService.list(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<ProjectInfoMonth> getProjectinfoByMonth(Date date, List<PointInfo> entity) {
|
|
|
+ List<ProjectInfoMonth> list = getProjectinfoByMonth(date);
|
|
|
+ if (CollUtil.isEmpty(list)) {
|
|
|
+ entity.forEach(pi -> {
|
|
|
+ ProjectInfoMonth day = new ProjectInfoMonth();
|
|
|
+ day.setStationId(pi.getStationId());
|
|
|
+ day.setProjectId(pi.getProjectId());
|
|
|
+ day.setRecordDate(date);
|
|
|
+ list.add(day);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<ProjectInfoMonth> getProjectinfoByMonth(Date date, String e) {
|
|
|
+ List<ProjectInfoMonth> list = getProjectinfoByMonth(date);
|
|
|
+ List<PointInfo> entity = new ArrayList<>();
|
|
|
+ PointInfo info1 = new PointInfo();
|
|
|
+ info1.setStationId("NX_FGS_HA_FDC_STA");
|
|
|
+ info1.setProjectId("NX_FGS_HAF01_EG");
|
|
|
+ PointInfo info2 = new PointInfo();
|
|
|
+ info2.setStationId("NX_FGS_HA_FDC_STA");
|
|
|
+ info2.setProjectId("NX_FGS_HAF02_EG");
|
|
|
+ entity.add(info1);
|
|
|
+ entity.add(info2);
|
|
|
+ if (CollUtil.isEmpty(list)) {
|
|
|
+ entity.forEach(pi -> {
|
|
|
+ ProjectInfoMonth day = new ProjectInfoMonth();
|
|
|
+ day.setStationId(pi.getStationId());
|
|
|
+ day.setProjectId(pi.getProjectId());
|
|
|
+ day.setRecordDate(date);
|
|
|
+ list.add(day);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, ProjectInfoMonth> getProjectinfoByMonth(Date date, Function<ProjectInfoMonth, String> fun) {
|
|
|
+ List<ProjectInfoMonth> month = getProjectinfoByMonth(date);
|
|
|
+ return month.stream().collect(Collectors.toMap(fun, Function.identity()));
|
|
|
+ }
|
|
|
|
|
|
}
|