Pārlūkot izejas kodu

修改区间曲线偏差1、2、3、4、5、6表写入事件

shilin 2 gadi atpakaļ
vecāks
revīzija
265603d30b
20 mainītis faili ar 1302 papildinājumiem un 203 dzēšanām
  1. 18 6
      realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java
  2. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconWtAlysisDayController.java
  3. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconWindturbineGoodnessMapper.java
  4. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconWtAlysisDayMapper.java
  5. 29 14
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWindturbineGoodness.java
  6. 342 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWtAlysisDay.java
  7. 6 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java
  8. 58 75
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java
  9. 9 9
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo4Service.java
  10. 4 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo5Service.java
  11. 7 6
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java
  12. 60 65
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java
  13. 106 21
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindturbineGoodnessService.java
  14. 276 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WtAlysisDayService.java
  15. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconWindturbineGoodnessService.java
  16. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconWtAlysisDayService.java
  17. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconWindturbineGoodnessServiceImpl.java
  18. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconWtAlysisDayServiceImpl.java
  19. 6 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticSchedulePgTask.java
  20. 306 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/util/statisticcs/Initial.java

+ 18 - 6
realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java

@@ -1,9 +1,13 @@
 package com.gyee.generation;
 
+import com.gyee.generation.service.WtAlysisDayService;
+import com.gyee.generation.util.SpringUtils;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+import java.util.Date;
+
 /**
  * @ClassName : GenerationMain
  * @Author : xieshengjie
@@ -55,7 +59,7 @@ public class GenerationMain {
 //
 //        c.set(Calendar.DAY_OF_MONTH,20);
 //        Date date =c.getTime();
-//        for(int i=0;i<4;i++)
+//        for(int i=0;i<5;i++)
 //        {
 //            WindPowerInfo1Service windPowerInfo1Service= SpringUtils.getBean("windPowerInfo1Service");
 //
@@ -100,11 +104,8 @@ public class GenerationMain {
 //            windPowerInfo6Service.calCompanyInfoDay(date);
 //            windPowerInfo6Service.calRegionInfoDay(date);
 //
-//            c.add(Calendar.DAY_OF_MONTH,1);
-//            date =c.getTime();
-//        }
-
-//        EquipmentInfo1Service equipmentInfo1Service= SpringUtils.getBean("equipmentInfo1Service");
+//
+//                    EquipmentInfo1Service equipmentInfo1Service= SpringUtils.getBean("equipmentInfo1Service");
 //        equipmentInfo1Service.calEquipmentInfoDay(date);
 //        EquipmentInfo2Service equipmentInfo2Service= SpringUtils.getBean("equipmentInfo2Service");
 //        equipmentInfo2Service.calEquipmentInfoDay(date);
@@ -114,6 +115,11 @@ public class GenerationMain {
 //        equipmentInfo4Service.calEquipmentInfoDay(date);
 //        EquipmentInfo5Service equipmentInfo5Service= SpringUtils.getBean("equipmentInfo5Service");
 //        equipmentInfo5Service.calEquipmentInfoDay(date);
+//            c.add(Calendar.DAY_OF_MONTH,1);
+//            date =c.getTime();
+//        }
+//
+
 //        EquipmentInfoDayTopService equipmentInfoDayTopService= SpringUtils.getBean("equipmentInfoDayTopService");
 //        equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
 //        Calendar c=Calendar.getInstance();
@@ -133,5 +139,11 @@ public class GenerationMain {
 //        PowerCurveFittingModelService powerCurveFittingModelService= SpringUtils.getBean("powerCurveFittingModelService");
 //        powerCurveFittingModelService.cureFittingModel();
 
+//        WindturbineGoodnessService windturbineGoodnessService= SpringUtils.getBean("windturbineGoodnessService");
+//        windturbineGoodnessService.calWindturbineGoodness(new Date());
+
+        WtAlysisDayService wtAlysisDayService= SpringUtils.getBean("wtAlysisDayService");
+        wtAlysisDayService.calEquipmentInfoDay(new Date());
+
     }
 }

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconWtAlysisDayController.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-24
+ */
+@RestController
+@RequestMapping("//pro-econ-wt-alysis-day")
+public class ProEconWtAlysisDayController {
+
+}

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconWindturbineGoodnessMapper.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * </p>
  *
  * @author shilin
