王波 3 месяцев назад
Родитель
Сommit
070cf77149

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

@@ -81,7 +81,7 @@ public class GetWindReportService {
 
         //周期数据
         double zqpjfs = monthList.size() > 0 ? StringUtils.round(monthList.get(0).getPjfs(), 2) : 0.0;
-        double zqklyl = monthList.size() > 0 ? StringUtils.round(monthList.get(0).getKlyl(), 0) : 0.0;
+        double zqklyl = monthList.size() > 0 ? StringUtils.round(monthList.get(0).getKlyl(), 2) : 0.0;
         double zqfdl = monthList.size() > 0 ? StringUtils.round(monthList.get(0).getRfdl() / bl, 2) : 0.0;
         double zqxdss = monthList.size() > 0 ? StringUtils.round(monthList.get(0).getXdss() / bl, 2) : 0.0;
         double zqjxss = monthList.size() > 0 ? StringUtils.round(monthList.get(0).getJhjxss() / bl, 2) : 0.0;
@@ -103,8 +103,10 @@ public class GetWindReportService {
         double fdlavgbottom3 = 0.0;
 
         // ID数组
-        String[] topIds = {"1101", "1102", "1103"};
-        String[] bottomIds = {"1101", "1102", "1103"};
+        String[] topIds = new String[3];
+        Arrays.fill(topIds, "");
+        String[] bottomIds = new String[3];
+        Arrays.fill(bottomIds, "");
 
         // 数据数组 - 对应top1fdl, top2fdl, top3fdl等
         double[] topFdl = new double[3];
@@ -153,7 +155,7 @@ public class GetWindReportService {
 
             for (int i = 0; i < top3list.size(); i++) {
                 var item = top3list.get(i);
-                topIds[i] = item.getStationId();
+                topIds[i] = item.getStationId() != null ? item.getStationId() : "";
 
                 // 计算各项值并赋值
                 topFdl[i] = StringUtils.round(item.getRfdl() / bl, 2);
@@ -173,7 +175,7 @@ public class GetWindReportService {
 
             // 计算最终平均值
             fdlavgtop3 = StringUtils.round((totalRfdl / bl) / 3, 2);
-            avgklyltop3 = StringUtils.round(totalKlyl / 3, 0);
+            avgklyltop3 = StringUtils.round(totalKlyl / 3, 2);
         }
         double top1ssdl = StringUtils.round(topXdssdl[0] + topJxssdl[0] + topGzssdl[0] + topXnssdl[0] + topSlssdl[0], 2);
         double top3ssdl = StringUtils.round(topXdssdl[2] + topJxssdl[2] + topGzssdl[2] + topXnssdl[2] + topSlssdl[2], 2);
@@ -182,9 +184,10 @@ public class GetWindReportService {
             double totalRfdl = 0.0;
             double totalKlyl = 0.0;
 
+
             for (int i = 0; i < bottom3list.size(); i++) {
                 var item = bottom3list.get(i);
-                bottomIds[i] = item.getStationId();
+                bottomIds[i] = item.getStationId() != null ? item.getStationId() : "";
                 bottomFdl[i] = StringUtils.round(item.getRfdl() / bl, 2);
 
                 totalRfdl += item.getRfdl();
@@ -192,7 +195,7 @@ public class GetWindReportService {
             }
 
             fdlavgbottom3 = StringUtils.round((totalRfdl / bl) / 3, 2);
-            avgknlylbottom3 = StringUtils.round(totalKlyl / 3, 0);
+            avgknlylbottom3 = StringUtils.round(totalKlyl / 3, 2);
         }
 
 
@@ -252,13 +255,13 @@ public class GetWindReportService {
 
         performance performance2 = new performance();
         performance2.setDbwd("月度风能利用率");
-        performance2.setTop("1." + fntop3list.get(0).getStationId() + "号:" + StringUtils.round(fntop3list.get(0).getFnlyl(), 0) + "%;" +
-                "2." + fntop3list.get(1).getStationId() + "号:" + StringUtils.round(fntop3list.get(1).getFnlyl(), 0) + "%;" +
-                "3." + fntop3list.get(2).getStationId() + "号:" + StringUtils.round(fntop3list.get(2).getFnlyl(), 0) + "%;");
+        performance2.setTop("1." + fntop3list.get(0).getStationId() + "号:" + StringUtils.round(fntop3list.get(0).getFnlyl(), 2) + "%;" +
+                "2." + fntop3list.get(1).getStationId() + "号:" + StringUtils.round(fntop3list.get(1).getFnlyl(), 2) + "%;" +
+                "3." + fntop3list.get(2).getStationId() + "号:" + StringUtils.round(fntop3list.get(2).getFnlyl(), 2) + "%;");
 
-        performance2.setBottom("1." + fnbottom3list.get(0).getStationId() + "号:" + StringUtils.round(fnbottom3list.get(0).getFnlyl(), 0) + "%;" +
-                "2." + fnbottom3list.get(1).getStationId() + "号:" + StringUtils.round(fnbottom3list.get(1).getFnlyl(), 0) + "%;" +
-                "3." + fnbottom3list.get(2).getStationId() + "号:" + StringUtils.round(fnbottom3list.get(2).getFnlyl(), 0) + "%;");
+        performance2.setBottom("1." + fnbottom3list.get(0).getStationId() + "号:" + StringUtils.round(fnbottom3list.get(0).getFnlyl(), 2) + "%;" +
+                "2." + fnbottom3list.get(1).getStationId() + "号:" + StringUtils.round(fnbottom3list.get(1).getFnlyl(), 2) + "%;" +
+                "3." + fnbottom3list.get(2).getStationId() + "号:" + StringUtils.round(fnbottom3list.get(2).getFnlyl(), 2) + "%;");
 
         performancesls.add(performance2);
 
@@ -284,9 +287,9 @@ public class GetWindReportService {
                 "          限电损失电量:" + topIds[0] + "号" + topXdssdl[0] + "万KWh、" + topIds[1] + "号" + topXdssdl[1] + "万KWh、" + topIds[2] + "号" + topXdssdl[2] + "万KWh\n" +
                 "          受累损失电量:" + topIds[0] + "号" + topSlssdl[0] + "万KWh、" + topIds[1] + "号" + topSlssdl[1] + "万KWh、" + topIds[2] + "号" + topSlssdl[2] + "万KWh\n" +
                 "          风能利用率:" + topIds[0] + "号" + topFnlyl[0] + "%、" + topIds[1] + "号" + topFnlyl[1] + "%、" + topIds[2] + "号" + topFnlyl[2] + "%\n" +
-                "          故障损失率:" + topIds[0] + "号" + StringUtils.round(topGzssdl[0] / topLlfdl[0] * 100, 0) + "%、" + topIds[1] + "号" + StringUtils.round(topGzssdl[1] / topLlfdl[1] * 100, 0) + "%、" + topIds[2] + "号" + StringUtils.round(topGzssdl[2] / topLlfdl[2] * 100, 0) + "%\n" +
-                "          检修损失率:" + topIds[0] + "号" + StringUtils.round(topJxssdl[0] / topLlfdl[0] * 100, 0) + "%、" + topIds[1] + "号" + StringUtils.round(topJxssdl[1] / topLlfdl[1] * 100, 0) + "%、" + topIds[2] + "号" + StringUtils.round(topJxssdl[2] / topLlfdl[2] * 100, 0) + "%\n" +
-                "          弃风率:" + topIds[0] + "号" + StringUtils.round(topXdssdl[0] / topLlfdl[0] * 100, 0) + "%、" + topIds[1] + "号" + StringUtils.round(topXdssdl[1] / topLlfdl[1] * 100, 0) + "%、" + topIds[2] + "号" + StringUtils.round(topXdssdl[2] / topLlfdl[2] * 100, 0) + "%");
+                "          故障损失率:" + topIds[0] + "号" + StringUtils.round(topGzssdl[0] / topLlfdl[0] * 100, 2) + "%、" + topIds[1] + "号" + StringUtils.round(topGzssdl[1] / topLlfdl[1] * 100, 2) + "%、" + topIds[2] + "号" + StringUtils.round(topGzssdl[2] / topLlfdl[2] * 100, 2) + "%\n" +
+                "          检修损失率:" + topIds[0] + "号" + StringUtils.round(topJxssdl[0] / topLlfdl[0] * 100, 2) + "%、" + topIds[1] + "号" + StringUtils.round(topJxssdl[1] / topLlfdl[1] * 100, 2) + "%、" + topIds[2] + "号" + StringUtils.round(topJxssdl[2] / topLlfdl[2] * 100, 2) + "%\n" +
+                "          弃风率:" + topIds[0] + "号" + StringUtils.round(topXdssdl[0] / topLlfdl[0] * 100, 2) + "%、" + topIds[1] + "号" + StringUtils.round(topXdssdl[1] / topLlfdl[1] * 100, 2) + "%、" + topIds[2] + "号" + StringUtils.round(topXdssdl[2] / topLlfdl[2] * 100, 2) + "%");
 
         benchmark1.setConclusion("对标结论:" + topIds[2] + "号与" + topIds[0] + "号风机核心差异,损失电量差" + StringUtils.round(top1ssdl - top3ssdl, 2) + "万kWh");
         map.put("cndb", benchmark1);
@@ -329,10 +332,10 @@ public class GetWindReportService {
                 "          线路总发电量:惠安一号集电线路" + lnfdl[0] + "万kWh、惠安二号集电线路" + lnfdl[1] + "万kWh、惠安三号集电线路" + lnfdl[2] + "万kWh、惠安四号集电线路" + lnfdl[3] + "万kWh\n" +
                 "          线路总损失电量:惠安一号集电线路" + lnzssdl[0] + "万kWh、惠安二号集电线路" + lnzssdl[1] + "万kWh、惠安三号集电线路" + lnzssdl[2] + "万kWh、惠安四号集电线路" + lnzssdl[3] + "万kWh\n" +
                 "          线路风能利用率:惠安一号集电线路" + lnfnlyl[0] + "%、惠安二号集电线路" + lnfnlyl[1] + "%、惠安三号集电线路" + lnfnlyl[2] + "%、惠安四号集电线路" + lnfnlyl[3] + "%\n" +
-                "          线路弃风率:惠安一号集电线路" + StringUtils.round(lnxdssdl[0] / lnllfdl[0] * 100, 0) + "%、" +
-                "          惠安二号集电线路" + StringUtils.round(lnxdssdl[1] / lnllfdl[1] * 100, 0) + "%、" +
-                "          惠安三号集电线路" + StringUtils.round(lnxdssdl[2] / lnllfdl[2] * 100, 0) + "%、" +
-                "          惠安四号集电线路" + StringUtils.round(lnxdssdl[3] / lnllfdl[3] * 100, 0) + "%");
+                "          线路弃风率:惠安一号集电线路" + StringUtils.round(lnxdssdl[0] / lnllfdl[0] * 100, 2) + "%、" +
+                "          惠安二号集电线路" + StringUtils.round(lnxdssdl[1] / lnllfdl[1] * 100, 2) + "%、" +
+                "          惠安三号集电线路" + StringUtils.round(lnxdssdl[2] / lnllfdl[2] * 100, 2) + "%、" +
+                "          惠安四号集电线路" + StringUtils.round(lnxdssdl[3] / lnllfdl[3] * 100, 2) + "%");
         benchmark3.setConclusion("对标结论:" + lnfdlmax + "在发电量指标上优于" + lnfdlmin + ",损失电量差距为" + StringUtils.round(ssdlmaxValue - ssdlminValue, 2));
 
         map.put("xldb", benchmark3);
@@ -384,15 +387,15 @@ public class GetWindReportService {
                     ? qndymttList.get(0).getYgzxqjsl().doubleValue()
                     : 0.0;
 
-            monthllfdl = StringUtils.round(qnllfdl > 1 ? (llfdl - qnllfdl) / qnllfdl * 100 : 0, 0);
-            monthfdl = StringUtils.round(qnfdl > 1 ? (fdl - qnfdl) / qnfdl * 100 : 0, 0);
-            monthfnlyl = StringUtils.round(qnmonthfnlyl > 1 ? (yfnlyl - qnmonthfnlyl) / qnmonthfnlyl * 100 : 0, 0); //当月风能利用率差
-            monthgzssl = StringUtils.round(qngzss > 1 ? (gzss - qngzss) / qngzss * 100 : 0, 0);
-            monthxdssl = StringUtils.round(qnxdss > 1 ? (xdss - qnxdss) / qnxdss * 100 : 0, 0);
-            monthmtbf = StringUtils.round(qnmonthmtbf > 1 ? (ymtbf - qnmonthmtbf) / qnmonthmtbf * 100 : 0, 0);
-            monthmttr = StringUtils.round(qnmonthmttr > 1 ? (ymttr - qnmonthmttr) / qnmonthmttr * 100 : 0, 0);
-            monthyfwjsl = StringUtils.round(qnmonthyfwjsl > 1 ? (yfwjsl - qnmonthyfwjsl) / qnmonthyfwjsl * 100 : 0, 0);
-            monthxqjsl = StringUtils.round(qnxqjsl > 1 ? (xqjsl - qnxqjsl) / qnxqjsl * 100 : 0, 0);
+            monthllfdl = StringUtils.round(qnllfdl > 1 ? (llfdl - qnllfdl) / qnllfdl * 100 : 0, 2);
+            monthfdl = StringUtils.round(qnfdl > 1 ? (fdl - qnfdl) / qnfdl * 100 : 0, 2);
+            monthfnlyl = StringUtils.round(qnmonthfnlyl > 1 ? (yfnlyl - qnmonthfnlyl) / qnmonthfnlyl * 100 : 0, 2); //当月风能利用率差
+            monthgzssl = StringUtils.round(qngzss > 1 ? (gzss - qngzss) / qngzss * 100 : 0, 2);
+            monthxdssl = StringUtils.round(qnxdss > 1 ? (xdss - qnxdss) / qnxdss * 100 : 0, 2);
+            monthmtbf = StringUtils.round(qnmonthmtbf > 1 ? (ymtbf - qnmonthmtbf) / qnmonthmtbf * 100 : 0, 2);
+            monthmttr = StringUtils.round(qnmonthmttr > 1 ? (ymttr - qnmonthmttr) / qnmonthmttr * 100 : 0, 2);
+            monthyfwjsl = StringUtils.round(qnmonthyfwjsl > 1 ? (yfwjsl - qnmonthyfwjsl) / qnmonthyfwjsl * 100 : 0, 2);
+            monthxqjsl = StringUtils.round(qnxqjsl > 1 ? (xqjsl - qnxqjsl) / qnxqjsl * 100 : 0, 2);
 
             yfnlyltrend = yfnlyl > qnmonthfnlyl ? "red" : "green";//月度风能利用率趋势
             yfdltrend = fdl > qnfdl ? "red" : "green";
@@ -447,15 +450,15 @@ public class GetWindReportService {
 
 
             if (qnllfdl != 0 && qnllfdl != 1 || qnfdl != 1 || qngzss != 1 || qnxdss != 1) {
-                yearllfdl = StringUtils.round((nllfdl - qnllfdl) / qnllfdl * 100, 0);
-                yearfdl = StringUtils.round((nfdl - qnfdl) / qnfdl * 100, 0);
-                yearfnlyl = StringUtils.round(((nfnlyl - qnfnlyl) / qnfnlyl * 100), 0);
-                yeargzssl = StringUtils.round((ngzss - qngzss) / qngzss * 100, 0);
-                yearxdssl = StringUtils.round((nxdss - qnxdss) / qnxdss * 100, 0);
-                yearmtbf = StringUtils.round((nmtbf - qnmtbf) / qnmtbf * 100, 0);
-                yearmttr = StringUtils.round((nmttr - qnmttr) / qnmttr * 100, 0);
-                yearyfwjsl = StringUtils.round((nyfwjsl - qnyfwjsl) / qnyfwjsl * 100, 0);
-                yearxqjsl = StringUtils.round((nxqjsl - qnxqjsl) / qnxqjsl * 100, 0);
+                yearllfdl = StringUtils.round((nllfdl - qnllfdl) / qnllfdl * 100, 2);
+                yearfdl = StringUtils.round((nfdl - qnfdl) / qnfdl * 100, 2);
+                yearfnlyl = StringUtils.round(((nfnlyl - qnfnlyl) / qnfnlyl * 100), 2);
+                yeargzssl = StringUtils.round((ngzss - qngzss) / qngzss * 100, 2);
+                yearxdssl = StringUtils.round((nxdss - qnxdss) / qnxdss * 100, 2);
+                yearmtbf = StringUtils.round((nmtbf - qnmtbf) / qnmtbf * 100, 2);
+                yearmttr = StringUtils.round((nmttr - qnmttr) / qnmttr * 100, 2);
+                yearyfwjsl = StringUtils.round((nyfwjsl - qnyfwjsl) / qnyfwjsl * 100, 2);
+                yearxqjsl = StringUtils.round((nxqjsl - qnxqjsl) / qnxqjsl * 100, 2);
             }
         }
 
@@ -497,37 +500,37 @@ public class GetWindReportService {
         double byllfdl = StringUtils.round(monthList.size() > 0 ? monthList.get(0).getLlfdl() / bl : 0, 2);
 
         double bygzss = StringUtils.round(monthList.size() > 0 ? monthList.get(0).getGzss() / bl : 0, 2);
-        double bygzssl = StringUtils.round(bygzss / byllfdl * 100, 0);
+        double bygzssl = StringUtils.round(bygzss / byllfdl * 100, 2);
 
         double bywhss = StringUtils.round(monthList.size() > 0 ? (monthList.get(0).getJhjxss() / bl) : 0 + monthList.size() > 0 ? (monthList.get(0).getFjhjxss() / bl) : 0, 2);
-        double bywhssl = StringUtils.round(bywhss / byllfdl * 100, 0);//本月维护损失率
+        double bywhssl = StringUtils.round(bywhss / byllfdl * 100, 2);//本月维护损失率
 
         double byslss = StringUtils.round(monthList.size() > 0 ? monthList.get(0).getSlss() / bl : 0, 2);
-        double byslssl = StringUtils.round(byslss / byllfdl * 100, 0);
+        double byslssl = StringUtils.round(byslss / byllfdl * 100, 2);
 
         double byxnss = StringUtils.round(monthList.size() > 0 ? monthList.get(0).getXnss() / bl : 0, 2);
-        double byxnssl = StringUtils.round(byxnss / byllfdl * 100, 0);
+        double byxnssl = StringUtils.round(byxnss / byllfdl * 100, 2);
 
         double byxdss = StringUtils.round(monthList.size() > 0 ? monthList.get(0).getXdss() / bl : 0, 2);
-        double byxdssl = StringUtils.round(byxdss / byllfdl * 100, 0);
+        double byxdssl = StringUtils.round(byxdss / byllfdl * 100, 2);
 
 
         double ytbllfdl = StringUtils.round(qnmonthList.size() > 0 ? qnmonthList.get(0).getLlfdl() / bl : 1, 2);
 
         double ytbgzss = StringUtils.round(qnmonthList.size() > 0 ? qnmonthList.get(0).getGzss() / bl : 0, 2);
-        double ytbgzssl = StringUtils.round(ytbgzss / ytbllfdl * 100, 0);
+        double ytbgzssl = StringUtils.round(ytbgzss / ytbllfdl * 100, 2);
 
         double ytbwhss = StringUtils.round(qnmonthList.size() > 0 ? (qnmonthList.get(0).getJhjxss() / bl) : 0 + qnmonthList.size() > 0 ? (qnmonthList.get(0).getFjhjxss() / bl) : 0, 2);
-        double ytbwhssl = StringUtils.round(ytbwhss / ytbllfdl * 100, 0);
+        double ytbwhssl = StringUtils.round(ytbwhss / ytbllfdl * 100, 2);
 
         double ytbslss = StringUtils.round(qnmonthList.size() > 0 ? qnmonthList.get(0).getSlss() / bl : 0, 2);
-        double ytbslssl = StringUtils.round(ytbslss / ytbllfdl * 100, 0);
+        double ytbslssl = StringUtils.round(ytbslss / ytbllfdl * 100, 2);
 
         double ytbxnss = StringUtils.round(qnmonthList.size() > 0 ? qnmonthList.get(0).getXnss() / bl : 0, 2);
-        double ytbxnssl = StringUtils.round(ytbxnss / ytbllfdl * 100, 0);
+        double ytbxnssl = StringUtils.round(ytbxnss / ytbllfdl * 100, 2);
 
         double ytbxdss = StringUtils.round(qnmonthList.size() > 0 ? qnmonthList.get(0).getXdss() / bl : 0, 2);
-        double ytbxdssl = StringUtils.round(ytbxdss / ytbllfdl * 100, 0);
+        double ytbxdssl = StringUtils.round(ytbxdss / ytbllfdl * 100, 2);
 
 
         List<LossRates> lossList = Arrays.asList(

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

@@ -1,5 +1,7 @@
 package com.gyee.runeconomy.service.EarlyWarning;
 
+import com.gyee.runeconomy.dto.response.FwjslDTO;
+import com.gyee.runeconomy.dto.response.QxjslDTO;
 import com.gyee.runeconomy.entity.StationInfoMonth;
 import com.gyee.runeconomy.init.CacheContext;
 import com.gyee.runeconomy.model.auto.*;
@@ -13,6 +15,8 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.time.YearMonth;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.function.BiConsumer;
 import java.util.function.Function;
@@ -39,6 +43,8 @@ public class WindReportService {
     private IProEconEquipmentInfoDay5Service day5Service;
     @Resource
     private IProEconFaultLiminatedefectsService proEconFaultLiminatedefectsService;
+    @Resource
+    private IProEconBrownoutsEvent2Service event2Service;
 
     // 定义等级常量,便于维护
     private static final String[] LEVELS = {"A", "B", "C"};
@@ -50,6 +56,26 @@ public class WindReportService {
         // 去除前导零
         month = month.replaceFirst("^0", "");
 
+        String yearbegin = year + "-01-01";
+        String yearend = year + "-12-31";
+        // 解析年月字符串
+        YearMonth yearMonth = YearMonth.parse(time);
+
+        // 计算开始日期(当月第一天)
+        String beginDate = yearMonth.atDay(1).format(DateTimeFormatter.ISO_LOCAL_DATE);
+
+        // 计算结束日期(当月最后一天)
+        String endDate = yearMonth.atEndOfMonth().format(DateTimeFormatter.ISO_LOCAL_DATE);
+
+        // 减去一个月
+        YearMonth previousYearMonth = yearMonth.minusMonths(1);
+
+        // 计算开始日期(上个月第一天)
+        String sybeginDate = previousYearMonth.atDay(1).format(DateTimeFormatter.ISO_LOCAL_DATE);
+
+        // 计算结束日期(上个月最后一天)
+        String syendDate = previousYearMonth.atEndOfMonth().format(DateTimeFormatter.ISO_LOCAL_DATE);
+
         Map<String, Object> map = new LinkedHashMap<>();
 
         List<ProBasicEquipment> wtls = CacheContext.wtls;
@@ -86,17 +112,28 @@ public class WindReportService {
         List<ProEconWindturbineGoodness> getsy_nhtop = goodnessService.getsytop(time);
         List<ProEconWindturbineGoodness> getsy_nhbottom = goodnessService.getsybottom(time);
 
-        List<ProEconEquipmentInfoDay5> stateRateList = day5Service.getStateRateList(time);
-        List<ProEconEquipmentInfoDay5> systateRateList = day5Service.getsyStateRateList(time);
-        List<ProEconEquipmentInfoDay5> stateRatebotList = day5Service.getStateRatebottomList(time);
+//        List<ProEconEquipmentInfoDay5> stateRateList = day5Service.getStateRateList(time);
+//        List<ProEconEquipmentInfoDay5> systateRateList = day5Service.getsyStateRateList(time);
+//        List<ProEconEquipmentInfoDay5> stateRatebotList = day5Service.getStateRatebottomList(time);
 
         List<ProEconEquipmentInfoDay5> threestateRateList = day5Service.getthreeStateRateList(time);
         List<ProEconEquipmentInfoDay5> threesystateRateList = day5Service.getsythreeStateRateList(time);
         List<ProEconEquipmentInfoDay5> threestateRatebotList = day5Service.getthreeStateRatebottomList(time);
 
-        List<ProEconFaultLiminatedefects> liminatedefects = proEconFaultLiminatedefectsService.getlist(time);
-        List<ProEconFaultLiminatedefects> syliminatedefects = proEconFaultLiminatedefectsService.getsylist(time);
-        List<ProEconFaultLiminatedefects> yearliminatedefects = proEconFaultLiminatedefectsService.getyearlist(time);
+//        List<ProEconFaultLiminatedefects> liminatedefects = proEconFaultLiminatedefectsService.getlist(time);
+//        List<ProEconFaultLiminatedefects> syliminatedefects = proEconFaultLiminatedefectsService.getsylist(time);
+//        List<ProEconFaultLiminatedefects> yearliminatedefects = proEconFaultLiminatedefectsService.getyearlist(time);
+
+        List<FwjslDTO> fwjsllist = event2Service.getResetTimelyRateInfo(null,null , beginDate, endDate);
+        List<FwjslDTO> syfwjsllist = event2Service.getResetTimelyRateInfo(null,null , sybeginDate, syendDate);
+        List<FwjslDTO> wtfwjsllist = event2Service.getWtResetTimelyRateInfo(null,null , beginDate, endDate);
+        List<QxjslDTO> xqjsllist = event2Service.getDefectsEliminatRateList(null, null, beginDate, endDate);
+        List<QxjslDTO> syxqjsllist = event2Service.getDefectsEliminatRateList(null, null, sybeginDate, syendDate);
+        List<QxjslDTO> yearxqjsllist = event2Service.getyearRateList(null, null, yearbegin, yearend);
+
+        List<FwjslDTO> firstThree = wtfwjsllist.stream()
+                .limit(3)
+                .collect(Collectors.toList());
 
         // 分组 1: TurbineInfoDay 相关列表
         applySetIdFromNemCode(wtls, Arrays.asList(
@@ -106,6 +143,10 @@ public class WindReportService {
                 TurbineInfoDay::getTurbineId,
                 TurbineInfoDay::setStationId);
 
+        applySetIdFromNemCode(wtls,Arrays.asList(firstThree),
+                FwjslDTO::getWpid,
+                FwjslDTO::setWpid);
+
         // 分组 2: ProEconCurveFittMonthMain 相关列表
         applySetIdFromNemCode(wtls, Arrays.asList(getqxlist),
                 ProEconCurveFittMonthMain::getWindturbineId,
@@ -118,8 +159,7 @@ public class WindReportService {
 
         // 分组 4: ProEconEquipmentInfoDay5 相关列表
         applySetIdFromNemCode(wtls, Arrays.asList(
-                        stateRatebotList, threestateRateList,
-                        threesystateRateList, threestateRatebotList),
+                       threestateRateList, threesystateRateList, threestateRatebotList),
                 ProEconEquipmentInfoDay5::getWindturbineId,
                 ProEconEquipmentInfoDay5::setWindturbineId);
 
@@ -197,6 +237,7 @@ public class WindReportService {
         double yearllfdl = !yeardllist.isEmpty() ? StringUtils.round(yeardllist.get(0).getLlfdl() / bl, 2) : 0.0;
 
         String[] dltopId = new String[3];
+        Arrays.fill(dltopId, "");
         double[] dltopFdl = new double[3];
         double month_dtpjFdl = StringUtils.round(monthfdl / 50, 2);
         double year_dtpjFdl = StringUtils.round(yearfdl / 50, 2);
@@ -213,14 +254,15 @@ public class WindReportService {
 
         for (int i = 0; i < dltoplist.size(); i++) {
             dltopFdl[i] = StringUtils.round(dltoplist.get(i).getRfdl() / bl, 2);
-            dltopId[i] = dltoplist.get(i).getStationId();
+            dltopId[i] = dltoplist.get(i).getStationId() != null ? dltoplist.get(i).getStationId() : "";
         }
 
         String[] bottomId = new String[3];
+        Arrays.fill(bottomId, "");
         double[] bottomFdl = new double[3];
         for (int i = 0; i < dlbottomlist.size(); i++) {
             bottomFdl[i] = StringUtils.round(dlbottomlist.get(i).getRfdl() / bl, 2);
-            bottomId[i] = dlbottomlist.get(i).getStationId();
+            bottomId[i] = dlbottomlist.get(i).getStationId() != null ? dlbottomlist.get(i).getStationId() : "";
         }
 
 //        map.put("发电量分析", "场站总发电量:月度" + monthfdl + "万KWh,年度" + yearfdl + "万KWh\n" +
@@ -326,10 +368,11 @@ public class WindReportService {
         map.put("风资源分析-历史对比","历史对比:与去年同期相比,平均风速" + tqb_avgfs + "m/s(±),静风频率" + tqb_jfpl + "%(±)");
 
         String[] qxtopid = new String[3];
+        Arrays.fill(qxtopid, "");
         double[] qxpcl = new double[3];
         for (int i = 0; i < getqxlist.size(); i++) {
             var item = getqxlist.get(i);
-            qxtopid[i] = item.getWindturbineId();
+            qxtopid[i] = item.getWindturbineId() != null ? item.getWindturbineId() : "";
             qxpcl[i] = item.getDeviationRate2();
         }
 
@@ -377,10 +420,10 @@ public class WindReportService {
         String[] yqrtopid = new String[3];
         double[] yqrfs = new double[3];
         double[] yqcfs = new double[3];
-
+        Arrays.fill(yqrtopid, "");
         for (int i = 0; i < outSpeedtopTotals.size(); i++) {
             var item = outSpeedtopTotals.get(i);
-            yqrtopid[i] = item.getWindturbineId();
+            yqrtopid[i] = item.getWindturbineId() != null ? item.getWindturbineId() : "";
             yqrfs[i] = StringUtils.round(item.getMonthInputSmall(), 2);
             yqcfs[i] = StringUtils.round(item.getMonthOutputSmall(), 2);
         }
@@ -417,32 +460,36 @@ public class WindReportService {
                 "合格率低于60%的风机:" + out_60.size() + "台,为" + out60_id + "");
 
         String[] topnhyd_id = new String[3];
+        Arrays.fill(topnhyd_id, "");
         double[] top_ynhyd = new double[3];
 
         String[] bottomnhyd_id = new String[3];
+        Arrays.fill(bottomnhyd_id, "");
         double[] bottom_ynhyd = new double[3];
 
         String[] sytopnhyd_id = new String[3];
+        Arrays.fill(sytopnhyd_id, "");
         double[] sytop_ynhyd = new double[3];
 
         String[] sybottomnhyd_id = new String[3];
+        Arrays.fill(sybottomnhyd_id, "");
         double[] sybottom_ynhyd = new double[3];
 
         for (int i = 0; i < getnhtop.size(); i++) {
             var item = getnhtop.get(i);
-            topnhyd_id[i] = item.getWindturbineId();
+            topnhyd_id[i] = item.getWindturbineId() != null ? item.getWindturbineId() : "";
             top_ynhyd[i] = StringUtils.round(item.getMonthGoodness(), 2);
 
             var item_bot = getnhbottom.get(i);
-            bottomnhyd_id[i] = item_bot.getWindturbineId();
+            bottomnhyd_id[i] = item_bot.getWindturbineId() != null ? item_bot.getWindturbineId() : "";
             bottom_ynhyd[i] = StringUtils.round(item_bot.getMonthGoodness(), 2);
 
             var qnitem = getsy_nhtop.get(i);
-            sytopnhyd_id[i] = qnitem.getWindturbineId();
+            sytopnhyd_id[i] = qnitem.getWindturbineId() != null ? qnitem.getWindturbineId() : "";
             sytop_ynhyd[i] = StringUtils.round(qnitem.getMonthGoodness(), 2);
 
             var qnitem_bot = getsy_nhbottom.get(i);
-            sybottomnhyd_id[i] = qnitem_bot.getWindturbineId();
+            sybottomnhyd_id[i] = qnitem_bot.getWindturbineId() != null ? qnitem_bot.getWindturbineId() : "";
             sybottom_ynhyd[i] = StringUtils.round(qnitem_bot.getMonthGoodness(), 2);
         }
 //        map.put("单机性能分析", "拟合优度排行:\n" +
@@ -476,25 +523,29 @@ public class WindReportService {
         String[] syglyz_botid = new String[3];
         double[] syglyz_bot = new double[3];
         double[] sylyxs_bot = new double[3];
+        Arrays.fill(glyz_topid, "");
+        Arrays.fill(syglyz_topid, "");
+        Arrays.fill(glyz_botid, "");
+        Arrays.fill(syglyz_botid, "");
         for (int i = 0; i < glyztopList.size(); i++) {
             var item_top = glyztopList.get(i);
-            glyz_topid[i] = item_top.getStationId();
+            glyz_topid[i] = item_top.getStationId() != null ? item_top.getStationId() : "";
             glyz_top[i] = StringUtils.round(item_top.getGlyzxxs(), 2);
             lyxs_top[i] = StringUtils.round(item_top.getLyxs(), 2);
 
             var syitem_top = syglyztopList.get(i);
-            syglyz_topid[i] = syitem_top.getStationId();
+            syglyz_topid[i] = syitem_top.getStationId() != null ?syitem_top.getStationId() : "";
             syglyz_top[i] = StringUtils.round(syitem_top.getGlyzxxs(), 2);
             sylyxs_top[i] = StringUtils.round(syitem_top.getLyxs(), 2);
 
 
             var item_bot = glyztopList.get(i);
-            glyz_botid[i] = item_bot.getStationId();
+            glyz_botid[i] = item_bot.getStationId() != null ? item_bot.getStationId() : "";
             glyz_bot[i] = StringUtils.round(item_bot.getGlyzxxs(), 2);
             lyxs_bot[i] = StringUtils.round(item_bot.getLyxs(), 2);
 
             var syitem_bot = syglyztopList.get(i);
-            syglyz_botid[i] = syitem_bot.getStationId();
+            syglyz_botid[i] = syitem_bot.getStationId() != null ?syitem_bot.getStationId() : "";
             syglyz_bot[i] = StringUtils.round(syitem_bot.getGlyzxxs(), 2);
             sylyxs_bot[i] = StringUtils.round(syitem_bot.getLyxs(), 2);
 
@@ -559,79 +610,30 @@ public class WindReportService {
                 "B级(良好):" + level_B + "台(" + level_Bid + "号等)\n" +
                 "C级(合格):" + level_C + "台(" + level_Cid + "号等)");
 
-        double wfzfwcs = 0.0;
-        double sfzfwcs = 0.0;
-        double swfzfwcs = 0.0;
-        double esfzfwcs = 0.0;
-
-        double wfzfwl = 0.0;
-        double sfzfwl = 0.0;
-        double swfzfwl = 0.0;
-        double esfzfwl = 0.0;
-        if (stateRateList.size() > 0) {
-
-            wfzfwcs = stateRateList.stream()
-                    .filter(o -> o != null)
-                    .mapToDouble(o -> o.getTimerate16())
-                    .sum();
-
-            sfzfwcs = stateRateList.stream()
-                    .filter(o -> o != null)
-                    .mapToDouble(o -> o.getTimerate17())
-                    .sum();
-
-            swfzfwcs = stateRateList.stream()
-                    .filter(o -> o != null)
-                    .mapToDouble(o -> o.getTimerate18())
-                    .sum();
-
-            esfzfwcs = stateRateList.stream()
-                    .filter(o -> o != null)
-                    .mapToDouble(o -> o.getTimerate19())
-                    .sum();
+        List<FwjslDTO> fwjslDTOList = fwjsllist.stream().filter(fw -> fw.getWpid().equals("合计")).collect(Collectors.toList());
+        List<FwjslDTO> syfwjslDTOList = syfwjsllist.stream().filter(fw -> fw.getWpid().equals("合计")).collect(Collectors.toList());
+        double wfzfwcs = !fwjslDTOList.isEmpty() ? StringUtils.round(fwjslDTOList.get(0).getWfz(),2) : 0.0;
+        double sfzfwcs = !fwjslDTOList.isEmpty() ? StringUtils.round(fwjslDTOList.get(0).getSfz(),2) : 0.0;
+        double swfzfwcs = !fwjslDTOList.isEmpty() ? StringUtils.round(fwjslDTOList.get(0).getSwfz(),2) : 0.0;
+        double esfzfwcs = !fwjslDTOList.isEmpty() ? StringUtils.round(fwjslDTOList.get(0).getEsfz(),2) : 0.0;
 
-            wfzfwl = stateRateList.stream()
-                    .filter(o -> o != null && o.getTimerate20() != 0)
-                    .mapToDouble(o -> o.getTimerate16() / o.getTimerate20() * 100)
-                    .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
-                    .sum();
+        double wfzfwl = !fwjslDTOList.isEmpty() ? StringUtils.round(fwjslDTOList.get(0).getWfzfwl(),2) : 0.0;
+        double sfzfwl = !fwjslDTOList.isEmpty() ? StringUtils.round(fwjslDTOList.get(0).getSfzfwl(),2) : 0.0;
+        double swfzfwl = !fwjslDTOList.isEmpty() ? StringUtils.round(fwjslDTOList.get(0).getSwfzfwl(),2) : 0.0;
+        double esfzfwl = !fwjslDTOList.isEmpty() ? StringUtils.round(fwjslDTOList.get(0).getEsfzfwl(),2) : 0.0;
 
-            sfzfwl = stateRateList.stream()
-                    .filter(o -> o != null && o.getTimerate20() != 0)
-                    .mapToDouble(o -> o.getTimerate17() / o.getTimerate20() * 100)
-                    .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
-                    .sum();
 
-            swfzfwl = stateRateList.stream()
-                    .filter(o -> o != null && o.getTimerate20() != 0)
-                    .mapToDouble(o -> o.getTimerate18() / o.getTimerate20() * 100)
-                    .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
-                    .sum();
-
-            esfzfwl = stateRateList.stream()
-                    .filter(o -> o != null && o.getTimerate20() != 0)
-                    .mapToDouble(o -> o.getTimerate19() / o.getTimerate20() * 100)
-                    .map(d -> new BigDecimal(d).setScale(2, RoundingMode.DOWN).doubleValue())
-                    .sum();
-        }
-
-        double sy_wfzcs = 0.0;
-        double sy_zcs = 0.0;
-        if (systateRateList.size() > 0) {
-            sy_wfzcs = systateRateList.get(0).getTimerate16();
-            sy_zcs = systateRateList.get(0).getTimerate16();
-        }
-
-        double sywfzfwl = StringUtils.round(sy_wfzcs / sy_zcs * 100, 2);
+        double sywfzfwl = !syfwjslDTOList.isEmpty() ?StringUtils.round(syfwjslDTOList.get(0).getWfzfwl(), 2) : 0.0;
 
         String[] wfzfwcsbot_id = new String[3];
         double[] wfzfwcsbot = new double[3];
-        for (int i = 0; i < stateRatebotList.size(); i++) {
-            var item = stateRatebotList.get(i);
-            wfzfwcsbot_id[i] = item.getWindturbineId();
-            wfzfwcsbot[i] = item.getTimerate16();
+        Arrays.fill(wfzfwcsbot_id, "");
+        for (int i = 0; i < firstThree.size(); i++) {
+            var item = firstThree.get(i);
+            wfzfwcsbot_id[i] = item.getWpid() != null ? item.getWpid() : "";
+            wfzfwcsbot[i] = item.getWfz();
         }
-        double fwltb = StringUtils.round((wfzfwl - sywfzfwl) / sywfzfwl * 100,2);
+        double fwltb = sywfzfwl>1 ? StringUtils.round((wfzfwl - sywfzfwl) / sywfzfwl * 100,2) : 0.0;
         map.put("复位及时率", "月度5分钟: 复位次数 "+ wfzfwcs + "次"+",复位及时率:" + wfzfwl + "%\n" +
                 "月度10分钟:复位次数"+ sfzfwcs + "次"+",复位及时率:" + sfzfwl + "%\n" +
                 "月度15分钟:复位次数"+ swfzfwcs +"次"+",复位及时率:" + swfzfwl + "%\n" +
@@ -639,18 +641,18 @@ public class WindReportService {
                 "月度5分钟复位次数排名最低的三台风机:" + wfzfwcsbot_id[0] + "号(" + wfzfwcsbot[0] + "次)、" + wfzfwcsbot_id[1] + "号(" + wfzfwcsbot[1] + "次)、" + wfzfwcsbot_id[2] + "号(" + wfzfwcsbot[2] + "次)\n" +
                 "与上月对比:月度5分钟复位及时率环比" + fwltb + "%(±)");
 
-        double ydgzcs = 0.0;
-        double ydxqcs = 0.0;
-        double ydxqjsl = 0.0;
-        if (liminatedefects.size() > 0) {
-            ydgzcs = liminatedefects.get(0).getFaultCount();
-            ydxqcs = liminatedefects.get(0).getRightCount();
-            ydxqjsl = StringUtils.round(liminatedefects.get(0).getRate(), 2);
-        }
-        double nxqjsl = yearliminatedefects.size() > 0 ? StringUtils.round(yearliminatedefects.get(0).getRate(), 2) : 0.0;
-        double syxqjsl = syliminatedefects.size() > 0 ? StringUtils.round(syliminatedefects.get(0).getRate(), 2) : 0.0;
 
-        double xqjsl_hb = StringUtils.round((ydxqjsl -syxqjsl) /syxqjsl * 100,2);
+        List<QxjslDTO> qxjslDTOS = xqjsllist.stream().filter(fw -> fw.getWpid().equals("合计")).collect(Collectors.toList());
+        List<QxjslDTO> syqxjslDTOS = syxqjsllist.stream().filter(fw -> fw.getWpid().equals("合计")).collect(Collectors.toList());
+
+            double ydgzcs = !qxjslDTOS.isEmpty() ? xqjsllist.get(0).getGzCount() : 0.0;
+            double ydxqcs = !qxjslDTOS.isEmpty() ? xqjsllist.get(0).getXqCount() : 0.0;
+            double ydxqjsl = !qxjslDTOS.isEmpty() ? StringUtils.round(xqjsllist.get(0).getXqjsl(), 2) : 0.0;
+
+        double nxqjsl = yearxqjsllist.size() > 0 ? StringUtils.round(yearxqjsllist.get(0).getXqjsl(), 2) : 0.0;
+        double syxqjsl = syqxjslDTOS.size() > 0 ? StringUtils.round(syxqjsllist.get(0).getXqjsl(), 2) : 0.0;
+
+        double xqjsl_hb = syxqjsl>1 ? StringUtils.round((ydxqjsl -syxqjsl) /syxqjsl * 100,2) : 0.0;
         map.put("消缺及时率", "月度故障次数:" + ydgzcs + "次\n" +
                 "月度消缺及时次数:" + ydxqcs + "次\n" +
                 "月度消缺及时率:" + ydxqjsl + "%\n" +
@@ -717,10 +719,10 @@ public class WindReportService {
 
         double[] ztzhbot_cs = new double[3];
         String[] ztzhbot_id = new String[3];
-
+        Arrays.fill(ztzhbot_id, "");
         for (int i = 0; i < threestateRatebotList.size(); i++) {
             var item = threestateRatebotList.get(i);
-            ztzhbot_id[i] = item.getWindturbineId();
+            ztzhbot_id[i] = item.getWindturbineId() != null ? item.getWindturbineId() : "";
             ztzhbot_cs[i] = item.getTimerate5();
         }
         double sy_ztzhl = 0.0;

+ 2 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IProEconBrownoutsEvent2Service.java

@@ -19,9 +19,11 @@ public interface IProEconBrownoutsEvent2Service extends IService<ProEconBrownout
 
 
     List<QxjslDTO> getDefectsEliminatRateList(String companyId, String windpowerstationId, String beginDate, String endDate);
+    List<QxjslDTO> getyearRateList(String companyId, String windpowerstationId, String beginDate, String endDate);
 
 
     List<FwjslDTO> getResetTimelyRateInfo(String companyId, String windpowerstationId, String beginDate, String endDate);
+    List<FwjslDTO> getWtResetTimelyRateInfo(String companyId, String windpowerstationId, String beginDate, String endDate);
 
 
 }

+ 111 - 2
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconBrownoutsEvent2ServiceImpl.java

@@ -13,8 +13,8 @@ import com.gyee.runeconomy.model.auto.ProEconBrownoutsEvent2;
 import com.gyee.runeconomy.service.auto.IProEconBrownoutsEvent2Service;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -102,6 +102,71 @@ public class ProEconBrownoutsEvent2ServiceImpl extends ServiceImpl<ProEconBrowno
         return fwList;
     }
 
+    /**
+     * 复位及时率-风机统计
+     * @param companyId
+     * @param windpowerstationId
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    @Override
+    public List<FwjslDTO> getWtResetTimelyRateInfo(String companyId, String windpowerstationId, String beginDate, String endDate) {
+        DateTime begin = DateUtil.parse(beginDate, "yyyy-MM-dd");
+        DateTime end = DateUtil.parse(endDate, "yyyy-MM-dd");
+
+        QueryWrapper<ProEconBrownoutsEvent2> qw = new QueryWrapper<>();
+        qw.lambda().eq(ProEconBrownoutsEvent2::getStopTypeId, "维护")
+                .between(ProEconBrownoutsEvent2::getStartTime, DateUtil.beginOfDay(begin), DateUtil.beginOfDay(end));
+        List<ProEconBrownoutsEvent2> brownouts = list(qw);
+
+        // 按照 windturbineId 分组
+        Map<String, List<ProEconBrownoutsEvent2>> groupedByTurbine = brownouts.stream()
+                .collect(Collectors.groupingBy(ProEconBrownoutsEvent2::getWindturbineId));
+
+        List<FwjslDTO> fwList = new ArrayList<>();
+
+        // 对每个分组进行统计
+        for (Map.Entry<String, List<ProEconBrownoutsEvent2>> entry : groupedByTurbine.entrySet()) {
+            String windturbineId = entry.getKey();
+            List<ProEconBrownoutsEvent2> turbineBrownouts = entry.getValue();
+
+            int wfz = 0, sfz = 0, swfz = 0, esfz = 0;
+
+            for (ProEconBrownoutsEvent2 bro : turbineBrownouts) {
+                Double stopHours = bro.getStopHours();
+                if (stopHours == null) continue;
+
+                if (stopHours <= 0.08) {
+                    wfz++;
+                    sfz++;
+                    swfz++;
+                    esfz++;
+                } else if (stopHours <= 0.17) {
+                    sfz++;
+                    swfz++;
+                    esfz++;
+                } else if (stopHours <= 0.25) {
+                    swfz++;
+                    esfz++;
+                } else if (stopHours <= 0.33) {
+                    esfz++;
+                }
+            }
+
+            FwjslDTO dto = new FwjslDTO();
+            dto.setWpid(windturbineId);
+            dto.setWfz(wfz);
+            dto.setSfz(sfz);
+            dto.setSwfz(swfz);
+            dto.setEsfz(esfz);
+
+            fwList.add(dto);
+        }
+        fwList.sort(Comparator.comparing(FwjslDTO::getWfz).reversed());
+        return fwList;
+    }
+
     @Override
     public List<QxjslDTO> getDefectsEliminatRateList(String companyId, String windpowerstationId, String beginDate, String endDate) {
         DateTime begin = DateUtil.parse(beginDate, "yyyy-MM-dd");
@@ -141,5 +206,49 @@ public class ProEconBrownoutsEvent2ServiceImpl extends ServiceImpl<ProEconBrowno
         return xqList;
     }
 
+    @Override
+    public List<QxjslDTO> getyearRateList(String companyId, String windpowerstationId, String beginDate, String endDate) {
+        DateTime begin = DateUtil.parse(beginDate, "yyyy-MM-dd");
+        DateTime end = DateUtil.parse(endDate, "yyyy-MM-dd");
+
+        QueryWrapper<ProEconBrownoutsEvent2> qw = new QueryWrapper<>();
+        qw.lambda().eq(ProEconBrownoutsEvent2::getStopTypeId, "故障")
+                .between(ProEconBrownoutsEvent2::getStartTime, DateUtil.beginOfDay(begin), DateUtil.endOfDay(end));
+
+        // 使用select进行聚合查询
+        qw.select(
+                "COUNT(*) as loss_power",  // 总故障次数
+                "SUM(CASE WHEN stop_hours <= 24 THEN 1 ELSE 0 END) as stop_hours"  // 小时故障次数
+        );
+
+        List<Map<String, Object>> result = getBaseMapper().selectMaps(qw);
+
+        List<QxjslDTO> xqList = new ArrayList<>();
+        QxjslDTO qx = new QxjslDTO();
+        qx.setOrdernum(1);
+        qx.setWpid(CacheContext.wpls.get(0).getName());
+        qx.setGzCount(0L);
+        qx.setXqCount(0L);
+        qx.setXqjsl(0.0);
+
+        if (null != result && !result.isEmpty()) {
+            Map<String, Object> data = result.get(0);
+            Long gzCount = ((Number) data.get("loss_power")).longValue();
+            Long xqCount = data.get("stop_hours") != null ?
+                    ((Number) data.get("stop_hours")).longValue() : 0L;
+
+            qx.setGzCount(gzCount);
+            qx.setXqCount(xqCount);
+
+            if (gzCount > 0) {
+                double xqjsl = NumberUtil.round((xqCount / (double) gzCount * 100), 2).doubleValue();
+                qx.setXqjsl(xqjsl);
+            }
+        }
+
+        xqList.add(qx);
+        return xqList;
+    }
+
 
 }