|
@@ -1001,16 +1001,23 @@ 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 {
|
|
|
|
|
|
+
|
|
|
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 = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> emils.contains(pbep.getWindturbineId())&&"AIEMI002".equals(pbep.getUniformCode()))
|
|
|
- .map(ProBasicEquipmentPoint::getNemCode).collect(Collectors.toList());
|
|
|
-
|
|
|
+ List<String> emil=null;
|
|
|
+ if ("-1".equals(type)) {
|
|
|
+ resultMap.put("list", new ArrayList<>());
|
|
|
+ resultMap.put("chanrt", new ArrayList<>());
|
|
|
+
|
|
|
+ return resultMap;
|
|
|
+ }else {
|
|
|
+ emil = CacheContext.proBasicEquipmentPointList.stream().filter(pbep -> emils.contains(pbep.getWindturbineId()) && "AIEMI002".equals(pbep.getUniformCode()))
|
|
|
+ .map(ProBasicEquipmentPoint::getNemCode).collect(Collectors.toList());
|
|
|
+ }
|
|
|
Optional<ProBasicPowerstationPoint> sszglpbpp = CacheContext.proBasicPowerstationPoint.stream().filter(pbpp -> "SSZGL".equals(pbpp.getUniformCode()) && wpid.equals(pbpp.getWindpowerstationId())).findFirst();
|
|
|
String sszgl = null;
|
|
|
if (sszglpbpp.isPresent()) {
|
|
@@ -1026,7 +1033,7 @@ public class WindturbinegoodnessService {
|
|
|
double count = 0;
|
|
|
Map<Long, PointData> gzpd = new HashMap<>();
|
|
|
for (String em : emil) {
|
|
|
- List<PointData> historyEmilDatas = edosUtil.getHistoryDatasSnap(em, DateUtils.parseDate(beginDate).getTime(), DateUtils.parseDate(endDate).getTime(), null, 900L);
|
|
|
+ List<PointData> historyEmilDatas = edosUtil.getHistoryDatasSnap(em, DateUtils.parseDate1(beginDate).getTime()/1000, DateUtils.parseDate1(endDate).getTime()/1000, null, 900L);
|
|
|
for (PointData pd : historyEmilDatas) {
|
|
|
if(i==0){
|
|
|
PointData data = new PointData();
|
|
@@ -1044,9 +1051,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.parseDate(beginDate).getTime(), DateUtils.parseDate(endDate).getTime(), null, 900L);
|
|
|
+ List<PointData> historySszglDatas = edosUtil.getHistoryDatasSnap(sszgl, DateUtils.parseDate1(beginDate).getTime()/1000, DateUtils.parseDate1(endDate).getTime()/1000, null, 900L);
|
|
|
Map<Long, PointData> collect2 = historySszglDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
|
|
|
- List<PointData> historySsznhglzsDatas = edosUtil.getHistoryDatasSnap(ssznhglzs, DateUtils.parseDate(beginDate).getTime(), DateUtils.parseDate(endDate).getTime(), null, 900L);
|
|
|
+ List<PointData> historySsznhglzsDatas = edosUtil.getHistoryDatasSnap(ssznhglzs, DateUtils.parseDate1(beginDate).getTime()/1000, DateUtils.parseDate1(endDate).getTime()/1000, null, 900L);
|
|
|
Map<Long, PointData> collect3 = historySsznhglzsDatas.stream().collect(Collectors.toMap(PointData::getPointTime, Function.identity()));
|
|
|
|
|
|
List<StationAnalysis> lpds = new ArrayList<>();
|
|
@@ -1055,14 +1062,14 @@ public class WindturbinegoodnessService {
|
|
|
StationAnalysis sa = new StationAnalysis();
|
|
|
sa.setTime(pointTime);
|
|
|
sa.setStationName(CacheContext.proBasicOrganizeTreesMap.get(wpid).getAname());
|
|
|
- sa.setIrradiance(DoubleUtils.keepPrecision(collect1.get(pointTime).getPointValueInDouble(),2));
|
|
|
- sa.setActualPower(DoubleUtils.keepPrecision(collect2.get(pointTime).getPointValueInDouble(),2));
|
|
|
- sa.setTheoreticalPower(DoubleUtils.keepPrecision(collect3.get(pointTime).getPointValueInDouble(),2));
|
|
|
+ sa.setIrradiance(collect1.get(pointTime).getPointValueInDouble());
|
|
|
+ sa.setActualPower(collect2.get(pointTime).getPointValueInDouble());
|
|
|
+ sa.setTheoreticalPower(collect3.get(pointTime).getPointValueInDouble());
|
|
|
lpds.add(sa);
|
|
|
}
|
|
|
-
|
|
|
- resultMap.put("list", lpds);
|
|
|
- resultMap.put("chanrt", lpds);
|
|
|
+ List<StationAnalysis> lsas = lpds.stream().sorted(Comparator.comparing(StationAnalysis::getTime)).collect(Collectors.toList());
|
|
|
+ resultMap.put("list", lsas);
|
|
|
+ resultMap.put("chanrt", lsas);
|
|
|
|
|
|
return resultMap;
|
|
|
}
|