- * @since 2022-11-17
+ * @since 2022-11-24
  */
 public interface ProEconWindturbineGoodnessMapper extends BaseMapper<ProEconWindturbineGoodness> {
 

+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconWtAlysisDayMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.generation.mapper.auto;
+
+import com.gyee.generation.model.auto.ProEconWtAlysisDay;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 风机日性能分析表 Mapper 接口
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-24
+ */
+public interface ProEconWtAlysisDayMapper extends BaseMapper<ProEconWtAlysisDay> {
+
+}

+ 29 - 14
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWindturbineGoodness.java

@@ -1,5 +1,7 @@
 package com.gyee.generation.model.auto;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -12,7 +14,7 @@ import java.util.Date;
  * </p>
  *
  * @author shilin
- * @since 2022-11-17
+ * @since 2022-11-24
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -23,60 +25,73 @@ public class ProEconWindturbineGoodness extends Model {
     /**
      * 编号
      */
+    @TableId(value = "ID",type = IdType.ASSIGN_ID)
     private Long id;
 
     /**
      * 风机编号
      */
-    private String windturbineid;
+    private String windturbineId;
 
     /**
      * 日拟合优度
      */
-    private Double daygoodness;
+    private Double dayGoodness;
 
     /**
      * 月拟合优度
      */
-    private Double monthgoodness;
+    private Double monthGoodness;
 
     /**
      * 年拟合优度
      */
-    private Double yeargoodness;
+    private Double yearGoodness;
 
     /**
      * 日期
      */
-    private Date recorddate;
-
+    private Date recordDate;
 
     /**
      * 风场编号
      */
-    private String windtpowerstationid;
+    private String windtpowerstationId;
 
     /**
      * 型号编号
      */
-    private String modelid;
-
-
+    private String modelId;
 
     /**
      * 日功率一致性系数
      */
-    private Double daycoefficient;
+    private Double dayCoefficient;
 
     /**
      * 月功率一致性系数
      */
-    private Double monthcoefficient;
+    private Double monthCoefficient;
 
     /**
      * 年功率一致性系数
      */
-    private Double yearcoefficient;
+    private Double yearCoefficient;
+
+    /**
+     * 日排行
+     */
+    private Integer dayTop;
+
+    /**
+     * 月排行
+     */
+    private Integer monthTop;
+
+    /**
+     * 年排行
+     */
+    private Integer yearTop;
 
 
 }

+ 342 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWtAlysisDay.java

@@ -0,0 +1,342 @@
+package com.gyee.generation.model.auto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 风机日性能分析表
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProEconWtAlysisDay extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    @TableId(value = "ID",type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 风机编号
+     */
+    private String windturbineId;
+
+    /**
+     * 日期
+     */
+    private Date recordDate;
+
+    /**
+     * 日发电量
+     */
+    private Double rfdl;
+
+    /**
+     * 月发电量
+     */
+    private Double yfdl;
+
+    /**
+     * 年发电量
+     */
+    private Double nfdl;
+
+    /**
+     * 日应发电量
+     */
+    private Double ryfdl;
+
+    /**
+     * 月应发电量
+     */
+    private Double yyfdl;
+
+    /**
+     * 年应发电量
+     */
+    private Double nyfdl;
+
+    /**
+     * 日平均功率
+     */
+    private Double rpjgl;
+
+    /**
+     * 月平均功率
+     */
+    private Double ypjgl;
+
+    /**
+     * 年平均功率
+     */
+    private Double npjgl;
+
+    /**
+     * 日平均风速
+     */
+    private Double rpjfs;
+
+    /**
+     * 月平均风速
+     */
+    private Double ypjfs;
+
+    /**
+     * 年平均风速
+     */
+    private Double npjfs;
+
+    /**
+     * 日运行小时
+     */
+    private Double ryxxs;
+
+    /**
+     * 月运行小时
+     */
+    private Double yyxxs;
+
+    /**
+     * 年运行小时
+     */
+    private Double nyxxs;
+
+    /**
+     * 日待机小时
+     */
+    private Double rdjxs;
+
+    /**
+     * 月待机小时
+     */
+    private Double ydjxs;
+
+    /**
+     * 年待机小时
+     */
+    private Double ndjxs;
+
+    /**
+     * 日故障小时
+     */
+    private Double rgzxs;
+
+    /**
+     * 月故障小时
+     */
+    private Double ygzxs;
+
+    /**
+     * 年故障小时
+     */
+    private Double ngzxs;
+
+    /**
+     * 日检修小时
+     */
+    private Double rjxxs;
+
+    /**
+     * 月检修小时
+     */
+    private Double yjxxs;
+
+    /**
+     * 年检修小时
+     */
+    private Double njxxs;
+
+    /**
+     * 日中断小时
+     */
+    private Double rzdxs;
+
+    /**
+     * 月中断小时
+     */
+    private Double yzdxs;
+
+    /**
+     * 年中断小时
+     */
+    private Double nzdxs;
+
+    /**
+     * 日有效风时
+     */
+    private Double ryxfs;
+
+    /**
+     * 月有效风时
+     */
+    private Double yyxfs;
+
+    /**
+     * 年有效风时
+     */
+    private Double nyxfs;
+
+    /**
+     * 日损失电量
+     */
+    private Double rssdl;
+
+    /**
+     * 月损失电量
+     */
+    private Double yssdl;
+
+    /**
+     * 年损失电量
+     */
+    private Double nssdl;
+
+    /**
+     * 日报警次数
+     */
+    private Double rbjcs;
+
+    /**
+     * 月报警次数
+     */
+    private Double ybjcs;
+
+    /**
+     * 年报警次数
+     */
+    private Double nbjcs;
+
+    /**
+     * 日停机次数
+     */
+    private Double rtjcs;
+
+    /**
+     * 月停机次数
+     */
+    private Double ytjcs;
+
+    /**
+     * 年停机次数
+     */
+    private Double ntjcs;
+
+    /**
+     * 日不饱和次数
+     */
+    private Double rbbhcs;
+
+    /**
+     * 月不饱和次数
+     */
+    private Double ybbhcs;
+
+    /**
+     * 年不饱和次数
+     */
+    private Double nbbhcs;
+
+    /**
+     * 日设备可利用率
+     */
+    private Double rsbklyl;
+
+    /**
+     * 月设备可利用率
+     */
+    private Double ysbklyl;
+
+    /**
+     * 年设备可利用率
+     */
+    private Double nsbklyl;
+
+    /**
+     * 日平均温度
+     */
+    private Double rpjwd;
+
+    /**
+     * 月平均温度
+     */
+    private Double ypjwd;
+
+    /**
+     * 年平均温度
+     */
+    private Double npjwd;
+
+    /**
+     * 日平均湿度
+     */
+    private Double rpjsd;
+
+    /**
+     * 月平均湿度
+     */
+    private Double ypjsd;
+
+    /**
+     * 年平均湿度
+     */
+    private Double npjsd;
+
+    /**
+     * 日平均压强
+     */
+    private Double rpjyq;
+
+    /**
+     * 月平均压强
+     */
+    private Double ypjyq;
+
+    /**
+     * 年平均压强
+     */
+    private Double npjyq;
+
+    /**
+     * 日拟合优度
+     */
+    private Double rnhyd;
+
+    /**
+     * 月拟合优度
+     */
+    private Double ynhyd;
+
+    /**
+     * 年拟合优度
+     */
+    private Double nnhyd;
+
+    /**
+     * 日实际/保证
+     */
+    private Double rsjbz;
+
+    /**
+     * 月实际/保证
+     */
+    private Double ysjbz;
+
+    /**
+     * 年实际/保正
+     */
+    private Double nsjbz;
+
+
+}

+ 6 - 4
realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java

@@ -29,7 +29,7 @@ public class CoefficientService {
     private IProEconWtPowerCurveFittingService proEconWtPowerCurveFittingService;
 
 
-    public Map<String, Map<String, Double>> coefficient(Date currentDate) throws Exception {
+    public Map<String, Map<String, Double>> coefficient(String wtId,Date currentDate) throws Exception {
 
         Date beginDate = DateUtils.addDays(currentDate,-1);
 
@@ -50,8 +50,10 @@ public class CoefficientService {
         //查询风机
         List<ProBasicEquipment> wtls = CacheContext.wtls;
 
-        //遍历所有风机ID
-        for (ProBasicEquipment wt : wtls) {
+        ProBasicEquipment wt=CacheContext.wtmap.get(wtId);
+
+//        //遍历所有风机ID
+//        for (ProBasicEquipment wt : wtls) {
 
 //****************************************年功率一致性统计********************************************************************/
             List<ProEconActivePowerData> yearList;
@@ -152,7 +154,7 @@ public class CoefficientService {
             tempmap.put("day", resultDay);
             resultmap.put(wt.getId(), tempmap);
 
-        }
+//        }
 
 
         return resultmap;

+ 58 - 75
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java

@@ -14,8 +14,6 @@ import com.gyee.generation.util.statisticcs.Initial;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -98,9 +96,9 @@ public class EquipmentInfo1Service {
 
     private void extracted(Date recordDate, Date end, Date begin,Map<String, ProBasicEquipmentPoint> pointmap, ProEconEquipmentInfoDay1 pewp,List<ProEconEquipmentInfoDay1> pepid1ls) throws Exception {
         //*******************************************日信息统计*********************************************************/
-        if(pointmap.containsKey(ContantXk.SSPJFS))
+        if(pointmap.containsKey(ContantXk.RPJFS))
         {
-            ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSPJFS);
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RPJFS);
             List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
             if(!pointls.isEmpty())
             {
@@ -115,9 +113,9 @@ public class EquipmentInfo1Service {
 
         }
 
-        if(pointmap.containsKey(ContantXk.SSZGL))
+        if(pointmap.containsKey(ContantXk.RPJGL))
         {
-            ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSZGL);
+            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RPJGL);
             List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
             if(!pointls.isEmpty())
             {
@@ -356,46 +354,39 @@ public class EquipmentInfo1Service {
         {
 
 
-            ProEconEquipmentInfoDay1 pepid=pepid1ls.get(0);
 
-            //如果昨日大于今日最大功率
-            if(pepid.getYzdgl()> pewp.getRzdgl())
+            if(pointmap.containsKey(ContantXk.YPJFS))
             {
-                pewp.setYzdgl(pepid.getYzdgl());
-            }else {
-                pewp.setYzdgl(pewp.getRzdgl());
-            }
-            //如果昨日大于今日最大风速
-            if(pepid.getYzdfs()> pewp.getRzdfs())
-            {
-                pewp.setYzdfs(pepid.getYzdfs());
-            }else
-            {
-                pewp.setYzdfs(pewp.getRzdfs());
-            }
+                ProBasicEquipmentPoint point= pointmap.get(ContantXk.YPJFS);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //月最大风速
+                    pewp.setYzdfs(summaryStatistics.getMax());
+                    //月最小风速
+                    pewp.setYzxfs(summaryStatistics.getMin());
+                    //月平均风速
+                    pewp.setYpjfs(summaryStatistics.getAverage());
+                }
 
-            //如果昨日小于今日最小功率
-            if(pepid.getYzxgl()< pewp.getRzxgl())
-            {
-                pewp.setYzxgl(pepid.getYzxgl());
-            }else
-            {
-                pewp.setYzxgl(pewp.getRzxgl());
             }
-            //如果昨日小于今日最小风速
-            if(pepid.getYzxfs()< pewp.getRzxfs())
-            {
-                pewp.setYzxfs(pepid.getYzxfs());
-            }else
+
+            if(pointmap.containsKey(ContantXk.YPJGL))
             {
-                pewp.setYzxfs(pewp.getRzxfs());
+                ProBasicEquipmentPoint point= pointmap.get(ContantXk.YPJGL);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //月最大功率
+                    pewp.setYzdgl(summaryStatistics.getMax());
+                    //月最小功率
+                    pewp.setYzxgl(summaryStatistics.getMin());
+                    //月平均功率
+                    pewp.setYpjgl(summaryStatistics.getAverage());
+                }
             }
-            double   pjfs = BigDecimal.valueOf(pewp.getYpjfs() + pepid.getRpjfs()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
-
-            pewp.setYzxfs(pjfs);
-
-            double   pjgl = BigDecimal.valueOf(pewp.getYpjgl() + pepid.getRpjgl()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
-            pewp.setYzxgl(pjgl);
 
         }
 
@@ -624,46 +615,38 @@ public class EquipmentInfo1Service {
         }else
         {
 
-            ProEconEquipmentInfoDay1 pepid=pepid1ls.get(0);
-
-            //如果昨日大于今日最大功率
-            if(pepid.getNzdgl()> pewp.getRzdgl())
+            if(pointmap.containsKey(ContantXk.NPJFS))
             {
-                pewp.setNzdgl(pepid.getNzdgl());
-            }else {
-                pewp.setNzdgl(pewp.getRzdgl());
-            }
-            //如果昨日大于今日最大风速
-            if(pepid.getNzdfs()> pewp.getRzdfs())
-            {
-                pewp.setNzdfs(pepid.getNzdfs());
-            }else
-            {
-                pewp.setNzdfs(pewp.getRzdfs());
-            }
+                ProBasicEquipmentPoint point= pointmap.get(ContantXk.NPJFS);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //年最大风速
+                    pewp.setNzdfs(summaryStatistics.getMax());
+                    //年最小风速
+                    pewp.setNzxfs(summaryStatistics.getMin());
+                    //年平均风速
+                    pewp.setNpjfs(summaryStatistics.getAverage());
+                }
 
-            //如果昨日小于今日最小功率
-            if(pepid.getNzxgl()< pewp.getRzxgl())
-            {
-                pewp.setNzxgl(pepid.getNzxgl());
-            }else
-            {
-                pewp.setNzxgl(pewp.getRzxgl());
             }
-            //如果昨日小于今日最小风速
-            if(pepid.getNzxfs()< pewp.getRzxfs())
-            {
-                pewp.setNzxfs(pepid.getNzxfs());
-            }else
+
+            if(pointmap.containsKey(ContantXk.NPJGL))
             {
-                pewp.setNzxfs(pewp.getRzxfs());
+                ProBasicEquipmentPoint point= pointmap.get(ContantXk.NPJFS);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //年最大功率
+                    pewp.setNzdgl(summaryStatistics.getMax());
+                    //年最小功率
+                    pewp.setNzxgl(summaryStatistics.getMin());
+                    //年平均功率
+                    pewp.setNpjgl(summaryStatistics.getAverage());
+                }
             }
-            double   pjfs = BigDecimal.valueOf(pewp.getNpjfs() + pepid.getRpjfs()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
-
-            pewp.setNzxfs(pjfs);
-
-            double   pjgl = BigDecimal.valueOf(pewp.getNpjgl() + pepid.getRpjgl()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
-            pewp.setNzxgl(pjgl);
 
         }
 

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

@@ -98,15 +98,15 @@ public class EquipmentInfo4Service {
         }
         Map<String,ProEconWindturbineGoodness> wgmap=new HashMap<>();
         List<ProEconWindturbineGoodness> wgls = proEconWindturbineGoodnessService.list().stream()
-                .filter(i -> i.getRecorddate().compareTo(DateUtils.truncate(begin))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineid()))
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(begin))==0
+                        && CacheContext.wtmap.containsKey(i.getWindturbineId()))
                 .collect(Collectors.toList());
 
         if(!wgls.isEmpty())
         {
             for(ProEconWindturbineGoodness wg:wgls)
             {
-                wgmap.put(wg.getWindturbineid(),wg);
+                wgmap.put(wg.getWindturbineId(),wg);
             }
         }
 //        //功率一致性接口调用
@@ -190,13 +190,13 @@ public class EquipmentInfo4Service {
         //获得功率一致性系数
         if (wgmap.containsKey(wt.getId())) {
             ProEconWindturbineGoodness wg = wgmap.get(wt.getId());
-            pewp.setRglyzxxs(wg.getDaycoefficient());
+            pewp.setRglyzxxs(wg.getDayCoefficient());
         }
 
         //获得拟合优度
         if (wgmap.containsKey(wt.getId())) {
             ProEconWindturbineGoodness wg = wgmap.get(wt.getId());
-            pewp.setRnhyd(wg.getDaygoodness());
+            pewp.setRnhyd(wg.getDayGoodness());
         }
 
         if (StringUtils.notEmp(pepid2)) {
@@ -441,13 +441,13 @@ public class EquipmentInfo4Service {
             //获得功率一致性系数
             if (wgmap.containsKey(wt.getId())) {
                 ProEconWindturbineGoodness wg = wgmap.get(wt.getId());
-                pewp.setYglyzxxs(wg.getMonthcoefficient());
+                pewp.setYglyzxxs(wg.getMonthCoefficient());
             }
 
             //获得拟合优度
             if (wgmap.containsKey(wt.getId())) {
                 ProEconWindturbineGoodness wg = wgmap.get(wt.getId());
-                pewp.setYnhyd(wg.getMonthgoodness());
+                pewp.setYnhyd(wg.getMonthGoodness());
             }
 
             if (StringUtils.notEmp(pepid2)) {
@@ -657,13 +657,13 @@ public class EquipmentInfo4Service {
             //获得功率一致性系数
             if (wgmap.containsKey(wt.getId())) {
                 ProEconWindturbineGoodness wg = wgmap.get(wt.getId());
-                pewp.setNglyzxxs(wg.getYearcoefficient());
+                pewp.setNglyzxxs(wg.getYearCoefficient());
             }
 
             //获得拟合优度
             if (wgmap.containsKey(wt.getId())) {
                 ProEconWindturbineGoodness wg = wgmap.get(wt.getId());
-                pewp.setNnhyd(wg.getYeargoodness());
+                pewp.setNnhyd(wg.getYearGoodness());
             }
 
             if (StringUtils.notEmp(pepid2)) {

+ 4 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo5Service.java

@@ -61,6 +61,8 @@ public class EquipmentInfo5Service {
             rate.setProjectId(wt.getProjectId());
             rate.setLineId(wt.getLineId());
             rate.setWindturbineId(wt.getId());
+            rate.setCompanyId(wt.getCompanyId());
+            rate.setRegionId(wt.getRegionId());
             Initial.initial(rate);
             rates.put(wt.getId(), rate);
         }
@@ -175,6 +177,8 @@ public class EquipmentInfo5Service {
         dayInfo.setProjectId(day.getProjectId());
         dayInfo.setLineId(day.getLineId());
         dayInfo.setWindturbineId(day.getWindturbineId());
+        dayInfo.setRegionId(day.getRegionId());
+        dayInfo.setCompanyId(day.getCompanyId());
         dayInfo.setTimerate1(day.getTimerate1());
         dayInfo.setTimerate2(day.getTimerate2());
         dayInfo.setTimerate3(day.getTimerate3());

+ 7 - 6
realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java

@@ -29,7 +29,7 @@ public class GoodnessOfFitService {
         @Resource
         private IProEconWtCurveFittingMonthService proEconWtCurveFittingMonthService;
 
-    public Map<String,Map<String,Double>> goodnessOfFit(Date nowDate) throws Exception {
+    public Map<String,Map<String,Double>> goodnessOfFit(String wtId,Date nowDate) throws Exception {
         Date startDate = DateUtils.addDays(nowDate,-1);
         Date endDate =new Date();
 
@@ -57,11 +57,12 @@ public class GoodnessOfFitService {
            List<ProEconWtCurveFittingMonth> powerList;
 
             powerList = proEconWtCurveFittingMonthService.list().stream().filter(i->i.getMonth().equals(month)
+                && i.getWindturbineId().equals(wtId)
                 && i.getYear().equals(year)).collect(Collectors.toList());
-
-            for (ProBasicEquipment wt : CacheContext.wtls)
-
-            {
+        ProBasicEquipment wt=CacheContext.wtmap.get(wtId);
+//            for (ProBasicEquipment wt : CacheContext.wtls)
+//
+//            {
 
                 List<FitClassVo> fitsD= new ArrayList<>();
                 List<FitClassVo> fitsM= new ArrayList<>();
@@ -183,7 +184,7 @@ public class GoodnessOfFitService {
                     }
 
                 });
-            }
+//            }
 
 
 //

+ 60 - 65
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java

@@ -13,8 +13,6 @@ import com.gyee.generation.util.statisticcs.Initial;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -747,8 +745,8 @@ public class WindPowerInfo1Service {
 
     private void extracted(Date recordDate, Date end, Date begin, Map<String, ProBasicPowerstationPoint> pointmap, ProEconPowerstationInfoDay1 pewp, List<ProEconPowerstationInfoDay1> pepid1ls) throws Exception {
         //*******************************************日信息统计*********************************************************/
-        if (pointmap.containsKey(ContantXk.SSPJFS)) {
-            ProBasicPowerstationPoint point = pointmap.get(ContantXk.SSPJFS);
+        if (pointmap.containsKey(ContantXk.RPJFS)) {
+            ProBasicPowerstationPoint point = pointmap.get(ContantXk.RPJFS);
             List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
             if (!pointls.isEmpty()) {
                 DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
@@ -762,8 +760,8 @@ public class WindPowerInfo1Service {
 
         }
 
-        if (pointmap.containsKey(ContantXk.SSZGL)) {
-            ProBasicPowerstationPoint point = pointmap.get(ContantXk.SSZGL);
+        if (pointmap.containsKey(ContantXk.RPJGL)) {
+            ProBasicPowerstationPoint point = pointmap.get(ContantXk.RPJGL);
             List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
             if (!pointls.isEmpty()) {
                 DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
@@ -961,40 +959,38 @@ public class WindPowerInfo1Service {
         if (pepid1ls.isEmpty()) {
             setPowerandSpeedMonth(pewp);
         } else {
+            if(pointmap.containsKey(ContantXk.YPJFS))
+            {
+                ProBasicPowerstationPoint point= pointmap.get(ContantXk.YPJFS);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //月最大风速
+                    pewp.setYzdfs(summaryStatistics.getMax());
+                    //月最小风速
+                    pewp.setYzxfs(summaryStatistics.getMin());
+                    //月平均风速
+                    pewp.setYpjfs(summaryStatistics.getAverage());
+                }
 
-            ProEconPowerstationInfoDay1 pepid = pepid1ls.get(0);
-
-            //如果昨日大于今日最大功率
-            if (pepid.getYzdgl() > pewp.getRzdgl()) {
-                pewp.setYzdgl(pepid.getYzdgl());
-            } else {
-                pewp.setYzdgl(pewp.getRzdgl());
-            }
-            //如果昨日大于今日最大风速
-            if (pepid.getYzdfs() > pewp.getRzdfs()) {
-                pewp.setYzdfs(pepid.getYzdfs());
-            } else {
-                pewp.setYzdfs(pewp.getRzdfs());
             }
 
-            //如果昨日小于今日最小功率
-            if (pepid.getYzxgl() < pewp.getRzxgl()) {
-                pewp.setYzxgl(pepid.getYzxgl());
-            } else {
-                pewp.setYzxgl(pewp.getRzxgl());
-            }
-            //如果昨日小于今日最小风速
-            if (pepid.getYzxfs() < pewp.getRzxfs()) {
-                pewp.setYzxfs(pepid.getYzxfs());
-            } else {
-                pewp.setYzxfs(pewp.getRzxfs());
+            if(pointmap.containsKey(ContantXk.YPJGL))
+            {
+                ProBasicPowerstationPoint point= pointmap.get(ContantXk.YPJGL);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //月最大功率
+                    pewp.setYzdgl(summaryStatistics.getMax());
+                    //月最小功率
+                    pewp.setYzxgl(summaryStatistics.getMin());
+                    //月平均功率
+                    pewp.setYpjgl(summaryStatistics.getAverage());
+                }
             }
-            double pjfs = BigDecimal.valueOf(pewp.getYpjfs() + pepid.getRpjfs()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
-
-            pewp.setYzxfs(pjfs);
-
-            double pjgl = BigDecimal.valueOf(pewp.getYpjgl() + pepid.getRpjgl()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
-            pewp.setYzxgl(pjgl);
 
         }
 
@@ -1184,39 +1180,38 @@ public class WindPowerInfo1Service {
             setPowerandSpeedYear(pewp);
         } else {
 
-            ProEconPowerstationInfoDay1 pepid = pepid1ls.get(0);
+            if(pointmap.containsKey(ContantXk.NPJFS))
+            {
+                ProBasicPowerstationPoint point= pointmap.get(ContantXk.NPJFS);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //年最大风速
+                    pewp.setNzdfs(summaryStatistics.getMax());
+                    //年最小风速
+                    pewp.setNzxfs(summaryStatistics.getMin());
+                    //年平均风速
+                    pewp.setNpjfs(summaryStatistics.getAverage());
+                }
 
-            //如果昨日大于今日最大功率
-            if (pepid.getNzdgl() > pewp.getRzdgl()) {
-                pewp.setNzdgl(pepid.getNzdgl());
-            } else {
-                pewp.setNzdgl(pewp.getRzdgl());
-            }
-            //如果昨日大于今日最大风速
-            if (pepid.getNzdfs() > pewp.getRzdfs()) {
-                pewp.setNzdfs(pepid.getNzdfs());
-            } else {
-                pewp.setNzdfs(pewp.getRzdfs());
             }
 
-            //如果昨日小于今日最小功率
-            if (pepid.getNzxgl() < pewp.getRzxgl()) {
-                pewp.setNzxgl(pepid.getNzxgl());
-            } else {
-                pewp.setNzxgl(pewp.getRzxgl());
-            }
-            //如果昨日小于今日最小风速
-            if (pepid.getNzxfs() < pewp.getRzxfs()) {
-                pewp.setNzxfs(pepid.getNzxfs());
-            } else {
-                pewp.setNzxfs(pewp.getRzxfs());
+            if(pointmap.containsKey(ContantXk.NPJGL))
+            {
+                ProBasicPowerstationPoint point= pointmap.get(ContantXk.NPJFS);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //年最大功率
+                    pewp.setNzdgl(summaryStatistics.getMax());
+                    //年最小功率
+                    pewp.setNzxgl(summaryStatistics.getMin());
+                    //年平均功率
+                    pewp.setNpjgl(summaryStatistics.getAverage());
+                }
             }
-            double pjfs = BigDecimal.valueOf(pewp.getNpjfs() + pepid.getRpjfs()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
-
-            pewp.setNzxfs(pjfs);
-
-            double pjgl = BigDecimal.valueOf(pewp.getNpjgl() + pepid.getRpjgl()).divide(new BigDecimal(2), 4, RoundingMode.HALF_EVEN).doubleValue();
-            pewp.setNzxgl(pjgl);
 
         }
 

+ 106 - 21
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindturbineGoodnessService.java

@@ -9,9 +9,7 @@ import com.gyee.generation.util.DateUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -30,8 +28,8 @@ public class WindturbineGoodnessService {
 
         //判断是否有重复记录,先删除重复记录
         List<Long> idls = proEconWindturbineGoodnessService.list().stream()
-                .filter(i -> i.getRecorddate().compareTo(DateUtils.truncate(recordDate))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineid())).map(ProEconWindturbineGoodness::getId)
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
+                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconWindturbineGoodness::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -40,32 +38,119 @@ public class WindturbineGoodnessService {
 
         }
 
-        Map<String, Map<String, Double>> coefficientMap=coefficientService.coefficient(recordDate);
-        Map<String, Map<String,Double>> fitMap=goodnessOfFitService.goodnessOfFit(recordDate);
 
+
+        List<ProEconWindturbineGoodness> vos=new ArrayList<>();
         for(ProBasicEquipment wt: CacheContext.wtls)
         {
+
+            Map<String, Map<String, Double>> coefficientMap=coefficientService.coefficient(wt.getId(),recordDate);
+            Map<String, Map<String,Double>> fitMap=goodnessOfFitService.goodnessOfFit(wt.getId(),recordDate);
             ProEconWindturbineGoodness po=new ProEconWindturbineGoodness();
-            po.setModelid(wt.getModelId());
-            po.setWindturbineid(wt.getId());
-            po.setRecorddate(DateUtils.truncate(recordDate));
-            po.setWindtpowerstationid(wt.getWindpowerstationId());
+            po.setModelId(wt.getModelId());
+            po.setWindturbineId(wt.getId());
+            po.setRecordDate(DateUtils.truncate(recordDate));
+            po.setWindtpowerstationId(wt.getWindpowerstationId());
+
+            po.setDayGoodness(0.0);
+            po.setYearGoodness(0.0);
+            po.setMonthGoodness(0.0);
+            po.setDayCoefficient(0.0);
+            po.setMonthCoefficient(0.0);
+            po.setYearCoefficient(0.0);
+            if(fitMap.containsKey(wt.getId()))
+            {
+                Map<String, Double> map=fitMap.get(wt.getId());
+                po.setDayGoodness(map.get("day"));
+                po.setYearGoodness(map.get("month"));
+                po.setMonthGoodness(map.get("year"));
+            }
             if(coefficientMap.containsKey(wt.getId()))
             {
                 Map<String, Double> map=coefficientMap.get(wt.getId());
-                po.setDaygoodness(map.get("day"));
-                po.setYeargoodness(map.get("month"));
-                po.setMonthgoodness(map.get("year"));
+                po.setDayCoefficient(map.get("day"));
+                po.setMonthCoefficient(map.get("month"));
+                po.setMonthCoefficient(map.get("year"));
             }
-            if(fitMap.containsKey(wt.getId()))
-            {
-                Map<String, Double> map=fitMap.get(wt.getId());
-                po.setDaycoefficient(map.get("day"));
-                po.setMonthcoefficient(map.get("month"));
-                po.setMonthcoefficient(map.get("year"));
+
+
+            vos.add(po);
+           // proEconWindturbineGoodnessService.save(po);
+        }
+        vos.sort(new Comparator<ProEconWindturbineGoodness>() {
+            @Override
+            public int compare(ProEconWindturbineGoodness o1, ProEconWindturbineGoodness o2) {
+                double d1=o1.getDayGoodness()+o1.getDayCoefficient();
+                double d2=o2.getDayGoodness()+o2.getDayCoefficient();
+                if (d1 < d2)
+                {
+                    return 1;
+                }else  if (d1 > d2){
+                    return 1;
+                }else
+                {
+                    return 0;
+                }
+
+            }
+        });
+
+        for(int i=0;i<vos.size();i++)
+        {
+            ProEconWindturbineGoodness vo=vos.get(i);
+            vo.setDayTop(i+1);
+        }
+
+        vos.sort(new Comparator<ProEconWindturbineGoodness>() {
+            @Override
+            public int compare(ProEconWindturbineGoodness o1, ProEconWindturbineGoodness o2) {
+                double d1=o1.getMonthGoodness()+o1.getMonthCoefficient();
+                double d2=o2.getMonthGoodness()+o2.getMonthCoefficient();
+                if (d1 < d2)
+                {
+                    return 1;
+                }else  if (d1 > d2){
+                    return 1;
+                }else
+                {
+                    return 0;
+                }
+
             }
-            proEconWindturbineGoodnessService.save(po);
+        });
+
+        for(int i=0;i<vos.size();i++)
+        {
+            ProEconWindturbineGoodness vo=vos.get(i);
+            vo.setMonthTop(i+1);
         }
+
+        vos.sort(new Comparator<ProEconWindturbineGoodness>() {
+            @Override
+            public int compare(ProEconWindturbineGoodness o1, ProEconWindturbineGoodness o2) {
+                double d1=o1.getYearGoodness()+o1.getYearCoefficient();
+                double d2=o2.getYearGoodness()+o2.getYearCoefficient();
+                if (d1 < d2)
+                {
+                    return 1;
+                }else  if (d1 > d2){
+                    return 1;
+                }else
+                {
+                    return 0;
+                }
+
+            }
+        });
+
+        for(int i=0;i<vos.size();i++)
+        {
+            ProEconWindturbineGoodness vo=vos.get(i);
+            vo.setYearTop(i+1);
+        }
+
+        proEconWindturbineGoodnessService.saveBatch(vos);
+
     }
 
 }

+ 276 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WtAlysisDayService.java

@@ -0,0 +1,276 @@
+package com.gyee.generation.service;//package com.gyee.generation.service;
+
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.model.StringUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+@Service
+public class WtAlysisDayService {
+
+//    private static final Logger logger = LoggerFactory.getLogger(EquipmentInfo1Service.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconWtAlysisDayService proEconWtAlysisDayService;
+
+    @Resource
+    private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
+    @Resource
+    private IProEconEquipmentInfoDay2Service proEconEquipmentInfoDay2Service;
+    @Resource
+    private IProEconEquipmentInfoDay3Service proEconEquipmentInfoDay3Service;
+    @Resource
+    private IProEconEquipmentInfoDay4Service proEconEquipmentInfoDay4Service;
+
+
+    private Map<String, ProEconEquipmentInfoDay1> queryEquipmentInfoDay1(Date recordDate) {
+
+
+        List<ProEconEquipmentInfoDay1> iostls= proEconEquipmentInfoDay1Service.list()
+                .stream().filter(i-> i.getRecordDate().compareTo(recordDate) == 0
+                )
+                .collect(Collectors.toList());
+        //List转map
+        Map<String, ProEconEquipmentInfoDay1> iostmap=iostls.stream().
+                collect(Collectors.toMap(ProEconEquipmentInfoDay1::getWindturbineId, Function.identity(), (key1, key2) -> key2));
+        return iostmap;
+    }
+    private Map<String, ProEconEquipmentInfoDay2> queryEquipmentInfoDay2(Date recordDate) {
+
+        List<ProEconEquipmentInfoDay2> iostls= proEconEquipmentInfoDay2Service.list()
+                .stream().filter(i-> i.getRecordDate().compareTo(recordDate) == 0
+                )
+                .collect(Collectors.toList());
+        //List转map
+        Map<String, ProEconEquipmentInfoDay2> iostmap=iostls.stream().
+                collect(Collectors.toMap(ProEconEquipmentInfoDay2::getWindturbineId, Function.identity(), (key1, key2) -> key2));
+        return iostmap;
+    }
+    private Map<String, ProEconEquipmentInfoDay3> queryEquipmentInfoDay3(Date recordDate) {
+
+
+        List<ProEconEquipmentInfoDay3> iostls= proEconEquipmentInfoDay3Service.list()
+                .stream().filter(i-> i.getRecordDate().compareTo(recordDate) == 0
+                )
+                .collect(Collectors.toList());
+        //List转map
+        Map<String, ProEconEquipmentInfoDay3> iostmap=iostls.stream().
+                collect(Collectors.toMap(ProEconEquipmentInfoDay3::getWindturbineId, Function.identity(), (key1, key2) -> key2));
+        return iostmap;
+    }
+
+    private Map<String, ProEconEquipmentInfoDay4> queryEquipmentInfoDay4(Date recordDate) {
+
+
+        List<ProEconEquipmentInfoDay4> iostls= proEconEquipmentInfoDay4Service.list()
+                .stream().filter(i-> i.getRecordDate().compareTo(recordDate) == 0
+                )
+                .collect(Collectors.toList());
+        //List转map
+        Map<String, ProEconEquipmentInfoDay4> iostmap=iostls.stream().
+                collect(Collectors.toMap(ProEconEquipmentInfoDay4::getWindturbineId, Function.identity(), (key1, key2) -> key2));
+        return iostmap;
+    }
+    /**
+     * 计算设备日信息
+     */
+    public void calEquipmentInfoDay(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+
+        Date begin= DateUtils.truncate(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<Long> idls = proEconWtAlysisDayService.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
+                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconWtAlysisDay::getId)
+                .collect(Collectors.toList());
+
+        if (idls.size() > 0) {
+
+            proEconWtAlysisDayService.removeByIds(idls);
+
+        }
+
+        Map<String, ProEconEquipmentInfoDay1> eqday1map = queryEquipmentInfoDay1(recordDate);
+        Map<String, ProEconEquipmentInfoDay2> eqday2map = queryEquipmentInfoDay2(recordDate);
+        Map<String, ProEconEquipmentInfoDay3> eqday3map = queryEquipmentInfoDay3(recordDate);
+        Map<String, ProEconEquipmentInfoDay4> eqday4map = queryEquipmentInfoDay4(recordDate);
+
+        List<ProEconWtAlysisDay> dayls=new ArrayList<>();
+
+        for(ProBasicEquipment wt:CacheContext.wtls)
+        {
+            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));
+            }
+
+
+            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));
+            }
+
+            if(eqday3map.containsKey(wt.getId()))
+            {
+                ProEconEquipmentInfoDay3 dayinfo= eqday3map.get(wt.getId());
+                pewp.setRtjcs(dayinfo.getRgztjcs()+dayinfo.getRjxtjcs());
+
+            }
+
+            if(eqday4map.containsKey(wt.getId()))
+            {
+                ProEconEquipmentInfoDay4 dayinfo= eqday4map.get(wt.getId());
+                pewp.setRnhyd(dayinfo.getRnhyd());
+                pewp.setRsjbz(dayinfo.getRqxpcbbzsj());
+                pewp.setRyxfs(dayinfo.getRyxfss());
+
+            }
+            //昨日的统计结果
+            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)
+            {
+                pepidls = proEconWtAlysisDayService.list().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);
+
+        }
+        proEconWtAlysisDayService.saveBatch(dayls);
+    }
+
+    private void calSimple(ProEconWtAlysisDay pewp, Date end, Date begin, ProBasicEquipment wt, List<ProEconWtAlysisDay> pepidls) throws Exception {
+
+//*******************************************日信息统计*********************************************************/
+
+        double lastState=-1;//上一分钟状态
+
+
+        double bbhcs=0;//不饱和次数
+
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+        Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getId());
+        if(aimap.containsKey(ContantXk.SSQFZT))
+        {
+
+            ProBasicEquipmentPoint point=aimap.get(ContantXk.SSQFZT);
+            //按照分钟时间进行统计状态快照值
+            List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+            if(!pointls.isEmpty()) {
+                for (PointData po : pointls) {
+
+                    if (po.getPointValueInDouble() >=3) {
+                        if (lastState != po.getPointValueInDouble()) {
+
+                            //将当前状态保存到上一分钟状态
+                            lastState = po.getPointValueInDouble();
+                            //实时欠发大于等于3的次数加1
+                            bbhcs++;
+                        }
+
+                    }
+
+                }
+
+            }
+
+        }
+        //日不饱和次数
+        pewp.setRbbhcs(bbhcs);
+
+        //*******************************************日信息统计*********************************************************/
+
+        //*******************************************月信息统计*********************************************************/
+        if(pepidls.isEmpty())
+        {
+            pewp.setYbbhcs(pewp.getRbbhcs());
+
+        }else
+        {
+            ProEconWtAlysisDay pepid=pepidls.get(0);
+
+            pewp.setYbbhcs(StringUtils.round(pepid.getYbbhcs()+pewp.getRbbhcs(),2));
+
+        }
+        //*******************************************月信息统计*********************************************************/
+
+        //*******************************************年信息统计*********************************************************/
+        if(pepidls.isEmpty())
+        {
+            pewp.setYbbhcs(pewp.getRbbhcs());
+
+        }else
+        {
+
+
+            ProEconWtAlysisDay pepid=pepidls.get(0);
+            pewp.setNbbhcs(StringUtils.round(pepid.getNbbhcs()+pewp.getRbbhcs(),2));
+
+        }
+        //*******************************************年信息统计*********************************************************/
+    }
+
+}
+
+
+
+
+
+
+

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconWindturbineGoodnessService.java

@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * </p>
  *
  * @author shilin
- * @since 2022-11-17
+ * @since 2022-11-24
  */
 public interface IProEconWindturbineGoodnessService extends IService<ProEconWindturbineGoodness> {
 

+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconWtAlysisDayService.java

@@ -0,0 +1,16 @@
+package com.gyee.generation.service.auto;
+
+import com.gyee.generation.model.auto.ProEconWtAlysisDay;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 风机日性能分析表 服务类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-24
+ */
+public interface IProEconWtAlysisDayService extends IService<ProEconWtAlysisDay> {
+
+}

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconWindturbineGoodnessServiceImpl.java

@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
  * </p>
  *
  * @author shilin
- * @since 2022-11-17
+ * @since 2022-11-24
  */
 @Service
 public class ProEconWindturbineGoodnessServiceImpl extends ServiceImpl<ProEconWindturbineGoodnessMapper, ProEconWindturbineGoodness> implements IProEconWindturbineGoodnessService {

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconWtAlysisDayServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.service.auto.impl;
+
+import com.gyee.generation.model.auto.ProEconWtAlysisDay;
+import com.gyee.generation.mapper.auto.ProEconWtAlysisDayMapper;
+import com.gyee.generation.service.auto.IProEconWtAlysisDayService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 风机日性能分析表 服务实现类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-24
+ */
+@Service
+public class ProEconWtAlysisDayServiceImpl extends ServiceImpl<ProEconWtAlysisDayMapper, ProEconWtAlysisDay> implements IProEconWtAlysisDayService {
+
+}

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

@@ -60,6 +60,10 @@ public class SaticSchedulePgTask {
     @Resource
     private WindturbineGoodnessService windturbineGoodnessService;
 
+    @Resource
+    private WtAlysisDayService wtAlysisDayService;
+
+
     //3.添加定时任务
     /**
      * 切入切出统计
@@ -292,6 +296,8 @@ public class SaticSchedulePgTask {
 
         equipmentInfo5Service.calEquipmentInfoDay(date);
 
+        wtAlysisDayService.calEquipmentInfoDay(date);
+
         XxlJobHelper.log("设备指标调度程序执行完成!........");
 
     }

+ 306 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/util/statisticcs/Initial.java

@@ -4,6 +4,7 @@ import com.gyee.generation.model.auto.*;
 
 public class Initial {
 
+
     public static void  initial(ProEconPowerstationInfoDay1 pepd)
     {
 
@@ -3007,4 +3008,309 @@ public class Initial {
          */
         pepd.setNgzxqjsl(0.0);
     }
+
+
+    public static void  initial(ProEconWtAlysisDay pepd)
+    {
+
+        /**
+         * 日发电量
+         */
+        pepd.setRfdl(0.0);
+
+        /**
+         * 月发电量
+         */
+        pepd.setYfdl(0.0);
+
+        /**
+         * 年发电量
+         */
+        pepd.setNfdl(0.0);
+
+        /**
+         * 日应发电量
+         */
+        pepd.setRyfdl(0.0);
+
+        /**
+         * 月应发电量
+         */
+        pepd.setYyfdl(0.0);
+
+        /**
+         * 年应发电量
+         */
+        pepd.setNyfdl(0.0);
+
+        /**
+         * 日平均功率
+         */
+        pepd.setRpjgl(0.0);
+
+        /**
+         * 月平均功率
+         */
+        pepd.setYpjgl(0.0);
+
+        /**
+         * 年平均功率
+         */
+        pepd.setNpjgl(0.0);
+
+        /**
+         * 日平均风速
+         */
+        pepd.setRpjfs(0.0);
+
+        /**
+         * 月平均风速
+         */
+        pepd.setYpjfs(0.0);
+
+        /**
+         * 年平均风速
+         */
+        pepd.setNpjfs(0.0);
+
+        /**
+         * 日运行小时
+         */
+        pepd.setRyxxs(0.0);
+
+        /**
+         * 月运行小时
+         */
+        pepd.setYyxxs(0.0);
+
+        /**
+         * 年运行小时
+         */
+        pepd.setNyxxs(0.0);
+
+        /**
+         * 日待机小时
+         */
+        pepd.setRdjxs(0.0);
+
+        /**
+         * 月待机小时
+         */
+        pepd.setYdjxs(0.0);
+
+        /**
+         * 年待机小时
+         */
+        pepd.setNdjxs(0.0);
+
+        /**
+         * 日故障小时
+         */
+        pepd.setRgzxs(0.0);
+
+        /**
+         * 月故障小时
+         */
+        pepd.setYgzxs(0.0);
+
+        /**
+         * 年故障小时
+         */
+        pepd.setNgzxs(0.0);
+
+        /**
+         * 日检修小时
+         */
+        pepd.setRjxxs(0.0);
+
+        /**
+         * 月检修小时
+         */
+        pepd.setYjxxs(0.0);
+
+        /**
+         * 年检修小时
+         */
+        pepd.setNjxxs(0.0);
+
+        /**
+         * 日中断小时
+         */
+        pepd.setRzdxs(0.0);
+
+        /**
+         * 月中断小时
+         */
+        pepd.setYzdxs(0.0);
+
+        /**
+         * 年中断小时
+         */
+        pepd.setNzdxs(0.0);
+
+        /**
+         * 日有效风时
+         */
+        pepd.setRyxfs(0.0);
+
+        /**
+         * 月有效风时
+         */
+        pepd.setYyxfs(0.0);
+
+        /**
+         * 年有效风时
+         */
+        pepd.setNyxfs(0.0);
+
+        /**
+         * 日损失电量
+         */
+        pepd.setRssdl(0.0);
+
+        /**
+         * 月损失电量
+         */
+        pepd.setYssdl(0.0);
+
+        /**
+         * 年损失电量
+         */
+        pepd.setNssdl(0.0);
+
+        /**
+         * 日报警次数
+         */
+        pepd.setRbjcs(0.0);
+
+        /**
+         * 月报警次数
+         */
+        pepd.setYbjcs(0.0);
+
+        /**
+         * 年报警次数
+         */
+        pepd.setNbjcs(0.0);
+
+        /**
+         * 日停机次数
+         */
+        pepd.setRtjcs(0.0);
+
+        /**
+         * 月停机次数
+         */
+        pepd.setYtjcs(0.0);
+
+        /**
+         * 年停机次数
+         */
+        pepd.setNtjcs(0.0);
+
+        /**
+         * 日不饱和次数
+         */
+        pepd.setRbbhcs(0.0);
+
+        /**
+         * 月不饱和次数
+         */
+        pepd.setYbbhcs(0.0);
+
+        /**
+         * 年不饱和次数
+         */
+        pepd.setNbbhcs(0.0);
+
+        /**
+         * 日设备可利用率
+         */
+        pepd.setRsbklyl(0.0);
+
+        /**
+         * 月设备可利用率
+         */
+        pepd.setYsbklyl(0.0);
+
+        /**
+         * 年设备可利用率
+         */
+        pepd.setNsbklyl(0.0);
+
+        /**
+         * 日平均温度
+         */
+        pepd.setRpjwd(0.0);
+
+        /**
+         * 月平均温度
+         */
+        pepd.setYpjwd(0.0);
+
+        /**
+         * 年平均温度
+         */
+        pepd.setNpjwd(0.0);
+
+        /**
+         * 日平均湿度
+         */
+        pepd.setRpjsd(0.0);
+
+        /**
+         * 月平均湿度
+         */
+        pepd.setYpjsd(0.0);
+
+        /**
+         * 年平均湿度
+         */
+        pepd.setNpjsd(0.0);
+
+        /**
+         * 日平均压强
+         */
+        pepd.setRpjyq(0.0);
+
+        /**
+         * 月平均压强
+         */
+        pepd.setYpjyq(0.0);
+
+        /**
+         * 年平均压强
+         */
+        pepd.setNpjyq(0.0);
+
+        /**
+         * 日拟合优度
+         */
+        pepd.setRnhyd(0.0);
+
+        /**
+         * 月拟合优度
+         */
+        pepd.setYnhyd(0.0);
+
+        /**
+         * 年拟合优度
+         */
+        pepd.setNnhyd(0.0);
+
+        /**
+         * 日实际/保证
+         */
+        pepd.setRsjbz(0.0);
+
+        /**
+         * 月实际/保证
+         */
+        pepd.setYsjbz(0.0);
+
+        /**
+         * 年实际/保正
+         */
+        pepd.setNsjbz(0.0);
+    }
 }