瀏覽代碼

光伏计算服务算法修正

shilin 1 年之前
父節點
當前提交
38fc62b9e4
共有 14 個文件被更改,包括 532 次插入327 次删除
  1. 106 28
      realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java
  2. 5 5
      realtime/generationXK-service/src/main/java/com/gyee/generation/config/ThreadPoolTaskConfig.java
  3. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java
  4. 4 3
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java
  5. 4 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java
  6. 4 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo3Service.java
  7. 50 16
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo4Service.java
  8. 38 147
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WtAlysisDayService.java
  9. 95 87
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java
  10. 87 24
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java
  11. 8 3
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/SafetyDayService.java
  12. 29 5
      realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticScheduleCALTask.java
  13. 97 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticSchedulePgTask.java
  14. 3 3
      realtime/generationXK-service/src/test/java/com/gyee/generation/HealthTest.java

+ 106 - 28
realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java

@@ -13,48 +13,126 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 @SpringBootApplication
 @MapperScan("com.gyee.generation.mapper")
 public class GenerationMain {
+
+
     public static void main(String[] args) throws Exception {
         SpringApplication.run(GenerationMain.class, args);
-//        System.out.println("设备指标记录调度程序执行开始!。。。。。。");
+
+        System.out.println("启动完成");
+
+//        /*************************风机历史计算服务**************************/
+//        Calendar c = Calendar.getInstance();
+//        Logger logger = LoggerFactory.getLogger(GenerationMain.class);
+//
+//        while (true) {
+//
+//            Date begin = new Date();
+//            Date end = null;
+//            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//            logger.info(df.format(c.getTime()).toString());
+//
+//
+//
+//
+//            EquipmentInfo1Service equipmentInfo1Service= SpringUtils.getBean("equipmentInfo1Service");
+//            EquipmentInfo2Service equipmentInfo2Service= SpringUtils.getBean("equipmentInfo2Service");
+//            EquipmentInfo3Service equipmentInfo3Service= SpringUtils.getBean("equipmentInfo3Service");
+//
+//
+//
+//
+//            equipmentInfo1Service.calEquipmentInfoDay(begin);
+//            equipmentInfo2Service.calEquipmentInfoDay(begin);
+//            equipmentInfo3Service.calEquipmentInfoDay(begin);
+//
+//            EquipmentInfo5Service equipmentInfo5Service= SpringUtils.getBean("equipmentInfo5Service");
+//            EquipmentInfo4Service equipmentInfo4Service= SpringUtils.getBean("equipmentInfo4Service");
+//
+//            equipmentInfo5Service.calEquipmentInfoDay(begin);
+//            equipmentInfo4Service.calEquipmentInfoDay(begin);
+//
+//
+//            WtAlysisDayService wtAlysisDayService= SpringUtils.getBean("wtAlysisDayService");
+//
+//            EquipmentInfoDayTopService equipmentInfoDayTopService= SpringUtils.getBean("equipmentInfoDayTopService");
+//            equipmentInfoDayTopService.calEquipmentInfoDayTop(begin);
+//            equipmentInfoDayTopService.calEquipmentInfoMonthTop(begin);
+//            equipmentInfoDayTopService.calEquipmentInfoYearTop(begin);
+//
+//            wtAlysisDayService.calEquipmentInfoDay(new Date());
+//
+//            end = new Date();
+//            logger.info(df.format(end).toString());
+//            logger.info("完成一次!。。。。。。");
+//            logger.info("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
+//            Thread.sleep(3000);
+//        }
+//
+//        /*************************风机历史计算服务**************************/
+
+
+//        /*************************逆变器历史计算服务**************************/
+//        Calendar c = Calendar.getInstance();
+//        Logger logger = LoggerFactory.getLogger(GenerationMain.class);
+//
+//        while (true) {
+//
+//            Date begin = new Date();
+//            Date end = null;
+//            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//            logger.info(df.format(c.getTime()).toString());
+//
+//
+//
+//
+//            EquipmentInfo1Service equipmentInfo1Service= SpringUtils.getBean("equipmentInfo1Service");
+//            EquipmentInfo2Service equipmentInfo2Service= SpringUtils.getBean("equipmentInfo2Service");
+//            EquipmentInfo3Service equipmentInfo3Service= SpringUtils.getBean("equipmentInfo3Service");
+//
+//
+//
 //
+//            equipmentInfo1Service.calEquipmentInfoDay(begin);
+//            equipmentInfo2Service.calEquipmentInfoDay(begin);
+//            equipmentInfo3Service.calEquipmentInfoDay(begin);
 //
 //
+//            end = new Date();
+//            logger.info(df.format(end).toString());
+//            logger.info("完成一次!。。。。。。");
+//            logger.info("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
+//            Thread.sleep(3000);
+//        }
+//
+//        /*************************逆变器历史计算服务**************************/
+//
 //
+//        /*************************15分钟实时状态计算服务**************************/
 //        Calendar c = Calendar.getInstance();
-//        Date begin = null;
-//        Date end = null;
-//        c.setTime(DateUtils.truncate(c.getTime()));
-////        c.set(Calendar. MONTH, 9);
-//        c.set(Calendar.DAY_OF_MONTH, 1);
-//        c.set(Calendar.HOUR_OF_DAY, 23);
-//        c.set(Calendar.MINUTE, 59);
-//        c.set(Calendar.SECOND, 59);
-////////
-////////
-////////
-////////
-//        begin = new Date();
-//        System.out.println("设备指标记录调度程序执行开始!。。。。。。");
-//        for (int i = 0; i < 9; i++) {
 //
+//
+//        while (true) {
+//
+//            Date begin = new Date();
+//            Date end = null;
 //            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//           System.out.println(df.format(c.getTime()).toString());
+//            System.out.println(df.format(c.getTime()).toString());
+//
 //
-//            CycleCalculationRebuildService cycleCalculationRebuildService = SpringUtils.getBean("cycleCalculationRebuildService");
 //
-//            cycleCalculationRebuildService.saveCyle(c.getTime());
 //
-//            c.add(Calendar.DAY_OF_MONTH, 1);
+//            CycleCalculationService cycleCalculationService= SpringUtils.getBean("cycleCalculationService");
+//
+//            cycleCalculationService.saveCyle();
+//
+//
 //            end = new Date();
-//            System.out.println(end);
+//            System.out.println(df.format(end).toString());
 //            System.out.println("完成一次!。。。。。。");
+//            System.out.println("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
+//            Thread.sleep(3000);
 //        }
-//        System.out.println("设备指标记录调度程序执行结束!。。。。。。");
-//        end = new Date();
-//        System.out.println("执行用时" + DateUtils.secondsDiff(begin, end) + "秒");
-//        System.out.println(end);
-
-
-        System.out.println("完成");
+//
+//        /*************************状态实时状态计算服务**************************/
     }
 }

