소스 검색

pg数据统计接口修改

shilin 2 년 전
부모
커밋
b762c46169
23개의 변경된 파일2558개의 추가작업 그리고 565개의 파일을 삭제
  1. 19 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/CompanyType.java
  2. 18 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/CurveType.java
  3. 17 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/vo/WpType.java
  4. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ActivePowerService.java
  5. 2 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java
  6. 39 12
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java
  7. 3 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo4Service.java
  8. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo5Service.java
  9. 5 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java
  10. 7 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java
  11. 3 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitService.java
  12. 1732 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeGfService.java
  13. 43 35
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeService.java
  14. 57 31
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java
  15. 24 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo2Service.java
  16. 22 20
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java
  17. 22 20
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo4Service.java
  18. 22 20
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo5Service.java
  19. 23 21
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo6Service.java
  20. 5 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindturbineGoodnessService.java
  21. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WpwindDayInfoService.java
  22. 383 370
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WtwindDayInfoService.java
  23. 108 0
      realtime/generationXK-service/src/test/java/com/gyee/generation/CurveTest.java

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

@@ -0,0 +1,19 @@
+package com.gyee.generation.model.vo;
+
+public enum CompanyType {
+
+
+    qb("qb"),
+    fd("fd"),
+    gf("gf");
+
+    public String id;
+    CompanyType(final  String c) {
+        id = c;
+    }
+
+    public String getValue()
+    {
+        return id;
+    }
+}

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

@@ -0,0 +1,18 @@
+package com.gyee.generation.model.vo;
+
+public enum CurveType {
+
+    dayCurve("dayCurve"),
+    monthCurve("monthCurve"),
+    yearCurve("yearCurve");
+
+    public String id;
+    CurveType(final  String c) {
+        id = c;
+    }
+
+    public String getValue()
+    {
+        return id;
+    }
+}

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

@@ -0,0 +1,17 @@
+package com.gyee.generation.model.vo;
+
+public enum WpType {
+
+    FDC("FDC"),
+    GDC("GDC");
+
+    public String id;
+    WpType(final  String c) {
+        id = c;
+    }
+
+    public String getValue()
+    {
+        return id;
+    }
+}

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

