Преглед на файлове

修正接口数据过滤

shilin преди 2 години
родител
ревизия
98a4e399ec
променени са 33 файла, в които са добавени 4318 реда и са изтрити 1233 реда
  1. 38 19
      realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java
  2. 5 5
      realtime/generationXK-service/src/main/java/com/gyee/generation/config/GeneratorCodeConfig.java
  3. 17 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java
  4. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconCurveFittingMainMapper.java
  5. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconCurveFittingSubMapper.java
  6. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconWtCurveFittingMapper.java
  7. 2715 306
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWpwindDayInfo.java
  8. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWtwindDayInfo.java
  9. 16 11
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ActivePowerService.java
  10. 7 7
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java
  11. 10 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo15minuteService.java
  12. 13 12
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java
  13. 13 9
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java
  14. 14 9
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo3Service.java
  15. 231 127
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo4Service.java
  16. 21 11
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo5Service.java
  17. 87 55
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfoDayTopService.java
  18. 7 5
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java
  19. 56 34
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java
  20. 40 17
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventnewService.java
  21. 156 112
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeService.java
  22. 38 15
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownnewService.java
  23. 87 48
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java
  24. 89 49
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo2Service.java
  25. 90 51
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java
  26. 310 177
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo4Service.java
  27. 53 31
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo5Service.java
  28. 85 49
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo6Service.java
  29. 7 3
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindturbineGoodnessService.java
  30. 40 29
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WtAlysisDayService.java
  31. 49 15
      realtime/generationXK-service/src/main/resources/application-test.yml
  32. 19 17
      realtime/generationXK-service/src/main/resources/application-xk.yml
  33. 1 1
      realtime/generationXK-service/src/main/resources/application.yml

+ 38 - 19
realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java

@@ -1,7 +1,5 @@
 package com.gyee.generation;
 