+ 5 - 5
realtime/generationXK-service/src/main/java/com/gyee/generation/config/ThreadPoolTaskConfig.java

@@ -14,15 +14,15 @@ public class ThreadPoolTaskConfig {
      */
 
     /** 核心线程数(默认线程数) */
-    private static final int corePoolSize =100;
+    private static final int corePoolSize =240;
     /** 最大线程数 */
-    private static final int maxPoolSize = 240;
+    private static final int maxPoolSize = 360;
     /** 允许线程空闲时间(单位:默认为秒) */
-    private static final int keepAliveTime = 60;
+    private static final int keepAliveTime = 3;
     /** 缓冲队列大小 */
-    private static final int queueCapacity = 100;
+    private static final int queueCapacity = 360;
     /** 允许等待最长时间 */
-    private static final int awaitTime = 30;
+    private static final int awaitTime = 3600;
     /** 线程池名前缀 */
     private static final String threadNamePrefix = "GYEE-Thread-";
 

+ 2 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java

@@ -30,7 +30,7 @@ import org.springframework.core.env.Environment;
 //@PropertySource("classpath:xxl-job-accuracy.properties")
 //@PropertySource("classpath:xxl-job-7001.properties")
 //@PropertySource("classpath:xxl-job-7002.properties")
-@PropertySource("classpath:xxl-job-7003.properties")
+//@PropertySource("classpath:xxl-job-7003.properties")
 //@PropertySource("classpath:xxl-job-executorGF000.properties")
 //@PropertySource("classpath:xxl-job-executorGF001.properties")
 //@PropertySource("classpath:xxl-job-executorGF002.properties")
@@ -38,7 +38,7 @@ import org.springframework.core.env.Environment;
 //@PropertySource("classpath:xxl-job-executorGF004.properties")
 //@PropertySource("classpath:xxl-job-executorGF005.properties")
 //@PropertySource("classpath:xxl-job-executorGF006.properties")
-//@PropertySource("classpath:xxl-job-executorGF007.properties")
+@PropertySource("classpath:xxl-job-executorGF007.properties")
 //@PropertySource("classpath:xxl-job-executorGF008.properties")
 //@PropertySource("classpath:xxl-job-region.properties")
 public class XxlJobConfig implements EnvironmentAware {

+ 4 - 3
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java

@@ -111,16 +111,16 @@ public class EquipmentInfo1Service {
                 wpls.add(wt.getWindpowerstationId());
             }
             wttemps.add(wt);
-            if (wttemps.size() == 100) {
+            if (wttemps.size() == 120) {
 
-                final CountDownLatch latch = new CountDownLatch(100);
+                final CountDownLatch latch = new CountDownLatch(120);
                 for (ProBasicEquipment wt1 : wttemps) {
                     new Thread(new EquipmentInfo1Thread(executor, wt1, pep1map,
                             recordDate, end, begin, dayls,
                             edosUtil, latch)).start();
                 }
                 latch.await();
-
+                Thread.sleep(12);
                 wttemps = new ArrayList<>();
             }
 
@@ -134,6 +134,7 @@ public class EquipmentInfo1Service {
                         edosUtil, latch)).start();
             }
             latch.await();
+            Thread.sleep(12);
         }
 
 

+ 4 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java

@@ -133,9 +133,9 @@ public class EquipmentInfo2Service {
                 wpls.add(wt.getWindpowerstationId());
             }
             wttemps.add(wt);
-            if (wttemps.size() == 100) {
+            if (wttemps.size() == 120) {
 
-                final CountDownLatch latch = new CountDownLatch(100);
+                final CountDownLatch latch = new CountDownLatch(120);
                 for (ProBasicEquipment wt1 : wttemps) {
                     new Thread(new EquipmentInfo2Thread(executor, wt1, pep2map,
                             recordDate, end, begin, dayls,
@@ -143,6 +143,7 @@ public class EquipmentInfo2Service {
                 }
                 latch.await();
                 wttemps = new ArrayList<>();
+                Thread.sleep(12);
             }
 
         }
@@ -155,6 +156,7 @@ public class EquipmentInfo2Service {
                         edosUtil, latch)).start();
             }
             latch.await();
+            Thread.sleep(12);
         }
 
         c = Calendar.getInstance();

+ 4 - 2
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo3Service.java

@@ -145,15 +145,16 @@ public class EquipmentInfo3Service {
                 wpls.add(wt.getWindpowerstationId());
             }
             wttemps.add(wt);
-            if (wttemps.size() == 100) {
+            if (wttemps.size() == 120) {
 
-                final CountDownLatch latch = new CountDownLatch(100);
+                final CountDownLatch latch = new CountDownLatch(120);
                 for (ProBasicEquipment wt1 : wttemps) {
                     new Thread(new EquipmentInfo3Thread(executor, wt1, pep3map,
                             recordDate, end, begin, dayls,
                             edosUtil, latch)).start();
                 }
                 latch.await();
+                Thread.sleep(12);
                 wttemps = new ArrayList<>();
             }
 
@@ -167,6 +168,7 @@ public class EquipmentInfo3Service {
                         edosUtil, latch)).start();
             }
             latch.await();
+            Thread.sleep(12);
         }
 
 

+ 50 - 16
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo4Service.java

