|
|
@@ -0,0 +1,792 @@
|
|
|
+package com.gyee.runeconomy.service.EarlyWarning;
|
|
|
+
|
|
|
+import com.gyee.runeconomy.entity.StationInfoMonth;
|
|
|
+import com.gyee.runeconomy.init.CacheContext;
|
|
|
+import com.gyee.runeconomy.model.auto.*;
|
|
|
+import com.gyee.runeconomy.service.IStationInfoMonthService;
|
|
|
+import com.gyee.runeconomy.service.auto.*;
|
|
|
+import com.gyee.runeconomy.util.StringUtils;
|
|
|
+import lombok.var;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.util.*;
|
|
|
+import java.util.function.BiConsumer;
|
|
|
+import java.util.function.Function;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class WindReportService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITurbineInfoDayService turbineInfoDayService;
|
|
|
+ @Resource
|
|
|
+ private IStationInfoMonthService stationInfoMonthService;
|
|
|
+ @Resource
|
|
|
+ private IStationInfoDayService stationInfoDayService;
|
|
|
+ @Resource
|
|
|
+ private IProEconCurveFittMonthMainService curveFittMonthMainService;
|
|
|
+ @Resource
|
|
|
+ private IProEconEquipmentInfoDay4Service day4Service;
|
|
|
+ @Resource
|
|
|
+ private IProEconInOrOutSpeedTotalService proEconInOrOutSpeedTotalService;
|
|
|
+ @Resource
|
|
|
+ private IProEconWindturbineGoodnessService goodnessService;
|
|
|
+ @Resource
|
|
|
+ private IProEconEquipmentInfoDay5Service day5Service;
|
|
|
+ @Resource
|
|
|
+ private IProEconFaultLiminatedefectsService proEconFaultLiminatedefectsService;
|
|
|
+
|
|
|
+ // 定义等级常量,便于维护
|
|
|
+ private static final String[] LEVELS = {"A", "B", "C"};
|
|
|
+
|
|
|
+ public Map<String, Object> Electricity(String time) throws Exception {
|
|
|
+
|
|
|
+ String year = time.substring(0, 4); // 从索引0开始,截取4位
|
|
|
+ String month = time.substring(5, 7);
|
|
|
+ // 去除前导零
|
|
|
+ month = month.replaceFirst("^0", "");
|
|
|
+
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
+
|
|
|
+ List<ProBasicEquipment> wtls = CacheContext.wtls;
|
|
|
+ // 1. 数据准备
|
|
|
+ List<StationInfoMonth> monthslist = stationInfoMonthService.monthslist(time);
|
|
|
+ List<StationInfoMonth> qndylist = stationInfoMonthService.qndylist(time);
|
|
|
+
|
|
|
+ List<TurbineInfoDay> monthdllist = turbineInfoDayService.monthList(time);
|
|
|
+ List<TurbineInfoDay> hbmonthList = turbineInfoDayService.hbmonthList(time);
|
|
|
+ List<TurbineInfoDay> qnmonthlist = turbineInfoDayService.qnmonthList(time);
|
|
|
+ List<TurbineInfoDay> dltoplist = turbineInfoDayService.topList(time);
|
|
|
+ List<TurbineInfoDay> dlbottomlist = turbineInfoDayService.bottomList(time);
|
|
|
+ List<TurbineInfoDay> yeardllist = turbineInfoDayService.yearList(time);
|
|
|
+ List<TurbineInfoDay> klyltopList = turbineInfoDayService.klyltopList(time);
|
|
|
+ List<TurbineInfoDay> klylbottomList = turbineInfoDayService.klylbottomList(time);
|
|
|
+ List<TurbineInfoDay> gzcslist = turbineInfoDayService.gzcssumList(time);
|
|
|
+ List<TurbineInfoDay> gzcstop = turbineInfoDayService.gzcstopList(time);
|
|
|
+ List<TurbineInfoDay> glyztopList = turbineInfoDayService.glyztopList(time);
|
|
|
+ List<TurbineInfoDay> glyzbottomList = turbineInfoDayService.glyzbottomList(time);
|
|
|
+ List<TurbineInfoDay> syglyztopList = turbineInfoDayService.syglyztopList(time);
|
|
|
+ List<TurbineInfoDay> syglyzbottomList = turbineInfoDayService.syglyzbottomList(time);
|
|
|
+ List<TurbineInfoDay> xndjList = turbineInfoDayService.xndjList(time);
|
|
|
+
|
|
|
+ List<StationInfoDay> zhcymonthlist = stationInfoDayService.getmonthList(time);
|
|
|
+ List<StationInfoDay> qnzhcymonthlist = stationInfoDayService.getqnmonthList(time);
|
|
|
+ List<StationInfoDay> zhcyyearlist = stationInfoDayService.getyearList(time);
|
|
|
+
|
|
|
+ List<ProEconCurveFittMonthMain> getqxlist = curveFittMonthMainService.getlist(year, month);
|
|
|
+ List<ProEconEquipmentInfoDay4> getpcllist = day4Service.getpcllist(time);
|
|
|
+ List<ProEconInOrOutSpeedTotal> outSpeedtopTotals = proEconInOrOutSpeedTotalService.gettoplist(time);
|
|
|
+ List<ProEconInOrOutSpeedTotal> outSpeedTotals = proEconInOrOutSpeedTotalService.getlist(time);
|
|
|
+ List<ProEconWindturbineGoodness> getnhtop = goodnessService.gettop(time);
|
|
|
+ List<ProEconWindturbineGoodness> getnhbottom = goodnessService.getbottom(time);
|
|
|
+ List<ProEconWindturbineGoodness> getsy_nhtop = goodnessService.getsytop(time);
|
|
|
+ List<ProEconWindturbineGoodness> getsy_nhbottom = goodnessService.getsybottom(time);
|
|
|
+
|
|
|
+ List<ProEconEquipmentInfoDay5> stateRateList = day5Service.getStateRateList(time);
|
|
|
+ List<ProEconEquipmentInfoDay5> systateRateList = day5Service.getsyStateRateList(time);
|
|
|
+ List<ProEconEquipmentInfoDay5> stateRatebotList = day5Service.getStateRatebottomList(time);
|
|
|
+
|
|
|
+ List<ProEconEquipmentInfoDay5> threestateRateList = day5Service.getthreeStateRateList(time);
|
|
|
+ List<ProEconEquipmentInfoDay5> threesystateRateList = day5Service.getsythreeStateRateList(time);
|
|
|
+ List<ProEconEquipmentInfoDay5> threestateRatebotList = day5Service.getthreeStateRatebottomList(time);
|
|
|
+
|
|
|
+ List<ProEconFaultLiminatedefects> liminatedefects = proEconFaultLiminatedefectsService.getlist(time);
|
|
|
+ List<ProEconFaultLiminatedefects> syliminatedefects = proEconFaultLiminatedefectsService.getsylist(time);
|
|
|
+ List<ProEconFaultLiminatedefects> yearliminatedefects = proEconFaultLiminatedefectsService.getyearlist(time);
|
|
|
+
|
|
|
+ // 分组 1: TurbineInfoDay 相关列表
|
|
|
+ applySetIdFromNemCode(wtls, Arrays.asList(
|
|
|
+ klyltopList, glyztopList, glyzbottomList, syglyztopList,
|
|
|
+ syglyzbottomList, klylbottomList, gzcstop, dltoplist,
|
|
|
+ dlbottomlist, xndjList),
|
|
|
+ TurbineInfoDay::getTurbineId,
|
|
|
+ TurbineInfoDay::setStationId);
|
|
|
+
|
|
|
+ // 分组 2: ProEconCurveFittMonthMain 相关列表
|
|
|
+ applySetIdFromNemCode(wtls, Arrays.asList(getqxlist),
|
|
|
+ ProEconCurveFittMonthMain::getWindturbineId,
|
|
|
+ ProEconCurveFittMonthMain::setWindturbineId);
|
|
|
+
|
|
|
+ // 分组 3: ProEconEquipmentInfoDay4 相关列表
|
|
|
+ applySetIdFromNemCode(wtls, Arrays.asList(getpcllist),
|
|
|
+ ProEconEquipmentInfoDay4::getWindturbineId,
|
|
|
+ ProEconEquipmentInfoDay4::setWindturbineId);
|
|
|
+
|
|
|
+ // 分组 4: ProEconEquipmentInfoDay5 相关列表
|
|
|
+ applySetIdFromNemCode(wtls, Arrays.asList(
|
|
|
+ stateRatebotList, threestateRateList,
|
|
|
+ threesystateRateList, threestateRatebotList),
|
|
|
+ ProEconEquipmentInfoDay5::getWindturbineId,
|
|
|
+ ProEconEquipmentInfoDay5::setWindturbineId);
|
|
|
+
|
|
|
+ // 分组 5: ProEconInOrOutSpeedTotal 相关列表
|
|
|
+ applySetIdFromNemCode(wtls, Arrays.asList(
|
|
|
+ outSpeedTotals, outSpeedtopTotals),
|
|
|
+ ProEconInOrOutSpeedTotal::getWindturbineId,
|
|
|
+ ProEconInOrOutSpeedTotal::setWindturbineId);
|
|
|
+
|
|
|
+ // 分组 6: ProEconWindturbineGoodness 相关列表
|
|
|
+ applySetIdFromNemCode(wtls, Arrays.asList(
|
|
|
+ getnhtop, getnhbottom, getsy_nhtop, getsy_nhbottom),
|
|
|
+ ProEconWindturbineGoodness::getWindturbineId,
|
|
|
+ ProEconWindturbineGoodness::setWindturbineId);
|
|
|
+
|
|
|
+ int bl = 1000;
|
|
|
+
|
|
|
+ double monthdmtbf = monthslist.size() > 0 ? StringUtils.round(monthslist.get(0).getMtbf(), 2) : 0.0;
|
|
|
+ double qnmonthmtbf = qndylist.size() > 0 ? StringUtils.round(qndylist.get(0).getMtbf(), 2) : 1.0;
|
|
|
+
|
|
|
+ double monthdmttr = monthslist.size() > 0 ? StringUtils.round(monthslist.get(0).getMttr(), 2) : 0.0;
|
|
|
+ double qnmonthmttr = qndylist.size() > 0 ? StringUtils.round(qndylist.get(0).getMttr(), 2) : 1.0;
|
|
|
+
|
|
|
+ double monthkyly = monthdllist.size() > 0 ? StringUtils.round(monthdllist.get(0).getKlyl(), 2) : 0.0;
|
|
|
+ double yearklyly = yeardllist.size() > 0 ? StringUtils.round(yeardllist.get(0).getKlyl(), 2) : 0.0;
|
|
|
+
|
|
|
+ String klyltop1id = klyltopList.size() > 0 ? klyltopList.get(0).getStationId() : "";
|
|
|
+ double klyltop1value = klyltopList.size() > 0 ? StringUtils.round(klyltopList.get(0).getKlyl(), 2) : 0.0;
|
|
|
+
|
|
|
+ String klyltop2id = klyltopList.size() > 0 ? klyltopList.get(1).getStationId() : "";
|
|
|
+ double klyltop2value = klyltopList.size() > 0 ? StringUtils.round(klyltopList.get(1).getKlyl(), 2) : 0.0;
|
|
|
+
|
|
|
+ String klyltop3id = klyltopList.size() > 0 ? klyltopList.get(2).getStationId() : "";
|
|
|
+ double klyltop3value = klyltopList.size() > 0 ? StringUtils.round(klyltopList.get(2).getKlyl(), 2) : 0.0;
|
|
|
+
|
|
|
+ String klylbottom1id = klylbottomList.size() > 0 ? klylbottomList.get(0).getStationId() : "";
|
|
|
+ double klylbottom1value = klylbottomList.size() > 0 ? StringUtils.round(klylbottomList.get(0).getKlyl(), 2) : 0.0;
|
|
|
+
|
|
|
+ String klylbottom2id = klylbottomList.size() > 0 ? klylbottomList.get(1).getStationId() : "";
|
|
|
+ double klylbottom2value = klylbottomList.size() > 0 ? StringUtils.round(klylbottomList.get(1).getKlyl(), 2) : 0.0;
|
|
|
+
|
|
|
+ String klylbottom3id = klylbottomList.size() > 0 ? klylbottomList.get(2).getStationId() : "";
|
|
|
+ double klylbottom3value = klylbottomList.size() > 0 ? StringUtils.round(klylbottomList.get(2).getKlyl(), 2) : 0.0;
|
|
|
+
|
|
|
+ double mtbftq = 0.0;
|
|
|
+ double mttrtq = 0.0;
|
|
|
+ if (qnmonthmtbf > 1) {
|
|
|
+ mtbftq = StringUtils.round((monthdmtbf - qnmonthmtbf) / qnmonthmtbf * 100, 2);
|
|
|
+ }
|
|
|
+ if (qnmonthmttr > 1) {
|
|
|
+ mttrtq = StringUtils.round((monthdmttr - qnmonthmttr) / qnmonthmttr * 100, 2);
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("MTBF", "MTBF(平均无故障时间):月度" + monthdmtbf + "h,与上年同期对比±" + mtbftq + "%");
|
|
|
+ map.put("MTTR", "MTTR(平均修复时间):月度" + monthdmttr + "h,与上年同期对比±" + mttrtq + "%");
|
|
|
+ map.put("风机可利用率", "风机可利用率:\n" +
|
|
|
+ "场站平均可利用率:月度" + monthkyly + "%,年度" + yearklyly + "%\n" +
|
|
|
+ "可利用率Top3风机:" + klyltop1id + "号" + klyltop1value + "%、" + klyltop2id + "号" + klyltop2value + "%、" + klyltop3id + "号" + klyltop3value + "%\n" +
|
|
|
+ "可利用率末3风机:" + klylbottom1id + "号" + klylbottom1value + "%、" + klylbottom2id + "号" + klylbottom2value + "%、" + klylbottom3id + "号" + klylbottom3value + "%");
|
|
|
+
|
|
|
+ int gzcs = gzcslist.size() > 0 ? gzcslist.get(0).getGzcs() : 0;
|
|
|
+ String gzfj = gzcstop.size() > 0 ? gzcstop.get(0).getStationId() : "";
|
|
|
+ int gzfjcs = gzcstop.size() > 0 ? gzcstop.get(0).getGzcs() : 0;
|
|
|
+ map.put("故障统计", "故障统计:\n" +
|
|
|
+ "月度总故障次数:" + gzcs + "次\n" +
|
|
|
+ "故障频发风机:" + gzfj + "号(" + gzfjcs + "次)");
|
|
|
+
|
|
|
+
|
|
|
+ double monthfdl = monthdllist.size() > 0 ? StringUtils.round(monthdllist.get(0).getRfdl() / bl, 2) : 0.0;
|
|
|
+ double monthllfdl = monthdllist.size() > 0 ? StringUtils.round(monthdllist.get(0).getLlfdl() / bl, 2) : 0.0;
|
|
|
+ double qnmonthfdl = qnmonthlist.size() > 0 ? StringUtils.round(qnmonthlist.get(0).getRfdl() / bl, 2) : 1.0;
|
|
|
+ double hbmothfdl = hbmonthList.size() > 0 ? StringUtils.round(hbmonthList.get(0).getRfdl() / bl, 2) : 1.0;
|
|
|
+
|
|
|
+ double yearfdl = yeardllist.size() > 0 ? StringUtils.round(yeardllist.get(0).getRfdl() / bl, 2) : 0.0;
|
|
|
+ double yearllfdl = yeardllist.size() > 0 ? StringUtils.round(yeardllist.get(0).getLlfdl() / bl, 2) : 0.0;
|
|
|
+
|
|
|
+ String[] dltopId = new String[3];
|
|
|
+ double[] dltopFdl = new double[3];
|
|
|
+ double month_dtpjFdl = StringUtils.round(monthfdl / 50, 2);
|
|
|
+ double year_dtpjFdl = StringUtils.round(yearfdl / 50, 2);
|
|
|
+ double monthfdltb = 0;
|
|
|
+ double monthfdlhb = 0;
|
|
|
+ if (qnmonthfdl != 1) {
|
|
|
+ monthfdltb = StringUtils.round((monthfdl - qnmonthfdl) / qnmonthfdl * 100, 2);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (hbmothfdl != 1) {
|
|
|
+ monthfdlhb = StringUtils.round((monthfdl - hbmothfdl) / hbmothfdl * 100, 2);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ for (int i = 0; i < dltoplist.size(); i++) {
|
|
|
+ dltopFdl[i] = StringUtils.round(dltoplist.get(i).getRfdl() / bl, 2);
|
|
|
+ dltopId[i] = dltoplist.get(i).getStationId();
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] bottomId = new String[3];
|
|
|
+ double[] bottomFdl = new double[3];
|
|
|
+ for (int i = 0; i < dlbottomlist.size(); i++) {
|
|
|
+ bottomFdl[i] = StringUtils.round(dlbottomlist.get(i).getRfdl() / bl, 2);
|
|
|
+ bottomId[i] = dlbottomlist.get(i).getStationId();
|
|
|
+ }
|
|
|
+
|
|
|
+// map.put("发电量分析", "场站总发电量:月度" + monthfdl + "万KWh,年度" + yearfdl + "万KWh\n" +
|
|
|
+// "理论发电量:月度" + monthllfdl + "万KWh,年度" + yearllfdl + "万KWh\n" +
|
|
|
+// "单台风机平均发电量:月度" + month_dtpjFdl + "万KWh,年度" + year_dtpjFdl + "万KWh\n" +
|
|
|
+// "发电量Top3风机:" + dltopId[0] + "号" + dltopFdl[0] + "万KWh、" + dltopId[1] + "号" + dltopFdl[1] + "万KWh、" + dltopId[2] + "号" + dltopFdl[2] + "万KWh\n" +
|
|
|
+// "发电量末3风机:" + bottomId[0] + "号" + bottomFdl[0] + "万KWh、" + bottomId[1] + "号" + bottomFdl[1] + "万KWh、" + bottomId[2] + "号" + bottomFdl[2] + "万KWh\n" +
|
|
|
+// "同比/环比分析:月度发电量同比" + monthfdltb + "%(±),环比" + monthfdlhb + "%(±)");
|
|
|
+
|
|
|
+ map.put("发电量分析-总发电量", "场站总发电量:月度" + monthfdl + "万KWh,年度" + yearfdl + "万KWh");
|
|
|
+ map.put("发电量分析-理论发电量","理论发电量:月度" + monthllfdl + "万KWh,年度" + yearllfdl + "万KWh");
|
|
|
+ map.put("发电量分析-单台平均","单台风机平均发电量:月度" + month_dtpjFdl + "万KWh,年度" + year_dtpjFdl + "万KWh");
|
|
|
+ map.put("发电量分析-Top3风机","发电量Top3风机:" + dltopId[0] + "号" + dltopFdl[0] + "万KWh、" + dltopId[1] + "号" + dltopFdl[1] + "万KWh、" + dltopId[2] + "号" + dltopFdl[2] + "万KWh");
|
|
|
+ map.put("发电量分析-末3风机","发电量末3风机:" + bottomId[0] + "号" + bottomFdl[0] + "万KWh、" + bottomId[1] + "号" + bottomFdl[1] + "万KWh、" + bottomId[2] + "号" + bottomFdl[2] + "万KWh");
|
|
|
+ map.put("发电量分析-同比分析","同比/环比分析:月度发电量同比" + monthfdltb + "%(±),环比" + monthfdlhb + "%(±)");
|
|
|
+
|
|
|
+ //月场用电量
|
|
|
+ double monthcydl = zhcymonthlist.size() > 0 ? StringUtils.round((double) zhcymonthlist.get(0).getZhcydl() / bl, 2) : 0.0;
|
|
|
+ //月发电量
|
|
|
+ double monthrfdl = zhcymonthlist.size() > 0 ? StringUtils.round((double) zhcymonthlist.get(0).getRfdl() / bl, 2) : 0.0;
|
|
|
+ //去年月场用电量
|
|
|
+ double qnmonthcydl = qnzhcymonthlist.size() > 0 ? StringUtils.round((double) qnzhcymonthlist.get(0).getZhcydl() / bl, 2) : 1.0;
|
|
|
+ //去年月发电量
|
|
|
+ double qnmonthrfdl = qnzhcymonthlist.size() > 0 ? StringUtils.round((double) qnzhcymonthlist.get(0).getRfdl() / bl, 2) : 1.0;
|
|
|
+ //年场用电量
|
|
|
+ double yearcydl = zhcyyearlist.size() > 0 ? StringUtils.round((double) zhcyyearlist.get(0).getZhcydl() / bl, 2) : 0.0;
|
|
|
+ //年发电量
|
|
|
+ double yearrfdl = zhcyyearlist.size() > 0 ? StringUtils.round((double) zhcyyearlist.get(0).getRfdl() / bl, 2) : 0.0;
|
|
|
+
|
|
|
+ //月场用电率
|
|
|
+ double monthcydll = monthrfdl > 1 ? StringUtils.round(monthcydl / monthrfdl * 100, 2) : 0.0;
|
|
|
+ //年场用电率
|
|
|
+ double yearcydll = yearrfdl > 1 ? StringUtils.round(yearcydl / yearrfdl * 100, 2) : 0.0;
|
|
|
+ //去年场用电率
|
|
|
+ double qnmonthcydll = qnmonthrfdl > 1 ? StringUtils.round(qnmonthcydl / qnmonthrfdl * 100, 2) : 0.0;
|
|
|
+
|
|
|
+ //月场用电量同比
|
|
|
+ double monthcydltb = qnmonthcydl > 1 ? StringUtils.round((monthcydl - qnmonthcydl) / qnmonthcydl * 100, 2) : 0.0;
|
|
|
+
|
|
|
+ //场用电率同比
|
|
|
+ double monthcydlltb = qnmonthcydll > 1 ? StringUtils.round((monthcydll - qnmonthcydll) / qnmonthcydll * 100, 2) : 0.0;
|
|
|
+
|
|
|
+
|
|
|
+// map.put("综合场用电量分析", "月度场用电量:" + monthcydl + "万KWh\n" +
|
|
|
+// "年度场用电量:" + yearcydl + "万KWh\n" +
|
|
|
+// "场用电率:月度" + monthcydll + "%,年度" + yearcydll + "%\n" +
|
|
|
+// "与同期对比:月度场用电量同比" + monthcydltb + "%(±),场用电率同比" + monthcydlltb + "%(±)");
|
|
|
+
|
|
|
+ map.put("综合场用电量分析-月度场用电量","月度场用电量:" + monthcydl + "万KWh");
|
|
|
+ map.put("综合场用电量分析-年度场用电量","年度场用电量:" + yearcydl + "万KWh");
|
|
|
+ map.put("综合场用电量分析-场用电率","场用电率:月度" + monthcydll + "%,年度" + yearcydll + "%");
|
|
|
+ map.put("综合场用电量分析-与同期对比","与同期对比:月度场用电量同比" + monthcydltb + "%(±),场用电率同比" + monthcydlltb + "%(±)");
|
|
|
+
|
|
|
+ double avgfs = Optional.ofNullable(zhcymonthlist)
|
|
|
+ .filter(list -> !list.isEmpty())
|
|
|
+ .map(list -> list.get(0))
|
|
|
+ .map(StationInfoDay::getCftfs) // 根据您的实际类名替换
|
|
|
+ .map(BigDecimal::doubleValue)
|
|
|
+ .map(value -> StringUtils.round(value, 2))
|
|
|
+ .orElse(0.0);
|
|
|
+
|
|
|
+ double qnavgfs = Optional.ofNullable(qnzhcymonthlist)
|
|
|
+ .filter(list -> !list.isEmpty())
|
|
|
+ .map(list -> list.get(0))
|
|
|
+ .map(StationInfoDay::getCftfs) // 根据您的实际类名替换
|
|
|
+ .map(BigDecimal::doubleValue)
|
|
|
+ .map(value -> StringUtils.round(value, 2))
|
|
|
+ .orElse(0.0);
|
|
|
+
|
|
|
+ double tqb_avgfs = qnavgfs > 1 ? StringUtils.round((avgfs - qnavgfs) / qnavgfs * 100, 2) : 0.0;
|
|
|
+ double avgfx = Optional.ofNullable(zhcymonthlist)
|
|
|
+ .filter(list -> !list.isEmpty())
|
|
|
+ .map(list -> list.get(0))
|
|
|
+ .map(StationInfoDay::getCftfx) // 替换YourObjectClass为实际类名
|
|
|
+ .map(BigDecimal::doubleValue) // 将BigDecimal转换为double
|
|
|
+ .map(value -> StringUtils.round(value, 2))
|
|
|
+ .orElse(0.0);
|
|
|
+
|
|
|
+ double avgjfpl = Optional.ofNullable(monthdllist)
|
|
|
+ .filter(list -> !list.isEmpty())
|
|
|
+ .map(list -> list.get(0))
|
|
|
+ .map(TurbineInfoDay::getJfpl)
|
|
|
+ .map(value -> StringUtils.round(value, 2))
|
|
|
+ .orElse(0.0);
|
|
|
+ double qnavgjfpl = Optional.ofNullable(qnmonthlist)
|
|
|
+ .filter(list -> !list.isEmpty())
|
|
|
+ .map(list -> list.get(0))
|
|
|
+ .map(TurbineInfoDay::getJfpl) // 替换YourObjectClass为实际类名
|
|
|
+ .map(value -> StringUtils.round(value, 2))
|
|
|
+ .orElse(0.0);
|
|
|
+ double tqb_jfpl = qnavgjfpl > 1 ? StringUtils.round((avgjfpl - qnavgjfpl) / qnavgjfpl * 100, 2) : 0.0;
|
|
|
+
|
|
|
+// map.put("风资源分析", "风资源数据:\n" +
|
|
|
+// "平均风速:" + avgfs + "m/s\n" +
|
|
|
+// "主导风向:" + avgfx + "\n" +
|
|
|
+// "静风频率:" + avgjfpl + "%\n" +
|
|
|
+// "历史对比:与去年同期相比,平均风速" + tqb_avgfs + "m/s(±),静风频率" + tqb_jfpl + "%(±)");
|
|
|
+
|
|
|
+ map.put("风资源分析-风资源数据","风资源数据:\n" +
|
|
|
+ "平均风速:" + avgfs + "m/s\n" +
|
|
|
+ "主导风向:" + avgfx + "\n" +
|
|
|
+ "静风频率:" + avgjfpl + "%");
|
|
|
+ map.put("风资源分析-历史对比","历史对比:与去年同期相比,平均风速" + tqb_avgfs + "m/s(±),静风频率" + tqb_jfpl + "%(±)");
|
|
|
+
|
|
|
+ String[] qxtopid = new String[3];
|
|
|
+ double[] qxpcl = new double[3];
|
|
|
+ for (int i = 0; i < getqxlist.size(); i++) {
|
|
|
+ var item = getqxlist.get(i);
|
|
|
+ qxtopid[i] = item.getWindturbineId();
|
|
|
+ qxpcl[i] = item.getDeviationRate2();
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("曲线偏差率分析", "偏差率排行(排名前三):\n" +
|
|
|
+ "" + qxtopid[0] + "号风机:偏差率" + qxpcl[0] + "%,排名: 1\n" +
|
|
|
+ "" + qxtopid[1] + "号风机:偏差率" + qxpcl[1] + "%,排名: 2\n" +
|
|
|
+ "" + qxtopid[2] + "号风机:偏差率" + qxpcl[2] + "%,排名: 3");
|
|
|
+
|
|
|
+ double pcl_35 = getpcllist.stream().mapToDouble(ProEconEquipmentInfoDay4::getR35mqxpcl).average().getAsDouble();
|
|
|
+ // 获取最小值对应的数据
|
|
|
+ Optional<ProEconEquipmentInfoDay4> min_35 = getpcllist.stream()
|
|
|
+ .min(Comparator.comparingDouble(ProEconEquipmentInfoDay4::getR35mqxpcl));
|
|
|
+ // 获取最大值对应的数据
|
|
|
+ Optional<ProEconEquipmentInfoDay4> max_35 = getpcllist.stream()
|
|
|
+ .max(Comparator.comparingDouble(ProEconEquipmentInfoDay4::getR35mqxpcl));
|
|
|
+
|
|
|
+ String min_35Id = min_35.map(ProEconEquipmentInfoDay4::getWindturbineId).orElse(null);
|
|
|
+ String max_35Id = max_35.map(ProEconEquipmentInfoDay4::getWindturbineId).orElse(null);
|
|
|
+
|
|
|
+
|
|
|
+ double pcl_511 = getpcllist.stream().mapToDouble(ProEconEquipmentInfoDay4::getR511mqxpcl).average().getAsDouble();
|
|
|
+ Optional<ProEconEquipmentInfoDay4> min_511 = getpcllist.stream()
|
|
|
+ .min(Comparator.comparingDouble(ProEconEquipmentInfoDay4::getR511mqxpcl));
|
|
|
+ // 获取最大值对应的数据
|
|
|
+ Optional<ProEconEquipmentInfoDay4> max_511 = getpcllist.stream()
|
|
|
+ .max(Comparator.comparingDouble(ProEconEquipmentInfoDay4::getR511mqxpcl));
|
|
|
+
|
|
|
+ String min_511Id = min_511.map(ProEconEquipmentInfoDay4::getWindturbineId).orElse(null);
|
|
|
+ String max_511Id = max_511.map(ProEconEquipmentInfoDay4::getWindturbineId).orElse(null);
|
|
|
+
|
|
|
+ double pcl_1125 = getpcllist.stream().mapToDouble(ProEconEquipmentInfoDay4::getR11mycqxpcl).average().getAsDouble();
|
|
|
+ Optional<ProEconEquipmentInfoDay4> min_1125 = getpcllist.stream()
|
|
|
+ .min(Comparator.comparingDouble(ProEconEquipmentInfoDay4::getR511mqxpcl));
|
|
|
+ // 获取最大值对应的数据
|
|
|
+ Optional<ProEconEquipmentInfoDay4> max_1125 = getpcllist.stream()
|
|
|
+ .max(Comparator.comparingDouble(ProEconEquipmentInfoDay4::getR511mqxpcl));
|
|
|
+
|
|
|
+ String min_1125Id = min_1125.map(ProEconEquipmentInfoDay4::getWindturbineId).orElse(null);
|
|
|
+ String max_1125Id = max_1125.map(ProEconEquipmentInfoDay4::getWindturbineId).orElse(null);
|
|
|
+ map.put("各区间偏差率统计", "各区间偏差率统计:\n" +
|
|
|
+ "3-5m/s区间:平均偏差率" + StringUtils.round(pcl_35, 2) + "%,偏差率最大风机:" + max_35Id + "号,偏差率最小风机:" + min_35Id + "号\n" +
|
|
|
+ "5-11m/s区间:平均偏差率" + StringUtils.round(pcl_511, 2) + "%,偏差率最大风机:" + max_511Id + "号,偏差率最小风机:" + min_511Id + "号\n" +
|
|
|
+ "11-25m/s区间:平均偏差率" + StringUtils.round(pcl_1125, 2) + "%,偏差率最大风机:" + max_1125Id + "号,偏差率最小风机:" + min_1125Id + "号");
|
|
|
+
|
|
|
+ String[] yqrtopid = new String[3];
|
|
|
+ double[] yqrfs = new double[3];
|
|
|
+ double[] yqcfs = new double[3];
|
|
|
+
|
|
|
+ for (int i = 0; i < outSpeedtopTotals.size(); i++) {
|
|
|
+ var item = outSpeedtopTotals.get(i);
|
|
|
+ yqrtopid[i] = item.getWindturbineId();
|
|
|
+ yqrfs[i] = StringUtils.round(item.getMonthInputSmall(), 2);
|
|
|
+ yqcfs[i] = StringUtils.round(item.getMonthOutputSmall(), 2);
|
|
|
+ }
|
|
|
+ map.put("单台风速分析", "单台风速分析(排名前三):\n" +
|
|
|
+ "" + yqrtopid[0] + "号风机:月度小风切入风速" + yqrfs[0] + "m/s、小风切出风速" + yqcfs[0] + "m/s\n" +
|
|
|
+ "" + yqrtopid[1] + "号风机:月度小风切入风速" + yqrfs[1] + "m/s、小风切出风速" + yqcfs[1] + "m/s\n" +
|
|
|
+ "" + yqrtopid[2] + "号风机:月度小风切入风速" + yqrfs[2] + "m/s、小风切出风速" + yqcfs[2] + "m/s");
|
|
|
+
|
|
|
+
|
|
|
+ double average = 0.0;
|
|
|
+ if (outSpeedTotals != null && !outSpeedTotals.isEmpty()) {
|
|
|
+ average = outSpeedTotals.stream()
|
|
|
+ .mapToDouble(ProEconInOrOutSpeedTotal::getMonthInputSmallRatio)
|
|
|
+ .average()
|
|
|
+ .orElse(0.0);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ProEconInOrOutSpeedTotal> out_100 = outSpeedTotals.stream().filter(o -> o.getMonthInputSmallRatio() == 100).collect(Collectors.toList());
|
|
|
+ List<ProEconInOrOutSpeedTotal> out_60 = outSpeedTotals.stream().filter(o -> o.getMonthInputSmallRatio() >= 60).collect(Collectors.toList());
|
|
|
+
|
|
|
+ String out60_id = out_60.stream()
|
|
|
+ .map(ProEconInOrOutSpeedTotal::getWindturbineId)
|
|
|
+ .filter(Objects::nonNull) // 过滤掉null值
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ String out100_id = out_100.stream()
|
|
|
+ .map(ProEconInOrOutSpeedTotal::getWindturbineId)
|
|
|
+ .filter(Objects::nonNull) // 过滤掉null值
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ map.put("合格率计算", "合格率计算:\n" +
|
|
|
+ "50台风机平均切入切出合格率" + StringUtils.round(average, 2) + "%\n" +
|
|
|
+ "合格率100%的风机:" + out_100.size() + "台,为" + out100_id + "\n" +
|
|
|
+ "合格率低于60%的风机:" + out_60.size() + "台,为" + out60_id + "");
|
|
|
+
|
|
|
+ String[] topnhyd_id = new String[3];
|
|
|
+ double[] top_ynhyd = new double[3];
|
|
|
+
|
|
|
+ String[] bottomnhyd_id = new String[3];
|
|
|
+ double[] bottom_ynhyd = new double[3];
|
|
|
+
|
|
|
+ String[] sytopnhyd_id = new String[3];
|
|
|
+ double[] sytop_ynhyd = new double[3];
|
|
|
+
|
|
|
+ String[] sybottomnhyd_id = new String[3];
|
|
|
+ double[] sybottom_ynhyd = new double[3];
|
|
|
+
|
|
|
+ for (int i = 0; i < getnhtop.size(); i++) {
|
|
|
+ var item = getnhtop.get(i);
|
|
|
+ topnhyd_id[i] = item.getWindturbineId();
|
|
|
+ top_ynhyd[i] = StringUtils.round(item.getMonthGoodness(), 2);
|
|
|
+
|
|
|
+ var item_bot = getnhbottom.get(i);
|
|
|
+ bottomnhyd_id[i] = item_bot.getWindturbineId();
|
|
|
+ bottom_ynhyd[i] = StringUtils.round(item_bot.getMonthGoodness(), 2);
|
|
|
+
|
|
|
+ var qnitem = getsy_nhtop.get(i);
|
|
|
+ sytopnhyd_id[i] = qnitem.getWindturbineId();
|
|
|
+ sytop_ynhyd[i] = StringUtils.round(qnitem.getMonthGoodness(), 2);
|
|
|
+
|
|
|
+ var qnitem_bot = getsy_nhbottom.get(i);
|
|
|
+ sybottomnhyd_id[i] = qnitem_bot.getWindturbineId();
|
|
|
+ sybottom_ynhyd[i] = StringUtils.round(qnitem_bot.getMonthGoodness(), 2);
|
|
|
+ }
|
|
|
+// map.put("单机性能分析", "拟合优度排行:\n" +
|
|
|
+// "月拟合优度Top3:" + topnhyd_id[0] + "号" + top_ynhyd[0] + "%、" + topnhyd_id[1] + "号" + top_ynhyd[1] + "%、" + topnhyd_id[2] + "号" + top_ynhyd[2] + "%\n" +
|
|
|
+// "月拟合优度末3:" + bottomnhyd_id[0] + "号" + bottom_ynhyd[0] + "%、" + bottomnhyd_id[1] + "号" + bottom_ynhyd[2] + "%、" + bottomnhyd_id[2] + "号" + bottom_ynhyd[2] + "%\n" +
|
|
|
+// "拟合优度排行—上月同期:\n" +
|
|
|
+// "月拟合优度Top3:" + sytopnhyd_id[0] + "号" + sytop_ynhyd[0] + "%、" + sytopnhyd_id[1] + "号" + sytop_ynhyd[1] + "%、" + sytopnhyd_id[2] + "号" + sytop_ynhyd[2] + "%\n" +
|
|
|
+// "月拟合优度末3:" + sybottomnhyd_id[0] + "号" + sybottom_ynhyd[0] + "%、" + sybottomnhyd_id[1] + "号" + sybottom_ynhyd[1] + "%、" + sybottomnhyd_id[2] + "号" + sybottom_ynhyd[2] + "%");
|
|
|
+
|
|
|
+ map.put("拟合优度排行","拟合优度排行:\n" +
|
|
|
+ "月拟合优度Top3:" + topnhyd_id[0] + "号" + top_ynhyd[0] + "%、" + topnhyd_id[1] + "号" + top_ynhyd[1] + "%、" + topnhyd_id[2] + "号" + top_ynhyd[2] + "%\n" +
|
|
|
+ "月拟合优度末3:" + bottomnhyd_id[0] + "号" + bottom_ynhyd[0] + "%、" + bottomnhyd_id[1] + "号" + bottom_ynhyd[2] + "%、" + bottomnhyd_id[2] + "号" + bottom_ynhyd[2] + "%");
|
|
|
+
|
|
|
+ map.put("拟合优度排行—上月","拟合优度排行—上月:\n" +
|
|
|
+ "月拟合优度Top3:" + sytopnhyd_id[0] + "号" + sytop_ynhyd[0] + "%、" + sytopnhyd_id[1] + "号" + sytop_ynhyd[1] + "%、" + sytopnhyd_id[2] + "号" + sytop_ynhyd[2] + "%\n" +
|
|
|
+ "月拟合优度末3:" + sybottomnhyd_id[0] + "号" + sybottom_ynhyd[0] + "%、" + sybottomnhyd_id[1] + "号" + sybottom_ynhyd[1] + "%、" + sybottomnhyd_id[2] + "号" + sybottom_ynhyd[2] + "%");
|
|
|
+
|
|
|
+ String[] glyz_topid = new String[3];
|
|
|
+ double[] glyz_top = new double[3];
|
|
|
+ double[] lyxs_top = new double[3];
|
|
|
+
|
|
|
+ String[] syglyz_topid = new String[3];
|
|
|
+ double[] syglyz_top = new double[3];
|
|
|
+ double[] sylyxs_top = new double[3];
|
|
|
+
|
|
|
+
|
|
|
+ String[] glyz_botid = new String[3];
|
|
|
+ double[] glyz_bot = new double[3];
|
|
|
+ double[] lyxs_bot = new double[3];
|
|
|
+
|
|
|
+ String[] syglyz_botid = new String[3];
|
|
|
+ double[] syglyz_bot = new double[3];
|
|
|
+ double[] sylyxs_bot = new double[3];
|
|
|
+ for (int i = 0; i < glyztopList.size(); i++) {
|
|
|
+ var item_top = glyztopList.get(i);
|
|
|
+ glyz_topid[i] = item_top.getStationId();
|
|
|
+ glyz_top[i] = StringUtils.round(item_top.getGlyzxxs(), 2);
|
|
|
+ lyxs_top[i] = StringUtils.round(item_top.getLyxs(), 2);
|
|
|
+
|
|
|
+ var syitem_top = syglyztopList.get(i);
|
|
|
+ syglyz_topid[i] = syitem_top.getStationId();
|
|
|
+ syglyz_top[i] = StringUtils.round(syitem_top.getGlyzxxs(), 2);
|
|
|
+ sylyxs_top[i] = StringUtils.round(syitem_top.getLyxs(), 2);
|
|
|
+
|
|
|
+
|
|
|
+ var item_bot = glyztopList.get(i);
|
|
|
+ glyz_botid[i] = item_bot.getStationId();
|
|
|
+ glyz_bot[i] = StringUtils.round(item_bot.getGlyzxxs(), 2);
|
|
|
+ lyxs_bot[i] = StringUtils.round(item_bot.getLyxs(), 2);
|
|
|
+
|
|
|
+ var syitem_bot = syglyztopList.get(i);
|
|
|
+ syglyz_botid[i] = syitem_bot.getStationId();
|
|
|
+ syglyz_bot[i] = StringUtils.round(syitem_bot.getGlyzxxs(), 2);
|
|
|
+ sylyxs_bot[i] = StringUtils.round(syitem_bot.getLyxs(), 2);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("单机月度分析-分析对象", "" + glyz_topid[0] + "、" + glyz_topid[1] + "、" + glyz_topid[2] + "、" + glyz_topid[0] + "、" + glyz_topid[1] + "、" + glyz_topid[2] + "、号风机");
|
|
|
+ map.put("单机月度分析-关键数据", "关键数据:\n" +
|
|
|
+ "Top3:" + glyz_topid[0] + "号 机组功率一致性" + glyz_top[0] + "%,设备利用小时:" + lyxs_top[0] + "h\n" +
|
|
|
+ "" + glyz_topid[1] + "号 机组功率一致性" + glyz_top[1] + "%,设备利用小时:" + lyxs_top[1] + "h\n" +
|
|
|
+ "" + glyz_topid[2] + "号 机组功率一致性" + glyz_top[2] + "%,设备利用小时:" + lyxs_top[2] + "h\n" +
|
|
|
+ "末3:" + glyz_botid[0] + "号 机组功率一致性" + glyz_bot[0] + "%,设备利用小时:" + lyxs_bot[0] + "h\n" +
|
|
|
+ "" + glyz_botid[1] + "号 机组功率一致性" + glyz_bot[1] + "%,设备利用小时:" + lyxs_bot[1] + "h\n" +
|
|
|
+ "" + glyz_botid[2] + "号 机组功率一致性" + glyz_bot[2] + "%,设备利用小时:" + lyxs_bot[2]);
|
|
|
+ map.put("单机月度分析-关键数据上月", "关键数据-上月:\n" +
|
|
|
+ "Top3:" + syglyz_topid[0] + "号 机组功率一致性" + syglyz_top[0] + "%,设备利用小时:" + sylyxs_top[0] + "h\n" +
|
|
|
+ "" + syglyz_topid[1] + "号 机组功率一致性" + syglyz_top[1] + "%,设备利用小时:" + sylyxs_top[1] + "h\n" +
|
|
|
+ "" + syglyz_topid[2] + "号 机组功率一致性" + syglyz_top[2] + "%,设备利用小时:" + sylyxs_top[2] + "h\n" +
|
|
|
+ "末3:" + syglyz_botid[0] + "号 机组功率一致性" + syglyz_bot[0] + "%,设备利用小时:" + sylyxs_bot[0] + "h\n" +
|
|
|
+ "" + syglyz_botid[1] + "号 机组功率一致性" + syglyz_bot[1] + "%,设备利用小时:" + sylyxs_bot[1] + "h\n" +
|
|
|
+ "" + syglyz_botid[2] + "号 机组功率一致性" + syglyz_bot[2] + "%,设备利用小时:" + sylyxs_bot[2]);
|
|
|
+
|
|
|
+
|
|
|
+ // 初始化统计Map
|
|
|
+ Map<String, Integer> levelCountMap = new HashMap<>();
|
|
|
+ Map<String, List<String>> levelStationMap = new HashMap<>();
|
|
|
+
|
|
|
+ for (String level : LEVELS) {
|
|
|
+ levelCountMap.put(level, 0);
|
|
|
+ levelStationMap.put(level, new ArrayList<>());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 遍历统计
|
|
|
+ for (TurbineInfoDay item : xndjList) {
|
|
|
+ String level = item.getLevel();
|
|
|
+ String stationId = item.getStationId();
|
|
|
+
|
|
|
+ if (level != null && stationId != null) {
|
|
|
+ for (String targetLevel : LEVELS) {
|
|
|
+ if (level.contains(targetLevel)) {
|
|
|
+ levelCountMap.put(targetLevel, levelCountMap.get(targetLevel) + 1);
|
|
|
+ // 只保留前3个ID
|
|
|
+ if (levelStationMap.get(targetLevel).size() < 3) {
|
|
|
+ levelStationMap.get(targetLevel).add(stationId);
|
|
|
+ }
|
|
|
+ break; // 找到一个匹配就跳出内层循环
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 生成结果
|
|
|
+ int level_A = levelCountMap.get("A");
|
|
|
+ int level_B = levelCountMap.get("B");
|
|
|
+ int level_C = levelCountMap.get("C");
|
|
|
+
|
|
|
+ String level_Aid = String.join(",", levelStationMap.get("A"));
|
|
|
+ String level_Bid = String.join(",", levelStationMap.get("B"));
|
|
|
+ String level_Cid = String.join(",", levelStationMap.get("C"));
|
|
|
+
|
|
|
+ map.put("性能等级评估", "等级分布:\n" +
|
|
|
+ "A级(优秀):" + level_A + "台(" + level_Aid + "号等)\n" +
|
|
|
+ "B级(良好):" + level_B + "台(" + level_Bid + "号等)\n" +
|
|
|
+ "C级(合格):" + level_C + "台(" + level_Cid + "号等)");
|
|
|
+
|
|
|
+ double wfzfwcs = 0.0;
|
|
|
+ double sfzfwcs = 0.0;
|
|
|
+ double swfzfwcs = 0.0;
|
|
|
+ double esfzfwcs = 0.0;
|
|
|
+
|
|
|
+ double wfzfwl = 0.0;
|
|
|
+ double sfzfwl = 0.0;
|
|
|
+ double swfzfwl = 0.0;
|
|
|
+ double esfzfwl = 0.0;
|
|
|
+ if (stateRateList.size() > 0) {
|
|
|
+
|
|
|
+ wfzfwcs = stateRateList.stream()
|
|
|
+ .filter(o -> o != null)
|
|
|
+ .mapToDouble(o -> o.getTimerate16())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ sfzfwcs = stateRateList.stream()
|
|
|
+ .filter(o -> o != null)
|
|
|
+ .mapToDouble(o -> o.getTimerate17())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ swfzfwcs = stateRateList.stream()
|
|
|
+ .filter(o -> o != null)
|
|
|
+ .mapToDouble(o -> o.getTimerate18())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ esfzfwcs = stateRateList.stream()
|
|
|
+ .filter(o -> o != null)
|
|
|
+ .mapToDouble(o -> o.getTimerate19())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ wfzfwl = stateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate20() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate16() / o.getTimerate20() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ sfzfwl = stateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate20() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate17() / o.getTimerate20() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ swfzfwl = stateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate20() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate18() / o.getTimerate20() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ esfzfwl = stateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate20() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate19() / o.getTimerate20() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+ }
|
|
|
+
|
|
|
+ double sy_wfzcs = 0.0;
|
|
|
+ double sy_zcs = 0.0;
|
|
|
+ if (systateRateList.size() > 0) {
|
|
|
+ sy_wfzcs = systateRateList.get(0).getTimerate16();
|
|
|
+ sy_zcs = systateRateList.get(0).getTimerate16();
|
|
|
+ }
|
|
|
+
|
|
|
+ double sywfzfwl = StringUtils.round(sy_wfzcs / sy_zcs * 100, 2);
|
|
|
+
|
|
|
+ String[] wfzfwcsbot_id = new String[3];
|
|
|
+ double[] wfzfwcsbot = new double[3];
|
|
|
+ for (int i = 0; i < stateRatebotList.size(); i++) {
|
|
|
+ var item = stateRatebotList.get(i);
|
|
|
+ wfzfwcsbot_id[i] = item.getWindturbineId();
|
|
|
+ wfzfwcsbot[i] = item.getTimerate16();
|
|
|
+ }
|
|
|
+ double fwltb = StringUtils.round((wfzfwl - sywfzfwl) / sywfzfwl * 100,2);
|
|
|
+ map.put("复位及时率", "月度5分钟: 复位次数 "+ wfzfwcs + "次"+",复位及时率:" + wfzfwl + "%\n" +
|
|
|
+ "月度10分钟:复位次数"+ sfzfwcs + "次"+",复位及时率:" + sfzfwl + "%\n" +
|
|
|
+ "月度15分钟:复位次数"+ swfzfwcs +"次"+",复位及时率:" + swfzfwl + "%\n" +
|
|
|
+ "月度20分钟:复位次数"+ esfzfwcs + "次" +"复位及时率:" + esfzfwl + "%\n" +
|
|
|
+ "月度5分钟复位次数排名最低的三台风机:" + wfzfwcsbot_id[0] + "号(" + wfzfwcsbot[0] + "次)、" + wfzfwcsbot_id[1] + "号(" + wfzfwcsbot[1] + "次)、" + wfzfwcsbot_id[2] + "号(" + wfzfwcsbot[2] + "次)\n" +
|
|
|
+ "与上月对比:月度5分钟复位及时率环比" + fwltb + "%(±)");
|
|
|
+
|
|
|
+ double ydgzcs = 0.0;
|
|
|
+ double ydxqcs = 0.0;
|
|
|
+ double ydxqjsl = 0.0;
|
|
|
+ if (liminatedefects.size() > 0) {
|
|
|
+ ydgzcs = liminatedefects.get(0).getFaultCount();
|
|
|
+ ydxqcs = liminatedefects.get(0).getRightCount();
|
|
|
+ ydxqjsl = StringUtils.round(liminatedefects.get(0).getRate(), 2);
|
|
|
+ }
|
|
|
+ double nxqjsl = yearliminatedefects.size() > 0 ? StringUtils.round(yearliminatedefects.get(0).getRate(), 2) : 0.0;
|
|
|
+ double syxqjsl = syliminatedefects.size() > 0 ? StringUtils.round(syliminatedefects.get(0).getRate(), 2) : 0.0;
|
|
|
+
|
|
|
+ double xqjsl_hb = StringUtils.round((ydxqjsl -syxqjsl) /syxqjsl * 100,2);
|
|
|
+ map.put("消缺及时率", "月度故障次数:" + ydgzcs + "次\n" +
|
|
|
+ "月度消缺及时次数:" + ydxqcs + "次\n" +
|
|
|
+ "月度消缺及时率:" + ydxqjsl + "%\n" +
|
|
|
+ "年度消缺及时率:" + nxqjsl + "%\n" +
|
|
|
+ "与上月对比:月度环比" + xqjsl_hb + "%(±)");
|
|
|
+
|
|
|
+
|
|
|
+ double wfzcs = 0.0;
|
|
|
+ double sfzcs = 0.0;
|
|
|
+ double swfzcs = 0.0;
|
|
|
+ double esfzcs = 0.0;
|
|
|
+
|
|
|
+ double wfzzhl = 0.0;
|
|
|
+ double sfzzhl = 0.0;
|
|
|
+ double swfzzhl = 0.0;
|
|
|
+ double esfzzhl = 0.0;
|
|
|
+
|
|
|
+ if (threestateRateList.size() > 0) {
|
|
|
+ // 累加计算,检查列表是否为 null
|
|
|
+ wfzcs = threestateRateList.stream()
|
|
|
+ .filter(o -> o != null)
|
|
|
+ .mapToDouble(o -> o.getTimerate5())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ sfzcs = threestateRateList.stream()
|
|
|
+ .filter(o -> o != null)
|
|
|
+ .mapToDouble(o -> o.getTimerate6())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ swfzcs = threestateRateList.stream()
|
|
|
+ .filter(o -> o != null)
|
|
|
+ .mapToDouble(o -> o.getTimerate7())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ esfzcs = threestateRateList.stream()
|
|
|
+ .filter(o -> o != null)
|
|
|
+ .mapToDouble(o -> o.getTimerate8())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ wfzzhl = threestateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate14() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate5() / o.getTimerate14() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ sfzzhl = threestateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate14() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate6() / o.getTimerate14() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ swfzzhl = threestateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate14() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate7() / o.getTimerate14() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+
|
|
|
+ esfzzhl = threestateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate14() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate8() / o.getTimerate14() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+ }
|
|
|
+
|
|
|
+ double[] ztzhbot_cs = new double[3];
|
|
|
+ String[] ztzhbot_id = new String[3];
|
|
|
+
|
|
|
+ for (int i = 0; i < threestateRatebotList.size(); i++) {
|
|
|
+ var item = threestateRatebotList.get(i);
|
|
|
+ ztzhbot_id[i] = item.getWindturbineId();
|
|
|
+ ztzhbot_cs[i] = item.getTimerate5();
|
|
|
+ }
|
|
|
+ double sy_ztzhl = 0.0;
|
|
|
+ if (threesystateRateList.size()>0){
|
|
|
+ sy_ztzhl = threesystateRateList.stream()
|
|
|
+ .filter(o -> o != null && o.getTimerate14() != 0)
|
|
|
+ .mapToDouble(o -> o.getTimerate5() / o.getTimerate14() * 100)
|
|
|
+ .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
|
|
|
+ .sum();
|
|
|
+ }
|
|
|
+
|
|
|
+ double ztzhl_hb = StringUtils.round((wfzzhl-sy_ztzhl) / sy_ztzhl * 100,2);
|
|
|
+// map.put("状态转换率", "大于3米风速转换次数及转换率:\n" +
|
|
|
+// "5分钟:转换次数为"+wfzcs+"次,转换率为"+wfzzhl+"%\n" +
|
|
|
+// "10分钟:转换次数为"+sfzcs+"次,转换率为"+sfzzhl+"%\n" +
|
|
|
+// "15分钟:转换次数为"+swfzcs+"次,转换率为"+swfzzhl+"%\n" +
|
|
|
+// "20分钟:转换次数为"+esfzcs+"次,转换率为"+esfzzhl+"%\n" +
|
|
|
+// "月度5分钟转换次数排名最低的三台风机:"+ztzhbot_id[0]+"号("+ztzhbot_cs[0]+"次)、"+ztzhbot_id[1]+"号("+ztzhbot_cs[1]+"次)、"+ztzhbot_id[2]+"号("+ztzhbot_cs[2]+"次)\n" +
|
|
|
+// "与上月对比:月度5分钟转换率环比"+ztzhl_hb+"%(±)");
|
|
|
+
|
|
|
+ map.put("状态转换率-大于3米风速","大于3米风速转换次数及转换率:\n" +
|
|
|
+ "5分钟:转换次数为"+wfzcs+"次,转换率为"+wfzzhl+"%\n" +
|
|
|
+ "10分钟:转换次数为"+sfzcs+"次,转换率为"+sfzzhl+"%\n" +
|
|
|
+ "15分钟:转换次数为"+swfzcs+"次,转换率为"+swfzzhl+"%\n" +
|
|
|
+ "20分钟:转换次数为"+esfzcs+"次,转换率为"+esfzzhl+"%");
|
|
|
+ map.put("状态转换率-月度5分钟","月度5分钟转换次数排名最低的三台风机:"+ztzhbot_id[0]+"号("+ztzhbot_cs[0]+"次)、"+ztzhbot_id[1]+"号("+ztzhbot_cs[1]+"次)、"+ztzhbot_id[2]+"号("+ztzhbot_cs[2]+"次)");
|
|
|
+ map.put("状态转换率-与上月对比","与上月对比:月度5分钟转换率环比"+ztzhl_hb+"%(±)");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通用的ID匹配和nemCode赋值方法
|
|
|
+ * 将wtls集合中与list匹配项的nemCode赋值给list的指定字段
|
|
|
+ * 匹配条件:wtls的id与list的指定ID字段相等
|
|
|
+ *
|
|
|
+ * @param wtls 风机基础信息集合
|
|
|
+ * @param list 目标信息集合
|
|
|
+ * @param idGetter 获取ID的函数
|
|
|
+ * @param idSetter 设置ID的函数
|
|
|
+ * @param <T> 目标信息类型
|
|
|
+ */
|
|
|
+ public <T> void setIdFromNemCode(List<ProBasicEquipment> wtls, List<T> list,
|
|
|
+ Function<T, String> idGetter, BiConsumer<T, String> idSetter) {
|
|
|
+ for (T item : list) {
|
|
|
+ String id = idGetter.apply(item);
|
|
|
+ if (id == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (ProBasicEquipment equipment : wtls) {
|
|
|
+ if (id.equals(equipment.getId())) {
|
|
|
+ idSetter.accept(item, equipment.getNemCode());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 通用方法,处理一组集合的 setIdFromNemCode 调用
|
|
|
+ private <T> void applySetIdFromNemCode(
|
|
|
+ List<ProBasicEquipment> wtls,
|
|
|
+ List<List<T>> collections,
|
|
|
+ Function<T, String> idGetter,
|
|
|
+ BiConsumer<T, String> idSetter) {
|
|
|
+ for (List<T> collection : collections) {
|
|
|
+ setIdFromNemCode(wtls, collection, idGetter, idSetter);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|