Browse Source

场站性能分析数据保留两位小数

宁檬 1 year ago
parent
commit
d6ec5a1bf5

+ 4 - 3
web/runeconomy-jjyx/src/main/java/com/gyee/runeconomy/service/goodness/WindturbinegoodnessService.java

@@ -1003,6 +1003,7 @@ public class WindturbinegoodnessService {
 
         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());
@@ -1054,9 +1055,9 @@ public class WindturbinegoodnessService {
             StationAnalysis sa = new StationAnalysis();
             sa.setTime(pointTime);
             sa.setStationName(CacheContext.proBasicOrganizeTreesMap.get(wpid).getAname());
-            sa.setIrradiance(collect1.get(pointTime).getPointValueInDouble());
-            sa.setActualPower(collect2.get(pointTime).getPointValueInDouble());
-            sa.setTheoreticalPower(collect3.get(pointTime).getPointValueInDouble());
+            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));
             lpds.add(sa);
         }