|
@@ -0,0 +1,732 @@
|
|
|
+package com.gyee.benchmarkinghistroy.service.infoday;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.gyee.benchmarkinghistroy.init.CacheContext;
|
|
|
+import com.gyee.benchmarkinghistroy.model.auto.*;
|
|
|
+import com.gyee.benchmarkinghistroy.service.auto.IWindpowerinfoday3Service;
|
|
|
+import com.gyee.benchmarkinghistroy.service.auto.IWindpowerinfodayService;
|
|
|
+import com.gyee.benchmarkinghistroy.service.auto.IWindturbineinfoday3Service;
|
|
|
+import com.gyee.benchmarkinghistroy.service.auto.IWindturbineinfodayService;
|
|
|
+import com.gyee.benchmarkinghistroy.util.realtimesource.IEdosUtil;
|
|
|
+import com.gyee.common.contant.Contant;
|
|
|
+import com.gyee.common.model.PointData;
|
|
|
+import com.gyee.common.model.StringUtils;
|
|
|
+import com.gyee.common.util.DateUtils;
|
|
|
+import com.gyee.common.util.DoubleUtils;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ClassName : InfodayService
|
|
|
+ * @Author : xieshengjie
|
|
|
+ * @Date: 2022/5/10 14:14
|
|
|
+ * @Description : 存储信息表
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class InfodayService {
|
|
|
+ @Resource
|
|
|
+ private IWindturbineinfodayService windturbineinfodayService;
|
|
|
+ @Resource
|
|
|
+ private IWindturbineinfoday3Service windturbineinfoday3Service;
|
|
|
+ @Resource
|
|
|
+ private IWindpowerinfodayService windpowerinfodayService;
|
|
|
+ @Resource
|
|
|
+ private IWindpowerinfoday3Service windpowerinfoday3Service;
|
|
|
+ @Resource
|
|
|
+ private IEdosUtil edosUtil;
|
|
|
+
|
|
|
+
|
|
|
+ public void saveWindturbineinfoday(String beginDate,String endDate){
|
|
|
+ Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap = CacheContext.wtpAimap;
|
|
|
+ List<Windturbine> wtls = CacheContext.wtls;
|
|
|
+ Map<String, Double> wtrlmap = CacheContext.wtrlmap;
|
|
|
+ List<String> days = DateUtils.getDays(beginDate, endDate);
|
|
|
+
|
|
|
+ days.stream().forEach(day->{
|
|
|
+ List<Windturbineinfoday> resultList = new ArrayList<>();
|
|
|
+ Date samedayZero = DateUtils.getSamedayZero(day);
|
|
|
+ Date addDays = DateUtils.addDays(samedayZero, 1);
|
|
|
+ Date endOfDay = DateUtils.getEndOfDay(samedayZero);
|
|
|
+ QueryWrapper<Windturbineinfoday> delQW = new QueryWrapper<>();
|
|
|
+ delQW.eq("recorddate",DateUtils.parseDate(day));
|
|
|
+ windturbineinfodayService.remove(delQW);
|
|
|
+
|
|
|
+ wtls.stream().forEach(wt->{
|
|
|
+ Windturbineinfoday windturbineinfoday = new Windturbineinfoday();
|
|
|
+ Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
|
|
|
+ Windturbinetestingpointnew ztmxpoint = windturbinetestingpointnewMap.get(Contant.FJ5T);
|
|
|
+ Windturbinetestingpointnew fdlPoint = windturbinetestingpointnewMap.get(Contant.RFDL);
|
|
|
+ Windturbinetestingpointnew yfdlPoint = windturbinetestingpointnewMap.get(Contant.YFDL);
|
|
|
+ Windturbinetestingpointnew nfdlPoint = windturbinetestingpointnewMap.get(Contant.NFDL);
|
|
|
+ Windturbinetestingpointnew speedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
|
|
|
+ Windturbinetestingpointnew powerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
|
|
|
+ Windturbinetestingpointnew ssfsPoint = windturbinetestingpointnewMap.get(Contant.AI022);
|
|
|
+ Windturbinetestingpointnew ssglPoint = windturbinetestingpointnewMap.get(Contant.AI130);
|
|
|
+ windturbineinfoday.setWindturbineid(wt.getId());
|
|
|
+
|
|
|
+ List<PointData> ztmxSnap = null;
|
|
|
+ List<PointData> ssfsSnap = null;
|
|
|
+ List<PointData> maxspeedStat = null;
|
|
|
+ List<PointData> minspeedtStat = null;
|
|
|
+ List<PointData> maxpowerStat = null;
|
|
|
+ List<PointData> minpowerStat = null;
|
|
|
+ double scadafdl = 0;
|
|
|
+ double scadayfdl = 0;
|
|
|
+ double scadanfdl = 0;
|
|
|
+ double speed = 0;
|
|
|
+ double power = 0;
|
|
|
+ double maxspeed = 0;
|
|
|
+ double minspeed = 0;
|
|
|
+ double windhour = 0;
|
|
|
+ double maxpower = 0;
|
|
|
+ double minpower = 0;
|
|
|
+ try {
|
|
|
+ ztmxSnap = edosUtil.getHistoryDatasSnap(ztmxpoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, null, 60l);
|
|
|
+ ssfsSnap = edosUtil.getHistoryDatasSnap(ssfsPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, null, 60l);
|
|
|
+ scadafdl = edosUtil.getSectionData(fdlPoint, endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ scadayfdl = edosUtil.getSectionData(yfdlPoint, endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ scadanfdl = edosUtil.getSectionData(nfdlPoint, endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ speed = edosUtil.getSectionData(speedPoint,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ power = edosUtil.getSectionData(powerPoint,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ maxspeedStat = edosUtil.getHistStat(ssfsPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1l, null, 0);
|
|
|
+ minspeedtStat = edosUtil.getHistStat(ssfsPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1l, null, 1);
|
|
|
+ maxpowerStat = edosUtil.getHistStat(ssglPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1l, null, 0);
|
|
|
+ minpowerStat = edosUtil.getHistStat(ssglPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1l, null, 1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ double runSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 1).collect(Collectors.toList()).size();
|
|
|
+ windturbineinfoday.setRunhours(DoubleUtils.keepPrecision(runSize/60,2));
|
|
|
+ windturbineinfoday.setRuntime(DoubleUtils.keepPrecision(runSize/60,2));
|
|
|
+ double stopSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 0).collect(Collectors.toList()).size();
|
|
|
+ windturbineinfoday.setStophours(DoubleUtils.keepPrecision(stopSize/60,2));
|
|
|
+ windturbineinfoday.setStoptime(DoubleUtils.keepPrecision(stopSize/60,2));
|
|
|
+ double faultSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 2).collect(Collectors.toList()).size();
|
|
|
+ windturbineinfoday.setFaulthours(DoubleUtils.keepPrecision(faultSize/60,2));
|
|
|
+ windturbineinfoday.setFaulttime(DoubleUtils.keepPrecision(faultSize/60,2));
|
|
|
+ double mainSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 4).collect(Collectors.toList()).size();
|
|
|
+ windturbineinfoday.setMaintainhours(DoubleUtils.keepPrecision(mainSize/60,2));
|
|
|
+ windturbineinfoday.setMaintaintime(DoubleUtils.keepPrecision(mainSize/60,2));
|
|
|
+ double interruptSize = ztmxSnap.stream().filter(zt -> zt.getPointValueInDouble() == 3).collect(Collectors.toList()).size();
|
|
|
+ windturbineinfoday.setInterrupthours(DoubleUtils.keepPrecision(interruptSize/60,2));
|
|
|
+ windturbineinfoday.setInterrupttime(DoubleUtils.keepPrecision(interruptSize/60,2));
|
|
|
+ windturbineinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(scadafdl,2));
|
|
|
+ windturbineinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(scadayfdl,2));
|
|
|
+ windturbineinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(scadanfdl,2));
|
|
|
+ windturbineinfoday.setSpeed(DoubleUtils.keepPrecision(speed,2));
|
|
|
+ windturbineinfoday.setPower(DoubleUtils.keepPrecision(power,2));
|
|
|
+ windturbineinfoday.setRecorddate(samedayZero);
|
|
|
+ windturbineinfoday.setWindpowerstationid(wt.getWindpowerstationid());
|
|
|
+ windturbineinfoday.setProjectid(wt.getProjectid());
|
|
|
+ windturbineinfoday.setLineid(wt.getLineid());
|
|
|
+ if (StringUtils.isNotEmpty(maxspeedStat)){
|
|
|
+ maxspeed = maxspeedStat.get(0).getPointValueInDouble();
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(minspeedtStat)){
|
|
|
+ minspeed = maxspeedStat.get(0).getPointValueInDouble();
|
|
|
+ }
|
|
|
+ windturbineinfoday.setMaxspeed(DoubleUtils.keepPrecision(maxspeed,2));
|
|
|
+ windturbineinfoday.setMaxspeed(DoubleUtils.keepPrecision(minspeed,2));
|
|
|
+ if (StringUtils.isNotEmpty(ssfsSnap)){
|
|
|
+ windhour = ssfsSnap.stream().filter(i->i.getPointValueInDouble()>=3 && i.getPointValueInDouble()<=25).collect(Collectors.toList()).size();
|
|
|
+ }
|
|
|
+ windturbineinfoday.setWindhours(DoubleUtils.keepPrecision(windhour,2));
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(maxpowerStat)){
|
|
|
+ maxpower = maxpowerStat.get(0).getPointValueInDouble();
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(minpowerStat)){
|
|
|
+ minpower = minpowerStat.get(0).getPointValueInDouble();
|
|
|
+ }
|
|
|
+ windturbineinfoday.setMaxpower(DoubleUtils.keepPrecision(maxpower,2));
|
|
|
+ windturbineinfoday.setMinpower(DoubleUtils.keepPrecision(minpower,2));
|
|
|
+ windturbineinfoday.setDaysbklyl(DoubleUtils.keepPrecision((24-faultSize/60)/24,2));
|
|
|
+ Double aDouble = wtrlmap.get(wt.getId());
|
|
|
+ windturbineinfoday.setDaylyxs(DoubleUtils.keepPrecision(scadafdl/aDouble,2));
|
|
|
+ windturbineinfoday.setDaydxkyxs((DoubleUtils.keepPrecision((24-faultSize/60-mainSize/60)/24,2)));
|
|
|
+ resultList.add(windturbineinfoday);
|
|
|
+ });
|
|
|
+ windturbineinfodayService.saveBatch(resultList);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public void saveWindturbineinfoday3(String beginDate,String endDate){
|
|
|
+ Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap = CacheContext.wtpAimap;
|
|
|
+ List<Windturbine> wtls = CacheContext.wtls;
|
|
|
+ List<String> days = DateUtils.getDays(beginDate, endDate);
|
|
|
+ days.stream().forEach(day->{
|
|
|
+ List<Windturbineinfoday3> resultList = new ArrayList<>();
|
|
|
+ Date samedayZero = DateUtils.getSamedayZero(day);
|
|
|
+ Date addDays = DateUtils.addDays(samedayZero, 1);
|
|
|
+ Date endOfDay = DateUtils.getEndOfDay(samedayZero);
|
|
|
+ QueryWrapper<Windturbineinfoday3> delQW = new QueryWrapper<>();
|
|
|
+ delQW.eq("recorddate",DateUtils.parseDate(day));
|
|
|
+ windturbineinfoday3Service.remove(delQW);
|
|
|
+
|
|
|
+ wtls.stream().forEach(wt->{
|
|
|
+ Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
|
|
|
+ Windturbinetestingpointnew xn1 = windturbinetestingpointnewMap.get(Contant.WTRDJSSDL);
|
|
|
+ Windturbinetestingpointnew xn2 = windturbinetestingpointnewMap.get(Contant.WTRSTSSDL);
|
|
|
+ Windturbinetestingpointnew xn3 = windturbinetestingpointnewMap.get(Contant.WTRXNSSDL);
|
|
|
+ Windturbinetestingpointnew xn4 = windturbinetestingpointnewMap.get(Contant.WTRQXSSDL);
|
|
|
+ Windturbinetestingpointnew gz1 = windturbinetestingpointnewMap.get(Contant.WTRGZSSDL);
|
|
|
+ Windturbinetestingpointnew gz2 = windturbinetestingpointnewMap.get(Contant.WTRSZSSDL);
|
|
|
+ Windturbinetestingpointnew wh1 = windturbinetestingpointnewMap.get(Contant.WTRJXSSDL);
|
|
|
+ Windturbinetestingpointnew wh2 = windturbinetestingpointnewMap.get(Contant.WTRLZSSDL);
|
|
|
+ Windturbinetestingpointnew xd1 = windturbinetestingpointnewMap.get(Contant.WTRQFSSDL);
|
|
|
+ Windturbinetestingpointnew xd2 = windturbinetestingpointnewMap.get(Contant.WTRXDSSDL);
|
|
|
+ Windturbinetestingpointnew sl1 = windturbinetestingpointnewMap.get(Contant.WTRWZSSDL);
|
|
|
+ Windturbinetestingpointnew sl2 = windturbinetestingpointnewMap.get(Contant.WTRTZSSDL);
|
|
|
+ double xnssdl1 = 0;
|
|
|
+ double xnssdl2 = 0;
|
|
|
+ double xnssdl3 = 0;
|
|
|
+ double xnssdl4 = 0;
|
|
|
+ double gzssdl1 = 0;
|
|
|
+ double gzssdl2 = 0;
|
|
|
+ double whssdl1 = 0;
|
|
|
+ double whssdl2 = 0;
|
|
|
+ double xdssdl1 = 0;
|
|
|
+ double xdssdl2 = 0;
|
|
|
+ double slssdl1 = 0;
|
|
|
+ double slssdl2 = 0;
|
|
|
+ try {
|
|
|
+ xnssdl1 = edosUtil.getSectionData(xn1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl2 = edosUtil.getSectionData(xn2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl3 = edosUtil.getSectionData(xn3,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl4 = edosUtil.getSectionData(xn4,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gzssdl1 = edosUtil.getSectionData(gz1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gzssdl2 = edosUtil.getSectionData(gz2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ whssdl1 = edosUtil.getSectionData(wh1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ whssdl2 = edosUtil.getSectionData(wh2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xdssdl1 = edosUtil.getSectionData(xd1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xdssdl2 = edosUtil.getSectionData(xd2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ slssdl1 = edosUtil.getSectionData(sl1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ slssdl2 = edosUtil.getSectionData(sl2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Windturbineinfoday3 windturbineinfoday3 = new Windturbineinfoday3();
|
|
|
+ windturbineinfoday3.setWindpowerstationid(wt.getWindpowerstationid());
|
|
|
+ windturbineinfoday3.setProjectid(wt.getProjectid());
|
|
|
+ windturbineinfoday3.setLineid(wt.getLineid());
|
|
|
+ windturbineinfoday3.setWindturbineid(wt.getId());
|
|
|
+ windturbineinfoday3.setRecorddate(samedayZero);
|
|
|
+
|
|
|
+ windturbineinfoday3.setDaynhgzssdl(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
|
|
|
+ windturbineinfoday3.setDaynhgzssdl2(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
|
|
|
+ windturbineinfoday3.setDaynhwhssdl(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
|
|
|
+ windturbineinfoday3.setDaynhwhssdl2(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
|
|
|
+ windturbineinfoday3.setDaynhxdssdl(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
|
|
|
+ windturbineinfoday3.setDaynhxdssdl2(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
|
|
|
+ windturbineinfoday3.setDaynhqfdl(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
|
|
|
+ windturbineinfoday3.setDaynhqfdl2(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
|
|
|
+ windturbineinfoday3.setDaynhcfdl(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
|
|
|
+ windturbineinfoday3.setDaynhcfdl2(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
|
|
|
+ resultList.add(windturbineinfoday3);
|
|
|
+ });
|
|
|
+ windturbineinfoday3Service.saveBatch(resultList);
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void saveWindpowerinfoday(String beginDate,String endDate){
|
|
|
+ List<String> days = DateUtils.getDays(beginDate, endDate);
|
|
|
+ List<Line> lines = CacheContext.lines;
|
|
|
+ List<Project> projects = CacheContext.projects;
|
|
|
+ List<Windpowerstation> wplist = CacheContext.wplist;
|
|
|
+ Map<String, Map<String, Windpowerstationpointnew>> lnPointmap = CacheContext.lnPointmap;
|
|
|
+ Map<String, Map<String, Windpowerstationpointnew>> pjPointmap = CacheContext.pjPointmap;
|
|
|
+ Map<String, Map<String, Windpowerstationpointnew>> wppointmap = CacheContext.wppointmap;
|
|
|
+ days.stream().forEach(day->{
|
|
|
+ List<Windpowerinfoday> resultList = new ArrayList<>();
|
|
|
+
|
|
|
+ Date samedayZero = DateUtils.getSamedayZero(day);
|
|
|
+ Date addDays = DateUtils.addDays(samedayZero, 1);
|
|
|
+ Date endOfDay = DateUtils.getEndOfDay(samedayZero);
|
|
|
+ QueryWrapper<Windpowerinfoday> delQW = new QueryWrapper<>();
|
|
|
+ delQW.eq("recorddate",DateUtils.parseDate(day));
|
|
|
+ windpowerinfodayService.remove(delQW);
|
|
|
+
|
|
|
+
|
|
|
+ lines.stream().forEach(line -> {
|
|
|
+ Map<String, Windpowerstationpointnew> linepointnewMap = lnPointmap.get(line.getId());
|
|
|
+ Windpowerinfoday windpowerinfoday = new Windpowerinfoday();
|
|
|
+ windpowerinfoday.setForeignkeyid(line.getId());
|
|
|
+ windpowerinfoday.setRecorddate(samedayZero);
|
|
|
+ Windpowerstationpointnew swdlpointnew = linepointnewMap.get(Contant.SWDLB);
|
|
|
+ Windpowerstationpointnew gwgwdlpointnew = linepointnewMap.get(Contant.GWGWB);
|
|
|
+ Windpowerstationpointnew nwgwdlpointnew = linepointnewMap.get(Contant.NWGWB);
|
|
|
+ Windpowerstationpointnew powerpointnew = linepointnewMap.get(Contant.RPJGL);
|
|
|
+ Windpowerstationpointnew speedpointnew = linepointnewMap.get(Contant.RPJFS);
|
|
|
+ Windpowerstationpointnew fdlpointnew = linepointnewMap.get(Contant.RFDL);
|
|
|
+ Windpowerstationpointnew yfdlpointnew = linepointnewMap.get(Contant.YFDL);
|
|
|
+ Windpowerstationpointnew nfdlpointnew = linepointnewMap.get(Contant.NFDL);
|
|
|
+ Windpowerstationpointnew cydlpointnew = linepointnewMap.get(Contant.CYDLB);
|
|
|
+ Windpowerstationpointnew fdlbpointnew = linepointnewMap.get(Contant.RFDLB);
|
|
|
+ Windpowerstationpointnew yfdlbpointnew = linepointnewMap.get(Contant.YFDLB);
|
|
|
+ Windpowerstationpointnew nfdlbpointnew = linepointnewMap.get(Contant.NFDLB);
|
|
|
+ Windpowerstationpointnew yswdlbpointnew = linepointnewMap.get(Contant.SWDLY);
|
|
|
+ Windpowerstationpointnew nswdlbpointnew = linepointnewMap.get(Contant.SWDLN);
|
|
|
+ Windpowerstationpointnew ygwgwdlpointnew = linepointnewMap.get(Contant.GWGWY);
|
|
|
+ Windpowerstationpointnew ngwgwdlpointnew = linepointnewMap.get(Contant.GWGWN);
|
|
|
+ Windpowerstationpointnew ynwgwdlpointnew = linepointnewMap.get(Contant.NWGWY);
|
|
|
+ Windpowerstationpointnew nnwgwdlpointnew = linepointnewMap.get(Contant.NWGWN);
|
|
|
+ double generatingcapacity = 0;
|
|
|
+ double swdl = 0;
|
|
|
+ double gwgwdl = 0;
|
|
|
+ double nwgwdl = 0;
|
|
|
+ double power = 0;
|
|
|
+ double speed = 0;
|
|
|
+ double yfdl = 0;
|
|
|
+ double nfdl = 0;
|
|
|
+ double cydl = 0;
|
|
|
+ double fdlb = 0;
|
|
|
+ double yfdlb = 0;
|
|
|
+ double nfdlb = 0;
|
|
|
+ double yswdl = 0;
|
|
|
+ double nswdl = 0;
|
|
|
+ double ygwgwdl = 0;
|
|
|
+ double ngwgwdl = 0;
|
|
|
+ double ynwgwdl = 0;
|
|
|
+ double nnwgwdl = 0;
|
|
|
+ try {
|
|
|
+ generatingcapacity = edosUtil.getSectionData(fdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ swdl = edosUtil.getSectionData(swdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gwgwdl = edosUtil.getSectionData(gwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nwgwdl = edosUtil.getSectionData(nwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ power = edosUtil.getSectionData(powerpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ speed = edosUtil.getSectionData(speedpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yfdl = edosUtil.getSectionData(yfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nfdl = edosUtil.getSectionData(nfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ cydl = edosUtil.getSectionData(cydlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ fdlb = edosUtil.getSectionData(fdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yfdlb = edosUtil.getSectionData(yfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nfdlb = edosUtil.getSectionData(nfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yswdl = edosUtil.getSectionData(yswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nswdl = edosUtil.getSectionData(nswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ygwgwdl = edosUtil.getSectionData(ygwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ngwgwdl = edosUtil.getSectionData(ngwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ynwgwdl = edosUtil.getSectionData(ynwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nnwgwdl = edosUtil.getSectionData(nnwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ windpowerinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(generatingcapacity,2));
|
|
|
+ windpowerinfoday.setPower(DoubleUtils.keepPrecision(power,2));
|
|
|
+ windpowerinfoday.setSpeed(DoubleUtils.keepPrecision(speed,2));
|
|
|
+ windpowerinfoday.setGridelectricity(DoubleUtils.keepPrecision(swdl,2));
|
|
|
+ windpowerinfoday.setBuyelectricity(DoubleUtils.keepPrecision(gwgwdl,2));
|
|
|
+ windpowerinfoday.setBuyagricultureelectricity(DoubleUtils.keepPrecision(nwgwdl,2));
|
|
|
+ windpowerinfoday.setMonthgc(DoubleUtils.keepPrecision(yfdl,2));
|
|
|
+ windpowerinfoday.setYeargc(DoubleUtils.keepPrecision(nfdl,2));
|
|
|
+ windpowerinfoday.setFieldelectricity(DoubleUtils.keepPrecision(cydl,2));
|
|
|
+ windpowerinfoday.setGeneratingcapacity2(DoubleUtils.keepPrecision(fdlb,2));
|
|
|
+ windpowerinfoday.setWindpowerstationid("");
|
|
|
+ windpowerinfoday.setProjectid(line.getProjectid());
|
|
|
+ windpowerinfoday.setLineid(line.getId());
|
|
|
+ windpowerinfoday.setMonthgc2(DoubleUtils.keepPrecision(yfdlb,2));
|
|
|
+ windpowerinfoday.setYeargc2(DoubleUtils.keepPrecision(nfdlb,2));
|
|
|
+ windpowerinfoday.setMonthge(DoubleUtils.keepPrecision(yswdl,2));
|
|
|
+ windpowerinfoday.setYearge(DoubleUtils.keepPrecision(nswdl,2));
|
|
|
+ windpowerinfoday.setMonthbe(DoubleUtils.keepPrecision(ygwgwdl,2));
|
|
|
+ windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
|
|
|
+ windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
|
|
|
+ windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
|
|
|
+ resultList.add(windpowerinfoday);
|
|
|
+ });
|
|
|
+
|
|
|
+ projects.stream().forEach(project -> {
|
|
|
+ Map<String, Windpowerstationpointnew> propointnewMap = pjPointmap.get(project.getId());
|
|
|
+ Windpowerinfoday windpowerinfoday = new Windpowerinfoday();
|
|
|
+ windpowerinfoday.setForeignkeyid(project.getId());
|
|
|
+ windpowerinfoday.setRecorddate(samedayZero);
|
|
|
+ Windpowerstationpointnew swdlpointnew = propointnewMap.get(Contant.SWDLB);
|
|
|
+ Windpowerstationpointnew gwgwdlpointnew = propointnewMap.get(Contant.GWGWB);
|
|
|
+ Windpowerstationpointnew nwgwdlpointnew = propointnewMap.get(Contant.NWGWB);
|
|
|
+ Windpowerstationpointnew powerpointnew = propointnewMap.get(Contant.RPJGL);
|
|
|
+ Windpowerstationpointnew speedpointnew = propointnewMap.get(Contant.RPJFS);
|
|
|
+ Windpowerstationpointnew fdlpointnew = propointnewMap.get(Contant.RFDL);
|
|
|
+ Windpowerstationpointnew yfdlpointnew = propointnewMap.get(Contant.YFDL);
|
|
|
+ Windpowerstationpointnew nfdlpointnew = propointnewMap.get(Contant.NFDL);
|
|
|
+ Windpowerstationpointnew cydlpointnew = propointnewMap.get(Contant.CYDLB);
|
|
|
+ Windpowerstationpointnew fdlbpointnew = propointnewMap.get(Contant.RFDLB);
|
|
|
+ Windpowerstationpointnew yfdlbpointnew = propointnewMap.get(Contant.YFDLB);
|
|
|
+ Windpowerstationpointnew nfdlbpointnew = propointnewMap.get(Contant.NFDLB);
|
|
|
+ Windpowerstationpointnew yswdlbpointnew = propointnewMap.get(Contant.SWDLY);
|
|
|
+ Windpowerstationpointnew nswdlbpointnew = propointnewMap.get(Contant.SWDLN);
|
|
|
+ Windpowerstationpointnew ygwgwdlpointnew = propointnewMap.get(Contant.GWGWY);
|
|
|
+ Windpowerstationpointnew ngwgwdlpointnew = propointnewMap.get(Contant.GWGWN);
|
|
|
+ Windpowerstationpointnew ynwgwdlpointnew = propointnewMap.get(Contant.NWGWY);
|
|
|
+ Windpowerstationpointnew nnwgwdlpointnew = propointnewMap.get(Contant.NWGWN);
|
|
|
+ double generatingcapacity = 0;
|
|
|
+ double swdl = 0;
|
|
|
+ double gwgwdl = 0;
|
|
|
+ double nwgwdl = 0;
|
|
|
+ double power = 0;
|
|
|
+ double speed = 0;
|
|
|
+ double yfdl = 0;
|
|
|
+ double nfdl = 0;
|
|
|
+ double cydl = 0;
|
|
|
+ double fdlb = 0;
|
|
|
+ double yfdlb = 0;
|
|
|
+ double nfdlb = 0;
|
|
|
+ double yswdl = 0;
|
|
|
+ double nswdl = 0;
|
|
|
+ double ygwgwdl = 0;
|
|
|
+ double ngwgwdl = 0;
|
|
|
+ double ynwgwdl = 0;
|
|
|
+ double nnwgwdl = 0;
|
|
|
+ try {
|
|
|
+ generatingcapacity = edosUtil.getSectionData(fdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ swdl = edosUtil.getSectionData(swdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gwgwdl = edosUtil.getSectionData(gwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nwgwdl = edosUtil.getSectionData(nwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ power = edosUtil.getSectionData(powerpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ speed = edosUtil.getSectionData(speedpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yfdl = edosUtil.getSectionData(yfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nfdl = edosUtil.getSectionData(nfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ cydl = edosUtil.getSectionData(cydlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ fdlb = edosUtil.getSectionData(fdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yfdlb = edosUtil.getSectionData(yfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nfdlb = edosUtil.getSectionData(nfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yswdl = edosUtil.getSectionData(yswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nswdl = edosUtil.getSectionData(nswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ygwgwdl = edosUtil.getSectionData(ygwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ngwgwdl = edosUtil.getSectionData(ngwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ynwgwdl = edosUtil.getSectionData(ynwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nnwgwdl = edosUtil.getSectionData(nnwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ windpowerinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(generatingcapacity,2));
|
|
|
+ windpowerinfoday.setPower(DoubleUtils.keepPrecision(power,2));
|
|
|
+ windpowerinfoday.setSpeed(DoubleUtils.keepPrecision(speed,2));
|
|
|
+ windpowerinfoday.setGridelectricity(DoubleUtils.keepPrecision(swdl,2));
|
|
|
+ windpowerinfoday.setBuyelectricity(DoubleUtils.keepPrecision(gwgwdl,2));
|
|
|
+ windpowerinfoday.setBuyagricultureelectricity(DoubleUtils.keepPrecision(nwgwdl,2));
|
|
|
+ windpowerinfoday.setMonthgc(DoubleUtils.keepPrecision(yfdl,2));
|
|
|
+ windpowerinfoday.setYeargc(DoubleUtils.keepPrecision(nfdl,2));
|
|
|
+ windpowerinfoday.setFieldelectricity(DoubleUtils.keepPrecision(cydl,2));
|
|
|
+ windpowerinfoday.setGeneratingcapacity2(DoubleUtils.keepPrecision(fdlb,2));
|
|
|
+ windpowerinfoday.setWindpowerstationid(project.getWindpowerstationid());
|
|
|
+ windpowerinfoday.setProjectid(project.getId());
|
|
|
+ windpowerinfoday.setLineid("");
|
|
|
+ windpowerinfoday.setMonthgc2(DoubleUtils.keepPrecision(yfdlb,2));
|
|
|
+ windpowerinfoday.setYeargc2(DoubleUtils.keepPrecision(nfdlb,2));
|
|
|
+ windpowerinfoday.setMonthge(DoubleUtils.keepPrecision(yswdl,2));
|
|
|
+ windpowerinfoday.setYearge(DoubleUtils.keepPrecision(nswdl,2));
|
|
|
+ windpowerinfoday.setMonthbe(DoubleUtils.keepPrecision(ygwgwdl,2));
|
|
|
+ windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
|
|
|
+ windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
|
|
|
+ windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
|
|
|
+ resultList.add(windpowerinfoday);
|
|
|
+ });
|
|
|
+ wplist.stream().forEach(wp -> {
|
|
|
+ Map<String, Windpowerstationpointnew> wppointnewMap = wppointmap.get(wp.getId());
|
|
|
+ Windpowerinfoday windpowerinfoday = new Windpowerinfoday();
|
|
|
+ windpowerinfoday.setForeignkeyid(wp.getId());
|
|
|
+ windpowerinfoday.setRecorddate(samedayZero);
|
|
|
+ Windpowerstationpointnew swdlpointnew = wppointnewMap.get(Contant.SWDLB);
|
|
|
+ Windpowerstationpointnew gwgwdlpointnew = wppointnewMap.get(Contant.GWGWB);
|
|
|
+ Windpowerstationpointnew nwgwdlpointnew = wppointnewMap.get(Contant.NWGWB);
|
|
|
+ Windpowerstationpointnew powerpointnew = wppointnewMap.get(Contant.RPJGL);
|
|
|
+ Windpowerstationpointnew speedpointnew = wppointnewMap.get(Contant.RPJFS);
|
|
|
+ Windpowerstationpointnew fdlpointnew = wppointnewMap.get(Contant.RFDL);
|
|
|
+ Windpowerstationpointnew yfdlpointnew = wppointnewMap.get(Contant.YFDL);
|
|
|
+ Windpowerstationpointnew nfdlpointnew = wppointnewMap.get(Contant.NFDL);
|
|
|
+ Windpowerstationpointnew cydlpointnew = wppointnewMap.get(Contant.CYDLB);
|
|
|
+ Windpowerstationpointnew fdlbpointnew = wppointnewMap.get(Contant.RFDLB);
|
|
|
+ Windpowerstationpointnew yfdlbpointnew = wppointnewMap.get(Contant.YFDLB);
|
|
|
+ Windpowerstationpointnew nfdlbpointnew = wppointnewMap.get(Contant.NFDLB);
|
|
|
+ Windpowerstationpointnew yswdlbpointnew = wppointnewMap.get(Contant.SWDLY);
|
|
|
+ Windpowerstationpointnew nswdlbpointnew = wppointnewMap.get(Contant.SWDLN);
|
|
|
+ Windpowerstationpointnew ygwgwdlpointnew = wppointnewMap.get(Contant.GWGWY);
|
|
|
+ Windpowerstationpointnew ngwgwdlpointnew = wppointnewMap.get(Contant.GWGWN);
|
|
|
+ Windpowerstationpointnew ynwgwdlpointnew = wppointnewMap.get(Contant.NWGWY);
|
|
|
+ Windpowerstationpointnew nnwgwdlpointnew = wppointnewMap.get(Contant.NWGWN);
|
|
|
+ double generatingcapacity = 0;
|
|
|
+ double swdl = 0;
|
|
|
+ double gwgwdl = 0;
|
|
|
+ double nwgwdl = 0;
|
|
|
+ double power = 0;
|
|
|
+ double speed = 0;
|
|
|
+ double yfdl = 0;
|
|
|
+ double nfdl = 0;
|
|
|
+ double cydl = 0;
|
|
|
+ double fdlb = 0;
|
|
|
+ double yfdlb = 0;
|
|
|
+ double nfdlb = 0;
|
|
|
+ double yswdl = 0;
|
|
|
+ double nswdl = 0;
|
|
|
+ double ygwgwdl = 0;
|
|
|
+ double ngwgwdl = 0;
|
|
|
+ double ynwgwdl = 0;
|
|
|
+ double nnwgwdl = 0;
|
|
|
+ try {
|
|
|
+ generatingcapacity = edosUtil.getSectionData(fdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ swdl = edosUtil.getSectionData(swdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gwgwdl = edosUtil.getSectionData(gwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nwgwdl = edosUtil.getSectionData(nwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ power = edosUtil.getSectionData(powerpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ speed = edosUtil.getSectionData(speedpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yfdl = edosUtil.getSectionData(yfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nfdl = edosUtil.getSectionData(nfdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ cydl = edosUtil.getSectionData(cydlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ fdlb = edosUtil.getSectionData(fdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yfdlb = edosUtil.getSectionData(yfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nfdlb = edosUtil.getSectionData(nfdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ yswdl = edosUtil.getSectionData(yswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nswdl = edosUtil.getSectionData(nswdlbpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ygwgwdl = edosUtil.getSectionData(ygwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ngwgwdl = edosUtil.getSectionData(ngwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ ynwgwdl = edosUtil.getSectionData(ynwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ nnwgwdl = edosUtil.getSectionData(nnwgwdlpointnew,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ windpowerinfoday.setGeneratingcapacity(DoubleUtils.keepPrecision(generatingcapacity,2));
|
|
|
+ windpowerinfoday.setPower(DoubleUtils.keepPrecision(power,2));
|
|
|
+ windpowerinfoday.setSpeed(DoubleUtils.keepPrecision(speed,2));
|
|
|
+ windpowerinfoday.setGridelectricity(DoubleUtils.keepPrecision(swdl,2));
|
|
|
+ windpowerinfoday.setBuyelectricity(DoubleUtils.keepPrecision(gwgwdl,2));
|
|
|
+ windpowerinfoday.setBuyagricultureelectricity(DoubleUtils.keepPrecision(nwgwdl,2));
|
|
|
+ windpowerinfoday.setMonthgc(DoubleUtils.keepPrecision(yfdl,2));
|
|
|
+ windpowerinfoday.setYeargc(DoubleUtils.keepPrecision(nfdl,2));
|
|
|
+ windpowerinfoday.setFieldelectricity(DoubleUtils.keepPrecision(cydl,2));
|
|
|
+ windpowerinfoday.setGeneratingcapacity2(DoubleUtils.keepPrecision(fdlb,2));
|
|
|
+ windpowerinfoday.setWindpowerstationid(wp.getId());
|
|
|
+ windpowerinfoday.setProjectid("");
|
|
|
+ windpowerinfoday.setLineid("");
|
|
|
+ windpowerinfoday.setMonthgc2(DoubleUtils.keepPrecision(yfdlb,2));
|
|
|
+ windpowerinfoday.setYeargc2(DoubleUtils.keepPrecision(nfdlb,2));
|
|
|
+ windpowerinfoday.setMonthge(DoubleUtils.keepPrecision(yswdl,2));
|
|
|
+ windpowerinfoday.setYearge(DoubleUtils.keepPrecision(nswdl,2));
|
|
|
+ windpowerinfoday.setMonthbe(DoubleUtils.keepPrecision(ygwgwdl,2));
|
|
|
+ windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
|
|
|
+ windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
|
|
|
+ windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
|
|
|
+ resultList.add(windpowerinfoday);
|
|
|
+ });
|
|
|
+ windpowerinfodayService.saveBatch(resultList);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void saveWindpowerinfoday3(String beginDate,String endDate){
|
|
|
+ List<String> days = DateUtils.getDays(beginDate, endDate);
|
|
|
+ List<Line> lines = CacheContext.lines;
|
|
|
+ List<Project> projects = CacheContext.projects;
|
|
|
+ List<Windpowerstation> wplist = CacheContext.wplist;
|
|
|
+ Map<String, Map<String, Windpowerstationpointnew>> lnPointmap = CacheContext.lnPointmap;
|
|
|
+ Map<String, Map<String, Windpowerstationpointnew>> pjPointmap = CacheContext.pjPointmap;
|
|
|
+ Map<String, Map<String, Windpowerstationpointnew>> wppointmap = CacheContext.wppointmap;
|
|
|
+ days.stream().forEach(day-> {
|
|
|
+ List<Windpowerinfoday3> resultList = new ArrayList<>();
|
|
|
+
|
|
|
+ Date samedayZero = DateUtils.getSamedayZero(day);
|
|
|
+ Date addDays = DateUtils.addDays(samedayZero, 1);
|
|
|
+ Date endOfDay = DateUtils.getEndOfDay(samedayZero);
|
|
|
+ QueryWrapper<Windpowerinfoday3> delQW = new QueryWrapper<>();
|
|
|
+ delQW.eq("recorddate", DateUtils.parseDate(day));
|
|
|
+ windpowerinfoday3Service.remove(delQW);
|
|
|
+
|
|
|
+ lines.stream().forEach(line -> {
|
|
|
+ Map<String, Windpowerstationpointnew> linepointnewMap = lnPointmap.get(line.getId());
|
|
|
+ Windpowerinfoday3 windpowerinfoday3 = new Windpowerinfoday3();
|
|
|
+ windpowerinfoday3.setForeignkeyid(line.getId());
|
|
|
+ windpowerinfoday3.setRecorddate(samedayZero);
|
|
|
+
|
|
|
+ Windpowerstationpointnew xn1 = linepointnewMap.get(Contant.RSDJZSDL);
|
|
|
+ Windpowerstationpointnew xn2 = linepointnewMap.get(Contant.RSSTZSDL);
|
|
|
+ Windpowerstationpointnew xn3 = linepointnewMap.get(Contant.RXNZSDL);
|
|
|
+ Windpowerstationpointnew xn4 = linepointnewMap.get(Contant.RSQXZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew gz1 = linepointnewMap.get(Contant.RGZZSDL);
|
|
|
+ Windpowerstationpointnew gz2 = linepointnewMap.get(Contant.RSZZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew wh1 = linepointnewMap.get(Contant.RJXZSDL);
|
|
|
+ Windpowerstationpointnew wh2 = linepointnewMap.get(Contant.RLZZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew xd1 = linepointnewMap.get(Contant.RQFZSDL);
|
|
|
+ Windpowerstationpointnew xd2 = linepointnewMap.get(Contant.RXDZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew sl1 = linepointnewMap.get(Contant.RWZZSDL);
|
|
|
+ Windpowerstationpointnew sl2 = linepointnewMap.get(Contant.RTZZSDL);
|
|
|
+ double xnssdl1 = 0;
|
|
|
+ double xnssdl2 = 0;
|
|
|
+ double xnssdl3 = 0;
|
|
|
+ double xnssdl4 = 0;
|
|
|
+ double gzssdl1 = 0;
|
|
|
+ double gzssdl2 = 0;
|
|
|
+ double whssdl1 = 0;
|
|
|
+ double whssdl2 = 0;
|
|
|
+ double xdssdl1 = 0;
|
|
|
+ double xdssdl2 = 0;
|
|
|
+ double slssdl1 = 0;
|
|
|
+ double slssdl2 = 0;
|
|
|
+ try {
|
|
|
+ xnssdl1 = edosUtil.getSectionData(xn1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl2 = edosUtil.getSectionData(xn2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl3 = edosUtil.getSectionData(xn3,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl4 = edosUtil.getSectionData(xn4,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gzssdl1 = edosUtil.getSectionData(gz1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gzssdl2 = edosUtil.getSectionData(gz2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ whssdl1 = edosUtil.getSectionData(wh1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ whssdl2 = edosUtil.getSectionData(wh2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xdssdl1 = edosUtil.getSectionData(xd1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xdssdl2 = edosUtil.getSectionData(xd2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ slssdl1 = edosUtil.getSectionData(sl1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ slssdl2 = edosUtil.getSectionData(sl2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ windpowerinfoday3.setDaynhgzssdl(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhgzssdl2(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhwhssdl(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhwhssdl2(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhxdssdl(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhxdssdl2(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhqfdl(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
|
|
|
+ windpowerinfoday3.setDaynhqfdl2(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
|
|
|
+ windpowerinfoday3.setDaynhcfdl(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhcfdl2(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
|
|
|
+ resultList.add(windpowerinfoday3);
|
|
|
+ });
|
|
|
+
|
|
|
+ projects.stream().forEach(project -> {
|
|
|
+ Map<String, Windpowerstationpointnew> propointnewMap = pjPointmap.get(project.getId());
|
|
|
+ Windpowerinfoday3 windpowerinfoday3 = new Windpowerinfoday3();
|
|
|
+ windpowerinfoday3.setForeignkeyid(project.getId());
|
|
|
+ windpowerinfoday3.setRecorddate(samedayZero);
|
|
|
+
|
|
|
+ Windpowerstationpointnew xn1 = propointnewMap.get(Contant.RSDJZSDL);
|
|
|
+ Windpowerstationpointnew xn2 = propointnewMap.get(Contant.RSSTZSDL);
|
|
|
+ Windpowerstationpointnew xn3 = propointnewMap.get(Contant.RXNZSDL);
|
|
|
+ Windpowerstationpointnew xn4 = propointnewMap.get(Contant.RSQXZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew gz1 = propointnewMap.get(Contant.RGZZSDL);
|
|
|
+ Windpowerstationpointnew gz2 = propointnewMap.get(Contant.RSZZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew wh1 = propointnewMap.get(Contant.RJXZSDL);
|
|
|
+ Windpowerstationpointnew wh2 = propointnewMap.get(Contant.RLZZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew xd1 = propointnewMap.get(Contant.RQFZSDL);
|
|
|
+ Windpowerstationpointnew xd2 = propointnewMap.get(Contant.RXDZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew sl1 = propointnewMap.get(Contant.RWZZSDL);
|
|
|
+ Windpowerstationpointnew sl2 = propointnewMap.get(Contant.RTZZSDL);
|
|
|
+ double xnssdl1 = 0;
|
|
|
+ double xnssdl2 = 0;
|
|
|
+ double xnssdl3 = 0;
|
|
|
+ double xnssdl4 = 0;
|
|
|
+ double gzssdl1 = 0;
|
|
|
+ double gzssdl2 = 0;
|
|
|
+ double whssdl1 = 0;
|
|
|
+ double whssdl2 = 0;
|
|
|
+ double xdssdl1 = 0;
|
|
|
+ double xdssdl2 = 0;
|
|
|
+ double slssdl1 = 0;
|
|
|
+ double slssdl2 = 0;
|
|
|
+ try {
|
|
|
+ xnssdl1 = edosUtil.getSectionData(xn1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl2 = edosUtil.getSectionData(xn2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl3 = edosUtil.getSectionData(xn3,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl4 = edosUtil.getSectionData(xn4,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gzssdl1 = edosUtil.getSectionData(gz1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gzssdl2 = edosUtil.getSectionData(gz2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ whssdl1 = edosUtil.getSectionData(wh1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ whssdl2 = edosUtil.getSectionData(wh2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xdssdl1 = edosUtil.getSectionData(xd1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xdssdl2 = edosUtil.getSectionData(xd2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ slssdl1 = edosUtil.getSectionData(sl1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ slssdl2 = edosUtil.getSectionData(sl2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ windpowerinfoday3.setDaynhgzssdl(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhgzssdl2(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhwhssdl(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhwhssdl2(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhxdssdl(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhxdssdl2(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhqfdl(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
|
|
|
+ windpowerinfoday3.setDaynhqfdl2(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
|
|
|
+ windpowerinfoday3.setDaynhcfdl(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhcfdl2(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
|
|
|
+ resultList.add(windpowerinfoday3);
|
|
|
+ });
|
|
|
+
|
|
|
+ wplist.stream().forEach(wp -> {
|
|
|
+ Map<String, Windpowerstationpointnew> wppointnewMap = wppointmap.get(wp.getId());
|
|
|
+ Windpowerinfoday3 windpowerinfoday3 = new Windpowerinfoday3();
|
|
|
+ windpowerinfoday3.setForeignkeyid(wp.getId());
|
|
|
+ windpowerinfoday3.setRecorddate(samedayZero);
|
|
|
+
|
|
|
+ Windpowerstationpointnew xn1 = wppointnewMap.get(Contant.RSDJZSDL);
|
|
|
+ Windpowerstationpointnew xn2 = wppointnewMap.get(Contant.RSSTZSDL);
|
|
|
+ Windpowerstationpointnew xn3 = wppointnewMap.get(Contant.RXNZSDL);
|
|
|
+ Windpowerstationpointnew xn4 = wppointnewMap.get(Contant.RSQXZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew gz1 = wppointnewMap.get(Contant.RGZZSDL);
|
|
|
+ Windpowerstationpointnew gz2 = wppointnewMap.get(Contant.RSZZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew wh1 = wppointnewMap.get(Contant.RJXZSDL);
|
|
|
+ Windpowerstationpointnew wh2 = wppointnewMap.get(Contant.RLZZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew xd1 = wppointnewMap.get(Contant.RQFZSDL);
|
|
|
+ Windpowerstationpointnew xd2 = wppointnewMap.get(Contant.RXDZSDL);
|
|
|
+
|
|
|
+ Windpowerstationpointnew sl1 = wppointnewMap.get(Contant.RWZZSDL);
|
|
|
+ Windpowerstationpointnew sl2 = wppointnewMap.get(Contant.RTZZSDL);
|
|
|
+ double xnssdl1 = 0;
|
|
|
+ double xnssdl2 = 0;
|
|
|
+ double xnssdl3 = 0;
|
|
|
+ double xnssdl4 = 0;
|
|
|
+ double gzssdl1 = 0;
|
|
|
+ double gzssdl2 = 0;
|
|
|
+ double whssdl1 = 0;
|
|
|
+ double whssdl2 = 0;
|
|
|
+ double xdssdl1 = 0;
|
|
|
+ double xdssdl2 = 0;
|
|
|
+ double slssdl1 = 0;
|
|
|
+ double slssdl2 = 0;
|
|
|
+ try {
|
|
|
+ xnssdl1 = edosUtil.getSectionData(xn1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl2 = edosUtil.getSectionData(xn2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl3 = edosUtil.getSectionData(xn3,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xnssdl4 = edosUtil.getSectionData(xn4,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gzssdl1 = edosUtil.getSectionData(gz1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ gzssdl2 = edosUtil.getSectionData(gz2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ whssdl1 = edosUtil.getSectionData(wh1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ whssdl2 = edosUtil.getSectionData(wh2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xdssdl1 = edosUtil.getSectionData(xd1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ xdssdl2 = edosUtil.getSectionData(xd2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ slssdl1 = edosUtil.getSectionData(sl1,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ slssdl2 = edosUtil.getSectionData(sl2,endOfDay.getTime()).getPointValueInDouble();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ windpowerinfoday3.setDaynhgzssdl(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhgzssdl2(DoubleUtils.keepPrecision(gzssdl1+gzssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhwhssdl(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhwhssdl2(DoubleUtils.keepPrecision(whssdl1+whssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhxdssdl(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhxdssdl2(DoubleUtils.keepPrecision(xdssdl1+xdssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhqfdl(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
|
|
|
+ windpowerinfoday3.setDaynhqfdl2(DoubleUtils.keepPrecision(xnssdl1+xnssdl2+xnssdl3+xnssdl4,2));
|
|
|
+ windpowerinfoday3.setDaynhcfdl(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
|
|
|
+ windpowerinfoday3.setDaynhcfdl2(DoubleUtils.keepPrecision(slssdl1+slssdl2,2));
|
|
|
+ resultList.add(windpowerinfoday3);
|
|
|
+ });
|
|
|
+ windpowerinfoday3Service.saveBatch(resultList);
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|