|
@@ -915,7 +915,7 @@ public class SingleAnalysisService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Map<String, List<SingleAnalysisVo>> SingleAnalysisListByWtIdDetiml(String wtId, Date beginDate, Date endDate) {
|
|
|
+ public Map<String, List<SingleAnalysisVo>> SingleAnalysisListByWtIdDetiml2(String wtId, Date beginDate, Date endDate) {
|
|
|
|
|
|
Map<String, List<SingleAnalysisVo>> map = new HashMap<>();
|
|
|
List<SingleAnalysisVo> fdlfsls = new ArrayList<>();
|
|
@@ -1108,6 +1108,209 @@ public class SingleAnalysisService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public Map<String, List<SingleAnalysisVo>> SingleAnalysisListByWtIdDetiml(String wtId, Date beginDate, Date endDate) {
|
|
|
+
|
|
|
+ Map<String, List<SingleAnalysisVo>> map = new HashMap<>();
|
|
|
+ List<SingleAnalysisVo> fdlfsls = new ArrayList<>();
|
|
|
+ List<SingleAnalysisVo> wsls = new ArrayList<>();
|
|
|
+ List<SingleAnalysisVo> jfpldjsjls = new ArrayList<>();
|
|
|
+ if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Map<Long, ProEconEquipmentInfoDay1>> day1map = new HashMap<>();
|
|
|
+ Map<String, Map<Long, ProEconEquipmentInfoDay2>> day2map = new HashMap<>();
|
|
|
+
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("windturbine_id", wtId).ge("record_date", beginDate)
|
|
|
+ .le("record_date", endDate)
|
|
|
+ .orderByAsc("record_date");;
|
|
|
+ List<ProEconEquipmentInfoDay1> wtday1ls = proEconEquipmentInfoDay1Service.list(queryWrapper);
|
|
|
+ if (!wtday1ls.isEmpty()) {
|
|
|
+ for (ProEconEquipmentInfoDay1 wtday1 : wtday1ls) {
|
|
|
+ if (day1map.containsKey(wtday1.getWindturbineId())) {
|
|
|
+ Map<Long, ProEconEquipmentInfoDay1> tempmap = day1map.get(wtday1.getWindturbineId());
|
|
|
+ tempmap.put(wtday1.getRecordDate().getTime(), wtday1);
|
|
|
+ day1map.put(wtId, tempmap);
|
|
|
+ } else {
|
|
|
+ Map<Long, ProEconEquipmentInfoDay1> tempmap = new HashMap<>();
|
|
|
+ tempmap.put(wtday1.getRecordDate().getTime(), wtday1);
|
|
|
+ day1map.put(wtId, tempmap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("windturbine_id", wtId).ge("record_date", beginDate)
|
|
|
+ .le("record_date", endDate)
|
|
|
+ .orderByAsc("record_date");;
|
|
|
+ List<ProEconEquipmentInfoDay2> wtday2ls = proEconEquipmentInfoDay2Service.list(queryWrapper2);
|
|
|
+ if (!wtday2ls.isEmpty()) {
|
|
|
+ for (ProEconEquipmentInfoDay2 wtday2 : wtday2ls) {
|
|
|
+ if (day2map.containsKey(wtday2.getWindturbineId())) {
|
|
|
+ Map<Long, ProEconEquipmentInfoDay2> tempmap = day2map.get(wtday2.getWindturbineId());
|
|
|
+ tempmap.put(wtday2.getRecordDate().getTime(), wtday2);
|
|
|
+ day2map.put(wtId, tempmap);
|
|
|
+ } else {
|
|
|
+ Map<Long, ProEconEquipmentInfoDay2> tempmap = new HashMap<>();
|
|
|
+ tempmap.put(wtday2.getRecordDate().getTime(), wtday2);
|
|
|
+ day2map.put(wtId, tempmap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper4 = new QueryWrapper<>();
|
|
|
+ queryWrapper4.eq("windturbine_id", wtId).ge("record_date", beginDate)
|
|
|
+ .le("record_date", endDate)
|
|
|
+ .orderByAsc("record_date");
|
|
|
+ List<ProEconEquipmentInfoDay4> wtday4ls = proEconEquipmentInfoDay4Service.list(queryWrapper4);
|
|
|
+ ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
|
|
|
+ ProBasicPowerstation wp = CacheContext.wpmap.get(wt.getWindpowerstationId());
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wtday2ls) && !wtday2ls.isEmpty()) {
|
|
|
+
|
|
|
+ for (ProEconEquipmentInfoDay2 wtd : wtday2ls) {
|
|
|
+
|
|
|
+ SingleAnalysisVo vo = new SingleAnalysisVo();
|
|
|
+
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+
|
|
|
+ c.setTime(wtd.getRecordDate());
|
|
|
+ int dayTimes = 24;//风机日历小时合计
|
|
|
+
|
|
|
+
|
|
|
+ if (day1map.containsKey(wtd.getWindturbineId())) {
|
|
|
+ Map<Long, ProEconEquipmentInfoDay1> map1 = day1map.get(wtd.getWindturbineId());
|
|
|
+ if (map1.containsKey(wtd.getRecordDate().getTime())) {
|
|
|
+ ProEconEquipmentInfoDay1 daypo = map1.get(wtd.getRecordDate().getTime());
|
|
|
+ double fdl = null != daypo.getRfdl() ? daypo.getRfdl() : 0.0;//风机发电量合计
|
|
|
+ if (CacheContext.modelMap.containsKey(wt.getModelId())) {
|
|
|
+ ProEconEquipmentmodel model = CacheContext.modelMap.get(wt.getModelId());
|
|
|
+ double lyxs = new BigDecimal(fdl).divide(new BigDecimal(model.getPowerProduction()), 2, RoundingMode.HALF_UP).doubleValue();
|
|
|
+ vo.setLyxs(lyxs);
|
|
|
+ }
|
|
|
+
|
|
|
+ fdl = new BigDecimal(fdl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
|
|
|
+ double fs = null != daypo.getRpjfs() ? daypo.getRpjfs() : 0.0;//风机平均风速
|
|
|
+ vo.setFdl(StringUtils.round(fdl, 2));
|
|
|
+ vo.setFs(StringUtils.round(fs, 2));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ double yxxs = null != wtd.getRyxxs() ? wtd.getRyxxs() : 0.0;//风机运行小时合计
|
|
|
+ double gzxs = null != wtd.getRgztjxs() ? wtd.getRgztjxs() : 0.0;//风机故障小时合计
|
|
|
+ double jxxs = null != wtd.getRjxtjxs() ? wtd.getRjxtjxs() : 0.0;//风机检修小时合计
|
|
|
+ double tjxs = null != wtd.getRxdxs() ? wtd.getRxdxs() : 0.0;//风限电小时合计
|
|
|
+ double zdxs = null != wtd.getRtxzdxs() ? wtd.getRtxzdxs() : 0.0;//风机中断小时合计
|
|
|
+
|
|
|
+ vo.setWindPowerStationId(wt.getWindpowerstationId());
|
|
|
+ vo.setWindPowerStationName(wp.getName());
|
|
|
+ vo.setWindturbineName(wt.getName());
|
|
|
+ vo.setWindturbineid(wt.getId());
|
|
|
+ vo.setRecorddate(wtd.getRecordDate());
|
|
|
+
|
|
|
+
|
|
|
+ vo.setYxxs(StringUtils.round(yxxs, 2));
|
|
|
+ vo.setGzxs(StringUtils.round(gzxs, 2));
|
|
|
+ vo.setJxxs(StringUtils.round(jxxs, 2));
|
|
|
+ vo.setTjxs(StringUtils.round(tjxs, 2));
|
|
|
+ vo.setZdxs(StringUtils.round(zdxs, 2));
|
|
|
+ vo.setRlxs(StringUtils.round(dayTimes, 2));
|
|
|
+
|
|
|
+ fdlfsls.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wtday1ls) && !wtday1ls.isEmpty()) {
|
|
|
+ for (ProEconEquipmentInfoDay1 wtd : wtday1ls) {
|
|
|
+ SingleAnalysisVo vo = new SingleAnalysisVo();
|
|
|
+ double gzss = null != wtd.getRgzssdl() ? wtd.getRgzssdl() : 0.0;//风机故障损失合计
|
|
|
+ double jxss = null != wtd.getRjxssdl() ? wtd.getRjxssdl() : 0.0;//风机检修损失合计
|
|
|
+ double xdss = null != wtd.getRxdtjssdl() ? wtd.getRxdtjssdl() : 0.0;//风机限电损失合计
|
|
|
+ double xnss = null != wtd.getRxnssdl() ? wtd.getRxnssdl() : 0.0;//风机性能损失时合计
|
|
|
+ double ycwsldwssdl = null != wtd.getRcwsldwssdl() ? wtd.getRcwsldwssdl() : 0.0;//场外受累电网损失电量
|
|
|
+ double ycwsltqssdl = null != wtd.getRcwsltqssdl() ? wtd.getRcwsldwssdl() : 0.0;//场外受累天气损失电量
|
|
|
+ double slss = StringUtils.round(ycwsldwssdl + ycwsltqssdl, 2);
|
|
|
+
|
|
|
+
|
|
|
+ vo.setWindPowerStationId(wt.getWindpowerstationId());
|
|
|
+ vo.setWindPowerStationName(wp.getName());
|
|
|
+ vo.setWindturbineName(wt.getName());
|
|
|
+ vo.setWindturbineid(wt.getId());
|
|
|
+ vo.setRecorddate(wtd.getRecordDate());
|
|
|
+
|
|
|
+ vo.setGzss(StringUtils.round(gzss, 2));
|
|
|
+ vo.setJxss(StringUtils.round(jxss, 2));
|
|
|
+ vo.setXdss(StringUtils.round(xdss, 2));
|
|
|
+ vo.setXnss(StringUtils.round(xnss, 2));
|
|
|
+ vo.setSlss(StringUtils.round(slss, 2));
|
|
|
+ wsls.add(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wtday4ls) && !wtday4ls.isEmpty()) {
|
|
|
+
|
|
|
+ for (ProEconEquipmentInfoDay4 wtd : wtday4ls) {
|
|
|
+
|
|
|
+ SingleAnalysisVo vo = new SingleAnalysisVo();
|
|
|
+
|
|
|
+ vo.setRecorddate(wtd.getRecordDate());
|
|
|
+
|
|
|
+ double jfsc = null != wtd.getRjfsc() ? wtd.getRjfsc() : 0.0;//静风时长
|
|
|
+ double jfpl = new BigDecimal(jfsc).divide(new BigDecimal(24), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();//静风频率
|
|
|
+
|
|
|
+ vo.setJfpl(StringUtils.round(jfpl, 2));
|
|
|
+ if (day2map.containsKey(wtd.getWindturbineId())) {
|
|
|
+ Map<Long, ProEconEquipmentInfoDay2> map2 = day2map.get(wtd.getWindturbineId());
|
|
|
+ if (map2.containsKey(wtd.getRecordDate().getTime())) {
|
|
|
+ ProEconEquipmentInfoDay2 daypo = map2.get(wtd.getRecordDate().getTime());
|
|
|
+ vo.setTjxs(daypo.getRdjxsmx());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ vo.setWindPowerStationId(wt.getWindpowerstationId());
|
|
|
+ vo.setWindPowerStationName(wp.getName());
|
|
|
+ vo.setWindturbineName(wt.getName());
|
|
|
+ vo.setWindturbineid(wt.getId());
|
|
|
+
|
|
|
+
|
|
|
+ jfpldjsjls.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("ff", fdlfsls);//发电量和风速
|
|
|
+ map.put("ws", wsls);//五项损失,绑定五个
|
|
|
+ map.put("jd", jfpldjsjls);//静风频率和待机时间
|
|
|
+ }
|
|
|
+
|
|
|
+ List<TurbineInfoDay> turbineSingle = turbineInfoDayService.getTurbineSingleList(wtId, beginDate, endDate);
|
|
|
+ Map<Date, TurbineInfoDay> col= turbineSingle.stream().collect(Collectors.toMap(TurbineInfoDay::getRecordDate, Function.identity()));
|
|
|
+ List<SingleAnalysisVo> ff = map.get("ff").stream().collect(Collectors.toList());
|
|
|
+ List<SingleAnalysisVo> ws = map.get("ws").stream().collect(Collectors.toList());
|
|
|
+ List<SingleAnalysisVo> jd = map.get("jd").stream().collect(Collectors.toList());
|
|
|
+ ff.forEach(f -> {
|
|
|
+ TurbineInfoDay tb = col.get(f.getRecorddate());
|
|
|
+ f.setFdl(NumberUtil.round(tb.getRfdl() , 2).doubleValue());
|
|
|
+ f.setFs(NumberUtil.round(tb.getPjfs(), 2).doubleValue());
|
|
|
+ });
|
|
|
+ ws.forEach(w -> {
|
|
|
+ TurbineInfoDay tb = col.get(w.getRecorddate());
|
|
|
+ w.setSlss(NumberUtil.round(tb.getSlss(), 2).doubleValue());
|
|
|
+ w.setXnss(NumberUtil.round(tb.getXnss(), 2).doubleValue());
|
|
|
+ w.setXdss(NumberUtil.round(tb.getXdss(), 2).doubleValue());
|
|
|
+ w.setJxss(NumberUtil.round(tb.getJhjxss(), 2).doubleValue());
|
|
|
+ w.setGzss(NumberUtil.round(tb.getGzss(), 2).doubleValue());
|
|
|
+ });
|
|
|
+ jd.forEach(j -> {
|
|
|
+ TurbineInfoDay tb = col.get(j.getRecorddate());
|
|
|
+ j.setJfpl(NumberUtil.round(tb.getJfpl(), 2).doubleValue());
|
|
|
+ j.setDjxs(NumberUtil.round(tb.getDjMin() / 60, 2).doubleValue());
|
|
|
+ });
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
public SingleAnalysisVo SingleAnalysisListByWtId(SingleAnalysisVo vo1, SingleAnalysisVo vo2) {
|
|
|
|
|
|
SingleAnalysisVo vo = new SingleAnalysisVo();
|
|
@@ -1377,35 +1580,35 @@ public class SingleAnalysisService {
|
|
|
.apply("to_char(record_date,'YYYY-MM')='" + date + "'");
|
|
|
List<TurbineInfoDay> list = turbineInfoDayService.list(qw);
|
|
|
double rfdl = list.stream().mapToDouble(TurbineInfoDay::getRfdl).sum();
|
|
|
- byzb.setFdl(NumberUtil.round(rfdl/1000,2).doubleValue());
|
|
|
+ byzb.setFdl(NumberUtil.round(rfdl / 1000, 2).doubleValue());
|
|
|
double pjfs = list.stream().mapToDouble(TurbineInfoDay::getPjfs).average().orElse(0.0);
|
|
|
- byzb.setFs(NumberUtil.round(pjfs,2).doubleValue());
|
|
|
+ byzb.setFs(NumberUtil.round(pjfs, 2).doubleValue());
|
|
|
double gzss = list.stream().mapToDouble(TurbineInfoDay::getGzss).sum();
|
|
|
- byzb.setGzss(NumberUtil.round(gzss/1000,2).doubleValue());
|
|
|
+ byzb.setGzss(NumberUtil.round(gzss / 1000, 2).doubleValue());
|
|
|
double jhjxss = list.stream().mapToDouble(TurbineInfoDay::getJhjxss).sum();
|
|
|
- byzb.setJxss(NumberUtil.round(jhjxss/1000,2).doubleValue());
|
|
|
+ byzb.setJxss(NumberUtil.round(jhjxss / 1000, 2).doubleValue());
|
|
|
double xdss = list.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
|
|
|
- byzb.setXdss(NumberUtil.round(xdss/1000,2).doubleValue());
|
|
|
+ byzb.setXdss(NumberUtil.round(xdss / 1000, 2).doubleValue());
|
|
|
double xnss = list.stream().mapToDouble(TurbineInfoDay::getXnss).sum();
|
|
|
- byzb.setXnss(NumberUtil.round(xnss/1000,2).doubleValue());
|
|
|
+ byzb.setXnss(NumberUtil.round(xnss / 1000, 2).doubleValue());
|
|
|
double slss = list.stream().mapToDouble(TurbineInfoDay::getXnss).sum();
|
|
|
- byzb.setSlss(NumberUtil.round(slss/1000,2).doubleValue());
|
|
|
+ byzb.setSlss(NumberUtil.round(slss / 1000, 2).doubleValue());
|
|
|
double llfdl = list.stream().mapToDouble(TurbineInfoDay::getXnss).sum();
|
|
|
- byzb.setLlfdl(NumberUtil.round(llfdl/1000,2).doubleValue());
|
|
|
+ byzb.setLlfdl(NumberUtil.round(llfdl / 1000, 2).doubleValue());
|
|
|
double gzmin = list.stream().mapToDouble(TurbineInfoDay::getGzMin).sum();
|
|
|
- byzb.setGzxs(NumberUtil.round(gzmin/60,2).doubleValue());
|
|
|
+ byzb.setGzxs(NumberUtil.round(gzmin / 60, 2).doubleValue());
|
|
|
double jxmin = list.stream().mapToDouble(TurbineInfoDay::getJxMin).sum();
|
|
|
- byzb.setJxxs(NumberUtil.round(jxmin/60,2).doubleValue());
|
|
|
+ byzb.setJxxs(NumberUtil.round(jxmin / 60, 2).doubleValue());
|
|
|
double lxmin = list.stream().mapToDouble(TurbineInfoDay::getLxMin).sum();
|
|
|
- byzb.setZdxs(NumberUtil.round(lxmin/60,2).doubleValue());
|
|
|
+ byzb.setZdxs(NumberUtil.round(lxmin / 60, 2).doubleValue());
|
|
|
double yxmin = list.stream().mapToDouble(TurbineInfoDay::getYxMin).sum();
|
|
|
- byzb.setYxxs(NumberUtil.round(yxmin/60,2).doubleValue());
|
|
|
+ byzb.setYxxs(NumberUtil.round(yxmin / 60, 2).doubleValue());
|
|
|
double djmin = list.stream().mapToDouble(TurbineInfoDay::getDjMin).sum();
|
|
|
- byzb.setDjxs(NumberUtil.round(djmin/60,2).doubleValue());
|
|
|
+ byzb.setDjxs(NumberUtil.round(djmin / 60, 2).doubleValue());
|
|
|
double sblyxs = list.stream().mapToDouble(TurbineInfoDay::getLyxs).sum();
|
|
|
- byzb.setLyxs(NumberUtil.round(sblyxs,2).doubleValue());
|
|
|
+ byzb.setLyxs(NumberUtil.round(sblyxs, 2).doubleValue());
|
|
|
double sbklyl = list.stream().mapToDouble(TurbineInfoDay::getKlyl).average().orElse(0.0);
|
|
|
- byzb.setSbklyl(NumberUtil.round(sbklyl,2).doubleValue());
|
|
|
+ byzb.setSbklyl(NumberUtil.round(sbklyl, 2).doubleValue());
|
|
|
return byzb;
|
|
|
}
|
|
|
}
|