|
@@ -208,7 +208,8 @@ public class AnalysisNewService {
|
|
|
analysissubtablebottom.setRecorddate(DateUtils.parseDate(day));
|
|
|
analysissubtablebottom.setStopcode(m.getNow());
|
|
|
analysissubtablebottom.setStopcodemodify(m.getNow());
|
|
|
- double dayvalue = DoubleUtils.GetResult(DoubleUtils.GetResult(m.getNow(),m.getDay(),"-"),meterMap.get(m.getMeterid()).getMagnification(),"*");
|
|
|
+ double yestdayNow = getYestdayNow(day,m.getMeterid());
|
|
|
+ double dayvalue = DoubleUtils.GetResult(DoubleUtils.GetResult(m.getNow(),yestdayNow,"-"),meterMap.get(m.getMeterid()).getMagnification(),"*");
|
|
|
analysissubtablebottom.setDayvalue(dayvalue);
|
|
|
analysissubtablebottom.setDayvaluemodify(dayvalue);
|
|
|
analysissubtablebottomService.save(analysissubtablebottom);
|
|
@@ -217,6 +218,65 @@ public class AnalysisNewService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 计算单场电量
|
|
|
+ *
|
|
|
+ * @param beginDate
|
|
|
+ * @param endDate
|
|
|
+ */
|
|
|
+ public void saveAnalysisGfTableBottomone(String beginDate, String endDate,String wpid) {
|
|
|
+ Map<String, Meterpoint2> meterMap = CacheContext.meterMap;
|
|
|
+ List<String> days = getDays(beginDate, endDate);
|
|
|
+ for (String day : days) {
|
|
|
+// Map<String, Object> deleteparam = new HashMap<>();
|
|
|
+// deleteparam.put("recorddate", DateUtils.parseDate(day));
|
|
|
+// analysissubtablebottomService.removeByMap(deleteparam);
|
|
|
+
|
|
|
+ QueryWrapper<Analysissubtablebottom> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("recorddate", DateUtils.parseDate(day)).like("wpid","GDC");
|
|
|
+ analysissubtablebottomService.remove(queryWrapper);
|
|
|
+
|
|
|
+ Map<String, Object> deleteparam = new HashMap<>();
|
|
|
+ Date selDate = DateUtils.parseDate(day);
|
|
|
+ deleteparam.put("recorddate", DateUtils.addDays(selDate,1));
|
|
|
+
|
|
|
+ List<Meterpointvalue> meterpointvalues = meterpointvalueService.listByMap(deleteparam);
|
|
|
+ List<Meterpointvalue> collect = meterpointvalues.stream().filter(i -> meterMap.get(i.getMeterid()) != null).filter(i -> meterMap.get(i.getMeterid()).getDescription() != null).collect(Collectors.toList());
|
|
|
+
|
|
|
+ Analysismain mainValues = getMainValues(day, wpid);
|
|
|
+ collect.stream().filter(i -> meterMap.get(i.getMeterid()).getWindpowerstationid().equals(wpid)).forEach(m -> {
|
|
|
+ Analysissubtablebottom analysissubtablebottom = new Analysissubtablebottom();
|
|
|
+ analysissubtablebottom.setTid(mainValues.getId());
|
|
|
+ analysissubtablebottom.setWpid(wpid);
|
|
|
+ analysissubtablebottom.setMeterid(m.getMeterid());
|
|
|
+ analysissubtablebottom.setMetername(meterMap.get(m.getMeterid()).getDescription());
|
|
|
+ analysissubtablebottom.setRecorddate(DateUtils.parseDate(day));
|
|
|
+ analysissubtablebottom.setStopcode(m.getNow());
|
|
|
+ analysissubtablebottom.setStopcodemodify(m.getNow());
|
|
|
+ double yestdayNow = getYestdayNow(day,m.getMeterid());
|
|
|
+ double dayvalue = DoubleUtils.GetResult(DoubleUtils.GetResult(m.getNow(),yestdayNow,"-"),meterMap.get(m.getMeterid()).getMagnification(),"*");
|
|
|
+ analysissubtablebottom.setDayvalue(dayvalue);
|
|
|
+ analysissubtablebottom.setDayvaluemodify(dayvalue);
|
|
|
+ analysissubtablebottomService.save(analysissubtablebottom);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取昨天的止码(针对光伏不过12点就计算,起码取昨天止码)
|
|
|
+ * @param day
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private double getYestdayNow(String day,String meterid) {
|
|
|
+ QueryWrapper<Analysissubtablebottom> queryWrapper = new QueryWrapper<>();
|
|
|
+ Date yestday = DateUtils.getYestday(DateUtils.parseDate(day));
|
|
|
+ queryWrapper.eq("recorddate",yestday);
|
|
|
+ queryWrapper.eq("meterid",meterid);
|
|
|
+ Analysissubtablebottom one = analysissubtablebottomService.getOne(queryWrapper);
|
|
|
+ return null != one ? one.getStopcodemodify() :0.0;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存风电项目表
|
|
|
*
|
|
@@ -538,10 +598,34 @@ public class AnalysisNewService {
|
|
|
can.setRecorddate(DateUtils.parseDate(day));
|
|
|
|
|
|
can.setFdl(generatingcapacity / 10000);
|
|
|
- can.setSwdl(fcfdl != 0.0 ? (generatingcapacity / fcfdl * fcswfdl) / 10000 : 0.0);
|
|
|
- can.setGwdl(fcfdl != 0.0 ? (generatingcapacity / fcfdl * fcgwfdl) / 10000 : 0.0);
|
|
|
- can.setFdcydl(fcfdl != 0.0 ? (generatingcapacity / fcfdl * fczyb) / 10000 : 0.0);
|
|
|
+ if (project.getWindpowerstationid().equals("HZJ_GDC")){
|
|
|
+ Double sfwyx = 0.0;
|
|
|
+ Optional<Analysissubtablebottom> sfwyxFirst = currentDayBdz.stream().filter(i -> i.getMeterid().equals("SBQDJL.NX_GD_SBQF_DD_P1_L1_001_ZXYG109")).findFirst();
|
|
|
+ if (sfwyxFirst.isPresent()){
|
|
|
+ sfwyx = sfwyxFirst.get().getDayvaluemodify();
|
|
|
+ }
|
|
|
+ List<String> ffdls = wpmeterMap.get("SBQ_FDC").stream()
|
|
|
+ .filter(i -> (
|
|
|
+ i.getProjectid().equals("SBQ04_GC") && i.getMetersort().equals("主") && i.getMetertype().equals("进线") && i.getDisplaytype().equals("正向有功")
|
|
|
+ )).map(i -> i.getId()).collect(Collectors.toList());
|
|
|
+ double ffdl = 0;
|
|
|
+ for (String meterid : fdls) {
|
|
|
+ ffdl += currentDay.stream().filter(i -> i.getMeterid().equals(meterid)).findFirst().isPresent() ? currentDay.stream().filter(i -> i.getMeterid().equals(meterid)).findFirst().get().getDayvaluemodify().doubleValue() : 0.0;
|
|
|
+ }
|
|
|
+ can.setSwdl(ffdl!=0.0?sfwyx*(generatingcapacity/ffdl)/10000:0.0);
|
|
|
+
|
|
|
|
|
|
+ Double gwdls = 0.0;
|
|
|
+ Optional<Analysissubtablebottom> gwdlFirst = currentDayBdz.stream().filter(i -> i.getMeterid().equals("HZJDJL.NX_GD_HZJG_DD_P1_L1_001_ZXYG001")).findFirst();
|
|
|
+ if (sfwyxFirst.isPresent()){
|
|
|
+ gwdls = sfwyxFirst.get().getDayvaluemodify();
|
|
|
+ }
|
|
|
+ can.setGwdl(gwdls/10000);
|
|
|
+ }else{
|
|
|
+ can.setSwdl(fcfdl != 0.0 ? (generatingcapacity / fcfdl * fcswfdl) / 10000 : 0.0);
|
|
|
+ can.setGwdl(fcfdl != 0.0 ? (generatingcapacity / fcfdl * fcgwfdl) / 10000 : 0.0);
|
|
|
+ }
|
|
|
+ can.setFdcydl(fcfdl != 0.0 ? (generatingcapacity / fcfdl * fczyb) / 10000 : 0.0);
|
|
|
QueryWrapper<Windpowerinfoday> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("recorddate", DateUtils.parseDate(day));
|
|
|
queryWrapper.eq("foreignkeyid", project.getId());
|