فهرست منبع

Merge branch 'master' of http://39.101.69.29:3000/wangb/runeconomy-nx

wangb 1 ماه پیش
والد
کامیت
8dbcc8bafb

+ 8 - 8
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/EarlyWarning/GetWindReportService.java

@@ -485,14 +485,14 @@ public class GetWindReportService {
 //                "" +fnbottom3list.get(2).getStationId()+"号"+StringUtils.round(fnbottom3list.get(2).getFnlyl(),0)+"%");
 
 
-        map.put("风能利用率", "场站整体风能利用率:月度" + StringUtils.round(ydfnlyl, 0) + "%,年度" + StringUtils.round(ndfnlyl, 0) + "%");
-        map.put("风能利用率Top3风机","风能利用率Top3风机:" + fntop3list.get(0).getStationId() + "号" + StringUtils.round(fntop3list.get(0).getFnlyl(), 0) + "%、"
-                + fntop3list.get(1).getStationId() + "号" + StringUtils.round(fntop3list.get(1).getFnlyl(), 0) + "%、" +
-                "" + fntop3list.get(1).getStationId() + "号" + StringUtils.round(fntop3list.get(2).getFnlyl(), 0) + "%");
-
-        map.put("风能利用率末3风机","风能利用率末3风机:" + fnbottom3list.get(0).getStationId() + "号" + StringUtils.round(fnbottom3list.get(0).getFnlyl(), 0) + "%、" +
-                "" + fnbottom3list.get(1).getStationId() + "号" + StringUtils.round(fnbottom3list.get(1).getFnlyl(), 0) + "%、" +
-                "" + fnbottom3list.get(2).getStationId() + "号" + StringUtils.round(fnbottom3list.get(2).getFnlyl(), 0) + "%");
+        map.put("风能利用率", "场站整体风能利用率:月度" + StringUtils.round(ydfnlyl, 2) + "%,年度" + StringUtils.round(ndfnlyl, 2) + "%");
+        map.put("风能利用率Top3风机","风能利用率Top3风机:" + fntop3list.get(0).getStationId() + "号" + StringUtils.round(fntop3list.get(0).getFnlyl(), 2) + "%、"
+                + fntop3list.get(1).getStationId() + "号" + StringUtils.round(fntop3list.get(1).getFnlyl(), 2) + "%、" +
+                "" + fntop3list.get(1).getStationId() + "号" + StringUtils.round(fntop3list.get(2).getFnlyl(), 2) + "%");
+
+        map.put("风能利用率末3风机","风能利用率末3风机:" + fnbottom3list.get(0).getStationId() + "号" + StringUtils.round(fnbottom3list.get(0).getFnlyl(), 2) + "%、" +
+                "" + fnbottom3list.get(1).getStationId() + "号" + StringUtils.round(fnbottom3list.get(1).getFnlyl(), 2) + "%、" +
+                "" + fnbottom3list.get(2).getStationId() + "号" + StringUtils.round(fnbottom3list.get(2).getFnlyl(), 2) + "%");
 
         double byllfdl = StringUtils.round(monthList.size() > 0 ? monthList.get(0).getLlfdl() / bl : 0, 2);
 

+ 37 - 37
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/EarlyWarning/WindReportService.java

@@ -137,32 +137,32 @@ public class WindReportService {
 
         int bl = 1000;
 
-        double monthdmtbf = monthslist.size() > 0 ? StringUtils.round(monthslist.get(0).getMtbf(), 2) : 0.0;
-        double qnmonthmtbf = qndylist.size() > 0 ? StringUtils.round(qndylist.get(0).getMtbf(), 2) : 1.0;
+        double monthdmtbf = !monthslist.isEmpty() ? StringUtils.round(monthslist.get(0).getMtbf(), 2) : 0.0;
+        double qnmonthmtbf = !qndylist.isEmpty() ? StringUtils.round(qndylist.get(0).getMtbf(), 2) : 1.0;
 
-        double monthdmttr = monthslist.size() > 0 ? StringUtils.round(monthslist.get(0).getMttr(), 2) : 0.0;
-        double qnmonthmttr = qndylist.size() > 0 ? StringUtils.round(qndylist.get(0).getMttr(), 2) : 1.0;
+        double monthdmttr = !monthslist.isEmpty() ? StringUtils.round(monthslist.get(0).getMttr(), 2) : 0.0;
+        double qnmonthmttr = !qndylist.isEmpty() ? StringUtils.round(qndylist.get(0).getMttr(), 2) : 1.0;
 
-        double monthkyly = monthdllist.size() > 0 ? StringUtils.round(monthdllist.get(0).getKlyl(), 2) : 0.0;
-        double yearklyly = yeardllist.size() > 0 ? StringUtils.round(yeardllist.get(0).getKlyl(), 2) : 0.0;
+        double monthkyly = !monthdllist.isEmpty() ? StringUtils.round(monthdllist.get(0).getKlyl(), 2) : 0.0;
+        double yearklyly = !yeardllist.isEmpty() ? StringUtils.round(yeardllist.get(0).getKlyl(), 2) : 0.0;
 
-        String klyltop1id = klyltopList.size() > 0 ? klyltopList.get(0).getStationId() : "";
-        double klyltop1value = klyltopList.size() > 0 ? StringUtils.round(klyltopList.get(0).getKlyl(), 2) : 0.0;
+        String klyltop1id = !klyltopList.isEmpty() ? klyltopList.get(0).getStationId() : "";
+        double klyltop1value = !klyltopList.isEmpty() ? StringUtils.round(klyltopList.get(0).getKlyl(), 2) : 0.0;
 
-        String klyltop2id = klyltopList.size() > 0 ? klyltopList.get(1).getStationId() : "";
-        double klyltop2value = klyltopList.size() > 0 ? StringUtils.round(klyltopList.get(1).getKlyl(), 2) : 0.0;
+        String klyltop2id = !klyltopList.isEmpty() ? klyltopList.get(1).getStationId() : "";
+        double klyltop2value = !klyltopList.isEmpty() ? StringUtils.round(klyltopList.get(1).getKlyl(), 2) : 0.0;
 
-        String klyltop3id = klyltopList.size() > 0 ? klyltopList.get(2).getStationId() : "";
-        double klyltop3value = klyltopList.size() > 0 ? StringUtils.round(klyltopList.get(2).getKlyl(), 2) : 0.0;
+        String klyltop3id = !klyltopList.isEmpty() ? klyltopList.get(2).getStationId() : "";
+        double klyltop3value = !klyltopList.isEmpty() ? StringUtils.round(klyltopList.get(2).getKlyl(), 2) : 0.0;
 
-        String klylbottom1id = klylbottomList.size() > 0 ? klylbottomList.get(0).getStationId() : "";
-        double klylbottom1value = klylbottomList.size() > 0 ? StringUtils.round(klylbottomList.get(0).getKlyl(), 2) : 0.0;
+        String klylbottom1id = !klylbottomList.isEmpty() ? klylbottomList.get(0).getStationId() : "";
+        double klylbottom1value = !klylbottomList.isEmpty() ? StringUtils.round(klylbottomList.get(0).getKlyl(), 2) : 0.0;
 
-        String klylbottom2id = klylbottomList.size() > 0 ? klylbottomList.get(1).getStationId() : "";
-        double klylbottom2value = klylbottomList.size() > 0 ? StringUtils.round(klylbottomList.get(1).getKlyl(), 2) : 0.0;
+        String klylbottom2id = !klylbottomList.isEmpty() ? klylbottomList.get(1).getStationId() : "";
+        double klylbottom2value = !klylbottomList.isEmpty() ? StringUtils.round(klylbottomList.get(1).getKlyl(), 2) : 0.0;
 
-        String klylbottom3id = klylbottomList.size() > 0 ? klylbottomList.get(2).getStationId() : "";
-        double klylbottom3value = klylbottomList.size() > 0 ? StringUtils.round(klylbottomList.get(2).getKlyl(), 2) : 0.0;
+        String klylbottom3id = !klylbottomList.isEmpty() ? klylbottomList.get(2).getStationId() : "";
+        double klylbottom3value = !klylbottomList.isEmpty() ? StringUtils.round(klylbottomList.get(2).getKlyl(), 2) : 0.0;
 
         double mtbftq = 0.0;
         double mttrtq = 0.0;
@@ -180,21 +180,21 @@ public class WindReportService {
                 "可利用率Top3风机:" + klyltop1id + "号" + klyltop1value + "%、" + klyltop2id + "号" + klyltop2value + "%、" + klyltop3id + "号" + klyltop3value + "%\n" +
                 "可利用率末3风机:" + klylbottom1id + "号" + klylbottom1value + "%、" + klylbottom2id + "号" + klylbottom2value + "%、" + klylbottom3id + "号" + klylbottom3value + "%");
 
-        int gzcs = gzcslist.size() > 0 ? gzcslist.get(0).getGzcs() : 0;
-        String gzfj = gzcstop.size() > 0 ? gzcstop.get(0).getStationId() : "";
-        int gzfjcs = gzcstop.size() > 0 ? gzcstop.get(0).getGzcs() : 0;
+        int gzcs = !gzcslist.isEmpty() ? gzcslist.get(0).getGzcs() : 0;
+        String gzfj = !gzcstop.isEmpty() ? gzcstop.get(0).getStationId() : "";
+        int gzfjcs = !gzcstop.isEmpty() ? gzcstop.get(0).getGzcs() : 0;
         map.put("故障统计", "故障统计:\n" +
                 "月度总故障次数:" + gzcs + "次\n" +
                 "故障频发风机:" + gzfj + "号(" + gzfjcs + "次)");
 
 
-        double monthfdl = monthdllist.size() > 0 ? StringUtils.round(monthdllist.get(0).getRfdl() / bl, 2) : 0.0;
-        double monthllfdl = monthdllist.size() > 0 ? StringUtils.round(monthdllist.get(0).getLlfdl() / bl, 2) : 0.0;
-        double qnmonthfdl = qnmonthlist.size() > 0 ? StringUtils.round(qnmonthlist.get(0).getRfdl() / bl, 2) : 1.0;
-        double hbmothfdl = hbmonthList.size() > 0 ? StringUtils.round(hbmonthList.get(0).getRfdl() / bl, 2) : 1.0;
+        double monthfdl = !monthdllist.isEmpty() ? StringUtils.round(monthdllist.get(0).getRfdl() / bl, 2) : 0.0;
+        double monthllfdl = !monthdllist.isEmpty() ? StringUtils.round(monthdllist.get(0).getLlfdl() / bl, 2) : 0.0;
+        double qnmonthfdl = !qnmonthlist.isEmpty() ? StringUtils.round(qnmonthlist.get(0).getRfdl() / bl, 2) : 1.0;
+        double hbmothfdl = !hbmonthList.isEmpty() ? StringUtils.round(hbmonthList.get(0).getRfdl() / bl, 2) : 1.0;
 
-        double yearfdl = yeardllist.size() > 0 ? StringUtils.round(yeardllist.get(0).getRfdl() / bl, 2) : 0.0;
-        double yearllfdl = yeardllist.size() > 0 ? StringUtils.round(yeardllist.get(0).getLlfdl() / bl, 2) : 0.0;
+        double yearfdl = !yeardllist.isEmpty() ? StringUtils.round(yeardllist.get(0).getRfdl() / bl, 2) : 0.0;
+        double yearllfdl = !yeardllist.isEmpty() ? StringUtils.round(yeardllist.get(0).getLlfdl() / bl, 2) : 0.0;
 
         String[] dltopId = new String[3];
         double[] dltopFdl = new double[3];
@@ -238,17 +238,17 @@ public class WindReportService {
         map.put("发电量分析-同比分析","同比/环比分析:月度发电量同比" + monthfdltb + "%(±),环比" + monthfdlhb + "%(±)");
 
         //月场用电量
-        double monthcydl = zhcymonthlist.size() > 0 ? StringUtils.round((double) zhcymonthlist.get(0).getZhcydl() / bl, 2) : 0.0;
+        double monthcydl = !zhcymonthlist.isEmpty() ? StringUtils.round((double) zhcymonthlist.get(0).getZhcydl() / bl, 2) : 0.0;
         //月发电量
-        double monthrfdl = zhcymonthlist.size() > 0 ? StringUtils.round((double) zhcymonthlist.get(0).getRfdl() / bl, 2) : 0.0;
+        double monthrfdl = !zhcymonthlist.isEmpty() ? StringUtils.round((double) zhcymonthlist.get(0).getRfdl() / bl, 2) : 0.0;
         //去年月场用电量
-        double qnmonthcydl = qnzhcymonthlist.size() > 0 ? StringUtils.round((double) qnzhcymonthlist.get(0).getZhcydl() / bl, 2) : 1.0;
+        double qnmonthcydl = !qnzhcymonthlist.isEmpty() ? StringUtils.round((double) qnzhcymonthlist.get(0).getZhcydl() / bl, 2) : 1.0;
         //去年月发电量
-        double qnmonthrfdl = qnzhcymonthlist.size() > 0 ? StringUtils.round((double) qnzhcymonthlist.get(0).getRfdl() / bl, 2) : 1.0;
+        double qnmonthrfdl = !qnzhcymonthlist.isEmpty() ? StringUtils.round((double) qnzhcymonthlist.get(0).getRfdl() / bl, 2) : 1.0;
         //年场用电量
-        double yearcydl = zhcyyearlist.size() > 0 ? StringUtils.round((double) zhcyyearlist.get(0).getZhcydl() / bl, 2) : 0.0;
+        double yearcydl = !zhcyyearlist.isEmpty() ? StringUtils.round((double) zhcyyearlist.get(0).getZhcydl() / bl, 2) : 0.0;
         //年发电量
-        double yearrfdl = zhcyyearlist.size() > 0 ? StringUtils.round((double) zhcyyearlist.get(0).getRfdl() / bl, 2) : 0.0;
+        double yearrfdl = !zhcyyearlist.isEmpty() ? StringUtils.round((double) zhcyyearlist.get(0).getRfdl() / bl, 2) : 0.0;
 
         //月场用电率
         double monthcydll = monthrfdl > 1 ? StringUtils.round(monthcydl / monthrfdl * 100, 2) : 0.0;
@@ -277,7 +277,7 @@ public class WindReportService {
         double avgfs = Optional.ofNullable(zhcymonthlist)
                 .filter(list -> !list.isEmpty())
                 .map(list -> list.get(0))
-                .map(StationInfoDay::getCftfs)  // 根据您的实际类名替换
+                .map(StationInfoDay::getCftfs)
                 .map(BigDecimal::doubleValue)
                 .map(value -> StringUtils.round(value, 2))
                 .orElse(0.0);
@@ -285,7 +285,7 @@ public class WindReportService {
         double qnavgfs = Optional.ofNullable(qnzhcymonthlist)
                 .filter(list -> !list.isEmpty())
                 .map(list -> list.get(0))
-                .map(StationInfoDay::getCftfs)  // 根据您的实际类名替换
+                .map(StationInfoDay::getCftfs)
                 .map(BigDecimal::doubleValue)
                 .map(value -> StringUtils.round(value, 2))
                 .orElse(0.0);
@@ -294,7 +294,7 @@ public class WindReportService {
         double avgfx = Optional.ofNullable(zhcymonthlist)
                 .filter(list -> !list.isEmpty())
                 .map(list -> list.get(0))
-                .map(StationInfoDay::getCftfx)  // 替换YourObjectClass为实际类名
+                .map(StationInfoDay::getCftfx)
                 .map(BigDecimal::doubleValue)    // 将BigDecimal转换为double
                 .map(value -> StringUtils.round(value, 2))
                 .orElse(0.0);
@@ -308,7 +308,7 @@ public class WindReportService {
         double qnavgjfpl = Optional.ofNullable(qnmonthlist)
                 .filter(list -> !list.isEmpty())
                 .map(list -> list.get(0))
-                .map(TurbineInfoDay::getJfpl)   // 替换YourObjectClass为实际类名
+                .map(TurbineInfoDay::getJfpl)
                 .map(value -> StringUtils.round(value, 2))
                 .orElse(0.0);
         double tqb_jfpl = qnavgjfpl > 1 ? StringUtils.round((avgjfpl - qnavgjfpl) / qnavgjfpl * 100, 2) : 0.0;