@@ -225,38 +225,72 @@ public class EquipmentInfo4Service {
 //
 //        latch.await();
 
+        List<ProBasicEquipment> wttemps = new ArrayList<>();
+
+
         for (Map.Entry<String, List<ProBasicEquipment>> entry : CacheContext.wpwtmap.entrySet()) {
 
 
             if(entry.getKey().contains("FDC"))
             {
-                final CountDownLatch latch = new CountDownLatch(entry.getValue().size());
                 for (ProBasicEquipment wt : entry.getValue()) {
 
                     if (!wpls.contains(wt.getWindpowerstationId())) {
                         wpls.add(wt.getWindpowerstationId());
                     }
+                    wttemps.add(wt);
+
+                    if (wttemps.size() == 120) {
+
+                        final CountDownLatch latch = new CountDownLatch(120);
+                        for (ProBasicEquipment wt1 : wttemps) {
+                            new Thread(new EquipmentInfo4Thread(executor,wt1, pep2map,
+                                    pep3map,
+                                    pep4map,
+                                    recordDate,  end,  begin,  dayls,
+                                    edosUtil, peioomap,
+                                    wgmap,
+                                    proEconCurveFittingMainService,
+                                    proEconEquipmentInfoDay5Service,
+                                    proEconFaultLiminatedefectsService,
+                                    proEconCurveFittingSubService,
+                                    proEconCurveFittMonthMainService,
+                                    proEconCurveFittMonthSubService,
+                                    proEconCurveFittYearMainService,
+                                    proEconCurveFittYearSubService,latch)).start();
 
-                    new Thread(new EquipmentInfo4Thread(executor,wt, pep2map,
-                            pep3map,
-                            pep4map,
-                            recordDate,  end,  begin,  dayls,
-                            edosUtil, peioomap,
-                            wgmap,
-                            proEconCurveFittingMainService,
-                            proEconEquipmentInfoDay5Service,
-                            proEconFaultLiminatedefectsService,
-                            proEconCurveFittingSubService,
-                            proEconCurveFittMonthMainService,
-                            proEconCurveFittMonthSubService,
-                            proEconCurveFittYearMainService,
-                            proEconCurveFittYearSubService,latch)).start();
+                        }
+                        latch.await();
+                        Thread.sleep(120);
+                        wttemps = new ArrayList<>();
+                    }
 
                 }
-                latch.await();
+
             }
 
         }
+        if (!wttemps.isEmpty()) {
+            final CountDownLatch latch = new CountDownLatch(wttemps.size());
+            for (ProBasicEquipment wt1 : wttemps) {
+                new Thread(new EquipmentInfo4Thread(executor,wt1, pep2map,
+                        pep3map,
+                        pep4map,
+                        recordDate,  end,  begin,  dayls,
+                        edosUtil, peioomap,
+                        wgmap,
+                        proEconCurveFittingMainService,
+                        proEconEquipmentInfoDay5Service,
+                        proEconFaultLiminatedefectsService,
+                        proEconCurveFittingSubService,
+                        proEconCurveFittMonthMainService,
+                        proEconCurveFittMonthSubService,
+                        proEconCurveFittYearMainService,
+                        proEconCurveFittYearSubService,latch)).start();
+            }
+            latch.await();
+            Thread.sleep(120);
+        }
 
 
         c = Calendar.getInstance();

+ 38 - 147
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WtAlysisDayService.java

@@ -142,155 +142,46 @@ public class WtAlysisDayService {
         Map<String, ProEconEquipmentInfoDay4> eqday4map = queryEquipmentInfoDay4(recordDate);
 
         List<ProEconWtAlysisDay> dayls=new ArrayList<>();
-        final CountDownLatch latch = new CountDownLatch(+CacheContext.wt_fjls.size());
-        for(ProBasicEquipment wt:CacheContext.wt_fjls)
-        {
-//            ProEconWtAlysisDay pewp=new ProEconWtAlysisDay();
-//            Initial.initial(pewp);
-//            pewp.setRecordDate(DateUtils.truncate(recordDate));
-//            pewp.setWindturbineId(wt.getId());
-//
-//            if(eqday1map.containsKey(wt.getId()))
-//            {
-//                ProEconEquipmentInfoDay1 dayinfo= eqday1map.get(wt.getId());
-//
-//                pewp.setRfdl(dayinfo.getRfdl());
-//                pewp.setRpjfs(dayinfo.getRpjfs());
-//                pewp.setRpjgl(dayinfo.getRpjgl());
-//                pewp.setRyfdl(dayinfo.getRllfdl());
-//
-//
-//                double gzss=dayinfo.getRgzssdl();
-//                double jxss=dayinfo.getRjxssdl();
-//                double xnss=dayinfo.getRxnssdl();
-//                double xdss=dayinfo.getRxdtjssdl()+dayinfo.getRxdjclssdl();
-//                double slss=dayinfo.getRcwsltqssdl()+dayinfo.getRcwsldwssdl();
-//
-//                double ssdl=gzss+jxss+xnss+xdss+slss;
-//                pewp.setRssdl(StringUtils.round(ssdl,2));
-//
-//                pewp.setYfdl(dayinfo.getYfdl());
-//                pewp.setYpjfs(dayinfo.getYpjfs());
-//                pewp.setYpjgl(dayinfo.getYpjgl());
-//                pewp.setYyfdl(dayinfo.getYllfdl());
-//
-//
-//                gzss=dayinfo.getYgzssdl();
-//                jxss=dayinfo.getYjxssdl();
-//                xnss=dayinfo.getYxnssdl();
-//                xdss=dayinfo.getYxdtjssdl()+dayinfo.getYxdjclssdl();
-//                slss=dayinfo.getYcwsltqssdl()+dayinfo.getYcwsldwssdl();
-//
-//                ssdl=gzss+jxss+xnss+xdss+slss;
-//                pewp.setYssdl(StringUtils.round(ssdl,2));
-//
-//                pewp.setNfdl(dayinfo.getNfdl());
-//                pewp.setNpjfs(dayinfo.getNpjfs());
-//                pewp.setNpjgl(dayinfo.getNpjgl());
-//                pewp.setNyfdl(dayinfo.getNllfdl());
-//
-//
-//                gzss=dayinfo.getNgzssdl();
-//                jxss=dayinfo.getNjxssdl();
-//                xnss=dayinfo.getNxnssdl();
-//                xdss=dayinfo.getNxdtjssdl()+dayinfo.getNxdjclssdl();
-//                slss=dayinfo.getNcwsltqssdl()+dayinfo.getNcwsldwssdl();
-//
-//                ssdl=gzss+jxss+xnss+xdss+slss;
-//                pewp.setNssdl(StringUtils.round(ssdl,2));
-//
-//            }
-//
-//
-//            if(eqday2map.containsKey(wt.getId()))
-//            {
-//                ProEconEquipmentInfoDay2 dayinfo= eqday2map.get(wt.getId());
-//                pewp.setRyxxs(dayinfo.getRyxxs());
-//                pewp.setRgzxs(dayinfo.getRgztjxs());
-//                pewp.setRjxxs(dayinfo.getRjxtjxs());
-//                pewp.setRzdxs(dayinfo.getRxdxs());
-//                pewp.setRzdxs(dayinfo.getRtxzdxs());
-//
-//                int dayTimes=24;
-//                double sbklyl =  new BigDecimal(dayTimes-dayinfo.getRgztjxs()).divide(new BigDecimal(dayTimes), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();//风机平均设备可利用率
-//                pewp.setRsbklyl(StringUtils.round(sbklyl, 2));
-//
-//                pewp.setYyxxs(dayinfo.getYyxxs());
-//                pewp.setYgzxs(dayinfo.getYgztjxs());
-//                pewp.setYjxxs(dayinfo.getYjxtjxs());
-//                pewp.setYzdxs(dayinfo.getYxdxs());
-//                pewp.setYzdxs(dayinfo.getYtxzdxs());
-//                c.setTime(recordDate);
-//                int days=c.get(Calendar.DAY_OF_MONTH);
-//                dayTimes=24*days;
-//                sbklyl =  new BigDecimal(dayTimes-dayinfo.getYgztjxs()).divide(new BigDecimal(dayTimes), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();//风机平均设备可利用率
-//                pewp.setYsbklyl(StringUtils.round(sbklyl, 2));
-//
-//                pewp.setNyxxs(dayinfo.getNyxxs());
-//                pewp.setNgzxs(dayinfo.getNgztjxs());
-//                pewp.setNjxxs(dayinfo.getNjxtjxs());
-//                pewp.setNzdxs(dayinfo.getNxdxs());
-//                pewp.setNzdxs(dayinfo.getNtxzdxs());
-//
-//                days=c.get(Calendar.DAY_OF_YEAR);
-//                dayTimes=24*days;
-//                sbklyl =  new BigDecimal(dayTimes-dayinfo.getNgztjxs()).divide(new BigDecimal(dayTimes), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();//风机平均设备可利用率
-//                pewp.setNsbklyl(StringUtils.round(sbklyl, 2));
-//            }
-//
-//            if(eqday3map.containsKey(wt.getId()))
-//            {
-//                ProEconEquipmentInfoDay3 dayinfo= eqday3map.get(wt.getId());
-//                pewp.setRtjcs(dayinfo.getRgztjcs()+dayinfo.getRjxtjcs());
-//                pewp.setYtjcs(dayinfo.getYgztjcs()+dayinfo.getYjxtjcs());
-//                pewp.setNtjcs(dayinfo.getNgztjcs()+dayinfo.getNjxtjcs());
-//
-//            }
-//
-//            if(eqday4map.containsKey(wt.getId()))
-//            {
-//                ProEconEquipmentInfoDay4 dayinfo= eqday4map.get(wt.getId());
-//                pewp.setRnhyd(dayinfo.getRnhyd());
-//                pewp.setRsjbz(dayinfo.getRqxpcbbzsj());
-//                pewp.setRyxfs(dayinfo.getRyxfss());
-//
-//                pewp.setYnhyd(dayinfo.getYnhyd());
-//                pewp.setYsjbz(dayinfo.getYqxpcbbzsj());
-//                pewp.setYyxfs(dayinfo.getYyxfss());
-//
-//                pewp.setNnhyd(dayinfo.getNnhyd());
-//                pewp.setNsjbz(dayinfo.getNqxpcbbzsj());
-//                pewp.setNyxfs(dayinfo.getNyxfss());
-//
-//            }
-//            //昨日的统计结果
-//            List<ProEconWtAlysisDay> pepidls =new ArrayList<>();
-//            Calendar cl=Calendar.getInstance();
-//            cl.setTime(recordDate);
-//            cl.add(Calendar.DAY_OF_MONTH,-1);
-//            if(cl.get(Calendar.DAY_OF_MONTH)!=1)
-//            {
-//                QueryWrapper<ProEconWtAlysisDay> queryWrapper2 = new QueryWrapper<>();
-//               queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime())).eq("windTurbine_Id",wt.getId());
-//               pepidls = proEconWtAlysisDayService.list(queryWrapper2);
-////                        .stream()
-////                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-////                                && i.getWindturbineId().equals(wt.getId())
-////                        )
-////                        .collect(Collectors.toList());
-//            }
-//            calSimple(pewp, end, begin, wt, pepidls);
-//            dayls.add(pewp);
-//
-            new Thread(new EconWtAlysisDayThread(executor,wt,  eqday1map,
-                    eqday2map,
-                    eqday3map,
-                    eqday4map,
-                    recordDate,  end,  begin,  dayls,
-                    edosUtil, c, proEconWtAlysisDayService,latch)).start();
+
+
+
+        List<ProBasicEquipment> wttemps = new ArrayList<>();
+
+        for(ProBasicEquipment wt:CacheContext.wt_fjls) {
+
+
+            wttemps.add(wt);
+            if (wttemps.size() == 120) {
+
+                final CountDownLatch latch = new CountDownLatch(120);
+                for (ProBasicEquipment wt1 : wttemps) {
+                    new Thread(new EconWtAlysisDayThread(executor,wt1,  eqday1map,
+                            eqday2map,
+                            eqday3map,
+                            eqday4map,
+                            recordDate,  end,  begin,  dayls,
+                            edosUtil, c, proEconWtAlysisDayService,latch)).start();
+                }
+                latch.await();
+                Thread.sleep(120);
+                wttemps = new ArrayList<>();
+            }
+
         }
-        latch.await();
 
+        if (!wttemps.isEmpty()) {
+            final CountDownLatch latch = new CountDownLatch(wttemps.size());
+            for (ProBasicEquipment wt1 : wttemps) {
+                new Thread(new EconWtAlysisDayThread(executor,wt1,  eqday1map,
+                        eqday2map,
+                        eqday3map,
+                        eqday4map,
+                        recordDate,  end,  begin,  dayls,
+                        edosUtil, c, proEconWtAlysisDayService,latch)).start();
+            }
+            latch.await();
+            Thread.sleep(120);
+        }
 
         //判断是否有重复记录,
         QueryWrapper<ProEconWtAlysisDay> queryWrapper = new QueryWrapper<>();

+ 95 - 87
realtime/generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java

@@ -3,6 +3,9 @@ package com.gyee.generation.service.initalcache;/*
 @date   2022/11/3-9:14
 */
 
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.generation.model.auto.*;
 import com.gyee.generation.service.auto.*;
 import com.gyee.generation.util.redis.RedisService;
 import lombok.extern.slf4j.Slf4j;
@@ -10,6 +13,11 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 @Service
 @Slf4j
@@ -61,70 +69,70 @@ public class CacheService {
 ////                        i.getWindpowerstationId().equals("SXJ_KGDL_PDL_FDC_STA")  ||
 ////                        i.getWindpowerstationId().equals("SXJ_KGDL_ZK_FDC_STA")
 //        ) &&  i.getIsable().equals(1)).collect(Collectors.toList());
-//        List<ProBasicEquipment> windturbineList = windturbineService.list().stream().filter(i-> i.getIsable().equals(1)).collect(Collectors.toList());
-//
-//        log.info("--------------------------windturbineList"+windturbineList.size());
-//        windturbineList.stream().forEach(i->{
-//            Map<String, ProBasicEquipmentPoint> codeaimap = new HashMap<>();
-//            QueryWrapper<ProBasicEquipmentPoint> qw = new QueryWrapper<>();
-//            qw.eq("windturbine_id",i.getId());
-//            List<ProBasicEquipmentPoint> windturbinetestingpointai2List = windturbinetestingpointnewService.list(qw);
-//            log.info("--------------------------windturbinetestingpointai2List"+windturbinetestingpointai2List.size());
-//            windturbinetestingpointai2List.stream().forEach(x->{
-//                codeaimap.put(x.getUniformCode(),x);
-//            });
-//            log.info("--------------------------codeaimap"+codeaimap.size());
-//            String s = JSONObject.toJSONString(codeaimap);
-//            redisService.set(i.getId(),s);
-//        });
+        List<ProBasicEquipment> windturbineList = windturbineService.list().stream().filter(i-> i.getIsable().equals(1)).collect(Collectors.toList());
 
+        log.info("--------------------------windturbineList"+windturbineList.size());
+        windturbineList.stream().forEach(i->{
+            Map<String, ProBasicEquipmentPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicEquipmentPoint> qw = new QueryWrapper<>();
+            qw.eq("windturbine_id",i.getId());
+            List<ProBasicEquipmentPoint> windturbinetestingpointai2List = windturbinetestingpointnewService.list(qw);
+            log.info("--------------------------windturbinetestingpointai2List"+windturbinetestingpointai2List.size());
+            windturbinetestingpointai2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            log.info("--------------------------codeaimap"+codeaimap.size());
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
 
 
 
-//        log.info("--------------------------redisSQ");
-//        List<ProBasicSquare> squareList = proBasicSquareService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
-//        squareList.stream().forEach(i->{
-//            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
-//            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
-//            qw.eq("windpowerstation_id",i.getId());
-//            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
-//            windpowerstationtestingpoint2List.stream().forEach(x->{
-//                codeaimap.put(x.getUniformCode(),x);
-//            });
-//            String s = JSONObject.toJSONString(codeaimap);
-//            redisService.set(i.getId(),s);
-//        });
-//
-//        log.info("--------------------------redisLN");
-//        List<ProBasicLine> lineList = lineService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
-//        lineList.stream().forEach(i->{
-//            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
-//            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
-//            qw.eq("windpowerstation_id",i.getId());
-//            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
-//            windpowerstationtestingpoint2List.stream().forEach(x->{
-//                codeaimap.put(x.getUniformCode(),x);
-//            });
-//            String s = JSONObject.toJSONString(codeaimap);
-//            redisService.set(i.getId(),s);
-//        });
-//
-//
-//
-//        log.info("--------------------------redisPJ");
-//        List<ProBasicProject> projectList = projectService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
-//        projectList.stream().forEach(i->{
-//            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
-//            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
-//            qw.eq("windpowerstation_id",i.getId());
-//            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
-//            windpowerstationtestingpoint2List.stream().forEach(x->{
-//                codeaimap.put(x.getUniformCode(),x);
-//            });
-//            String s = JSONObject.toJSONString(codeaimap);
-//            redisService.set(i.getId(),s);
-//        });
-//
+
+        log.info("--------------------------redisSQ");
+        List<ProBasicSquare> squareList = proBasicSquareService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        squareList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
+        log.info("--------------------------redisLN");
+        List<ProBasicLine> lineList = lineService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        lineList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
+
+
+        log.info("--------------------------redisPJ");
+        List<ProBasicProject> projectList = projectService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        projectList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
 //        log.info("--------------------------redisSubWP");
 //        redisService.select(9);
 //        List<ProBasicSubStation> subStationList = subStationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
@@ -155,19 +163,19 @@ public class CacheService {
 //        });
 //
 //        log.info("--------------------------redisWP");
-//        List<ProBasicPowerstation> wpList = windpowerstationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
-//
-//        wpList.stream().forEach(i->{
-//            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
-//            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
-//            qw.eq("windpowerstation_id",i.getId());
-//            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
-//            windpowerstationtestingpoint2List.stream().forEach(x->{
-//                codeaimap.put(x.getUniformCode(),x);
-//            });
-//            String s = JSONObject.toJSONString(codeaimap);
-//            redisService.set(i.getId(),s);
-//        });
+        List<ProBasicPowerstation> wpList = windpowerstationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+
+        wpList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
 //
 //        log.info("--------------------------redisCOMPANY");
 //        List<ProBasicCompany> coms = companyService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
@@ -245,20 +253,20 @@ public class CacheService {
 //            }
 //        });
 //        redisService.set("ZLLGL", JSONObject.toJSONString(powerrdMap));
-//
-//        log.info("--------------------------redis十三种状态");
-//        Map<String, List<ProBasicStatusPoint>> sszztMap = new HashMap<>();
-//        List<ProBasicStatusPoint> windturbinestatusdis = proBasicStatusPointService.list();
-//        windturbinestatusdis.stream().forEach(w->{
-//            if (sszztMap.containsKey(w.getWindturbineId())){
-//                sszztMap.get(w.getWindturbineId()).add(w);
-//            }else {
-//                List<ProBasicStatusPoint> wdisList = new ArrayList<>();
-//                wdisList.add(w);
-//                sszztMap.put(w.getWindturbineId(),wdisList);
-//            }
-//        });
-//        redisService.set("SSZZT", JSONObject.toJSONString(sszztMap));
+
+        log.info("--------------------------redis十三种状态");
+        Map<String, List<ProBasicStatusPoint>> sszztMap = new HashMap<>();
+        List<ProBasicStatusPoint> windturbinestatusdis = proBasicStatusPointService.list();
+        windturbinestatusdis.stream().forEach(w->{
+            if (sszztMap.containsKey(w.getWindturbineId())){
+                sszztMap.get(w.getWindturbineId()).add(w);
+            }else {
+                List<ProBasicStatusPoint> wdisList = new ArrayList<>();
+                wdisList.add(w);
+                sszztMap.put(w.getWindturbineId(),wdisList);
+            }
+        });
+        redisService.set("SSZZT", JSONObject.toJSONString(sszztMap));
 
         log.info("--------------------------完成");
     }

+ 87 - 24
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java

@@ -411,9 +411,9 @@ public class CycleCalculationService {
                     }
                     else
                     {
-                        List<PointData> mxztPointDatas = edosUtil.getHistoryDatasSnap(mxztPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
-                        List<PointData> rfdlPointDatas = edosUtil.getHistoryDatasSnap(rfdlPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
-                        List<PointData> gzdPointDatas = edosUtil.getHistoryDatasSnap(gzdPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
+                        List<PointData> mxztPointDatas = edosUtil.getHistoryDatasSnap(mxztPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
+                        List<PointData> rfdlPointDatas = edosUtil.getHistoryDatasSnap(rfdlPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
+                        List<PointData> gzdPointDatas = edosUtil.getHistoryDatasSnap(gzdPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
 
 //                        if(wt.getId().equals("SXJ_KGDL_JR_G_IN_0304_EQ"))
 //                        {
@@ -605,7 +605,7 @@ public class CycleCalculationService {
                             }
                         } else {
 
-                            List<PointData> pointls = edosUtil.getHistoryDatasSnap(gzdPoint, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
+                            List<PointData> pointls = edosUtil.getHistoryDatasSnap(gzdPoint, date15age.getTime() / 1000, currentDate.getTime() / 1000, null, 60l);
                             if(!pointls.isEmpty())
                             {
                                 List<PointData> filterls=new ArrayList<>();
@@ -638,20 +638,48 @@ public class CycleCalculationService {
                             rkydl = DoubleUtils.sum(lskydl, dataMap.get("kydl"));
                             double lslldlzs = edosUtil.getSectionData(rlldlzsPoint, currentDate.getTime()).getPointValueInDouble();
                             rzsdl = DoubleUtils.sum(lslldlzs, dataMap.get("zsdl"));
+//                            double lsgzss = edosUtil.getSectionData(rgzssPoint, currentDate.getTime()).getPointValueInDouble();
+//
+//                            rgzss = gzss;
+//                            rgzsl = gzsl;
+//                            rjxss = jxss;
+//                            rjxsl = jxsl;
+//                            rdjss = djss;
+//                            rsdtj = sdtj;
+//                            rxnss = xnss;
+//                            rfdjcl = fdjcl;
+//                            rxdjcl =xdjcl;
+//                            rxdtj = xdtj;
+//                            rdwsl = dwsl;
+//                            rhjsl =hjsl;
+
                             double lsgzss = edosUtil.getSectionData(rgzssPoint, currentDate.getTime()).getPointValueInDouble();
+                            rgzss = DoubleUtils.sum(lsgzss, gzss);
+                            double lsgzsl = edosUtil.getSectionData(rgzslPoint, currentDate.getTime()).getPointValueInDouble();
+                            rgzsl = DoubleUtils.sum(lsgzsl, gzsl);
+                            double lsjxss = edosUtil.getSectionData(rjxssPoint, currentDate.getTime()).getPointValueInDouble();
+                            rjxss = DoubleUtils.sum(lsjxss, jxss);
+                            double lsjxsl = edosUtil.getSectionData(rjxslPoint, currentDate.getTime()).getPointValueInDouble();
+                            rjxsl = DoubleUtils.sum(lsjxsl, jxsl);
+
+                            double lsdjss = edosUtil.getSectionData(rdjssPoint, currentDate.getTime()).getPointValueInDouble();
+                            rdjss = DoubleUtils.sum(lsdjss, djss);;
+                            double lssdtj = edosUtil.getSectionData(rsdtjPoint, currentDate.getTime()).getPointValueInDouble();
+                            rsdtj = DoubleUtils.sum(lssdtj, sdtj);;
+                            double lsxnss = edosUtil.getSectionData(rxnssPoint, currentDate.getTime()).getPointValueInDouble();
+                            rxnss = DoubleUtils.sum(lsxnss, xnss);;
 
-                            rgzss = gzss;
-                            rgzsl = gzsl;
-                            rjxss = jxss;
-                            rjxsl = jxsl;
-                            rdjss = djss;
-                            rsdtj = sdtj;
-                            rxnss = xnss;
-                            rfdjcl = fdjcl;
-                            rxdjcl =xdjcl;
-                            rxdtj = xdtj;
-                            rdwsl = dwsl;
-                            rhjsl =hjsl;
+                            double lsfdjcl = edosUtil.getSectionData(rfdjclPoint, currentDate.getTime()).getPointValueInDouble();
+                            rfdjcl = DoubleUtils.sum(lsfdjcl, fdjcl);
+
+                            double lsxdjcl = edosUtil.getSectionData(rxdjclPoint, currentDate.getTime()).getPointValueInDouble();
+                            rxdjcl = DoubleUtils.sum(lsxdjcl, xdjcl);
+                            double lsxdtj = edosUtil.getSectionData(rxdtjPoint, currentDate.getTime()).getPointValueInDouble();
+                            rxdtj = DoubleUtils.sum(lsxdtj, xdtj);
+                            double lsdwsl = edosUtil.getSectionData(rdwslPoint, currentDate.getTime()).getPointValueInDouble();
+                            rdwsl = DoubleUtils.sum(lsdwsl, dwsl);
+                            double lshjsl = edosUtil.getSectionData(rhjslPoint, currentDate.getTime()).getPointValueInDouble();
+                            rhjsl = DoubleUtils.sum(lshjsl, hjsl);
                             double temp = rgzss + rgzsl + rjxss + rjxsl + rdjss + rsdtj + rxnss + rfdjcl + rxdjcl + rxdtj + rdwsl + rhjsl;
                             if (temp >= 0) {
                                 rqfdl = temp;
@@ -2039,15 +2067,50 @@ public class CycleCalculationService {
             lineResultList.add(PointUtil.createPointData(date, nkydl.get(), wpnkydlPoint.getNemCode(), wpnkydlPoint.getName()));
             lineResultList.add(PointUtil.createPointData(date, kydl15.get(), wpkydl15Point.getNemCode(), wpkydl15Point.getName()));
 
-            lineResultList.add(PointUtil.createPointData(date, rllfdlzs.get(), wprlldlzsPoint.getNemCode(), wprkydlPoint.getName()));
-            lineResultList.add(PointUtil.createPointData(date, yllfdlzs.get(), wpylldlzsPoint.getNemCode(), wpykydlPoint.getName()));
-            lineResultList.add(PointUtil.createPointData(date, nllfdlzs.get(), wpnlldlzsPoint.getNemCode(), wpnkydlPoint.getName()));
-            lineResultList.add(PointUtil.createPointData(date, llfdl15zs.get(), wplldl15zsPoint.getNemCode(), wpkydl15Point.getName()));
 
-            lineResultList.add(PointUtil.createPointData(date, rfdl.get(), wprfdlPoint.getNemCode(), wprfdlPoint.getName()));
-            lineResultList.add(PointUtil.createPointData(date, yfdl.get(), wpyfdlPoint.getNemCode(), wpyfdlPoint.getName()));
-            lineResultList.add(PointUtil.createPointData(date, nfdl.get(), wpnfdlPoint.getNemCode(), wpnfdlPoint.getName()));
-            lineResultList.add(PointUtil.createPointData(date, fdl15.get(), wpfdl15Point.getNemCode(), wpfdl15Point.getName()));
+            if(rllfdlzs.get()!=0)
+            {
+                lineResultList.add(PointUtil.createPointData(date, rllfdlzs.get(), wprlldlzsPoint.getNemCode(), wprkydlPoint.getName()));
+
+            }
+            if(yllfdlzs.get()!=0)
+            {
+                lineResultList.add(PointUtil.createPointData(date, yllfdlzs.get(), wpylldlzsPoint.getNemCode(), wpykydlPoint.getName()));
+
+            }
+            if(nllfdlzs.get()!=0)
+            {
+                lineResultList.add(PointUtil.createPointData(date, nllfdlzs.get(), wpnlldlzsPoint.getNemCode(), wpnkydlPoint.getName()));
+
+            }
+            if(llfdl15zs.get()!=0)
+            {
+                lineResultList.add(PointUtil.createPointData(date, llfdl15zs.get(), wplldl15zsPoint.getNemCode(), wpkydl15Point.getName()));
+
+            }
+
+            if(rfdl.get()!=0)
+            {
+                lineResultList.add(PointUtil.createPointData(date, rfdl.get(), wprfdlPoint.getNemCode(), wprfdlPoint.getName()));
+
+            }
+
+            if(yfdl.get()!=0)
+            {
+                lineResultList.add(PointUtil.createPointData(date, yfdl.get(), wpyfdlPoint.getNemCode(), wpyfdlPoint.getName()));
+
+            }
+            if(nfdl.get()!=0)
+            {
+                lineResultList.add(PointUtil.createPointData(date, nfdl.get(), wpnfdlPoint.getNemCode(), wpnfdlPoint.getName()));
+
+            }
+            if(fdl15.get()!=0)
+            {
+                lineResultList.add(PointUtil.createPointData(date, fdl15.get(), wpfdl15Point.getNemCode(), wpfdl15Point.getName()));
+
+            }
+
 
             lineResultList.add(PointUtil.createPointData(date, rzhd.get(), wprzhdPoint.getNemCode(), wprzhdPoint.getName()));
             lineResultList.add(PointUtil.createPointData(date, yzhd.get(), wpyzhdPoint.getNemCode(), wpyzhdPoint.getName()));

+ 8 - 3
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/SafetyDayService.java

@@ -45,9 +45,14 @@ public class SafetyDayService {
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
-                aqts ++;
-                PointData pointData = PointUtil.createPointData(currentDate, aqts, powerstationPoint.getNemCode(), powerstationPoint.getName());
-                resultList.add(pointData);
+
+                if(aqts!=0)
+                {
+                    aqts ++;
+                    PointData pointData = PointUtil.createPointData(currentDate, aqts, powerstationPoint.getNemCode(), powerstationPoint.getName());
+                    resultList.add(pointData);
+                }
+
             }
         });
 

+ 29 - 5
realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticScheduleCALTask.java

@@ -108,6 +108,30 @@ public class SaticScheduleCALTask {
         XxlJobHelper.log("日月年计算指标调度任务处理完成!........");
     }
 
+
+
+    /**
+     * 日,月,年,15分钟计算指标
+     * 每15分钟执行一次
+     */
+    @XxlJob("cycleCalculation_All_CAL")
+    public void cycleCalculation_All_CAL()  {
+
+        XxlJobHelper.log("日月年计算指标调度程序执行开始!........");
+        try {
+
+            while(true)
+            {
+                cycleCalculationService.saveCyle();
+                Thread.sleep(200);
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        XxlJobHelper.log("日月年计算指标调度任务处理完成!........");
+    }
     /**
      * 电计量计算指标
      * 每15分钟执行一次
@@ -190,11 +214,6 @@ public class SaticScheduleCALTask {
         }
         XxlJobHelper.log("中间状态计算调度任务处理完成!........");
     }
-
-    /**
-     * 状态计算
-     * 执行一次
-     */
     @XxlJob("status_statusReal")
     public void status_statusReal()  {
 
@@ -211,6 +230,11 @@ public class SaticScheduleCALTask {
      * 场站状态计算
      * 执行一次
      */
+    /**
+     * 状态计算
+     * 执行一次
+     */
+
     @XxlJob("calculate_powerRationing")
     public void calculate_powerRationing()  {
 

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

@@ -4,6 +4,7 @@ package com.gyee.generation.task;
 import com.gyee.common.util.DateUtils;
 import com.gyee.generation.service.*;
 import com.gyee.generation.service.StationPower.StationPowerService;
+import com.gyee.generation.util.SpringUtils;
 import com.gyee.generation.util.math.AvailablePowerAccuracyCalculator;
 import com.gyee.generation.util.math.PowerPredictionErrorCalculator;
 import com.gyee.generation.util.math.ShortTermPowerPredictionAccuracyCalculator;
@@ -14,6 +15,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 
@@ -883,6 +885,9 @@ public class SaticSchedulePgTask {
 
     }
 
+
+
+
     /**
      * 设备3表
      * 15分钟只执行一次
@@ -941,6 +946,98 @@ public class SaticSchedulePgTask {
 
     }
 
+
+    /**
+     * 风电设备调度
+     *执行一次
+     */
+    @XxlJob("equipment_PowerInfoAll_FD")
+    public void equipment_PowerInfoAll_FD() throws Exception {
+
+        XxlJobHelper.log("风电设备调度调度程序执行开始!........");
+
+        Calendar c = Calendar.getInstance();
+
+
+        while (true) {
+
+            Date begin = new Date();
+            Date end = null;
+            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            System.out.println(df.format(c.getTime()).toString());
+
+
+
+
+            EquipmentInfo1Service equipmentInfo1Service= SpringUtils.getBean("equipmentInfo1Service");
+            EquipmentInfo2Service equipmentInfo2Service= SpringUtils.getBean("equipmentInfo2Service");
+            EquipmentInfo3Service equipmentInfo3Service= SpringUtils.getBean("equipmentInfo3Service");
+
+            EquipmentInfo5Service equipmentInfo5Service= SpringUtils.getBean("equipmentInfo5Service");
+            EquipmentInfo4Service equipmentInfo4Service= SpringUtils.getBean("equipmentInfo4Service");
+
+            equipmentInfo1Service.calEquipmentInfoDay(begin);
+            equipmentInfo2Service.calEquipmentInfoDay(begin);
+            equipmentInfo3Service.calEquipmentInfoDay(begin);
+
+            equipmentInfo5Service.calEquipmentInfoDay(begin);
+            equipmentInfo4Service.calEquipmentInfoDay(begin);
+
+
+
+            end = new Date();
+            System.out.println(end);
+            System.out.println("完成一次!。。。。。。");
+            System.out.println("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
+            Thread.sleep(200);
+        }
+
+    }
+
+
+    /**
+     * 光伏设备调度
+     *执行一次
+     */
+    @XxlJob("equipment_PowerInfoAll_GD")
+    public void equipment_PowerInfoAll_GD() throws Exception {
+
+        XxlJobHelper.log("风电设备调度调度程序执行开始!........");
+
+        Calendar c = Calendar.getInstance();
+
+
+        while (true) {
+
+            Date begin = new Date();
+            Date end = null;
+            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            System.out.println(df.format(c.getTime()).toString());
+
+
+
+
+            EquipmentInfo1Service equipmentInfo1Service= SpringUtils.getBean("equipmentInfo1Service");
+            EquipmentInfo2Service equipmentInfo2Service= SpringUtils.getBean("equipmentInfo2Service");
+            EquipmentInfo3Service equipmentInfo3Service= SpringUtils.getBean("equipmentInfo3Service");
+
+
+            equipmentInfo1Service.calEquipmentInfoDay(begin);
+            equipmentInfo2Service.calEquipmentInfoDay(begin);
+            equipmentInfo3Service.calEquipmentInfoDay(begin);
+
+
+
+
+            end = new Date();
+            System.out.println(end);
+            System.out.println("完成一次!。。。。。。");
+            System.out.println("执行用时" + com.gyee.generation.util.DateUtils.secondsDiff(begin, end) + "秒");
+
+            Thread.sleep(200);
+        }
+
+    }
     /**
      * 等级评估统计
      * 每天执行一次

+ 3 - 3
realtime/generationXK-service/src/test/java/com/gyee/generation/HealthTest.java

@@ -27,9 +27,9 @@ public class HealthTest {
 ////        windPowerInfo5UpdateService.calLineInfoDay(c.getTime());
 //        windPowerInfo5UpdateService.calProjectInfoDay(c.getTime());
 //        windPowerInfo5UpdateService.calWindpowerInfoDay(c.getTime());
-
-        windPowerInfo5UpdateService.calWindpowerInfoDayCurry();
-        windPowerInfo5UpdateService.calProjectInfoDayCurry();
+//
+//        windPowerInfo5UpdateService.calWindpowerInfoDayCurry();
+//        windPowerInfo5UpdateService.calProjectInfoDayCurry();
 //        inputOrOutPutService.initialInputOrOutputSpeed();
 //        Calendar c = Calendar.getInstance();
 //        Date begin=null;