浏览代码

中心功率预测-99数据显示为空

fanxiaoyu 7 月之前
父节点
当前提交
1ce35ddc9f

+ 9 - 7
cpp-admin/src/main/java/com/cpp/web/service/station/impl/PowerStationStatusDataServiceImpl.java

@@ -54,6 +54,8 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
     @Autowired
     private ISysConfigService configService;
 
+    private final BigDecimal compareNum = new BigDecimal(-99);
+
 
     @Override
     public List<PowerStationStatusData> findByStationCodeAndStartTimeAndEndTime(String stationCode, Date startTime, Date endTime) {
@@ -570,21 +572,21 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
             Date time = new Date(l);
             dataMap.put("time", DateFormatUtils.format(time, "yyyy-MM-dd HH:mm"));
             PowerStationStatusData powerStationStatusData = Optional.ofNullable(powerStationStatusDataTimeMap.containsKey(time) ? powerStationStatusDataTimeMap.get(time).get(0) : null).orElse(new PowerStationStatusData());
-            dataMap.put("realPower", powerStationStatusData.getRealValue());
-            dataMap.put("ablePower", powerStationStatusData.getAbleValue());
-            dataMap.put("theoryPower", powerStationStatusData.getTheoryValue());
+            dataMap.put("realPower", powerStationStatusData.getRealValue().compareTo(compareNum) == 0 ? "" : powerStationStatusData.getRealValue());
+            dataMap.put("ablePower", powerStationStatusData.getAbleValue().compareTo(compareNum) == 0 ? "" : powerStationStatusData.getAbleValue());
+            dataMap.put("theoryPower", powerStationStatusData.getTheoryValue().compareTo(compareNum) == 0 ? "" : powerStationStatusData.getTheoryValue());
 
             if (electricFieldType.equals("E1")) {
                 WeatherStationStatusData weatherStationStatusData = Optional.ofNullable(enStatusDataMap.containsKey(time) ? (WeatherStationStatusData) enStatusDataMap.get(time).get(0) : null).orElse(new WeatherStationStatusData());
-                dataMap.put("globalR", weatherStationStatusData.getGlobalR());
+                dataMap.put("globalR", weatherStationStatusData.getGlobalR().compareTo(compareNum) == 0 ? "" : weatherStationStatusData.getGlobalR());
 
             } else {
                 WindTowerStatusData windTowerStatusData = Optional.ofNullable(enStatusDataMap.containsKey(time) ? (WindTowerStatusData) enStatusDataMap.get(time).get(0) : null).orElse(new WindTowerStatusData());
-                dataMap.put("wsHubHeight", windTowerStatusData.getWsHubHeight());
+                dataMap.put("wsHubHeight", windTowerStatusData.getWsHubHeight().compareTo(compareNum) == 0 ? "" : windTowerStatusData.getWsHubHeight());
             }
 
             ForecastPowerShortTermRegulation forecastPowerShortTermRegulation = Optional.ofNullable(forecastPowerShortTermRegulationTimeMap.containsKey(time) ? forecastPowerShortTermRegulationTimeMap.get(time).get(0) : null).orElse(new ForecastPowerShortTermRegulation());
-            dataMap.put("fpValue", forecastPowerShortTermRegulation.getFpValue());
+            dataMap.put("fpValue", forecastPowerShortTermRegulation.getFpValue().compareTo(compareNum) == 0 ? "" : forecastPowerShortTermRegulation.getFpValue());
 
 
             for (Map.Entry<String, String> stringStringEntry : forecastModelMap.entrySet()) {
@@ -593,7 +595,7 @@ public class PowerStationStatusDataServiceImpl extends ServiceImpl<PowerStationS
                     Map<Date, List<ForecastPowerShortTermCloud>> dateListMap = forecastPowerShortTermCloudModelTimeMap.get(stringStringEntry.getValue());
                     forecastPowerShortTermCloud = Optional.ofNullable(dateListMap.containsKey(time) ? dateListMap.get(time).get(0) : null).orElse(new ForecastPowerShortTermCloud());
                 }
-                dataMap.put(stringStringEntry.getValue(), forecastPowerShortTermCloud.getFpValue().compareTo(new BigDecimal(-99)) == 0 ? "" : forecastPowerShortTermCloud.getFpValue());
+                dataMap.put(stringStringEntry.getValue(), forecastPowerShortTermCloud.getFpValue().compareTo(compareNum) == 0 ? "" : forecastPowerShortTermCloud.getFpValue());
             }