@@ -36,11 +36,11 @@ public class ActivePowerService {
         Date endDate=c.getTime();
         for (ProBasicPowerstation station : CacheContext.wpls) {
 
-            QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
+            QueryWrapper<ProEconEquipmentInfo15minute> queryWrapper = new QueryWrapper<>();
             queryWrapper.ge("record_date",beginDate)
                     .le("record_date",endDate)
                     .eq("windPowerStation_Id",station.getId());
-            List<ProEconEquipmentInfo15minute> ei15ls = proEconEquipmentInfo15minuteService.list();
+            List<ProEconEquipmentInfo15minute> ei15ls = proEconEquipmentInfo15minuteService.list(queryWrapper);
 //                    .stream()
 //                    .filter(i -> i.getWindpowerstationId().equals(station.getId())
 //                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))

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

@@ -6,6 +6,7 @@ import com.gyee.common.model.PointData;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
 import com.gyee.generation.model.vo.StatData;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconWtPowerCurveFittingService;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.StringUtils;
@@ -220,7 +221,7 @@ public class CoefficientService {
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
 
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         speed /= 100;
                         speed = StringUtils.round(speed, 2);
                         speed *= 100;

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

@@ -8,6 +8,7 @@ import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.ProBasicEquipment;
 import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
 import com.gyee.generation.model.auto.ProEconEquipmentInfoDay1;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
@@ -96,24 +97,50 @@ public class EquipmentInfo1Service {
     }
 
     private void extracted(Date recordDate, Date end, Date begin,Map<String, ProBasicEquipmentPoint> pointmap, ProEconEquipmentInfoDay1 pewp,List<ProEconEquipmentInfoDay1> pepid1ls) throws Exception {
-        //*******************************************日信息统计*********************************************************/
-        if(pointmap.containsKey(ContantXk.RPJFS))
+
+
+        if(pewp.getWindpowerstationId().contains(WpType.FDC.id))
         {
-            ProBasicEquipmentPoint point= pointmap.get(ContantXk.RPJFS);
-            List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
-            if(!pointls.isEmpty())
+            //*******************************************日信息统计*********************************************************/
+            if(pointmap.containsKey(ContantXk.RPJFS))
             {
-                DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
-                //日最大风速
-                pewp.setRzdfs(summaryStatistics.getMax());
-                //日最小风速
-                pewp.setRzxfs(summaryStatistics.getMin());
-                //日平均风速
-                pewp.setRpjfs(summaryStatistics.getAverage());
+                ProBasicEquipmentPoint point= pointmap.get(ContantXk.RPJFS);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //日最大风速
+                    pewp.setRzdfs(summaryStatistics.getMax());
+                    //日最小风速
+                    pewp.setRzxfs(summaryStatistics.getMin());
+                    //日平均风速
+                    pewp.setRpjfs(summaryStatistics.getAverage());
+                }
+
             }
+        }else
+        {
+            //*******************************************日信息统计*********************************************************/
+            if(pointmap.containsKey(ContantXk.RPJGZD))
+            {
+                ProBasicEquipmentPoint point= pointmap.get(ContantXk.RPJGZD);
+                List<PointData> pointls=edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime()/1000, end.getTime()/1000);
+                if(!pointls.isEmpty())
+                {
+                    DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //日最大风速
+                    pewp.setRzdfs(summaryStatistics.getMax());
+                    //日最小风速
+                    pewp.setRzxfs(summaryStatistics.getMin());
+                    //日平均风速
+                    pewp.setRpjfs(summaryStatistics.getAverage());
+                }
 
+            }
         }
 
+
+
         if(pointmap.containsKey(ContantXk.RPJGL))
         {
             ProBasicEquipmentPoint point= pointmap.get(ContantXk.RPJGL);

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

@@ -71,6 +71,8 @@ public class EquipmentInfo4Service {
 
         Date begin = DateUtils.truncate(c.getTime());
 
+        Date lastDay=DateUtils.addDays(begin,-1);
+
         //判断是否有重复记录,先删除重复记录
         QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("record_date",begin);
@@ -103,7 +105,7 @@ public class EquipmentInfo4Service {
         Map<String,ProEconWindturbineGoodness> wgmap=new HashMap<>();
 
         QueryWrapper<ProEconWindturbineGoodness> queryWrapper3 = new QueryWrapper<>();
-        queryWrapper3.eq("record_date",DateUtils.truncate(begin));
+        queryWrapper3.eq("record_date",lastDay);
 
         List<ProEconWindturbineGoodness> wgls = proEconWindturbineGoodnessService.list(queryWrapper3);
 //                .stream()

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

@@ -48,7 +48,7 @@ public class EquipmentInfo5Service {
                 .isNotNull("stop_Type_Id").isNotNull("stop_Hours").ne("stop_Type_Id","wh");
         List<ProEconShutdownEvent2> shutdownevents = proEconShutdownEvent2Service.list(queryWrapper);
 //                .stream().filter(i ->
-//                i.getWinpowerstationId().contains("FDC")
+//                i.getWinpowerstationId().contains(WpType.FDC.id)
 //                        && (i.getStopTime().compareTo(currentDate) == 0 || i.getStopTime().after(currentDate))
 //                        && (i.getStopTime().compareTo(endDate) == 0 || i.getStopTime().before(endDate))
 //                        && i.getStopTypeId() != null && i.getStopHours() != null

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

@@ -10,6 +10,7 @@ import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
 import com.gyee.generation.model.auto.ProEconWtCurveFittingMonth;
 import com.gyee.generation.model.vo.FitClassVo;
 import com.gyee.generation.model.vo.StatData;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconWtCurveFittingMonthService;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.StringUtils;
@@ -30,8 +31,10 @@ public class GoodnessOfFitService {
         private IProEconWtCurveFittingMonthService proEconWtCurveFittingMonthService;
 
     public Map<String,Map<String,Double>> goodnessOfFit(String wtId,Date nowDate) throws Exception {
+
+        Date endDate =DateUtils.truncate(nowDate);
         Date startDate = DateUtils.addDays(nowDate,-1);
-        Date endDate =new Date();
+
 
 
         Calendar c= Calendar.getInstance();
@@ -221,7 +224,7 @@ public class GoodnessOfFitService {
         for (FitClassVo item : fitsY)
         {
             Double speed;
-            if (windpowerstationId.contains("GDC"))
+            if (windpowerstationId.contains(WpType.GDC.id))
             {
                 speed = item.getSpeed();
                 speed /= 100;

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

@@ -5,6 +5,7 @@ import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconInOrOutSpeedTotal2Service;
 import com.gyee.generation.service.auto.IProEconInOrOutSpeedTotalService;
 import com.gyee.generation.service.auto.IProEconInputOrOutputSpeedService;
@@ -47,6 +48,10 @@ public class InputOrOutPutService {
         Date end = recordDate;
         for(ProBasicEquipment wt:CacheContext.wtls)
         {
+            if(wt.getWindpowerstationId().contains(WpType.GDC.id))
+            {
+                continue;
+            }
 
             Map<String, ProBasicEquipmentPoint> pointmap= CacheContext.wtpAimap.get(wt.getNemCode());
 
@@ -215,7 +220,7 @@ public class InputOrOutPutService {
                     total1.setRecordDate(daybegin);
                     total1.setCompanyId(wt.getCompanyId());
                     total1.setRegionId(wt.getRegionId());
-                    if(wt.getWindpowerstationId().contains("FDC"))
+                    if(wt.getWindpowerstationId().contains(WpType.FDC.id))
                     {
                         total1.setTypes("-1");
                     }else
@@ -230,7 +235,7 @@ public class InputOrOutPutService {
                     total2.setRecordDate(daybegin);
                     total2.setRegionId(wt.getRegionId());
                     total2.setCompanyId(wt.getCompanyId());
-                    if(wt.getWindpowerstationId().contains("FDC"))
+                    if(wt.getWindpowerstationId().contains(WpType.FDC.id))
                     {
                         total2.setTypes("-1");
                     }else

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

@@ -7,6 +7,7 @@ import com.gyee.generation.model.auto.ProBasicEquipment;
 import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
 import com.gyee.generation.model.auto.ProBasicPowerstationPoint;
 import com.gyee.generation.model.vo.StatData;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.StringUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
@@ -63,7 +64,7 @@ public  class LimitService {
             Map<String,Map<String, ProBasicPowerstationPoint>> wppointmap =CacheContext.wppointmap;
             CacheContext.wpls.forEach(wp->{
             Map<String, ProBasicPowerstationPoint> wppMap = wppointmap.get(wp.getId());
-            if(wp.getId().contains("FDC"))
+            if(wp.getId().contains(WpType.FDC.id))
             {
                 if(wppMap.containsKey(ContantXk.TPOINT_WP_AGC))
                 {
@@ -115,7 +116,7 @@ public  class LimitService {
                 //风机转速限值1.5MV && 有功控制给定值2MV
 
             wtls.stream().forEach(wt->{
-                if(wt.getWindpowerstationId().contains("FDC"))
+                if(wt.getWindpowerstationId().contains(WpType.FDC.id))
                 {
                     Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                     if(windturbinetestingpointnewMap.containsKey(ContantXk.XDZT))

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1732 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeGfService.java


+ 43 - 35
realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeService.java

@@ -1,22 +1,23 @@
 package com.gyee.generation.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
-import com.gyee.generation.model.vo.CureFittingVo;
-import com.gyee.generation.model.vo.PointVo;
-import com.gyee.generation.model.vo.PointfVo;
+import com.gyee.generation.model.vo.*;
 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 com.gyee.generation.util.realtimesource.math.LineUtil;
+import com.gyee.generation.util.redis.RedisService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+
 import javax.annotation.Resource;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -36,6 +37,9 @@ public class PowerCurveFittingByTimeService {
     private String initialcode;
     public Map<String, Double> windturbineCapacity;
 
+
+    @Resource
+    private RedisService redisService;
     @Resource
     private IProEconWtCurveFittingMonthService proEconWtCurveFittingMonthService;
 
@@ -90,33 +94,31 @@ public class PowerCurveFittingByTimeService {
         for (ProBasicEquipment wt : CacheContext.wtls) {
             String windturbineId = wt.getId();
 
+            if(wt.getWindpowerstationId().contains(WpType.GDC.id))
+            {
+                continue;
+            }
+
 
             Map<String, ProBasicEquipmentPoint> windturbinetestingpointnewMap = CacheContext.wtpAimap.get(wt.getId());
             //设备有功功率
-            String pointIdGL = windturbinetestingpointnewMap.get(ContantXk.CJ_SSGL).getNemCode();
+            String pointIdGL = null;
             //设备明细状态
-            String pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
-
-            String pointIdFS;
-            if (wt.getWindpowerstationId().contains("GDC")) {   //测风塔70米风速
-
-                if (windturbinetestingpointnewMap.containsKey(ContantXk.FCCFTFS70)) {
-                    ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.FCCFTFS70);
-
-                    if (StringUtils.notEmp(point.getNemCode()) && !point.getNemCode().equals(initialcode)) {
-                        pointIdFS = windturbinetestingpointnewMap.get(ContantXk.FCCFTFS70).getNemCode();
-                    } else {
-                        pointIdFS = windturbinetestingpointnewMap.get(ContantXk.CJ_SSFS).getNemCode();
-                    }
-                } else {
-                    pointIdFS = windturbinetestingpointnewMap.get(ContantXk.CJ_SSFS).getNemCode();
-                }
+            String pointIdZT =  null;
 
+            String pointIdFS = null;
+            if (windturbinetestingpointnewMap.containsKey(ContantXk.CJ_SSFS)) {
 
-            } else {   //设备风速
                 pointIdFS = windturbinetestingpointnewMap.get(ContantXk.CJ_SSFS).getNemCode();
             }
+            if (windturbinetestingpointnewMap.containsKey(ContantXk.CJ_SSGL)) {
 
+                pointIdGL = windturbinetestingpointnewMap.get(ContantXk.CJ_SSGL).getNemCode();
+            }
+            if (windturbinetestingpointnewMap.containsKey(ContantXk.MXZT)) {
+
+                pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
+            }
 
             CureFittingVo item = new CureFittingVo();
 
@@ -345,7 +347,7 @@ public class PowerCurveFittingByTimeService {
             String pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
 
             String pointIdFS;
-            if (wt.getWindpowerstationId().contains("GDC")) {   //测风塔70米风速
+            if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {   //测风塔70米风速
 
                 if (windturbinetestingpointnewMap.containsKey(ContantXk.FCCFTFS70)) {
                     ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.FCCFTFS70);
@@ -599,7 +601,7 @@ public class PowerCurveFittingByTimeService {
             String pointIdZT = windturbinetestingpointnewMap.get(ContantXk.MXZT).getNemCode();
 
             String pointIdFS;
-            if (wt.getWindpowerstationId().contains("GDC")) {   //测风塔70米风速
+            if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {   //测风塔70米风速
 
                 if (windturbinetestingpointnewMap.containsKey(ContantXk.FCCFTFS70)) {
                     ProBasicEquipmentPoint point = windturbinetestingpointnewMap.get(ContantXk.FCCFTFS70);
@@ -879,9 +881,9 @@ public class PowerCurveFittingByTimeService {
         String speedStr = String.valueOf(speed);
 
         //*********************************************当月曲线偏差子表记录**********************************************************/
-        QueryWrapper<ProEconCurveFittingSub> queryWrapper2 = new QueryWrapper<>();
+        QueryWrapper<ProEconCurveFittMonthSub> queryWrapper2 = new QueryWrapper<>();
         queryWrapper2.eq("year",stringyear).eq("month",stringmonth).eq("speed",speedStr).eq("windturbine_id",key);
-        Optional<ProEconCurveFittMonthSub> cfmsmontho = proEconCurveFittMonthSubService.list().stream()
+        Optional<ProEconCurveFittMonthSub> cfmsmontho = proEconCurveFittMonthSubService.list(queryWrapper2).stream()
 //                .filter(i -> i.getWindturbineId().equals(key)
 //                && i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth) && i.getSpeed().equals(speedStr))
                 .findFirst();
@@ -990,7 +992,7 @@ public class PowerCurveFittingByTimeService {
 
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         continue;
                         // item.SPEED = Double.Truncate(pointsF2[i].X);
                     } else {
@@ -1022,7 +1024,7 @@ public class PowerCurveFittingByTimeService {
 
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         continue;
                         //item.SPEED = Double.Truncate(pointsF2[i].X);
                     } else {
@@ -1053,6 +1055,8 @@ public class PowerCurveFittingByTimeService {
             //*********************************************当日曲线偏差记录**********************************************************/
         }
         proEconWtCurveFittingService.saveBatch(wtcfls);
+        String s = JSONObject.toJSONString(wtcfls);
+        redisService.set(CurveType.dayCurve.id+"_"+windturbineId, s);
 
     }
 
@@ -1075,7 +1079,7 @@ public class PowerCurveFittingByTimeService {
                 item.setWindturbineId(windturbineId);
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         continue;
                         // item.SPEED = Double.Truncate(pointsF1[i].X);
                     } else {
@@ -1101,7 +1105,7 @@ public class PowerCurveFittingByTimeService {
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
 
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         continue;
                         //item.SPEED = Double.Truncate(pointsF1[i].X);
                     } else {
@@ -1130,6 +1134,8 @@ public class PowerCurveFittingByTimeService {
         //*********************************************当月曲线偏差记录**********************************************************/
 
         proEconWtCurveFittingMonthService.saveBatch(wtcfls);
+        String s = JSONObject.toJSONString(wtcfls);
+        redisService.set(CurveType.monthCurve.id+"_"+windturbineId, s);
     }
 
     private void insertPoints(String year,  List<PointVo> sjglls, List<PointVo> zyglls, String windturbineId) {
@@ -1148,7 +1154,7 @@ public class PowerCurveFittingByTimeService {
                 item.setWindturbineId(windturbineId);
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         continue;
                         // item.SPEED = Double.Truncate(pointsF1[i].X);
                     } else {
@@ -1173,7 +1179,7 @@ public class PowerCurveFittingByTimeService {
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
 
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         continue;
                         //item.SPEED = Double.Truncate(pointsF1[i].X);
                     } else {
@@ -1201,6 +1207,8 @@ public class PowerCurveFittingByTimeService {
         //*********************************************当年曲线偏差记录**********************************************************/
 
         proEconWtCurveFittingYearService.saveBatch(wtcfls);
+        String s = JSONObject.toJSONString(wtcfls);
+        redisService.set(CurveType.yearCurve.id+"_"+windturbineId, s);
     }
     private void insertPoints2(List<PointVo> monthSjglls, List<PointVo> monthZyglls, String windturbineId) {
 
@@ -1226,7 +1234,7 @@ public class PowerCurveFittingByTimeService {
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
 
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         continue;
                         // item.SPEED = Double.Truncate(pointsF1[i].X);
                     } else {
@@ -1258,7 +1266,7 @@ public class PowerCurveFittingByTimeService {
                 if (CacheContext.wtmap.containsKey(windturbineId)) {
 
                     ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                    if (wt.getWindpowerstationId().contains("GDC")) {
+                    if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                         continue;
                         //item.SPEED = Double.Truncate(pointsF1[i].X);
                     } else {
@@ -1549,7 +1557,7 @@ public class PowerCurveFittingByTimeService {
                         if (CacheContext.wtmap.containsKey(windturbineId)) {
 
                             ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                            if (wt.getWindpowerstationId().contains("GDC")) {
+                            if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                                 b = (x >= 0 && y > 0);
                             } else {
                                 if (z == 2) {
@@ -1605,7 +1613,7 @@ public class PowerCurveFittingByTimeService {
                         if (CacheContext.wtmap.containsKey(windturbineId)) {
 
                             ProBasicEquipment wt = CacheContext.wtmap.get(windturbineId);
-                            if (wt.getWindpowerstationId().contains("GDC")) {
+                            if (wt.getWindpowerstationId().contains(WpType.GDC.id)) {
                                 b = (x >= 0 && y > 0);
                             } else {
                                 if (z == 2) {

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

@@ -6,7 +6,9 @@ import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.CompanyType;
 import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconPowerstationInfoDay1Service;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
@@ -50,9 +52,9 @@ public class WindPowerInfo1Service {
 
                 if (rgmap.containsKey(wpinfo.getRegionId())) {
                     Map<String, List<ProEconPowerstationInfoDay1>> map = rgmap.get(wpinfo.getRegionId());
-                    List<ProEconPowerstationInfoDay1> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay1> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay1> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay1> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay1> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay1> gfls = map.get(CompanyType.gf.id);
 
                     if (wpinfo.getForeignKeyId().contains("-1")) {
                         fdls.add(wpinfo);
@@ -77,9 +79,9 @@ public class WindPowerInfo1Service {
                         qbls.add(wpinfo);
                     }
 
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     rgmap.put(wpinfo.getRegionId(), map);
                 }
             }
@@ -103,9 +105,9 @@ public class WindPowerInfo1Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay1>>> entry : rgmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay1>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay1> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay1> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay1> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay1> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay1> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay1> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -182,11 +184,11 @@ public class WindPowerInfo1Service {
 
                 if (cpmap.containsKey(wpinfo.getCompanyId())) {
                     Map<String, List<ProEconPowerstationInfoDay1>> map = cpmap.get(wpinfo.getCompanyId());
-                    List<ProEconPowerstationInfoDay1> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay1> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay1> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay1> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay1> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay1> gfls = map.get(CompanyType.gf.id);
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
@@ -199,15 +201,15 @@ public class WindPowerInfo1Service {
                     List<ProEconPowerstationInfoDay1> gfls = new ArrayList<>();
                     List<ProEconPowerstationInfoDay1> fdls = new ArrayList<>();
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
                     }
                     qbls.add(wpinfo);
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     cpmap.put(wpinfo.getCompanyId(), map);
                 }
             }
@@ -229,9 +231,9 @@ public class WindPowerInfo1Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay1>>> entry : cpmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay1>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay1> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay1> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay1> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay1> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay1> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay1> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -784,22 +786,46 @@ public class WindPowerInfo1Service {
     }
 
     private void extracted(Date recordDate, Date end, Date begin, Map<String, ProBasicPowerstationPoint> pointmap, ProEconPowerstationInfoDay1 pewp, List<ProEconPowerstationInfoDay1> pepid1ls) throws Exception {
+
+
         //*******************************************日信息统计*********************************************************/
-        if (pointmap.containsKey(ContantXk.RPJFS)) {
-            ProBasicPowerstationPoint point = pointmap.get(ContantXk.RPJFS);
-            List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
-            if (!pointls.isEmpty()) {
-                DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
-                //日最大风速
-                pewp.setRzdfs(summaryStatistics.getMax());
-                //日最小风速
-                pewp.setRzxfs(summaryStatistics.getMin());
-                //日平均风速
-                pewp.setRpjfs(summaryStatistics.getAverage());
+
+        if(pewp.getWindpowerstationId().contains(WpType.FDC.id))
+        {
+            if (pointmap.containsKey(ContantXk.RPJFS)) {
+                ProBasicPowerstationPoint point = pointmap.get(ContantXk.RPJFS);
+                List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
+                if (!pointls.isEmpty()) {
+                    DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //日最大风速
+                    pewp.setRzdfs(summaryStatistics.getMax());
+                    //日最小风速
+                    pewp.setRzxfs(summaryStatistics.getMin());
+                    //日平均风速
+                    pewp.setRpjfs(summaryStatistics.getAverage());
+                }
+
             }
+        }else{
+
+            if (pointmap.containsKey(ContantXk.RPJGZD)) {
+                ProBasicPowerstationPoint point = pointmap.get(ContantXk.RPJGZD);
+                List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
+                if (!pointls.isEmpty()) {
+                    DoubleSummaryStatistics summaryStatistics = pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                    //日最大风速
+                    pewp.setRzdfs(summaryStatistics.getMax());
+                    //日最小风速
+                    pewp.setRzxfs(summaryStatistics.getMin());
+                    //日平均风速
+                    pewp.setRpjfs(summaryStatistics.getAverage());
+                }
 
+            }
         }
 
+
+
         if (pointmap.containsKey(ContantXk.RPJGL)) {
             ProBasicPowerstationPoint point = pointmap.get(ContantXk.RPJGL);
             List<PointData> pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);

+ 24 - 22
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo2Service.java

@@ -6,7 +6,9 @@ import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.CompanyType;
 import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconPowerstationInfoDay2Service;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
@@ -52,9 +54,9 @@ public class WindPowerInfo2Service {
 
                 if (rgmap.containsKey(wpinfo.getRegionId())) {
                     Map<String, List<ProEconPowerstationInfoDay2>> map = rgmap.get(wpinfo.getRegionId());
-                    List<ProEconPowerstationInfoDay2> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay2> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay2> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay2> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay2> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay2> gfls = map.get(CompanyType.gf.id);
 
                     if (wpinfo.getForeignKeyId().contains("-1")) {
                         fdls.add(wpinfo);
@@ -77,9 +79,9 @@ public class WindPowerInfo2Service {
                     } else if (wpinfo.getForeignKeyId().contains("0")) {
                         qbls.add(wpinfo);
                     }
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     rgmap.put(wpinfo.getRegionId(), map);
                 }
             }
@@ -102,9 +104,9 @@ public class WindPowerInfo2Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay2>>> entry : rgmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay2>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay2> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay2> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay2> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay2> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay2> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay2> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -181,11 +183,11 @@ public class WindPowerInfo2Service {
 
                 if (cpmap.containsKey(wpinfo.getCompanyId())) {
                     Map<String, List<ProEconPowerstationInfoDay2>> map = cpmap.get(wpinfo.getCompanyId());
-                    List<ProEconPowerstationInfoDay2> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay2> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay2> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay2> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay2> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay2> gfls = map.get(CompanyType.gf.id);
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
@@ -198,15 +200,15 @@ public class WindPowerInfo2Service {
                     List<ProEconPowerstationInfoDay2> gfls = new ArrayList<>();
                     List<ProEconPowerstationInfoDay2> fdls = new ArrayList<>();
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
                     }
                     qbls.add(wpinfo);
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     cpmap.put(wpinfo.getCompanyId(), map);
                 }
             }
@@ -229,9 +231,9 @@ public class WindPowerInfo2Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay2>>> entry : cpmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay2>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay2> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay2> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay2> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay2> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay2> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay2> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -518,11 +520,11 @@ public class WindPowerInfo2Service {
             //昨日的统计结果
             cl.add(Calendar.DAY_OF_MONTH, -1);
             if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper2 = new QueryWrapper<>();
+                QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper2 = new QueryWrapper<>();
                 queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
                         .eq("location",Location.pj.getValue())
                         .eq("project_id",pj.getId());
-                pepidls = proEconPowerstationInfoDay2Service.list();
+                pepidls = proEconPowerstationInfoDay2Service.list(queryWrapper2);
 //                        .stream()
 //                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
 //

+ 22 - 20
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java

@@ -6,7 +6,9 @@ import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.CompanyType;
 import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconPowerstationInfoDay3Service;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
@@ -50,9 +52,9 @@ public class WindPowerInfo3Service {
 
                 if (rgmap.containsKey(wpinfo.getRegionId())) {
                     Map<String, List<ProEconPowerstationInfoDay3>> map = rgmap.get(wpinfo.getRegionId());
-                    List<ProEconPowerstationInfoDay3> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay3> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay3> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay3> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay3> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay3> gfls = map.get(CompanyType.gf.id);
 
                     if (wpinfo.getForeignKeyId().contains("-1")) {
                         fdls.add(wpinfo);
@@ -75,9 +77,9 @@ public class WindPowerInfo3Service {
                     } else if (wpinfo.getForeignKeyId().contains("0")) {
                         qbls.add(wpinfo);
                     }
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     rgmap.put(wpinfo.getRegionId(), map);
                 }
             }
@@ -100,9 +102,9 @@ public class WindPowerInfo3Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay3>>> entry : rgmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay3>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay3> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay3> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay3> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay3> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay3> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay3> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -181,11 +183,11 @@ public class WindPowerInfo3Service {
 
                 if (cpmap.containsKey(wpinfo.getCompanyId())) {
                     Map<String, List<ProEconPowerstationInfoDay3>> map = cpmap.get(wpinfo.getCompanyId());
-                    List<ProEconPowerstationInfoDay3> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay3> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay3> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay3> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay3> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay3> gfls = map.get(CompanyType.gf.id);
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
@@ -198,15 +200,15 @@ public class WindPowerInfo3Service {
                     List<ProEconPowerstationInfoDay3> gfls = new ArrayList<>();
                     List<ProEconPowerstationInfoDay3> fdls = new ArrayList<>();
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
                     }
                     qbls.add(wpinfo);
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     cpmap.put(wpinfo.getCompanyId(), map);
                 }
             }
@@ -229,9 +231,9 @@ public class WindPowerInfo3Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay3>>> entry : cpmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay3>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay3> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay3> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay3> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay3> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay3> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay3> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 

+ 22 - 20
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo4Service.java

@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.model.StringUtils;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.CompanyType;
 import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.*;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.statisticcs.Initial;
@@ -58,9 +60,9 @@ public class WindPowerInfo4Service {
 
                 if (rgmap.containsKey(wpinfo.getRegionId())) {
                     Map<String, List<ProEconPowerstationInfoDay4>> map = rgmap.get(wpinfo.getRegionId());
-                    List<ProEconPowerstationInfoDay4> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay4> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay4> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay4> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay4> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay4> gfls = map.get(CompanyType.gf.id);
 
                     if (wpinfo.getForeignKeyId().contains("-1")) {
                         fdls.add(wpinfo);
@@ -83,9 +85,9 @@ public class WindPowerInfo4Service {
                     }else if (wpinfo.getForeignKeyId().contains("0")) {
                         qbls.add(wpinfo);
                     }
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     rgmap.put(wpinfo.getRegionId(), map);
                 }
             }
@@ -108,9 +110,9 @@ public class WindPowerInfo4Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay4>>> entry : rgmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay4>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay4> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay4> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay4> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay4> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay4> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay4> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -190,11 +192,11 @@ public class WindPowerInfo4Service {
 
                 if (cpmap.containsKey(wpinfo.getCompanyId())) {
                     Map<String, List<ProEconPowerstationInfoDay4>> map = cpmap.get(wpinfo.getCompanyId());
-                    List<ProEconPowerstationInfoDay4> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay4> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay4> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay4> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay4> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay4> gfls = map.get(CompanyType.gf.id);
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
@@ -207,15 +209,15 @@ public class WindPowerInfo4Service {
                     List<ProEconPowerstationInfoDay4> gfls = new ArrayList<>();
                     List<ProEconPowerstationInfoDay4> fdls = new ArrayList<>();
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
                     }
                     qbls.add(wpinfo);
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     cpmap.put(wpinfo.getCompanyId(), map);
                 }
             }
@@ -238,9 +240,9 @@ public class WindPowerInfo4Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay4>>> entry : cpmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay4>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay4> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay4> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay4> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay4> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay4> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay4> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 

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

@@ -6,7 +6,9 @@ import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.CompanyType;
 import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconPowerstationInfoDay5Service;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
@@ -50,9 +52,9 @@ public class WindPowerInfo5Service {
 
                 if (rgmap.containsKey(wpinfo.getRegionId())) {
                     Map<String, List<ProEconPowerstationInfoDay5>> map = rgmap.get(wpinfo.getRegionId());
-                    List<ProEconPowerstationInfoDay5> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay5> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay5> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay5> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay5> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay5> gfls = map.get(CompanyType.gf.id);
 
                     if (wpinfo.getForeignKeyId().contains("-1")) {
                         fdls.add(wpinfo);
@@ -76,9 +78,9 @@ public class WindPowerInfo5Service {
                     }else if (wpinfo.getForeignKeyId().contains("0")) {
                         qbls.add(wpinfo);
                     }
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     rgmap.put(wpinfo.getRegionId(), map);
                 }
             }
@@ -101,9 +103,9 @@ public class WindPowerInfo5Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay5>>> entry : rgmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay5>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay5> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay5> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay5> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay5> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay5> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay5> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -181,11 +183,11 @@ public class WindPowerInfo5Service {
 
                 if (cpmap.containsKey(wpinfo.getCompanyId())) {
                     Map<String, List<ProEconPowerstationInfoDay5>> map = cpmap.get(wpinfo.getCompanyId());
-                    List<ProEconPowerstationInfoDay5> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay5> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay5> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay5> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay5> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay5> gfls = map.get(CompanyType.gf.id);
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
@@ -198,15 +200,15 @@ public class WindPowerInfo5Service {
                     List<ProEconPowerstationInfoDay5> gfls = new ArrayList<>();
                     List<ProEconPowerstationInfoDay5> fdls = new ArrayList<>();
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
                     }
                     qbls.add(wpinfo);
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     cpmap.put(wpinfo.getCompanyId(), map);
                 }
             }
@@ -229,9 +231,9 @@ public class WindPowerInfo5Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay5>>> entry : cpmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay5>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay5> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay5> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay5> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay5> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay5> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay5> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 

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

@@ -5,7 +5,9 @@ import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.vo.CompanyType;
 import com.gyee.generation.model.vo.Location;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconPowerstationInfoDay6Service;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.StringUtils;
@@ -56,9 +58,9 @@ public class WindPowerInfo6Service {
 
                 if (rgmap.containsKey(wpinfo.getRegionId())) {
                     Map<String, List<ProEconPowerstationInfoDay6>> map = rgmap.get(wpinfo.getRegionId());
-                    List<ProEconPowerstationInfoDay6> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay6> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay6> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay6> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay6> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay6> gfls = map.get(CompanyType.gf.id);
 
                     if (wpinfo.getForeignKeyId().contains("-1")) {
                         fdls.add(wpinfo);
@@ -82,9 +84,9 @@ public class WindPowerInfo6Service {
                     }else if (wpinfo.getForeignKeyId().contains("0")) {
                         qbls.add(wpinfo);
                     }
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     rgmap.put(wpinfo.getRegionId(), map);
                 }
             }
@@ -107,9 +109,9 @@ public class WindPowerInfo6Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay6>>> entry : rgmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay6>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay6> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay6> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay6> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay6> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay6> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay6> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -186,11 +188,11 @@ public class WindPowerInfo6Service {
 
                 if (cpmap.containsKey(wpinfo.getCompanyId())) {
                     Map<String, List<ProEconPowerstationInfoDay6>> map = cpmap.get(wpinfo.getCompanyId());
-                    List<ProEconPowerstationInfoDay6> qbls = map.get("qb");
-                    List<ProEconPowerstationInfoDay6> fdls = map.get("fd");
-                    List<ProEconPowerstationInfoDay6> gfls = map.get("gf");
+                    List<ProEconPowerstationInfoDay6> qbls = map.get(CompanyType.qb.id);
+                    List<ProEconPowerstationInfoDay6> fdls = map.get(CompanyType.fd.id);
+                    List<ProEconPowerstationInfoDay6> gfls = map.get(CompanyType.gf.id);
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
@@ -203,15 +205,15 @@ public class WindPowerInfo6Service {
                     List<ProEconPowerstationInfoDay6> gfls = new ArrayList<>();
                     List<ProEconPowerstationInfoDay6> fdls = new ArrayList<>();
 
-                    if (wpinfo.getWindpowerstationId().contains("FDC")) {
+                    if (wpinfo.getWindpowerstationId().contains(WpType.FDC.id)) {
                         fdls.add(wpinfo);
                     } else {
                         gfls.add(wpinfo);
                     }
                     qbls.add(wpinfo);
-                    map.put("qb", qbls);
-                    map.put("fd", fdls);
-                    map.put("gf", gfls);
+                    map.put(CompanyType.qb.id, qbls);
+                    map.put(CompanyType.fd.id, fdls);
+                    map.put(CompanyType.gf.id, gfls);
                     cpmap.put(wpinfo.getCompanyId(), map);
                 }
             }
@@ -234,9 +236,9 @@ public class WindPowerInfo6Service {
             }
             for (Map.Entry<String, Map<String, List<ProEconPowerstationInfoDay6>>> entry : cpmap.entrySet()) {
                 Map<String, List<ProEconPowerstationInfoDay6>> map = entry.getValue();
-                List<ProEconPowerstationInfoDay6> qbls = map.get("qb");
-                List<ProEconPowerstationInfoDay6> fdls = map.get("fd");
-                List<ProEconPowerstationInfoDay6> gfls = map.get("gf");
+                List<ProEconPowerstationInfoDay6> qbls = map.get(CompanyType.qb.id);
+                List<ProEconPowerstationInfoDay6> fdls = map.get(CompanyType.fd.id);
+                List<ProEconPowerstationInfoDay6> gfls = map.get(CompanyType.gf.id);
 //                if(CacheContext.cpwpmap.size()==qbls.size())
 //                {
 
@@ -429,7 +431,7 @@ public class WindPowerInfo6Service {
                     queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
                             .eq("windPowerStation_Id",wp.getId())
                             .eq("location",Location.wp.getValue());
-                    pepid1ls = proEconPowerstationInfoDay6Service.list();
+                    pepid1ls = proEconPowerstationInfoDay6Service.list(queryWrapper2);
 //                            .stream()
 //                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
 //                                    && i.getLocation().equals(Location.wp.getValue())

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

@@ -6,6 +6,7 @@ import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.ProBasicEquipment;
 import com.gyee.generation.model.auto.ProEconEquipmentInfoDay1;
 import com.gyee.generation.model.auto.ProEconWindturbineGoodness;
+import com.gyee.generation.model.vo.WpType;
 import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
 import com.gyee.generation.service.auto.IProEconWindturbineGoodnessService;
 import com.gyee.generation.util.DateUtils;
@@ -57,7 +58,9 @@ public class WindturbineGoodnessService {
             Map<String, Map<String, Double>> coefficientMap=coefficientService.coefficient(wt.getId(),DateUtils.truncate(recordDate));
             Map<String, Map<String,Double>> fitMap=goodnessOfFitService.goodnessOfFit(wt.getId(),DateUtils.truncate(recordDate));
 
-          List<ProEconEquipmentInfoDay1> day1ls=  proEconEquipmentInfoDay1Service.list().stream().filter(i->
+            QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("windturbine_id",wt.getId());
+          List<ProEconEquipmentInfoDay1> day1ls=  proEconEquipmentInfoDay1Service.list(queryWrapper2).stream().filter(i->
                     i.getWindturbineId().equals(wt.getId())
             && i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
             ).collect(Collectors.toList());
@@ -69,7 +72,7 @@ public class WindturbineGoodnessService {
             po.setWindtpowerstationId(wt.getWindpowerstationId());
             po.setCompanyId(wt.getCompanyId());
             po.setRegionId(wt.getRegionId());
-            if(wt.getWindpowerstationId().contains("FDC"))
+            if(wt.getWindpowerstationId().contains(WpType.FDC.id))
             {
                 po.setTypes("-1");
             }else

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

@@ -76,7 +76,7 @@ public class WpwindDayInfoService {
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
                     QueryWrapper<ProEconWpwindDayInfo> queryWrapper2 = new QueryWrapper<>();
                     queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime())).eq("Weather_Id",ws.getId());
-                    pepid1ls = proEconWpwindDayInfoService.list();
+                    pepid1ls = proEconWpwindDayInfoService.list(queryWrapper2);
 //                            .stream()
 //                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
 //                                    && i.getWeatherId().equals(ws.getId())

+ 383 - 370
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WtwindDayInfoService.java

@@ -210,9 +210,33 @@ public class WtwindDayInfoService {
         double nwn_dayjfcs = 0.0;
         double nwn_dayfcs = 0.0;
 
+        List<PointData> fxpointls =new ArrayList<>();
+        List<PointData> fspointls =new ArrayList<>();
+
+        if(wt.getWindpowerstationId().contains(WpType.FDC.id))
+        {
+            if(pointmap.containsKey(ContantXk.CJ_FX) && pointmap.containsKey(ContantXk.RPJFS))
+            {
+                ProBasicEquipmentPoint fxpoint = pointmap.get(ContantXk.CJ_FX);
+                ProBasicEquipmentPoint fspoint = pointmap.get(ContantXk.RPJFS);
+                fxpointls = edosUtil.getHistoryDatasSnap(fxpoint.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
+
+
+                fspointls = edosUtil.getHistoryDatasSnap(fspoint.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
+            }
+
+        }else
+        {
+            if(pointmap.containsKey(ContantXk.CJ_FX) && pointmap.containsKey(ContantXk.RPJGZD))
+            {
+                ProBasicEquipmentPoint fxpoint = pointmap.get(ContantXk.CJ_FX);
+                ProBasicEquipmentPoint fspoint = pointmap.get(ContantXk.RPJGZD);
+                fxpointls = edosUtil.getHistoryDatasSnap(fxpoint.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
+
+                fspointls = edosUtil.getHistoryDatasSnap(fspoint.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
+            }
+        }
 
-        ProBasicEquipmentPoint fspoint = pointmap.get(ContantXk.RPJFS);
-        List<PointData> fspointls = edosUtil.getHistoryDatasSnap(fspoint.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
         if (!fspointls.isEmpty()) {
 
 //            //切入切出统计
@@ -235,509 +259,498 @@ public class WtwindDayInfoService {
 
             }
 
-//                //日静风次数
-//                pewp.setCa(dayjfcs);
-//                //日风次数
-//                pewp.setCh(dayfcs);
-//
-//                if (dayfcs != 0) {
-//                    pewp.setCb(BigDecimal.valueOf(dayjfcs).divide(new BigDecimal(dayfcs), 2, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue());
-//                }
         }
 
-        if (pointmap.containsKey(ContantXk.CJ_FX) && pointmap.containsKey(ContantXk.RPJFS)) {
-            ProBasicEquipmentPoint fxpoint = pointmap.get(ContantXk.CJ_FX);
-            List<PointData> fxpointls = edosUtil.getHistoryDatasSnap(fxpoint.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000);
 
-            if (!fxpointls.isEmpty() && !fspointls.isEmpty() && fxpointls.size() == fspointls.size()) {
 
 
-                for (int i = 0; i < fxpointls.size(); i++) {
-                    double fx = fxpointls.get(i).getPointValueInDouble();
+        if (!fxpointls.isEmpty() && !fspointls.isEmpty() && fxpointls.size() == fspointls.size()) {
 
-                    double lastfx = -1;
-                    for (PointData po : fxpointls) {
-                        if (lastfx != po.getPointValueInDouble()) {
-                            zfxcs++;
-                            lastfx=po.getPointValueInDouble();
-                        }
-                    }
-                    //北
-                    if ((fx >= 348.76 && fx <= 360) || (fx >= 0 && fx <= 11.25)) {
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
-
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
-
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        n_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
-
-                                    n_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    n_fxls.add(fxpointls.get(i).getPointValueInDouble());
-
-                                    n_dayfcs++;
-                                }
 
-                            }
+            for (int i = 0; i < fxpointls.size(); i++) {
+                double fx = fxpointls.get(i).getPointValueInDouble();
 
-                        }
+                double lastfx = -1;
+                for (PointData po : fxpointls) {
+                    if (lastfx != po.getPointValueInDouble()) {
+                        zfxcs++;
+                        lastfx=po.getPointValueInDouble();
                     }
-
-                    //北东北
-                    else if (fx >= 11.26 && fx <= 33.75) {
-
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
-
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
-
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        nen_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
-
-                                    nen_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    nen_fxls.add(fxpointls.get(i).getPointValueInDouble());
-
-                                    nen_dayfcs++;
+                }
+                //北
+                if ((fx >= 348.76 && fx <= 360) || (fx >= 0 && fx <= 11.25)) {
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    n_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                n_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                n_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                n_dayfcs++;
                             }
 
                         }
-                    }
-
-                    //东北
-                    else if (fx >= 33.76 && fx <= 56.25) {
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+                    }
+                }
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
+                //北东北
+                else if (fx >= 11.26 && fx <= 33.75) {
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        en_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                                    en_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    en_fxls.add(fxpointls.get(i).getPointValueInDouble());
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
 
-                                    en_dayfcs++;
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    nen_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                nen_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                nen_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                nen_dayfcs++;
                             }
 
                         }
-                    }
-                    //东东北
-                    else if (fx >= 56.26 && fx <= 78.75) {
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+                    }
+                }
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
+                //东北
+                else if (fx >= 33.76 && fx <= 56.25) {
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        een_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                                    een_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    een_fxls.add(fxpointls.get(i).getPointValueInDouble());
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
 
-                                    een_dayfcs++;
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    en_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                en_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                en_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                en_dayfcs++;
                             }
 
                         }
-                    }
-                    //东
-                    else if (fx >= 78.76 && fx <= 101.25) {
-
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
-
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
-
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        e_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
 
-                                    e_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    e_fxls.add(fxpointls.get(i).getPointValueInDouble());
-
-                                    e_dayfcs++;
+                    }
+                }
+                //东东北
+                else if (fx >= 56.26 && fx <= 78.75) {
+
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    een_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                een_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                een_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                een_dayfcs++;
                             }
 
                         }
-                    }
-                    //东东南
-                    else if (fx >= 101.26 && fx <= 123.75) {
-
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
-
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        ees_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
-
-                                    ees_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    ees_fxls.add(fxpointls.get(i).getPointValueInDouble());
-
-                                    ees_dayfcs++;
+                    }
+                }
+                //东
+                else if (fx >= 78.76 && fx <= 101.25) {
+
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    e_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                e_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                e_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                e_dayfcs++;
                             }
 
                         }
-                    }
-                    //东南
-                    else if (fx >= 123.76 && fx <= 146.25) {
-
-
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
-
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
-
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        es_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
-
-                                    es_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    es_fxls.add(fxpointls.get(i).getPointValueInDouble());
-
-                                    es_dayfcs++;
+                    }
+                }
+                //东东南
+                else if (fx >= 101.26 && fx <= 123.75) {
+
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    ees_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                ees_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                ees_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                ees_dayfcs++;
                             }
 
                         }
-                    }
-                    //南东南
-                    else if (fx >= 146.26 && fx <= 168.75) {
 
+                    }
+                }
+                //东南
+                else if (fx >= 123.76 && fx <= 146.25) {
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        ses_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                                    ses_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    ses_fxls.add(fxpointls.get(i).getPointValueInDouble());
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
 
-                                    ses_dayfcs++;
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    es_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                es_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                es_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                es_dayfcs++;
                             }
 
                         }
-                    }
-                    //南
-                    else if (fx >= 168.76 && fx <= 191.25) {
-
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+                    }
+                }
+                //南东南
+                else if (fx >= 146.26 && fx <= 168.75) {
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        s_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                                    s_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    s_fxls.add(fxpointls.get(i).getPointValueInDouble());
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
 
-                                    s_dayfcs++;
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    ses_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                ses_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                ses_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                ses_dayfcs++;
                             }
 
                         }
-                    }
-                    //南西南
-                    else if (fx >= 191.26 && fx <= 213.75) {
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+                    }
+                }
+                //南
+                else if (fx >= 168.76 && fx <= 191.25) {
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        sws_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                                    sws_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    sws_fxls.add(fxpointls.get(i).getPointValueInDouble());
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
 
-                                    sws_dayfcs++;
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    s_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                s_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                s_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                s_dayfcs++;
                             }
 
                         }
-                    }
-                    //西南
-                    else if (fx >= 213.76 && fx <= 236.25) {
-
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
-
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        ws_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
-
-                                    ws_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    ws_fxls.add(fxpointls.get(i).getPointValueInDouble());
-
-                                    ws_dayfcs++;
+                    }
+                }
+                //南西南
+                else if (fx >= 191.26 && fx <= 213.75) {
+
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    sws_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                sws_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                sws_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                sws_dayfcs++;
                             }
 
                         }
-                    }
-                    //西西南
-                    else if (fx >= 236.26 && fx <= 258.75) {
-
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
-
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        wws_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
-
-                                    wws_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    wws_fxls.add(fxpointls.get(i).getPointValueInDouble());
-
-                                    wws_dayfcs++;
+                    }
+                }
+                //西南
+                else if (fx >= 213.76 && fx <= 236.25) {
+
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    ws_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                ws_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                ws_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                ws_dayfcs++;
                             }
 
                         }
-                    }
-                    //西
-                    else if (fx >= 258.76 && fx <= 281.25) {
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
-
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
-
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        w_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
-
-                                    w_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    w_fxls.add(fxpointls.get(i).getPointValueInDouble());
-
-                                    w_dayfcs++;
+                    }
+                }
+                //西西南
+                else if (fx >= 236.26 && fx <= 258.75) {
+
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    wws_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                wws_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                wws_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                wws_dayfcs++;
                             }
 
                         }
-                    }
-                    //西西北
-                    else if (fx >= 281.26 && fx <= 303.75) {
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+                    }
+                }
+                //西
+                else if (fx >= 258.76 && fx <= 281.25) {
+
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    w_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
+                                }
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
+                                w_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                w_fxls.add(fxpointls.get(i).getPointValueInDouble());
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        wwn_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
+                                w_dayfcs++;
+                            }
 
-                                    wwn_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    wwn_fxls.add(fxpointls.get(i).getPointValueInDouble());
+                        }
 
-                                    wwn_dayfcs++;
+                    }
+                }
+                //西西北
+                else if (fx >= 281.26 && fx <= 303.75) {
+
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
+
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    wwn_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                wwn_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                wwn_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                wwn_dayfcs++;
                             }
 
                         }
-                    }
-                    //西北
-                    else if (fx >= 303.76 && fx <= 326.25) {
 
+                    }
+                }
+                //西北
+                else if (fx >= 303.76 && fx <= 326.25) {
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
-
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        wn_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                                    wn_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    wn_fxls.add(fxpointls.get(i).getPointValueInDouble());
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
 
-                                    wn_dayfcs++;
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    wn_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                wn_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                wn_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                wn_dayfcs++;
                             }
 
                         }
-                    }
-                    //北西北
-                    else if (fx >= 326.26 && fx <= 348.75) {
-
 
-                        if (!fspointls.isEmpty()) {
-                            //切入切出统计
-                            //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
+                    }
+                }
+                //北西北
+                else if (fx >= 326.26 && fx <= 348.75) {
 
-                            double lastvalue = -1;
-                            for (PointData po : fspointls) {
-                                //小风切入风速
-                               // double xfqr = peiost.getDayInputSmall();
 
-                                if (lastvalue != po.getPointValueInDouble()) {
-                                    //小于小风切入算静风次数累计
-                                    if (po.getPointValueInDouble() < 3.0) {
-                                        nwn_dayjfcs++;
-                                        lastvalue=po.getPointValueInDouble();
-                                    }
+                    if (!fspointls.isEmpty()) {
+                        //切入切出统计
+                        //ProEconInOrOutSpeedTotal peiost = peioomap.get(wt.getId());
 
-                                    nwn_fsls.add(fspointls.get(i).getPointValueInDouble());
-                                    nwn_fxls.add(fxpointls.get(i).getPointValueInDouble());
+                        double lastvalue = -1;
+                        for (PointData po : fspointls) {
+                            //小风切入风速
+                            // double xfqr = peiost.getDayInputSmall();
 
-                                    nwn_dayfcs++;
+                            if (lastvalue != po.getPointValueInDouble()) {
+                                //小于小风切入算静风次数累计
+                                if (po.getPointValueInDouble() < 3.0) {
+                                    nwn_dayjfcs++;
+                                    lastvalue=po.getPointValueInDouble();
                                 }
 
+                                nwn_fsls.add(fspointls.get(i).getPointValueInDouble());
+                                nwn_fxls.add(fxpointls.get(i).getPointValueInDouble());
+
+                                nwn_dayfcs++;
                             }
 
                         }
-                    }
 
+                    }
                 }
+
             }
         }
-
         //日静风次数
         pewp.setCa(dayjfcs);
         //日风次数

+ 108 - 0
realtime/generationXK-service/src/test/java/com/gyee/generation/CurveTest.java

@@ -0,0 +1,108 @@
+package com.gyee.generation;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.ProBasicEquipment;
+import com.gyee.generation.model.auto.ProEconWtCurveFitting;
+import com.gyee.generation.model.auto.ProEconWtCurveFittingMonth;
+import com.gyee.generation.model.auto.ProEconWtCurveFittingYear;
+import com.gyee.generation.model.vo.CurveType;
+import com.gyee.generation.service.auto.IProEconWtCurveFittingMonthService;
+import com.gyee.generation.service.auto.IProEconWtCurveFittingService;
+import com.gyee.generation.service.auto.IProEconWtCurveFittingYearService;
+import com.gyee.generation.util.DateUtils;
+import com.gyee.generation.util.redis.RedisService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+import java.util.Calendar;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+/**
+ * OpenCSV CSVReader Example, Read line by line
+ *
+ * @author pankaj
+ *
+ */
+@SpringBootTest
+@RunWith(SpringRunner.class)
+@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
+public class CurveTest {
+
+    @Resource
+    private RedisService redisService;
+    @Resource
+    private IProEconWtCurveFittingMonthService proEconWtCurveFittingMonthService;
+
+    @Resource
+    private IProEconWtCurveFittingYearService proEconWtCurveFittingYearService;
+    @Resource
+    private IProEconWtCurveFittingService proEconWtCurveFittingService;
+
+
+
+    @Test
+    public void csvTest() throws Exception {
+        Calendar c=Calendar.getInstance();
+
+        Date date = DateUtils.truncate(c.getTime());
+        for(ProBasicEquipment wt :CacheContext.wtls)
+        {
+            QueryWrapper<ProEconWtCurveFitting> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("record_date",date)
+                    .eq("windturbine_Id", wt.getId());
+
+            List<ProEconWtCurveFitting> dayls=proEconWtCurveFittingService.list(queryWrapper).stream()
+                    .sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
+
+            if(!dayls.isEmpty())
+            {
+                String s = JSONObject.toJSONString(dayls);
+                redisService.set(CurveType.dayCurve.id+"_"+wt.getId(), s);
+            }
+
+            QueryWrapper<ProEconWtCurveFittingMonth> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("year",String.valueOf(c.get(Calendar.YEAR)))
+                    .eq("month",String.valueOf(c.get(Calendar.MONTH)+1))
+                    .eq("windturbine_Id", wt.getId());
+
+            List<ProEconWtCurveFittingMonth> monthls=proEconWtCurveFittingMonthService.list(queryWrapper2).stream()
+                    .sorted(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed)).collect(Collectors.toList());
+
+            if(!monthls.isEmpty())
+            {
+                String s = JSONObject.toJSONString(monthls);
+                redisService.set(CurveType.monthCurve.id+"_"+wt.getId(), s);
+            }
+
+            QueryWrapper<ProEconWtCurveFittingYear>  queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.eq("year",String.valueOf(c.get(Calendar.YEAR)))
+                    .eq("windturbine_Id", wt.getId());
+
+            List<ProEconWtCurveFittingYear> yearls=proEconWtCurveFittingYearService.list(queryWrapper3).stream()
+                    .sorted(Comparator.comparing(ProEconWtCurveFittingYear::getSpeed)).collect(Collectors.toList());
+
+            if(!dayls.isEmpty())
+            {
+                String s = JSONObject.toJSONString(dayls);
+                redisService.set(CurveType.yearCurve.id+"_"+wt.getId(), s);
+            }
+        }
+//        electricityMeteringService.saveGenerationDatas();
+    }
+
+
+
+
+}