|
@@ -2,11 +2,14 @@ package com.gyee.generation.service;
|
|
|
|
|
|
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.generation.init.CacheContext;
|
|
|
import com.gyee.generation.model.auto.*;
|
|
|
import com.gyee.generation.util.realtimesource.EdosUtil;
|
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
|
+import org.apache.commons.logging.Log;
|
|
|
+import org.apache.commons.logging.LogFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
@@ -21,11 +24,19 @@ import java.util.concurrent.atomic.AtomicReference;
|
|
|
@Service
|
|
|
public class GenerationService {
|
|
|
|
|
|
+ private Log log = LogFactory.getLog(GenerationService.class);
|
|
|
+
|
|
|
private IEdosUtil edosUtil = new EdosUtil();
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存电计量电量,场用电量,购网电量,上网电量
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
public void saveGenerationDatas() throws Exception {
|
|
|
List<PointData> resultList = new ArrayList<>();
|
|
|
+ List<PointData> fdlList = new ArrayList<>();
|
|
|
List<Windpowerstation> wpls = CacheContext.wpls;
|
|
|
+ List<Line> lines = CacheContext.lines;
|
|
|
Map<String, List<Project>> wppromap = CacheContext.wppromap;
|
|
|
Map<String, List<Line>> prolinemap = CacheContext.prolinemap;
|
|
|
List<Meterpoint> meterpoints = CacheContext.meterpoints;
|
|
@@ -42,189 +53,525 @@ public class GenerationService {
|
|
|
AtomicReference<Double> gfrfdl = new AtomicReference<>(0.0);
|
|
|
AtomicReference<Double> gfyfdl = new AtomicReference<>(0.0);
|
|
|
AtomicReference<Double> gfnfdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdrswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdyswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdnswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfrswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfyswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfnswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdrgwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdygwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdngwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfrgwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfygwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfngwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfrcydl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfycydl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> gfncydl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdrcydl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdycydl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> fdncydl = new AtomicReference<>(0.0);
|
|
|
+
|
|
|
Double gsrfdl = 0.0;
|
|
|
Double gsyfdl = 0.0;
|
|
|
Double gsnfdl = 0.0;
|
|
|
- wpls.stream().forEach(wp->{
|
|
|
+ lines.parallelStream().forEach(line->{
|
|
|
+ Map<String, Windpowerstationpointnew> linemap = linepointmap.get(line.getId());
|
|
|
+ //线路发电量
|
|
|
+ Optional<Meterpoint> fdlOptional = meterpoints.stream().filter(me -> me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("进线") && me.getMetersort().equals("主")).findFirst();
|
|
|
+ computeFdl(fdlList, samedayZero, monthFirstZero, yearFirstZero, currentDate, linemap, fdlOptional);
|
|
|
+ });
|
|
|
+ wpls.parallelStream().forEach(wp->{
|
|
|
Map<String, Windpowerstationpointnew> wpmap = wppointmap.get(wp.getId());
|
|
|
AtomicReference<Double> fcrfdl = new AtomicReference<>((double) 0);
|
|
|
AtomicReference<Double> fcyfdl = new AtomicReference<>((double) 0);
|
|
|
AtomicReference<Double> fcnfdl = new AtomicReference<>((double) 0);
|
|
|
- wppromap.get(wp.getId()).stream().forEach(project -> {
|
|
|
+ AtomicReference<Double> fcrswdl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> fcyswdl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> fcnswdl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> fcrgwdl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> fcygwdl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> fcngwdl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> fcrcydl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> fcycydl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> fcncydl = new AtomicReference<>((double) 0);
|
|
|
+ wppromap.get(wp.getId()).parallelStream().forEach(project -> {
|
|
|
Map<String, Windpowerstationpointnew> projectmap = propointmap.get(project.getId());
|
|
|
AtomicReference<Double> qcrfdl = new AtomicReference<>(0.0);
|
|
|
AtomicReference<Double> qcyfdl = new AtomicReference<>(0.0);
|
|
|
AtomicReference<Double> qcnfdl = new AtomicReference<>(0.0);
|
|
|
- prolinemap.get(project.getId()).stream().forEach(line -> {
|
|
|
+ AtomicReference<Double> qcrswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> qcyswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> qcnswdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> qcrgwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> qcygwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> qcngwdl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> qcrcydl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> qcycydl = new AtomicReference<>(0.0);
|
|
|
+ AtomicReference<Double> qcncydl = new AtomicReference<>(0.0);
|
|
|
+ prolinemap.get(project.getId()).parallelStream().forEach(line -> {
|
|
|
Map<String, Windpowerstationpointnew> linemap = linepointmap.get(line.getId());
|
|
|
- Optional<Meterpoint> optionalMeterpoint = meterpoints.stream().filter(me -> me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("进线") && me.getMetersort().equals("主")).findFirst();
|
|
|
- if (optionalMeterpoint.isPresent()){
|
|
|
- String pointid = optionalMeterpoint.get().getId();
|
|
|
- Double real = 0.0;
|
|
|
- Double sameday = 0.0;
|
|
|
- Double month = 0.0;
|
|
|
- Double year = 0.0;
|
|
|
- try {
|
|
|
- real = edosUtil.getRealData(pointid).getPointValueInDouble();
|
|
|
- Optional<PointData> dayFirst = edosUtil.getHistoryDatasSnap(pointid, samedayZero.getTime() / 1000, samedayZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
- if (dayFirst.isPresent()){
|
|
|
- sameday = dayFirst.get().getPointValueInDouble();
|
|
|
- }
|
|
|
- Optional<PointData> monthFirst = edosUtil.getHistoryDatasSnap(pointid, monthFirstZero.getTime() / 1000, monthFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
- if (monthFirst.isPresent()){
|
|
|
- month = monthFirst.get().getPointValueInDouble();
|
|
|
- }
|
|
|
- Optional<PointData> yearFirst = edosUtil.getHistoryDatasSnap(pointid, yearFirstZero.getTime() / 1000, yearFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
- if (yearFirst.isPresent()){
|
|
|
- year = yearFirst.get().getPointValueInDouble();
|
|
|
- }
|
|
|
- Double magnification = optionalMeterpoint.get().getMagnification();
|
|
|
- double xlrfdl = (real - sameday) * magnification;
|
|
|
- qcrfdl.updateAndGet(v -> new Double((double) (v + xlrfdl)));
|
|
|
- //线路日发电量
|
|
|
- PointData r = new PointData();
|
|
|
- r.setPointTime(currentDate.getTime());
|
|
|
- r.setPointValue(String.valueOf(xlrfdl));
|
|
|
- r.setPointValueInDouble(xlrfdl);
|
|
|
- r.setEdnaId(linemap.get(Contant.RFDLB).getCode());
|
|
|
- r.setPointName(linemap.get(Contant.RFDLB).getName());
|
|
|
- resultList.add(r);
|
|
|
- //线路月发电量
|
|
|
- double xlyfdl = (real - month) * magnification;
|
|
|
- qcyfdl.updateAndGet(v -> new Double((double) (v + xlyfdl)));
|
|
|
- PointData y = new PointData();
|
|
|
- y.setPointTime(currentDate.getTime());
|
|
|
- y.setPointValue(String.valueOf(xlyfdl));
|
|
|
- y.setPointValueInDouble(xlyfdl);
|
|
|
- y.setEdnaId(linemap.get(Contant.YFDLB).getCode());
|
|
|
- y.setPointName(linemap.get(Contant.YFDLB).getName());
|
|
|
- resultList.add(y);
|
|
|
- //线路年发电量
|
|
|
- double xlnfdl = (real - year) * magnification;
|
|
|
- qcnfdl.updateAndGet(v -> new Double((double) (v + xlnfdl)));
|
|
|
- PointData n = new PointData();
|
|
|
- n.setPointTime(currentDate.getTime());
|
|
|
- n.setPointValue(String.valueOf(xlnfdl));
|
|
|
- n.setPointValueInDouble(xlnfdl);
|
|
|
- n.setEdnaId(linemap.get(Contant.NFDLB).getCode());
|
|
|
- n.setPointName(linemap.get(Contant.NFDLB).getName());
|
|
|
- resultList.add(n);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
+ //线路发电量
|
|
|
+ Optional<Meterpoint> fdlOptional = meterpoints.stream().filter(me -> me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("进线") && me.getMetersort().equals("主")).findFirst();
|
|
|
+ lineFdl(resultList, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrfdl, qcyfdl, qcnfdl, linemap, fdlOptional);
|
|
|
+ log.info(line.getName()+"电计量电量计算完毕!");
|
|
|
+ //线路上网电量
|
|
|
+ Optional<Meterpoint> swdlOptional = meterpoints.stream().filter(me -> me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("出线") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
|
|
|
+ lineOrtherdl(fdlList,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrswdl, qcyswdl, qcnswdl, line, linemap, swdlOptional,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
|
|
|
+ log.info(line.getName()+"上网电量计算完毕!");
|
|
|
+ //线路购网电量
|
|
|
+ Optional<Meterpoint> gwdlOptional = meterpoints.stream().filter(me -> me.getUniformcode().equals("FXYG") && me.getMetertype().equals("出线") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
|
|
|
+ lineOrtherdl(fdlList,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrgwdl, qcygwdl, qcngwdl, line, linemap, gwdlOptional,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
|
|
|
+ log.info(line.getName()+"工网购网电量计算完毕!");
|
|
|
+ //厂用电量
|
|
|
+ Optional<Meterpoint> zybOptional = meterpoints.stream().filter(me -> me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("站用变") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
|
|
|
+ lineOrtherdl(fdlList,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrcydl, qcycydl, qcncydl, line, linemap, zybOptional,Contant.CYDLB,Contant.CYDLY,Contant.CYDLN);
|
|
|
+ log.info(line.getName()+"场用电量计算完毕!");
|
|
|
+ //农网购网电量
|
|
|
+ setZero(resultList,currentDate,linemap,Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
|
|
|
+ log.info(line.getName()+"农网购网电量计算完毕!");
|
|
|
});
|
|
|
- fcrfdl.updateAndGet(v -> new Double((double) (v + qcrfdl.get())));
|
|
|
- //期次日发电量
|
|
|
- PointData r = new PointData();
|
|
|
- r.setPointTime(currentDate.getTime());
|
|
|
- r.setPointValue(String.valueOf(qcrfdl.get()));
|
|
|
- r.setPointValueInDouble(qcrfdl.get());
|
|
|
- r.setEdnaId(projectmap.get(Contant.RFDLB).getCode());
|
|
|
- r.setPointName(projectmap.get(Contant.RFDLB).getName());
|
|
|
- resultList.add(r);
|
|
|
- fcyfdl.updateAndGet(v -> new Double((double) (v + qcyfdl.get())));
|
|
|
- //期次月发电量
|
|
|
- PointData y = new PointData();
|
|
|
- y.setPointTime(currentDate.getTime());
|
|
|
- y.setPointValue(String.valueOf(qcyfdl.get()));
|
|
|
- y.setPointValueInDouble(qcyfdl.get());
|
|
|
- y.setEdnaId(projectmap.get(Contant.YFDLB).getCode());
|
|
|
- y.setPointName(projectmap.get(Contant.YFDLB).getName());
|
|
|
- resultList.add(y);
|
|
|
- fcnfdl.updateAndGet(v -> new Double((double) (v + qcnfdl.get())));
|
|
|
- //期次年发电量
|
|
|
- PointData n = new PointData();
|
|
|
- n.setPointTime(currentDate.getTime());
|
|
|
- n.setPointValue(String.valueOf(qcnfdl.get()));
|
|
|
- n.setPointValueInDouble(qcnfdl.get());
|
|
|
- n.setEdnaId(projectmap.get(Contant.NFDLB).getCode());
|
|
|
- n.setPointName(projectmap.get(Contant.NFDLB).getName());
|
|
|
- resultList.add(n);
|
|
|
+ //期次发电量
|
|
|
+ projectFdl(resultList, currentDate, fcrfdl, fcyfdl, fcnfdl, projectmap, qcrfdl, qcyfdl, qcnfdl);
|
|
|
+ log.info(project.getName()+"发电量计算完毕!");
|
|
|
+ //期次上网电量
|
|
|
+ projectOrther(resultList, currentDate, fcrswdl, fcyswdl, fcnswdl, projectmap, qcrswdl, qcyswdl, qcnswdl,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
|
|
|
+ log.info(project.getName()+"上网电量计算完毕!");
|
|
|
+ //期次购网电量
|
|
|
+ projectOrther(resultList, currentDate, fcrgwdl, fcygwdl, fcngwdl, projectmap, qcrgwdl, qcygwdl, qcngwdl,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
|
|
|
+ log.info(project.getName()+"工网购网电量计算完毕!");
|
|
|
+ //期次厂用电量
|
|
|
+ projectOrther(resultList, currentDate, fcrcydl, fcycydl, fcncydl, projectmap, qcrcydl, qcycydl, qcncydl,Contant.CYDLB,Contant.CYDLY,Contant.CYDLN);
|
|
|
+ log.info(project.getName()+"场用电量计算完毕!");
|
|
|
+ //期次农网电量
|
|
|
+ setZero(resultList,currentDate,projectmap,Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
|
|
|
+ log.info(project.getName()+"农网电量计算完毕!");
|
|
|
+
|
|
|
});
|
|
|
- //风场日发电量
|
|
|
- PointData r = new PointData();
|
|
|
- r.setPointTime(currentDate.getTime());
|
|
|
- r.setPointValue(String.valueOf(fcrfdl.get()));
|
|
|
- r.setPointValueInDouble(fcrfdl.get());
|
|
|
- r.setEdnaId(wpmap.get(Contant.RFDLB).getCode());
|
|
|
- r.setPointName(wpmap.get(Contant.RFDLB).getName());
|
|
|
- resultList.add(r);
|
|
|
- //风场月发电量
|
|
|
- PointData y = new PointData();
|
|
|
- y.setPointTime(currentDate.getTime());
|
|
|
- y.setPointValue(String.valueOf(fcyfdl.get()));
|
|
|
- y.setPointValueInDouble(fcyfdl.get());
|
|
|
- y.setEdnaId(wpmap.get(Contant.YFDLB).getCode());
|
|
|
- y.setPointName(wpmap.get(Contant.YFDLB).getName());
|
|
|
- resultList.add(y);
|
|
|
- //风场年发电量
|
|
|
- PointData n = new PointData();
|
|
|
- n.setPointTime(currentDate.getTime());
|
|
|
- n.setPointValue(String.valueOf(fcnfdl.get()));
|
|
|
- n.setPointValueInDouble(fcnfdl.get());
|
|
|
- n.setEdnaId(wpmap.get(Contant.NFDLB).getCode());
|
|
|
- n.setPointName(wpmap.get(Contant.NFDLB).getName());
|
|
|
- resultList.add(n);
|
|
|
+ //场站发电量
|
|
|
+ windpowerFdl(resultList, currentDate, wpmap, fcrfdl, fcyfdl, fcnfdl,Contant.RFDLB,Contant.YFDLB,Contant.NFDLB);
|
|
|
+ log.info(wp.getName()+"发电量计算完毕!");
|
|
|
+ //场站上网电量
|
|
|
+ windpowerFdl(resultList, currentDate, wpmap, fcrswdl, fcyswdl, fcnswdl,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
|
|
|
+ log.info(wp.getName()+"上网电量计算完毕!");
|
|
|
+ //场站购网电量
|
|
|
+ windpowerFdl(resultList, currentDate, wpmap, fcrgwdl, fcygwdl, fcngwdl,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
|
|
|
+ log.info(wp.getName()+"工网购网电量计算完毕!");
|
|
|
+ //场站场用电量
|
|
|
+ windpowerFdl(resultList, currentDate, wpmap, fcrcydl, fcycydl, fcncydl,Contant.CYDLB,Contant.CYDLY,Contant.CYDLN);
|
|
|
+ log.info(wp.getName()+"场用电量计算完毕!");
|
|
|
+ //场站农网电量
|
|
|
+ setZero(resultList,currentDate,wpmap,Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
|
|
|
+ log.info(wp.getName()+"农网购网电量计算完毕!");
|
|
|
+
|
|
|
//给0,-1,-2赋值
|
|
|
if (wp.getId().endsWith("FDC")){
|
|
|
fdrfdl.updateAndGet(v -> v + fcrfdl.get());
|
|
|
fdyfdl.updateAndGet(v -> v + fcyfdl.get());
|
|
|
fdnfdl.updateAndGet(v -> v + fcnfdl.get());
|
|
|
+ fdrswdl.updateAndGet(v -> v + fcrswdl.get());
|
|
|
+ fdyswdl.updateAndGet(v -> v + fcyswdl.get());
|
|
|
+ fdnswdl.updateAndGet(v -> v + fcnswdl.get());
|
|
|
+ fdrgwdl.updateAndGet(v -> v + fcrgwdl.get());
|
|
|
+ fdygwdl.updateAndGet(v -> v + fcygwdl.get());
|
|
|
+ fdngwdl.updateAndGet(v -> v + fcngwdl.get());
|
|
|
+ fdrcydl.updateAndGet(v -> v + fcrcydl.get());
|
|
|
+ fdycydl.updateAndGet(v -> v + fcycydl.get());
|
|
|
+ fdncydl.updateAndGet(v -> v + fcncydl.get());
|
|
|
}else if (wp.getId().endsWith("GDC")){
|
|
|
gfrfdl.updateAndGet(v -> v + fcrfdl.get());
|
|
|
gfyfdl.updateAndGet(v -> v + fcyfdl.get());
|
|
|
gfnfdl.updateAndGet(v -> v + fcnfdl.get());
|
|
|
+ gfrswdl.updateAndGet(v -> v + fcrswdl.get());
|
|
|
+ gfyswdl.updateAndGet(v -> v + fcyswdl.get());
|
|
|
+ gfnswdl.updateAndGet(v -> v + fcnswdl.get());
|
|
|
+ gfrgwdl.updateAndGet(v -> v + fcrgwdl.get());
|
|
|
+ gfygwdl.updateAndGet(v -> v + fcygwdl.get());
|
|
|
+ gfngwdl.updateAndGet(v -> v + fcngwdl.get());
|
|
|
+ gfrcydl.updateAndGet(v -> v + fcrcydl.get());
|
|
|
+ gfycydl.updateAndGet(v -> v + fcycydl.get());
|
|
|
+ gfncydl.updateAndGet(v -> v + fcncydl.get());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //0,-1,-2公司发电量
|
|
|
+ qygsFdl(resultList, wppointmap, currentDate, gsrfdl,gsyfdl,gsnfdl,fdrfdl, fdyfdl, fdnfdl, gfrfdl, gfyfdl, gfnfdl,Contant.RFDLB,Contant.YFDLB,Contant.NFDLB);
|
|
|
+ log.info("公司发电量计算完毕!");
|
|
|
+ //0,-1,-2公司上网电量
|
|
|
+ qygsFdl(resultList, wppointmap, currentDate, gsrfdl,gsyfdl,gsnfdl,fdrswdl, fdyswdl, fdnswdl, gfrswdl, gfyswdl, gfnswdl,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
|
|
|
+ log.info("公司上网电量计算完毕!");
|
|
|
+ //0,-1,-2公司购网电量
|
|
|
+ qygsFdl(resultList, wppointmap, currentDate, gsrfdl,gsyfdl,gsnfdl,fdrgwdl, fdygwdl, fdngwdl, gfrgwdl, gfygwdl, gfngwdl,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
|
|
|
+ log.info("公司工网购网电量计算完毕!");
|
|
|
+ //0,-1,-2公司场用电量
|
|
|
+ qygsFdl(resultList, wppointmap, currentDate, gsrfdl,gsyfdl,gsnfdl,fdrcydl, fdycydl, fdncydl, gfrcydl, gfycydl, gfncydl,Contant.CYDLB,Contant.CYDLY,Contant.CYDLN);
|
|
|
+ log.info("公司场用电量计算完毕!");
|
|
|
+ //0,-1,-2公司农网电量
|
|
|
+ setGsZero(resultList,currentDate,wppointmap,"-1",Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
|
|
|
+ setGsZero(resultList,currentDate,wppointmap,"-2",Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
|
|
|
+ setGsZero(resultList,currentDate,wppointmap,"-0",Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
|
|
|
+ log.info("公司农网购网电量计算完毕!");
|
|
|
+ edosUtil.sendMultiPoint(resultList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void setGsZero(List<PointData> resultList,Date currentDate,Map<String, Map<String, Windpowerstationpointnew>> linemap,String foreignkeyid,String rcode,String ycode,String ncode) {
|
|
|
+ //线路日发电量
|
|
|
+ PointData r = new PointData();
|
|
|
+ r.setPointTime(currentDate.getTime());
|
|
|
+ r.setPointValue("0");
|
|
|
+ r.setPointValueInDouble(0);
|
|
|
+ r.setEdnaId(linemap.get(foreignkeyid).get(rcode).getCode());
|
|
|
+ r.setPointName(linemap.get(foreignkeyid).get(rcode).getName());
|
|
|
+ resultList.add(r);
|
|
|
+ //线路月发电量
|
|
|
+ PointData y = new PointData();
|
|
|
+ y.setPointTime(currentDate.getTime());
|
|
|
+ y.setPointValue("0");
|
|
|
+ y.setPointValueInDouble(0);
|
|
|
+ y.setEdnaId(linemap.get(foreignkeyid).get(ycode).getCode());
|
|
|
+ y.setPointName(linemap.get(foreignkeyid).get(ycode).getName());
|
|
|
+ resultList.add(y);
|
|
|
+ //线路年发电量
|
|
|
+ PointData n = new PointData();
|
|
|
+ n.setPointTime(currentDate.getTime());
|
|
|
+ n.setPointValue("0");
|
|
|
+ n.setPointValueInDouble(0);
|
|
|
+ n.setEdnaId(linemap.get(foreignkeyid).get(ncode).getCode());
|
|
|
+ n.setPointName(linemap.get(foreignkeyid).get(ncode).getName());
|
|
|
+ resultList.add(n);
|
|
|
+ }
|
|
|
+ private void setZero(List<PointData> resultList,Date currentDate,Map<String, Windpowerstationpointnew> linemap,String rcode,String ycode,String ncode) {
|
|
|
+ //线路日发电量
|
|
|
+ PointData r = new PointData();
|
|
|
+ r.setPointTime(currentDate.getTime());
|
|
|
+ r.setPointValue("0");
|
|
|
+ r.setPointValueInDouble(0);
|
|
|
+ r.setEdnaId(linemap.get(rcode).getCode());
|
|
|
+ r.setPointName(linemap.get(rcode).getName());
|
|
|
+ resultList.add(r);
|
|
|
+ //线路月发电量
|
|
|
+ PointData y = new PointData();
|
|
|
+ y.setPointTime(currentDate.getTime());
|
|
|
+ y.setPointValue("0");
|
|
|
+ y.setPointValueInDouble(0);
|
|
|
+ y.setEdnaId(linemap.get(ycode).getCode());
|
|
|
+ y.setPointName(linemap.get(ycode).getName());
|
|
|
+ resultList.add(y);
|
|
|
+ //线路年发电量
|
|
|
+ PointData n = new PointData();
|
|
|
+ n.setPointTime(currentDate.getTime());
|
|
|
+ n.setPointValue("0");
|
|
|
+ n.setPointValueInDouble(0);
|
|
|
+ n.setEdnaId(linemap.get(ncode).getCode());
|
|
|
+ n.setPointName(linemap.get(ncode).getName());
|
|
|
+ resultList.add(n);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String,Double> getPercentage(List<PointData> fdlList,Meterpoint swdlMeterpoint,List<PointData> resultList,Map<String, Map<String, Windpowerstationpointnew>> linepointmap,Line line){
|
|
|
+
|
|
|
+ Map<String,Double> percentageMap = new HashMap<>();
|
|
|
+ String[] swdlLines = swdlMeterpoint.getLineid().split("\\|");
|
|
|
+ AtomicReference<Double> xldl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> xlzdl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> xlydl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> xlzydl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> xlndl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> xlzndl = new AtomicReference<>((double) 0);
|
|
|
+ Arrays.stream(swdlLines).forEach(l->{
|
|
|
+ Optional<PointData> xldlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(Contant.RFDLB).getCode())).findFirst();
|
|
|
+ if (xldlfirst.isPresent()){
|
|
|
+ if (l.equals(line.getId())){
|
|
|
+ xldl.set(xldlfirst.get().getPointValueInDouble());
|
|
|
+ xlzdl.updateAndGet(v -> new Double((double) (v + xldlfirst.get().getPointValueInDouble())));
|
|
|
+ }else{
|
|
|
+ xlzdl.updateAndGet(v -> new Double((double) (v + xldlfirst.get().getPointValueInDouble())));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Optional<PointData> xlydlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(Contant.YFDLB).getCode())).findFirst();
|
|
|
+ if (xlydlfirst.isPresent()){
|
|
|
+ if (l.equals(line.getId())){
|
|
|
+ xlydl.set(xlydlfirst.get().getPointValueInDouble());
|
|
|
+ xlzydl.updateAndGet(v -> new Double((double) (v + xlydlfirst.get().getPointValueInDouble())));
|
|
|
+ }else{
|
|
|
+ xlzydl.updateAndGet(v -> new Double((double) (v + xlydlfirst.get().getPointValueInDouble())));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Optional<PointData> xlndlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(Contant.NFDLB).getCode())).findFirst();
|
|
|
+ if (xlndlfirst.isPresent()){
|
|
|
+ if (l.equals(line.getId())){
|
|
|
+ xlndl.set(xlndlfirst.get().getPointValueInDouble());
|
|
|
+ xlzndl.updateAndGet(v -> new Double((double) (v + xlndlfirst.get().getPointValueInDouble())));
|
|
|
+ }else{
|
|
|
+ xlzndl.updateAndGet(v -> new Double((double) (v + xlndlfirst.get().getPointValueInDouble())));
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
- //风电日发电量
|
|
|
- PointData fdr = new PointData();
|
|
|
- fdr.setPointTime(currentDate.getTime());
|
|
|
- fdr.setPointValue(String.valueOf(fdrfdl.get()));
|
|
|
- fdr.setPointValueInDouble(fdrfdl.get());
|
|
|
- fdr.setEdnaId(wppointmap.get("-1").get(Contant.RFDLB).getCode());
|
|
|
- fdr.setPointName(wppointmap.get("-1").get(Contant.RFDLB).getName());
|
|
|
- resultList.add(fdr);
|
|
|
- //风电月发电量
|
|
|
- PointData fdy = new PointData();
|
|
|
- fdy.setPointTime(currentDate.getTime());
|
|
|
- fdy.setPointValue(String.valueOf(fdyfdl.get()));
|
|
|
- fdy.setPointValueInDouble(fdyfdl.get());
|
|
|
- fdy.setEdnaId(wppointmap.get("-1").get(Contant.YFDLB).getCode());
|
|
|
- fdy.setPointName(wppointmap.get("-1").get(Contant.YFDLB).getName());
|
|
|
- resultList.add(fdy);
|
|
|
- //风电年发电量
|
|
|
- PointData fdn = new PointData();
|
|
|
- fdn.setPointTime(currentDate.getTime());
|
|
|
- fdn.setPointValue(String.valueOf(fdnfdl.get()));
|
|
|
- fdn.setPointValueInDouble(fdnfdl.get());
|
|
|
- fdn.setEdnaId(wppointmap.get("-1").get(Contant.NFDLB).getCode());
|
|
|
- fdn.setPointName(wppointmap.get("-1").get(Contant.NFDLB).getName());
|
|
|
- resultList.add(fdn);
|
|
|
- //光伏日发电量
|
|
|
- PointData gfr = new PointData();
|
|
|
- gfr.setPointTime(currentDate.getTime());
|
|
|
- gfr.setPointValue(String.valueOf(gfrfdl.get()));
|
|
|
- gfr.setPointValueInDouble(gfrfdl.get());
|
|
|
- gfr.setEdnaId(wppointmap.get("-2").get(Contant.RFDLB).getCode());
|
|
|
- gfr.setPointName(wppointmap.get("-2").get(Contant.RFDLB).getName());
|
|
|
- resultList.add(gfr);
|
|
|
- //光伏月发电量
|
|
|
- PointData gfy = new PointData();
|
|
|
- gfy.setPointTime(currentDate.getTime());
|
|
|
- gfy.setPointValue(String.valueOf(gfyfdl.get()));
|
|
|
- gfy.setPointValueInDouble(gfyfdl.get());
|
|
|
- gfy.setEdnaId(wppointmap.get("-2").get(Contant.YFDLB).getCode());
|
|
|
- gfy.setPointName(wppointmap.get("-2").get(Contant.YFDLB).getName());
|
|
|
- resultList.add(gfy);
|
|
|
- //光伏年发电量
|
|
|
- PointData gfn = new PointData();
|
|
|
- gfn.setPointTime(currentDate.getTime());
|
|
|
- gfn.setPointValue(String.valueOf(gfnfdl.get()));
|
|
|
- gfn.setPointValueInDouble(gfnfdl.get());
|
|
|
- gfn.setEdnaId(wppointmap.get("-2").get(Contant.NFDLB).getCode());
|
|
|
- gfn.setPointName(wppointmap.get("-2").get(Contant.NFDLB).getName());
|
|
|
- resultList.add(gfn);
|
|
|
+ //电量百分比
|
|
|
+ double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get() * 100 : 0;
|
|
|
+ percentageMap.put("percentage",percentage);
|
|
|
+ double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get() * 100 : 0;
|
|
|
+ percentageMap.put("ypercentage",ypercentage);
|
|
|
+ double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() * 100 : 0;
|
|
|
+ percentageMap.put("npercentage",npercentage);
|
|
|
+ return percentageMap;
|
|
|
+ }
|
|
|
+ private void lineOrtherdl(List<PointData> fdlList,List<PointData> resultList, Map<String, Map<String, Windpowerstationpointnew>> linepointmap, Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, AtomicReference<Double> qcrswdl, AtomicReference<Double> qcyswdl, AtomicReference<Double> qcnswdl, Line line, Map<String, Windpowerstationpointnew> linemap, Optional<Meterpoint> optionalMeterpoint,String rcode,String ycode,String ncode) {
|
|
|
+ if (optionalMeterpoint.isPresent()){
|
|
|
+ Meterpoint swdlMeterpoint = optionalMeterpoint.get();
|
|
|
+ //获取电量百分比,算其他电量
|
|
|
+ Map<String, Double> percentageMap = getPercentage(fdlList,swdlMeterpoint, resultList, linepointmap, line);
|
|
|
+
|
|
|
+ String pointid = swdlMeterpoint.getId();
|
|
|
+ Double real = 0.0;
|
|
|
+ Double sameday = 0.0;
|
|
|
+ Double month = 0.0;
|
|
|
+ Double year = 0.0;
|
|
|
+ try {
|
|
|
+ real = edosUtil.getRealData(pointid).getPointValueInDouble();
|
|
|
+ Optional<PointData> dayFirst = edosUtil.getHistoryDatasSnap(pointid, samedayZero.getTime() / 1000, samedayZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (dayFirst.isPresent()){
|
|
|
+ sameday = dayFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Optional<PointData> monthFirst = edosUtil.getHistoryDatasSnap(pointid, monthFirstZero.getTime() / 1000, monthFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (monthFirst.isPresent()){
|
|
|
+ month = monthFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Optional<PointData> yearFirst = edosUtil.getHistoryDatasSnap(pointid, yearFirstZero.getTime() / 1000, yearFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (yearFirst.isPresent()){
|
|
|
+ year = yearFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Double magnification = optionalMeterpoint.get().getMagnification();
|
|
|
+
|
|
|
+ double xlswdl = (real - sameday) * magnification * percentageMap.get("percentage");
|
|
|
+ qcrswdl.updateAndGet(v -> new Double((double) (v + xlswdl)));
|
|
|
+ //线路上网电量
|
|
|
+ PointData r = new PointData();
|
|
|
+ r.setPointTime(currentDate.getTime());
|
|
|
+ r.setPointValue(String.valueOf(xlswdl));
|
|
|
+ r.setPointValueInDouble(xlswdl);
|
|
|
+ r.setEdnaId(linemap.get(rcode).getCode());
|
|
|
+ r.setPointName(linemap.get(rcode).getName());
|
|
|
+ resultList.add(r);
|
|
|
+ //线路月上网发电量
|
|
|
+ double xlyswdl = (real - month) * magnification * percentageMap.get("ypercentage");
|
|
|
+ qcyswdl.updateAndGet(v -> new Double((double) (v + xlyswdl)));
|
|
|
+ PointData y = new PointData();
|
|
|
+ y.setPointTime(currentDate.getTime());
|
|
|
+ y.setPointValue(String.valueOf(xlyswdl));
|
|
|
+ y.setPointValueInDouble(xlyswdl);
|
|
|
+ y.setEdnaId(linemap.get(ycode).getCode());
|
|
|
+ y.setPointName(linemap.get(ycode).getName());
|
|
|
+ resultList.add(y);
|
|
|
+ //线路年上网发电量
|
|
|
+ double xlnswfdl = (real - year) * magnification * percentageMap.get("npercentage");
|
|
|
+ qcnswdl.updateAndGet(v -> new Double((double) (v + xlnswfdl)));
|
|
|
+ PointData n = new PointData();
|
|
|
+ n.setPointTime(currentDate.getTime());
|
|
|
+ n.setPointValue(String.valueOf(xlnswfdl));
|
|
|
+ n.setPointValueInDouble(xlnswfdl);
|
|
|
+ n.setEdnaId(linemap.get(ncode).getCode());
|
|
|
+ n.setPointName(linemap.get(ncode).getName());
|
|
|
+ resultList.add(n);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void computeFdl(List<PointData> fdlList, Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, Map<String, Windpowerstationpointnew> linemap, Optional<Meterpoint> fdlOptional) {
|
|
|
+ if (fdlOptional.isPresent()){
|
|
|
+ String pointid = fdlOptional.get().getId();
|
|
|
+ Double real = 0.0;
|
|
|
+ Double sameday = 0.0;
|
|
|
+ Double month = 0.0;
|
|
|
+ Double year = 0.0;
|
|
|
+ try {
|
|
|
+ real = edosUtil.getRealData(pointid).getPointValueInDouble();
|
|
|
+ Optional<PointData> dayFirst = edosUtil.getHistoryDatasSnap(pointid, samedayZero.getTime() / 1000, samedayZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (dayFirst.isPresent()){
|
|
|
+ sameday = dayFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Optional<PointData> monthFirst = edosUtil.getHistoryDatasSnap(pointid, monthFirstZero.getTime() / 1000, monthFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (monthFirst.isPresent()){
|
|
|
+ month = monthFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Optional<PointData> yearFirst = edosUtil.getHistoryDatasSnap(pointid, yearFirstZero.getTime() / 1000, yearFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (yearFirst.isPresent()){
|
|
|
+ year = yearFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Double magnification = fdlOptional.get().getMagnification();
|
|
|
+ double xlrfdl = (real - sameday) * magnification;
|
|
|
+ //线路日发电量
|
|
|
+ PointData r = new PointData();
|
|
|
+ r.setPointTime(currentDate.getTime());
|
|
|
+ r.setPointValue(String.valueOf(xlrfdl));
|
|
|
+ r.setPointValueInDouble(xlrfdl);
|
|
|
+ r.setEdnaId(linemap.get(Contant.RFDLB).getCode());
|
|
|
+ r.setPointName(linemap.get(Contant.RFDLB).getName());
|
|
|
+ fdlList.add(r);
|
|
|
+ //线路月发电量
|
|
|
+ double xlyfdl = (real - month) * magnification;
|
|
|
+ PointData y = new PointData();
|
|
|
+ y.setPointTime(currentDate.getTime());
|
|
|
+ y.setPointValue(String.valueOf(xlyfdl));
|
|
|
+ y.setPointValueInDouble(xlyfdl);
|
|
|
+ y.setEdnaId(linemap.get(Contant.YFDLB).getCode());
|
|
|
+ y.setPointName(linemap.get(Contant.YFDLB).getName());
|
|
|
+ fdlList.add(y);
|
|
|
+ //线路年发电量
|
|
|
+ double xlnfdl = (real - year) * magnification;
|
|
|
+ PointData n = new PointData();
|
|
|
+ n.setPointTime(currentDate.getTime());
|
|
|
+ n.setPointValue(String.valueOf(xlnfdl));
|
|
|
+ n.setPointValueInDouble(xlnfdl);
|
|
|
+ n.setEdnaId(linemap.get(Contant.NFDLB).getCode());
|
|
|
+ n.setPointName(linemap.get(Contant.NFDLB).getName());
|
|
|
+ fdlList.add(n);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void lineFdl(List<PointData> resultList, Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, AtomicReference<Double> qcrfdl, AtomicReference<Double> qcyfdl, AtomicReference<Double> qcnfdl, Map<String, Windpowerstationpointnew> linemap, Optional<Meterpoint> optionalMeterpoint) {
|
|
|
+ if (optionalMeterpoint.isPresent()){
|
|
|
+ String pointid = optionalMeterpoint.get().getId();
|
|
|
+ Double real = 0.0;
|
|
|
+ Double sameday = 0.0;
|
|
|
+ Double month = 0.0;
|
|
|
+ Double year = 0.0;
|
|
|
+ try {
|
|
|
+ real = edosUtil.getRealData(pointid).getPointValueInDouble();
|
|
|
+ Optional<PointData> dayFirst = edosUtil.getHistoryDatasSnap(pointid, samedayZero.getTime() / 1000, samedayZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (dayFirst.isPresent()){
|
|
|
+ sameday = dayFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Optional<PointData> monthFirst = edosUtil.getHistoryDatasSnap(pointid, monthFirstZero.getTime() / 1000, monthFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (monthFirst.isPresent()){
|
|
|
+ month = monthFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Optional<PointData> yearFirst = edosUtil.getHistoryDatasSnap(pointid, yearFirstZero.getTime() / 1000, yearFirstZero.getTime() / 1000, 1l, null).stream().findFirst();
|
|
|
+ if (yearFirst.isPresent()){
|
|
|
+ year = yearFirst.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ Double magnification = optionalMeterpoint.get().getMagnification();
|
|
|
+ double xlrfdl = (real - sameday) * magnification;
|
|
|
+ qcrfdl.updateAndGet(v -> new Double((double) (v + xlrfdl)));
|
|
|
+ //线路日发电量
|
|
|
+ PointData r = new PointData();
|
|
|
+ r.setPointTime(currentDate.getTime());
|
|
|
+ r.setPointValue(String.valueOf(xlrfdl));
|
|
|
+ r.setPointValueInDouble(xlrfdl);
|
|
|
+ r.setEdnaId(linemap.get(Contant.RFDLB).getCode());
|
|
|
+ r.setPointName(linemap.get(Contant.RFDLB).getName());
|
|
|
+ resultList.add(r);
|
|
|
+ //线路月发电量
|
|
|
+ double xlyfdl = (real - month) * magnification;
|
|
|
+ qcyfdl.updateAndGet(v -> new Double((double) (v + xlyfdl)));
|
|
|
+ PointData y = new PointData();
|
|
|
+ y.setPointTime(currentDate.getTime());
|
|
|
+ y.setPointValue(String.valueOf(xlyfdl));
|
|
|
+ y.setPointValueInDouble(xlyfdl);
|
|
|
+ y.setEdnaId(linemap.get(Contant.YFDLB).getCode());
|
|
|
+ y.setPointName(linemap.get(Contant.YFDLB).getName());
|
|
|
+ resultList.add(y);
|
|
|
+ //线路年发电量
|
|
|
+ double xlnfdl = (real - year) * magnification;
|
|
|
+ qcnfdl.updateAndGet(v -> new Double((double) (v + xlnfdl)));
|
|
|
+ PointData n = new PointData();
|
|
|
+ n.setPointTime(currentDate.getTime());
|
|
|
+ n.setPointValue(String.valueOf(xlnfdl));
|
|
|
+ n.setPointValueInDouble(xlnfdl);
|
|
|
+ n.setEdnaId(linemap.get(Contant.NFDLB).getCode());
|
|
|
+ n.setPointName(linemap.get(Contant.NFDLB).getName());
|
|
|
+ resultList.add(n);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private void windpowerFdl(List<PointData> resultList, Date currentDate, Map<String, Windpowerstationpointnew> wpmap, AtomicReference<Double> fcrswdl, AtomicReference<Double> fcyswdl, AtomicReference<Double> fcnswdl,String rcode,String ycode,String ncode) {
|
|
|
+ //风场日上网发电量
|
|
|
+ PointData r = new PointData();
|
|
|
+ r.setPointTime(currentDate.getTime());
|
|
|
+ r.setPointValue(String.valueOf(fcrswdl.get()));
|
|
|
+ r.setPointValueInDouble(fcrswdl.get());
|
|
|
+ r.setEdnaId(wpmap.get(rcode).getCode());
|
|
|
+ r.setPointName(wpmap.get(rcode).getName());
|
|
|
+ resultList.add(r);
|
|
|
+ //风场月上网发电量
|
|
|
+ PointData y = new PointData();
|
|
|
+ y.setPointTime(currentDate.getTime());
|
|
|
+ y.setPointValue(String.valueOf(fcyswdl.get()));
|
|
|
+ y.setPointValueInDouble(fcyswdl.get());
|
|
|
+ y.setEdnaId(wpmap.get(ycode).getCode());
|
|
|
+ y.setPointName(wpmap.get(ycode).getName());
|
|
|
+ resultList.add(y);
|
|
|
+ //风场年上网发电量
|
|
|
+ PointData n = new PointData();
|
|
|
+ n.setPointTime(currentDate.getTime());
|
|
|
+ n.setPointValue(String.valueOf(fcnswdl.get()));
|
|
|
+ n.setPointValueInDouble(fcnswdl.get());
|
|
|
+ n.setEdnaId(wpmap.get(ncode).getCode());
|
|
|
+ n.setPointName(wpmap.get(ncode).getName());
|
|
|
+ resultList.add(n);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void qygsFdl(List<PointData> resultList, Map<String, Map<String, Windpowerstationpointnew>> wppointmap, Date currentDate, Double gsrfdl, Double gsyfdl, Double gsnfdl, AtomicReference<Double> fdrfdl, AtomicReference<Double> fdyfdl, AtomicReference<Double> fdnfdl, AtomicReference<Double> gfrfdl, AtomicReference<Double> gfyfdl, AtomicReference<Double> gfnfdl, String rcode, String ycode, String ncode) {
|
|
|
+ if (StringUtils.isNotEmpty(wppointmap.get("-1"))){
|
|
|
+ PointData fdr = new PointData();
|
|
|
+ fdr.setPointTime(currentDate.getTime());
|
|
|
+ fdr.setPointValue(String.valueOf(fdrfdl.get()));
|
|
|
+ fdr.setPointValueInDouble(fdrfdl.get());
|
|
|
+ fdr.setEdnaId(wppointmap.get("-1").get(rcode).getCode());
|
|
|
+ fdr.setPointName(wppointmap.get("-1").get(rcode).getName());
|
|
|
+ resultList.add(fdr);
|
|
|
+ //风电月发电量
|
|
|
+ PointData fdy = new PointData();
|
|
|
+ fdy.setPointTime(currentDate.getTime());
|
|
|
+ fdy.setPointValue(String.valueOf(fdyfdl.get()));
|
|
|
+ fdy.setPointValueInDouble(fdyfdl.get());
|
|
|
+ fdy.setEdnaId(wppointmap.get("-1").get(ycode).getCode());
|
|
|
+ fdy.setPointName(wppointmap.get("-1").get(ycode).getName());
|
|
|
+ resultList.add(fdy);
|
|
|
+ //风电年发电量
|
|
|
+ PointData fdn = new PointData();
|
|
|
+ fdn.setPointTime(currentDate.getTime());
|
|
|
+ fdn.setPointValue(String.valueOf(fdnfdl.get()));
|
|
|
+ fdn.setPointValueInDouble(fdnfdl.get());
|
|
|
+ fdn.setEdnaId(wppointmap.get("-1").get(ncode).getCode());
|
|
|
+ fdn.setPointName(wppointmap.get("-1").get(ncode).getName());
|
|
|
+ resultList.add(fdn);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(wppointmap.get("-2"))){
|
|
|
+ //光伏日发电量
|
|
|
+ PointData gfr = new PointData();
|
|
|
+ gfr.setPointTime(currentDate.getTime());
|
|
|
+ gfr.setPointValue(String.valueOf(gfrfdl.get()));
|
|
|
+ gfr.setPointValueInDouble(gfrfdl.get());
|
|
|
+ gfr.setEdnaId(wppointmap.get("-2").get(rcode).getCode());
|
|
|
+ gfr.setPointName(wppointmap.get("-2").get(rcode).getName());
|
|
|
+ resultList.add(gfr);
|
|
|
+ //光伏月发电量
|
|
|
+ PointData gfy = new PointData();
|
|
|
+ gfy.setPointTime(currentDate.getTime());
|
|
|
+ gfy.setPointValue(String.valueOf(gfyfdl.get()));
|
|
|
+ gfy.setPointValueInDouble(gfyfdl.get());
|
|
|
+ gfy.setEdnaId(wppointmap.get("-2").get(ycode).getCode());
|
|
|
+ gfy.setPointName(wppointmap.get("-2").get(ycode).getName());
|
|
|
+ resultList.add(gfy);
|
|
|
+ //光伏年发电量
|
|
|
+ PointData gfn = new PointData();
|
|
|
+ gfn.setPointTime(currentDate.getTime());
|
|
|
+ gfn.setPointValue(String.valueOf(gfnfdl.get()));
|
|
|
+ gfn.setPointValueInDouble(gfnfdl.get());
|
|
|
+ gfn.setEdnaId(wppointmap.get("-2").get(ncode).getCode());
|
|
|
+ gfn.setPointName(wppointmap.get("-2").get(ncode).getName());
|
|
|
+ resultList.add(gfn);
|
|
|
+ }
|
|
|
+
|
|
|
//风场日发电量
|
|
|
gsrfdl = fdrfdl.get()+gfrfdl.get();
|
|
|
gsyfdl = fdyfdl.get()+gfyfdl.get();
|
|
@@ -233,27 +580,92 @@ public class GenerationService {
|
|
|
r.setPointTime(currentDate.getTime());
|
|
|
r.setPointValue(String.valueOf(gsrfdl));
|
|
|
r.setPointValueInDouble(gsrfdl);
|
|
|
- r.setEdnaId(wppointmap.get("0").get(Contant.RFDLB).getCode());
|
|
|
- r.setPointName(wppointmap.get("0").get(Contant.RFDLB).getName());
|
|
|
+ r.setEdnaId(wppointmap.get("0").get(rcode).getCode());
|
|
|
+ r.setPointName(wppointmap.get("0").get(rcode).getName());
|
|
|
resultList.add(r);
|
|
|
//风场月发电量
|
|
|
PointData y = new PointData();
|
|
|
y.setPointTime(currentDate.getTime());
|
|
|
y.setPointValue(String.valueOf(gsyfdl));
|
|
|
y.setPointValueInDouble(gsyfdl);
|
|
|
- y.setEdnaId(wppointmap.get("0").get(Contant.YFDLB).getCode());
|
|
|
- y.setPointName(wppointmap.get("0").get(Contant.YFDLB).getName());
|
|
|
+ y.setEdnaId(wppointmap.get("0").get(ycode).getCode());
|
|
|
+ y.setPointName(wppointmap.get("0").get(ycode).getName());
|
|
|
resultList.add(y);
|
|
|
//风场年发电量
|
|
|
PointData n = new PointData();
|
|
|
n.setPointTime(currentDate.getTime());
|
|
|
n.setPointValue(String.valueOf(gsnfdl));
|
|
|
n.setPointValueInDouble(gsnfdl);
|
|
|
- n.setEdnaId(wppointmap.get("0").get(Contant.NFDLB).getCode());
|
|
|
- n.setPointName(wppointmap.get("0").get(Contant.NFDLB).getName());
|
|
|
+ n.setEdnaId(wppointmap.get("0").get(ncode).getCode());
|
|
|
+ n.setPointName(wppointmap.get("0").get(ncode).getName());
|
|
|
resultList.add(n);
|
|
|
+ }
|
|
|
|
|
|
- edosUtil.sendMultiPoint(resultList);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private void projectOrther(List<PointData> resultList, Date currentDate, AtomicReference<Double> fcrswdl, AtomicReference<Double> fcyswdl, AtomicReference<Double> fcnswdl, Map<String, Windpowerstationpointnew> projectmap, AtomicReference<Double> qcrswdl, AtomicReference<Double> qcyswdl, AtomicReference<Double> qcnswdl,String rcode,String ycode,String ncode) {
|
|
|
+ //-------------------------------------------期次上网电量
|
|
|
+ fcrswdl.updateAndGet(v -> new Double((double) (v + qcrswdl.get())));
|
|
|
+ //期次日上网发电量
|
|
|
+ PointData r = new PointData();
|
|
|
+ r.setPointTime(currentDate.getTime());
|
|
|
+ r.setPointValue(String.valueOf(qcrswdl.get()));
|
|
|
+ r.setPointValueInDouble(qcrswdl.get());
|
|
|
+ r.setEdnaId(projectmap.get(rcode).getCode());
|
|
|
+ r.setPointName(projectmap.get(rcode).getName());
|
|
|
+ resultList.add(r);
|
|
|
+ fcyswdl.updateAndGet(v -> new Double((double) (v + qcyswdl.get())));
|
|
|
+ //期次月上网发电量
|
|
|
+ PointData y = new PointData();
|
|
|
+ y.setPointTime(currentDate.getTime());
|
|
|
+ y.setPointValue(String.valueOf(qcyswdl.get()));
|
|
|
+ y.setPointValueInDouble(qcyswdl.get());
|
|
|
+ y.setEdnaId(projectmap.get(ycode).getCode());
|
|
|
+ y.setPointName(projectmap.get(ycode).getName());
|
|
|
+ resultList.add(y);
|
|
|
+ fcnswdl.updateAndGet(v -> new Double((double) (v + qcnswdl.get())));
|
|
|
+ //期次年上网发电量
|
|
|
+ PointData n = new PointData();
|
|
|
+ n.setPointTime(currentDate.getTime());
|
|
|
+ n.setPointValue(String.valueOf(qcnswdl.get()));
|
|
|
+ n.setPointValueInDouble(qcnswdl.get());
|
|
|
+ n.setEdnaId(projectmap.get(ncode).getCode());
|
|
|
+ n.setPointName(projectmap.get(ncode).getName());
|
|
|
+ resultList.add(n);
|
|
|
}
|
|
|
|
|
|
+ private void projectFdl(List<PointData> resultList, Date currentDate, AtomicReference<Double> fcrfdl, AtomicReference<Double> fcyfdl, AtomicReference<Double> fcnfdl, Map<String, Windpowerstationpointnew> projectmap, AtomicReference<Double> qcrfdl, AtomicReference<Double> qcyfdl, AtomicReference<Double> qcnfdl) {
|
|
|
+ //-------------------------------------------期次发电量
|
|
|
+ fcrfdl.updateAndGet(v -> new Double((double) (v + qcrfdl.get())));
|
|
|
+ //期次日发电量
|
|
|
+ PointData r = new PointData();
|
|
|
+ r.setPointTime(currentDate.getTime());
|
|
|
+ r.setPointValue(String.valueOf(qcrfdl.get()));
|
|
|
+ r.setPointValueInDouble(qcrfdl.get());
|
|
|
+ r.setEdnaId(projectmap.get(Contant.RFDLB).getCode());
|
|
|
+ r.setPointName(projectmap.get(Contant.RFDLB).getName());
|
|
|
+ resultList.add(r);
|
|
|
+ fcyfdl.updateAndGet(v -> new Double((double) (v + qcyfdl.get())));
|
|
|
+ //期次月发电量
|
|
|
+ PointData y = new PointData();
|
|
|
+ y.setPointTime(currentDate.getTime());
|
|
|
+ y.setPointValue(String.valueOf(qcyfdl.get()));
|
|
|
+ y.setPointValueInDouble(qcyfdl.get());
|
|
|
+ y.setEdnaId(projectmap.get(Contant.YFDLB).getCode());
|
|
|
+ y.setPointName(projectmap.get(Contant.YFDLB).getName());
|
|
|
+ resultList.add(y);
|
|
|
+ fcnfdl.updateAndGet(v -> new Double((double) (v + qcnfdl.get())));
|
|
|
+ //期次年发电量
|
|
|
+ PointData n = new PointData();
|
|
|
+ n.setPointTime(currentDate.getTime());
|
|
|
+ n.setPointValue(String.valueOf(qcnfdl.get()));
|
|
|
+ n.setPointValueInDouble(qcnfdl.get());
|
|
|
+ n.setEdnaId(projectmap.get(Contant.NFDLB).getCode());
|
|
|
+ n.setPointName(projectmap.get(Contant.NFDLB).getName());
|
|
|
+ resultList.add(n);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|