Prechádzať zdrojové kódy

开发场站3、5、6表的后台计算服务

shilin 2 rokov pred
rodič
commit
58292afc4d
35 zmenil súbory, kde vykonal 2227 pridanie a 6529 odobranie
  1. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/config/GeneratorCodeConfig.java
  2. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconEquipmentInfo15minuteController.java
  3. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconWt15minuteController.java
  4. 14 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconActivePowerDataMapper.java
  5. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfo15minuteMapper.java
  6. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconActivePowerData.java
  7. 3 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconCurveFittMonthSub.java
  8. 184 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfo15minute.java
  9. 6 10
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/CureFittingVo.java
  10. 0 134
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/EquipmentInfo15Vo.java
  11. 26 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/FitClassVo.java
  12. 152 435
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ActivePowerService.java
  13. 295 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java
  14. 524 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo15minuteService.java
  15. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java
  16. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java
  17. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo3Service.java
  18. 267 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java
  19. 26 26
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java
  20. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventService.java
  21. 3 3
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitService.java
  22. 462 669
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingService.java
  23. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownService.java
  24. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java
  25. 6 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo2Service.java
  26. 5 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java
  27. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo5Service.java
  28. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo6Service.java
  29. 0 2759
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindpowerInfoDayService.java
  30. 0 2468
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindpowerInfoMonthService.java
  31. 8 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconActivePowerDataService.java
  32. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconEquipmentInfo15minuteService.java
  33. 14 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconActivePowerDataServiceImpl.java
  34. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfo15minuteServiceImpl.java
  35. 124 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/util/statisticcs/Initial.java

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/config/GeneratorCodeConfig.java

