|
@@ -1,17 +1,21 @@
|
|
|
package com.gyee.generation.service.realtimelibrary;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.common.model.PointData;
|
|
|
import com.gyee.common.util.DateUtils;
|
|
|
import com.gyee.common.util.DoubleUtils;
|
|
|
import com.gyee.generation.init.CacheContext;
|
|
|
import com.gyee.generation.model.auto.*;
|
|
|
-import com.gyee.generation.model.vo.ExcelVo;
|
|
|
-import com.gyee.generation.util.ExcelExport;
|
|
|
+import com.gyee.generation.model.vo.CurveType;
|
|
|
+import com.gyee.generation.model.vo.PowerVo;
|
|
|
import com.gyee.generation.util.PointUtil;
|
|
|
import com.gyee.generation.util.StringUtils;
|
|
|
+import com.gyee.generation.util.math.LightToTheoreticalPower;
|
|
|
import com.gyee.generation.util.math.PowerIntegration;
|
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
|
+import com.gyee.generation.util.redis.RedisService;
|
|
|
import lombok.SneakyThrows;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -19,7 +23,6 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -38,6 +41,10 @@ public class CycleCalculationRebuildService {
|
|
|
@Value("${notCalculatePower}")
|
|
|
private String notCalculatePower;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private RedisService redisService;
|
|
|
+ @Resource
|
|
|
+ private LightToTheoreticalPower lightToTheoreticalPower;
|
|
|
@SneakyThrows
|
|
|
public void saveCyle(Date currentDate) throws Exception {
|
|
|
|
|
@@ -45,25 +52,18 @@ public class CycleCalculationRebuildService {
|
|
|
List<String> runWpids = Arrays.asList(notCalculatePower.split(","));
|
|
|
|
|
|
|
|
|
- Calendar cal= Calendar.getInstance();
|
|
|
-
|
|
|
int day = DateUtils.getDay(currentDate);
|
|
|
int month = DateUtils.getMonth(currentDate);
|
|
|
- Date date = currentDate;
|
|
|
+ Date date = DateUtils.addMinutes(currentDate, -5);
|
|
|
Date date15age = DateUtils.addMinutes(currentDate, -15);
|
|
|
|
|
|
-
|
|
|
Date samedayZero = DateUtils.truncate(currentDate);
|
|
|
Date samedayZeroAdd15 = DateUtils.addMinutes(samedayZero, 15);
|
|
|
|
|
|
- cal.setTime(currentDate);
|
|
|
- cal.set(Calendar.DAY_OF_MONTH,1);
|
|
|
-
|
|
|
- Date monthFirstZero=DateUtils.truncate(cal.getTime());
|
|
|
+ Date monthFirstZero = DateUtils.getMonthFirstZero();
|
|
|
Date monthFirstZeroAdd15 = DateUtils.addMinutes(monthFirstZero, 15);
|
|
|
- cal.set(Calendar.DAY_OF_YEAR,1);
|
|
|
- cal.set(Calendar.MONTH,0);
|
|
|
- Date yearFirstZero =DateUtils.truncate(cal.getTime());
|
|
|
+
|
|
|
+ Date yearFirstZero = DateUtils.getYearFirstZero();
|
|
|
Date yearFirstZeroAdd15 = DateUtils.addMinutes(yearFirstZero, 15);
|
|
|
|
|
|
|
|
@@ -86,6 +86,10 @@ public class CycleCalculationRebuildService {
|
|
|
|
|
|
Map<String, Double> dataMap = new HashMap<>();
|
|
|
Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
|
|
|
+
|
|
|
+ Map<String, ProBasicPowerstationPoint> wpPointMap = wppointmap.get(wt.getWindpowerstationId());
|
|
|
+
|
|
|
+ ProBasicPowerstationPoint gzdPoint=wpPointMap.get("GCGZQD");
|
|
|
ProBasicEquipmentPoint ssfsPoint = equipmentPointMap.get(ContantXk.CJ_SSFS);
|
|
|
ProBasicEquipmentPoint ssglPoint = equipmentPointMap.get(ContantXk.CJ_SSGL);
|
|
|
ProBasicEquipmentPoint rssfdlPoint = equipmentPointMap.get(ContantXk.CJ_FDL);
|
|
@@ -188,6 +192,7 @@ public class CycleCalculationRebuildService {
|
|
|
double ssztmx = edosUtil.getRealData(mxztPoint).getPointValueInDouble();
|
|
|
|
|
|
if (ssztmx == 12 || ssztmx == 13) {
|
|
|
+
|
|
|
continue;
|
|
|
|
|
|
} else {
|
|
@@ -198,16 +203,38 @@ public class CycleCalculationRebuildService {
|
|
|
double yearfirstfdl = edosUtil.getSectionData(rssfdlPoint, yearFirstZero.getTime()).getPointValueInDouble() * rssfdlPoint.getCoefficient();
|
|
|
double date15agofdl = edosUtil.getSectionData(rssfdlPoint, date15age.getTime()).getPointValueInDouble() * rssfdlPoint.getCoefficient();
|
|
|
|
|
|
+
|
|
|
+ Calendar c=Calendar.getInstance();
|
|
|
+ c.setTime(currentDate);
|
|
|
+ if(c.get(Calendar.DAY_OF_MONTH)!=1)
|
|
|
+ {
|
|
|
+ c.add(Calendar.DAY_OF_MONTH,-1);
|
|
|
+ c.set(Calendar.HOUR_OF_DAY,23);
|
|
|
+ c.set(Calendar.MINUTE,59);
|
|
|
+ }
|
|
|
+
|
|
|
+ double yssfdl = edosUtil.getSectionData(yfdlPoint, c.getTime().getTime()).getPointValueInDouble() ;
|
|
|
+ double nssfdl = edosUtil.getSectionData(nfdlPoint, c.getTime().getTime()).getPointValueInDouble();
|
|
|
+
|
|
|
double rfdl = ssfdl - zerofdl;
|
|
|
|
|
|
if (rfdl <= 0 || rfdl > modelpower.get(wt.getModelId()) * 24 * 1.5) {
|
|
|
rfdl = 0;
|
|
|
- List<PointData> ssglList = edosUtil.getHistoryDatasSnap(ssglPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 1800l);
|
|
|
+ List<PointData> ssglList = edosUtil.getHistoryDatasSnap(ssglPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 900l);
|
|
|
|
|
|
if (!ssglList.isEmpty()) {
|
|
|
Map<Integer, Double> map = new HashMap<>();
|
|
|
+ int time=0;
|
|
|
for (int i = 0; i < ssglList.size(); i++) {
|
|
|
- map.put(i, ssglList.get(i).getPointValueInDouble());
|
|
|
+
|
|
|
+ double modelvalue= modelpower.get(wt.getModelId())*1.5;
|
|
|
+
|
|
|
+ if(ssglList.get(i).getPointValueInDouble() >0 && ssglList.get(i).getPointValueInDouble()<modelvalue)
|
|
|
+ {
|
|
|
+ map.put(time, ssglList.get(i).getPointValueInDouble());
|
|
|
+ time++;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
PowerIntegration pi = new PowerIntegration();
|
|
|
|
|
@@ -216,36 +243,47 @@ public class CycleCalculationRebuildService {
|
|
|
|
|
|
}
|
|
|
|
|
|
-// if(wt.getWindpowerstationId().equals("SXJ_KGDL_TZ_GDC_STA"))
|
|
|
-// {
|
|
|
-// System.out.println("");
|
|
|
-// }
|
|
|
|
|
|
- double yfdl = ssfdl - monthfirstfdl;
|
|
|
+
|
|
|
+ double yfdl = yssfdl - monthfirstfdl;
|
|
|
+ if(c.get(Calendar.DAY_OF_MONTH)==1)
|
|
|
+ {
|
|
|
+ yfdl=rfdl;
|
|
|
+ }else {
|
|
|
+ yfdl=yfdl+rfdl;
|
|
|
+ }
|
|
|
+
|
|
|
if (yfdl <= 0 || yfdl < rfdl || yfdl > modelpower.get(wt.getModelId()) * 24 * 31 * 1.5) {
|
|
|
yfdl = rfdl * day;
|
|
|
}
|
|
|
|
|
|
- double nfdl = ssfdl - yearfirstfdl;
|
|
|
+ double nfdl = nssfdl - yearfirstfdl;
|
|
|
+
|
|
|
+
|
|
|
+ if(c.get(Calendar.DAY_OF_MONTH)==1 && c.get(Calendar.MONTH)==0)
|
|
|
+ {
|
|
|
+ nfdl=rfdl;
|
|
|
+ }else {
|
|
|
+ nfdl=nfdl+rfdl;
|
|
|
+ }
|
|
|
if (nfdl <= 0 || nfdl < yfdl || nfdl > modelpower.get(wt.getModelId()) * 24 * 31 * 12 * 1.5) {
|
|
|
nfdl = yfdl * month;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//
|
|
|
// if(wt.getWindpowerstationId().equals("SXJ_KGDL_YTY_FDC_STA"))
|
|
|
// {
|
|
|
// System.out.println("");
|
|
|
// }
|
|
|
if (!runWpids.contains(wt.getWindpowerstationId())) {
|
|
|
-
|
|
|
wtResultList.add(PointUtil.createPointData(date, rfdl, rfdlPoint.getNemCode(), rfdlPoint.getName()));
|
|
|
wtResultList.add(PointUtil.createPointData(date, yfdl, yfdlPoint.getNemCode(), yfdlPoint.getName()));
|
|
|
wtResultList.add(PointUtil.createPointData(date, nfdl, nfdlPoint.getNemCode(), nfdlPoint.getName()));
|
|
|
}
|
|
|
|
|
|
-// wtResultList.add(PointUtil.createPointData(date, rfdl, rfdlPoint.getNemCode(), rfdlPoint.getName()));
|
|
|
-// wtResultList.add(PointUtil.createPointData(date, yfdl, yfdlPoint.getNemCode(), yfdlPoint.getName()));
|
|
|
-// wtResultList.add(PointUtil.createPointData(date, nfdl, nfdlPoint.getNemCode(), nfdlPoint.getName()));
|
|
|
-
|
|
|
double fdl15 = ssfdl - date15agofdl;
|
|
|
wtResultList.add(PointUtil.createPointData(date, fdl15, fdl15Point.getNemCode(), fdl15Point.getName()));
|
|
|
|
|
@@ -265,7 +303,7 @@ public class CycleCalculationRebuildService {
|
|
|
wtResultList.add(PointUtil.createPointData(date, zhd15, zhd15Point.getNemCode(), zhd15Point.getName()));
|
|
|
|
|
|
|
|
|
- List<PointData> ssfsList = edosUtil.getHistStat(ssfsPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 1800l, 2);
|
|
|
+ List<PointData> ssfsList = edosUtil.getHistStat(ssfsPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, 1l, 900l, 2);
|
|
|
Optional<PointData> ssfsFirst = ssfsList.stream().findFirst();
|
|
|
if (ssfsFirst.isPresent()) {
|
|
|
double value = ssfsFirst.get().getPointValueInDouble();
|
|
@@ -280,19 +318,19 @@ public class CycleCalculationRebuildService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- List<PointData> ssglList = edosUtil.getHistStat(ssglPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 1800l, 2);
|
|
|
+ List<PointData> ssglList = edosUtil.getHistStat(ssglPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, 1l, 900l, 2);
|
|
|
Optional<PointData> ssglFirst = ssglList.stream().findFirst();
|
|
|
if (ssglFirst.isPresent()) {
|
|
|
dataMap.put("pjgl", ssglFirst.get().getPointValueInDouble());
|
|
|
}
|
|
|
-// List<PointData> kyglList = edosUtil.getHistStat(kyglPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, 1l, 1800l, 2);
|
|
|
+// List<PointData> kyglList = edosUtil.getHistStat(kyglPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, 1l, 900l, 2);
|
|
|
// Optional<PointData> kyglFirst = kyglList.stream().findFirst();
|
|
|
// if (kyglFirst.isPresent()) {
|
|
|
// dataMap.put("kydl", kyglFirst.get().getPointValueInDouble());
|
|
|
// }
|
|
|
|
|
|
dataMap.put("kydl", 0.0);
|
|
|
- List<PointData> zsglList = edosUtil.getHistStat(zsglPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 1800l, 2);
|
|
|
+ List<PointData> zsglList = edosUtil.getHistStat(zsglPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, 1l, 900l, 2);
|
|
|
Optional<PointData> zsglFirst = zsglList.stream().findFirst();
|
|
|
if (zsglFirst.isPresent()) {
|
|
|
dataMap.put("zsdl", zsglFirst.get().getPointValueInDouble());
|
|
@@ -302,41 +340,110 @@ public class CycleCalculationRebuildService {
|
|
|
// List<PointData> ssglPointDatas = edosUtil.getHistoryDatasSnap(ssglPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
|
|
|
//拟合功率
|
|
|
// List<PointData> zsglPointDatas = edosUtil.getHistoryDatasSnap(zsglPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
|
|
|
- List<PointData> mxztPointDatas = edosUtil.getHistoryDatasSnap(mxztPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 1800l);
|
|
|
- long count=mxztPointDatas.size();
|
|
|
- //实时功率平均值
|
|
|
- List<PointData> ssglPointDatas = edosUtil.getHistStat(ssglPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, count, 1800l, 2);
|
|
|
- //实时风速平均值
|
|
|
- List<PointData> pjfsointDatas = edosUtil.getHistStat(ssfsPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, count, 1800l, 2);
|
|
|
-
|
|
|
-// if(wt.getId().equals("SXJ_KGDL_GJY_F_WT_0033_EQ"))
|
|
|
-// {
|
|
|
-// System.out.println("");
|
|
|
-// }
|
|
|
//故障
|
|
|
- double gzss = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 4,wt);
|
|
|
+ double gzss =0.0;
|
|
|
//故障受累
|
|
|
- double gzsl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 5,wt);
|
|
|
+ double gzsl =0.0;
|
|
|
//检修
|
|
|
- double jxss = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 6,wt);
|
|
|
+ double jxss=0.0;
|
|
|
//检修受累
|
|
|
- double jxsl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 7,wt);
|
|
|
+ double jxsl =0.0;
|
|
|
//待机
|
|
|
- double djss = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 0,wt)*0.1;
|
|
|
+ double djss=0.0;
|
|
|
//手动停机
|
|
|
- double sdtj = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 1,wt)*0.1;
|
|
|
+ double sdtj =0.0;
|
|
|
//性能
|
|
|
- double xnss = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 2,wt)*0.1;
|
|
|
+ double xnss =0.0;
|
|
|
//发电降出力
|
|
|
- double fdjcl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 3,wt)*0.1;
|
|
|
+ double fdjcl =0.0;
|
|
|
//限电降出力
|
|
|
- double xdjcl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 8,wt);
|
|
|
+ double xdjcl =0.0;
|
|
|
//限电停机
|
|
|
- double xdtj = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 9,wt);
|
|
|
+ double xdtj =0.0;
|
|
|
//电网受累
|
|
|
- double dwsl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 10,wt);
|
|
|
+ double dwsl =0.0;
|
|
|
//环境受累
|
|
|
- double hjsl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 11,wt);
|
|
|
+ double hjsl =0.0;
|
|
|
+ if(wt.getId().contains("_F_"))
|
|
|
+ {
|
|
|
+ List<PointData> mxztPointDatas = edosUtil.getHistoryDatasSnap(mxztPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
|
|
|
+
|
|
|
+ //实时功率平均值
|
|
|
+ List<PointData> ssglPointDatas = edosUtil.getHistStat(ssglPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, 15l, 60l, 2);
|
|
|
+ //实时风速平均值
|
|
|
+ List<PointData> pjfsointDatas = edosUtil.getHistStat(ssfsPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, 15l, 60l, 2);
|
|
|
+ //故障
|
|
|
+ gzss = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 4,wt);
|
|
|
+ //故障受累
|
|
|
+ gzsl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 5,wt);
|
|
|
+ //检修
|
|
|
+ jxss = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 6,wt);
|
|
|
+ //检修受累
|
|
|
+ jxsl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 7,wt);
|
|
|
+ //待机
|
|
|
+ djss = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 0,wt)*0.1;
|
|
|
+ //手动停机
|
|
|
+ sdtj = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 1,wt)*0.1;
|
|
|
+ //性能
|
|
|
+ xnss = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 2,wt)*0.1;
|
|
|
+ //发电降出力
|
|
|
+ fdjcl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 3,wt)*0.1;
|
|
|
+ //限电降出力
|
|
|
+ xdjcl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 8,wt);
|
|
|
+ //限电停机
|
|
|
+ xdtj = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 9,wt);
|
|
|
+ //电网受累
|
|
|
+ dwsl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 10,wt);
|
|
|
+ //环境受累
|
|
|
+ hjsl = generalLossBySpeed(mxztPointDatas, pjfsointDatas, ssglPointDatas, 11,wt);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ List<PointData> mxztPointDatas = edosUtil.getHistoryDatasSnap(mxztPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
|
|
|
+ List<PointData> rfdlPointDatas = edosUtil.getHistoryDatasSnap(rfdlPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
|
|
|
+ List<PointData> gzdPointDatas = edosUtil.getHistoryDatasSnap(gzdPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
|
|
|
+
|
|
|
+// if(wt.getId().equals("SXJ_KGDL_JR_G_IN_0304_EQ"))
|
|
|
+// {
|
|
|
+// System.out.println("");
|
|
|
+// }
|
|
|
+ if(CacheContext.modelMap.containsKey(wt.getModelId()))
|
|
|
+ {
|
|
|
+ if(!rfdlPointDatas.isEmpty() &&rfdlPointDatas.size()>=2 )
|
|
|
+ {
|
|
|
+ rfdlPointDatas.get(0).setPointValueInDouble(rfdlPointDatas.get(1).getPointValueInDouble());
|
|
|
+ }
|
|
|
+ ProEconEquipmentmodel model=CacheContext.modelMap.get(wt.getModelId());
|
|
|
+ PowerVo vo= lightToTheoreticalPower.calculateEnergy(rfdlPointDatas, gzdPointDatas, mxztPointDatas,gzdPoint.getNemCode(),model.getPowerProduction());
|
|
|
+ //故障
|
|
|
+ gzss = vo.getRgzssdl();
|
|
|
+ //故障受累
|
|
|
+ gzsl = vo.getRcnslgzssdl();
|
|
|
+ //检修
|
|
|
+ jxss = vo.getRjxssdl();
|
|
|
+ //检修受累
|
|
|
+ jxsl = vo.getRcnsljxssdl();
|
|
|
+ //待机
|
|
|
+ djss = vo.getRdjssdl();
|
|
|
+ //手动停机
|
|
|
+ sdtj = vo.getRsdtjssdl();
|
|
|
+ //性能
|
|
|
+ xnss = vo.getRxnssdl();
|
|
|
+ //发电降出力
|
|
|
+ fdjcl = vo.getRqxjclssdl();
|
|
|
+ //限电降出力
|
|
|
+ xdjcl = vo.getRxdjclssdl();
|
|
|
+ //限电停机
|
|
|
+ xdtj = vo.getRxdtjssdl();
|
|
|
+ //电网受累
|
|
|
+ dwsl = vo.getRcwsldwssdl();
|
|
|
+ //环境受累
|
|
|
+ hjsl = vo.getRcwsltqssdl();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
double rgzss = 0;
|
|
|
double rgzsl = 0;
|
|
@@ -429,10 +536,64 @@ public class CycleCalculationRebuildService {
|
|
|
lsfs = 0;
|
|
|
}
|
|
|
rpjfs = DoubleUtils.ave(lsfs, dataMap.get("pjfs"));
|
|
|
+
|
|
|
+ double lsgl = edosUtil.getSectionData(rpjglPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rpjgl = DoubleUtils.ave(lsgl, dataMap.get("pjgl"));
|
|
|
+ double lskydl = edosUtil.getSectionData(rkydlPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rkydl = DoubleUtils.sum(lskydl, dataMap.get("kydl"));
|
|
|
+ double lslldlzs = edosUtil.getSectionData(rlldlzsPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rzsdl = DoubleUtils.sum(lslldlzs, dataMap.get("zsdl"));
|
|
|
+ double lsgzss = edosUtil.getSectionData(rgzssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rgzss = DoubleUtils.sum(lsgzss, gzss);
|
|
|
+ double lsgzsl = edosUtil.getSectionData(rgzslPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rgzsl = DoubleUtils.sum(lsgzsl, gzsl);
|
|
|
+ double lsjxss = edosUtil.getSectionData(rjxssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rjxss = DoubleUtils.sum(lsjxss, jxss);
|
|
|
+ double lsjxsl = edosUtil.getSectionData(rjxslPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rjxsl = DoubleUtils.sum(lsjxsl, jxsl);
|
|
|
+
|
|
|
+ double lsdjss = edosUtil.getSectionData(rdjssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rdjss = DoubleUtils.sum(lsdjss, djss);;
|
|
|
+ double lssdtj = edosUtil.getSectionData(rsdtjPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rsdtj = DoubleUtils.sum(lssdtj, sdtj);;
|
|
|
+ double lsxnss = edosUtil.getSectionData(rxnssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rxnss = DoubleUtils.sum(lsxnss, xnss);;
|
|
|
+
|
|
|
+ double lsfdjcl = edosUtil.getSectionData(rfdjclPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rfdjcl = DoubleUtils.sum(lsfdjcl, fdjcl);
|
|
|
+
|
|
|
+ double lsxdjcl = edosUtil.getSectionData(rxdjclPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rxdjcl = DoubleUtils.sum(lsxdjcl, xdjcl);
|
|
|
+ double lsxdtj = edosUtil.getSectionData(rxdtjPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rxdtj = DoubleUtils.sum(lsxdtj, xdtj);
|
|
|
+ double lsdwsl = edosUtil.getSectionData(rdwslPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rdwsl = DoubleUtils.sum(lsdwsl, dwsl);
|
|
|
+ double lshjsl = edosUtil.getSectionData(rhjslPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rhjsl = DoubleUtils.sum(lshjsl, hjsl);
|
|
|
+
|
|
|
+// if (currentDate.getTime() < samedayZeroAdd15.getTime()) {
|
|
|
+// rgzss = gzss;
|
|
|
+// rgzsl = gzsl;
|
|
|
+// rjxss = jxss;
|
|
|
+// rjxsl = jxsl;
|
|
|
+// rdjss = djss;
|
|
|
+// rsdtj = sdtj;
|
|
|
+// rxnss = xnss;
|
|
|
+// rfdjcl = fdjcl;
|
|
|
+// rxdjcl = xdjcl;
|
|
|
+// rxdtj = xdtj;
|
|
|
+// rdwsl = dwsl;
|
|
|
+// rhjsl = hjsl;
|
|
|
+// }
|
|
|
+ double temp = rgzss + rgzsl + rjxss + rjxsl + rdjss + rsdtj + rxnss + rfdjcl + rxdjcl + rxdtj + rdwsl + rhjsl;
|
|
|
+ if (temp >= 0) {
|
|
|
+ rqfdl = temp;
|
|
|
+ } else {
|
|
|
+ rzfdl = Math.abs(temp);
|
|
|
+ }
|
|
|
} else {
|
|
|
|
|
|
- Date tempdate=DateUtils.truncate(currentDate);
|
|
|
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(ssfsPoint.getNemCode(), tempdate.getTime()/1000, currentDate.getTime()/1000);
|
|
|
+ List<PointData> pointls = edosUtil.getHistoryDatasSnap(gzdPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
|
|
|
if(!pointls.isEmpty())
|
|
|
{
|
|
|
List<PointData> filterls=new ArrayList<>();
|
|
@@ -453,51 +614,40 @@ public class CycleCalculationRebuildService {
|
|
|
//累计光照度
|
|
|
rpjfs = new BigDecimal(avg * hours).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
|
|
|
+
|
|
|
+ dataMap.put("pjfs",rpjfs);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ double lsgl = edosUtil.getSectionData(rpjglPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rpjgl = DoubleUtils.ave(lsgl, dataMap.get("pjgl"));
|
|
|
+ double lskydl = edosUtil.getSectionData(rkydlPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rkydl = DoubleUtils.sum(lskydl, dataMap.get("kydl"));
|
|
|
+ double lslldlzs = edosUtil.getSectionData(rlldlzsPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ rzsdl = DoubleUtils.sum(lslldlzs, dataMap.get("zsdl"));
|
|
|
+ double lsgzss = edosUtil.getSectionData(rgzssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+
|
|
|
+ rgzss = gzss;
|
|
|
+ rgzsl = gzsl;
|
|
|
+ rjxss = jxss;
|
|
|
+ rjxsl = jxsl;
|
|
|
+ rdjss = djss;
|
|
|
+ rsdtj = sdtj;
|
|
|
+ rxnss = xnss;
|
|
|
+ rfdjcl = fdjcl;
|
|
|
+ rxdjcl =xdjcl;
|
|
|
+ rxdtj = xdtj;
|
|
|
+ rdwsl = dwsl;
|
|
|
+ rhjsl =hjsl;
|
|
|
+ double temp = rgzss + rgzsl + rjxss + rjxsl + rdjss + rsdtj + rxnss + rfdjcl + rxdjcl + rxdtj + rdwsl + rhjsl;
|
|
|
+ if (temp >= 0) {
|
|
|
+ rqfdl = temp;
|
|
|
+ } else {
|
|
|
+ rzfdl = Math.abs(temp);
|
|
|
+ }
|
|
|
}
|
|
|
- double lsgl = edosUtil.getSectionData(rpjglPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rpjgl = DoubleUtils.ave(lsgl, dataMap.get("pjgl"));
|
|
|
- double lskydl = edosUtil.getSectionData(rkydlPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rkydl = DoubleUtils.sum(lskydl, dataMap.get("kydl"));
|
|
|
- double lslldlzs = edosUtil.getSectionData(rlldlzsPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rzsdl = DoubleUtils.sum(lslldlzs, dataMap.get("zsdl"));
|
|
|
- double lsgzss = edosUtil.getSectionData(rgzssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rgzss = DoubleUtils.sum(lsgzss, gzss);
|
|
|
- double lsgzsl = edosUtil.getSectionData(rgzslPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rgzsl = DoubleUtils.sum(lsgzsl, gzsl);
|
|
|
- double lsjxss = edosUtil.getSectionData(rjxssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rjxss = DoubleUtils.sum(lsjxss, jxss);
|
|
|
- double lsjxsl = edosUtil.getSectionData(rjxslPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rjxsl = DoubleUtils.sum(lsjxsl, jxsl);
|
|
|
-
|
|
|
- double lsdjss = edosUtil.getSectionData(rdjssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rdjss = DoubleUtils.sum(lsdjss, djss)*0.1;
|
|
|
- double lssdtj = edosUtil.getSectionData(rsdtjPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rsdtj = DoubleUtils.sum(lssdtj, sdtj)*0.1;
|
|
|
- double lsxnss = edosUtil.getSectionData(rxnssPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rxnss = DoubleUtils.sum(lsxnss, xnss)*0.1;
|
|
|
-
|
|
|
- double lsfdjcl = edosUtil.getSectionData(rfdjclPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rfdjcl = DoubleUtils.sum(lsfdjcl, fdjcl)*0.1;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- double lsxdjcl = edosUtil.getSectionData(rxdjclPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rxdjcl = DoubleUtils.sum(lsxdjcl, xdjcl);
|
|
|
- double lsxdtj = edosUtil.getSectionData(rxdtjPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rxdtj = DoubleUtils.sum(lsxdtj, xdtj);
|
|
|
- double lsdwsl = edosUtil.getSectionData(rdwslPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rdwsl = DoubleUtils.sum(lsdwsl, dwsl);
|
|
|
- double lshjsl = edosUtil.getSectionData(rhjslPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- rhjsl = DoubleUtils.sum(lshjsl, hjsl);
|
|
|
- double temp = rgzss + rgzsl + rjxss + rjxsl + rdjss + rsdtj + rxnss + rfdjcl + rxdjcl + rxdtj + rdwsl + rhjsl;
|
|
|
- if (temp >= 0) {
|
|
|
- rqfdl = temp;
|
|
|
- } else {
|
|
|
- rzfdl = Math.abs(temp);
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
if (date.getTime() > monthFirstZero.getTime() && date.getTime() <= monthFirstZeroAdd15.getTime()) {
|
|
|
ypjfs = dataMap.get("pjfs");
|
|
@@ -535,27 +685,29 @@ public class CycleCalculationRebuildService {
|
|
|
}
|
|
|
ypjfs = DoubleUtils.ave(lsfs, dataMap.get("pjfs"));
|
|
|
} else {
|
|
|
-// double lsfs = edosUtil.getSectionData(ypjgzdPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
-// ypjfs = DoubleUtils.ave(lsfs, dataMap.get("pjfs"));
|
|
|
-
|
|
|
- Date tempdate=DateUtils.truncate(currentDate);
|
|
|
- Calendar c=new GregorianCalendar();
|
|
|
- c.setTime(tempdate);
|
|
|
- c.set(Calendar.DAY_OF_MONTH,1);
|
|
|
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(rpjgzdPoint.getNemCode(), tempdate.getTime()/1000, currentDate.getTime()/1000,null,24*60*60l);
|
|
|
- if(!pointls.isEmpty())
|
|
|
- {
|
|
|
- double value=0.0;
|
|
|
- for(PointData po:pointls)
|
|
|
- {
|
|
|
- if(po.getPointValueInDouble()>10)
|
|
|
- {
|
|
|
- value=value+po.getPointValueInDouble();
|
|
|
- }
|
|
|
- }
|
|
|
- //累计光照度
|
|
|
- ypjfs = new BigDecimal(value).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- }
|
|
|
+ double lsfs = edosUtil.getSectionData(ypjgzdPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ ypjfs = DoubleUtils.sum(lsfs, dataMap.get("pjfs"));
|
|
|
+
|
|
|
+// Date tempdate=DateUtils.truncate(currentDate);
|
|
|
+// Calendar c=new GregorianCalendar();
|
|
|
+// c.setTime(tempdate);
|
|
|
+// c.set(Calendar.DAY_OF_MONTH,1);
|
|
|
+// List<PointData> pointls=edosUtil.getHistoryDatasSnap(rpjgzdPoint.getNemCode(), tempdate.getTime()/1000, currentDate.getTime()/1000,null,24*60*60l);
|
|
|
+// if(!pointls.isEmpty())
|
|
|
+// {
|
|
|
+// double value=0.0;
|
|
|
+// for(PointData po:pointls)
|
|
|
+// {
|
|
|
+// if(po.getPointValueInDouble()>10)
|
|
|
+// {
|
|
|
+// value=value+po.getPointValueInDouble();
|
|
|
+// }
|
|
|
+// }
|
|
|
+// //累计光照度
|
|
|
+// ypjfs = new BigDecimal(value).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+// }
|
|
|
+//
|
|
|
+
|
|
|
}
|
|
|
|
|
|
double lsgl = edosUtil.getSectionData(ypjglPoint, currentDate.getTime()).getPointValueInDouble();
|
|
@@ -632,24 +784,9 @@ public class CycleCalculationRebuildService {
|
|
|
}
|
|
|
npjfs = DoubleUtils.ave(lsfs, dataMap.get("pjfs"));
|
|
|
} else {
|
|
|
-// double lsfs = edosUtil.getSectionData(npjgzdPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
-// npjfs = DoubleUtils.ave(lsfs, dataMap.get("pjfs"));
|
|
|
-
|
|
|
- Date tempdate=DateUtils.truncate(currentDate);
|
|
|
- Calendar c=new GregorianCalendar();
|
|
|
- c.setTime(tempdate);
|
|
|
- c.set(Calendar.DAY_OF_YEAR,1);
|
|
|
- List<PointData> pointls=edosUtil.getHistoryDatasSnap(rpjgzdPoint.getNemCode(), tempdate.getTime()/1000, currentDate.getTime()/1000,null,24*60*60l);
|
|
|
- if(!pointls.isEmpty()) {
|
|
|
- double value = 0.0;
|
|
|
- for (PointData po : pointls) {
|
|
|
- if (po.getPointValueInDouble() > 10) {
|
|
|
- value = value + po.getPointValueInDouble();
|
|
|
- }
|
|
|
- }
|
|
|
- //累计光照度
|
|
|
- npjfs = new BigDecimal(value).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
- }
|
|
|
+ double lsfs = edosUtil.getSectionData(npjgzdPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
+ npjfs=DoubleUtils.sum(lsfs, dataMap.get("pjfs"));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
double lsgl = edosUtil.getSectionData(npjglPoint, currentDate.getTime()).getPointValueInDouble();
|
|
@@ -832,27 +969,7 @@ public class CycleCalculationRebuildService {
|
|
|
}
|
|
|
// });
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-// String[] arr = new String[]{"测点编号", "数值", "时间"};
|
|
|
-// String heardName = "电量测点";
|
|
|
-//
|
|
|
-// List<ExcelVo> vos=new ArrayList<>();
|
|
|
-// if(!wtResultList.isEmpty())
|
|
|
-// {
|
|
|
-// for(PointData po:wtResultList)
|
|
|
-// {
|
|
|
-// ExcelVo vo=new ExcelVo();
|
|
|
-// vo.setId(po.getEdnaId());
|
|
|
-// vo.setValue(po.getPointValueInDouble());
|
|
|
-// vo.setDate(new Date(po.getPointTime()));
|
|
|
-// vos.add(vo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//// //调用Excel导出工具类
|
|
|
-//// ExcelExport.exportToPath(vos, arr, heardName, 6, "电量测点"+DateUtils.toDate1(currentDate));
|
|
|
-
|
|
|
- edosUtil.updatePoint(wtResultList);
|
|
|
+ edosUtil.sendMultiPoint(wtResultList);
|
|
|
|
|
|
|
|
|
List<PointData> lineResultList = new ArrayList<>();
|
|
@@ -1151,7 +1268,6 @@ public class CycleCalculationRebuildService {
|
|
|
ProBasicEquipmentPoint qfdl15Point = equipmentPointMap.get(ContantXk.QFDL15);
|
|
|
ProBasicEquipmentPoint zfdl15Point = equipmentPointMap.get(ContantXk.ZFDL15);
|
|
|
ProBasicEquipmentPoint llfdl15Point = equipmentPointMap.get(ContantXk.LLFDL15);
|
|
|
-
|
|
|
ProBasicEquipmentPoint mxztPoint = equipmentPointMap.get(ContantXk.MXZT);
|
|
|
|
|
|
double ssztmx = 0;
|
|
@@ -1990,23 +2106,7 @@ public class CycleCalculationRebuildService {
|
|
|
lineResultList.add(PointUtil.createPointData(date, zfdl15.get(), wpzfdl15Point.getNemCode(), wpzfdl15Point.getName()));
|
|
|
lineResultList.add(PointUtil.createPointData(date, llfdl15.get(), wpllfdl15Point.getNemCode(), wpllfdl15Point.getName()));
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
-// if(!lineResultList.isEmpty())
|
|
|
-// {
|
|
|
-// for(PointData po:lineResultList)
|
|
|
-// {
|
|
|
-// ExcelVo vo=new ExcelVo();
|
|
|
-// vo.setId(po.getEdnaId());
|
|
|
-// vo.setValue(po.getPointValueInDouble());
|
|
|
-// vo.setDate(new Date(po.getPointTime()));
|
|
|
-// vos.add(vo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- edosUtil.updatePoint(lineResultList);
|
|
|
+ edosUtil.sendMultiPoint(lineResultList);
|
|
|
|
|
|
List<PointData> projectResultList = new ArrayList<>();
|
|
|
pjls.stream().forEach(project -> {
|
|
@@ -3124,22 +3224,7 @@ public class CycleCalculationRebuildService {
|
|
|
projectResultList.add(PointUtil.createPointData(date, zfdl15.get(), wpzfdl15Point.getNemCode(), wpzfdl15Point.getName()));
|
|
|
projectResultList.add(PointUtil.createPointData(date, llfdl15.get(), wpllfdl15Point.getNemCode(), wpllfdl15Point.getName()));
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
-// if(!projectResultList.isEmpty())
|
|
|
-// {
|
|
|
-// for(PointData po:projectResultList)
|
|
|
-// {
|
|
|
-// ExcelVo vo=new ExcelVo();
|
|
|
-// vo.setId(po.getEdnaId());
|
|
|
-// vo.setValue(po.getPointValueInDouble());
|
|
|
-// vo.setDate(new Date(po.getPointTime()));
|
|
|
-// vos.add(vo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //调用Excel导出工具类
|
|
|
-// ExcelExport.exportToPath(vos, arr, heardName, 6, "电量测点"+DateUtils.toDate1(currentDate));
|
|
|
- edosUtil.updatePoint(projectResultList);
|
|
|
+ edosUtil.sendMultiPoint(projectResultList);
|
|
|
|
|
|
List<PointData> windpowerResultList = new ArrayList<>();
|
|
|
wpls.stream().forEach(wp -> {
|
|
@@ -4258,30 +4343,7 @@ public class CycleCalculationRebuildService {
|
|
|
windpowerResultList.add(PointUtil.createPointData(date, zfdl15.get(), wpzfdl15Point.getNemCode(), wpzfdl15Point.getName()));
|
|
|
windpowerResultList.add(PointUtil.createPointData(date, llfdl15.get(), wpllfdl15Point.getNemCode(), wpllfdl15Point.getName()));
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
-// if(!windpowerResultList.isEmpty())
|
|
|
-// {
|
|
|
-// for(PointData po:windpowerResultList)
|
|
|
-// {
|
|
|
-// ExcelVo vo=new ExcelVo();
|
|
|
-// vo.setId(po.getEdnaId());
|
|
|
-// vo.setValue(po.getPointValueInDouble());
|
|
|
-// vo.setDate(new Date(po.getPointTime()));
|
|
|
-// vos.add(vo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// Calendar c= Calendar.getInstance();
|
|
|
-// c.setTime(currentDate);
|
|
|
-// c.set(Calendar.HOUR_OF_DAY,23);
|
|
|
-// c.set(Calendar.MINUTE,59);
|
|
|
-// c.set(Calendar.SECOND,59);
|
|
|
-//
|
|
|
-// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
-//
|
|
|
-// //调用Excel导出工具类
|
|
|
-// ExcelExport.exportToPath(vos, arr, heardName, 6, df.format(c.getTime()));
|
|
|
- edosUtil.updatePoint(windpowerResultList);
|
|
|
+ edosUtil.sendMultiPoint(windpowerResultList);
|
|
|
}
|
|
|
|
|
|
private double generalLoss(List<PointData> ztmxDatasSnap, List<PointData> zsglDatasSnap, List<PointData> powerDatasSnap, double statusValue) {
|
|
@@ -4320,9 +4382,123 @@ public class CycleCalculationRebuildService {
|
|
|
return zsss;
|
|
|
}
|
|
|
|
|
|
+// private double generalLossBySpeed(List<PointData> ztmxDatasSnap, List<PointData> speedDatasSnap, List<PointData> powerDatasSnap, double statusValue,ProBasicEquipment wt) {
|
|
|
+// List<PointData> pointDataList = ztmxDatasSnap.stream().filter(zt -> zt.getPointValueInDouble() == statusValue).collect(Collectors.toList());
|
|
|
+//
|
|
|
+// Double zsss = 0.0;
|
|
|
+// if (ztmxDatasSnap.size() == speedDatasSnap.size() && speedDatasSnap.size() == powerDatasSnap.size()) {
|
|
|
+//
|
|
|
+// PowerIntegration powerIntegration=new PowerIntegration();
|
|
|
+// Map<Integer, Double> powerData=new HashMap<>();
|
|
|
+// if (statusValue == 2.0 || statusValue == 3.0 || statusValue == 8.0) {
|
|
|
+//
|
|
|
+// int time=0;
|
|
|
+// for (int i = 0; i < ztmxDatasSnap.size(); i++) {
|
|
|
+// for (int j = 0; j < pointDataList.size(); j++) {
|
|
|
+// if (pointDataList.get(j).getPointTime().equals(ztmxDatasSnap.get(i).getPointTime())) {
|
|
|
+// double pjfs = StringUtils.round(speedDatasSnap.get(i).getPointValueInDouble(),2);
|
|
|
+// double power = powerDatasSnap.get(i).getPointValueInDouble();
|
|
|
+//
|
|
|
+// if (CacheContext.theoreticalPowerMap.containsKey(wt.getModelId()))
|
|
|
+// {
|
|
|
+// Map<Double,ProBasicModelPowerRd> valuemap=CacheContext.theoreticalPowerMap.get(wt.getModelId());
|
|
|
+// if(valuemap.containsKey(pjfs))
|
|
|
+// {
|
|
|
+// double bzgl= valuemap.get(pjfs).getTheoryPower();
|
|
|
+//
|
|
|
+// if (power > 0) {
|
|
|
+// double temp1 = bzgl - power;
|
|
|
+// if (temp1 > 0) {
|
|
|
+//// zsss += temp1;
|
|
|
+// powerData.put(time,temp1);
|
|
|
+// time++;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//// zsss = zsss / pointDataList.size() >= 0 ? zsss / pointDataList.size() : 0;
|
|
|
+// } else {
|
|
|
+// int time=0;
|
|
|
+// for (int i = 0; i < ztmxDatasSnap.size(); i++) {
|
|
|
+// for (int j = 0; j < pointDataList.size(); j++) {
|
|
|
+// if (pointDataList.get(j).getPointTime().equals(ztmxDatasSnap.get(i).getPointTime())) {
|
|
|
+//
|
|
|
+//
|
|
|
+// double pjfs = StringUtils.round(speedDatasSnap.get(i).getPointValueInDouble(),2);
|
|
|
+// if (CacheContext.theoreticalPowerMap.containsKey(wt.getModelId()))
|
|
|
+// {
|
|
|
+// Map<Double,ProBasicModelPowerRd> valuemap=CacheContext.theoreticalPowerMap.get(wt.getModelId());
|
|
|
+// if(valuemap.containsKey(pjfs))
|
|
|
+// {
|
|
|
+// double bzgl= valuemap.get(pjfs).getTheoryPower();
|
|
|
+//
|
|
|
+// powerData.put(time,bzgl);
|
|
|
+// time++;
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//// zsss = zsss / pointDataList.size() >= 0 ? zsss / pointDataList.size() : 0;
|
|
|
+// double timeInterval=BigDecimal.valueOf(1).divide(new BigDecimal(120), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+// zsss= powerIntegration.calculateEnergy(powerData, timeInterval);
|
|
|
+// }
|
|
|
+//
|
|
|
+// return zsss;
|
|
|
+// }
|
|
|
|
|
|
private double generalLossBySpeed(List<PointData> ztmxDatasSnap, List<PointData> speedDatasSnap, List<PointData> powerDatasSnap, double statusValue,ProBasicEquipment wt) {
|
|
|
List<PointData> pointDataList = ztmxDatasSnap.stream().filter(zt -> zt.getPointValueInDouble() == statusValue).collect(Collectors.toList());
|
|
|
+
|
|
|
+ Map<Double,Double> powerMap=new HashMap<>();
|
|
|
+ if (redisService.hasKey(CurveType.monthCurve.id+"_"+wt.getId())){
|
|
|
+ String cp0String = redisService.get(CurveType.monthCurve.id+"_"+wt.getId());
|
|
|
+ List<ProEconWtCurveFittingMonth> powerList = JSONObject.parseObject(cp0String, new TypeReference< List<ProEconWtCurveFittingMonth>>() {
|
|
|
+ });
|
|
|
+ if(!powerList.isEmpty())
|
|
|
+ {
|
|
|
+ powerList.stream().forEach(curveFitting->{
|
|
|
+
|
|
|
+ powerMap.put(curveFitting.getSpeed(),curveFitting.getActualPower());
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ if(CacheContext.wpwtmap.containsKey(wt.getWindpowerstationId()))
|
|
|
+ {
|
|
|
+ List<ProBasicEquipment> wtls=CacheContext.wpwtmap.get(wt.getWindpowerstationId());
|
|
|
+ for(ProBasicEquipment w:wtls)
|
|
|
+ {
|
|
|
+ if (wt.getModelId().equals(w.getModelId()) && redisService.hasKey(CurveType.monthCurve.id+"_"+wt.getId())){
|
|
|
+ String cp0String = redisService.get(CurveType.monthCurve.id+"_"+wt.getId());
|
|
|
+ List<ProEconWtCurveFittingMonth> powerList = JSONObject.parseObject(cp0String, new TypeReference< List<ProEconWtCurveFittingMonth>>() {
|
|
|
+ });
|
|
|
+ if(!powerList.isEmpty())
|
|
|
+ {
|
|
|
+ powerList.stream().forEach(curveFitting->{
|
|
|
+
|
|
|
+ powerMap.put(curveFitting.getSpeed(),curveFitting.getActualPower());
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
Double zsss = 0.0;
|
|
|
if (ztmxDatasSnap.size() == speedDatasSnap.size() && speedDatasSnap.size() == powerDatasSnap.size()) {
|
|
|
|
|
@@ -4337,7 +4513,20 @@ public class CycleCalculationRebuildService {
|
|
|
double pjfs = StringUtils.round(speedDatasSnap.get(i).getPointValueInDouble(),2);
|
|
|
double power = powerDatasSnap.get(i).getPointValueInDouble();
|
|
|
|
|
|
- if (CacheContext.theoreticalPowerMap.containsKey(wt.getModelId()))
|
|
|
+ if(powerMap.containsKey(pjfs))
|
|
|
+ {
|
|
|
+ double bzgl= powerMap.get(pjfs);
|
|
|
+
|
|
|
+ if (power > 0) {
|
|
|
+ double temp1 = bzgl - power;
|
|
|
+ if (temp1 > 0) {
|
|
|
+// zsss += temp1;
|
|
|
+ powerData.put(time,temp1);
|
|
|
+ time++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if (CacheContext.theoreticalPowerMap.containsKey(wt.getModelId()))
|
|
|
{
|
|
|
Map<Double,ProBasicModelPowerRd> valuemap=CacheContext.theoreticalPowerMap.get(wt.getModelId());
|
|
|
if(valuemap.containsKey(pjfs))
|
|
@@ -4366,7 +4555,15 @@ public class CycleCalculationRebuildService {
|
|
|
|
|
|
|
|
|
double pjfs = StringUtils.round(speedDatasSnap.get(i).getPointValueInDouble(),2);
|
|
|
- if (CacheContext.theoreticalPowerMap.containsKey(wt.getModelId()))
|
|
|
+
|
|
|
+ if(powerMap.containsKey(pjfs))
|
|
|
+ {
|
|
|
+ double bzgl= powerMap.get(pjfs);
|
|
|
+
|
|
|
+ powerData.put(time,bzgl);
|
|
|
+ time++;
|
|
|
+
|
|
|
+ }else if (CacheContext.theoreticalPowerMap.containsKey(wt.getModelId()))
|
|
|
{
|
|
|
Map<Double,ProBasicModelPowerRd> valuemap=CacheContext.theoreticalPowerMap.get(wt.getModelId());
|
|
|
if(valuemap.containsKey(pjfs))
|
|
@@ -4378,14 +4575,14 @@ public class CycleCalculationRebuildService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
// zsss = zsss / pointDataList.size() >= 0 ? zsss / pointDataList.size() : 0;
|
|
|
- zsss= powerIntegration.calculateEnergy(powerData, 5/60);
|
|
|
+ double timeInterval=BigDecimal.valueOf(1).divide(new BigDecimal(120), 2, RoundingMode.HALF_EVEN).doubleValue();
|
|
|
+ zsss= powerIntegration.calculateEnergy(powerData, timeInterval);
|
|
|
}
|
|
|
|
|
|
return zsss;
|