|
@@ -9,6 +9,7 @@ import com.gyee.common.util.SortUtils;
|
|
|
import com.gyee.common.vo.benchmark.DataVo;
|
|
|
import com.gyee.common.vo.threerate.PvVo;
|
|
|
import com.gyee.runeconomy.dto.EchartDataVo;
|
|
|
+import com.gyee.runeconomy.dto.response.InverterAnalysis;
|
|
|
import com.gyee.runeconomy.dto.response.StationAnalysis;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
@@ -1000,21 +1001,21 @@ public class WindturbinegoodnessService {
|
|
|
* 场站性能分析
|
|
|
*/
|
|
|
public Map<String, List<StationAnalysis>> stationAnalysis(String companys, String type, String wpid, String beginDate, String endDate, String target, String sort) throws Exception {
|
|
|
-
|
|
|
-
|
|
|
+ Long startTs = DateUtils.parseDate1(beginDate).getTime() / 1000;
|
|
|
+ Long endTs = DateUtils.parseDate1(endDate).getTime() / 1000;
|
|
|
Map<String, List<StationAnalysis>> resultMap = new HashMap<>();
|
|
|
List<ProBasicOrganizeTree> eqs = CacheContext.proBasicOrganizeTrees;
|
|
|
//拿到场站下的环境监测仪id
|
|
|
List<String> emils = eqs.stream().filter(v -> "EMI".equals(v.getEqType()) && v.getParentCode().equals(wpid))
|
|
|
.map(ProBasicOrganizeTree::getId)
|
|
|
.collect(Collectors.toList());
|
|
|
- List<String> emil=null;
|
|
|
+ List<String> emil = null;
|
|
|
if ("-1".equals(type)) {
|
|
|
resultMap.put("list", new ArrayList<>());
|
|
|
resultMap.put("chanrt", new ArrayList<>());
|
|
|
|
|
|
return resultMap;
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
emil = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> emils.contains(pbep.getWindturbineId()) && "AIEMI002".equals(pbep.getUniformCode()))
|
|
|
.map(ProBasicEquipmentPoint::getNemCode).collect(Collectors.toList());
|
|
|
}
|
|
@@ -1033,16 +1034,16 @@ public class WindturbinegoodnessService {
|
|
|
double count = 0;
|
|
|
Map<Long, PointData> gzpd = new HashMap<>();
|
|
|
for (String em : emil) {
|
|
|
- List<PointData> historyEmilDatas = edosUtil.getHistoryDatasSnap(em, DateUtils.parseDate1(beginDate).getTime()/1000, DateUtils.parseDate1(endDate).getTime()/1000, null, 900L);
|
|
|
+ List<PointData> historyEmilDatas = edosUtil.getHistoryDatasSnap(em, startTs, endTs, null, 900L);
|
|
|
for (PointData pd : historyEmilDatas) {
|
|
|
- if(i==0){
|
|
|
+ if (i == 0) {
|
|
|
PointData data = new PointData();
|
|
|
data.setPointTime(pd.getPointTime());
|
|
|
data.setPointValueInDouble(pd.getPointValueInDouble());
|
|
|
- gzpd.put(pd.getPointTime(),data);
|
|
|
- }else {
|
|
|
+ gzpd.put(pd.getPointTime(), data);
|
|
|
+ } else {
|
|
|
PointData data = gzpd.get(pd.getPointTime());
|
|
|
- data.setPointValueInDouble(data.getPointValueInDouble()+pd.getPointValueInDouble());
|
|
|
+ data.setPointValueInDouble(data.getPointValueInDouble() + pd.getPointValueInDouble());
|
|
|
}
|
|
|
}
|
|
|
i++;
|
|
@@ -1051,9 +1052,9 @@ public class WindturbinegoodnessService {
|
|
|
|
|
|
List<PointData> historyEmilDatas = gzpd.values().stream().peek(g -> g.setPointValueInDouble(g.getPointValueInDouble() / finalI)).collect(Collectors.toList());
|
|
|
Map<Long, PointData> collect1 = historyEmilDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
|
|
|
- List<PointData> historySszglDatas = edosUtil.getHistoryDatasSnap(sszgl, DateUtils.parseDate1(beginDate).getTime()/1000, DateUtils.parseDate1(endDate).getTime()/1000, null, 900L);
|
|
|
+ List<PointData> historySszglDatas = edosUtil.getHistoryDatasSnap(sszgl, startTs, endTs, null, 900L);
|
|
|
Map<Long, PointData> collect2 = historySszglDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
|
|
|
- List<PointData> historySsznhglzsDatas = edosUtil.getHistoryDatasSnap(ssznhglzs, DateUtils.parseDate1(beginDate).getTime()/1000, DateUtils.parseDate1(endDate).getTime()/1000, null, 900L);
|
|
|
+ List<PointData> historySsznhglzsDatas = edosUtil.getHistoryDatasSnap(ssznhglzs, startTs, endTs, null, 900L);
|
|
|
Map<Long, PointData> collect3 = historySsznhglzsDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
|
|
|
|
|
|
List<StationAnalysis> lpds = new ArrayList<>();
|
|
@@ -1075,4 +1076,44 @@ public class WindturbinegoodnessService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 逆变器分析
|
|
|
+ */
|
|
|
+ public Map<String, List<InverterAnalysis>> inverterAnalysis(String companys, String type, String wpid, String target, String sort) throws Exception {
|
|
|
+ Map<String, List<InverterAnalysis>> resultMap = new HashMap<>();
|
|
|
+ List<InverterAnalysis> lias = new ArrayList<>();
|
|
|
+ InverterAnalysis ia = new InverterAnalysis();
|
|
|
+ Optional<ProBasicEquipmentPoint> srg = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> "AIG010".equals(pbep.getUniformCode()) && wpid.equals(pbep.getWindpowerstationId())).findFirst();
|
|
|
+ String srgl = null;
|
|
|
+ if (srg.isPresent()) {
|
|
|
+ srgl = srg.get().getNemCode();
|
|
|
+ }
|
|
|
+ PointData realSrgData = edosUtil.getRealData(srgl);
|
|
|
+ ia.setInputPower(realSrgData.getPointValueInDouble());
|
|
|
+
|
|
|
+ Optional<ProBasicEquipmentPoint> scg = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> "AIG007".equals(pbep.getUniformCode()) && wpid.equals(pbep.getWindpowerstationId())).findFirst();
|
|
|
+ String scgl = null;
|
|
|
+ if (scg.isPresent()) {
|
|
|
+ scgl = scg.get().getNemCode();
|
|
|
+ }
|
|
|
+ PointData realScgData = edosUtil.getRealData(scgl);
|
|
|
+ ia.setInputPower(realScgData.getPointValueInDouble());
|
|
|
+
|
|
|
+ Optional<ProBasicEquipmentPoint> srd = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> "DIHW050".equals(pbep.getUniformCode()) && wpid.equals(pbep.getWindpowerstationId())).findFirst();
|
|
|
+ String srdy = null;
|
|
|
+ if (srd.isPresent()) {
|
|
|
+ srdy = srd.get().getNemCode();
|
|
|
+ }
|
|
|
+ PointData realSrdData = edosUtil.getRealData(srdy);
|
|
|
+ ia.setInputPower(realSrdData.getPointValueInDouble());
|
|
|
+ ia.setConversionRate(realScgData.getPointValueInDouble() / realSrgData.getPointValueInDouble() * 100);
|
|
|
+
|
|
|
+ lias.add(ia);
|
|
|
+ resultMap.put("list", lias);
|
|
|
+ resultMap.put("chanrt", lias);
|
|
|
+
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|