Kaynağa Gözat

功率曲线拟合处理

wangchangsheng 2 yıl önce
ebeveyn
işleme
50478e9981

+ 15 - 9
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/PerformanceCurvefittingService.java

@@ -126,9 +126,11 @@ public class PerformanceCurvefittingService {
                     });
 //                    List<ProEconWtCurveFitting> daylist = proEconWtCurveFittingService.getProEconWtCurveFittingList(wt,date);
 
-                    daylist.stream().forEach(w -> {
-                        doubleMap.put(w.getSpeed(), w.getActualPower());
-                    });
+                    if(null != daylist){
+                        daylist.stream().forEach(w -> {
+                            doubleMap.put(w.getSpeed(), w.getActualPower());
+                        });
+                    }
                     zzsglMap.put(wt, doubleMap);
                     break;
                 case "2":
@@ -138,9 +140,11 @@ public class PerformanceCurvefittingService {
                     });
 //                    List<ProEconWtCurveFittingMonth> monthlist = proEconWtCurveFittingMonthService.getProEconWtCurveFittingMonthList(wt,String.valueOf(month),String.valueOf(year));
 
-                    monthlist.stream().forEach(w -> {
-                        doubleMap.put(w.getSpeed(), w.getActualPower());
-                    });
+                    if(null !=monthlist){
+                        monthlist.stream().forEach(w -> {
+                            doubleMap.put(w.getSpeed(), w.getActualPower());
+                        });
+                    }
                     zzsglMap.put(wt, doubleMap);
                     break;
                 case "3":
@@ -149,9 +153,11 @@ public class PerformanceCurvefittingService {
                     });
 //                    List<ProEconWtCurveFittingYear>  yearslist = proEconWtCurveFittingYearService.getProEconWtCurveFittingYearList(wt,String.valueOf(year));
 
-                    yearslist.stream().forEach(w -> {
-                        doubleMap.put(w.getSpeed(), w.getActualPower());
-                    });
+                    if(null != yearslist){
+                        yearslist.stream().forEach(w -> {
+                            doubleMap.put(w.getSpeed(), w.getActualPower());
+                        });
+                    }
                     zzsglMap.put(wt, doubleMap);
                     break;
             }