-import com.gyee.generation.service.initalcache.CacheService;
-import com.gyee.generation.util.SpringUtils;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -37,11 +35,14 @@ public class GenerationMain {
 //        System.out.println("开始导出风场测点。。。。。。");
 //        initialPointGoldenXkByEqService.initalFc();
 //        System.out.println("结束导出风场测点。。。。。。");
-//        PowerCurveFittingByTimeService powerCurveFittingByTimeService= SpringUtils.getBean("powerCurveFittingByTimeService");
-//
-//        powerCurveFittingByTimeService.cureFittingDay(new Date());
+////        PowerCurveFittingByTimeService powerCurveFittingByTimeService= SpringUtils.getBean("powerCurveFittingByTimeService");
+//        Calendar c=Calendar.getInstance();
+//        c.set(Calendar.MONTH,7);
+//        c.set(Calendar.DAY_OF_MONTH,2);
+//        Date date =c.getTime();
+//        powerCurveFittingByTimeService.cureFittingDay(date);
 //        powerCurveFittingByTimeService.cureFittingMonth(new Date());
-//        powerCurveFittingByTimeService.cureFittingYear(new Date());
+//        powerCurveFittingByTimeService.cureFittingYear(date);
 //        CacheService cacheService= SpringUtils.getBean("cacheService");
 //        cacheService.initRedisCache();
 //        InputOrOutPutService inputOrOutPutService= SpringUtils.getBean("inputOrOutPutService");
@@ -54,10 +55,10 @@ public class GenerationMain {
 //        Date date =new Date();
 //
 //        Calendar c=Calendar.getInstance();
-//
-//        c.set(Calendar.DAY_OF_MONTH,20);
+//        c.set(Calendar.MONTH,10);
+//        c.set(Calendar.DAY_OF_MONTH,30);
 //        Date date =c.getTime();
-//        for(int i=0;i<5;i++)
+//        for(int i=0;i<2;i++)
 //        {
 //            WindPowerInfo1Service windPowerInfo1Service= SpringUtils.getBean("windPowerInfo1Service");
 //
@@ -113,15 +114,21 @@ public class GenerationMain {
 //        equipmentInfo4Service.calEquipmentInfoDay(date);
 //        EquipmentInfo5Service equipmentInfo5Service= SpringUtils.getBean("equipmentInfo5Service");
 //        equipmentInfo5Service.calEquipmentInfoDay(date);
+//
+//
+//        WtAlysisDayService wtAlysisDayService= SpringUtils.getBean("wtAlysisDayService");
+//        wtAlysisDayService.calEquipmentInfoDay(date);
 //            c.add(Calendar.DAY_OF_MONTH,1);
 //            date =c.getTime();
-//        }
 //
-
-//        EquipmentInfoDayTopService equipmentInfoDayTopService= SpringUtils.getBean("equipmentInfoDayTopService");
+//                    EquipmentInfoDayTopService equipmentInfoDayTopService= SpringUtils.getBean("equipmentInfoDayTopService");
 //        equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
 //        equipmentInfoDayTopService.calEquipmentInfoMonthTop(new Date());
 //        equipmentInfoDayTopService.calEquipmentInfoYearTop(new Date());
+//        }
+//
+
+
 
 //        Calendar c=Calendar.getInstance();
 //        c.set(Calendar.MONTH,7);
@@ -134,17 +141,29 @@ public class GenerationMain {
 //        System.out.println("执行用时"+ DateUtils.secondsDiff(date,end) +"秒");
 //        System.out.println("计算完成");
 //
-        CacheService cacheService= SpringUtils.getBean("cacheService");
-        cacheService.initRedisCache();
+//        CacheService cacheService= SpringUtils.getBean("cacheService");
+//        cacheService.initRedisCache();
 //
 //        PowerCurveFittingModelService powerCurveFittingModelService= SpringUtils.getBean("powerCurveFittingModelService");
 //        powerCurveFittingModelService.cureFittingModel();
-
+//
+//        Calendar c=Calendar.getInstance();
+//        c.set(Calendar.MONTH,7);
+//        c.set(Calendar.DAY_OF_MONTH,2);
 //        WindturbineGoodnessService windturbineGoodnessService= SpringUtils.getBean("windturbineGoodnessService");
-//        windturbineGoodnessService.calWindturbineGoodness(new Date());
-
-//        WtAlysisDayService wtAlysisDayService= SpringUtils.getBean("wtAlysisDayService");
-//        wtAlysisDayService.calEquipmentInfoDay(new Date());
+//        windturbineGoodnessService.calWindturbineGoodness(c.getTime());
+//
+//        WtwindDayInfoService wtwindDayInfoService= SpringUtils.getBean("wtwindDayInfoService");
+//        Date date =c.getTime();
+//        wtwindDayInfoService.calWpwindDayInfo(c.getTime());
+//
+//        WpwindDayInfoService wpwindDayInfoService= SpringUtils.getBean("wpwindDayInfoService");
+//        c=Calendar.getInstance();
+//        c.set(Calendar.MONTH,7);
+//        c.set(Calendar.DAY_OF_MONTH,2);
+//        date =c.getTime();
+//
+//        wpwindDayInfoService.calWpwindDayInfo(c.getTime());
 System.out.println("完成");
     }
 }

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

@@ -59,12 +59,12 @@ public class GeneratorCodeConfig {
 //        dsc.setUrl("jdbc:oracle:thin:@10.83.68.165:1521:gdsj");
 
         dsc.setDriverName("org.postgresql.Driver");
-//        dsc.setUsername("postgres");
-//        dsc.setPassword("postgres");
-//        dsc.setUrl("jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD");
-        dsc.setUrl("jdbc:postgresql://124.70.75.91:5432/jn_test");
         dsc.setUsername("postgres");
-        dsc.setPassword("gd123");
+        dsc.setPassword("postgres");
+        dsc.setUrl("jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD");
+//        dsc.setUrl("jdbc:postgresql://124.70.75.91:5432/jn_test");
+//        dsc.setUsername("postgres");
+//        dsc.setPassword("gd123");
         mpg.setDataSource(dsc);
 
 

+ 17 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -61,13 +61,16 @@ public class CacheContext implements CommandLineRunner {
 
     @Resource
     private IProBasicModelPowerRdService proBasicModelPowerRdService;
-
+    @Resource
+    private IProBasicWeatherStationService proBasicWeatherStationService;
     @Value("${runWindpowerstation}")
     private String runWindpowerstation;
 
     public static List<ProBasicEquipment> wtls = new ArrayList<>();
     public static List<ProBasicProject> pjls = new ArrayList<>();
     public static List<ProBasicLine>  lnls = new ArrayList<>();
+
+    public static List<ProBasicWeatherStation> wsls=new ArrayList<>();
     public static List<ProBasicSubStation>  subwpls = new ArrayList<>();
 
     public static List<ProBasicSquare> sqls = new ArrayList<>();
@@ -97,6 +100,7 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String,List<ProBasicEquipment>> sqwtmap = new HashMap<>();
     public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = new HashMap<>();// 风电机测点AI表
     public static Map<String,Map<String, ProBasicPowerstationPoint>> linepointmap =new HashMap<>();
+    public static Map<String,Map<String, ProBasicPowerstationPoint>> wspointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> propointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> wppointmap =new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> subwppointmap =new HashMap<>();
@@ -124,14 +128,17 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, Map<Double,ProEconWtPowerCurveFitting>> curveFittingPowerMap = new HashMap<>(); //自算,最优功率
     public static Map<String,List<ProBasicStatusPoint>> statusMap = new HashMap<>();
 
+
     @Override
     public void run(String... args) throws Exception {
         logger.info("缓存开始------------------------------------------------------------");
 
 
+
         List<String> runWpids = Arrays.asList(runWindpowerstation.split(","));
         logger.info(runWpids.get(0)+"------------------"+runWpids.size());
 
+       wsls= proBasicWeatherStationService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId()) && i.getIsAble()==1).collect(Collectors.toList());
         theoreticalPowerList= proBasicModelPowerRdService.list();
         equipmentmodels = proEconEquipmentmodelService.list();
         equipmentmodels.stream().forEach(e->{
@@ -345,6 +352,15 @@ public class CacheContext implements CommandLineRunner {
 
 
 
+        wsls.stream().forEach(p->{
+
+
+            String wsString = redisService.get(p.getId());
+            Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(wsString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
+            });
+            wspointmap.put(p.getId(),stringWindpowerstationpointnewMap);
+
+        });
         pjls = proBasicProjectService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId()) && i.getIsAble()==1).collect(Collectors.toList());
         pjls.stream().forEach(p->{
             pjmap.put(p.getId(),p);

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

@@ -17,6 +17,6 @@ import java.util.Date;
  */
 public interface ProEconCurveFittingMainMapper extends BaseMapper<ProEconCurveFittingMain> {
 
-    @Delete(" delete from pro_econ_curve_fitting_main where recordDate=#{recordDate} ")
+    @Delete(" delete from pro_econ_curve_fitting_main where record_date=#{recordDate} ")
     public int deleteProEconCurveFittingMainByDay(@Param(value = "recordDate") Date recordDate);
 }

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

@@ -18,6 +18,6 @@ import java.util.Date;
 public interface ProEconCurveFittingSubMapper extends BaseMapper<ProEconCurveFittingSub> {
 
 
-    @Delete(" delete from pro_econ_curve_fitting_sub where recordDate=#{recordDate} ")
+    @Delete(" delete from pro_econ_curve_fitting_sub where record_date=#{recordDate} ")
     public int deleteProEconCurveFittingSubByDay(@Param(value = "recordDate") Date recordDate);
 }

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

@@ -17,7 +17,7 @@ import java.util.Date;
  */
 public interface ProEconWtCurveFittingMapper extends BaseMapper<ProEconWtCurveFitting> {
 
-    @Delete(" delete from pro_econ_wt_curve_fitting where recordDate=#{recordDate} ")
+    @Delete(" delete from pro_econ_wt_curve_fitting where record_date=#{recordDate} ")
     public int deleteProEconWtCurveFittingByDay(@Param(value = "recordDate") Date recordDate);
 
 }

Файловите разлики са ограничени, защото са твърде много
+ 2715 - 306
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWpwindDayInfo.java


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

@@ -43,7 +43,7 @@ public class ProEconWtwindDayInfo extends Model {
      * 编号
      */
     @TableId(value = "ID",type = IdType.ASSIGN_ID)
-    private Integer id;
+    private Long id;
 
     /**
      * 风机编号

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

@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.*;
-import java.util.stream.Collectors;
 
 @Service
 public class ActivePowerService {
@@ -37,11 +36,16 @@ public class ActivePowerService {
         Date endDate=c.getTime();
         for (ProBasicPowerstation station : CacheContext.wpls) {
 
-            List<ProEconEquipmentInfo15minute> ei15ls = proEconEquipmentInfo15minuteService.list().stream()
-                    .filter(i -> i.getWindpowerstationId().equals(station.getId())
-                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
-                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
-                    ).collect(Collectors.toList());
+            QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
+            queryWrapper.ge("record_date",beginDate)
+                    .le("record_date",endDate)
+                    .eq("windPowerStation_Id",station.getId());
+            List<ProEconEquipmentInfo15minute> ei15ls = proEconEquipmentInfo15minuteService.list();
+//                    .stream()
+//                    .filter(i -> i.getWindpowerstationId().equals(station.getId())
+//                            && ( i.getRecordDate().compareTo(beginDate)==0 || i.getRecordDate().after(beginDate))
+//                            && (i.getRecordDate().compareTo(endDate)==0 || i.getRecordDate().before(endDate))
+//                    ).collect(Collectors.toList());
 
 
 
@@ -91,11 +95,12 @@ public class ActivePowerService {
                 for (Double speed : intnalMap.keySet()) {
                     List<Double> powers = intnalMap.get(speed);
 
-                    Optional<ProEconActivePowerData> data = proEconActivePowerDataService.list().stream()
-                            .filter(i -> i.getWindturbineId().equals(windturbineId)
-                                    && i.getRecordDate().compareTo(beginDate) == 0
-                                    && i.getSpeed() == speed
-                            ).findFirst();
+                    QueryWrapper<ProEconActivePowerData> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",beginDate)
+                            .eq("windturbine_id",windturbineId).eq("speed",speed);
+
+                    Optional<ProEconActivePowerData> data = proEconActivePowerDataService.list(queryWrapper2)
+                            .stream().findFirst();
 
                     ProEconActivePowerData apdata;
                     if (!data.isPresent()) {

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

@@ -1,12 +1,10 @@
 package com.gyee.generation.service;
 
+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.ProBasicEquipment;
-import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
-import com.gyee.generation.model.auto.ProEconActivePowerData;
-import com.gyee.generation.model.auto.ProEconWtPowerCurveFitting;
+import com.gyee.generation.model.auto.*;
 import com.gyee.generation.model.vo.StatData;
 import com.gyee.generation.service.auto.IProEconWtPowerCurveFittingService;
 import com.gyee.generation.util.DateUtils;
@@ -205,9 +203,11 @@ public class CoefficientService {
             Calendar c = Calendar.getInstance();
             c.setTime(currentDate);
 
-
-            powerList = proEconWtPowerCurveFittingService.list().stream()
-                    .filter(i -> i.getWindturbineId().equals(windturbineId)).collect(Collectors.toList());
+            QueryWrapper<ProEconWtPowerCurveFitting> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id",windturbineId);
+            powerList = proEconWtPowerCurveFittingService.list(queryWrapper);
+//                    .stream()
+//                    .filter(i -> i.getWindturbineId().equals(windturbineId)).collect(Collectors.toList());
 
 
             for (ProEconActivePowerData data : dataList) {

+ 10 - 4
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo15minuteService.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -7,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.ProEconEquipmentInfo15minute;
+import com.gyee.generation.model.auto.ProEconEquipmentInfoDay5;
 import com.gyee.generation.service.auto.IProEconEquipmentInfo15minuteService;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
@@ -42,11 +44,15 @@ public class EquipmentInfo15minuteService {
         c.add(Calendar.MINUTE,-15);
         Date begin= DateUtils.truncate(c.getTime());
 
+        QueryWrapper<ProEconEquipmentInfoDay5> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",DateUtils.truncate(recordDate));
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconEquipmentInfo15minuteService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
-           ).map(ProEconEquipmentInfo15minute::getId)
+        List<String> idls = proEconEquipmentInfo15minuteService.list()
+               .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
+//                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
+//           )
+                .map(ProEconEquipmentInfo15minute::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {

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

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -27,10 +28,6 @@ public class EquipmentInfo1Service {
     @Resource
     private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
 
-
-
-
-
     /**
      * 计算设备日信息
      */
@@ -42,16 +39,16 @@ public class EquipmentInfo1Service {
 
         Date begin= DateUtils.truncate(c.getTime());
 
+        QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",recordDate);
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconEquipmentInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconEquipmentInfoDay1::getId)
+        List<String> idls = proEconEquipmentInfoDay1Service.list(queryWrapper).stream()
+                .map(ProEconEquipmentInfoDay1::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
 
             proEconEquipmentInfoDay1Service.removeByIds(idls);
-
         }
 
         List<ProEconEquipmentInfoDay1> dayls=new ArrayList<>();
@@ -77,10 +74,14 @@ public class EquipmentInfo1Service {
                 cl.setTime(recordDate);
                 if(cl.get(Calendar.DAY_OF_MONTH)!=1)
                 {
-                    pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && CacheContext.wtmap.containsKey(i.getWindturbineId())
-                            ).collect(Collectors.toList());
+                    QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",cl.getTime())
+                            .eq("windturbine_Id",wt.getId());
+                    pepid1ls = proEconEquipmentInfoDay1Service.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && CacheContext.wtmap.containsKey(i.getWindturbineId())
+//                            ).collect(Collectors.toList());
                 }
                 extracted(recordDate, end, begin, pointmap, pewp,pepid1ls);
 

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

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -43,10 +44,9 @@ public class EquipmentInfo2Service {
         Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconEquipmentInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
-           ).map(ProEconEquipmentInfoDay2::getId)
+        QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",recordDate);
+        List<String> idls = proEconEquipmentInfoDay2Service.list(queryWrapper).stream().map(ProEconEquipmentInfoDay2::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -77,11 +77,15 @@ public class EquipmentInfo2Service {
                 if(cl.get(Calendar.DAY_OF_MONTH)!=1)
 
                 {
-                    pepidls = proEconEquipmentInfoDay2Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getWindturbineId().equals(wt.getId())
-                            )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",cl.getTime())
+                            .eq("windturbine_Id",wt.getId());
+                    pepidls = proEconEquipmentInfoDay2Service.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getWindturbineId().equals(wt.getId())
+//                            )
+//                            .collect(Collectors.toList());
                 }
                 calDetiall( pewp, end, begin, wt,pepidls);
                 calSimple( pewp, end, begin, wt,pepidls);

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

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -42,10 +43,10 @@ public class EquipmentInfo3Service {
         Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconEquipmentInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
-                         ).map(ProEconEquipmentInfoDay3::getId)
+        QueryWrapper<ProEconEquipmentInfoDay3> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",recordDate);
+        List<String> idls = proEconEquipmentInfoDay3Service.list(queryWrapper).stream()
+                .map(ProEconEquipmentInfoDay3::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -77,11 +78,15 @@ public class EquipmentInfo3Service {
                 if(cl.get(Calendar.DAY_OF_MONTH)!=1)
 
                 {
-                    pepidls = proEconEquipmentInfoDay3Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getWindturbineId().equals(wt.getId())
-                                  )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconEquipmentInfoDay3> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",cl.getTime())
+                            .eq("windturbine_Id",wt.getId());
+                    pepidls = proEconEquipmentInfoDay3Service.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getWindturbineId().equals(wt.getId())
+//                                  )
+//                            .collect(Collectors.toList());
                 }
                 calDetiall( pewp, end, begin,wt,pepidls);
                 calSimple( pewp, end, begin, wt,pepidls);

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

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -71,10 +72,10 @@ public class EquipmentInfo4Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconEquipmentInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())
-                ).map(ProEconEquipmentInfoDay4::getId)
+        QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",begin);
+        List<String> idls = proEconEquipmentInfoDay4Service.list(queryWrapper).stream()
+                .map(ProEconEquipmentInfoDay4::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -86,10 +87,13 @@ public class EquipmentInfo4Service {
         //获取曲线风机切入风速
         Map<String, ProEconInOrOutSpeedTotal> peioomap = new HashMap<>();
 
-        List<ProEconInOrOutSpeedTotal> peioostls = proEconInOrOutSpeedTotalService.list().stream().filter(i ->
-                (i.getRecordDate().compareTo(begin) == 0 || i.getRecordDate().after(begin))
-                        && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-        ).collect(Collectors.toList());
+        QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("record_date",begin);
+
+        List<ProEconInOrOutSpeedTotal> peioostls = proEconInOrOutSpeedTotalService.list(queryWrapper2);
+//                .stream().filter(i ->
+//                i.getRecordDate().compareTo(begin) == 0
+//        ).collect(Collectors.toList());
 
         if (!peioostls.isEmpty()) {
             for (ProEconInOrOutSpeedTotal peioo : peioostls) {
@@ -97,10 +101,15 @@ public class EquipmentInfo4Service {
             }
         }
         Map<String,ProEconWindturbineGoodness> wgmap=new HashMap<>();
-        List<ProEconWindturbineGoodness> wgls = proEconWindturbineGoodnessService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(begin))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId()))
-                .collect(Collectors.toList());
+
+        QueryWrapper<ProEconWindturbineGoodness> queryWrapper3 = new QueryWrapper<>();
+        queryWrapper3.eq("record_date",DateUtils.truncate(begin));
+
+        List<ProEconWindturbineGoodness> wgls = proEconWindturbineGoodnessService.list(queryWrapper3);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(begin))==0
+//                        && CacheContext.wtmap.containsKey(i.getWindturbineId()))
+//                .collect(Collectors.toList());
 
         if(!wgls.isEmpty())
         {
@@ -133,20 +142,28 @@ public class EquipmentInfo4Service {
                 cl.setTime(recordDate);
                 cl.add(Calendar.DAY_OF_MONTH,-1);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepidls = proEconEquipmentInfoDay4Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getWindturbineId().equals(wt.getId())
-                            )
-                            .collect(Collectors.toList());
+
+                    QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper4 = new QueryWrapper<>();
+                    queryWrapper4.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("windturbine_id",wt.getId());
+                    pepidls = proEconEquipmentInfoDay4Service.list(queryWrapper4);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getWindturbineId().equals(wt.getId())
+//                            )
+//                            .collect(Collectors.toList());
                 }
 
                 //获得当日设备统计2表数据
                 ProEconEquipmentInfoDay2 pepid2 = null;
                 List<ProEconEquipmentInfoDay2> pepid2ls;
-                pepid2ls = proEconEquipmentInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getWindturbineId().equals(wt.getId())
-                        ).collect(Collectors.toList());
+                QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper5 = new QueryWrapper<>();
+                queryWrapper5.eq("record_date",DateUtils.truncate(cl.getTime())).eq("windturbine_id",wt.getId());
+                pepid2ls = proEconEquipmentInfoDay2Service.list(queryWrapper5);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getWindturbineId().equals(wt.getId())
+//                        ).collect(Collectors.toList());
 
                 if (!pepid2ls.isEmpty()) {
                     pepid2 = pepid2ls.get(0);
@@ -154,10 +171,13 @@ public class EquipmentInfo4Service {
                 //获得当日设备统计3表数据
                 ProEconEquipmentInfoDay3 pepid3 = null;
                 List<ProEconEquipmentInfoDay3> pepid3ls;
-                pepid3ls = proEconEquipmentInfoDay3Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getWindturbineId().equals(wt.getId())
-                        ).collect(Collectors.toList());
+                QueryWrapper<ProEconEquipmentInfoDay3> queryWrapper6 = new QueryWrapper<>();
+                queryWrapper6.eq("record_date",DateUtils.truncate(cl.getTime())).eq("windturbine_id",wt.getId());
+                pepid3ls = proEconEquipmentInfoDay3Service.list(queryWrapper6);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getWindturbineId().equals(wt.getId())
+//                        ).collect(Collectors.toList());
 
                 if (!pepid3ls.isEmpty()) {
                     pepid3 = pepid3ls.get(0);
@@ -251,10 +271,10 @@ public class EquipmentInfo4Service {
                 if (StringUtils.notEmp(peiost) && !fsls.isEmpty()) {
                     double dayjfsc = 0.0;
                     for (PointData po : fsls) {
-                        //小风切入风速
-                        double xfqr = peiost.getDayInputSmall();
-                        //小于小风切入算静风时长累计
-                        if (po.getPointValueInDouble() < xfqr) {
+//                        //小风切入风速
+//                        double xfqr = peiost.getDayInputSmall();
+//                        //小于小风切入算静风时长累计
+                        if (po.getPointValueInDouble() < 3) {
                             dayjfsc++;
                         }
 
@@ -313,10 +333,12 @@ public class EquipmentInfo4Service {
             }
         }
 
-
-        List<ProEconCurveFittingMain> pecfmls = proEconCurveFittingMainService.list().stream().filter(i -> i.getRecordDate().compareTo(begin) == 0
-                && i.getWindturbineId().equals(wt.getId())
-        ).collect(Collectors.toList());
+        QueryWrapper<ProEconCurveFittingMain> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",begin).eq("windturbine_id",wt.getId());
+        List<ProEconCurveFittingMain> pecfmls = proEconCurveFittingMainService.list(queryWrapper);
+//                .stream().filter(i -> i.getRecordDate().compareTo(begin) == 0
+//                && i.getWindturbineId().equals(wt.getId())
+//        ).collect(Collectors.toList());
 
         if (!pecfmls.isEmpty()) {
             ProEconCurveFittingMain pecfm = pecfmls.get(0);
@@ -330,10 +352,12 @@ public class EquipmentInfo4Service {
 
 //**************************************************日三率统计****************************************************************/
 
-
-        List<ProEconStateTransitionRates> pestrls = proEconStateTransitionRatesService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(begin) == 0 && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconStateTransitionRates> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("record_date",begin).eq("windturbine_id",wt.getId());
+        List<ProEconStateTransitionRates> pestrls = proEconStateTransitionRatesService.list(queryWrapper2);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(begin) == 0 && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
         //大于3米20分钟转换及时次数
         DoubleSummaryStatistics timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
         //大于3米20分钟转换及时次数合计
@@ -369,9 +393,12 @@ public class EquipmentInfo4Service {
         } else {
             pewp.setRfwjsl(100.0);
         }
-        List<ProEconFaultLiminatedefects> peflls=proEconFaultLiminatedefectsService.list().stream()
-                .filter(i -> i.getDateTime().compareTo(begin) == 0 && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconFaultLiminatedefects> queryWrapper3 = new QueryWrapper<>();
+        queryWrapper3.ge("date_time",begin).le("date_time",end).eq("windturbine_id",wt.getId());
+        List<ProEconFaultLiminatedefects> peflls=proEconFaultLiminatedefectsService.list(queryWrapper3);
+//                .stream()
+//                .filter(i -> i.getDateTime().compareTo(begin) == 0 && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
         //消缺及时次数
         DoubleSummaryStatistics right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
         //消缺及时次数合计
@@ -391,31 +418,48 @@ public class EquipmentInfo4Service {
         }
 //**************************************************日三率统计****************************************************************/
 
-        List<ProEconCurveFittingSub> pointls=proEconCurveFittingSubService.list().stream().filter(x-> x.getSpeed() !=null
-                && Double.valueOf(x.getSpeed())>=3.0
-                && Double.valueOf(x.getSpeed())<5.0
-                && x.getRecordDate().compareTo(begin) == 0
-                && x.getWindturbineId().equals(wt.getId())
-        ).collect(Collectors.toList());
+        QueryWrapper<ProEconCurveFittingSub> queryWrapper6 = new QueryWrapper<>();
+        queryWrapper6.eq("record_date",begin).isNotNull("speed")
+                .lt("speed",5.0)
+                .ge("speed",3.0)
+                .eq("windturbine_id",wt.getId());
+        List<ProEconCurveFittingSub> pointls=proEconCurveFittingSubService.list(queryWrapper6);
+//                .stream().filter(x-> x.getSpeed() !=null
+//                && Double.valueOf(x.getSpeed())>=3.0
+//                && Double.valueOf(x.getSpeed())<5.0
+//                && x.getRecordDate().compareTo(begin) == 0
+//                && x.getWindturbineId().equals(wt.getId())
+//        ).collect(Collectors.toList());
 
         DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(ProEconCurveFittingSub::getDeviationRate1).summaryStatistics();
         pewp.setR35mqxpcl(summaryStatistics.getAverage());
 
-          pointls=proEconCurveFittingSubService.list().stream().filter(x-> x.getSpeed() !=null
-              && Double.valueOf(x.getSpeed())>=5.0
-                && Double.valueOf(x.getSpeed())<11.0
-                && x.getRecordDate().compareTo(begin) == 0
-                && x.getWindturbineId().equals(wt.getId())
-        ).collect(Collectors.toList());
+        queryWrapper6 = new QueryWrapper<>();
+        queryWrapper6.eq("record_date",begin).isNotNull("speed")
+                .lt("speed",11.0)
+                .ge("speed",5.0)
+                .eq("windturbine_id",wt.getId());
+          pointls=proEconCurveFittingSubService.list(queryWrapper6);
+//                  .stream().filter(x-> x.getSpeed() !=null
+//              && Double.valueOf(x.getSpeed())>=5.0
+//                && Double.valueOf(x.getSpeed())<11.0
+//                && x.getRecordDate().compareTo(begin) == 0
+//                && x.getWindturbineId().equals(wt.getId())
+//        ).collect(Collectors.toList());
 
         summaryStatistics=pointls.stream().mapToDouble(ProEconCurveFittingSub::getDeviationRate1).summaryStatistics();
         pewp.setR511mqxpcl(summaryStatistics.getAverage());
 
-        pointls=proEconCurveFittingSubService.list().stream().filter(x-> x.getSpeed() !=null
-                && Double.valueOf(x.getSpeed())>=11.0
-                && x.getRecordDate().compareTo(begin) == 0
-                && x.getWindturbineId().equals(wt.getId())
-        ).collect(Collectors.toList());
+        queryWrapper6 = new QueryWrapper<>();
+        queryWrapper6.eq("record_date",begin).isNotNull("speed")
+                .ge("speed",11.0)
+                .eq("windturbine_id",wt.getId());
+        pointls=proEconCurveFittingSubService.list(queryWrapper6);
+//                .stream().filter(x-> x.getSpeed() !=null
+//                && Double.valueOf(x.getSpeed())>=11.0
+//                && x.getRecordDate().compareTo(begin) == 0
+//                && x.getWindturbineId().equals(wt.getId())
+//        ).collect(Collectors.toList());
 
         summaryStatistics=pointls.stream().mapToDouble(ProEconCurveFittingSub::getDeviationRate1).summaryStatistics();
         pewp.setR11mycqxpcl(summaryStatistics.getAverage());
@@ -519,10 +563,12 @@ public class EquipmentInfo4Service {
                 }
             }
 
-
-            List<ProEconCurveFittMonthMain> pecfmmls = proEconCurveFittMonthMainService.list().stream().filter(i -> i.getYear().equals(year) && i.getMonth().equals(month)
-                    && i.getWindturbineId().equals(wt.getId())
-            ).collect(Collectors.toList());
+            QueryWrapper<ProEconCurveFittMonthMain> queryWrapper4 = new QueryWrapper<>();
+            queryWrapper4.eq("year",year).eq("month",month).eq("windturbine_id",wt.getId());
+            List<ProEconCurveFittMonthMain> pecfmmls = proEconCurveFittMonthMainService.list(queryWrapper4);
+//                    .stream().filter(i -> i.getYear().equals(year) && i.getMonth().equals(month)
+//                    && i.getWindturbineId().equals(wt.getId())
+//            ).collect(Collectors.toList());
 
             if (!pecfmmls.isEmpty()) {
                 ProEconCurveFittMonthMain pecfm = pecfmmls.get(0);
@@ -542,13 +588,16 @@ public class EquipmentInfo4Service {
             cal.set(Calendar.DAY_OF_MONTH, 1);
             Date monthbiegin = c.getTime();
 
+            queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.ge("record_date",monthbiegin).le("record_date",end).eq("windturbine_id",wt.getId());
 
-            pestrls =proEconStateTransitionRatesService.list().stream()
-                    .filter(i ->
-                            (i.getRecordDate().compareTo(monthbiegin) == 0 || i.getRecordDate().after(monthbiegin))
-                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                                    && i.getWindturbineId().equals(wt.getId())
-                    ).collect(Collectors.toList());
+            pestrls =proEconStateTransitionRatesService.list(queryWrapper2);
+//                    .stream()
+//                    .filter(i ->
+//                            (i.getRecordDate().compareTo(monthbiegin) == 0 || i.getRecordDate().after(monthbiegin))
+//                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                                    && i.getWindturbineId().equals(wt.getId())
+//                    ).collect(Collectors.toList());
             //大于3米20分钟转换及时次数
             timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
             //大于3米20分钟转换及时次数合计
@@ -584,13 +633,15 @@ public class EquipmentInfo4Service {
             } else {
                 pewp.setYfwjsl(100.0);
             }
-
-            peflls=proEconFaultLiminatedefectsService.list().stream()
-                    .filter(i ->
-                            (i.getDateTime().compareTo(monthbiegin) == 0 || i.getDateTime().after(monthbiegin))
-                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
-                                    && i.getWindturbineId().equals(wt.getId())
-                    ).collect(Collectors.toList());
+            queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.ge("date_time",monthbiegin).le("date_time",end).eq("windturbine_id",wt.getId());
+            peflls=proEconFaultLiminatedefectsService.list(queryWrapper3);
+//                    .stream()
+//                    .filter(i ->
+//                            (i.getDateTime().compareTo(monthbiegin) == 0 || i.getDateTime().after(monthbiegin))
+//                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
+//                                    && i.getWindturbineId().equals(wt.getId())
+//                    ).collect(Collectors.toList());
             //消缺及时次数
             right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
             //消缺及时次数合计
@@ -609,33 +660,58 @@ public class EquipmentInfo4Service {
                 pewp.setYgzxqjsl(100.0);
             }
 //**************************************************月三率统计****************************************************************/
-            List<ProEconCurveFittMonthSub> monthpointls=proEconCurveFittMonthSubService.list().stream().filter(x-> x.getSpeed() !=null
-                    && Double.valueOf(x.getSpeed())>=3.0
-                    && Double.valueOf(x.getSpeed())<5.0
-                    && x.getYear().equals(year)
-                    && x.getMonth().equals(month)
-                    && x.getWindturbineId().equals(wt.getId())
-            ).collect(Collectors.toList());
+            QueryWrapper<ProEconCurveFittMonthSub> queryWrapper7 = new QueryWrapper<>();
+            queryWrapper7.isNotNull("speed")
+                    .lt("speed",5.0)
+                    .ge("speed",3.0)
+                    .eq("year",year)
+                    .eq("month",month)
+                    .eq("windturbine_id",wt.getId());
+            List<ProEconCurveFittMonthSub> monthpointls=proEconCurveFittMonthSubService.list(queryWrapper7);
+//            .stream().filter(x-> x.getSpeed() !=null
+//                    && Double.valueOf(x.getSpeed())>=3.0
+//                    && Double.valueOf(x.getSpeed())<5.0
+//                    && x.getYear().equals(year)
+//                    && x.getMonth().equals(month)
+//                    && x.getWindturbineId().equals(wt.getId())
+//            ).collect(Collectors.toList());
 
             summaryStatistics=monthpointls.stream().mapToDouble(ProEconCurveFittMonthSub::getDeviationRate1).summaryStatistics();
             pewp.setY35mqxpcl(summaryStatistics.getAverage());
-            monthpointls=proEconCurveFittMonthSubService.list().stream().filter(x-> x.getSpeed() !=null
-                    && Double.valueOf(x.getSpeed())>=5.0
-                    && Double.valueOf(x.getSpeed())<11.0
-                    && x.getYear().equals(year)
-                    && x.getMonth().equals(month)
-                    && x.getWindturbineId().equals(wt.getId())
-            ).collect(Collectors.toList());
+
+            queryWrapper7 = new QueryWrapper<>();
+            queryWrapper7.isNotNull("speed")
+                    .lt("speed",11.0)
+                    .ge("speed",5.0)
+                    .eq("year",year)
+                    .eq("month",month)
+                    .eq("windturbine_id",wt.getId());
+           monthpointls=proEconCurveFittMonthSubService.list(queryWrapper7);
+//            monthpointls=proEconCurveFittMonthSubService.list().stream().filter(x-> x.getSpeed() !=null
+//                    && Double.valueOf(x.getSpeed())>=5.0
+//                    && Double.valueOf(x.getSpeed())<11.0
+//                    && x.getYear().equals(year)
+//                    && x.getMonth().equals(month)
+//                    && x.getWindturbineId().equals(wt.getId())
+//            ).collect(Collectors.toList());
 
             summaryStatistics=monthpointls.stream().mapToDouble(ProEconCurveFittMonthSub::getDeviationRate1).summaryStatistics();
             pewp.setY511mqxpcl(summaryStatistics.getAverage());
 
-            monthpointls=proEconCurveFittMonthSubService.list().stream().filter(x-> x.getSpeed() !=null
-                    && Double.valueOf(x.getSpeed())>=11.0
-                    && x.getYear().equals(year)
-                    && x.getMonth().equals(month)
-                    && x.getWindturbineId().equals(wt.getId())
-            ).collect(Collectors.toList());
+            queryWrapper7 = new QueryWrapper<>();
+            queryWrapper7.isNotNull("speed")
+//                    .lt("speed",11.0)
+                    .ge("speed",11.0)
+                    .eq("year",year)
+                    .eq("month",month)
+                    .eq("windturbine_id",wt.getId());
+            monthpointls=proEconCurveFittMonthSubService.list(queryWrapper7);
+//            monthpointls=proEconCurveFittMonthSubService.list().stream().filter(x-> x.getSpeed() !=null
+//                    && Double.valueOf(x.getSpeed())>=11.0
+//                    && x.getYear().equals(year)
+//                    && x.getMonth().equals(month)
+//                    && x.getWindturbineId().equals(wt.getId())
+//            ).collect(Collectors.toList());
 
             summaryStatistics=monthpointls.stream().mapToDouble(ProEconCurveFittMonthSub::getDeviationRate1).summaryStatistics();
             pewp.setY11mycqxpcl(summaryStatistics.getAverage());
@@ -736,10 +812,13 @@ public class EquipmentInfo4Service {
                 }
             }
 
+            QueryWrapper<ProEconCurveFittYearMain> queryWrapper8 = new QueryWrapper<>();
+            queryWrapper8.eq("year",year).eq("windturbine_id",wt.getId());
 
-            List<ProEconCurveFittYearMain> pecfYmls = proEconCurveFittYearMainService.list().stream().filter(i -> i.getYear().equals(year)
-                    && i.getWindturbineId().equals(wt.getId())
-            ).collect(Collectors.toList());
+            List<ProEconCurveFittYearMain> pecfYmls = proEconCurveFittYearMainService.list(queryWrapper8);
+//                    .stream().filter(i -> i.getYear().equals(year)
+//                    && i.getWindturbineId().equals(wt.getId())
+//            ).collect(Collectors.toList());
 
             if (!pecfYmls.isEmpty()) {
                 ProEconCurveFittYearMain pecfm = pecfYmls.get(0);
@@ -758,12 +837,15 @@ public class EquipmentInfo4Service {
             cal.set(Calendar.DAY_OF_YEAR, 1);
             Date yearbiegin = c.getTime();
 
-            pestrls =proEconStateTransitionRatesService.list().stream()
-                    .filter(i ->
-                            (i.getRecordDate().compareTo(yearbiegin) == 0 || i.getRecordDate().after(yearbiegin))
-                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                                    && i.getWindturbineId().equals(wt.getId())
-                    ).collect(Collectors.toList());
+            queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.ge("record_date",yearbiegin).le("record_date",end).eq("windturbine_id",wt.getId());
+            pestrls =proEconStateTransitionRatesService.list(queryWrapper2);
+//                    .stream()
+//                    .filter(i ->
+//                            (i.getRecordDate().compareTo(yearbiegin) == 0 || i.getRecordDate().after(yearbiegin))
+//                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                                    && i.getWindturbineId().equals(wt.getId())
+//                    ).collect(Collectors.toList());
             //大于3米20分钟转换及时次数
             timerate8_summary =pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
             //大于3米20分钟转换及时次数合计
@@ -799,12 +881,15 @@ public class EquipmentInfo4Service {
             } else {
                 pewp.setNfwjsl(100.0);
             }
-            peflls=proEconFaultLiminatedefectsService.list().stream()
-                    .filter(i ->
-                            (i.getDateTime().compareTo(yearbiegin) == 0 || i.getDateTime().after(yearbiegin))
-                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
-                                    && i.getWindturbineId().equals(wt.getId())
-                    ).collect(Collectors.toList());
+            queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.ge("date_time",yearbiegin).le("date_time",end).eq("windturbine_id",wt.getId());
+            peflls=proEconFaultLiminatedefectsService.list(queryWrapper3);
+//                    .stream()
+//                    .filter(i ->
+//                            (i.getDateTime().compareTo(yearbiegin) == 0 || i.getDateTime().after(yearbiegin))
+//                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
+//                                    && i.getWindturbineId().equals(wt.getId())
+//                    ).collect(Collectors.toList());
             //消缺及时次数
             right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
             //消缺及时次数合计
@@ -823,30 +908,49 @@ public class EquipmentInfo4Service {
                 pewp.setNgzxqjsl(100.0);
             }
 //**************************************************年三率统计****************************************************************/
-            List<ProEconCurveFittYearSub> yearpointls=proEconCurveFittYearSubService.list().stream().filter(x-> x.getSpeed() !=null
-                    && Double.valueOf(x.getSpeed())>=3.0
-                    && Double.valueOf(x.getSpeed())<5.0
-                    && x.getYear().equals(year)
-                    && x.getWindturbineId().equals(wt.getId())
-            ).collect(Collectors.toList());
+            QueryWrapper<ProEconCurveFittYearSub> queryWrapper7 = new QueryWrapper<>();
+            queryWrapper.isNotNull("speed")
+                    .lt("speed",5.0)
+                    .ge("speed",3.0)
+                    .eq("year",year)
+                    .eq("windturbine_id",wt.getId());
+            List<ProEconCurveFittYearSub> yearpointls=proEconCurveFittYearSubService.list(queryWrapper7);
+//                    .stream().filter(x-> x.getSpeed() !=null
+//                    && Double.valueOf(x.getSpeed())>=3.0
+//                    && Double.valueOf(x.getSpeed())<5.0
+//                    && x.getYear().equals(year)
+//                    && x.getWindturbineId().equals(wt.getId())
+//            ).collect(Collectors.toList());
 
             summaryStatistics=yearpointls.stream().mapToDouble(ProEconCurveFittYearSub::getDeviationRate1).summaryStatistics();
             pewp.setN35mqxpcl(summaryStatistics.getAverage());
-            yearpointls=proEconCurveFittYearSubService.list().stream().filter(x-> x.getSpeed() !=null
-                    && Double.valueOf(x.getSpeed())>=5.0
-                    && Double.valueOf(x.getSpeed())<11.0
-                    && x.getYear().equals(year)
-                    && x.getWindturbineId().equals(wt.getId())
-            ).collect(Collectors.toList());
+            queryWrapper7 = new QueryWrapper<>();
+            queryWrapper7.isNotNull("speed")
+                    .lt("speed",11.0)
+                    .ge("speed",5.0)
+                    .eq("year",year)
+                    .eq("windturbine_id",wt.getId());
+            yearpointls=proEconCurveFittYearSubService.list(queryWrapper7);
+//                    .stream().filter(x-> x.getSpeed() !=null
+//                    && Double.valueOf(x.getSpeed())>=5.0
+//                    && Double.valueOf(x.getSpeed())<11.0
+//                    && x.getYear().equals(year)
+//                    && x.getWindturbineId().equals(wt.getId())
+//            ).collect(Collectors.toList());
 
             summaryStatistics=yearpointls.stream().mapToDouble(ProEconCurveFittYearSub::getDeviationRate1).summaryStatistics();
             pewp.setN511mqxpcl(summaryStatistics.getAverage());
-
-            yearpointls=proEconCurveFittYearSubService.list().stream().filter(x-> x.getSpeed() !=null
-                    && Double.valueOf(x.getSpeed())>=11.0
-                    && x.getYear().equals(year)
-                     && x.getWindturbineId().equals(wt.getId())
-            ).collect(Collectors.toList());
+            queryWrapper7 = new QueryWrapper<>();
+            queryWrapper.isNotNull("speed")
+                    .ge("speed",11.0)
+                    .eq("year",year)
+                    .eq("windturbine_id",wt.getId());
+            yearpointls=proEconCurveFittYearSubService.list(queryWrapper7);
+//            yearpointls=proEconCurveFittYearSubService.list().stream().filter(x-> x.getSpeed() !=null
+//                    && Double.valueOf(x.getSpeed())>=11.0
+//                    && x.getYear().equals(year)
+//                     && x.getWindturbineId().equals(wt.getId())
+//            ).collect(Collectors.toList());
 
             summaryStatistics=yearpointls.stream().mapToDouble(ProEconCurveFittYearSub::getDeviationRate1).summaryStatistics();
             pewp.setN11mycqxpcl(summaryStatistics.getAverage());

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

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+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;
@@ -39,17 +40,20 @@ public class EquipmentInfo5Service {
      * 复位及时率
      */
     public void resetRate(Date currentDate) throws Exception {
-        //调度时间是第二天,currentDate 是第一天
+        //调度时间是第二天,currentDate 是第一天
         Date endDate = DateUtils.addDays(currentDate, 1);
 
-
-        List<ProEconShutdownEvent2> shutdownevents = proEconShutdownEvent2Service.list().stream().filter(i ->
-                i.getWinpowerstationId().contains("FDC")
-                        && (i.getStopTime().compareTo(currentDate) == 0 || i.getStopTime().after(currentDate))
-                        && (i.getStopTime().compareTo(endDate) == 0 || i.getStopTime().before(endDate))
-                        && i.getStopTypeId() != null && i.getStopHours() != null
-                        && !i.getStopTypeId().equals("wh")
-        ).collect(Collectors.toList());
+        QueryWrapper<ProEconShutdownEvent2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("stop_Time",currentDate).le("stop_Time",endDate)
+                .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.getStopTime().compareTo(currentDate) == 0 || i.getStopTime().after(currentDate))
+//                        && (i.getStopTime().compareTo(endDate) == 0 || i.getStopTime().before(endDate))
+//                        && i.getStopTypeId() != null && i.getStopHours() != null
+//                        && !i.getStopTypeId().equals("wh")
+//        ).collect(Collectors.toList());
 
 
         Map<String, ProEconEquipmentInfoDay5> rates = new HashMap<>();
@@ -146,8 +150,14 @@ public class EquipmentInfo5Service {
             stateRate(currentDate,rates);
         }
         List<ProEconEquipmentInfoDay5> dayls=new ArrayList<>();
-            List<String> dayInfoids = proEconEquipmentInfoDay5Service.list().stream().filter(i -> i.getRecordDate().compareTo(currentDate) == 0
-            ).map(ProEconEquipmentInfoDay5::getId).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay5> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.ge("record_date",currentDate);
+
+            List<String> dayInfoids = proEconEquipmentInfoDay5Service.list(queryWrapper2)
+                    .stream()
+//                    .filter(i -> i.getRecordDate().compareTo(currentDate) == 0
+//            )
+        .map(ProEconEquipmentInfoDay5::getId).collect(Collectors.toList());
 
             ProEconEquipmentInfoDay5 dayInfo;
             if (!dayInfoids.isEmpty()) {

+ 87 - 55
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfoDayTopService.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+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.*;
@@ -36,12 +37,14 @@ public class EquipmentInfoDayTopService {
         Calendar c = Calendar.getInstance();
         c.setTime(recordDate);
 
-
+        QueryWrapper<ProEconEquipmentInfoDayTop> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",DateUtils.truncate(recordDate)).eq("types",1);
         //判断是否有重复记录,先删除重复记录
-        List<Long> idls = proEconEquipmentInfoDayTopService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getTypes() ==1
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconEquipmentInfoDayTop::getId)
+        List<Long> idls = proEconEquipmentInfoDayTopService.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getTypes() ==1
+//                        && CacheContext.wtmap.containsKey(i.getWindturbineId()))
+                .map(ProEconEquipmentInfoDayTop::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -92,10 +95,13 @@ public class EquipmentInfoDayTopService {
 
 
         //判断是否有重复记录,先删除重复记录
-        List<Long> idls = proEconEquipmentInfoDayTopService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getTypes() ==2
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconEquipmentInfoDayTop::getId)
+        QueryWrapper<ProEconEquipmentInfoDayTop> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",DateUtils.truncate(recordDate)).eq("types",2);
+        List<Long> idls = proEconEquipmentInfoDayTopService.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getTypes() ==2
+//                        && CacheContext.wtmap.containsKey(i.getWindturbineId()))
+                .map(ProEconEquipmentInfoDayTop::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -147,10 +153,13 @@ public class EquipmentInfoDayTopService {
 
 
         //判断是否有重复记录,先删除重复记录
-        List<Long> idls = proEconEquipmentInfoDayTopService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getTypes() ==3
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconEquipmentInfoDayTop::getId)
+        QueryWrapper<ProEconEquipmentInfoDayTop> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",DateUtils.truncate(recordDate)).eq("types",3);
+        List<Long> idls = proEconEquipmentInfoDayTopService.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getTypes() ==3
+//                        && CacheContext.wtmap.containsKey(i.getWindturbineId()))
+                .map(ProEconEquipmentInfoDayTop::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -207,10 +216,13 @@ public class EquipmentInfoDayTopService {
         peeidt.setYear(DateUtils.getYear(recordDate));
         peeidt.setMonth(DateUtils.getMonth(recordDate) + 1);
         initial(peeidt);
-        List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+        List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid1ls.isEmpty()) {
             ProEconEquipmentInfoDay1 pepid1 = pepid1ls.get(0);
@@ -240,11 +252,13 @@ public class EquipmentInfoDayTopService {
 
         }
 
-
-        List<ProEconEquipmentInfoDay2> pepid2ls = proEconEquipmentInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+        List<ProEconEquipmentInfoDay2> pepid2ls = proEconEquipmentInfoDay2Service.list(queryWrapper2);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid2ls.isEmpty()) {
             ProEconEquipmentInfoDay2 pepid2 = pepid2ls.get(0);
@@ -284,11 +298,13 @@ public class EquipmentInfoDayTopService {
 
 
         }
-
-        List<ProEconEquipmentInfoDay4> pepid4ls = proEconEquipmentInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper4 = new QueryWrapper<>();
+        queryWrapper4.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+        List<ProEconEquipmentInfoDay4> pepid4ls = proEconEquipmentInfoDay4Service.list(queryWrapper4);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid4ls.isEmpty()) {
             ProEconEquipmentInfoDay4 pepid4 = pepid4ls.get(0);
@@ -327,10 +343,13 @@ public class EquipmentInfoDayTopService {
         peeidt.setYear(DateUtils.getYear(recordDate));
         peeidt.setMonth(DateUtils.getMonth(recordDate) + 1);
         initial(peeidt);
-        List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+        List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid1ls.isEmpty()) {
             ProEconEquipmentInfoDay1 pepid1 = pepid1ls.get(0);
@@ -360,11 +379,13 @@ public class EquipmentInfoDayTopService {
 
         }
 
-
-        List<ProEconEquipmentInfoDay2> pepid2ls = proEconEquipmentInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+        List<ProEconEquipmentInfoDay2> pepid2ls = proEconEquipmentInfoDay2Service.list(queryWrapper2);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid2ls.isEmpty()) {
             ProEconEquipmentInfoDay2 pepid2 = pepid2ls.get(0);
@@ -404,11 +425,13 @@ public class EquipmentInfoDayTopService {
 
 
         }
-
-        List<ProEconEquipmentInfoDay4> pepid4ls = proEconEquipmentInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper4 = new QueryWrapper<>();
+        queryWrapper4.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+        List<ProEconEquipmentInfoDay4> pepid4ls = proEconEquipmentInfoDay4Service.list(queryWrapper4);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid4ls.isEmpty()) {
             ProEconEquipmentInfoDay4 pepid4 = pepid4ls.get(0);
@@ -447,10 +470,15 @@ public class EquipmentInfoDayTopService {
         peeidt.setYear(DateUtils.getYear(recordDate));
         peeidt.setMonth(DateUtils.getMonth(recordDate) + 1);
         initial(peeidt);
-        List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+
+        QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+
+        List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid1ls.isEmpty()) {
             ProEconEquipmentInfoDay1 pepid1 = pepid1ls.get(0);
@@ -480,11 +508,13 @@ public class EquipmentInfoDayTopService {
 
         }
 
-
-        List<ProEconEquipmentInfoDay2> pepid2ls = proEconEquipmentInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+        List<ProEconEquipmentInfoDay2> pepid2ls = proEconEquipmentInfoDay2Service.list(queryWrapper2);
+//        .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid2ls.isEmpty()) {
             ProEconEquipmentInfoDay2 pepid2 = pepid2ls.get(0);
@@ -524,11 +554,13 @@ public class EquipmentInfoDayTopService {
 
 
         }
-
-        List<ProEconEquipmentInfoDay4> pepid4ls = proEconEquipmentInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getWindturbineId().equals(wt.getId())
-                ).collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper4 = new QueryWrapper<>();
+        queryWrapper4.ge("record_date",DateUtils.truncate(recordDate)).eq("windturbine_id",wt.getId());
+        List<ProEconEquipmentInfoDay4> pepid4ls = proEconEquipmentInfoDay4Service.list(queryWrapper4);
+//        .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getWindturbineId().equals(wt.getId())
+//                ).collect(Collectors.toList());
 
         if (!pepid4ls.isEmpty()) {
             ProEconEquipmentInfoDay4 pepid4 = pepid4ls.get(0);

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

@@ -1,6 +1,7 @@
 package com.gyee.generation.service;
 
 
+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;
@@ -17,7 +18,6 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.*;
-import java.util.stream.Collectors;
 
 @Service
 public class GoodnessOfFitService {
@@ -55,10 +55,12 @@ public class GoodnessOfFitService {
         List<FitClassVo> theList = new ArrayList<>();
 
            List<ProEconWtCurveFittingMonth> powerList;
-
-            powerList = proEconWtCurveFittingMonthService.list().stream().filter(i->i.getMonth().equals(month)
-                && i.getWindturbineId().equals(wtId)
-                && i.getYear().equals(year)).collect(Collectors.toList());
+        QueryWrapper<ProEconWtCurveFittingMonth> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("year",year).eq("month",month).eq("windturbine_id",wtId);
+            powerList = proEconWtCurveFittingMonthService.list(queryWrapper);
+//                    .stream().filter(i->i.getMonth().equals(month)
+//                && i.getWindturbineId().equals(wtId)
+//                && i.getYear().equals(year)).collect(Collectors.toList());
         ProBasicEquipment wt=CacheContext.wtmap.get(wtId);
 //            for (ProBasicEquipment wt : CacheContext.wtls)
 //

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

@@ -50,11 +50,14 @@ public class InputOrOutPutService {
 
             Map<String, ProBasicEquipmentPoint> pointmap= CacheContext.wtpAimap.get(wt.getNemCode());
 
-            List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list().stream()
-                    .filter(i -> i.getWindturbineId().equals(wt.getId())
-                            && (i.getRecordDate().compareTo(daybegin) == 0 || i.getRecordDate().after(daybegin))
-                            && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                           ).collect(Collectors.toList());
+            QueryWrapper<ProEconInputOrOutputSpeed> queryWrapper = new QueryWrapper<>();
+            queryWrapper.ge("record_date",daybegin).le("record_date",end).eq("windturbine_id",wt.getId());
+            List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list(queryWrapper);
+//            .stream()
+//                    .filter(i -> i.getWindturbineId().equals(wt.getId())
+//                            && (i.getRecordDate().compareTo(daybegin) == 0 || i.getRecordDate().after(daybegin))
+//                            && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                           ).collect(Collectors.toList());
 
             if(!recordList.isEmpty())
             {
@@ -169,16 +172,23 @@ public class InputOrOutPutService {
 
                     ProEconInOrOutSpeedTotal total1 = null;
                     ProEconInOrOutSpeedTotal2 total2 = null;
-                    Optional<ProEconInOrOutSpeedTotal> total1o = proEconInOrOutSpeedTotalService.list().stream()
-                            .filter(i -> i.getWindturbineId().equals(wt.getId())
-                                    && i.getRecordDate().compareTo(daybegin) == 0).findFirst();
+                    QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("record_date",daybegin).eq("windturbine_id",wt.getId());
+                    Optional<ProEconInOrOutSpeedTotal> total1o = proEconInOrOutSpeedTotalService.list(queryWrapper)
+                    .stream()
+//                            .filter(i -> i.getWindturbineId().equals(wt.getId())
+//                                    && i.getRecordDate().compareTo(daybegin) == 0)
+                                    .findFirst();
 
                     if (total1o.isPresent()) {
                         total1 = total1o.get();
                     }
-
-                    Optional<ProEconInOrOutSpeedTotal2> total2o = proEconInOrOutSpeedTotal2Service.list().stream().filter(i -> i.getWindturbineId().equals(wt.getId())
-                            && i.getRecordDate().compareTo(daybegin) == 0).findFirst();
+                    QueryWrapper<ProEconInOrOutSpeedTotal2> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",daybegin).eq("windturbine_id",wt.getId());
+                    Optional<ProEconInOrOutSpeedTotal2> total2o = proEconInOrOutSpeedTotal2Service.list(queryWrapper2).stream()
+//                            .filter(i -> i.getWindturbineId().equals(wt.getId())
+//                            && i.getRecordDate().compareTo(daybegin) == 0)
+                            .findFirst();
 
                     if (total2o.isPresent()) {
                         total2 = total2o.get();
@@ -786,8 +796,11 @@ public class InputOrOutPutService {
         buildMonth(end, monthbegin, windturbineId, total1, total2);
         buildyear(end, yearbegin, windturbineId, total1, total2);
 
-        List<ProEconInOrOutSpeedTotal> items = proEconInOrOutSpeedTotalService.list().stream()
-                .filter(i -> i.getWindturbineId().equals(windturbineId)).collect(Collectors.toList());
+        QueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("windturbine_id",windturbineId);
+        List<ProEconInOrOutSpeedTotal> items = proEconInOrOutSpeedTotalService.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getWindturbineId().equals(windturbineId)).collect(Collectors.toList());
 
         items.add(total1);
 
@@ -856,10 +869,12 @@ public class InputOrOutPutService {
 
 
 
-
-        List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list().stream()
-                .filter(i -> i.getWindturbineId().equals(windturbineId) && StringUtils.notEmp(i.getSpeed())
-                        && i.getSpeed() != 0).collect(Collectors.toList());
+        QueryWrapper<ProEconInputOrOutputSpeed> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("windturbine_id",windturbineId).isNotNull("speed").ne("speed",0);
+        List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list(queryWrapper2);
+//                .stream()
+//                .filter(i -> i.getWindturbineId().equals(windturbineId) && StringUtils.notEmp(i.getSpeed())
+//                        && i.getSpeed() != 0).collect(Collectors.toList());
 
 
         List<ProEconInputOrOutputSpeed> inputrecordList = recordList.stream()
@@ -924,12 +939,14 @@ public class InputOrOutPutService {
     private void buildDay(Date end, Date daybegin, String windturbineId, ProEconInOrOutSpeedTotal total1, ProEconInOrOutSpeedTotal2 total2) {
         int count;
 
-
-        List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list().stream()
-                .filter(i -> i.getWindturbineId().equals(windturbineId) && StringUtils.notEmp(i.getSpeed())
-                        && (i.getRecordDate().compareTo(daybegin) == 0 || i.getRecordDate().after(daybegin))
-                        && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                        && i.getSpeed() != 0).collect(Collectors.toList());
+        QueryWrapper<ProEconInputOrOutputSpeed> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",daybegin).le("record_date",end).eq("windturbine_id",windturbineId).isNotNull("speed");
+        List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getWindturbineId().equals(windturbineId) && StringUtils.notEmp(i.getSpeed())
+//                        && (i.getRecordDate().compareTo(daybegin) == 0 || i.getRecordDate().after(daybegin))
+//                        && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                        && i.getSpeed() != 0).collect(Collectors.toList());
 
 
         List<ProEconInputOrOutputSpeed> inputrecordList = recordList.stream()
@@ -1136,12 +1153,14 @@ public class InputOrOutPutService {
 
     private void buildMonth(Date end, Date monthbegin, String windturbineId, ProEconInOrOutSpeedTotal total1, ProEconInOrOutSpeedTotal2 total2) {
         int count;
-
-        List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list().stream()
-                .filter(i -> i.getWindturbineId().equals(windturbineId) && StringUtils.notEmp(i.getSpeed())
-                        && (i.getRecordDate().compareTo(monthbegin) == 0 || i.getRecordDate().after(monthbegin))
-                        && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                        && i.getSpeed() != 0).collect(Collectors.toList());
+        QueryWrapper<ProEconInputOrOutputSpeed> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",monthbegin).le("record_date",end).eq("windturbine_id",windturbineId).isNotNull("speed");
+        List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list(queryWrapper);
+//        .stream()
+//                .filter(i -> i.getWindturbineId().equals(windturbineId) && StringUtils.notEmp(i.getSpeed())
+//                        && (i.getRecordDate().compareTo(monthbegin) == 0 || i.getRecordDate().after(monthbegin))
+//                        && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                        && i.getSpeed() != 0).collect(Collectors.toList());
 
 
         List<ProEconInputOrOutputSpeed> inputrecordList = recordList.stream()
@@ -1345,11 +1364,14 @@ public class InputOrOutPutService {
 
     private void buildyear(Date end, Date yearbegin, String windturbineId, ProEconInOrOutSpeedTotal total1, ProEconInOrOutSpeedTotal2 total2) {
         int count;
-        List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list().stream()
-                .filter(i -> i.getWindturbineId().equals(windturbineId) && StringUtils.notEmp(i.getSpeed())
-                        && (i.getRecordDate().compareTo(yearbegin) == 0 || i.getRecordDate().after(yearbegin))
-                        && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                        && i.getSpeed() != 0).collect(Collectors.toList());
+        QueryWrapper<ProEconInputOrOutputSpeed> queryWrapper = new QueryWrapper<>();
+        queryWrapper.ge("record_date",yearbegin).le("record_date",end).eq("windturbine_id",windturbineId).isNotNull("speed");
+        List<ProEconInputOrOutputSpeed> recordList = proEconInputOrOutputSpeedService.list(queryWrapper);
+//        .stream()
+//                .filter(i -> i.getWindturbineId().equals(windturbineId) && StringUtils.notEmp(i.getSpeed())
+//                        && (i.getRecordDate().compareTo(yearbegin) == 0 || i.getRecordDate().after(yearbegin))
+//                        && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                        && i.getSpeed() != 0).collect(Collectors.toList());
 
 
         List<ProEconInputOrOutputSpeed> inputrecordList = recordList.stream()

+ 40 - 17
realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventnewService.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;
 
+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;
@@ -123,9 +124,10 @@ public class LimitEventnewService {
 
         //读取数据库存在的恢复时间为NULL的数据,并通过风机编号把数据遍历到对应的map
 
-
-        List<ProEconMainBrownouts> oldStatusQuery = proEconMainBrownoutsService.list().stream()
-                .filter(i -> StringUtils.empty(i.getStartTime()))
+        QueryWrapper<ProEconMainBrownouts> queryWrapper = new QueryWrapper<>();
+        queryWrapper.isNull("start_Time");
+        List<ProEconMainBrownouts> oldStatusQuery = proEconMainBrownoutsService.list(queryWrapper).stream()
+//                .filter(i -> StringUtils.empty(i.getStartTime()))
                 .sorted(Comparator.comparing(ProEconMainBrownouts::getStopTime)).collect(Collectors.toList());
 
         for (ProEconMainBrownouts oldMainBrownouts : oldStatusQuery) {
@@ -133,9 +135,10 @@ public class LimitEventnewService {
                 oldMainBrownoutsMap.put(oldMainBrownouts.getWindpowerstationId(), oldMainBrownouts);
             }
         }
-
-        List<ProEconMainBrownouts2> oldStatus2Query = proEconMainBrownouts2Service.list().stream()
-                .filter(i -> StringUtils.empty(i.getStartTime()))
+        QueryWrapper<ProEconMainBrownouts2> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.isNull("start_Time");
+        List<ProEconMainBrownouts2> oldStatus2Query = proEconMainBrownouts2Service.list(queryWrapper2).stream()
+//                .filter(i -> StringUtils.empty(i.getStartTime()))
                 .sorted(Comparator.comparing(ProEconMainBrownouts2::getStopTime)).collect(Collectors.toList());
 
         for (ProEconMainBrownouts2 oldMainBrownouts2 : oldStatus2Query) {
@@ -143,9 +146,10 @@ public class LimitEventnewService {
                 oldMainBrownouts2Map.put(oldMainBrownouts2.getWindpowerstationId(), oldMainBrownouts2);
             }
         }
-
-        List<ProEconBrownoutsEvent> oldStatus3Query = proEconBrownoutsEventService.list().stream()
-                .filter(i -> StringUtils.empty(i.getStartTime()))
+        QueryWrapper<ProEconBrownoutsEvent> queryWrapper3 = new QueryWrapper<>();
+        queryWrapper3.isNull("start_Time");
+        List<ProEconBrownoutsEvent> oldStatus3Query = proEconBrownoutsEventService.list(queryWrapper3).stream()
+//                .filter(i -> StringUtils.empty(i.getStartTime()))
                 .sorted(Comparator.comparing(ProEconBrownoutsEvent::getStopTime)).collect(Collectors.toList());
 
         for (ProEconBrownoutsEvent oldBrownouts : oldStatus3Query) {
@@ -153,9 +157,10 @@ public class LimitEventnewService {
                 oldBrownoutsStatusMap.put(oldBrownouts.getWindturbineId(), oldBrownouts);
             }
         }
-
-        List<ProEconBrownoutsEvent2> oldStatus4Query = proEconBrownoutsEvent2Service.list().stream()
-                .filter(i -> StringUtils.empty(i.getStartTime()))
+        QueryWrapper<ProEconBrownoutsEvent2> queryWrapper4 = new QueryWrapper<>();
+        queryWrapper4.isNull("start_Time");
+        List<ProEconBrownoutsEvent2> oldStatus4Query = proEconBrownoutsEvent2Service.list(queryWrapper4).stream()
+//                .filter(i -> StringUtils.empty(i.getStartTime()))
                 .sorted(Comparator.comparing(ProEconBrownoutsEvent2::getStopTime)).collect(Collectors.toList());
 
         for (ProEconBrownoutsEvent2 oldBrownouts2 : oldStatus4Query) {
@@ -247,8 +252,14 @@ public class LimitEventnewService {
 
                 if (mainBrownouts != null) {
                     ProEconMainBrownouts finalItem = mainBrownouts;
-                    List<ProEconMainBrownouts> ls = proEconMainBrownoutsService.list().stream().filter(i -> i.getWindpowerstationId().equals(finalItem.getWindpowerstationId()) && i.getStopTime().compareTo(finalItem.getStopTime()) == 0).collect(Collectors.toList());
-
+                    QueryWrapper<ProEconMainBrownouts> queryWrapper5 = new QueryWrapper<>();
+                    queryWrapper5.eq("windpowerstation_id", finalItem.getWindpowerstationId()).eq("stop_Time",finalItem.getStopTime());
+                    List<ProEconMainBrownouts> ls = proEconMainBrownoutsService.list(queryWrapper5);
+//                            .stream()
+//                            .filter(i -> i.getWindpowerstationId().equals(finalItem.getWindpowerstationId())
+//                                    && i.getStopTime().compareTo(finalItem.getStopTime()) == 0)
+                    //.collect(Collectors.toList());
+//
                     if (ls.isEmpty()) {
                         proEconMainBrownoutsService.save(finalItem);
                         oldMainBrownoutsMap.put(wpId, null);
@@ -273,7 +284,11 @@ public class LimitEventnewService {
                 mainBrownouts2 = oldMainBrownouts2Map.get(wpId);
                 if (mainBrownouts2 != null) {
                     ProEconMainBrownouts2 finalItem = mainBrownouts2;
-                    List<ProEconMainBrownouts2> ls = proEconMainBrownouts2Service.list().stream().filter(i -> i.getWindpowerstationId().equals(finalItem.getWindpowerstationId()) && i.getStopTime().compareTo(finalItem.getStopTime()) == 0).collect(Collectors.toList());
+                    QueryWrapper<ProEconMainBrownouts2> queryWrapper5 = new QueryWrapper<>();
+                    queryWrapper5.eq("windpowerstation_id", finalItem.getWindpowerstationId()).eq("stop_Time",finalItem.getStopTime());
+                    List<ProEconMainBrownouts2> ls = proEconMainBrownouts2Service.list(queryWrapper5);
+//                            .stream().filter(i -> i.getWindpowerstationId().equals(finalItem.getWindpowerstationId())
+//                                    && i.getStopTime().compareTo(finalItem.getStopTime()) == 0).collect(Collectors.toList());
 
                     if (ls.isEmpty()) {
                         proEconMainBrownouts2Service.save(finalItem);
@@ -375,7 +390,11 @@ public class LimitEventnewService {
                 brownoutsEvent = oldBrownoutsStatusMap.get(wtId);
                 if (brownoutsEvent != null) {
                     ProEconBrownoutsEvent finalItem = brownoutsEvent;
-                    List<ProEconBrownoutsEvent> ls = proEconBrownoutsEventService.list().stream().filter(i -> i.getWindpowerstationId().equals(finalItem.getWindpowerstationId()) && i.getStopTime().compareTo(finalItem.getStopTime()) == 0).collect(Collectors.toList());
+                    QueryWrapper<ProEconBrownoutsEvent> queryWrapper5 = new QueryWrapper<>();
+                    queryWrapper5.eq("windpowerstation_id", finalItem.getWindpowerstationId()).eq("stop_Time",finalItem.getStopTime());
+                    List<ProEconBrownoutsEvent> ls = proEconBrownoutsEventService.list(queryWrapper5);
+//                            .stream().filter(i -> i.getWindpowerstationId().equals(finalItem.getWindpowerstationId())
+//                                    && i.getStopTime().compareTo(finalItem.getStopTime()) == 0).collect(Collectors.toList());
 
                     if (ls.isEmpty()) {
                         proEconBrownoutsEventService.save(finalItem);
@@ -393,7 +412,11 @@ public class LimitEventnewService {
                 brownoutsEvent2 = oldBrownoutsStatus2Map.get(wtId);
                 if (brownoutsEvent2 != null) {
                     ProEconBrownoutsEvent2 finalItem = brownoutsEvent2;
-                    List<ProEconBrownoutsEvent2> ls = proEconBrownoutsEvent2Service.list().stream().filter(i -> i.getWindpowerstationId().equals(finalItem.getWindpowerstationId()) && i.getStopTime().compareTo(finalItem.getStopTime()) == 0).collect(Collectors.toList());
+                    QueryWrapper<ProEconBrownoutsEvent2> queryWrapper5 = new QueryWrapper<>();
+                    queryWrapper5.eq("windpowerstation_id", finalItem.getWindpowerstationId()).eq("stop_Time",finalItem.getStopTime());
+                    List<ProEconBrownoutsEvent2> ls = proEconBrownoutsEvent2Service.list(queryWrapper5);
+//                            .stream().filter(i -> i.getWindpowerstationId().equals(finalItem.getWindpowerstationId())
+//                                    && i.getStopTime().compareTo(finalItem.getStopTime()) == 0).collect(Collectors.toList());
 
                     if (ls.isEmpty()) {
                         proEconBrownoutsEvent2Service.save(finalItem);

+ 156 - 112
realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeService.java

@@ -194,16 +194,23 @@ public class PowerCurveFittingByTimeService {
 //*********************************************日曲线偏差上个日和上一年记录**********************************************************/
             Date d1 = DateUtils.addDays(recordDate, -1);
             Date d2 = DateUtils.addYears(recordDate, -1);
-
-            List<ProEconWtCurveFitting> wcfls = proEconWtCurveFittingService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
-                    i.getRecordDate().compareTo(d1) == 0).sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
+            QueryWrapper<ProEconWtCurveFitting> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("record_date",d1).eq("windturbine_id",key);
+            List<ProEconWtCurveFitting> wcfls = proEconWtCurveFittingService.list(queryWrapper)
+                    .stream()
+//                    .filter(i -> i.getWindturbineId().equals(key) &&
+//                    i.getRecordDate().compareTo(d1) == 0)
+                    .sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
 
 
             dayBuildPoints(wcfls, dayLastMonthPoints);
 
-
-            wcfls = proEconWtCurveFittingService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
-                    i.getRecordDate().compareTo(d2) == 0).sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
+            QueryWrapper<ProEconWtCurveFitting> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",d2).eq("windturbine_id",key);
+            wcfls = proEconWtCurveFittingService.list(queryWrapper2).stream()
+//                    .filter(i -> i.getWindturbineId().equals(key) &&
+//                    i.getRecordDate().compareTo(d2) == 0)
+                    .sorted(Comparator.comparing(ProEconWtCurveFitting::getSpeed)).collect(Collectors.toList());
 
             //与轶总的原始代码对比不一致,临时修改测试
             dayBuildPoints(wcfls, dayLastMonthPoints);
@@ -227,8 +234,12 @@ public class PowerCurveFittingByTimeService {
 
 
             //*********************************************当日曲线偏差记录**********************************************************/
-            Optional<ProEconCurveFittingMain> cfmdayo = proEconCurveFittingMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
-                    && i.getRecordDate().compareTo(recordDate) == 0).findFirst();
+            QueryWrapper<ProEconCurveFittingMain> queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.eq("record_date",recordDate).eq("windturbine_id",key);
+            Optional<ProEconCurveFittingMain> cfmdayo = proEconCurveFittingMainService.list(queryWrapper3).stream()
+//                    .filter(i -> i.getWindturbineId().equals(key)
+//                    && i.getRecordDate().compareTo(recordDate) == 0)
+                    .findFirst();
             ProEconCurveFittingMain cfmday;
 
             if (cfmdayo.isPresent()) {
@@ -435,14 +446,20 @@ public class PowerCurveFittingByTimeService {
 
 
 //*********************************************月曲线偏差上个月和上一年记录**********************************************************/
-
-            List<ProEconWtCurveFittingMonth> wcfmls = proEconWtCurveFittingMonthService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
-                    i.getYear().equals(stringyear2) && i.getMonth().equals(stringmonth2)).sorted(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed)).collect(Collectors.toList());
+            QueryWrapper<ProEconWtCurveFittingMonth> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("year",stringyear2).eq("month",stringmonth2).eq("windturbine_id",key);
+            List<ProEconWtCurveFittingMonth> wcfmls = proEconWtCurveFittingMonthService.list(queryWrapper).stream()
+//                    .filter(i -> i.getWindturbineId().equals(key) &&
+//                    i.getYear().equals(stringyear2) && i.getMonth().equals(stringmonth2))
+                    .sorted(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed)).collect(Collectors.toList());
 
             monthBuildPoints(wcfmls, monthLastMonthPoints);
-
-            wcfmls = proEconWtCurveFittingMonthService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
-                    i.getYear().equals(stringyear3) && i.getMonth().equals(stringmonth3)).sorted(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed)).collect(Collectors.toList());
+            QueryWrapper<ProEconWtCurveFittingMonth> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("year",stringyear3).eq("month",stringmonth3).eq("windturbine_id",key);
+            wcfmls = proEconWtCurveFittingMonthService.list(queryWrapper2).stream()
+//                    .filter(i -> i.getWindturbineId().equals(key) &&
+//                    i.getYear().equals(stringyear3) && i.getMonth().equals(stringmonth3))
+                    .sorted(Comparator.comparing(ProEconWtCurveFittingMonth::getSpeed)).collect(Collectors.toList());
 
             monthBuildPoints(wcfmls, monthLastYearPoints);
 //*********************************************月曲线偏差上个月和上一年记录**********************************************************/
@@ -466,8 +483,12 @@ public class PowerCurveFittingByTimeService {
 
 
 //*********************************************当月曲线偏差记录**********************************************************/
-            Optional<ProEconCurveFittMonthMain> cfmmontho = proEconCurveFittMonthMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
-                    && i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth)).findFirst();
+            QueryWrapper<ProEconCurveFittMonthMain> queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.eq("year",stringyear).eq("month",stringmonth).eq("windturbine_id",key);
+            Optional<ProEconCurveFittMonthMain> cfmmontho = proEconCurveFittMonthMainService.list(queryWrapper3).stream()
+//                    .filter(i -> i.getWindturbineId().equals(key)
+//                    && i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth))
+                    .findFirst();
             ProEconCurveFittMonthMain cfmmonth;
             if (cfmmontho.isPresent()) {
                 cfmmonth = cfmmontho.get();
@@ -631,8 +652,12 @@ public class PowerCurveFittingByTimeService {
 
             //拟合年功率曲线
           //  curveFittingBuilder(begin, end, dimension, scale, windMap.get(key).getPointIdGL(), windMap.get(key).getPointIdFS(), windMap.get(key).getPointIdZT(), windMap.get(key).getNsjglPoints(), windMap.get(key).getNzyglPoints(), key);
-
-            List<ProEconWtPowerCurveFitting> wtpowerls= proEconWtPowerCurveFittingService.list().stream().filter(i->i.getWindturbineId().equals(key)).sorted(Comparator.comparing(ProEconWtPowerCurveFitting::getSpeed)).collect(Collectors.toList());
+            QueryWrapper<ProEconWtPowerCurveFitting> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windturbine_id",key);
+            List<ProEconWtPowerCurveFitting> wtpowerls= proEconWtPowerCurveFittingService.list(queryWrapper)
+                    .stream()
+//                    .filter(i->i.getWindturbineId().equals(key))
+                    .sorted(Comparator.comparing(ProEconWtPowerCurveFitting::getSpeed)).collect(Collectors.toList());
 
             List<PointVo> zyglls=new ArrayList<>();
             List<PointVo> sjglls=new ArrayList<>();
@@ -704,9 +729,12 @@ public class PowerCurveFittingByTimeService {
 
             // /*********************************************年曲线偏差上个月和上一年记录**********************************************************/
 
-
-            List<ProEconWtCurveFittingYear> wcfyls = proEconWtCurveFittingYearService.list().stream().filter(i -> i.getWindturbineId().equals(key) &&
-                    i.getYear().equals(stringyear3)).sorted(Comparator.comparing(ProEconWtCurveFittingYear::getSpeed)).collect(Collectors.toList());
+            QueryWrapper<ProEconWtCurveFittingYear> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("year",stringyear3).eq("windturbine_id",key);
+            List<ProEconWtCurveFittingYear> wcfyls = proEconWtCurveFittingYearService.list(queryWrapper).stream()
+//                    .filter(i -> i.getWindturbineId().equals(key) &&
+//                    i.getYear().equals(stringyear3))
+                    .sorted(Comparator.comparing(ProEconWtCurveFittingYear::getSpeed)).collect(Collectors.toList());
 
             //与轶总的原始代码对比不一致,新增代码修改测试
             yearBuildPoints(wcfyls, yearLastMonthPoints);
@@ -732,8 +760,13 @@ public class PowerCurveFittingByTimeService {
 //*********************************************年曲线偏差记录**********************************************************/
 
 //*********************************************当年曲线偏差记录**********************************************************/
-            Optional<ProEconCurveFittYearMain> cfmyearo = proEconCurveFittYearMainService.list().stream().filter(i -> i.getWindturbineId().equals(key)
-                    && i.getYear().equals(stringyear)).findFirst();
+            QueryWrapper<ProEconCurveFittYearMain> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("year",stringyear).eq("windturbine_id",key);
+            Optional<ProEconCurveFittYearMain> cfmyearo = proEconCurveFittYearMainService.list(queryWrapper2)
+                    .stream()
+//                    .filter(i -> i.getWindturbineId().equals(key)
+//                    && i.getYear().equals(stringyear))
+                    .findFirst();
             ProEconCurveFittYearMain cfmyear;
             if (cfmyearo.isPresent()) {
                 cfmyear = cfmyearo.get();
@@ -799,8 +832,13 @@ public class PowerCurveFittingByTimeService {
         String speedStr = String.valueOf(speed);
 
 //*********************************************当日曲线偏差子表记录**********************************************************/
-        Optional<ProEconCurveFittingSub> cfmso = proEconCurveFittingSubService.list().stream().filter(i -> i.getWindturbineId().equals(key)
-                && i.getRecordDate().compareTo(current) == 0 && i.getSpeed().equals(speedStr)).findFirst();
+        QueryWrapper<ProEconCurveFittingSub> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("record_date",current).eq("speed",speedStr).eq("windturbine_id",key);
+        Optional<ProEconCurveFittingSub> cfmso = proEconCurveFittingSubService.list(queryWrapper2)
+                .stream()
+//                .filter(i -> i.getWindturbineId().equals(key)
+//                && i.getRecordDate().compareTo(current) == 0 && i.getSpeed().equals(speedStr))
+                .findFirst();
         ProEconCurveFittingSub cfms;
 
         if (cfmso.isPresent()) {
@@ -841,9 +879,12 @@ public class PowerCurveFittingByTimeService {
         String speedStr = String.valueOf(speed);
 
         //*********************************************当月曲线偏差子表记录**********************************************************/
-
-        Optional<ProEconCurveFittMonthSub> cfmsmontho = proEconCurveFittMonthSubService.list().stream().filter(i -> i.getWindturbineId().equals(key)
-                && i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth) && i.getSpeed().equals(speedStr)).findFirst();
+        QueryWrapper<ProEconCurveFittingSub> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("year",stringyear).eq("month",stringmonth).eq("speed",speedStr).eq("windturbine_id",key);
+        Optional<ProEconCurveFittMonthSub> cfmsmontho = proEconCurveFittMonthSubService.list().stream()
+//                .filter(i -> i.getWindturbineId().equals(key)
+//                && i.getYear().equals(stringyear) && i.getMonth().equals(stringmonth) && i.getSpeed().equals(speedStr))
+                .findFirst();
         ProEconCurveFittMonthSub cfmsmonth;
 
         if (cfmsmontho.isPresent()) {
@@ -888,9 +929,12 @@ public class PowerCurveFittingByTimeService {
         String speedStr = String.valueOf(speed);
 
         //*********************************************当年曲线偏差子表记录**********************************************************/
-
-        Optional<ProEconCurveFittYearSub> cfmsyearo = proEconCurveFittYearSubService.list().stream().filter(i -> i.getWindturbineId().equals(key)
-                && i.getYear().equals(stringyear) && i.getSpeed().equals(speedStr)).findFirst();
+        QueryWrapper<ProEconCurveFittYearSub> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("year",stringyear).eq("speed",speedStr).eq("windturbine_id",key);
+        Optional<ProEconCurveFittYearSub> cfmsyearo = proEconCurveFittYearSubService.list(queryWrapper).stream()
+//                .filter(i -> i.getWindturbineId().equals(key)
+//                && i.getYear().equals(stringyear) && i.getSpeed().equals(speedStr))
+                .findFirst();
         ProEconCurveFittYearSub cfmsyear;
 
         if (cfmsyearo.isPresent()) {
@@ -1363,87 +1407,87 @@ public class PowerCurveFittingByTimeService {
         }
 
 
-        //设置时间为10分钟前,10钟前有停机事件数据进行过滤
-        Calendar c = Calendar.getInstance();
-        c.setTimeInMillis(zt.getPointTime());
-        Date end = c.getTime();
-        c.add(Calendar.MINUTE, -10);
-        Date bedin = c.getTime();
-        List<PointData> points = edosUtil.getHistoryDatasSnap(zt.getEdnaId(), bedin.getTime() / 1000, end.getTime() / 1000);
-        if (!points.isEmpty()) {
-            for (PointData p : points) {
-                if (p.getPointValueInDouble() == 4) {
-
-                    return false;
-                }
-
-            }
-
-        }
-
-        //设置时间为10分钟后,运行后10分钟数据进行过滤
-
-        points = edosUtil.getHistoryDatasSnap(zt.getEdnaId(), bedin.getTime() / 1000, end.getTime() / 1000);
-        if (!points.isEmpty()) {
-            for (PointData p : points) {
-                if (p.getPointValueInDouble() != 2) {
-                    return false;
-
-                }
-
-            }
-
-        }
-
-
-        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
-        Map<String, ProBasicEquipmentPoint> wtpointmap = wtpAimap.get(windturbineId);
-
-
-        List<PointVo> bzPointls=new ArrayList<>();
-        List<PointVo> sjPointls=new ArrayList<>();
-
-        double modelpower=0.0;
-        if (CacheContext.wtmap.containsKey(windturbineId)) {
-            String modelid = CacheContext.wtmap.get(windturbineId).getModelId();
-            if (StringUtils.notEmp(modelid)) {
-                //获取保证功率曲线中的风速和功率
-                if (CacheContext.theoreticalPowerMap.containsKey(modelid)) {
-                    Map<Double,ProBasicModelPowerRd> theoreticalMap= CacheContext.theoreticalPowerMap.get(modelid);
-
-                    PointVo point = new PointVo();
-                    double speed=StringUtils.round(fs.getPointValueInDouble(),2);
-                    point.setX(speed);
-                    point.setY(theoreticalMap.get(speed).getEnsurePower());
-                    modelpower=point.getY();
-                    bzPointls.add(point);
-                }
-            }
-        }
-
-        PointVo point = new PointVo();
-        double speed=StringUtils.round(fs.getPointValueInDouble(),2);
-        double power=StringUtils.round(gl.getPointValueInDouble(),2);
-        point.setX(speed);
-        point.setY(power);
-        sjPointls.add(point);
-
-        //与保证功率进行对比,偏差大于25%的进行过滤
-        double value= pcl2( sjPointls, bzPointls, modelpower, speed);
-
-        if (value > Math.abs(0.25)) {
-            return false;
-        }
-
-        List<String> pointid = new ArrayList<>();
-        //欠发状态大于2过滤掉
-        pointid.add(wtpointmap.get(ContantXk.LSQFZT).getNemCode());
-        List<PointData> values = edosUtil.getHistMatrix(pointid, gl.getPointTime() / 1000);
-        if (null != values && values.size() > 0) {
-            double qfzt = values.get(0).getPointValueInDouble();
-
-            return !(qfzt > 2);
-        }
+//        //设置时间为10分钟前,10钟前有停机事件数据进行过滤
+//        Calendar c = Calendar.getInstance();
+//        c.setTimeInMillis(zt.getPointTime());
+//        Date end = c.getTime();
+//        c.add(Calendar.MINUTE, -10);
+//        Date bedin = c.getTime();
+//        List<PointData> points = edosUtil.getHistoryDatasSnap(zt.getEdnaId(), bedin.getTime() / 1000, end.getTime() / 1000);
+//        if (!points.isEmpty()) {
+//            for (PointData p : points) {
+//                if (p.getPointValueInDouble() == 4) {
+//
+//                    return false;
+//                }
+//
+//            }
+//
+//        }
+//
+//        //设置时间为10分钟后,运行后10分钟数据进行过滤
+//
+//        points = edosUtil.getHistoryDatasSnap(zt.getEdnaId(), bedin.getTime() / 1000, end.getTime() / 1000);
+//        if (!points.isEmpty()) {
+//            for (PointData p : points) {
+//                if (p.getPointValueInDouble() != 2) {
+//                    return false;
+//
+//                }
+//
+//            }
+//
+//        }
+//
+//
+//        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+//        Map<String, ProBasicEquipmentPoint> wtpointmap = wtpAimap.get(windturbineId);
+//
+//
+//        List<PointVo> bzPointls=new ArrayList<>();
+//        List<PointVo> sjPointls=new ArrayList<>();
+//
+//        double modelpower=0.0;
+//        if (CacheContext.wtmap.containsKey(windturbineId)) {
+//            String modelid = CacheContext.wtmap.get(windturbineId).getModelId();
+//            if (StringUtils.notEmp(modelid)) {
+//                //获取保证功率曲线中的风速和功率
+//                if (CacheContext.theoreticalPowerMap.containsKey(modelid)) {
+//                    Map<Double,ProBasicModelPowerRd> theoreticalMap= CacheContext.theoreticalPowerMap.get(modelid);
+//
+//                    PointVo point = new PointVo();
+//                    double speed=StringUtils.round(fs.getPointValueInDouble(),2);
+//                    point.setX(speed);
+//                    point.setY(theoreticalMap.get(speed).getEnsurePower());
+//                    modelpower=point.getY();
+//                    bzPointls.add(point);
+//                }
+//            }
+//        }
+//
+//        PointVo point = new PointVo();
+//        double speed=StringUtils.round(fs.getPointValueInDouble(),2);
+//        double power=StringUtils.round(gl.getPointValueInDouble(),2);
+//        point.setX(speed);
+//        point.setY(power);
+//        sjPointls.add(point);
+//
+//        //与保证功率进行对比,偏差大于25%的进行过滤
+//        double value= pcl2( sjPointls, bzPointls, modelpower, speed);
+//
+//        if (value > Math.abs(0.25)) {
+//            return false;
+//        }
+//
+//        List<String> pointid = new ArrayList<>();
+//        //欠发状态大于2过滤掉
+//        pointid.add(wtpointmap.get(ContantXk.LSQFZT).getNemCode());
+//        List<PointData> values = edosUtil.getHistMatrix(pointid, gl.getPointTime() / 1000);
+//        if (null != values && values.size() > 0) {
+//            double qfzt = values.get(0).getPointValueInDouble();
+//
+//            return !(qfzt > 2);
+//        }
         return true;
     }
 

+ 38 - 15
realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownnewService.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;
 
+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;
@@ -105,8 +106,10 @@ public class ShutdownnewService {
 //******************************************************************************************************/
 
         //读取数据库存在的恢复时间为NULL的数据,并通过风机编号把数据遍历到对应的map
-        List<ProEconWindturbineStatus> oldStatusQuery=proEconWindturbineStatusService.list().stream()
-                .filter(i->StringUtils.empty(i.getStartTime()))
+        QueryWrapper<ProEconWindturbineStatus> queryWrapper = new QueryWrapper<>();
+        queryWrapper.isNull("start_Time");
+        List<ProEconWindturbineStatus> oldStatusQuery=proEconWindturbineStatusService.list(queryWrapper).stream()
+//                .filter(i->StringUtils.empty(i.getStartTime()))
                 .sorted(Comparator.comparing(ProEconWindturbineStatus::getStopTime)).collect(Collectors.toList());
 
         for (ProEconWindturbineStatus oldStatus : oldStatusQuery)
@@ -116,9 +119,10 @@ public class ShutdownnewService {
                 oldStatusMap.put(oldStatus.getWindturbineId(),oldStatus);
             }
         }
-
-        List<ProEconShutdownEvent> oldShutdwonQuery=proEconShutdownEventService.list().stream()
-                .filter(i->StringUtils.empty(i.getStartTime()))
+        QueryWrapper<ProEconShutdownEvent> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.isNull("start_Time");
+        List<ProEconShutdownEvent> oldShutdwonQuery=proEconShutdownEventService.list(queryWrapper2).stream()
+//                .filter(i->StringUtils.empty(i.getStartTime()))
                 .sorted(Comparator.comparing(ProEconShutdownEvent::getStopTime)).collect(Collectors.toList());
 
         for (ProEconShutdownEvent shutdown : oldShutdwonQuery)
@@ -128,9 +132,10 @@ public class ShutdownnewService {
                 oldShutdownEvent.put(shutdown.getWindturbineId(),shutdown);
             }
         }
-
-        List<ProEconInterruption> oldInterrupQuery=proEconInterruptionService.list().stream()
-                .filter(i->StringUtils.empty(i.getStartTime()))
+        QueryWrapper<ProEconInterruption> queryWrapper3 = new QueryWrapper<>();
+        queryWrapper3.isNull("start_Time");
+        List<ProEconInterruption> oldInterrupQuery=proEconInterruptionService.list(queryWrapper3).stream()
+//                .filter(i->StringUtils.empty(i.getStartTime()))
                 .sorted(Comparator.comparing(ProEconInterruption::getStopTime)).collect(Collectors.toList());
 
         for (ProEconInterruption interrup : oldInterrupQuery)
@@ -140,9 +145,10 @@ public class ShutdownnewService {
                 oldInterrup.put(interrup.getWindturbineId(),interrup);
             }
         }
-
-        List<ProEconShutdownEvent2> oldShutdwonQuery2=proEconShutdownEvent2Service.list().stream()
-                .filter(i->StringUtils.empty(i.getStartTime()))
+        QueryWrapper<ProEconShutdownEvent2> queryWrapper4 = new QueryWrapper<>();
+        queryWrapper4.isNull("start_Time");
+        List<ProEconShutdownEvent2> oldShutdwonQuery2=proEconShutdownEvent2Service.list(queryWrapper4).stream()
+//                .filter(i->StringUtils.empty(i.getStartTime()))
                 .sorted(Comparator.comparing(ProEconShutdownEvent2::getStopTime)).collect(Collectors.toList());
 
         for (ProEconShutdownEvent2 shutdown : oldShutdwonQuery2)
@@ -309,7 +315,11 @@ public class ShutdownnewService {
                 if(item!=null)
                 {
                     ProEconWindturbineStatus finalItem = item;
-                    List<ProEconWindturbineStatus> ls= proEconWindturbineStatusService.list().stream().filter(i->i.getWindturbineId().equals(finalItem.getWindturbineId()) && i.getStopTime().compareTo(finalItem.getStopTime())==0).collect(Collectors.toList());
+                    QueryWrapper<ProEconWindturbineStatus> queryWrapper9 = new QueryWrapper<>();
+                    queryWrapper9.eq("stop_Time",finalItem.getStopTime()).eq("windturbine_id",finalItem.getWindturbineId());
+                    List<ProEconWindturbineStatus> ls= proEconWindturbineStatusService.list(queryWrapper9);
+//                            .stream().filter(i->i.getWindturbineId().equals(finalItem.getWindturbineId())
+//                                    && i.getStopTime().compareTo(finalItem.getStopTime())==0).collect(Collectors.toList());
 
                     if(ls.isEmpty())
                     {
@@ -330,7 +340,12 @@ public class ShutdownnewService {
                 if(shutdwonEvent!=null)
                 {
                     ProEconShutdownEvent finalShutdwonEvent = shutdwonEvent;
-                    List<ProEconShutdownEvent> ls= proEconShutdownEventService.list().stream().filter(i->i.getWindturbineId().equals(finalShutdwonEvent.getWindturbineId()) && i.getStopTime().compareTo(finalShutdwonEvent.getStopTime())==0).collect(Collectors.toList());
+                    QueryWrapper<ProEconShutdownEvent> queryWrapper5 = new QueryWrapper<>();
+                    queryWrapper5.eq("stop_Time",finalShutdwonEvent.getStopTime()).eq("windturbine_id",finalShutdwonEvent.getWindturbineId());
+                    List<ProEconShutdownEvent> ls= proEconShutdownEventService.list(queryWrapper5);
+//                            .stream().filter(i->i.getWindturbineId().equals(finalShutdwonEvent.getWindturbineId())
+//                                    && i.getStopTime().compareTo(finalShutdwonEvent.getStopTime())==0)
+//                            .collect(Collectors.toList());
 
                     if(ls.isEmpty())
                     {
@@ -348,7 +363,11 @@ public class ShutdownnewService {
                 if(interrup!=null)
                 {
                     ProEconInterruption finalInterrup = interrup;
-                    List<ProEconInterruption> ls= proEconInterruptionService.list().stream().filter(i->i.getWindturbineId().equals(finalInterrup.getWindturbineId()) && i.getStopTime().compareTo(finalInterrup.getStopTime())==0).collect(Collectors.toList());
+                    QueryWrapper<ProEconInterruption> queryWrapper5 = new QueryWrapper<>();
+                    queryWrapper5.eq("stop_Time",finalInterrup.getStopTime()).eq("windturbine_id",finalInterrup.getWindturbineId());
+                    List<ProEconInterruption> ls= proEconInterruptionService.list(queryWrapper5);
+//                            .stream().filter(i->i.getWindturbineId().equals(finalInterrup.getWindturbineId())
+//                                    && i.getStopTime().compareTo(finalInterrup.getStopTime())==0).collect(Collectors.toList());
 
                     if(ls.isEmpty())
                     {
@@ -367,7 +386,11 @@ public class ShutdownnewService {
                 if(shutdwonEvent2!=null)
                 {
                     ProEconShutdownEvent2 finalShutdwonEvent1 = shutdwonEvent2;
-                    List<ProEconShutdownEvent2> ls= proEconShutdownEvent2Service.list().stream().filter(i->i.getWindturbineId().equals(finalShutdwonEvent1.getWindturbineId()) && i.getStopTime().compareTo(finalShutdwonEvent1.getStopTime())==0).collect(Collectors.toList());
+                    QueryWrapper<ProEconShutdownEvent2> queryWrapper5 = new QueryWrapper<>();
+                    queryWrapper5.eq("stop_Time",finalShutdwonEvent1.getStopTime()).eq("windturbine_id",finalShutdwonEvent1.getWindturbineId());
+                    List<ProEconShutdownEvent2> ls= proEconShutdownEvent2Service.list(queryWrapper5);
+//                            .stream().filter(i->i.getWindturbineId().equals(finalShutdwonEvent1.getWindturbineId())
+//                                    && i.getStopTime().compareTo(finalShutdwonEvent1.getStopTime())==0).collect(Collectors.toList());
 
                     if(ls.isEmpty())
                     {

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

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -32,11 +33,14 @@ public class WindPowerInfo1Service {
      */
     public void calRegionInfoDay(Date recordDate) throws Exception {
 
-        List<ProEconPowerstationInfoDay1> wpinfodayls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.cp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+        List<ProEconPowerstationInfoDay1> wpinfodayls = proEconPowerstationInfoDay1Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.cp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay1>>> rgmap = new HashMap<>();
@@ -82,10 +86,14 @@ public class WindPowerInfo1Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay1::getId)
+            QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.rg.getValue());
+            List<String> idls = proEconPowerstationInfoDay1Service.list(queryWrapper2)
+            .stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.rg.getValue()))
+                    .map(ProEconPowerstationInfoDay1::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -158,11 +166,13 @@ public class WindPowerInfo1Service {
      * 计算公司日信息
      */
     public void calCompanyInfoDay(Date recordDate) {
-
-        List<ProEconPowerstationInfoDay1> wpinfodayls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && i.getLocation().equals(Location.wp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<ProEconPowerstationInfoDay1> wpinfodayls = proEconPowerstationInfoDay1Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && i.getLocation().equals(Location.wp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay1>>> cpmap = new HashMap<>();
@@ -204,9 +214,12 @@ public class WindPowerInfo1Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                            && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay1::getId)
+            QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+            List<String> idls = proEconPowerstationInfoDay1Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                            && i.getLocation().equals(Location.cp.getValue()))
+                    .map(ProEconPowerstationInfoDay1::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -547,10 +560,13 @@ public class WindPowerInfo1Service {
 
 
         //判断是否有重复记录,先删除重复记录
+        QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
         List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay1::getId)
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+                .map(ProEconPowerstationInfoDay1::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -579,13 +595,18 @@ public class WindPowerInfo1Service {
                 //昨日的统计结果
                 cl.add(Calendar.DAY_OF_MONTH, -1);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepid1ls = proEconPowerstationInfoDay1Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-
-                                    && i.getLocation().equals(Location.wp.getValue())
-                                    && i.getWindpowerstationId().equals(wp.getId())
-                            )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("windpowerstation_id",wp.getId())
+                            .eq("location",Location.wp.getValue());
+                    pepid1ls = proEconPowerstationInfoDay1Service.list(queryWrapper2);
+//                    .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//
+//                                    && i.getLocation().equals(Location.wp.getValue())
+//                                    && i.getWindpowerstationId().equals(wp.getId())
+//                            )
+//                            .collect(Collectors.toList());
                 }
                 extracted(recordDate, end, begin, pointmap, pewp, pepid1ls);
 //*******************************************年信息统计*********************************************************/
@@ -613,10 +634,14 @@ public class WindPowerInfo1Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.pjmap.containsKey(i.getProjectId())
-                        && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay1::getId)
+        QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate))
+                .eq("location",Location.pj.getValue());
+        List<String> idls = proEconPowerstationInfoDay1Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.pjmap.containsKey(i.getProjectId())
+//                        && i.getLocation().equals(Location.pj.getValue()))
+                .map(ProEconPowerstationInfoDay1::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -650,13 +675,18 @@ public class WindPowerInfo1Service {
                 //昨日的统计结果
                 cl.add(Calendar.DAY_OF_MONTH, -1);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepid1ls = proEconPowerstationInfoDay1Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getLocation().equals(Location.pj.getValue())
-                                    && i.getProjectId().equals(pj.getId())
-
-                            )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("location",Location.pj.getValue())
+                            .eq("project_id",pj.getId());
+                    pepid1ls = proEconPowerstationInfoDay1Service.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getLocation().equals(Location.pj.getValue())
+//                                    && i.getProjectId().equals(pj.getId())
+//                            .collect(Collectors.toList());
+//
+//                            )
                 }
                 extracted(recordDate, end, begin, pointmap, pewp, pepid1ls);
 
@@ -682,10 +712,14 @@ public class WindPowerInfo1Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.lnmap.containsKey(i.getLineId())
-                        && i.getLocation().equals(Location.ln.getValue())).map(ProEconPowerstationInfoDay1::getId)
+        QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate))
+                .eq("location",Location.ln.getValue());
+        List<String> idls = proEconPowerstationInfoDay1Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.lnmap.containsKey(i.getLineId())
+//                        && i.getLocation().equals(Location.ln.getValue()))
+                .map(ProEconPowerstationInfoDay1::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -724,12 +758,17 @@ public class WindPowerInfo1Service {
                 //昨日的统计结果
                 cl.add(Calendar.DAY_OF_MONTH, -1);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepid1ls = proEconPowerstationInfoDay1Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getLocation().equals(Location.ln.getValue())
-                                    && i.getLineId().equals(ln.getId())
-                            )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("location",Location.ln.getValue())
+                            .eq("line_id",ln.getId());
+                    pepid1ls = proEconPowerstationInfoDay1Service.list(queryWrapper2);
+//                    .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getLocation().equals(Location.ln.getValue())
+//                                    && i.getLineId().equals(ln.getId())
+//                            )
+//                            .collect(Collectors.toList());
                 }
                 extracted(recordDate, end, begin, pointmap, pewp, pepid1ls);
 

+ 89 - 49
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo2Service.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -34,11 +35,14 @@ public class WindPowerInfo2Service {
      */
     public void calRegionInfoDay(Date recordDate) {
 
-        List<ProEconPowerstationInfoDay2> wpinfodayls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.cp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+        List<ProEconPowerstationInfoDay2> wpinfodayls = proEconPowerstationInfoDay2Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.cp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay2>>> rgmap = new HashMap<>();
@@ -82,10 +86,13 @@ public class WindPowerInfo2Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay2::getId)
+            QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.rg.getValue());
+            List<String> idls = proEconPowerstationInfoDay2Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.rg.getValue()))
+                    .map(ProEconPowerstationInfoDay2::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -157,12 +164,14 @@ public class WindPowerInfo2Service {
      * 计算公司日信息
      */
     public void calCompanyInfoDay(Date recordDate) {
-
-        List<ProEconPowerstationInfoDay2> wpinfodayls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<ProEconPowerstationInfoDay2> wpinfodayls = proEconPowerstationInfoDay2Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay2>>> cpmap = new HashMap<>();
@@ -204,10 +213,13 @@ public class WindPowerInfo2Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay2::getId)
+            QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+            List<String> idls = proEconPowerstationInfoDay2Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.cp.getValue()))
+                    .map(ProEconPowerstationInfoDay2::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -386,10 +398,14 @@ public class WindPowerInfo2Service {
 
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay2::getId)
+        QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+
+        List<String> idls = proEconPowerstationInfoDay2Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+                .map(ProEconPowerstationInfoDay2::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -419,13 +435,19 @@ public class WindPowerInfo2Service {
                 //昨日的统计结果
                 cl.add(Calendar.DAY_OF_MONTH, -1);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepidls = proEconPowerstationInfoDay2Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
 
-                                    && i.getLocation().equals(Location.wp.getValue())
-                                    && i.getWindpowerstationId().equals(wp.getId())
-                            )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("windpowerstation_id","wp.getId()")
+                            .eq("location",Location.wp.getValue());
+                    pepidls = proEconPowerstationInfoDay2Service.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//
+//                                    && i.getLocation().equals(Location.wp.getValue())
+//                                    && i.getWindpowerstationId().equals(wp.getId())
+//                            )
+//                            .collect(Collectors.toList());
                 }
                 calDetiall(pewp, end, begin, CacheContext.wpwtmap.get(wp.getId()), pepidls);
 
@@ -454,10 +476,14 @@ public class WindPowerInfo2Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.pjmap.containsKey(i.getProjectId())
-                        && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay2::getId)
+        QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate))
+                .eq("location",Location.pj.getValue());
+        List<String> idls = proEconPowerstationInfoDay2Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.pjmap.containsKey(i.getProjectId())
+//                        && i.getLocation().equals(Location.pj.getValue()))
+                        .map(ProEconPowerstationInfoDay2::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -492,13 +518,18 @@ public class WindPowerInfo2Service {
             //昨日的统计结果
             cl.add(Calendar.DAY_OF_MONTH, -1);
             if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                pepidls = proEconPowerstationInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-
-                                && i.getLocation().equals(Location.pj.getValue())
-                                && i.getProjectId().equals(pj.getId())
-                        )
-                        .collect(Collectors.toList());
+                QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                        .eq("location",Location.pj.getValue())
+                        .eq("project_id",pj.getId());
+                pepidls = proEconPowerstationInfoDay2Service.list();
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//
+//                                && i.getLocation().equals(Location.pj.getValue())
+//                                && i.getProjectId().equals(pj.getId())
+//                        )
+//                        .collect(Collectors.toList());
             }
             calDetiall(pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()), pepidls);
             calSimple(pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()), pepidls);
@@ -525,10 +556,14 @@ public class WindPowerInfo2Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
+        QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate))
+                .eq("location",Location.ln.getValue());
         List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.lnmap.containsKey(i.getLineId())
-                        && i.getLocation().equals(Location.ln.getValue())).map(ProEconPowerstationInfoDay2::getId)
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.lnmap.containsKey(i.getLineId())
+//                        && i.getLocation().equals(Location.ln.getValue()))
+                .map(ProEconPowerstationInfoDay2::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -569,12 +604,17 @@ public class WindPowerInfo2Service {
             //昨日的统计结果
             cl.add(Calendar.DAY_OF_MONTH, -1);
             if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                pepidls = proEconPowerstationInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getLocation().equals(Location.ln.getValue())
-                                && i.getLineId().equals(ln.getId())
-                        )
-                        .collect(Collectors.toList());
+                QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                        .eq("location",Location.ln.getValue())
+                        .eq("line_id",ln.getId());
+                pepidls = proEconPowerstationInfoDay2Service.list(queryWrapper2);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getLocation().equals(Location.ln.getValue())
+//                                && i.getLineId().equals(ln.getId())
+//                        )
+//                        .collect(Collectors.toList());
             }
             calDetiall(pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()), pepidls);
             calSimple(pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()), pepidls);

+ 90 - 51
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -32,11 +33,14 @@ public class WindPowerInfo3Service {
      */
     public void calRegionInfoDay(Date recordDate) {
 
-        List<ProEconPowerstationInfoDay3> wpinfodayls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.cp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+        List<ProEconPowerstationInfoDay3> wpinfodayls = proEconPowerstationInfoDay3Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.cp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay3>>> rgmap = new HashMap<>();
@@ -80,10 +84,13 @@ public class WindPowerInfo3Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay3::getId)
+            QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.rg.getValue());
+            List<String> idls = proEconPowerstationInfoDay3Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.rg.getValue()))
+                    .map(ProEconPowerstationInfoDay3::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -157,11 +164,14 @@ public class WindPowerInfo3Service {
      */
     public void calCompanyInfoDay(Date recordDate) {
 
-        List<ProEconPowerstationInfoDay3> wpinfodayls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<ProEconPowerstationInfoDay3> wpinfodayls = proEconPowerstationInfoDay3Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay3>>> cpmap = new HashMap<>();
@@ -203,10 +213,13 @@ public class WindPowerInfo3Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay3::getId)
+            QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+            List<String> idls = proEconPowerstationInfoDay3Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.cp.getValue()))
+                    .map(ProEconPowerstationInfoDay3::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -388,10 +401,13 @@ public class WindPowerInfo3Service {
 
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay3::getId)
+        QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<String> idls = proEconPowerstationInfoDay3Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+                .map(ProEconPowerstationInfoDay3::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -420,13 +436,18 @@ public class WindPowerInfo3Service {
                 //昨日的统计结果
                 cl.add(Calendar.DAY_OF_MONTH, -1);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepidls = proEconPowerstationInfoDay3Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getLocation().equals(Location.wp.getValue())
-                                    && i.getWindpowerstationId().equals(wp.getId())
-
-                            )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("windpowerstation_id",wp.getId())
+                            .eq("location",Location.wp.getValue());
+                    pepidls = proEconPowerstationInfoDay3Service.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getLocation().equals(Location.wp.getValue())
+//                                    && i.getWindpowerstationId().equals(wp.getId())
+//
+//                            )
+//                            .collect(Collectors.toList());
                 }
                 calDetiall(pewp, end, begin, CacheContext.wpwtmap.get(wp.getId()), pepidls);
                 calSimple(pewp, end, begin, CacheContext.wpwtmap.get(wp.getId()), pepidls);
@@ -454,10 +475,14 @@ public class WindPowerInfo3Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.pjmap.containsKey(i.getProjectId())
-                        && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay3::getId)
+        QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate))
+                .eq("location",Location.pj.getValue());
+        List<String> idls = proEconPowerstationInfoDay3Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.pjmap.containsKey(i.getProjectId())
+//                        && i.getLocation().equals(Location.pj.getValue()))
+                .map(ProEconPowerstationInfoDay3::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -491,13 +516,18 @@ public class WindPowerInfo3Service {
             //昨日的统计结果
             cl.add(Calendar.DAY_OF_MONTH, -1);
             if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                pepidls = proEconPowerstationInfoDay3Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getLocation().equals(Location.pj.getValue())
-                                && i.getProjectId().equals(pj.getId())
-
-                        )
-                        .collect(Collectors.toList());
+                QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                        .eq("location",Location.pj.getValue())
+                        .eq("project_id",pj.getId());
+                pepidls = proEconPowerstationInfoDay3Service.list(queryWrapper2);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getLocation().equals(Location.pj.getValue())
+//                                && i.getProjectId().equals(pj.getId())
+//
+//                        )
+//                        .collect(Collectors.toList());
             }
             calDetiall(pewp, end, begin, CacheContext.pjwtmap.get(pj.getId()), pepidls);
 
@@ -524,10 +554,14 @@ public class WindPowerInfo3Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.lnmap.containsKey(i.getLineId())
-                        && i.getLocation().equals(Location.ln.getValue())).map(ProEconPowerstationInfoDay3::getId)
+        QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate))
+                .eq("location",Location.ln.getValue());
+        List<String> idls = proEconPowerstationInfoDay3Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.lnmap.containsKey(i.getLineId())
+//                        && i.getLocation().equals(Location.ln.getValue()))
+                .map(ProEconPowerstationInfoDay3::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -566,13 +600,18 @@ public class WindPowerInfo3Service {
             //昨日的统计结果
             cl.add(Calendar.DAY_OF_MONTH, -1);
             if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                pepidls = proEconPowerstationInfoDay3Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getLocation().equals(Location.ln.getValue())
-                                && i.getLineId().equals(ln.getId())
-
-                        )
-                        .collect(Collectors.toList());
+                QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                        .eq("location",Location.ln.getValue())
+                        .eq("line_id",ln.getId());
+                pepidls = proEconPowerstationInfoDay3Service.list(queryWrapper2);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getLocation().equals(Location.ln.getValue())
+//                                && i.getLineId().equals(ln.getId())
+//
+//                        )
+//                        .collect(Collectors.toList());
             }
             calDetiall(pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()), pepidls);
             calSimple(pewp, end, begin, CacheContext.lnwtmap.get(ln.getId()), pepidls);

+ 310 - 177
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo4Service.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+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.*;
@@ -40,11 +41,14 @@ public class WindPowerInfo4Service {
      */
     public void calRegionInfoDay(Date recordDate) {
 
-        List<ProEconPowerstationInfoDay4> wpinfodayls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.cp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+        List<ProEconPowerstationInfoDay4> wpinfodayls = proEconPowerstationInfoDay4Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.cp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay4>>> rgmap = new HashMap<>();
@@ -88,10 +92,13 @@ public class WindPowerInfo4Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay4::getId)
+            QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.rg.getValue());
+            List<String> idls = proEconPowerstationInfoDay4Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.rg.getValue()))
+                    .map(ProEconPowerstationInfoDay4::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -166,11 +173,14 @@ public class WindPowerInfo4Service {
      */
     public void calCompanyInfoDay(Date recordDate) {
 
-        List<ProEconPowerstationInfoDay4> wpinfodayls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<ProEconPowerstationInfoDay4> wpinfodayls = proEconPowerstationInfoDay4Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay4>>> cpmap = new HashMap<>();
@@ -212,10 +222,13 @@ public class WindPowerInfo4Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay4::getId)
+            QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+            List<String> idls = proEconPowerstationInfoDay4Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.cp.getValue()))
+                    .map(ProEconPowerstationInfoDay4::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -412,10 +425,13 @@ public class WindPowerInfo4Service {
 
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay4::getId)
+        QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<String> idls = proEconPowerstationInfoDay4Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+                .map(ProEconPowerstationInfoDay4::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -445,12 +461,17 @@ public class WindPowerInfo4Service {
                 //获得当日设备统计2表数据
                 ProEconPowerstationInfoDay2 pepid2 = null;
                 List<ProEconPowerstationInfoDay2> pepid2ls;
-                pepid2ls = proEconPowerstationInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getLocation().equals(Location.wp.getValue())
-                                && i.getWindpowerstationId().equals(wp.getId())
-
-                        ).collect(Collectors.toList());
+                QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper2 = new QueryWrapper<>();
+                queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                        .eq("windpowerstation_id",wp.getId())
+                        .eq("location",Location.wp.getValue());
+                pepid2ls = proEconPowerstationInfoDay2Service.list(queryWrapper2);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getLocation().equals(Location.wp.getValue())
+//                                && i.getWindpowerstationId().equals(wp.getId())
+//
+//                        ).collect(Collectors.toList());
 
                 if (!pepid2ls.isEmpty()) {
                     pepid2 = pepid2ls.get(0);
@@ -458,14 +479,18 @@ public class WindPowerInfo4Service {
                 //获得当日设备统计3表数据
                 ProEconPowerstationInfoDay3 pepid3 = null;
                 List<ProEconPowerstationInfoDay3> pepid3ls;
-                pepid3ls = proEconPowerstationInfoDay3Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getLocation().equals(Location.wp.getValue())
-                                && i.getWindpowerstationId().equals(wp.getId())
 
-
-
-                        ).collect(Collectors.toList());
+                QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper3 = new QueryWrapper<>();
+                queryWrapper3.eq("record_date",DateUtils.truncate(cl.getTime()))
+                        .eq("windpowerstation_id",wp.getId())
+                        .eq("location",Location.wp.getValue());
+                pepid3ls = proEconPowerstationInfoDay3Service.list(queryWrapper3);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getLocation().equals(Location.wp.getValue())
+//                                && i.getWindpowerstationId().equals(wp.getId())
+//
+//                        ).collect(Collectors.toList());
 
                 if (!pepid3ls.isEmpty()) {
                     pepid3 = pepid3ls.get(0);
@@ -473,13 +498,18 @@ public class WindPowerInfo4Service {
                 //昨日的统计结果
                 cl.add(Calendar.DAY_OF_MONTH, -1);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepidls = proEconPowerstationInfoDay4Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getLocation().equals(Location.wp.getValue())
-                                    && i.getWindpowerstationId().equals(wp.getId())
-
-                            )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper4 = new QueryWrapper<>();
+                    queryWrapper4.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("windpowerstation_id",wp.getId())
+                            .eq("location",Location.wp.getValue());
+                    pepidls = proEconPowerstationInfoDay4Service.list(queryWrapper4);
+//                    .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getLocation().equals(Location.wp.getValue())
+//                                    && i.getWindpowerstationId().equals(wp.getId())
+//
+//                            )
+//                            .collect(Collectors.toList());
                 }
 
 
@@ -509,10 +539,14 @@ public class WindPowerInfo4Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
+        QueryWrapper<ProEconPowerstationInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate))
+                .eq("location",Location.pj.getValue());
         List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.pjmap.containsKey(i.getProjectId())
-                        && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay4::getId)
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.pjmap.containsKey(i.getProjectId())
+//                        && i.getLocation().equals(Location.pj.getValue()))
+                .map(ProEconPowerstationInfoDay4::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -546,12 +580,17 @@ public class WindPowerInfo4Service {
             //获得当日设备统计2表数据
             ProEconPowerstationInfoDay2 pepid2 = null;
             List<ProEconPowerstationInfoDay2> pepid2ls;
-            pepid2ls = proEconPowerstationInfoDay2Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                            && i.getLocation().equals(Location.pj.getValue())
-                            && i.getProjectId().equals(pj.getId())
-
-                    ).collect(Collectors.toList());
+            QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                    .eq("location",Location.pj.getValue())
+                    .eq("project_id",pj.getId());
+            pepid2ls = proEconPowerstationInfoDay2Service.list(queryWrapper2);
+//            .stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                            && i.getLocation().equals(Location.pj.getValue())
+//                            && i.getProjectId().equals(pj.getId())
+//
+//                    ).collect(Collectors.toList());
 
             if (!pepid2ls.isEmpty()) {
                 pepid2 = pepid2ls.get(0);
@@ -559,12 +598,17 @@ public class WindPowerInfo4Service {
             //获得当日设备统计3表数据
             ProEconPowerstationInfoDay3 pepid3 = null;
             List<ProEconPowerstationInfoDay3> pepid3ls;
-            pepid3ls = proEconPowerstationInfoDay3Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                            && i.getLocation().equals(Location.pj.getValue())
-                            && i.getProjectId().equals(pj.getId())
-
-                    ).collect(Collectors.toList());
+            QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.eq("record_date",DateUtils.truncate(cl.getTime()))
+                    .eq("location",Location.pj.getValue())
+                    .eq("project_id",pj.getId());
+            pepid3ls = proEconPowerstationInfoDay3Service.list(queryWrapper3);
+//                    .stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                            && i.getLocation().equals(Location.pj.getValue())
+//                            && i.getProjectId().equals(pj.getId())
+//
+//                    ).collect(Collectors.toList());
 
             if (!pepid3ls.isEmpty()) {
                 pepid3 = pepid3ls.get(0);
@@ -574,13 +618,18 @@ public class WindPowerInfo4Service {
             //昨日的统计结果
             cl.add(Calendar.DAY_OF_MONTH, -1);
             if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                pepidls = proEconPowerstationInfoDay4Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getLocation().equals(Location.pj.getValue())
-                                && i.getProjectId().equals(pj.getId())
-
-                        )
-                        .collect(Collectors.toList());
+                QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper4 = new QueryWrapper<>();
+                queryWrapper4.eq("record_date",DateUtils.truncate(cl.getTime()))
+                        .eq("location",Location.pj.getValue())
+                        .eq("project_id",pj.getId());
+                pepidls = proEconPowerstationInfoDay4Service.list(queryWrapper4);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getLocation().equals(Location.pj.getValue())
+//                                && i.getProjectId().equals(pj.getId())
+//
+//                        )
+//                        .collect(Collectors.toList());
             }
 
 
@@ -609,10 +658,14 @@ public class WindPowerInfo4Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.lnmap.containsKey(i.getLineId())
-                        && i.getLocation().equals(Location.ln.getValue())).map(ProEconPowerstationInfoDay4::getId)
+        QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate))
+                .eq("location",Location.ln.getValue());
+        List<String> idls = proEconPowerstationInfoDay4Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.lnmap.containsKey(i.getLineId())
+//                        && i.getLocation().equals(Location.ln.getValue()))
+                .map(ProEconPowerstationInfoDay4::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -651,12 +704,17 @@ public class WindPowerInfo4Service {
             //获得当日设备统计2表数据
             ProEconPowerstationInfoDay2 pepid2 = null;
             List<ProEconPowerstationInfoDay2> pepid2ls;
-            pepid2ls = proEconPowerstationInfoDay2Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                            && i.getLocation().equals(Location.ln.getValue())
-                            && i.getLineId().equals(ln.getId())
-
-                    ).collect(Collectors.toList());
+            QueryWrapper<ProEconPowerstationInfoDay2> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                    .eq("location",Location.ln.getValue())
+                    .eq("line_id",ln.getId());
+            pepid2ls = proEconPowerstationInfoDay2Service.list(queryWrapper2);
+//            .stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                            && i.getLocation().equals(Location.ln.getValue())
+//                            && i.getLineId().equals(ln.getId())
+//
+//                    ).collect(Collectors.toList());
 
             if (!pepid2ls.isEmpty()) {
                 pepid2 = pepid2ls.get(0);
@@ -664,12 +722,17 @@ public class WindPowerInfo4Service {
             //获得当日设备统计3表数据
             ProEconPowerstationInfoDay3 pepid3 = null;
             List<ProEconPowerstationInfoDay3> pepid3ls;
-            pepid3ls = proEconPowerstationInfoDay3Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                            && i.getLocation().equals(Location.ln.getValue())
-                            && i.getLineId().equals(ln.getId())
-
-                    ).collect(Collectors.toList());
+            QueryWrapper<ProEconPowerstationInfoDay3> queryWrapper3 = new QueryWrapper<>();
+            queryWrapper3.eq("record_date",DateUtils.truncate(cl.getTime()))
+                    .eq("location",Location.ln.getValue())
+                    .eq("line_id",ln.getId());
+            pepid3ls = proEconPowerstationInfoDay3Service.list(queryWrapper3);
+//                    .stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                            && i.getLocation().equals(Location.ln.getValue())
+//                            && i.getLineId().equals(ln.getId())
+//
+//                    ).collect(Collectors.toList());
 
             if (!pepid3ls.isEmpty()) {
                 pepid3 = pepid3ls.get(0);
@@ -677,13 +740,18 @@ public class WindPowerInfo4Service {
             //昨日的统计结果
             cl.add(Calendar.DAY_OF_MONTH, -1);
             if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                pepidls = proEconPowerstationInfoDay4Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getLocation().equals(Location.ln.getValue())
-                                && i.getLineId().equals(ln.getId())
-
-                        )
-                        .collect(Collectors.toList());
+                QueryWrapper<ProEconPowerstationInfoDay4> queryWrapper4 = new QueryWrapper<>();
+                queryWrapper4.eq("record_date",DateUtils.truncate(cl.getTime()))
+                        .eq("location",Location.ln.getValue())
+                        .eq("line_id",ln.getId());
+                pepidls = proEconPowerstationInfoDay4Service.list(queryWrapper4);
+//                .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getLocation().equals(Location.ln.getValue())
+//                                && i.getLineId().equals(ln.getId())
+//
+//                        )
+//                        .collect(Collectors.toList());
             }
 
 
@@ -737,9 +805,13 @@ public class WindPowerInfo4Service {
             switch (types) {
                 case "0":
 //日场站统计
-                    List<ProEconStateTransitionRates> pestrls = proEconStateTransitionRatesService.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(begin) == 0 && i.getWindpwoerId().equals(wt.getWindpowerstationId())
-                            ).collect(Collectors.toList());
+                    QueryWrapper<ProEconStateTransitionRates> queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("record_date",DateUtils.truncate(begin))
+                            .eq("windpwoer_id",wt.getWindpowerstationId());
+                    List<ProEconStateTransitionRates> pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(begin) == 0 && i.getWindpwoerId().equals(wt.getWindpowerstationId())
+//                            ).collect(Collectors.toList());
                     //大于3米20分钟转换及时次数
                     DoubleSummaryStatistics timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                     //大于3米20分钟转换及时次数合计
@@ -775,9 +847,13 @@ public class WindPowerInfo4Service {
                     } else {
                         pewp.setRfwjsl(100.0);
                     }
-                    List<ProEconFaultLiminatedefects> peflls = proEconFaultLiminatedefectsService.list().stream()
-                            .filter(i -> i.getDateTime().compareTo(begin) == 0 && i.getWindpowerstationId().equals(wt.getWindpowerstationId())
-                            ).collect(Collectors.toList());
+                    QueryWrapper<ProEconFaultLiminatedefects> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("date_time",DateUtils.truncate(begin))
+                            .eq("windpowerstation_id",wt.getWindpowerstationId());
+                    List<ProEconFaultLiminatedefects> peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getDateTime().compareTo(begin) == 0 && i.getWindpowerstationId().equals(wt.getWindpowerstationId())
+//                            ).collect(Collectors.toList());
                     //消缺及时次数
                     DoubleSummaryStatistics right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                     //消缺及时次数合计
@@ -798,9 +874,13 @@ public class WindPowerInfo4Service {
 //日场站统计
                 case "1":
 //日工程统计
-                    pestrls = proEconStateTransitionRatesService.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(begin) == 0 && i.getProjectId().equals(wt.getProjectId())
-                            ).collect(Collectors.toList());
+                    queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("record_date",DateUtils.truncate(begin))
+                            .eq("project_id",wt.getProjectId());
+                    pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(begin) == 0 && i.getProjectId().equals(wt.getProjectId())
+//                            ).collect(Collectors.toList());
                     //大于3米20分钟转换及时次数
                     timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                     //大于3米20分钟转换及时次数合计
@@ -836,9 +916,13 @@ public class WindPowerInfo4Service {
                     } else {
                         pewp.setRfwjsl(100.0);
                     }
-                    peflls = proEconFaultLiminatedefectsService.list().stream()
-                            .filter(i -> i.getDateTime().compareTo(begin) == 0 && i.getProjectId().equals(wt.getProjectId())
-                            ).collect(Collectors.toList());
+                    queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("date_time",DateUtils.truncate(begin))
+                            .eq("project_id",wt.getProjectId());
+                    peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                    .stream()
+//                            .filter(i -> i.getDateTime().compareTo(begin) == 0 && i.getProjectId().equals(wt.getProjectId())
+//                            ).collect(Collectors.toList());
                     //消缺及时次数
                     right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                     //消缺及时次数合计
@@ -859,9 +943,13 @@ public class WindPowerInfo4Service {
 //日工程统计
                 case "2":
 //日线路统计
-                    pestrls = proEconStateTransitionRatesService.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(begin) == 0 && i.getLineId().equals(wt.getLineId())
-                            ).collect(Collectors.toList());
+                    queryWrapper = new QueryWrapper<>();
+                    queryWrapper.eq("record_date",DateUtils.truncate(begin))
+                            .eq("line_id",wt.getLineId());
+                    pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(begin) == 0 && i.getLineId().equals(wt.getLineId())
+//                            ).collect(Collectors.toList());
                     //大于3米20分钟转换及时次数
                     timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                     //大于3米20分钟转换及时次数合计
@@ -897,9 +985,14 @@ public class WindPowerInfo4Service {
                     } else {
                         pewp.setRfwjsl(100.0);
                     }
-                    peflls = proEconFaultLiminatedefectsService.list().stream()
-                            .filter(i -> i.getDateTime().compareTo(begin) == 0 && i.getLineId().equals(wt.getLineId())
-                            ).collect(Collectors.toList());
+                    queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("date_time",DateUtils.truncate(begin))
+                            .eq("line_id",wt.getLineId());
+
+                    peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getDateTime().compareTo(begin) == 0 && i.getLineId().equals(wt.getLineId())
+//                            ).collect(Collectors.toList());
                     //消缺及时次数
                     right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                     //消缺及时次数合计
@@ -976,12 +1069,16 @@ public class WindPowerInfo4Service {
                 switch (types) {
                     case "0":
 //月场站统计
-                        List<ProEconStateTransitionRates> pestrls = proEconStateTransitionRatesService.list().stream()
-                                .filter(i ->
-                                        (i.getRecordDate().compareTo(monthbegin) == 0 || i.getRecordDate().after(monthbegin))
-                                                && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                                                && i.getWindpwoerId().equals(wt.getWindpowerstationId())
-                                ).collect(Collectors.toList());
+
+                        QueryWrapper<ProEconStateTransitionRates> queryWrapper = new QueryWrapper<>();
+                        queryWrapper.ge("record_date",monthbegin).le("record_date",end).eq("windpwoer_id",wt.getWindpowerstationId());
+                        List<ProEconStateTransitionRates> pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                                .stream()
+//                                .filter(i ->
+//                                        (i.getRecordDate().compareTo(monthbegin) == 0 || i.getRecordDate().after(monthbegin))
+//                                                && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                                                && i.getWindpwoerId().equals(wt.getWindpowerstationId())
+//                                ).collect(Collectors.toList());
                         //大于3米20分钟转换及时次数
                         DoubleSummaryStatistics timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                         //大于3米20分钟转换及时次数合计
@@ -1017,12 +1114,15 @@ public class WindPowerInfo4Service {
                         } else {
                             pewp.setYfwjsl(100.0);
                         }
-                        List<ProEconFaultLiminatedefects> peflls = proEconFaultLiminatedefectsService.list().stream()
-                                .filter(i ->
-                                        (i.getDateTime().compareTo(monthbegin) == 0 || i.getDateTime().after(monthbegin))
-                                                && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
-                                                && i.getWindpowerstationId().equals(wt.getWindpowerstationId())
-                                ).collect(Collectors.toList());
+                        QueryWrapper<ProEconFaultLiminatedefects> queryWrapper2 = new QueryWrapper<>();
+                        queryWrapper2.ge("date_time",monthbegin).le("date_time",end).eq("windpowerstation_id",wt.getWindpowerstationId());
+                        List<ProEconFaultLiminatedefects> peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                                .stream()
+//                                .filter(i ->
+//                                        (i.getDateTime().compareTo(monthbegin) == 0 || i.getDateTime().after(monthbegin))
+//                                                && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
+//                                                && i.getWindpowerstationId().equals(wt.getWindpowerstationId())
+//                                ).collect(Collectors.toList());
                         //消缺及时次数
                         DoubleSummaryStatistics right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                         //消缺及时次数合计
@@ -1043,12 +1143,16 @@ public class WindPowerInfo4Service {
                         //月场站统计
                     case "1":
                         //月工程统计
-                        pestrls = proEconStateTransitionRatesService.list().stream()
-                                .filter(i ->
-                                        (i.getRecordDate().compareTo(monthbegin) == 0 || i.getRecordDate().after(monthbegin))
-                                                && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                                                && i.getProjectId().equals(wt.getProjectId())
-                                ).collect(Collectors.toList());
+
+                        queryWrapper = new QueryWrapper<>();
+                        queryWrapper.ge("record_date",monthbegin).le("record_date",end).eq("project_id",wt.getProjectId());
+                        pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                                .stream()
+//                                .filter(i ->
+//                                        (i.getRecordDate().compareTo(monthbegin) == 0 || i.getRecordDate().after(monthbegin))
+//                                                && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                                                && i.getProjectId().equals(wt.getProjectId())
+//                                ).collect(Collectors.toList());
                         //大于3米20分钟转换及时次数
                         timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                         //大于3米20分钟转换及时次数合计
@@ -1084,12 +1188,15 @@ public class WindPowerInfo4Service {
                         } else {
                             pewp.setYfwjsl(100.0);
                         }
-                        peflls = proEconFaultLiminatedefectsService.list().stream()
-                                .filter(i ->
-                                        (i.getDateTime().compareTo(monthbegin) == 0 || i.getDateTime().after(monthbegin))
-                                                && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
-                                                && i.getProjectId().equals(wt.getProjectId())
-                                ).collect(Collectors.toList());
+                         queryWrapper2 = new QueryWrapper<>();
+                        queryWrapper2.ge("date_time",monthbegin).le("date_time",end).eq("project_id",wt.getProjectId());
+                        peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                                .stream()
+//                                .filter(i ->
+//                                        (i.getDateTime().compareTo(monthbegin) == 0 || i.getDateTime().after(monthbegin))
+//                                                && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
+//                                                && i.getProjectId().equals(wt.getProjectId())
+//                                ).collect(Collectors.toList());
                         //消缺及时次数
                         right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                         //消缺及时次数合计
@@ -1110,12 +1217,15 @@ public class WindPowerInfo4Service {
 //月工程统计
                     case "2":
 //月线路统计
-                        pestrls = proEconStateTransitionRatesService.list().stream()
-                                .filter(i ->
-                                        (i.getRecordDate().compareTo(monthbegin) == 0 || i.getRecordDate().after(monthbegin))
-                                                && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                                                && i.getLineId().equals(wt.getLineId())
-                                ).collect(Collectors.toList());
+                        queryWrapper = new QueryWrapper<>();
+                        queryWrapper.ge("record_date",monthbegin).le("record_date",end).eq("line_id",wt.getLineId());
+                        pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                                .stream()
+//                                .filter(i ->
+//                                        (i.getRecordDate().compareTo(monthbegin) == 0 || i.getRecordDate().after(monthbegin))
+//                                                && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                                                && i.getLineId().equals(wt.getLineId())
+//                                ).collect(Collectors.toList());
                         //大于3米20分钟转换及时次数
                         timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                         //大于3米20分钟转换及时次数合计
@@ -1151,12 +1261,15 @@ public class WindPowerInfo4Service {
                         } else {
                             pewp.setYfwjsl(100.0);
                         }
-                        peflls = proEconFaultLiminatedefectsService.list().stream()
-                                .filter(i ->
-                                        (i.getDateTime().compareTo(monthbegin) == 0 || i.getDateTime().after(monthbegin))
-                                                && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
-                                                && i.getLineId().equals(wt.getLineId())
-                                ).collect(Collectors.toList());
+                        queryWrapper2 = new QueryWrapper<>();
+                        queryWrapper2.ge("date_time",monthbegin).le("date_time",end).eq("line_Id",wt.getLineId());
+                        peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                                .stream()
+//                                .filter(i ->
+//                                        (i.getDateTime().compareTo(monthbegin) == 0 || i.getDateTime().after(monthbegin))
+//                                                && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
+//                                                && i.getLineId().equals(wt.getLineId())
+//                                ).collect(Collectors.toList());
                         //消缺及时次数
                         right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                         //消缺及时次数合计
@@ -1235,12 +1348,15 @@ public class WindPowerInfo4Service {
                     switch (types) {
                         case "0":
 //年场站统计
-                            List<ProEconStateTransitionRates> pestrls = proEconStateTransitionRatesService.list().stream()
-                                    .filter(i ->
-                                            (i.getRecordDate().compareTo(yearbegin) == 0 || i.getRecordDate().after(yearbegin))
-                                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                                                    && i.getWindpwoerId().equals(wt.getWindpowerstationId())
-                                    ).collect(Collectors.toList());
+                            QueryWrapper<ProEconStateTransitionRates> queryWrapper = new QueryWrapper<>();
+                            queryWrapper.ge("record_date",yearbegin).le("record_date",end).eq("windpwoer_id",wt.getWindpowerstationId());
+                            List<ProEconStateTransitionRates> pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                                    .stream()
+//                                    .filter(i ->
+//                                            (i.getRecordDate().compareTo(yearbegin) == 0 || i.getRecordDate().after(yearbegin))
+//                                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                                                    && i.getWindpwoerId().equals(wt.getWindpowerstationId())
+//                                    ).collect(Collectors.toList());
                             //大于3米20分钟转换及时次数
                             DoubleSummaryStatistics timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                             //大于3米20分钟转换及时次数合计
@@ -1276,12 +1392,16 @@ public class WindPowerInfo4Service {
                             } else {
                                 pewp.setNfwjsl(100.0);
                             }
-                            List<ProEconFaultLiminatedefects> peflls = proEconFaultLiminatedefectsService.list().stream()
-                                    .filter(i ->
-                                            (i.getDateTime().compareTo(yearbegin) == 0 || i.getDateTime().after(yearbegin))
-                                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
-                                                    && i.getWindpowerstationId().equals(wt.getWindpowerstationId())
-                                    ).collect(Collectors.toList());
+
+                            QueryWrapper<ProEconFaultLiminatedefects> queryWrapper2 = new QueryWrapper<>();
+                            queryWrapper2.ge("date_time",yearbegin).le("date_time",end).eq("windpowerstation_id",wt.getWindpowerstationId());
+                            List<ProEconFaultLiminatedefects> peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                            .stream()
+//                                    .filter(i ->
+//                                            (i.getDateTime().compareTo(yearbegin) == 0 || i.getDateTime().after(yearbegin))
+//                                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
+//                                                    && i.getWindpowerstationId().equals(wt.getWindpowerstationId())
+//                                    ).collect(Collectors.toList());
                             //消缺及时次数
                             DoubleSummaryStatistics right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                             //消缺及时次数合计
@@ -1302,12 +1422,15 @@ public class WindPowerInfo4Service {
 //年场站统计
                         case "1":
 //年工程统计
-                            pestrls = proEconStateTransitionRatesService.list().stream()
-                                    .filter(i ->
-                                            (i.getRecordDate().compareTo(yearbegin) == 0 || i.getRecordDate().after(yearbegin))
-                                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                                                    && i.getProjectId().equals(wt.getProjectId())
-                                    ).collect(Collectors.toList());
+                            queryWrapper = new QueryWrapper<>();
+                            queryWrapper.ge("record_date",yearbegin).le("record_date",end).eq("windpwoer_id",wt.getWindpowerstationId());
+                            pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                                    .stream()
+//                                    .filter(i ->
+//                                            (i.getRecordDate().compareTo(yearbegin) == 0 || i.getRecordDate().after(yearbegin))
+//                                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                                                    && i.getProjectId().equals(wt.getProjectId())
+//                                    ).collect(Collectors.toList());
                             //大于3米20分钟转换及时次数
                             timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                             //大于3米20分钟转换及时次数合计
@@ -1343,12 +1466,16 @@ public class WindPowerInfo4Service {
                             } else {
                                 pewp.setNfwjsl(100.0);
                             }
-                            peflls = proEconFaultLiminatedefectsService.list().stream()
-                                    .filter(i ->
-                                            (i.getDateTime().compareTo(yearbegin) == 0 || i.getDateTime().after(yearbegin))
-                                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
-                                                    && i.getProjectId().equals(wt.getProjectId())
-                                    ).collect(Collectors.toList());
+
+                            queryWrapper2 = new QueryWrapper<>();
+                            queryWrapper2.ge("date_time",yearbegin).le("date_time",end).eq("project_id",wt.getProjectId());
+                            peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                                    .stream()
+//                                    .filter(i ->
+//                                            (i.getDateTime().compareTo(yearbegin) == 0 || i.getDateTime().after(yearbegin))
+//                                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
+//                                                    && i.getProjectId().equals(wt.getProjectId())
+//                                    ).collect(Collectors.toList());
                             //消缺及时次数
                             right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                             //消缺及时次数合计
@@ -1369,12 +1496,15 @@ public class WindPowerInfo4Service {
 //年工程统计
                         case "2":
 //年线路统计
-                            pestrls = proEconStateTransitionRatesService.list().stream()
-                                    .filter(i ->
-                                            (i.getRecordDate().compareTo(yearbegin) == 0 || i.getRecordDate().after(yearbegin))
-                                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
-                                                    && i.getLineId().equals(wt.getLineId())
-                                    ).collect(Collectors.toList());
+                            queryWrapper = new QueryWrapper<>();
+                            queryWrapper.ge("record_date",yearbegin).le("record_date",end).eq("line_id",wt.getLineId());
+                            pestrls = proEconStateTransitionRatesService.list(queryWrapper);
+//                                    .stream()
+//                                    .filter(i ->
+//                                            (i.getRecordDate().compareTo(yearbegin) == 0 || i.getRecordDate().after(yearbegin))
+//                                                    && (i.getRecordDate().compareTo(end) == 0 || i.getRecordDate().before(end))
+//                                                    && i.getLineId().equals(wt.getLineId())
+//                                    ).collect(Collectors.toList());
                             //大于3米20分钟转换及时次数
                             timerate8_summary = pestrls.stream().mapToDouble(ProEconStateTransitionRates::getTimerate8).summaryStatistics();
                             //大于3米20分钟转换及时次数合计
@@ -1410,12 +1540,15 @@ public class WindPowerInfo4Service {
                             } else {
                                 pewp.setNfwjsl(100.0);
                             }
-                            peflls = proEconFaultLiminatedefectsService.list().stream()
-                                    .filter(i ->
-                                            (i.getDateTime().compareTo(yearbegin) == 0 || i.getDateTime().after(yearbegin))
-                                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
-                                                    && i.getLineId().equals(wt.getLineId())
-                                    ).collect(Collectors.toList());
+                            queryWrapper2 = new QueryWrapper<>();
+                            queryWrapper2.ge("date_time",monthbegin).le("date_time",end).eq("line_id",wt.getLineId());
+                            peflls = proEconFaultLiminatedefectsService.list(queryWrapper2);
+//                                    .stream()
+//                                    .filter(i ->
+//                                            (i.getDateTime().compareTo(yearbegin) == 0 || i.getDateTime().after(yearbegin))
+//                                                    && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
+//                                                    && i.getLineId().equals(wt.getLineId())
+//                                    ).collect(Collectors.toList());
                             //消缺及时次数
                             right_summary = peflls.stream().mapToDouble(ProEconFaultLiminatedefects::getRightCount).summaryStatistics();
                             //消缺及时次数合计

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

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -32,11 +33,14 @@ public class WindPowerInfo5Service {
      */
     public void calRegionInfoDay(Date recordDate) {
 
-        List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.cp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+        List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.cp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay5>>> rgmap = new HashMap<>();
@@ -81,10 +85,13 @@ public class WindPowerInfo5Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay5::getId)
+            QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.rg.getValue());
+            List<String> idls = proEconPowerstationInfoDay5Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.rg.getValue()))
+                    .map(ProEconPowerstationInfoDay5::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -157,11 +164,14 @@ public class WindPowerInfo5Service {
      */
     public void calCompanyInfoDay(Date recordDate) {
 
-        List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay5>>> cpmap = new HashMap<>();
@@ -202,11 +212,14 @@ public class WindPowerInfo5Service {
             }
 
 
-            //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay5::getId)
+            //判断是否有重复记录,
+            QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+            List<String> idls = proEconPowerstationInfoDay5Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.cp.getValue()))
+                    .map(ProEconPowerstationInfoDay5::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -342,10 +355,13 @@ public class WindPowerInfo5Service {
 
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay5::getId)
+        QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper= new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<String> idls = proEconPowerstationInfoDay5Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+                        .map(ProEconPowerstationInfoDay5::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -406,10 +422,13 @@ public class WindPowerInfo5Service {
 //        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.pjmap.containsKey(i.getProjectId())
-                        && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay5::getId)
+        QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper= new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.pj.getValue());
+        List<String> idls = proEconPowerstationInfoDay5Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.pjmap.containsKey(i.getProjectId())
+//                        && i.getLocation().equals(Location.pj.getValue()))
+                .map(ProEconPowerstationInfoDay5::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -474,10 +493,13 @@ public class WindPowerInfo5Service {
 //        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.lnmap.containsKey(i.getLineId())
-                        && i.getLocation().equals(Location.ln.getValue())).map(ProEconPowerstationInfoDay5::getId)
+        QueryWrapper<ProEconPowerstationInfoDay5> queryWrapper= new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.ln.getValue());
+        List<String> idls = proEconPowerstationInfoDay5Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.lnmap.containsKey(i.getLineId())
+//                        && i.getLocation().equals(Location.ln.getValue()))
+                .map(ProEconPowerstationInfoDay5::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {

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

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+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;
@@ -38,11 +39,14 @@ public class WindPowerInfo6Service {
      */
     public void calRegionInfoDay(Date recordDate) {
 
-        List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.cp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+        List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list(queryWrapper);
+//                .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.cp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay6>>> rgmap = new HashMap<>();
@@ -87,10 +91,13 @@ public class WindPowerInfo6Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.rg.getValue())).map(ProEconPowerstationInfoDay6::getId)
+            QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.rg.getValue());
+            List<String> idls = proEconPowerstationInfoDay6Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.rg.getValue()))
+                    .map(ProEconPowerstationInfoDay6::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -162,12 +169,14 @@ public class WindPowerInfo6Service {
      * 计算公司日信息
      */
     public void calCompanyInfoDay(Date recordDate) {
-
-        List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue()))
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list(queryWrapper);
+//        .stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+//                .collect(Collectors.toList());
         if (!wpinfodayls.isEmpty()) {
 
             Map<String, Map<String, List<ProEconPowerstationInfoDay6>>> cpmap = new HashMap<>();
@@ -209,10 +218,13 @@ public class WindPowerInfo6Service {
 
 
             //判断是否有重复记录,先删除重复记录
-            List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-//                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                            && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay6::getId)
+            QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.cp.getValue());
+            List<String> idls = proEconPowerstationInfoDay6Service.list(queryWrapper2).stream()
+//                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+////                            && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                            && i.getLocation().equals(Location.cp.getValue()))
+                    .map(ProEconPowerstationInfoDay6::getId)
                     .collect(Collectors.toList());
 
             if (idls.size() > 0) {
@@ -380,10 +392,13 @@ public class WindPowerInfo6Service {
 
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
-                        && i.getLocation().equals(Location.wp.getValue())).map(ProEconPowerstationInfoDay6::getId)
+        QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.wp.getValue());
+        List<String> idls = proEconPowerstationInfoDay6Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
+//                        && i.getLocation().equals(Location.wp.getValue()))
+                .map(ProEconPowerstationInfoDay6::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -410,12 +425,17 @@ public class WindPowerInfo6Service {
                 Calendar cl = Calendar.getInstance();
                 cl.setTime(recordDate);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getLocation().equals(Location.wp.getValue())
-                                    && i.getWindpowerstationId().equals(wp.getId())
-                                  )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("windPowerStation_Id",wp.getId())
+                            .eq("location",Location.wp.getValue());
+                    pepid1ls = proEconPowerstationInfoDay6Service.list();
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getLocation().equals(Location.wp.getValue())
+//                                    && i.getWindpowerstationId().equals(wp.getId())
+//                                  )
+//                            .collect(Collectors.toList());
                 }
                 extracted(end, begin, pointmap, pewp, pepid1ls);
 //*******************************************年信息统计*********************************************************/
@@ -442,10 +462,13 @@ public class WindPowerInfo6Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
+        QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.pj.getValue());
         List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.pjmap.containsKey(i.getProjectId())
-                        && i.getLocation().equals(Location.pj.getValue())).map(ProEconPowerstationInfoDay6::getId)
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.pjmap.containsKey(i.getProjectId())
+//                        && i.getLocation().equals(Location.pj.getValue()))
+                .map(ProEconPowerstationInfoDay6::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -476,13 +499,18 @@ public class WindPowerInfo6Service {
                 Calendar cl = Calendar.getInstance();
                 cl.setTime(recordDate);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getLocation().equals(Location.pj.getValue())
-                                    && i.getProjectId().equals(pj.getId())
-
-                            )
-                            .collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("project_Id",pj.getId())
+                            .eq("location",Location.pj.getValue());
+                    pepid1ls = proEconPowerstationInfoDay6Service.list(queryWrapper2);
+//                    .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getLocation().equals(Location.pj.getValue())
+//                                    && i.getProjectId().equals(pj.getId())
+//
+//                            )
+//                            .collect(Collectors.toList());
                 }
                 extracted(end, begin, pointmap, pewp, pepid1ls);
 
@@ -509,10 +537,13 @@ public class WindPowerInfo6Service {
         Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
-        List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
-                        && CacheContext.lnmap.containsKey(i.getLineId())
-                        && i.getLocation().equals(Location.ln.getValue())).map(ProEconPowerstationInfoDay6::getId)
+        QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate)).eq("location",Location.ln.getValue());
+        List<String> idls = proEconPowerstationInfoDay6Service.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                        && CacheContext.lnmap.containsKey(i.getLineId())
+//                        && i.getLocation().equals(Location.ln.getValue()))
+                .map(ProEconPowerstationInfoDay6::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -548,12 +579,17 @@ public class WindPowerInfo6Service {
                 Calendar cl = Calendar.getInstance();
                 cl.setTime(recordDate);
                 if (cl.get(Calendar.DAY_OF_MONTH) != 1) {
-                    pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                    && i.getLocation().equals(Location.ln.getValue())
-                                    && i.getLineId().equals(ln.getId())
-
-                            ).collect(Collectors.toList());
+                    QueryWrapper<ProEconPowerstationInfoDay6> queryWrapper2 = new QueryWrapper<>();
+                    queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime()))
+                            .eq("line_Id",ln.getId())
+                            .eq("location",Location.ln.getValue());
+                    pepid1ls = proEconPowerstationInfoDay6Service.list(queryWrapper2);
+//                            .stream()
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                    && i.getLocation().equals(Location.ln.getValue())
+//                                    && i.getLineId().equals(ln.getId())
+//
+//                            ).collect(Collectors.toList());
                 }
                 extracted(end, begin, pointmap, pewp, pepid1ls);
 

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

@@ -1,6 +1,7 @@
 package com.gyee.generation.service;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.ProBasicEquipment;
 import com.gyee.generation.model.auto.ProEconEquipmentInfoDay1;
@@ -33,9 +34,12 @@ public class WindturbineGoodnessService {
 
 
         //判断是否有重复记录,先删除重复记录
-        List<Long> idls = proEconWindturbineGoodnessService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconWindturbineGoodness::getId)
+        QueryWrapper<ProEconWindturbineGoodness> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate));
+        List<Long> idls = proEconWindturbineGoodnessService.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
+//                        && CacheContext.wtmap.containsKey(i.getWindturbineId()))
+                .map(ProEconWindturbineGoodness::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {

+ 40 - 29
realtime/generationXK-service/src/main/java/com/gyee/generation/service/WtAlysisDayService.java

@@ -1,5 +1,6 @@
 package com.gyee.generation.service;//package com.gyee.generation.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
@@ -40,22 +41,24 @@ public class WtAlysisDayService {
 
     private Map<String, ProEconEquipmentInfoDay1> queryEquipmentInfoDay1(Date recordDate) {
 
-
-        List<ProEconEquipmentInfoDay1> iostls= proEconEquipmentInfoDay1Service.list()
-                .stream().filter(i-> i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay1> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate));
+        List<ProEconEquipmentInfoDay1> iostls= proEconEquipmentInfoDay1Service.list(queryWrapper);
+//                .stream().filter(i-> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconEquipmentInfoDay1> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconEquipmentInfoDay1::getWindturbineId, Function.identity(), (key1, key2) -> key2));
         return iostmap;
     }
     private Map<String, ProEconEquipmentInfoDay2> queryEquipmentInfoDay2(Date recordDate) {
-
-        List<ProEconEquipmentInfoDay2> iostls= proEconEquipmentInfoDay2Service.list()
-                .stream().filter(i-> i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay2> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate));
+        List<ProEconEquipmentInfoDay2> iostls= proEconEquipmentInfoDay2Service.list(queryWrapper);
+//                .stream().filter(i-> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconEquipmentInfoDay2> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconEquipmentInfoDay2::getWindturbineId, Function.identity(), (key1, key2) -> key2));
@@ -63,11 +66,12 @@ public class WtAlysisDayService {
     }
     private Map<String, ProEconEquipmentInfoDay3> queryEquipmentInfoDay3(Date recordDate) {
 
-
-        List<ProEconEquipmentInfoDay3> iostls= proEconEquipmentInfoDay3Service.list()
-                .stream().filter(i-> i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay3> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate));
+        List<ProEconEquipmentInfoDay3> iostls= proEconEquipmentInfoDay3Service.list(queryWrapper);
+//                .stream().filter(i-> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconEquipmentInfoDay3> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconEquipmentInfoDay3::getWindturbineId, Function.identity(), (key1, key2) -> key2));
@@ -76,11 +80,12 @@ public class WtAlysisDayService {
 
     private Map<String, ProEconEquipmentInfoDay4> queryEquipmentInfoDay4(Date recordDate) {
 
-
-        List<ProEconEquipmentInfoDay4> iostls= proEconEquipmentInfoDay4Service.list()
-                .stream().filter(i-> i.getRecordDate().compareTo(recordDate) == 0
-                )
-                .collect(Collectors.toList());
+        QueryWrapper<ProEconEquipmentInfoDay4> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate));
+        List<ProEconEquipmentInfoDay4> iostls= proEconEquipmentInfoDay4Service.list(queryWrapper);
+//                .stream().filter(i-> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
+//                )
+//                .collect(Collectors.toList());
         //List转map
         Map<String, ProEconEquipmentInfoDay4> iostmap=iostls.stream().
                 collect(Collectors.toMap(ProEconEquipmentInfoDay4::getWindturbineId, Function.identity(), (key1, key2) -> key2));
@@ -97,10 +102,13 @@ public class WtAlysisDayService {
 
         Date begin= DateUtils.truncate(c.getTime());
 
-        //判断是否有重复记录,先删除重复记录
-        List<Long> idls = proEconWtAlysisDayService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
-                        && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconWtAlysisDay::getId)
+        //判断是否有重复记录,
+        QueryWrapper<ProEconWtAlysisDay> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("record_date",DateUtils.truncate(recordDate));
+        List<Long> idls = proEconWtAlysisDayService.list(queryWrapper).stream()
+//                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
+//                        && CacheContext.wtmap.containsKey(i.getWindturbineId()))
+                .map(ProEconWtAlysisDay::getId)
                 .collect(Collectors.toList());
 
         if (idls.size() > 0) {
@@ -180,11 +188,14 @@ public class WtAlysisDayService {
             cl.add(Calendar.DAY_OF_MONTH,-1);
             if(cl.get(Calendar.DAY_OF_MONTH)!=1)
             {
-                pepidls = proEconWtAlysisDayService.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
-                                && i.getWindturbineId().equals(wt.getId())
-                        )
-                        .collect(Collectors.toList());
+                QueryWrapper<ProEconWtAlysisDay> queryWrapper2 = new QueryWrapper<>();
+               queryWrapper2.eq("record_date",DateUtils.truncate(cl.getTime())).eq("windTurbine_Id",wt.getId());
+               pepidls = proEconWtAlysisDayService.list(queryWrapper2);
+//                        .stream()
+//                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
+//                                && i.getWindturbineId().equals(wt.getId())
+//                        )
+//                        .collect(Collectors.toList());
             }
             calSimple(pewp, end, begin, wt, pepidls);
             dayls.add(pewp);

+ 49 - 15
realtime/generationXK-service/src/main/resources/application-test.yml

@@ -9,16 +9,17 @@ spring:
     allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
   #redis集群
   redis:
-    host: 10.83.68.151
+    host: 127.0.0.1
+    #host: 192.168.11.250
     port: 6379
     timeout: 100000
     #    集群环境打开下面注释,单机不需要打开
-    cluster:
-      #集群信息
-      nodes: 10.83.68.151:6379,10.83.68.152:6379,10.83.68.153:6379,10.83.68.154:6379,10.83.68.155:6379,10.83.68.156:6379,10.83.68.157:6379,10.83.68.158:6379,10.83.68.159:6379
-      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
-      maxRedirects: 3
-    password: Dsjpt@2021
+    #    cluster:
+    #      #集群信息
+    #      nodes: 10.83.68.151:6379,10.83.68.152:6379,10.83.68.153:6379,10.83.68.154:6379,10.83.68.155:6379,10.83.68.156:6379,10.83.68.157:6379,10.83.68.158:6379,10.83.68.159:6379
+    #      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
+    #      maxRedirects: 3
+    password:
     application:
       name: test
     jedis:
@@ -32,11 +33,13 @@ spring:
     exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
-    driver-class-name: oracle.jdbc.OracleDriver
-    #外网
-    url: jdbc:oracle:thin:@10.83.68.165:1521:gdsj
-    username: gdprod
-    password: gd123
+    driver-class-name: org.postgresql.Driver
+    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_TEST?rewriteBatchedStatements=true
+    username: postgres
+    password: postgres
+    #    url: jdbc:postgresql://124.70.75.91:5432/jn_test?rewriteBatchedStatements=true
+    #    username: postgres
+    #    password: gd123
     oracle-schema=:
     #    type: com.alibaba.druid.pool.DruidDataSource
     #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
@@ -82,12 +85,43 @@ logging:
   level:
     root: info
     com.example: debug
+#db url
+db:
+  url: http://127.0.0.1:8011/ts
+  #url: http://192.168.11.250:8011/ts
+  #url: http://124.70.75.91:8011/ts
+#参与计算的场站
+#runWindpowerstation: SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_GDDL_BH1_FDC_STA,SD_GDDL_BH2_FDC_STA,SD_GDDL_CG_FDC_STA,SD_GDDL_FJ_FDC_STA,SD_GDDL_YS_FDC_STA,SD_GDDL_FXFC_FDC_STA,SD_GDDL_JNSS_FDC_STA,SD_GDDL_WFBH_FDC_STA,SD_GDDL_PLHS_FDC_STA,SD_GDDL_JNCQ_FDC_STA,SD_GDDL_LXLN_FDC_STA,SD_GDDL_LQJS_FDC_STA,SD_GDDL_ZYXD_FDC_STA,SD_GDDL_ZYFS_FDC_STA
+runWindpowerstation: SD_GDDL_RZLX_FDC_STA
+#计算状态用ai或者di
+clauStatus:
+  ai: GJY03_GC,YLZ01_GC,PTZ02_GC   #配置期次
+  di: GJY01_GC,GJY02_GC,DJY01_GC,DJY02_GC,YF01_GC,YF02_GC,HSM01_GC,PTZ01_GC,ZK01_GC,NJL01_GC,YTY01_GC,PDL01_GC
+#判断数据终端
+second: 1800
+#判断降出力
+AI110: 17.4    #叶轮转速给定
+AI178: 17.4    #转矩给定
+#AI443:容量
+
+#功率曲线拟合
+curvefitting:
+  #维度
+  dimension: 20
+  #尺度
+  scale: 0.01
+initialcode: INITIAL
+##调用区间间隔时长,需要与XXLJOB调度时长结合,保证查询区间时长大于调度时长,单位分钟
+frequency:
+  #停机
+  shutdown: 6
+  #限电
+  powerrationing: 6
+  #切入切出
+  cutinandout: 6
 
 
-db:
-  url: http://10.83.68.205:8011/ts
 
-runWindpowerstation: CL_FDC,KB_FDC,DX_FDC,SY_FDC
 
 
 

+ 19 - 17
realtime/generationXK-service/src/main/resources/application-xk.yml

@@ -9,17 +9,17 @@ spring:
     allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
   #redis集群
   redis:
-    host: 124.70.18.168
-    #host: 192.168.11.250
+    #host: 127.0.0.1
+    host: 192.168.11.250
     port: 6379
     timeout: 100000
     #    集群环境打开下面注释,单机不需要打开
-#    cluster:
-#      #集群信息
-#      nodes: 10.83.68.151:6379,10.83.68.152:6379,10.83.68.153:6379,10.83.68.154:6379,10.83.68.155:6379,10.83.68.156:6379,10.83.68.157:6379,10.83.68.158:6379,10.83.68.159:6379
-#      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
-#      maxRedirects: 3
-    password: gdnxfd123
+    #    cluster:
+    #      #集群信息
+    #      nodes: 10.83.68.151:6379,10.83.68.152:6379,10.83.68.153:6379,10.83.68.154:6379,10.83.68.155:6379,10.83.68.156:6379,10.83.68.157:6379,10.83.68.158:6379,10.83.68.159:6379
+    #      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
+    #      maxRedirects: 3
+    password:
     application:
       name: test
     jedis:
@@ -28,18 +28,18 @@ spring:
         min-idle: 0
         max-idle: 8
         max-wait: -1
-    database: 0
+    database: 9
   autoconfigure:
     exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: org.postgresql.Driver
-#    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD?rewriteBatchedStatements=true
-#    username: postgres
-#    password: postgres
-    url: jdbc:postgresql://124.70.75.91:5432/jn_test
+    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD?rewriteBatchedStatements=true
     username: postgres
-    password: gd123
+    password: postgres
+    #    url: jdbc:postgresql://124.70.75.91:5432/jn_test?rewriteBatchedStatements=true
+    #    username: postgres
+    #    password: gd123
     oracle-schema=:
     #    type: com.alibaba.druid.pool.DruidDataSource
     #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
@@ -87,10 +87,12 @@ logging:
     com.example: debug
 #db url
 db:
-  url: http://127.0.0.1:8011/ts
-  #url: http://192.168.11.250:8011/ts
+  #url: http://127.0.0.1:8011/ts
+  url: http://192.168.11.250:8011/ts
+  #url: http://124.70.75.91:8011/ts
 #参与计算的场站
-runWindpowerstation: SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_LYDL_BH1_FDC_STA,SD_LYDL_BH2_FDC_STA,SD_LYDL_CG_FDC_STA,SD_LYDL_FJ_FDC_STA,SD_LYDL_YS_FDC_STA,SD_SXNY_FXFC_FDC_STA,SD_SXNY_JNSS_FDC_STA,SD_SXNY_WFBH_FDC_STA,SD_SXNY_PLHS_FDC_STA,SD_SXNY_JNCQ_FDC_STA,SD_SXNY_LXLN_FDC_STA,SD_SXNY_LQJS_FDC_STA,SD_SXNY_ZYXD_FDC_STA,SD_SXNY_ZYFS_FDC_STA,SD_GHTZ_HZJ_GDC_STA
+#runWindpowerstation: SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_GDDL_BH1_FDC_STA,SD_GDDL_BH2_FDC_STA,SD_GDDL_CG_FDC_STA,SD_GDDL_FJ_FDC_STA,SD_GDDL_YS_FDC_STA,SD_GDDL_FXFC_FDC_STA,SD_GDDL_JNSS_FDC_STA,SD_GDDL_WFBH_FDC_STA,SD_GDDL_PLHS_FDC_STA,SD_GDDL_JNCQ_FDC_STA,SD_GDDL_LXLN_FDC_STA,SD_GDDL_LQJS_FDC_STA,SD_GDDL_ZYXD_FDC_STA,SD_GDDL_ZYFS_FDC_STA
+runWindpowerstation: SD_GDDL_RZLX_FDC_STA
 #计算状态用ai或者di
 clauStatus:
   ai: GJY03_GC,YLZ01_GC,PTZ02_GC   #配置期次

+ 1 - 1
realtime/generationXK-service/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
 #    active: xk
-    active: dev
+    active: xk
 
 #    active: td