@@ -62,7 +62,7 @@ public class GeneratorCodeConfig {
 //        dsc.setUsername("postgres");
 //        dsc.setPassword("postgres");
 //        dsc.setUrl("jdbc:postgresql://192.168.11.248:5432/eng_mctl");
-        dsc.setUrl("jdbc:postgresql://120.46.148.180:5432/wisdom");
+        dsc.setUrl("jdbc:postgresql://120.46.148.180:5432/postgres");
         dsc.setUsername("gdprod");
         dsc.setPassword("gd123");
         mpg.setDataSource(dsc);

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconEquipmentInfo15minuteController.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>
+ * 电设备15分钟信息表 前端控制器
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+@RestController
+@RequestMapping("//pro-econ-equipment-info15-minute")
+public class ProEconEquipmentInfo15minuteController {
+
+}

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconWt15minuteController.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>
+ * 风机15分钟信息表 前端控制器
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+@RestController
+@RequestMapping("//pro-econ-wt15-minute")
+public class ProEconWt15minuteController {
+
+}

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

@@ -2,6 +2,12 @@ package com.gyee.generation.mapper.auto;
 
 import com.gyee.generation.model.auto.ProEconActivePowerData;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.generation.model.vo.FitClassVo;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +19,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ProEconActivePowerDataMapper extends BaseMapper<ProEconActivePowerData> {
 
+    @Select(" SELECT windpowerstation_id windpowerstationId,windturbine_id windturbineId, " +
+            "model_id modelId,speed,avg(power) power " +
+            "FROM Pro_Econ_Active_Power_Data " +
+            "  where  windpowerstation_id=#{windpowerstationId} and record_date>=#{beginDate}  and record_date<=#{endDate} " +
+            "       group by windpowerstation_id,windturbine_id,model_id,speed order by speed ")
+    public List<FitClassVo> getFitList(@Param(value = "windpowerstationId")String windpowerstationId, @Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate);
+
+
 }

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

@@ -0,0 +1,16 @@
+package com.gyee.generation.mapper.auto;
+
+import com.gyee.generation.model.auto.ProEconEquipmentInfo15minute;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 电设备15分钟信息表 Mapper 接口
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+public interface ProEconEquipmentInfo15minuteMapper extends BaseMapper<ProEconEquipmentInfo15minute> {
+
+}

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

@@ -60,7 +60,7 @@ public class ProEconActivePowerData extends Model {
     /**
      * 频率
      */
-    private Double frequency;
+    private Integer frequency;
 
     /**
      * 风机编码

+ 3 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconCurveFittMonthSub.java

@@ -1,6 +1,8 @@
 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;
@@ -21,7 +23,7 @@ public class ProEconCurveFittMonthSub extends Model {
 
     /**
      * 编号
-
+     */
      @TableId(value = "ID",type = IdType.ASSIGN_ID)
     private String id;
 

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

@@ -0,0 +1,184 @@
+package com.gyee.generation.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 电设备15分钟信息表
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProEconEquipmentInfo15minute extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    private String id;
+
+    /**
+     * 风机编号
+     */
+    private String windturbineId;
+
+    /**
+     * 日期
+     */
+    private Date recordDate;
+
+    /**
+     * 风场编号
+     */
+    private String windpowerstationId;
+
+    /**
+     * 项目编号
+     */
+    private String projectId;
+
+    /**
+     * 线路编号
+     */
+    private String lineId;
+
+    /**
+     * 公司编号
+     */
+    private String companyId;
+
+    /**
+     * 区域编号
+     */
+    private String regionId;
+
+    /**
+     * 15分钟故障小时(明细)
+     */
+    private Double fgzxsmx;
+
+    /**
+     * 15分钟场内受累故障小时(明细)
+     */
+    private Double fcnslgzxsmx;
+
+    /**
+     * 15分钟检修小时(明细)
+     */
+    private Double fjxxsmx;
+
+    /**
+     * 15分钟场内受累检修小时(明细)
+     */
+    private Double fcnsljxxsmx;
+
+    /**
+     * 15分钟待机小时(明细)
+     */
+    private Double fdjxsmx;
+
+    /**
+     * 15分钟缺陷降出力小时(明细)
+     */
+    private Double fqxjclxsmx;
+
+    /**
+     * 15分钟手动停机小时(明细)
+     */
+    private Double fsdtjxsmx;
+
+    /**
+     * 15分钟并网小时(明细)
+     */
+    private Double fbwxsmx;
+
+    /**
+     * 15分钟限电停机小时(明细)
+     */
+    private Double fxdtjxsmx;
+
+    /**
+     * 15分钟限电降出力小时(明细)
+     */
+    private Double fxdjclxsmx;
+
+    /**
+     * 15分钟场外受累电网小时(明细)
+     */
+    private Double fcwsldwxsmx;
+
+    /**
+     * 15分钟场外受累天气小时(明细)
+     */
+    private Double fcwsltqxsmx;
+
+    /**
+     * 15分钟离线小时(明细)
+     */
+    private Double flxxsmx;
+
+    /**
+     * 15分钟通讯中断小时(明细)
+     */
+    private Double ftxzdxsmx;
+
+    /**
+     * 15分钟待机小时
+     */
+    private Double fdjxs;
+
+    /**
+     * 15分钟故障停机小时
+     */
+    private Double fgztjxs;
+
+    /**
+     * 15分钟通讯中断小时
+     */
+    private Double ftxzdxs;
+
+    /**
+     * 15分钟维护停机小时
+     */
+    private Double fjxtjxs;
+
+    /**
+     * 15分钟限电小时
+     */
+    private Double fxdxs;
+
+    /**
+     * 15分钟运行小时
+     */
+    private Double fyxxs;
+
+    /**
+     * 15分钟受累小时
+     */
+    private Double fslxs;
+
+    /**
+     * 15分钟平均风速
+     */
+    private Double fpjfs;
+
+    /**
+     * 15分钟平均功率
+     */
+    private Double fpjgl;
+
+    /**
+     * 15分钟发电量
+     */
+    private Double ffdl;
+
+
+}

+ 6 - 10
realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/CureFittingVo.java

@@ -13,19 +13,15 @@ public class CureFittingVo {
     private String pointIdFS;
     
     private String pointIdZT;
-   
-
-    private String pointIdZT2;
-    
 
     private String standardId;
     
-    private List<PointVo> myPoints1;
-    
-    private List<PointVo> myPointsFF1;
-   
-    private List<PointVo> myPoints2;
+    private List<PointVo> ysjglPoints;
     
-    private List<PointVo> myPointsFF2;
+    private List<PointVo> yzyglPoints;
+
+    private List<PointVo> rsjglPoints;
+
+    private List<PointVo> rzyglPoints;
     
 }

+ 0 - 134
realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/EquipmentInfo15Vo.java

@@ -1,134 +0,0 @@
-package com.gyee.generation.model.vo;
-
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.Date;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class EquipmentInfo15Vo {
-
-
-    /**
-     * 风机编号
-     */
-    private String windturbineId;
-
-    /**
-     * 日期
-     */
-    private Date recordDate;
-
-    /**
-     * 风场编号
-     */
-    private String windpowerstationId;
-
-    /**
-     * 项目编号
-     */
-    private String projectId;
-
-    /**
-     * 线路编号
-     */
-    private String lineId;
-
-    /**
-     * 公司编号
-     */
-    private String companyId;
-
-    /**
-     * 区域编号
-     */
-    private String regionId;
-
-    /**
-     * 日故障小时(明细)
-     */
-    private Double rgzxsmx;
-
-    /**
-     * 日场内受累故障小时(明细)
-     */
-    private Double rcnslgzxsmx;
-
-    /**
-     * 日检修小时(明细)
-     */
-    private Double rjxxsmx;
-
-    /**
-     * 日场内受累检修小时(明细)
-     */
-    private Double rcnsljxxsmx;
-
-    /**
-     * 日待机小时(明细)
-     */
-    private Double rdjxsmx;
-
-    /**
-     * 日缺陷降出力小时(明细)
-     */
-    private Double rqxjclxsmx;
-
-    /**
-     * 日手动停机小时(明细)
-     */
-    private Double rsdtjxsmx;
-
-    /**
-     * 日并网小时(明细)
-     */
-    private Double rbwxsmx;
-
-    /**
-     * 日限电停机小时(明细)
-     */
-    private Double rxdtjxsmx;
-
-    /**
-     * 日限电降出力小时(明细)
-     */
-    private Double rxdjclxsmx;
-
-    /**
-     * 日场外受累电网小时(明细)
-     */
-    private Double rcwsldwxsmx;
-
-    /**
-     * 日场外受累天气小时(明细)
-     */
-    private Double rcwsltqxsmx;
-
-    /**
-     * 日离线小时(明细)
-     */
-    private Double rlxxsmx;
-
-    /**
-     * 日通讯中断小时(明细)
-     */
-    private Double rtxzdxsmx;
-    /**
-     * 日平均功率
-     */
-    private Double rpjgl;
-
-    /**
-     * 日平均风速
-     */
-    private Double rpjfs;
-    /**
-     * 装机容量
-     */
-    private Double powerProduction;
-
-}

+ 26 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/FitClassVo.java

@@ -0,0 +1,26 @@
+package com.gyee.generation.model.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class FitClassVo {
+
+    //型号id
+    private String modelId;
+    //风场id
+    private String windpowerstationId;
+    //风机id
+    private String windturbineId;
+    //风速
+    private Double speed;
+    //功率
+    private Double power;
+    //排名
+    private Integer number;
+    //拟合优度
+    private Double epower;
+    
+
+}

+ 152 - 435
realtime/generationXK-service/src/main/java/com/gyee/generation/service/ActivePowerService.java

@@ -1,435 +1,152 @@
-//package com.gyee.generation.service;
-//
-//import com.gyee.generation.init.CacheContext;
-//import com.gyee.generation.model.auto.ProBasicWindpowerstation;
-//import com.gyee.generation.model.auto.ProBasicWindturbine;
-//import com.gyee.generation.model.auto.ProEconEquipmentInfoDay1;
-//import com.gyee.generation.model.auto.ProEconEquipmentInfoDay2;
-//import com.gyee.generation.model.vo.EquipmentInfo15Vo;
-//import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
-//import com.gyee.generation.service.auto.IProEconEquipmentInfoDay2Service;
-//import com.gyee.generation.service.auto.IProEconEquipmentInfoDay3Service;
-//import com.gyee.generation.util.DateUtils;
-//import com.gyee.generation.util.StringUtils;
-//import com.gyee.generation.util.realtimesource.IEdosUtil;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//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;
-//
-//@Service
-//public class ActivePowerService {
-//
-//
-//        private static final Logger logger = LoggerFactory.getLogger(ActivePowerService.class);
-//        @Resource
-//        private IEdosUtil edosUtil;
-//
-//        @Resource
-//        private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
-//        private IProEconEquipmentInfoDay2Service proEconEquipmentInfoDay2Service;
-//        private IProEconEquipmentInfoDay3Service proEconEquipmentInfoDay3Service;
-//
-//
-//
-//        public List<EquipmentInfo15Vo> initailEi1515(List<ProBasicWindturbine> wtls,Date currentDate,ProBasicWindpowerstation station)
-//        {
-//
-//            List<EquipmentInfo15Vo> ei15ls=new ArrayList<>();
-//            if(!wtls.isEmpty())
-//            {
-//                Map<String,ProEconEquipmentInfoDay1> peeidmap1=new HashMap<>();
-//                Map<String,ProEconEquipmentInfoDay2> peeidmap2=new HashMap<>();
-//                List<ProEconEquipmentInfoDay1> peeidls1 = proEconEquipmentInfoDay1Service.list().stream()
-//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(currentDate)) == 0
-//                                && i.getWindpowerstationId().equals(station.getId())
-//                        ).collect(Collectors.toList());
-//
-//                if(!peeidls1.isEmpty())
-//                {
-//                    for(ProEconEquipmentInfoDay1 peeid:peeidls1)
-//                    {
-//                        peeidmap1.put(peeid.getWindturbineId(),peeid);
-//                    }
-//                }
-//                List<ProEconEquipmentInfoDay2> peeidls2 = proEconEquipmentInfoDay2Service.list().stream()
-//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(currentDate)) == 0
-//                                && i.getWindpowerstationId().equals(station.getId())
-//                        ).collect(Collectors.toList());
-//
-//                if(!peeidls2.isEmpty())
-//                {
-//                    for(ProEconEquipmentInfoDay2 peeid:peeidls2)
-//                    {
-//                        peeidmap2.put(peeid.getWindturbineId(),peeid);
-//                    }
-//                }
-//
-//                for(ProBasicWindturbine wt:wtls)
-//                {
-//                    EquipmentInfo15Vo vo=new EquipmentInfo15Vo();
-//                    vo.setWindpowerstationId(wt.getWindpowerstationId());
-//                    vo.setWindturbineId(wt.getId());
-//                    vo.setProjectId(wt.getProjectId());
-//                    vo.setLineId(wt.getLineId());
-//                    vo.setCompanyId(wt.getCompanyId());
-//                    vo.setRegionId(wt.getRegionId());
-//
-//                    if(peeidmap1.containsKey(wt.getId()))
-//                    {
-//                        ProEconEquipmentInfoDay1  peeid1= peeidmap1.get(wt.getId());
-//                        vo.setRecordDate(peeid1.getRecordDate());
-//                        vo.setRpjfs(peeid1.getRpjfs());
-//                        vo.setRpjgl(peeid1.getRpjgl());
-//                    }
-//
-//                    if(peeidmap2.containsKey(wt.getId()))
-//                    {
-//                        ProEconEquipmentInfoDay2  peeid1= peeidmap2.get(wt.getId());
-//                        vo.setRecordDate(peeid1.getRecordDate());
-//
-//                        //日合计故障小时(明细)
-//                        vo.setRgzxsmx(vo.getRgzxsmx());
-//                        //日合计场内受累故障小时(明细)
-//                        vo.setRcnslgzxsmx(vo.getRcnslgzxsmx());
-//                        //日合计检修小时(明细)
-//                        vo.setRjxxsmx(vo.getRjxxsmx());
-//                        //日合计场内受累检修小时(明细)
-//                        vo.setRcnsljxxsmx(vo.getRcnsljxxsmx());
-//                        //日合计待机小时(明细)
-//                        vo.setRdjxsmx(vo.getRdjxsmx());
-//                        //日合计缺陷降出力小时(明细)
-//                        vo.setRqxjclxsmx(vo.getRqxjclxsmx());
-//                        //日合计手动停机小时(明细)
-//                        vo.setRsdtjxsmx(vo.getRsdtjxsmx());
-//                        //日合计性能小时(明细)
-//                        vo.setRbwxsmx(vo.getRbwxsmx());
-//                        //日合计限电停机小时(明细)
-//                        vo.setRxdtjxsmx(vo.getRxdtjxsmx());
-//                        //日合计限电降出力小时(明细)
-//                        vo.setRxdjclxsmx( vo.getRxdjclxsmx());
-//                        //日合计场外受累电网小时(明细)
-//                        vo.setRcwsldwxsmx(vo.getRcwsldwxsmx());
-//                        //日合计场外受累电网小时(明细)
-//                        vo.setRcwsltqxsmx(vo.getRcwsltqxsmx());
-//                        //日合计通讯中断小时(明细)
-//                        vo.setRtxzdxsmx(vo.getRtxzdxsmx());
-//                        //日合计离线小时(明细)
-//                        vo.setRlxxsmx(vo.getRlxxsmx());
-//
-//                    }
-//                    ei15ls.add(vo);
-//                }
-//            }
-//
-//            return ei15ls;
-//        }
-//
-//    public void calcActivePowerData(Date currentDate)
-//    {
-//        Calendar c=Calendar.getInstance();
-//        c.setTime(currentDate);
-//        Date beginDate = DateUtils.truncate(currentDate);
-//
-//        c.set(Calendar.HOUR_OF_DAY, 23);
-//        c.set(Calendar.MINUTE, 59);
-//        c.set(Calendar.SECOND, 59);
-//        Date endDate = c.getTime();
-//
-//
-//
-//
-//            Map<String, Double> windInfo = new HashMap<String, Double>();
-//            for (ProBasicWindpowerstation station : CacheContext.wpls)
-//            {
-//                List<ProBasicWindturbine> wtls= CacheContext.wpwtmap.get(station.getId());
-//                List<EquipmentInfo15Vo> ei15ls= initailEi1515(wtls,currentDate,station);
-//
-//
-//
-//                Map<String/*风机编号*/, Map<Double/*风速*/, List<Double>>> map =
-//                        new HashMap<String, Map<Double, List<Double>>>();
-//
-//
-//
-//                Map<Double/*风速*/, List<Double>> speedMap;
-//                for (EquipmentInfo15Vo item : ei15ls)
-//                {
-//
-//                    if (map.containsKey(item.getWindturbineId()))
-//                    {
-//                        speedMap = map.get(item.getWindturbineId());
-//                    }
-//                    else
-//                    {
-//                        speedMap = new HashMap<Double, List<Double>>();
-//                        map.put(item.getWindturbineId(), speedMap);
-//                    }
-//                    Double speed = StringUtils.round(item.getRpjfs(),2);
-//                    if (speed > item.getRpjfs())
-//                    {
-//
-//                        if (speed - item.getRpjfs() > 0.25)
-//                        {
-//                            speed -= 0.5;
-//                        }
-//                            else if (speed - item.getRpjfs() > 0.175)
-//                        {
-//                            speed -= 0.25;
-//                        }
-//                    }
-//                    else if (speed < item.getRpjfs())
-//                    {
-//                        if (item.getRpjfs() - speed > 0.25)
-//                        {
-//                            speed += 0.5;
-//                        }
-//                            else if (item.getRpjfs() - speed > 0.175)
-//                        {
-//                            speed += 0.25;
-//                        }
-//                    }
-//                    if ((item.getRpjgl() > 0 && item.getRpjfs() >= 3) || (item.getRpjfs() <= 3))
-//                    {
-//                        List<Double> powers;
-//                        if (speedMap.containsKey(speed))
-//                        {
-//                            powers = speedMap.get(speed);
-//                        }
-//                        else
-//                        {
-//                            powers = new ArrayList<Double>();
-//                            speedMap.put(speed, powers);
-//                        }
-//                        powers.add(item.getRpjgl());
-//                    }
-//
-//                }
-//                for (String windturbineId : map.keySet())
-//                {
-//                    List<ACTIVEPOWERDATA> dataList = new ArrayList<ACTIVEPOWERDATA>();
-//                    int frequency = 0;
-//                    Map<Double/*风速*/, List<Double>> intnalMap = map[windturbineId];
-//                    for (Double speed : intnalMap.keySet())
-//                    {
-//                        List<Double> powers = intnalMap[speed];
-//
-//                        var data = (from c : entities.ACTIVEPOWERDATA
-//                        where (c.WINDTURBINEID == windturbineId && c.RECORDDATE.Value.CompareTo(beginDate) == 0 && c.SPEED == speed)
-//                        select c).FirstOrDefault();
-//
-//                        if (data == null)
-//                        {
-//                            data = new Entities.ACTIVEPOWERDATA();
-//                            BuildActivePowerData(beginDate, entities, station, windturbineId, speed, powers, data);
-//                            entities.AddToACTIVEPOWERDATA(data);
-//                        }
-//                        else
-//                        {
-//                            BuildActivePowerData(beginDate, entities, station, windturbineId, speed, powers, data);
-//                        }
-//                        frequency += powers.Count;
-//                        dataList.Add(data);
-//                    }
-//
-//
-//                    //if (dataList.Count > 0)
-//                    //{
-//
-//                    //    Date recordDate = dataList[0].RECORDDATE.Value;
-//                    //    var dayInfo = (from c : entities.WINDTURBINEINFODAY
-//                    //                   where (c.WINDTURBINEID == windturbineId && c.RECORDDATE.Value.CompareTo(recordDate) == 0)
-//                    //                   select c).FirstOrDefault();
-//                    //    if (dayInfo != null)
-//                    //    {
-//                    //        Double result = UpdateTheoryGeneration(dataList, frequency, beginDate,windturbineId);
-//                    //        dayInfo.THEORYGENERATION = result;
-//
-//
-//                    //        #region 新添风场日信息表代码
-//                    //        if (windInfo.containsKey(dayInfo.LINEID))
-//                    //        {
-//                    //            windInfo[dayInfo.LINEID] += result;
-//                    //        }
-//                    //        else
-//                    //        {
-//                    //            windInfo.Add(dayInfo.LINEID, result);
-//                    //        }
-//
-//                    //        if (windInfo.containsKey(dayInfo.PROJECTID))
-//                    //        {
-//                    //            windInfo[dayInfo.PROJECTID] += result;
-//                    //        }
-//                    //        else
-//                    //        {
-//                    //            windInfo.Add(dayInfo.PROJECTID, result);
-//                    //        }
-//
-//                    //        if (windInfo.containsKey(dayInfo.WINDPOWERSTATIONID))
-//                    //        {
-//                    //            windInfo[dayInfo.WINDPOWERSTATIONID] += result;
-//                    //        }
-//                    //        else
-//                    //        {
-//                    //            windInfo.Add(dayInfo.WINDPOWERSTATIONID, result);
-//                    //        }
-//                    //        #endregion
-//                    //    }
-//                    //}
-//                }
-//
-//            //for (var key : windInfo.keySet())
-//            //{
-//            //    var dayInfo = (from c : entities.WINDPOWERINFODAY
-//            //                   where (c.FOREIGNKEYID == key && c.RECORDDATE.Value.CompareTo(beginDate) == 0)
-//            //                   select c).FirstOrDefault();
-//
-//            //    if (dayInfo != null)
-//            //    {
-//            //        dayInfo.THEORYGENERATION = windInfo[key]/10000;
-//            //    }
-//            //}
-//                #endregion
-//
-//            int z = entities.SaveChanges(false);
-//            logger.Info(String.Format("{1}:更新sqlserver数据库记录数:{0}", z, Date.Now));
-//        }
-//    }
-//
-//    private void BuildActivePowerData(Date beginDate, GdsjEntities entities, String station, String windturbineId, Double speed, List<Double> powers, Entities.ACTIVEPOWERDATA data)
-//    {
-//        data.WINDPOWERSTATIONID = station;
-//        data.WINDTURBINEID = windturbineId;
-//        data.POWER = powers.Average();
-//        data.SPEED = speed;
-//        data.FREQUENCY = powers.Count;
-//        data.RECORDDATE = beginDate;
-//        data.WINDTURBINECODE = this.windTurbineDictionary[windturbineId].CODE;
-//        data.MODELID = windTurbineDictionary[windturbineId].MODELID;
-//        data.MODELNAME = this.windTurbineModelDictionary[data.MODELID].CODE;
-//
-//    }
-//
-//    private Double UpdateTheoryGeneration(List<Entities.ACTIVEPOWERDATA> dataList, int frequency, Date currentDate, String windturbineId)
-//    {
-//        //电量分析主要针对省公司和各风场的每月实际发电量与计划的对比分析,可以查看省公司及各风场每月计划的完成情况和总体的计划完成情况,可以同比和环比进行比较;
-//        //对省公司和各风场的实际发电量与理论发电量的对比分析,利用标准功率曲线中的风速,理论功率,和固定时间段的风频进行统计,设计统计分析公式为:
-//        //理论发电量=(T*f1/f)*P1+(T*f2/f)*P2+…………(T*fn/f)*Pn
-//        //T是选取的时间段;
-//        //f是所有风频的和;
-//        //f1、f2、fn是某风速对应的风频;
-//        //P1、Pn是某风速对应理论曲线上的功率。
-//        //必要性:如果理论电量能够实现计算的准确,调峰电量就可以用理论电量来减去实际电量得出。
-//        //b、可选一段时间内的实际功率和理论功率能够形成曲线形式展示对比,理论功率根据实际风速利用理论功率曲线得出。
-//        //c、风频数据取值时间段需要统一。
-//
-//
-//            #region WINDTURBINECURVEFITTINGMONTH 替换成WINDTURBINEPOWERCURVEFITTING
-//        //List<WINDTURBINECURVEFITTINGMONTH> powerList = null;
-//        List<WINDTURBINEPOWERCURVEFITTING> powerList = null;
-//            #endregion
-//        using (GdsjEntities entity = new GdsjEntities())
-//        {
-//            //powerList = entity.WINDTURBINECURVEFITTING.Where(it => it.WINDTURBINEID == windturbineId && it.RECORDDATE.Value.CompareTo(currentDate) == 0).ToList();
-//
-//            String year=currentDate.Year.ToString();
-//            String month=currentDate.Month.ToString();
-//
-//
-//                #region WINDTURBINECURVEFITTINGMONTH 替换成WINDTURBINEPOWERCURVEFITTING
-//                //powerList = entity.WINDTURBINECURVEFITTINGMONTH.Where(it => it.WINDTURBINEID == windturbineId && it.YEAR == year && it.MONTH == month).ToList();
-//                powerList = entity.WINDTURBINEPOWERCURVEFITTING.Where(it => it.WINDTURBINEID == windturbineId).ToList();
-//                #endregion
-//
-//        }
-//
-//        Double t = 24;
-//
-//        Double result = 0;
-//
-//
-//        for (var data : dataList)
-//        {
-//            Double speed = data.SPEED.Value;
-//                #region WINDTURBINECURVEFITTINGMONTH 替换成 WINDTURBINEPOWERCURVEFITTING
-//            //if (type == "GDC")
-//            //{
-//            //    speed /= 100;
-//            //    speed = Math.Round(speed, 1);
-//            //    speed *= 100;
-//
-//            //    speed = Double.Truncate(speed);
-//            //}
-//            //else
-//            //{
-//            //    speed = Math.Round(speed, 1);
-//            //}
-//            if (type == "GDC")
-//            {
-//                speed /= 100;
-//                speed = Math.Round(speed, 2);
-//                speed *= 100;
-//
-//                speed = Double.Truncate(speed);
-//            }
-//            else
-//            {
-//                speed = Math.Round(speed, 2);
-//            }
-//                #endregion
-//
-//            if (modelPowerDictionary.containsKey(data.MODELID))
-//            {
-//                if (modelPowerDictionary[data.MODELID].Count > 0)
-//                {
-//                    if (modelPowerDictionary[data.MODELID].containsKey(speed))
-//                    {
-//                        Double p = modelPowerDictionary[data.MODELID][speed].ENSUREPOWER.Value;
-//
-//                        result += (t * data.FREQUENCY.Value / frequency) * p;
-//                    }
-//                }
-//                else
-//                {
-//                    if (powerList != null && powerList.Count>0)
-//                    {
-//                        Double? p = powerList.Where(it => it.SPEED == speed).Select(it => it.OPTIMALPOWER).FirstOrDefault();
-//
-//                        if (p != null)
-//                        {
-//                            result += (t * data.FREQUENCY.Value / frequency) * p.Value;
-//                        }
-//                        else
-//                        {
-//                            Double max = powerList.Max(it => it.SPEED).Value;
-//                            if (speed > max)
-//                            {
-//                                p = powerList.Max(it => it.ACTUALPOWER).Value;
-//                                if (p != null)
-//                                {
-//
-//                                    result += (t * data.FREQUENCY.Value / frequency) * p.Value;
-//                                }
-//                            }
-//
-//                        }
-//
-//                    }
-//                }
-//
-//
-//
-//            }
-//
-//        }
-//        return result;
-//
-//    }
-//}
-//
-//    }
+package com.gyee.generation.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+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.StringUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class ActivePowerService {
+
+
+    private static final Logger logger = LoggerFactory.getLogger(ActivePowerService.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconEquipmentInfo15minuteService proEconEquipmentInfo15minuteService;
+
+    @Resource
+    private IProEconActivePowerDataService proEconActivePowerDataService;
+
+    @Resource
+    private IProEconWtPowerCurveFittingService proEconWtPowerCurveFittingService;
+
+
+    public void calcActivePowerData(Date currentDate) {
+        Calendar c = Calendar.getInstance();
+        c.setTime(currentDate);
+        Date beginDate = DateUtils.truncate(currentDate);
+        c.add(Calendar.DAY_OF_MONTH,1);
+        Date endDate=c.getTime();
+        for (ProBasicWindpowerstation station : CacheContext.wpls) {
+
+            List<ProEconEquipmentInfo15minute> ei15ls = proEconEquipmentInfo15minuteService.list().stream()
+                    .filter(i -> i.getWindpowerstationId().equals(station)
+                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+                    ).collect(Collectors.toList());
+
+
+
+            Map<String/*风机编号*/, Map<Double/*风速*/, List<Double>>> map =
+                    new HashMap<String, Map<Double, List<Double>>>();
+
+
+            Map<Double/*风速*/, List<Double>> speedMap;
+            for (ProEconEquipmentInfo15minute item : ei15ls) {
+
+                if (map.containsKey(item.getWindturbineId())) {
+                    speedMap = map.get(item.getWindturbineId());
+                } else {
+                    speedMap = new HashMap<Double, List<Double>>();
+                    map.put(item.getWindturbineId(), speedMap);
+                }
+                Double speed = StringUtils.round(item.getFpjfs(), 2);
+                if (speed > item.getFpjfs()) {
+
+                    if (speed - item.getFpjfs() > 0.25) {
+                        speed -= 0.5;
+                    } else if (speed - item.getFpjfs() > 0.175) {
+                        speed -= 0.25;
+                    }
+                } else if (speed < item.getFpjfs()) {
+                    if (item.getFpjfs() - speed > 0.25) {
+                        speed += 0.5;
+                    } else if (item.getFpjfs() - speed > 0.175) {
+                        speed += 0.25;
+                    }
+                }
+                if ((item.getFpjgl() > 0 && item.getFpjfs() >= 3) || (item.getFpjfs() <= 3)) {
+                    List<Double> powers;
+                    if (speedMap.containsKey(speed)) {
+                        powers = speedMap.get(speed);
+                    } else {
+                        powers = new ArrayList<>();
+                        speedMap.put(speed, powers);
+                    }
+                    powers.add(item.getFpjgl());
+                }
+
+            }
+            for (String windturbineId : map.keySet()) {
+                List<ProEconActivePowerData> dataList = new ArrayList<ProEconActivePowerData>();
+                Map<Double/*风速*/, List<Double>> intnalMap = map.get(windturbineId);
+                for (Double speed : intnalMap.keySet()) {
+                    List<Double> powers = intnalMap.get(speed);
+
+                    Optional<ProEconActivePowerData> data = proEconActivePowerDataService.list().stream()
+                            .filter(i -> i.getWindturbineId().equals(windturbineId)
+                                    && i.getRecordDate().compareTo(beginDate) == 0
+                                    && i.getSpeed() == speed
+                            ).findFirst();
+
+                    ProEconActivePowerData apdata = new ProEconActivePowerData();
+                    if (!data.isPresent()) {
+
+                        QueryWrapper<ProEconActivePowerData> wrapper = new QueryWrapper<>();
+                        wrapper.eq("id", data.get().getId());
+                        proEconActivePowerDataService.remove(wrapper);
+
+                    }
+
+                    apdata = new ProEconActivePowerData();
+                    buildActivePowerData(beginDate, station.getId(), windturbineId, speed, powers, apdata);
+                    proEconActivePowerDataService.save(apdata);
+
+                    dataList.add(apdata);
+                }
+            }
+
+        }
+    }
+
+    private void buildActivePowerData(Date beginDate, String station, String windturbineId, Double speed, List<Double> powers, ProEconActivePowerData data) {
+        data.setWindturbineId(windturbineId);
+        data.setWindpowerstationId(station);
+        DoubleSummaryStatistics summaryStatistics = powers.stream().mapToDouble(n -> n).summaryStatistics();
+        data.setPower(summaryStatistics.getAverage());
+        data.setSpeed(speed);
+        data.setFrequency(powers.size());
+        data.setRecordDate(beginDate);
+
+        if (CacheContext.wtmap.containsKey(windturbineId)) {
+            ProBasicWindturbine wt = CacheContext.wtmap.get(windturbineId);
+            data.setModelId(wt.getModelId());
+            data.setWindturbineCode(wt.getNemCode());
+
+        }
+
+        if (StringUtils.notEmp(data.getModelId()) && CacheContext.modelMap.containsKey(data.getModelId())) {
+            ProEconEquipmentmodel em = CacheContext.modelMap.get(data.getModelId());
+            data.setModelName(em.getName());
+
+        }
+
+    }
+
+
+}
+

+ 295 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java

@@ -0,0 +1,295 @@
+package com.gyee.generation.service;
+
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.service.auto.IProEconActivePowerDataService;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay2Service;
+import com.gyee.generation.service.auto.IProEconWtPowerCurveFittingService;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.StringUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class CoefficientService {
+
+
+        private static final Logger logger = LoggerFactory.getLogger(CoefficientService.class);
+        @Resource
+        private IEdosUtil edosUtil;
+
+        @Resource
+        private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
+        private IProEconEquipmentInfoDay2Service proEconEquipmentInfoDay2Service;
+
+        private IProEconActivePowerDataService proEconActivePowerDataService;
+
+
+        private IProEconWtPowerCurveFittingService proEconWtPowerCurveFittingService;
+
+
+
+
+    public  Map<String,Map<String,Double>>  coefficient(Date currentDate)
+    {
+        //调度时间是第二天,currentDate 是第一天
+
+        currentDate = DateUtils.truncDay(currentDate);
+
+        Calendar c= Calendar.getInstance();
+        c.setTime(currentDate);
+
+        c.set(Calendar.DAY_OF_MONTH,1);
+        Date monthbeginDate = c.getTime();
+        c.set(Calendar.MONTH,0);
+        Date yearbeginDate = c.getTime();
+
+        c.setTime(currentDate);
+        Date beginDate = c.getTime();
+        c.add(Calendar.DAY_OF_MONTH,1);
+        Date endDate = c.getTime();
+
+        Map<String,Map<String,Double>> resultmap =new HashMap<>();
+            //查询风机
+            List<ProBasicWindturbine> wtls = CacheContext.wtls;
+
+            //遍历所有风机ID
+            for (ProBasicWindturbine wt : wtls)
+            {
+
+                Map<String/*风机编号*/, Map<Double/*风速*/, List<Double>/*对应功率集合*/>> map =
+                        new HashMap<String, Map<Double, List<Double>>>();
+
+/**********************************************年功率一致性统计***************************************************************/
+
+                List<ProEconActivePowerData> yearList = new ArrayList<ProEconActivePowerData>();
+
+
+                List<ProEconActivePowerData> queryYear =proEconActivePowerDataService.list().stream().filter(i->i.getWindturbineId().equals(wt.getId())
+                        && ( i.getRecordDate().compareTo(yearbeginDate)==0 || i.getRecordDate().after(yearbeginDate))
+                        && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+                ).collect(Collectors.toList());
+
+                yearList=calCoefficient(queryYear,wt);
+
+/*****************************************月功率一致性统计********************************************************************/
+
+                List<ProEconActivePowerData> monthList = new ArrayList<ProEconActivePowerData>();
+                List<ProEconActivePowerData> queryMonth =queryYear.stream().filter(i->i.getWindturbineId().equals(wt.getId())
+                        && ( i.getRecordDate().compareTo(monthbeginDate)==0 || i.getRecordDate().after(monthbeginDate))
+                        && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+                ).collect(Collectors.toList());
+
+                monthList=calCoefficient(queryMonth,wt);
+
+
+
+/*****************************************日功率一致性统计********************************************************************/
+
+
+                List<ProEconActivePowerData> dayList = new ArrayList<ProEconActivePowerData>();
+
+
+                List<ProEconActivePowerData> queryDay =queryMonth.stream().filter(i->i.getWindturbineId().equals(wt.getId())
+                                && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+                                && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+                        ).collect(Collectors.toList());
+
+                dayList=calCoefficient(queryDay,wt);
+
+
+
+                Double resultYear = coefficient(yearList, currentDate, wt.getId());
+                Double resultMonth = coefficient(monthList, currentDate, wt.getId());
+                Double resultDay = coefficient(dayList, currentDate, wt.getId());
+
+                Map<String,Double> tempmap=new HashMap<>();
+                tempmap.put("year",resultYear);
+                tempmap.put("month",resultMonth);
+                tempmap.put("day",resultDay);
+                resultmap.put(wt.getId(),tempmap);
+
+            }
+
+
+
+            return resultmap;
+    }
+
+
+    private List<ProEconActivePowerData> calCoefficient(List<ProEconActivePowerData> query,ProBasicWindturbine wt)
+    {
+
+
+        Map<Double, List<ProEconActivePowerData>> apdataYearMap = query.stream().collect(Collectors.groupingBy(ProEconActivePowerData::getSpeed));
+
+
+        Map<Double, Double> speedAndPowerYearMap=new HashMap<Double, Double>();
+        apdataYearMap.forEach((key,value)->{
+            DoubleSummaryStatistics summaryStatistics=value.stream().mapToDouble(n -> n.getPower()).summaryStatistics();
+            speedAndPowerYearMap.put(key,summaryStatistics.getAverage());
+        });
+
+        List<ProEconActivePowerData> yearList = new ArrayList<ProEconActivePowerData>();
+
+
+
+        speedAndPowerYearMap.forEach((key,value)->{
+
+            ProEconActivePowerData activepowerdata= new ProEconActivePowerData();
+            activepowerdata.setWindturbineId(wt.getId());
+            activepowerdata.setSpeed(key);
+            activepowerdata.setPower(value);
+            activepowerdata.setFrequency(1);
+            activepowerdata.setModelId(wt.getModelId());
+
+            yearList.add(activepowerdata);
+        });
+
+        return yearList;
+
+    }
+
+
+    //功率一致性系数
+    private Double coefficient(List<ProEconActivePowerData> dataList, Date currentDate, String windturbineId)
+    {
+        Double result=0.0;
+        Double count =0.0;
+
+        if (dataList != null && dataList.size() != 0)
+        {
+
+            List<ProEconWtPowerCurveFitting> powerList = null;
+  
+                Calendar c=Calendar.getInstance();
+                c.setTime(currentDate);
+                String year =String.valueOf(c.get(Calendar.YEAR));
+                String month = String.valueOf(c.get(Calendar.MONTH)+1);
+
+                powerList = proEconWtPowerCurveFittingService.list().stream()
+                        .filter(i->i.getWindturbineId().equals(windturbineId)).collect(Collectors.toList());
+
+      
+
+
+            for (ProEconActivePowerData data : dataList)
+            {
+                Double p1 = data.getPower();
+                Double speed = data.getSpeed();
+                if (speed < 3 || speed > 25)
+                {
+                    continue;
+                }
+                
+                if (CacheContext.wtmap.containsKey(windturbineId))
+                {
+                    ProBasicWindturbine wt=CacheContext.wtmap.get(windturbineId);
+
+                    if (wt.getWindpowerstationId().contains("GDC"))
+                    {
+                        speed /= 100;
+                        speed = StringUtils.round(speed, 2);
+                        speed *= 100;
+
+                        speed = StringUtils.round(speed, 2);
+                    }
+                    else
+                    {
+                        speed = StringUtils.round(speed, 2);
+                    }
+                }
+      
+
+
+
+                if (CacheContext.modelpowermap.containsKey(data.getModelId()))
+                {
+                    if (CacheContext.modelpowermap.get(data.getModelId()).size() > 0)
+                    {
+                        if (CacheContext.modelpowermap.get(data.getModelId()).containsKey(speed))
+                        {
+                            Double p = CacheContext.modelpowermap.get(data.getModelId()).get(speed).getEnsurePower();
+
+
+                            if (p != 0)
+                            {
+                                for (int i = 0; i < data.getFrequency(); i++)
+                                {
+                                    result += Math.abs((p - p1) / p);
+                                    count += 1;
+                                }
+                            }
+                        }
+                    }
+                    else
+                    {
+                        if (powerList != null && powerList.size() > 0)
+                        {
+                            Double finalSpeed = speed;
+                            OptionalDouble opd = powerList.stream().filter(i->i.getSpeed()== finalSpeed).mapToDouble(x->x.getOptimalPower()).findFirst();
+
+
+                            double p=0.0;
+                            if (opd.isPresent())
+                            {
+                                p=opd.getAsDouble();
+                                if (p != 0)
+                                {
+                                    for (int i = 0; i < data.getFrequency(); i++)
+                                    {
+                                        result += Math.abs((p- p1) / p);
+                                        count += 1;
+                                    }
+                                }
+                            }
+                            else
+                            {
+
+                                DoubleSummaryStatistics summaryStatistics=powerList.stream().mapToDouble(ProEconWtPowerCurveFitting::getSpeed).summaryStatistics();
+
+                                Double max = summaryStatistics.getMax();
+                                if (speed > max)
+                                {
+                                    summaryStatistics=powerList.stream().mapToDouble(ProEconWtPowerCurveFitting::getActualPower).summaryStatistics();
+                                    p = summaryStatistics.getMax();
+                                    if (p != 0.0)
+                                    {
+
+                                        if (p != 0)
+                                        {
+                                            for (int i = 0; i < data.getFrequency(); i++)
+                                            {
+                                                result += Math.abs((p - p1) / p);
+                                                count += 1;
+                                            }
+                                        }
+                                    }
+                                }
+
+                            }
+
+                        }
+                    }
+                }
+
+            }
+            if (count != 0)
+                result = result / count * 100;
+            else
+                result = 100.0;
+        }
+
+        return result;
+
+    }
+}
+
+

+ 524 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo15minuteService.java

@@ -0,0 +1,524 @@
+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.ProBasicEquipmentPoint;
+import com.gyee.generation.model.auto.ProBasicWindturbine;
+import com.gyee.generation.model.auto.ProEconEquipmentInfo15minute;
+import com.gyee.generation.service.auto.IProEconEquipmentInfo15minuteService;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+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;
+
+@Service
+public class EquipmentInfo15minuteService {
+
+    private static final Logger logger = LoggerFactory.getLogger(EquipmentInfo15minuteService.class);
+    @Resource
+    private IEdosUtil edosUtil;
+
+    @Resource
+    private IProEconEquipmentInfo15minuteService proEconEquipmentInfo15minuteService;
+
+
+
+    /**
+     * 计算设备15分钟信息
+     * @param recordDate
+     * @throws Exception
+     */
+    public void calLineInfoMinute15(Date recordDate) throws Exception {
+        Calendar c=Calendar.getInstance();
+        c.setTime(recordDate);
+
+        Date end=c.getTime();
+        c.add(Calendar.MINUTE,-15);
+        Date begin= DateUtils.truncDay(c.getTime());
+
+        //判断是否有重复记录,先删除重复记录
+        List<String> idls = proEconEquipmentInfo15minuteService.list().stream()
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
+           ).map(ProEconEquipmentInfo15minute::getId)
+                .collect(Collectors.toList());
+
+        if (idls != null && idls.size() > 0) {
+
+            proEconEquipmentInfo15minuteService.removeByIds(idls);
+
+        }
+        for(ProBasicWindturbine wt:CacheContext.wtls)
+        {
+            if(CacheContext.wppointmap.containsKey(wt.getId()))
+            {
+                Map<String, ProBasicEquipmentPoint> pointmap=CacheContext.wtpAimap.get(wt.getId());
+
+                ProEconEquipmentInfo15minute pewp=new ProEconEquipmentInfo15minute();
+                Initial.initial(pewp);
+                pewp.setCompanyId(wt.getCompanyId());
+                pewp.setWindpowerstationId(wt.getWindpowerstationId());
+                pewp.setLineId(wt.getLineId());
+                pewp.setProjectId(wt.getProjectId());
+                pewp.setRegionId(wt.getRegionId());
+                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+
+
+
+                if(pointmap.containsKey(ContantXk.SSPJFS))
+                {
+                    ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSPJFS);
+                    List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                    if(!pointls.isEmpty())
+                    {
+                        DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
+                        //15分钟平均风速
+                        pewp.setFpjfs(summaryStatistics.getAverage());
+                    }
+
+                }
+
+                if(pointmap.containsKey(ContantXk.SSZGL))
+                {
+                    ProBasicEquipmentPoint point= pointmap.get(ContantXk.SSZGL);
+                    List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                    if(!pointls.isEmpty())
+                    {
+                        DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(n -> n.getPointValueInDouble()).summaryStatistics();
+                        //15分钟平均功率
+                        pewp.setFpjgl(summaryStatistics.getAverage());
+                    }
+                }
+
+
+                if(pointmap.containsKey(ContantXk.RFDL))
+                {
+                    ProBasicEquipmentPoint point= pointmap.get(ContantXk.RFDL);
+
+                    PointData beginValue=edosUtil.getHistMatrix(point.getNemCode(), begin.getTime()/1000);
+                    PointData endValue=edosUtil.getHistMatrix(point.getNemCode(), end.getTime()/1000);
+                    if(StringUtils.notEmp(beginValue)  && StringUtils.notEmp(endValue))
+                    {
+                        //15分钟发电量
+                        pewp.setFfdl(StringUtils.round(endValue.getPointValueInDouble()-beginValue.getPointValueInDouble(),2));
+
+                    }
+                }
+
+                calDetiall( pewp, end, begin, wt);
+                calSimple( pewp, end, begin, wt);
+                proEconEquipmentInfo15minuteService.save(pewp);
+
+            }
+
+
+        }
+
+    }
+
+    private void calDetiall(ProEconEquipmentInfo15minute pewp,Date end, Date begin,ProBasicWindturbine wt) throws Exception {
+        //        //                0	待机
+//                1	手动停机
+//                2	正常发电
+//                3	发电降出力
+//                4	故障
+//                5	故障受累
+//                6	检修
+//                7	检修受累
+//                8	限电降出力
+//                9	限电停机
+//                10	电网受累
+//                11	环境受累
+//                12	通讯中断
+//                13	设备离线
+
+        double lastState=-1;//上一分钟状态
+
+        double djsc=0;//待机时长
+        double sdtjsc=0;//手动停机时长
+        double zcfdsc=0;//正常发电时长
+        double fdjclsc=0;//发电降出力时长
+        double gzsc=0;//故障时长
+        double gzslsc=0;//故障受累时长
+        double jxsc=0;//检修时长
+        double jxslsc=0;//检修受累时长
+        double xdjclsc=0;//限电降出力时长
+        double xdtjsc=0;//限电停机时长
+        double dwslsc=0;//电网受累时长
+        double hjslsc=0;//环境受累时长
+        double txzdsc=0;//通讯中断时长
+        double sblxsc=0;//设备离线时长
+
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+            lastState=-1;//上一分钟状态
+            Map<String, ProBasicEquipmentPoint> aimap=wtpAimap.get(wt.getNemCode());
+            if(wtpAimap.containsKey(ContantXk.MXZT));
+            {
+
+                ProBasicEquipmentPoint point=aimap.get(ContantXk.MXZT);
+                 //按照分钟时间进行统计状态快照值
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    for(PointData po :pointls)
+                    {
+
+                        if(po.getPointValueInDouble()==0)
+                        {
+
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //待机时长加1分钟
+                            djsc++;
+                        }else  if(po.getPointValueInDouble()==1)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //手动停机时长加1分钟
+                            sdtjsc++;
+                        }else  if(po.getPointValueInDouble()==2)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //正常发电时长加1分钟
+                            zcfdsc++;
+                        }else  if(po.getPointValueInDouble()==3)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //发电降出力时长加1分钟
+                            fdjclsc++;
+                        }else  if(po.getPointValueInDouble()==4)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //故障时长加1分钟
+                            gzsc++;
+                        }else  if(po.getPointValueInDouble()==5)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //故障受累时长加1分钟
+                            gzslsc++;
+                        }else  if(po.getPointValueInDouble()==6)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //检修时长加1分钟
+                            jxsc++;
+                        }else  if(po.getPointValueInDouble()==7)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //检修受累时长加1分钟
+                            jxslsc++;
+                        }else  if(po.getPointValueInDouble()==8)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //限电降出力时长加1分钟
+                            xdjclsc++;
+                        }else  if(po.getPointValueInDouble()==9)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //限电停机时长加1分钟
+                            xdtjsc++;
+                        }else  if(po.getPointValueInDouble()==10)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //电网受累时长加1分钟
+                            dwslsc++;
+                        }else  if(po.getPointValueInDouble()==11)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //环境受累时长加1分钟
+                            hjslsc++;
+                        }else  if(po.getPointValueInDouble()==12)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+                            //通讯中断时长加1分钟
+                            txzdsc++;
+                        }else  if(po.getPointValueInDouble()==13)
+                        {
+                            if(lastState!=po.getPointValueInDouble())
+                            {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState=po.getPointValueInDouble();
+
+                            }
+
+                            //设备离线时长加1分钟
+                            sblxsc++;
+                        }
+
+                    }
+
+
+
+                }
+
+            }
+   
+        //15分钟合计故障小时(明细)
+        pewp.setFgzxsmx(new BigDecimal(gzsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计场内受累故障小时(明细)
+        pewp.setFcnslgzxsmx(new BigDecimal(gzslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计检修小时(明细)
+        pewp.setFjxxsmx(new BigDecimal(jxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计场内受累检修小时(明细)
+        pewp.setFcnsljxxsmx(new BigDecimal(jxslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计待机小时(明细)
+        pewp.setFdjxsmx(new BigDecimal(djsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计缺陷降出力小时(明细)
+        pewp.setFqxjclxsmx(new BigDecimal(fdjclsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计手动停机小时(明细)
+        pewp.setFsdtjxsmx(new BigDecimal(sdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计性能小时(明细)
+        pewp.setFbwxsmx(new BigDecimal(zcfdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计限电停机小时(明细)
+        pewp.setFxdtjxsmx(new BigDecimal(xdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计限电降出力小时(明细)
+        pewp.setFxdjclxsmx(new BigDecimal(xdjclsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计场外受累电网小时(明细)
+        pewp.setFcwsldwxsmx(new BigDecimal(dwslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计场外受累电网小时(明细)
+        pewp.setFcwsltqxsmx(new BigDecimal(hjslsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计通讯中断小时(明细)
+        pewp.setFtxzdxsmx(new BigDecimal(txzdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+        //15分钟合计离线小时(明细)
+        pewp.setFlxxsmx(new BigDecimal(sblxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+
+
+
+/*******************************************15分钟信息统计*********************************************************/
+
+
+
+
+
+    }
+
+
+
+        private void calSimple(ProEconEquipmentInfo15minute pewp,Date end, Date begin,ProBasicWindturbine wt) throws Exception {
+//        0	待机
+//        1	运行
+//        2	故障
+//        3	检修
+//        4	限电
+//        5	受累
+//        6	离线
+/*******************************************15分钟信息统计*********************************************************/
+
+            double lastState = -1;//上一分钟状态
+
+
+            double djsc = 0;//待机时长
+            double zcfdsc = 0;//正常发电时长
+            double gzsc = 0;//故障时长
+            double jxsc = 0;//检修时长
+            double xdtjsc = 0;//限电停机时长
+            double slsc = 0;//受累时长
+            double txzdsc = 0;//通讯中断时长
+
+
+            Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+
+
+            Map<String, ProBasicEquipmentPoint> aimap = wtpAimap.get(wt.getNemCode());
+            if (wtpAimap.containsKey(ContantXk.SBZT)) ;
+            {
+
+                ProBasicEquipmentPoint point = aimap.get(ContantXk.SBZT);
+                //按照分钟时间进行统计状态快照值
+                List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
+                if (!pointls.isEmpty()) {
+                    for (PointData po : pointls) {
+
+                        if (po.getPointValueInDouble() == 0) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //待机时长加1分钟
+                            djsc++;
+                        } else if (po.getPointValueInDouble() == 1) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //正常发电时长加1分钟
+                            zcfdsc++;
+                        } else if (po.getPointValueInDouble() == 2) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //故障时长加1分钟
+                            gzsc++;
+                        } else if (po.getPointValueInDouble() == 3) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //检修时长加1分钟
+                            jxsc++;
+
+                        } else if (po.getPointValueInDouble() == 4) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //限电停机时长加1分钟
+                            xdtjsc++;
+                        } else if (po.getPointValueInDouble() == 5) {
+                            if (lastState != po.getPointValueInDouble()) {
+
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+
+                            //受累时长加1分钟
+                            slsc++;
+
+                        } else if (po.getPointValueInDouble() == 6) {
+                            if (lastState != po.getPointValueInDouble()) {
+                                //将当前状态保存到上一分钟状态
+                                lastState = po.getPointValueInDouble();
+
+                            }
+                            //通讯中断时长加1分钟
+                            txzdsc++;
+                        }
+
+                    }
+
+                }
+
+
+            }
+
+
+            //15分钟合计待机小时
+            pewp.setFdjxs(new BigDecimal(gzsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计维护停机小时
+            pewp.setFjxtjxs(new BigDecimal(jxsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            // 15分钟合计待机小时
+            pewp.setFdjxs(new BigDecimal(djsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计运行小时
+            pewp.setFyxxs(new BigDecimal(zcfdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计限电小时
+            pewp.setFxdxs(new BigDecimal(xdtjsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计通讯中断小时
+            pewp.setFtxzdxs(new BigDecimal(txzdsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+            //15分钟合计受累小时
+            pewp.setFslxs(new BigDecimal(slsc).divide(new BigDecimal(60), 2, RoundingMode.HALF_EVEN).doubleValue());
+
+
+            /*******************************************15分钟信息统计*********************************************************/
+        }
+
+
+}
+
+
+
+
+
+
+

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

@@ -61,7 +61,7 @@ public class EquipmentInfo1Service {
         }
         for(ProBasicWindturbine wt:CacheContext.wtls)
         {
-            if(CacheContext.wppointmap.containsKey(wt.getId()))
+            if(CacheContext.wtpAimap.containsKey(wt.getId()))
             {
                 Map<String, ProBasicEquipmentPoint> pointmap=CacheContext.wtpAimap.get(wt.getId());
 

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

@@ -59,7 +59,7 @@ public class EquipmentInfo2Service {
         }
         for(ProBasicWindturbine wt:CacheContext.wtls)
         {
-            if(CacheContext.wppointmap.containsKey(wt.getId()))
+            if(CacheContext.wtpAimap.containsKey(wt.getId()))
             {
 
 
@@ -85,7 +85,7 @@ public class EquipmentInfo2Service {
                             .collect(Collectors.toList());
                 }
                 calDetiall( pewp, end, begin, wt,pepidls);
-
+                calSimple( pewp, end, begin, wt,pepidls);
                 proEconEquipmentInfoDay2Service.save(pewp);
 
             }

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

@@ -61,7 +61,7 @@ public class EquipmentInfo3Service {
         }
         for(ProBasicWindturbine wt:CacheContext.wtls)
         {
-            if(CacheContext.wppointmap.containsKey(wt.getId()))
+            if(CacheContext.wtpAimap.containsKey(wt.getId()))
             {
 
 
@@ -88,7 +88,7 @@ public class EquipmentInfo3Service {
                             .collect(Collectors.toList());
                 }
                 calDetiall( pewp, end, begin,wt,pepidls);
-
+                calSimple( pewp, end, begin, wt,pepidls);
                 proEconEquipmentInfoDay3Service.save(pewp);
 
             }

+ 267 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java

@@ -0,0 +1,267 @@
+package com.gyee.generation.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.FitClassVo;
+import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.StringUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class GoodnessOfFitService {
+
+
+        private static final Logger logger = LoggerFactory.getLogger(GoodnessOfFitService.class);
+        @Resource
+        private IEdosUtil edosUtil;
+
+        @Resource
+       private IProEconActivePowerDataService proEconActivePowerDataService;
+
+        @Resource
+        private IProEconWtCurveFittingMonthService proEconWtCurveFittingMonthService;
+
+
+
+    public Map<String,Map<String,Double>> goodnessOfFit(Date nowDate)
+    {
+        Date current = DateUtils.addDays(nowDate,-1);
+        Date startDate = current;
+        Date endDate =new Date();
+
+
+        Calendar c= Calendar.getInstance();
+        c.setTime(startDate);
+        String  year =String.valueOf(c.get(Calendar.YEAR));
+        String month = String.valueOf(c.get(Calendar.MONTH)+1);
+
+        c.setTime(nowDate);
+
+        c.set(Calendar.DAY_OF_MONTH,1);
+        Date startDateM = c.getTime();
+        c.set(Calendar.MONTH,0);
+        Date startDateY = c.getTime();
+
+        Map<String,Map<String,Double>> resultmap =new HashMap<>();
+
+        Map<String, FitClassVo> theMapY = new HashMap<String, FitClassVo>();
+        Map<String, FitClassVo> theMapM = new HashMap<String, FitClassVo>();
+        Map<String, FitClassVo> theMapD = new HashMap<String, FitClassVo>();
+        List<FitClassVo> theList = new ArrayList<FitClassVo>();
+
+
+            List<ProEconWtCurveFittingMonth> powerList = null;
+
+
+            powerList = proEconWtCurveFittingMonthService.list().stream().filter(i->i.getMonth().equals(month)
+                && i.getYear().equals(year)).collect(Collectors.toList());
+
+
+            for (ProBasicWindpowerstation wp : CacheContext.wpls)
+            {
+
+                List<FitClassVo> fitsD=  proEconActivePowerDataService.getFitList(wp.getId(),startDate,endDate);
+                List<FitClassVo> fitsM=  proEconActivePowerDataService.getFitList(wp.getId(),startDateM,endDate);
+                List<FitClassVo> fitsY=  proEconActivePowerDataService.getFitList(wp.getId(),startDateY,endDate);
+
+                buildList(theMapY, theList, wp.getId(), fitsY, powerList);
+                buildList(theMapM, theList, wp.getId(), fitsM, powerList);
+                buildList(theMapD, theList, wp.getId(), fitsD, powerList);
+
+
+                theMapD.forEach((key,value)->{
+                    if(resultmap.containsKey(key))
+                    {
+                        Map<String,Double> tempmap=resultmap.get(key);
+                        tempmap.put("day",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }else
+                    {
+                        Map<String,Double> tempmap=new HashMap<>();
+                        tempmap.put("day",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }
+
+                });
+
+                theMapM.forEach((key,value)->{
+                    if(resultmap.containsKey(key))
+                    {
+                        Map<String,Double> tempmap=resultmap.get(key);
+                        tempmap.put("month",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }else
+                    {
+                        Map<String,Double> tempmap=new HashMap<>();
+                        tempmap.put("month",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }
+
+                });
+
+                theMapY.forEach((key,value)->{
+                    if(resultmap.containsKey(key))
+                    {
+                        Map<String,Double> tempmap=resultmap.get(key);
+                        tempmap.put("year",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }else
+                    {
+                        Map<String,Double> tempmap=new HashMap<>();
+                        tempmap.put("year",value.getPower() > 1 ? 1 : value.getPower());
+                        resultmap.put(key,tempmap);
+                    }
+
+                });
+            }
+
+
+//
+//            for (FitClassVo item : theList)
+//            {
+//                Double rnew = 0.0;
+//                Double speed = 0.0;
+//
+//                if (item.getEpower() != 0)
+//                {
+//                    rnew = (Double)Math.sqrt((double)(item.getPower() / item.getEpower()));
+//                }
+//                if (item.getNumber() != 0)
+//                {
+//                    speed = item.getSpeed() / item.getNumber();
+//                }
+//                item.setSpeed(speed);
+//                item.setPower(rnew);
+//
+//            }
+
+        return resultmap;
+    }
+
+
+
+    private void buildList(Map<String, FitClassVo> theMap, List<FitClassVo> theList, String windpowerstationId, List<FitClassVo> fitsY, List<ProEconWtCurveFittingMonth> powerList)
+    {
+
+
+
+        for (FitClassVo item : fitsY)
+        {
+            Double speed = 0.0;
+            if (windpowerstationId.contains("GDC"))
+            {
+                speed = item.getSpeed();
+                speed /= 100;
+
+                speed = StringUtils.round(speed, 1);
+                speed *= 100;
+
+                speed = speed;
+            }
+            else
+            {
+                speed = StringUtils.round(item.getSpeed(), 1);
+            }
+            String windturbineId = item.getWindturbineId();
+            if (CacheContext.modelpowermap.containsKey(item.getModelId()))
+            {
+                if (CacheContext.modelpowermap.get(item.getModelId()).size() > 0)
+                {
+
+
+                    if (CacheContext.modelpowermap.get(item.getModelId()).containsKey(speed))
+                    {
+                        Double epower = CacheContext.modelpowermap.get(item.getModelId()).get(speed).getEnsurePower();
+
+
+                        buildtheMap(theMap, theList, windpowerstationId, item, speed, epower);
+
+
+                    }
+                }
+                else
+                {
+                    if (powerList != null && powerList.size()>0)
+                    {
+                        Double finalSpeed = speed;
+                        OptionalDouble tempp=powerList.stream().filter(i-> i.getSpeed()== finalSpeed &&  i.getWindturbineId().equals(windturbineId)).mapToDouble(x->x.getOptimalPower()).findFirst();
+                        Double  p =0.0;
+
+                        if (tempp.isPresent())
+                        {
+                            Double epower = tempp.getAsDouble();
+
+                            buildtheMap(theMap, theList, windpowerstationId, item, speed, epower);
+                        }
+                        else
+                        {
+                            DoubleSummaryStatistics summaryStatistics=powerList.stream().mapToDouble(ProEconWtCurveFittingMonth::getSpeed).summaryStatistics();
+
+                            Double max = summaryStatistics.getMax();
+                            if (speed > max)
+                            {
+                                summaryStatistics=powerList.stream().mapToDouble(ProEconWtCurveFittingMonth::getActualPower).summaryStatistics();
+                                p = summaryStatistics.getMax();
+
+                                if (p != null)
+                                {
+                                    Double epower = p.doubleValue();
+
+                                    buildtheMap(theMap, theList, windpowerstationId, item, speed, epower);
+                                }
+                            }
+
+                        }
+
+                    }
+                }
+
+            }
+        }
+    }
+
+    private static void buildtheMap(Map<String, FitClassVo> theMap, List<FitClassVo> theList, String windpowerstationId, FitClassVo item, Double speed, Double epower)
+    {
+        Double value1 = item.getPower() - epower;
+        value1 *= value1;
+        Double value2 = item.getPower();
+        value2 *= value2;
+
+
+
+        if (theMap.containsKey(item.getWindturbineId()))
+        {
+            FitClassVo vo= theMap.get(item.getWindturbineId());
+            int number=vo.getNumber();
+            vo.setSpeed(item.getSpeed()+speed);
+            vo.setPower(item.getPower()+value1);
+            vo.setEpower(item.getEpower()+value2);
+            vo.setNumber(number++);
+            theMap.put(item.getWindturbineId(),vo);
+        }
+        else
+        {
+            FitClassVo fit = new FitClassVo();
+            fit.setWindturbineId(item.getWindturbineId());
+            fit.setWindpowerstationId(windpowerstationId);
+            fit.setModelId(item.getModelId());
+            fit.setSpeed(speed);
+            fit.setPower(value1);
+            fit.setEpower(value2);
+            fit.setNumber(1);
+            theList.add(fit);
+            theMap.put(item.getWindturbineId(), fit);
+        }
+    }
+
+}
+

+ 26 - 26
realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
 import com.gyee.generation.service.auto.IProEconInOrOutSpeedTotal2Service;
@@ -73,34 +74,41 @@ public class InputOrOutPutService {
                         {
                             total2=total2o.get();
                         }
-                        if (total1 == null)
+                        if (total1 != null)
                         {
-                            total1 = new ProEconInOrOutSpeedTotal();
-                            total1.setWindturbineId(wt.getId());
-                            total1.setWindpowerstationId(wt.getWindpowerstationId());
-                            total1.setProjectId(wt.getProjectId());
-                            total1.setLineId(wt.getLineId());
-                            total1.setRecordDate(daybegin);
-
-                            proEconInOrOutSpeedTotalService.save(total1);
+
+                            QueryWrapper<ProEconInOrOutSpeedTotal> wrapper = new QueryWrapper<>();
+                            wrapper.eq("id",total1.getId());
+                            proEconInOrOutSpeedTotalService.remove(wrapper);
+
                         }
-                        if (total2 == null)
+                        if (total2 != null)
                         {
+                            QueryWrapper<ProEconInOrOutSpeedTotal2> wrapper = new QueryWrapper<>();
+                            wrapper.eq("id",total2.getId());
+                            proEconInOrOutSpeedTotal2Service.remove(wrapper);
 
-                            total2 = new ProEconInOrOutSpeedTotal2();
-                            total2.setWindturbineId(wt.getId());
-                            total2.setWindpowerstationId(wt.getWindpowerstationId());
-                            total2.setProjectId(wt.getProjectId());
-                            total2.setLineId(wt.getLineId());
-                            total2.setRecordDate(daybegin);
-                            proEconInOrOutSpeedTotal2Service.save(total2);
                         }
 
+                        total1 = new ProEconInOrOutSpeedTotal();
+                        total1.setWindturbineId(wt.getId());
+                        total1.setWindpowerstationId(wt.getWindpowerstationId());
+                        total1.setProjectId(wt.getProjectId());
+                        total1.setLineId(wt.getLineId());
+                        total1.setRecordDate(daybegin);
 
+                        total2 = new ProEconInOrOutSpeedTotal2();
+                        total2.setWindturbineId(wt.getId());
+                        total2.setWindpowerstationId(wt.getWindpowerstationId());
+                        total2.setProjectId(wt.getProjectId());
+                        total2.setLineId(wt.getLineId());
+                        total2.setRecordDate(daybegin);
 
-                        newMethod(end, daybegin, monthbegin, yearbegin,  wt.getId(), total1, total2);
 
+                        newMethod(end, daybegin, monthbegin, yearbegin,  wt.getId(), total1, total2);
 
+                        proEconInOrOutSpeedTotalService.save(total1);
+                        proEconInOrOutSpeedTotal2Service.save(total2);
                     }
             
                 }
@@ -154,14 +162,6 @@ public class InputOrOutPutService {
         
 
 
-
-        //total1.INPUTSMALLRATIO = items.Where(it => it.DAYINPUTSMALL > 0 && it.DAYINPUTSMALL != null).Average(it => it.DAYINPUTSMALL);
-        //total1.INPUTBIGRATIO = items.Where(it => it.DAYINPUTSMALL > 0 && it.DAYINPUTSMALL != null).Average(it => it.DAYINPUTSMALL);
-        //total1.OUTPUTSMALLRATIO = items.Where(it => it.DAYINPUTSMALL > 0 && it.DAYINPUTSMALL != null).Average(it => it.DAYINPUTSMALL);
-        //total1.OUTPUTBIGMAXRATIO = items.Where(it => it.DAYINPUTSMALL > 0 && it.DAYINPUTSMALL != null).Average(it => it.DAYINPUTSMALL);
-
-
-
         Integer count = 0;
         
         List<ProEconInputOrOutputSpeed> recordList =proEconInputOrOutputSpeedService.list().stream()

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

@@ -122,7 +122,7 @@ public class LimitEventService {
         Map<String, Map<String, ProBasicWppoint>> wppointmap = CacheContext.wppointmap;
         CacheContext.wpls.forEach(wp -> {
             Map<String, ProBasicWppoint> wppmap = wppointmap.get(wp.getId());
-            if (wp.getId().indexOf("FDC")>=0) {
+            if (wp.getId().contains("FDC")) {
 
                 if (wppmap.containsKey(ContantXk.SBZT)) {
                     ProBasicWppoint point = wppmap.get(ContantXk.SBZT);
@@ -154,7 +154,7 @@ public class LimitEventService {
         List<ProBasicWindturbine> wtls = CacheContext.wtls;
         Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
         wtls.stream().forEach(wt -> {
-            if (wt.getWindpowerstationId().indexOf("FDC")>=0) {
+            if (wt.getWindpowerstationId().contains("FDC")) {
                 //风机状态
                 Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                 if (windturbinetestingpointnewMap.containsKey(ContantXk.SBZT)) {

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

@@ -320,7 +320,7 @@ public  class LimitService {
         Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap=CacheContext.wtpAimap;
         Map<String, ProEconLineElectrical> electrical = proEconLineElectricalService.list().stream().collect(Collectors.toMap(ProEconLineElectrical::getLineId, Function.identity()));
         wtls.stream().forEach(wt->{
-            if(wt.getWindpowerstationId().indexOf("FDC")>=0)
+            if(wt.getWindpowerstationId().contains("FDC"))
             {
                 Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                 if(windturbinetestingpointnewMap.containsKey(ContantXk.GPZT))
@@ -534,7 +534,7 @@ public  class LimitService {
             Map<String,Map<String, ProBasicWppoint>> wppointmap =CacheContext.wppointmap;
             CacheContext.wpls.forEach(wp->{
             Map<String, ProBasicWppoint> wppMap = wppointmap.get(wp.getId());
-            if(wp.getId().indexOf("FDC")>=0)
+            if(wp.getId().contains("FDC"))
             {
                 if(wppMap.containsKey(ContantXk.TPOINT_WP_AGC))
                 {
@@ -586,7 +586,7 @@ public  class LimitService {
                 //风机转速限值1.5MV && 有功控制给定值2MV
 
             wtls.stream().forEach(wt->{
-                if(wt.getWindpowerstationId().indexOf("FDC")>=0)
+                if(wt.getWindpowerstationId().contains("FDC"))
                 {
                     Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                     if(windturbinetestingpointnewMap.containsKey(ContantXk.XDZT))

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 462 - 669
realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingService.java


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

@@ -531,7 +531,7 @@ public class ShutdownService {
         List<PointData> speedDataList1;
         String type1;
 
-        if (windTurbines.get(status.getWindturbineId()).getWindpowerstationId().indexOf("GDC") >= 0)
+        if (windTurbines.get(status.getWindturbineId()).getWindpowerstationId().contains("GDC"))
         {
             String point=gzdpointMap.get(windTurbines.get(status.getWindturbineId()).getWindpowerstationId()).getNemCode();
             speedDataList1 =edosUtil.getHistoryDatasSnap(point,status.getStopTime().getTime()/1000,status.getStartTime().getTime()/1000);

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

@@ -195,7 +195,7 @@ public class WindPowerInfo1Service {
                     List<ProEconPowerstationInfoDay1> gfls=map.get("fd");
                     List<ProEconPowerstationInfoDay1> fdls=map.get("gf");
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {
@@ -210,7 +210,7 @@ public class WindPowerInfo1Service {
                     List<ProEconPowerstationInfoDay1> gfls=new ArrayList<>();
                     List<ProEconPowerstationInfoDay1> fdls=new ArrayList<>();
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {

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

@@ -195,7 +195,7 @@ public class WindPowerInfo2Service {
                     List<ProEconPowerstationInfoDay2> gfls=map.get("fd");
                     List<ProEconPowerstationInfoDay2> fdls=map.get("gf");
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {
@@ -210,7 +210,7 @@ public class WindPowerInfo2Service {
                     List<ProEconPowerstationInfoDay2> gfls=new ArrayList<>();
                     List<ProEconPowerstationInfoDay2> fdls=new ArrayList<>();
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {
@@ -455,6 +455,8 @@ public class WindPowerInfo2Service {
                         .collect(Collectors.toList());
                 }
                 calDetiall(pewp, end, begin, CacheContext.wpwtmap.get(wp.getId()), pepidls);
+
+                calSimple( pewp, end, begin, CacheContext.wpwtmap.get(wp.getId()),pepidls);
 /*******************************************年信息统计*********************************************************/
 //                wpinfodayls.add(pewp);
                 proEconPowerstationInfoDay2Service.save(pewp);
@@ -519,7 +521,7 @@ public class WindPowerInfo2Service {
                             .collect(Collectors.toList());
                 }
                 calDetiall(pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()), pepidls);
-
+                calSimple( pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()),pepidls);
 
                 proEconPowerstationInfoDay2Service.save(pewp);
 
@@ -582,7 +584,7 @@ public class WindPowerInfo2Service {
                             .collect(Collectors.toList());
                 }
                 calDetiall( pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()),pepidls);
-
+                calSimple( pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()),pepidls);
                 proEconPowerstationInfoDay2Service.save(pewp);
 
             }

+ 5 - 4
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java

@@ -195,7 +195,7 @@ public class WindPowerInfo3Service {
                     List<ProEconPowerstationInfoDay3> gfls=map.get("fd");
                     List<ProEconPowerstationInfoDay3> fdls=map.get("gf");
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {
@@ -210,7 +210,7 @@ public class WindPowerInfo3Service {
                     List<ProEconPowerstationInfoDay3> gfls=new ArrayList<>();
                     List<ProEconPowerstationInfoDay3> fdls=new ArrayList<>();
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {
@@ -455,6 +455,7 @@ public class WindPowerInfo3Service {
                             .collect(Collectors.toList());
                 }
                 calDetiall(pewp, end, begin, CacheContext.wpwtmap.get(wp.getId()), pepidls);
+                calSimple(pewp, end, begin, CacheContext.wpwtmap.get(wp.getId()), pepidls);
 /*******************************************年信息统计*********************************************************/
 //                wpinfodayls.add(pewp);
                 proEconPowerstationInfoDay3Service.save(pewp);
@@ -520,7 +521,7 @@ public class WindPowerInfo3Service {
                 }
                 calDetiall(pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()), pepidls);
 
-
+                calSimple(pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()), pepidls);
                 proEconPowerstationInfoDay3Service.save(pewp);
 
             }
@@ -582,7 +583,7 @@ public class WindPowerInfo3Service {
                             .collect(Collectors.toList());
                 }
                 calDetiall( pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()),pepidls);
-
+                calSimple( pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()),pepidls);
                 proEconPowerstationInfoDay3Service.save(pewp);
 
             }

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

@@ -195,7 +195,7 @@ public class WindPowerInfo5Service {
                     List<ProEconPowerstationInfoDay5> gfls=map.get("fd");
                     List<ProEconPowerstationInfoDay5> fdls=map.get("gf");
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {
@@ -210,7 +210,7 @@ public class WindPowerInfo5Service {
                     List<ProEconPowerstationInfoDay5> gfls=new ArrayList<>();
                     List<ProEconPowerstationInfoDay5> fdls=new ArrayList<>();
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {

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

@@ -195,7 +195,7 @@ public class WindPowerInfo6Service {
                     List<ProEconPowerstationInfoDay6> gfls=map.get("fd");
                     List<ProEconPowerstationInfoDay6> fdls=map.get("gf");
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {
@@ -210,7 +210,7 @@ public class WindPowerInfo6Service {
                     List<ProEconPowerstationInfoDay6> gfls=new ArrayList<>();
                     List<ProEconPowerstationInfoDay6> fdls=new ArrayList<>();
 
-                    if(wpinfo.getWindpowerstationId().indexOf("FDC")>=0)
+                    if(wpinfo.getWindpowerstationId().contains("FDC"))
                     {
                         fdls.add(wpinfo);
                     }else {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 2759
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindpowerInfoDayService.java


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 2468
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindpowerInfoMonthService.java


+ 8 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconActivePowerDataService.java

@@ -1,7 +1,14 @@
 package com.gyee.generation.service.auto;
 
+import com.gyee.generation.mapper.auto.ProEconActivePowerDataMapper;
 import com.gyee.generation.model.auto.ProEconActivePowerData;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.generation.model.vo.FitClassVo;
+import org.apache.ibatis.annotations.Param;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +20,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IProEconActivePowerDataService extends IService<ProEconActivePowerData> {
 
+    public List<FitClassVo> getFitList(String windpowerstationId, Date beginDate, Date endDate);
 }

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

@@ -0,0 +1,16 @@
+package com.gyee.generation.service.auto;
+
+import com.gyee.generation.model.auto.ProEconEquipmentInfo15minute;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 电设备15分钟信息表 服务类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+public interface IProEconEquipmentInfo15minuteService extends IService<ProEconEquipmentInfo15minute> {
+
+}

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

@@ -2,10 +2,15 @@ package com.gyee.generation.service.auto.impl;
 
 import com.gyee.generation.model.auto.ProEconActivePowerData;
 import com.gyee.generation.mapper.auto.ProEconActivePowerDataMapper;
+import com.gyee.generation.model.vo.FitClassVo;
 import com.gyee.generation.service.auto.IProEconActivePowerDataService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
 /**
  * <p>
  * 动态功率数据 服务实现类
@@ -17,4 +22,13 @@ import org.springframework.stereotype.Service;
 @Service
 public class ProEconActivePowerDataServiceImpl extends ServiceImpl<ProEconActivePowerDataMapper, ProEconActivePowerData> implements IProEconActivePowerDataService {
 
+    @Resource
+    private ProEconActivePowerDataMapper proEconActivePowerDataMapper;
+
+
+
+    @Override
+    public List<FitClassVo> getFitList(String windpowerstationId, Date beginDate, Date endDate) {
+        return proEconActivePowerDataMapper.getFitList(windpowerstationId,beginDate, endDate);
+    }
 }

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

@@ -0,0 +1,20 @@
+package com.gyee.generation.service.auto.impl;
+
+import com.gyee.generation.model.auto.ProEconEquipmentInfo15minute;
+import com.gyee.generation.mapper.auto.ProEconEquipmentInfo15minuteMapper;
+import com.gyee.generation.service.auto.IProEconEquipmentInfo15minuteService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 电设备15分钟信息表 服务实现类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-04
+ */
+@Service
+public class ProEconEquipmentInfo15minuteServiceImpl extends ServiceImpl<ProEconEquipmentInfo15minuteMapper, ProEconEquipmentInfo15minute> implements IProEconEquipmentInfo15minuteService {
+
+}

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

@@ -2186,4 +2186,128 @@ public class Initial {
 
 
     }
+    public static void  initial(ProEconEquipmentInfo15minute pepd)
+    {
+        /**
+         * 15分钟故障小时(明细)
+         */
+        pepd.setFgzxsmx(0.0);
+
+        /**
+         * 15分钟场内受累故障小时(明细)
+         */
+        pepd.setFcnslgzxsmx(0.0);
+
+        /**
+         * 15分钟检修小时(明细)
+         */
+        pepd.setFjxxsmx(0.0);
+
+        /**
+         * 15分钟场内受累检修小时(明细)
+         */
+        pepd.setFcnsljxxsmx(0.0);
+
+        /**
+         * 15分钟待机小时(明细)
+         */
+        pepd.setFdjxsmx(0.0);
+
+        /**
+         * 15分钟缺陷降出力小时(明细)
+         */
+        pepd.setFqxjclxsmx(0.0);
+
+        /**
+         * 15分钟手动停机小时(明细)
+         */
+        pepd.setFsdtjxsmx(0.0);
+
+        /**
+         * 15分钟并网小时(明细)
+         */
+        pepd.setFbwxsmx(0.0);
+
+        /**
+         * 15分钟限电停机小时(明细)
+         */
+        pepd.setFxdtjxsmx(0.0);
+
+        /**
+         * 15分钟限电降出力小时(明细)
+         */
+        pepd.setFxdjclxsmx(0.0);
+
+        /**
+         * 15分钟场外受累电网小时(明细)
+         */
+        pepd.setFcwsldwxsmx(0.0);
+
+        /**
+         * 15分钟场外受累天气小时(明细)
+         */
+        pepd.setFcwsltqxsmx(0.0);
+
+        /**
+         * 15分钟离线小时(明细)
+         */
+        pepd.setFlxxsmx(0.0);
+
+        /**
+         * 15分钟通讯中断小时(明细)
+         */
+        pepd.setFtxzdxsmx(0.0);
+
+        /**
+         * 15分钟待机小时
+         */
+        pepd.setFdjxs(0.0);
+
+        /**
+         * 15分钟故障停机小时
+         */
+        pepd.setFgztjxs(0.0);
+
+        /**
+         * 15分钟通讯中断小时
+         */
+        pepd.setFtxzdxs(0.0);
+
+        /**
+         * 15分钟维护停机小时
+         */
+        pepd.setFjxtjxs(0.0);
+
+        /**
+         * 15分钟限电小时
+         */
+        pepd.setFxdxs(0.0);
+
+        /**
+         * 15分钟运行小时
+         */
+        pepd.setFyxxs(0.0);
+
+        /**
+         * 15分钟受累小时
+         */
+        pepd.setFslxs(0.0);
+
+        /**
+         * 15分钟平均风速
+         */
+        pepd.setFpjfs(0.0);
+
+        /**
+         * 15分钟平均功率
+         */
+        pepd.setFpjgl(0.0);
+
+        /**
+         * 15分钟发电量
+         */
+        pepd.setFfdl(0.0);
+
+    }
+
 }