Просмотр исходного кода

风机和升压站推送点时间区分

wangb 3 дней назад
Родитель
Сommit
2e7dd3783f

+ 78 - 2
generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java

@@ -1375,7 +1375,53 @@ public class WindPowerInfo1Service {
 
     public void writeHaWindturbine(Date date) throws Exception {
         QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
-        qwf.lambda().eq(ProBaseBackfill::getType, "AI0003");
+        qwf.lambda().eq(ProBaseBackfill::getType, "windturbine");
+        List<ProBaseBackfill> list = iProBaseBackfillService.list(qwf);
+        List<String> str = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
+        List<PointData> realData = edosUtil.getRealData(str);
+        QueryWrapper<ProEconAnalysisSubtableBottom> qw = new QueryWrapper<>();
+        qw.lambda().eq(ProEconAnalysisSubtableBottom::getRecordDate, date);
+        List<ProEconAnalysisSubtableBottom> sel = iProEconAnalysisSubtableBottomService.sel(qw);
+        List<ProEconAnalysisSubtableBottom> collect = sel.stream().filter(peasb -> str.contains(peasb.getMeterId())).collect(Collectors.toList());
+        List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
+        if (collect.isEmpty()) {
+            for (PointData real : realData) {
+                ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
+                pb.setRecordDate(date);
+                pb.setWpid("NX_FGS_HA_FDC_STA");
+                pb.setMeterId(real.getPointName());
+                pb.setMeterName(real.getPointName());
+                pb.setStopCode(real.getPointValueInDouble());
+                pb.setStopCodeModify(real.getPointValueInDouble());
+                ls.add(pb);
+            }
+        } else {
+            for (PointData real : realData) {
+                for (ProEconAnalysisSubtableBottom s : sel) {
+                    if (real.getPointName().equals(s.getMeterId())) {
+                        ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
+                        pb.setId(s.getId());
+                        pb.setStopCode(real.getPointValueInDouble());
+                        pb.setStopCodeModify(real.getPointValueInDouble());
+                        pb.setRecordDate(date);
+                        pb.setMeterName(real.getPointName());
+                        pb.setMeterId(real.getPointName());
+                        ls.add(pb);
+                    }
+                }
+            }
+        }
+        try {
+            boolean b = iProEconAnalysisSubtableBottomService.batchAdd(ls);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    public void writeBoosterStation(Date date) throws Exception {
+        QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
+        qwf.lambda().eq(ProBaseBackfill::getType, "booster_station");
         List<ProBaseBackfill> list = iProBaseBackfillService.list(qwf);
         List<String> str = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
         List<PointData> realData = edosUtil.getRealData(str);
@@ -1422,7 +1468,7 @@ public class WindPowerInfo1Service {
 
     public void writeHaWindturbineHistory(Date date) throws Exception {
         QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
-        qwf.lambda().eq(ProBaseBackfill::getType, "AI0003");
+        qwf.lambda().eq(ProBaseBackfill::getType, "windturbine");
         List<ProBaseBackfill> list = iProBaseBackfillService.list(qwf);
         List<String> str = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
         long time = date.getTime();
@@ -1450,6 +1496,36 @@ public class WindPowerInfo1Service {
     }
 
 
+    public void writeBoosterStationHistory(Date date) throws Exception {
+        QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
+        qwf.lambda().eq(ProBaseBackfill::getType, "booster_station");
+        List<ProBaseBackfill> list = iProBaseBackfillService.list(qwf);
+        List<String> str = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
+        long time = date.getTime();
+
+        for (long i = time; i < 1751248800000L; i += 86400000) {
+            List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
+            for (String s : str) {
+                Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), s, i);
+                ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
+                pb.setRecordDate(new Date(i));
+                pb.setWpid("NX_FGS_HA_FDC_STA");
+                pb.setMeterId(s);
+                pb.setMeterName(s);
+                pb.setStopCode(historySection.get(s).getDoubleValue());
+                pb.setStopCodeModify(historySection.get(s).getDoubleValue());
+                ls.add(pb);
+            }
+            try {
+                boolean b = iProEconAnalysisSubtableBottomService.batchAdd(ls);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+        }
+    }
+
+
 //    public void writeGfHistory(Date date) throws Exception {
 //        String s2 = "2024-12-11 23:55:00";
 //        String[] split = gf.split(",");

+ 12 - 0
generationXK-service/src/main/java/com/gyee/generation/task/SaticSchedulePgTask.java

@@ -1760,6 +1760,18 @@ public class SaticSchedulePgTask {
 
     }
 
+    @XxlJob("report_booster_station")
+    public void reportBoosterStation() throws Exception {
+
+        Date date = new Date();
+        windPowerInfo1Service.writeBoosterStation(date);
+//        date.setTime(1735660800000L);
+//        windPowerInfo1Service.writeBoosterStationHistory(date);
+
+    }
+
+
+
     /**
      * 一/二期风机运行参数
      */

+ 19 - 10
generationXK-service/src/test/java/com/gyee/generation/SaticScheduleCALTaskTest.java

@@ -56,20 +56,20 @@ public class SaticScheduleCALTaskTest {
 //        saticScheduleCALTask.calculate_powerRationing();
 //        saticScheduleCALTask.calculateStatusNumber();
 //
-////        saticSchedulePgTask.shutdown_All_STA();
+//        saticSchedulePgTask.shutdown_All_STA();
 //
 //        saticScheduleCALTask.theoreticalPower_CAL();
 //        saticScheduleCALTask.realtime_CAL();
 //        saticScheduleCALTask.realtime_Wp_CAL();
 //        saticScheduleCALTask.electricityMetering_CAL();
 
-        //saticScheduleCALTask.accessStatus_CAL();
-        saticScheduleCALTask.cycleCalculation_CAL();
+//        saticScheduleCALTask.accessStatus_CAL();
+//        saticScheduleCALTask.cycleCalculation_CAL();
 
 
-        //saticSchedulePgTask.inputOrOutPutSpeed_PG();
+//        saticSchedulePgTask.inputOrOutPutSpeed_PG();
         //saticSchedulePgTask.inputOrOutPut_PG();
-        //saticSchedulePgTask.shutdown_PG();
+//        saticSchedulePgTask.shutdown_PG();
 
         //saticSchedulePgTask.wtwindDayInfo_PG();
         //saticSchedulePgTask.wpwindDayInfo_PG();
@@ -77,23 +77,32 @@ public class SaticScheduleCALTaskTest {
 //        saticSchedulePgTask.equipment_PowerInfo1_PG();
         //saticSchedulePgTask.equipment_PowerInfo2_PG();
         //saticSchedulePgTask.equipment_PowerInfo3_PG();
-        //saticSchedulePgTask.equipment_PowerInfo5_PG();
-        //saticSchedulePgTask.equipment_PowerInfo4_PG();
+//        saticSchedulePgTask.equipment_PowerInfo4_PG();
+//        saticSchedulePgTask.equipment_PowerInfo5_PG();
+
         //saticSchedulePgTask.equipmentInfoDayTop_PG();
-        //saticSchedulePgTask.wtAlysisDay_PG();
+//        saticSchedulePgTask.wtAlysisDay_PG();
 
         //saticSchedulePgTask.windturbineGoodness_PG();
         //saticSchedulePgTask.calWindDeviation_PG();
-        //saticSchedulePgTask.calFailRate_PG();
+//        saticSchedulePgTask.calFailRate_PG();
         //saticSchedulePgTask.brownouts_PG();
 
         //saticSchedulePgTask.windPowerInfo1_PG();
         //saticSchedulePgTask.windPowerInfo2_PG();
         //saticSchedulePgTask.windPowerInfo3_PG();
-        //saticSchedulePgTask.windPowerInfo4_PG();
+//        saticSchedulePgTask.windPowerInfo4_PG();
         //saticSchedulePgTask.windPowerInfo5_PG();
         //saticSchedulePgTask.windPowerInfo6_PG();
 
+//        saticSchedulePgTask.inputOrOutPut_PG();
 
+        //报表
+//        saticSchedulePgTask.reportInfo1();
+//        saticSchedulePgTask.reportInfo2();
+//        saticSchedulePgTask.reportInfo3();
+//        saticSchedulePgTask.ndgfzb();
+//        saticSchedulePgTask.reportHaWindturbine();
+//        saticSchedulePgTask.reportBoosterStation();
     }
 }

+ 259 - 31
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java

@@ -193,13 +193,13 @@ public class SpecificService {
             Optional<TurbineInfoDay> monthFirst = monthList.stream().findFirst();
             if (monthFirst.isPresent()) {
                 TurbineInfoDay monthSpecific = monthFirst.get();
-                dqvo.setYllfdl(DoubleUtils.getRoundingNum(monthSpecific.getLlfdl() / 10000, 2));
-                dqvo.setYsjfdl(DoubleUtils.getRoundingNum(monthSpecific.getRfdl().doubleValue() / 10000, 2));
-                dqvo.setYwhssdl(DoubleUtils.getRoundingNum(monthSpecific.getJhjxss().doubleValue() / 10000 + monthSpecific.getFjhjxss().doubleValue() / 10000, 2));
-                dqvo.setYgzssdl(DoubleUtils.getRoundingNum(monthSpecific.getGzss().doubleValue() / 10000, 2));
-                dqvo.setYxdssdl(DoubleUtils.getRoundingNum(monthSpecific.getXnss().doubleValue() / 10000, 2));
-                dqvo.setYxnssdl(DoubleUtils.getRoundingNum(monthSpecific.getDjss().doubleValue() / 10000, 2));
-                dqvo.setYslssdl(DoubleUtils.getRoundingNum(monthSpecific.getSlss().doubleValue() / 10000, 2));
+                dqvo.setYllfdl(DoubleUtils.getRoundingNum(monthSpecific.getLlfdl() / 1000, 2));
+                dqvo.setYsjfdl(DoubleUtils.getRoundingNum(monthSpecific.getRfdl() / 1000, 2));
+                dqvo.setYwhssdl(DoubleUtils.getRoundingNum(monthSpecific.getJhjxss() / 1000 + monthSpecific.getFjhjxss() / 1000, 2));
+                dqvo.setYgzssdl(DoubleUtils.getRoundingNum(monthSpecific.getGzss() / 1000, 2));
+                dqvo.setYxdssdl(DoubleUtils.getRoundingNum(monthSpecific.getXnss() / 1000, 2));
+                dqvo.setYxnssdl(DoubleUtils.getRoundingNum(monthSpecific.getDjss() / 1000, 2));
+                dqvo.setYslssdl(DoubleUtils.getRoundingNum(monthSpecific.getSlss() / 1000, 2));
                 if (dqvo.getYllfdl() != 0) {
                     dqvo.setYfnlyl(DoubleUtils.getRoundingNum(dqvo.getYsjfdl() / dqvo.getYllfdl() * 100, 2));
                     dqvo.setYwhssl(DoubleUtils.getRoundingNum(dqvo.getYwhssdl() / dqvo.getYllfdl() * 100, 2));
@@ -312,13 +312,13 @@ public class SpecificService {
         Optional<TurbineInfoDay> monthFirst = monthList.stream().findFirst();
         if (monthFirst.isPresent()) {
             TurbineInfoDay monthSpecific = monthFirst.get();
-            dqvo.setYllfdl(DoubleUtils.getRoundingNum(monthSpecific.getLlfdl() / 10000, 2));
-            dqvo.setYsjfdl(DoubleUtils.getRoundingNum(monthSpecific.getRfdl().doubleValue() / 10000, 2));
-            dqvo.setYwhssdl(DoubleUtils.getRoundingNum(monthSpecific.getJhjxss().doubleValue() / 10000 + monthSpecific.getFjhjxss().doubleValue() / 10000, 2));
-            dqvo.setYgzssdl(DoubleUtils.getRoundingNum(monthSpecific.getGzss().doubleValue() / 10000, 2));
-            dqvo.setYxdssdl(DoubleUtils.getRoundingNum(monthSpecific.getXnss().doubleValue() / 10000, 2));
-            dqvo.setYxnssdl(DoubleUtils.getRoundingNum(monthSpecific.getDjss().doubleValue() / 10000, 2));
-            dqvo.setYslssdl(DoubleUtils.getRoundingNum(monthSpecific.getSlss().doubleValue() / 10000, 2));
+            dqvo.setYllfdl(DoubleUtils.getRoundingNum(monthSpecific.getLlfdl() / 1000, 2));
+            dqvo.setYsjfdl(DoubleUtils.getRoundingNum(monthSpecific.getRfdl() / 1000, 2));
+            dqvo.setYwhssdl(DoubleUtils.getRoundingNum(monthSpecific.getJhjxss() / 1000 + monthSpecific.getFjhjxss() / 1000, 2));
+            dqvo.setYgzssdl(DoubleUtils.getRoundingNum(monthSpecific.getGzss() / 1000, 2));
+            dqvo.setYxdssdl(DoubleUtils.getRoundingNum(monthSpecific.getXnss() / 1000, 2));
+            dqvo.setYxnssdl(DoubleUtils.getRoundingNum(monthSpecific.getDjss() / 1000, 2));
+            dqvo.setYslssdl(DoubleUtils.getRoundingNum(monthSpecific.getSlss() / 1000, 2));
             if (dqvo.getYllfdl() != 0) {
                 dqvo.setYfnlyl(DoubleUtils.getRoundingNum(dqvo.getYsjfdl() / dqvo.getYllfdl() * 100, 2));
                 dqvo.setYwhssl(DoubleUtils.getRoundingNum(dqvo.getYwhssdl() / dqvo.getYllfdl() * 100, 2));
@@ -431,13 +431,13 @@ public class SpecificService {
             Optional<TurbineInfoDay> yearFirsts = yearList.stream().findFirst();
             if (yearFirsts.isPresent()) {
                 TurbineInfoDay yearSpecific = yearFirsts.get();
-                dqvo.setNllfdl(DoubleUtils.getRoundingNum(yearSpecific.getLlfdl() / 10000, 2));
-                dqvo.setNsjfdl(DoubleUtils.getRoundingNum(yearSpecific.getRfdl().doubleValue() / 10000, 2));
-                dqvo.setNwhssdl(DoubleUtils.getRoundingNum(yearSpecific.getJhjxss().doubleValue() / 10000 + yearSpecific.getFjhjxss().doubleValue() / 10000, 2));
-                dqvo.setNgzssdl(DoubleUtils.getRoundingNum(yearSpecific.getGzss().doubleValue() / 10000, 2));
-                dqvo.setNxdssdl(DoubleUtils.getRoundingNum(yearSpecific.getXnss().doubleValue() / 10000, 2));
-                dqvo.setNxnssdl(DoubleUtils.getRoundingNum(yearSpecific.getDjss().doubleValue() / 10000, 2));
-                dqvo.setNslssdl(DoubleUtils.getRoundingNum(yearSpecific.getSlss().doubleValue() / 10000, 2));
+                dqvo.setNllfdl(DoubleUtils.getRoundingNum(yearSpecific.getLlfdl() / 1000, 2));
+                dqvo.setNsjfdl(DoubleUtils.getRoundingNum(yearSpecific.getRfdl() / 1000, 2));
+                dqvo.setNwhssdl(DoubleUtils.getRoundingNum(yearSpecific.getJhjxss() / 1000 + yearSpecific.getFjhjxss() / 1000, 2));
+                dqvo.setNgzssdl(DoubleUtils.getRoundingNum(yearSpecific.getGzss() / 1000, 2));
+                dqvo.setNxdssdl(DoubleUtils.getRoundingNum(yearSpecific.getXnss() / 1000, 2));
+                dqvo.setNxnssdl(DoubleUtils.getRoundingNum(yearSpecific.getDjss() / 1000, 2));
+                dqvo.setNslssdl(DoubleUtils.getRoundingNum(yearSpecific.getSlss() / 1000, 2));
                 if (dqvo.getYllfdl() != 0) {
                     dqvo.setNfnlyl(DoubleUtils.getRoundingNum(dqvo.getNsjfdl() / dqvo.getNllfdl() * 100, 2));
                     dqvo.setNwhssl(DoubleUtils.getRoundingNum(dqvo.getNwhssdl() / dqvo.getNllfdl() * 100, 2));
@@ -551,12 +551,12 @@ public class SpecificService {
         if (yearFirsts.isPresent()) {
             TurbineInfoDay yearSpecific = yearFirsts.get();
             dqvo.setNllfdl(DoubleUtils.getRoundingNum(yearSpecific.getLlfdl() / 10000, 2));
-            dqvo.setNsjfdl(DoubleUtils.getRoundingNum(yearSpecific.getRfdl().doubleValue() / 10000, 2));
-            dqvo.setNwhssdl(DoubleUtils.getRoundingNum(yearSpecific.getJhjxss().doubleValue() / 10000 + yearSpecific.getFjhjxss().doubleValue() / 10000, 2));
-            dqvo.setNgzssdl(DoubleUtils.getRoundingNum(yearSpecific.getGzss().doubleValue() / 10000, 2));
-            dqvo.setNxdssdl(DoubleUtils.getRoundingNum(yearSpecific.getXnss().doubleValue() / 10000, 2));
-            dqvo.setNxnssdl(DoubleUtils.getRoundingNum(yearSpecific.getDjss().doubleValue() / 10000, 2));
-            dqvo.setNslssdl(DoubleUtils.getRoundingNum(yearSpecific.getSlss().doubleValue() / 10000, 2));
+            dqvo.setNsjfdl(DoubleUtils.getRoundingNum(yearSpecific.getRfdl() / 10000, 2));
+            dqvo.setNwhssdl(DoubleUtils.getRoundingNum(yearSpecific.getJhjxss() / 10000 + yearSpecific.getFjhjxss() / 10000, 2));
+            dqvo.setNgzssdl(DoubleUtils.getRoundingNum(yearSpecific.getGzss() / 10000, 2));
+            dqvo.setNxdssdl(DoubleUtils.getRoundingNum(yearSpecific.getXnss() / 10000, 2));
+            dqvo.setNxnssdl(DoubleUtils.getRoundingNum(yearSpecific.getDjss() / 10000, 2));
+            dqvo.setNslssdl(DoubleUtils.getRoundingNum(yearSpecific.getSlss() / 10000, 2));
             if (dqvo.getYllfdl() != 0) {
                 dqvo.setNfnlyl(DoubleUtils.getRoundingNum(dqvo.getNsjfdl() / dqvo.getNllfdl() * 100, 2));
                 dqvo.setNwhssl(DoubleUtils.getRoundingNum(dqvo.getNwhssdl() / dqvo.getNllfdl() * 100, 2));
@@ -697,6 +697,7 @@ public class SpecificService {
             i.setWpid(wpmap.get(i.getWpid()).getAname());
 
         });
+
         yearresultList.stream().forEach(i -> {
             i.setOrdernum(wpmap.get(i.getWpid()).getOrderNum());
             i.setWpid(wpmap.get(i.getWpid()).getAname());
@@ -720,7 +721,7 @@ public class SpecificService {
      * @param yearmonth
      * @param monthresultList
      */
-    private void setCenterYtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
+    private void setCenterYtqInfo2(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
 
         //        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
         //        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
@@ -803,13 +804,80 @@ public class SpecificService {
 
     }
 
+
+    /**
+     * 设置月同期mtbf,mttr,复位及时率,状态转换率,消缺及时率
+     *
+     * @param companys
+     * @param type
+     * @param yearmonth
+     * @param monthresultList
+     */
+    private void setCenterYtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
+        List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
+        String yearString = yearmonth.split("-")[0];
+        String year = String.valueOf(Integer.parseInt(yearString) - 1);
+        String yearMonth = year + "-" + yearmonth.split("-")[1];
+        QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
+        QueryWrapper<StationInfoMonth> qw2 = new QueryWrapper<>();
+
+        qw.select("foreign_key_id,sum(rmtbf) ymtbf,sum(rmttr) ymttr,avg(rfwjsl) yfwjsl,avg(rztzhjsl) yztzhjsl,avg(rgzxqjsl) ygzxqjsl");
+        qw.eq("location", "wp");
+        qw.like("foreign_key_id", "_FDC_");
+        qw.eq("to_char(record_date,'yyyy-MM')", yearMonth);
+        qw2.eq("to_char(record_date,'yyyy-MM')", yearmonth);
+        qw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
+        List<ProEconPowerstationInfoDay4> tqList = proEconPowerstationInfoDay4Service.list(qw);
+        List<StationInfoMonth> list = stationInfoMonthService.list(qw2);
+        if (StringUtils.isNotEmpty(tqList)) {
+            tqList.stream().forEach(i -> {
+                Optional<SpecificCenterVo> optionMonth = monthresultList.stream().filter(j -> j.getWpid().equals(i.getForeignKeyId())).findFirst();
+                SpecificCenterVo leftVo = optionMonth.get();
+                if (optionMonth.isPresent()) {
+                    if (null != list && !list.isEmpty()) {
+                        leftVo.setTqmtbf(NumberUtil.round(list.get(0).getMtbf(), 2).doubleValue());
+                        leftVo.setTqmttr(NumberUtil.round(list.get(0).getMttr(), 2).doubleValue());
+                    } else {
+                        leftVo.setTqmtbf(0.0);
+                        leftVo.setTqmttr(0.0);
+                    }
+                    leftVo.setTqfwjsl(DoubleUtils.keepPrecision(i.getYfwjsl().doubleValue(), 2));
+                    leftVo.setTqztzhl(DoubleUtils.keepPrecision(i.getYztzhjsl().doubleValue(), 2));
+                    leftVo.setTqxqjsl(DoubleUtils.keepPrecision(i.getYgzxqjsl().doubleValue(), 2));
+                } else {
+                    leftVo.setTqmtbf(0.0);
+                    leftVo.setTqmttr(0.0);
+                    leftVo.setTqfwjsl(0.0);
+                    leftVo.setTqztzhl(0.0);
+                    leftVo.setTqxqjsl(0.0);
+                }
+            });
+        } else {
+            List<ProBasicPowerstation> wpls = benchmarkingService.wpByCplist(companys, type);
+            wpls.stream().forEach(wp -> {
+                Optional<SpecificCenterVo> optionMonth = monthresultList.stream().filter(j -> j.getWpid().equals(wp.getId())).findFirst();
+                if (optionMonth.isPresent()) {
+                    SpecificCenterVo leftVo = optionMonth.get();
+                    leftVo.setTqmtbf(0.0);
+                    leftVo.setTqmttr(0.0);
+                    leftVo.setTqfwjsl(0.0);
+                    leftVo.setTqztzhl(0.0);
+                    leftVo.setTqxqjsl(0.0);
+                }
+
+            });
+
+        }
+
+    }
+
     /**
      * 设置年同期mtbf,mttr,复位及时率,状态转换率,消缺及时率
      *
      * @param companys
      * @param yearresultList
      */
-    private void setCenterNtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) throws ParseException {
+    private void setCenterNtqInfo2(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) throws ParseException {
 
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
         //        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
@@ -884,13 +952,70 @@ public class SpecificService {
     }
 
     /**
+     * 设置年同期mtbf,mttr,复位及时率,状态转换率,消缺及时率
+     *
+     * @param companys
+     * @param yearresultList
+     */
+    private void setCenterNtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) throws ParseException {
+        String yearString = yearmonth.split("-")[0];
+        String year = String.valueOf(Integer.parseInt(yearString) - 1);
+        QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
+        QueryWrapper<StationInfoMonth> qw2 = new QueryWrapper<>();
+        qw.select("foreign_key_id,sum(rmtbf) nmtbf,sum(rmttr) nmttr,avg(rfwjsl) nfwjsl,avg(rztzhjsl) nztzhjsl,avg(rgzxqjsl) ngzxqjsl");
+        qw2.select("station_id,avg(mtbf) as mtbf,avg(mttr) as mttr");
+        qw.eq("location", "wp");
+        qw.like("foreign_key_id", "_FDC_");
+        qw.eq("to_char(record_date,'yyyy')", year);
+        qw2.eq("to_char(record_date,'yyyy')", year);
+        qw.groupBy("to_char(record_date,'yyyy'),foreign_key_id");
+        qw2.groupBy("to_char(record_date,'yyyy'),station_id");
+        List<ProEconPowerstationInfoDay4> tqList = proEconPowerstationInfoDay4Service.list(qw);
+        List<StationInfoMonth> list = stationInfoMonthService.list(qw2);
+        if (StringUtils.isNotEmpty(tqList)) {
+            tqList.stream().forEach(i -> {
+                Optional<SpecificCenterVo> optionYear = yearresultList.stream().filter(j -> j.getWpid().equals(i.getWindpowerstationId())||j.getWpid().equals(i.getForeignKeyId())).findFirst();
+                if (optionYear.isPresent()) {
+                    SpecificCenterVo rightVo = optionYear.get();
+                    if (null != list && !list.isEmpty()) {
+                        rightVo.setTqmtbf(NumberUtil.round(list.get(0).getMtbf(), 2).doubleValue());
+                        rightVo.setTqmttr(NumberUtil.round(list.get(0).getMttr(), 2).doubleValue());
+                    } else {
+                        rightVo.setTqmtbf(0.0);
+                        rightVo.setTqmttr(0.0);
+                    }
+                    rightVo.setTqfwjsl(DoubleUtils.keepPrecision(i.getNfwjsl().doubleValue(), 2));
+                    rightVo.setTqztzhl(DoubleUtils.keepPrecision(i.getNztzhjsl().doubleValue(), 2));
+                    rightVo.setTqxqjsl(DoubleUtils.keepPrecision(i.getNgzxqjsl().doubleValue(), 2));
+                }
+            });
+        } else {
+            List<ProBasicPowerstation> wpls = benchmarkingService.wpByCplist(companys, type);
+            wpls.stream().forEach(wp -> {
+                Optional<SpecificCenterVo> optionMonth = yearresultList.stream().filter(j -> j.getWpid().equals(wp.getId())).findFirst();
+                if (optionMonth.isPresent()) {
+                    SpecificCenterVo leftVo = optionMonth.get();
+                    leftVo.setTqmtbf(0.0);
+                    leftVo.setTqmttr(0.0);
+                    leftVo.setTqfwjsl(0.0);
+                    leftVo.setTqztzhl(0.0);
+                    leftVo.setTqxqjsl(0.0);
+                }
+
+            });
+        }
+
+    }
+
+    /**
      * 设置当月mtbf,mttr,复位及时率,状态转换率,消缺及时率
      *
      * @param companys
      * @param type
      * @param monthresultList
      */
-    private void setCenterDyInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
+    private void setCenterDyInfo2(String companys, String type, String
+            yearmonth, List<SpecificCenterVo> monthresultList) {
 
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
         //        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
@@ -961,13 +1086,64 @@ public class SpecificService {
 
     }
 
+
+    private void setCenterDyInfo(String companys, String type, String
+            yearmonth, List<SpecificCenterVo> monthresultList) {
+
+        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+        List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
+        QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
+        QueryWrapper<StationInfoMonth> qw2 = new QueryWrapper<>();
+        qw.select("foreign_key_id,sum(rmtbf) ymtbf,sum(rmttr) ymttr,avg(rfwjsl) yfwjsl,avg(rztzhjsl) yztzhjsl,avg(rgzxqjsl) ygzxqjsl");
+        qw.eq("location", "wp");
+        qw.like("foreign_key_id", "_FDC_");
+        qw.eq("to_char(record_date,'yyyy-MM')", yearmonth);
+        qw2.eq("to_char(record_date,'yyyy-MM')", yearmonth);
+        qw.groupBy("to_char(record_date,'yyyy-MM'),foreign_key_id");
+        List<ProEconPowerstationInfoDay4> dyList = proEconPowerstationInfoDay4Service.list(qw);
+        List<StationInfoMonth> list = stationInfoMonthService.list(qw2);
+        if (StringUtils.isNotEmpty(dyList)) {
+            dyList.stream().forEach(i -> {
+                SpecificCenterVo leftVo = new SpecificCenterVo();
+                leftVo.setWpid(i.getForeignKeyId());
+                if (null != list && !list.isEmpty()) {
+                    leftVo.setMtbf(NumberUtil.round(list.get(0).getMtbf(), 2).doubleValue());
+                    leftVo.setMttr(NumberUtil.round(list.get(0).getMttr(), 2).doubleValue());
+                } else {
+                    leftVo.setMtbf(0.0);
+                    leftVo.setMttr(0.0);
+                }
+                leftVo.setFwjsl(DoubleUtils.keepPrecision(i.getYfwjsl().doubleValue(), 2));
+                leftVo.setZtzhl(DoubleUtils.keepPrecision(i.getYztzhjsl().doubleValue(), 2));
+                leftVo.setXqjsl(DoubleUtils.keepPrecision(i.getYgzxqjsl().doubleValue(), 2));
+
+                monthresultList.add(leftVo);
+            });
+        } else {
+            List<ProBasicPowerstation> wpls = benchmarkingService.wpByCplist(companys, type);
+            wpls.stream().forEach(i -> {
+                SpecificCenterVo leftVo = new SpecificCenterVo();
+                leftVo.setWpid(i.getId());
+                leftVo.setMtbf(0.0);
+                leftVo.setMttr(0.0);
+                leftVo.setFwjsl(0.0);
+                leftVo.setZtzhl(0.0);
+                leftVo.setXqjsl(0.0);
+                monthresultList.add(leftVo);
+            });
+        }
+
+    }
+
+
     /**
      * 设置当年mtbf,mttr,复位及时率,状态转换率,消缺及时率
      *
      * @param companys
      * @param yearresultList
      */
-    private void setCenterDnInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) {
+    private void setCenterDnInfo2(String companys, String type, String
+            yearmonth, List<SpecificCenterVo> yearresultList) {
 
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
         //        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
@@ -1038,6 +1214,58 @@ public class SpecificService {
     }
 
     /**
+     * 设置当年mtbf,mttr,复位及时率,状态转换率,消缺及时率
+     *
+     * @param companys
+     * @param yearresultList
+     */
+    private void setCenterDnInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) {
+        QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
+        QueryWrapper<StationInfoMonth> qw2 = new QueryWrapper<>();
+        qw.select("foreign_key_id,sum(rmtbf) nmtbf,sum(rmttr) nmttr,avg(rfwjsl) nfwjsl,avg(rztzhjsl) nztzhjsl,avg(rgzxqjsl) ngzxqjsl");
+        qw2.select("station_id,avg(mtbf) as mtbf,avg(mttr) as mttr");
+        qw.eq("location", "wp");
+        qw.like("foreign_key_id", "_FDC_");
+        qw.eq("to_char(record_date,'yyyy')", yearmonth.split("-")[0]);
+        qw2.eq("to_char(record_date,'yyyy')", yearmonth.split("-")[0]);
+        qw.groupBy("to_char(record_date,'yyyy'),foreign_key_id");
+        qw2.groupBy("to_char(record_date,'yyyy'),station_id");
+        List<ProEconPowerstationInfoDay4> dyList = proEconPowerstationInfoDay4Service.list(qw);
+        List<StationInfoMonth> list = stationInfoMonthService.list(qw2);
+        if (StringUtils.isNotEmpty(dyList)) {
+            dyList.stream().forEach(i -> {
+                SpecificCenterVo rightVo = new SpecificCenterVo();
+                rightVo.setWpid(i.getForeignKeyId());
+                if (null != list && !list.isEmpty()) {
+                    rightVo.setMtbf(NumberUtil.round(list.get(0).getMtbf(), 2).doubleValue());
+                    rightVo.setMttr(NumberUtil.round(list.get(0).getMttr(), 2).doubleValue());
+                } else {
+                    rightVo.setMtbf(0.0);
+                    rightVo.setMttr(0.0);
+                }
+                rightVo.setFwjsl(DoubleUtils.keepPrecision(i.getNfwjsl().doubleValue(), 2));
+                rightVo.setZtzhl(DoubleUtils.keepPrecision(i.getNztzhjsl().doubleValue(), 2));
+                rightVo.setXqjsl(DoubleUtils.keepPrecision(i.getNgzxqjsl().doubleValue(), 2));
+
+                yearresultList.add(rightVo);
+            });
+        } else {
+            List<ProBasicPowerstation> wpls = benchmarkingService.wpByCplist(companys, type);
+            wpls.stream().forEach(i -> {
+                SpecificCenterVo rightVo = new SpecificCenterVo();
+                rightVo.setWpid(i.getId());
+                rightVo.setMtbf(0.0);
+                rightVo.setMttr(0.0);
+                rightVo.setFwjsl(0.0);
+                rightVo.setZtzhl(0.0);
+                rightVo.setXqjsl(0.0);
+                yearresultList.add(rightVo);
+            });
+        }
+
+    }
+
+    /**
      * 获取风能利用率
      *
      * @param companys