|
@@ -4,53 +4,430 @@ package com.gyee.generation.service.realtimelibrary;
|
|
|
@date 2022/11/4-17:09
|
|
|
*/
|
|
|
|
|
|
-import com.gyee.common.contant.Contant;
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.common.model.PointData;
|
|
|
import com.gyee.common.util.DateUtils;
|
|
|
+import com.gyee.common.util.algorithm.Underdelivery;
|
|
|
import com.gyee.generation.init.CacheContext;
|
|
|
-import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
|
|
|
-import com.gyee.generation.model.auto.ProBasicWindturbine;
|
|
|
+import com.gyee.generation.model.auto.*;
|
|
|
import com.gyee.generation.util.PointUtil;
|
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
|
@Service
|
|
|
public class RealtimeService {
|
|
|
@Resource
|
|
|
private IEdosUtil edosUtil;
|
|
|
|
|
|
+ /**
|
|
|
+ * 存储补风风速实时点,理论保证自算最优可用功率,
|
|
|
+ *
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
public void savaRealtimeTarget() throws Exception {
|
|
|
- List<PointData> resultList = new ArrayList<>();
|
|
|
+
|
|
|
List<ProBasicWindturbine> wtls = CacheContext.wtls;
|
|
|
+ List<ProBasicLine> lnls = CacheContext.lnls;
|
|
|
+ List<ProBasicProject> pjls = CacheContext.pjls;
|
|
|
+ List<ProBasicWindpowerstation> wpls = CacheContext.wpls;
|
|
|
+ Map<String, List<ProBasicWindturbine>> lnwtmap = CacheContext.lnwtmap;
|
|
|
+ Map<String, List<ProBasicLine>> prolinemap = CacheContext.prolinemap;
|
|
|
+ Map<String, List<ProBasicProject>> wppromap = CacheContext.wppromap;
|
|
|
+ Map<String, Map<Double, ProBasicModelPowerRd>> theoreticalPowerMap = CacheContext.theoreticalPowerMap; //理论保证功率
|
|
|
+ Map<String, Map<Double, ProEconWtPowerCurveFitting>> curveFittingPowerMap = CacheContext.curveFittingPowerMap; //最优自算功率
|
|
|
Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
|
|
|
-
|
|
|
+ Map<String, Map<String, ProBasicWppoint>> linepointmap = CacheContext.linepointmap;
|
|
|
+ Map<String, Map<String, ProBasicWppoint>> propointmap = CacheContext.propointmap;
|
|
|
+ Map<String, Map<String, ProBasicWppoint>> wppointmap = CacheContext.wppointmap;
|
|
|
Date currentDate = DateUtils.getCurrentDate();
|
|
|
- wtls.stream().forEach(wt->{
|
|
|
+ Date minute15begin = DateUtils.addMinutes(currentDate, -15);
|
|
|
+ //保存风机点
|
|
|
+ List<PointData> wtResultList = new ArrayList<>();
|
|
|
+ wtls.stream().forEach(wt -> {
|
|
|
Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
|
|
|
ProBasicEquipmentPoint speedPoint = equipmentPointMap.get(ContantXk.CJ_SSFS);
|
|
|
ProBasicEquipmentPoint mxztPoint = equipmentPointMap.get(ContantXk.MXZT);
|
|
|
ProBasicEquipmentPoint ssbfPoint = equipmentPointMap.get(ContantXk.SSBF);
|
|
|
+ ProBasicEquipmentPoint ssglPoint = equipmentPointMap.get(ContantXk.CJ_SSGL);
|
|
|
+ //理论功率测点
|
|
|
+ ProBasicEquipmentPoint llglPoint = equipmentPointMap.get(ContantXk.LLGL);
|
|
|
+ //保证功率测点
|
|
|
+ ProBasicEquipmentPoint bzglPoint = equipmentPointMap.get(ContantXk.BZGL);
|
|
|
+ //自算功率测点
|
|
|
+ ProBasicEquipmentPoint zsglPoint = equipmentPointMap.get(ContantXk.ZSGL);
|
|
|
+ //最优功率测点
|
|
|
+ ProBasicEquipmentPoint zyglPoint = equipmentPointMap.get(ContantXk.ZYGL);
|
|
|
+ //可用功率测点
|
|
|
+ ProBasicEquipmentPoint kyglPoint = equipmentPointMap.get(ContantXk.KYGL);
|
|
|
+ //实时欠发状态
|
|
|
+ ProBasicEquipmentPoint ssqfztPoint = equipmentPointMap.get(ContantXk.SSQFZT);
|
|
|
+ //历史欠发状态
|
|
|
+ ProBasicEquipmentPoint lsqfztPoint = equipmentPointMap.get(ContantXk.LSQFZT);
|
|
|
double mxzt = 0;
|
|
|
double speed = 0;
|
|
|
+ double ssbf = 0;
|
|
|
+ double ssgl = 0;
|
|
|
+ Optional<PointData> ssglOptional = null;
|
|
|
+ Optional<PointData> zsglOptional = null;
|
|
|
try {
|
|
|
- mxzt = edosUtil.getSectionData(mxztPoint,currentDate.getTime()).getPointValueInDouble();
|
|
|
- speed = edosUtil.getSectionData(speedPoint,currentDate.getTime()).getPointValueInDouble();
|
|
|
+ mxzt = edosUtil.getSectionData(mxztPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ speed = edosUtil.getSectionData(speedPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ ssgl = edosUtil.getSectionData(ssglPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ ssglOptional = edosUtil.getHistStat(ssglPoint, minute15begin.getTime() / 1000, currentDate.getTime() / 1000, 1l, 900l, 2).stream().findFirst();
|
|
|
+ zsglOptional = edosUtil.getHistStat(zsglPoint, minute15begin.getTime() / 1000, currentDate.getTime() / 1000, 1l, 900l, 2).stream().findFirst();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- if (mxzt == 12 || mxzt == 13){
|
|
|
+ PointData ssbfPointDate = null;
|
|
|
+ if (mxzt == 12 || mxzt == 13) {
|
|
|
+ //补风算法(后续补充,暂时用0)
|
|
|
+ ssbfPointDate = PointUtil.createPointData(currentDate, 0, ssbfPoint.getNemCode(), ssbfPoint.getName());
|
|
|
+ } else {
|
|
|
+ ssbf = speed;
|
|
|
+ ssbfPointDate = PointUtil.createPointData(currentDate, ssbf, ssbfPoint.getNemCode(), ssbfPoint.getName());
|
|
|
+ }
|
|
|
+ wtResultList.add(ssbfPointDate);
|
|
|
+ ProBasicModelPowerRd basicModelPowerRd = theoreticalPowerMap.get(wt.getModelId()).get(ssbf);
|
|
|
+ wtResultList.add(PointUtil.createPointData(currentDate, basicModelPowerRd.getTheoryPower(), llglPoint.getNemCode(), llglPoint.getName()));
|
|
|
+ wtResultList.add(PointUtil.createPointData(currentDate, basicModelPowerRd.getEnsurePower(), bzglPoint.getNemCode(), bzglPoint.getName()));
|
|
|
+ ProEconWtPowerCurveFitting wtPowerCurveFitting = curveFittingPowerMap.get(wt.getId()).get(ssbf);
|
|
|
+ Double actualPower = wtPowerCurveFitting.getActualPower();
|
|
|
+ double[] underissuanceArray = {0, 1, 2, 3, 8, 9, 11};
|
|
|
+ double qfzt = 0;
|
|
|
+ double lsqfzt = 0;
|
|
|
+ double ssgl15 = 0;
|
|
|
+ double zsgl15 = 0;
|
|
|
+ if (ssglOptional.isPresent()) {
|
|
|
+ ssgl15 = ssglOptional.get().getPointValueInDouble();
|
|
|
+ zsgl15 = zsglOptional.get().getPointValueInDouble();
|
|
|
+ }
|
|
|
+ if (Arrays.asList(underissuanceArray).contains(mxzt)) {
|
|
|
+ qfzt = Underdelivery.underdeliveryStatusReal(ssgl, actualPower);
|
|
|
+ lsqfzt = Underdelivery.underdeliveryStatusReal(ssgl15, zsgl15);
|
|
|
+ }
|
|
|
+ wtResultList.add(PointUtil.createPointData(currentDate, qfzt, ssqfztPoint.getNemCode(), ssqfztPoint.getName()));
|
|
|
+ wtResultList.add(PointUtil.createPointData(currentDate, lsqfzt, lsqfztPoint.getNemCode(), lsqfztPoint.getName()));
|
|
|
|
|
|
- }else {
|
|
|
- resultList.add(PointUtil.createPointData(currentDate,speed,ssbfPoint.getNemCode(),ssbfPoint.getName()));
|
|
|
+ wtResultList.add(PointUtil.createPointData(currentDate, wtPowerCurveFitting.getActualPower(), zsglPoint.getNemCode(), zsglPoint.getName()));
|
|
|
+ wtResultList.add(PointUtil.createPointData(currentDate, wtPowerCurveFitting.getOptimalPower(), zyglPoint.getNemCode(), zyglPoint.getName()));
|
|
|
+
|
|
|
+ if (mxzt == 4 || mxzt == 5 || mxzt == 6 || mxzt == 7) {
|
|
|
+ wtResultList.add(PointUtil.createPointData(currentDate, 0, kyglPoint.getNemCode(), kyglPoint.getName()));
|
|
|
+ } else {
|
|
|
+ wtResultList.add(PointUtil.createPointData(currentDate, wtPowerCurveFitting.getActualPower(), kyglPoint.getNemCode(), kyglPoint.getName()));
|
|
|
}
|
|
|
});
|
|
|
- edosUtil.sendMultiPoint(resultList);
|
|
|
+ edosUtil.sendMultiPoint(wtResultList);
|
|
|
+ //保存线路点
|
|
|
+ List<PointData> lineResultList = new ArrayList<>();
|
|
|
+ lnls.stream().forEach(line -> {
|
|
|
+ List<ProBasicWindturbine> proBasicWindturbines = lnwtmap.get(line.getId());
|
|
|
+ Map<String, ProBasicWppoint> proBasicWppointMap = linepointmap.get(line.getId());
|
|
|
+ AtomicReference<Double> zssbf = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zssgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zllgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zbzgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zzsgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zzygl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zkygl = new AtomicReference<>((double) 0);
|
|
|
+
|
|
|
+ ProBasicWppoint ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJFS);
|
|
|
+ ProBasicWppoint ssglWpPoint = proBasicWppointMap.get(ContantXk.SSZGL);
|
|
|
+ ProBasicWppoint llglWpPoint = proBasicWppointMap.get(ContantXk.SSZLLGL);
|
|
|
+ ProBasicWppoint bzglWpPoint = proBasicWppointMap.get(ContantXk.SSZBZGL);
|
|
|
+ ProBasicWppoint zsglWpPoint = proBasicWppointMap.get(ContantXk.SSZNHGLZS);
|
|
|
+ ProBasicWppoint zyglWpPoint = proBasicWppointMap.get(ContantXk.SSZZYGL);
|
|
|
+ ProBasicWppoint kyglWpPoint = proBasicWppointMap.get(ContantXk.SSZKYGL);
|
|
|
+
|
|
|
+ proBasicWindturbines.stream().forEach(wt -> {
|
|
|
+ Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
|
|
|
+ ProBasicEquipmentPoint ssbfPoint = equipmentPointMap.get(ContantXk.SSBF);
|
|
|
+ ProBasicEquipmentPoint ssglPoint = equipmentPointMap.get(ContantXk.CJ_SSGL);
|
|
|
+ //理论功率测点
|
|
|
+ ProBasicEquipmentPoint llglPoint = equipmentPointMap.get(ContantXk.LLGL);
|
|
|
+ //保证功率测点
|
|
|
+ ProBasicEquipmentPoint bzglPoint = equipmentPointMap.get(ContantXk.BZGL);
|
|
|
+ //自算功率测点
|
|
|
+ ProBasicEquipmentPoint zsglPoint = equipmentPointMap.get(ContantXk.ZSGL);
|
|
|
+ //最优功率测点
|
|
|
+ ProBasicEquipmentPoint zyglPoint = equipmentPointMap.get(ContantXk.ZYGL);
|
|
|
+ //可用功率测点
|
|
|
+ ProBasicEquipmentPoint kyglPoint = equipmentPointMap.get(ContantXk.KYGL);
|
|
|
+
|
|
|
+ zssbf.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(ssbfPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zssgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(ssglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zllgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(llglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zbzgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(bzglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zzsgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(zsglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zzygl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(zyglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zkygl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(kyglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ lineResultList.add(PointUtil.createPointData(currentDate, zssbf.get() / proBasicWindturbines.size(), ssfsWpPoint.getNemCode(), ssfsWpPoint.getName()));
|
|
|
+ lineResultList.add(PointUtil.createPointData(currentDate, zssgl.get(), ssglWpPoint.getNemCode(), ssglWpPoint.getName()));
|
|
|
+ lineResultList.add(PointUtil.createPointData(currentDate, zllgl.get(), llglWpPoint.getNemCode(), llglWpPoint.getName()));
|
|
|
+ lineResultList.add(PointUtil.createPointData(currentDate, zbzgl.get(), bzglWpPoint.getNemCode(), bzglWpPoint.getName()));
|
|
|
+ lineResultList.add(PointUtil.createPointData(currentDate, zzsgl.get(), zsglWpPoint.getNemCode(), zsglWpPoint.getName()));
|
|
|
+ lineResultList.add(PointUtil.createPointData(currentDate, zzygl.get(), zyglWpPoint.getNemCode(), zyglWpPoint.getName()));
|
|
|
+ lineResultList.add(PointUtil.createPointData(currentDate, zkygl.get(), kyglWpPoint.getNemCode(), kyglWpPoint.getName()));
|
|
|
+ });
|
|
|
+ edosUtil.sendMultiPoint(lineResultList);
|
|
|
+ //保存期次点
|
|
|
+ List<PointData> projectResultList = new ArrayList<>();
|
|
|
+ pjls.stream().forEach(project -> {
|
|
|
+ List<ProBasicLine> proBasicLines = prolinemap.get(project.getId());
|
|
|
+ Map<String, ProBasicWppoint> proBasicWppointMap = propointmap.get(project.getId());
|
|
|
+ AtomicReference<Double> zssbf = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zssgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zllgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zbzgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zzsgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zzygl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zkygl = new AtomicReference<>((double) 0);
|
|
|
+
|
|
|
+ ProBasicWppoint ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJFS);
|
|
|
+ ProBasicWppoint ssglWpPoint = proBasicWppointMap.get(ContantXk.SSZGL);
|
|
|
+ ProBasicWppoint llglWpPoint = proBasicWppointMap.get(ContantXk.SSZLLGL);
|
|
|
+ ProBasicWppoint bzglWpPoint = proBasicWppointMap.get(ContantXk.SSZBZGL);
|
|
|
+ ProBasicWppoint zsglWpPoint = proBasicWppointMap.get(ContantXk.SSZNHGLZS);
|
|
|
+ ProBasicWppoint zyglWpPoint = proBasicWppointMap.get(ContantXk.SSZZYGL);
|
|
|
+ ProBasicWppoint kyglWpPoint = proBasicWppointMap.get(ContantXk.SSZKYGL);
|
|
|
+
|
|
|
+ proBasicLines.stream().forEach(wp -> {
|
|
|
+ Map<String, ProBasicWppoint> basicWppointMap = linepointmap.get(wp.getId());
|
|
|
+ ProBasicWppoint ssbfPoint = basicWppointMap.get(ContantXk.SSPJFS);
|
|
|
+ ProBasicWppoint ssglPoint = basicWppointMap.get(ContantXk.SSZGL);
|
|
|
+ //理论功率测点
|
|
|
+ ProBasicWppoint llglPoint = basicWppointMap.get(ContantXk.SSZLLGL);
|
|
|
+ //保证功率测点
|
|
|
+ ProBasicWppoint bzglPoint = basicWppointMap.get(ContantXk.SSZBZGL);
|
|
|
+ //自算功率测点
|
|
|
+ ProBasicWppoint zsglPoint = basicWppointMap.get(ContantXk.SSZNHGLZS);
|
|
|
+ //最优功率测点
|
|
|
+ ProBasicWppoint zyglPoint = basicWppointMap.get(ContantXk.SSZZYGL);
|
|
|
+ //可用功率测点
|
|
|
+ ProBasicWppoint kyglPoint = basicWppointMap.get(ContantXk.SSZKYGL);
|
|
|
+
|
|
|
+ zssbf.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(ssbfPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zssgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(ssglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zllgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(llglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zbzgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(bzglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zzsgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(zsglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zzygl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(zyglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zkygl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(kyglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ projectResultList.add(PointUtil.createPointData(currentDate, zssbf.get() / proBasicLines.size(), ssfsWpPoint.getNemCode(), ssfsWpPoint.getName()));
|
|
|
+ projectResultList.add(PointUtil.createPointData(currentDate, zssgl.get(), ssglWpPoint.getNemCode(), ssglWpPoint.getName()));
|
|
|
+ projectResultList.add(PointUtil.createPointData(currentDate, zllgl.get(), llglWpPoint.getNemCode(), llglWpPoint.getName()));
|
|
|
+ projectResultList.add(PointUtil.createPointData(currentDate, zbzgl.get(), bzglWpPoint.getNemCode(), bzglWpPoint.getName()));
|
|
|
+ projectResultList.add(PointUtil.createPointData(currentDate, zzsgl.get(), zsglWpPoint.getNemCode(), zsglWpPoint.getName()));
|
|
|
+ projectResultList.add(PointUtil.createPointData(currentDate, zzygl.get(), zyglWpPoint.getNemCode(), zyglWpPoint.getName()));
|
|
|
+ projectResultList.add(PointUtil.createPointData(currentDate, zkygl.get(), kyglWpPoint.getNemCode(), kyglWpPoint.getName()));
|
|
|
+ });
|
|
|
+ edosUtil.sendMultiPoint(projectResultList);
|
|
|
+ //保存场站点
|
|
|
+ List<PointData> wpResultList = new ArrayList<>();
|
|
|
+ wpls.stream().forEach(wps -> {
|
|
|
+ List<ProBasicProject> proBasicProjects = wppromap.get(wps.getId());
|
|
|
+ Map<String, ProBasicWppoint> proBasicWppointMap = wppointmap.get(wps.getId());
|
|
|
+ AtomicReference<Double> zssbf = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zssgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zllgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zbzgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zzsgl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zzygl = new AtomicReference<>((double) 0);
|
|
|
+ AtomicReference<Double> zkygl = new AtomicReference<>((double) 0);
|
|
|
+
|
|
|
+ ProBasicWppoint ssfsWpPoint = proBasicWppointMap.get(ContantXk.SSPJFS);
|
|
|
+ ProBasicWppoint ssglWpPoint = proBasicWppointMap.get(ContantXk.SSZGL);
|
|
|
+ ProBasicWppoint llglWpPoint = proBasicWppointMap.get(ContantXk.SSZLLGL);
|
|
|
+ ProBasicWppoint bzglWpPoint = proBasicWppointMap.get(ContantXk.SSZBZGL);
|
|
|
+ ProBasicWppoint zsglWpPoint = proBasicWppointMap.get(ContantXk.SSZNHGLZS);
|
|
|
+ ProBasicWppoint zyglWpPoint = proBasicWppointMap.get(ContantXk.SSZZYGL);
|
|
|
+ ProBasicWppoint kyglWpPoint = proBasicWppointMap.get(ContantXk.SSZKYGL);
|
|
|
+
|
|
|
+ proBasicProjects.stream().forEach(wp -> {
|
|
|
+ Map<String, ProBasicWppoint> basicWppointMap = propointmap.get(wp.getId());
|
|
|
+ ProBasicWppoint ssbfPoint = basicWppointMap.get(ContantXk.SSPJFS);
|
|
|
+ ProBasicWppoint ssglPoint = basicWppointMap.get(ContantXk.SSZGL);
|
|
|
+ //理论功率测点
|
|
|
+ ProBasicWppoint llglPoint = basicWppointMap.get(ContantXk.SSZLLGL);
|
|
|
+ //保证功率测点
|
|
|
+ ProBasicWppoint bzglPoint = basicWppointMap.get(ContantXk.SSZBZGL);
|
|
|
+ //自算功率测点
|
|
|
+ ProBasicWppoint zsglPoint = basicWppointMap.get(ContantXk.SSZNHGLZS);
|
|
|
+ //最优功率测点
|
|
|
+ ProBasicWppoint zyglPoint = basicWppointMap.get(ContantXk.SSZZYGL);
|
|
|
+ //可用功率测点
|
|
|
+ ProBasicWppoint kyglPoint = basicWppointMap.get(ContantXk.SSZKYGL);
|
|
|
+
|
|
|
+ zssbf.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(ssbfPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zssgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(ssglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zllgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(llglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zbzgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(bzglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zzsgl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(zsglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zzygl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(zyglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ zkygl.updateAndGet(v -> {
|
|
|
+ try {
|
|
|
+ return new Double((double) (v + edosUtil.getSectionData(kyglPoint, currentDate.getTime()).getPointValueInDouble()));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ wpResultList.add(PointUtil.createPointData(currentDate, zssbf.get() / proBasicProjects.size(), ssfsWpPoint.getNemCode(), ssfsWpPoint.getName()));
|
|
|
+ wpResultList.add(PointUtil.createPointData(currentDate, zssgl.get(), ssglWpPoint.getNemCode(), ssglWpPoint.getName()));
|
|
|
+ wpResultList.add(PointUtil.createPointData(currentDate, zllgl.get(), llglWpPoint.getNemCode(), llglWpPoint.getName()));
|
|
|
+ wpResultList.add(PointUtil.createPointData(currentDate, zbzgl.get(), bzglWpPoint.getNemCode(), bzglWpPoint.getName()));
|
|
|
+ wpResultList.add(PointUtil.createPointData(currentDate, zzsgl.get(), zsglWpPoint.getNemCode(), zsglWpPoint.getName()));
|
|
|
+ wpResultList.add(PointUtil.createPointData(currentDate, zzygl.get(), zyglWpPoint.getNemCode(), zyglWpPoint.getName()));
|
|
|
+ wpResultList.add(PointUtil.createPointData(currentDate, zkygl.get(), kyglWpPoint.getNemCode(), kyglWpPoint.getName()));
|
|
|
+ });
|
|
|
+ edosUtil.sendMultiPoint(wpResultList);
|
|
|
+
|
|
|
}
|
|
|
}
|