Browse Source

修改切入切出算法,修改停机和限电事件

shilin 2 years ago
parent
commit
cd2ed38cb4
37 changed files with 1721 additions and 1123 deletions
  1. 10 10
      realtime/generationXK-service/src/main/java/com/gyee/generation/GenerationMain.java
  2. 7 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java
  3. 3 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconBrownoutsEvent.java
  4. 3 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconBrownoutsEvent2.java
  5. 3 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconFaultLiminatedefects.java
  6. 3 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconInputOrOutputSpeed.java
  7. 3 5
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconInterruption.java
  8. 3 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconInterruptionItem.java
  9. 3 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconWindturbineStatus.java
  10. 6 6
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/CoefficientService.java
  11. 3 3
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo15minuteService.java
  12. 4 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo1Service.java
  13. 4 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo2Service.java
  14. 4 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo3Service.java
  15. 6 6
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo4Service.java
  16. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo5Service.java
  17. 5 5
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfoDayTopService.java
  18. 4 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/GoodnessOfFitService.java
  19. 629 65
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/InputOrOutPutService.java
  20. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventService.java
  21. 468 506
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventnewService.java
  22. 13 13
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingByTimeService.java
  23. 5 5
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/PowerCurveFittingService.java
  24. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownService.java
  25. 100 42
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownnewService.java
  26. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/TimelinessRateService.java
  27. 22 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo1Service.java
  28. 22 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo2Service.java
  29. 22 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo3Service.java
  30. 28 28
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo4Service.java
  31. 22 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo5Service.java
  32. 22 22
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/WindPowerInfo6Service.java
  33. 264 264
      realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticSchedulePgTask.java
  34. 10 10
      realtime/generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java
  35. 12 3
      realtime/generationXK-service/src/main/resources/application-xk.yml
  36. 2 2
      realtime/generationXK-service/src/main/resources/application.yml
  37. 1 1
      realtime/generationXK-service/src/main/resources/xxl-job-executor.properties

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

@@ -1,7 +1,5 @@
 package com.gyee.generation;
 
-import com.gyee.generation.service.InputOrOutPutService;
-import com.gyee.generation.util.SpringUtils;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -37,17 +35,19 @@ public class GenerationMain {
 //        System.out.println("开始导出风场测点。。。。。。");
 //        initialPointGoldenXkByEqService.initalFc();
 //        System.out.println("结束导出风场测点。。。。。。");
-//        PowerCurveFittingModelService powerCurveFittingModelService= SpringUtils.getBean("powerCurveFittingModelService");
+//        PowerCurveFittingByTimeService powerCurveFittingByTimeService= SpringUtils.getBean("powerCurveFittingByTimeService");
 //
-//        powerCurveFittingModelService.cureFittingModel();
+//        powerCurveFittingByTimeService.cureFittingDay(new Date());
+//        powerCurveFittingByTimeService.cureFittingMonth(new Date());
+//        powerCurveFittingByTimeService.cureFittingYear(new Date());
 //        CacheService cacheService= SpringUtils.getBean("cacheService");
 //        cacheService.initRedisCache();
-        InputOrOutPutService inputOrOutPutService= SpringUtils.getBean("inputOrOutPutService");
-//        inputOrOutPutService.inputOrOutput(new Date());
-        while(true)
-        {
-            inputOrOutPutService.inputOrOutputSpeed();
-        }
+//        InputOrOutPutService inputOrOutPutService= SpringUtils.getBean("inputOrOutPutService");
+//       inputOrOutPutService.inputOrOutput(new Date());
+//        while (true)
+//        {
+//            inputOrOutPutService.inputOrOutputSpeed(new Date());
+//        }
 
     }
 }

+ 7 - 4
realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -58,6 +58,9 @@ public class CacheContext implements CommandLineRunner {
     @Resource
     private TheoreticalPowerService theoreticalPowerService;
 
+    @Resource
+    private IProBasicModelPowerRdService proBasicModelPowerRdService;
+
     @Value("${runWindpowerstation}")
     private String runWindpowerstation;
 
@@ -112,7 +115,7 @@ public class CacheContext implements CommandLineRunner {
     public static List<ProEconEquipmentmodel> equipmentmodels=new ArrayList<>();
 
     public static Map<String,List<ProBasicEquipment>> subWtsMap = new HashMap<>();
-
+    public static List<ProBasicModelPowerRd> theoreticalPowerList=new ArrayList<>();
     public static Map<String, Map<Double,ProBasicModelPowerRd>> theoreticalPowerMap = new HashMap<>(); //理论,保证功率
     public static Map<String, Map<Double,ProEconWtPowerCurveFitting>> curveFittingPowerMap = new HashMap<>(); //自算,最优功率
     @Override
@@ -123,7 +126,7 @@ public class CacheContext implements CommandLineRunner {
         List<String> runWpids = Arrays.asList(runWindpowerstation.split(","));
         logger.info(runWpids.get(0)+"------------------"+runWpids.size());
 
-
+        theoreticalPowerList= proBasicModelPowerRdService.list();
         equipmentmodels = proEconEquipmentmodelService.list();
         equipmentmodels.stream().forEach(e->{
             modelMap.put(e.getId(),e);
@@ -318,8 +321,8 @@ public class CacheContext implements CommandLineRunner {
             });
             subwppointmap.put(sub.getId(),stringWindpowerstationpointnewMap);
 
-            List<ProBasicEquipment> collect = wtls.stream().filter(wt -> wt.getSubstationId().equals(sub.getId())).collect(Collectors.toList());
-            subWtsMap.put(sub.getId(),collect);
+//            List<ProBasicEquipment> collect = wtls.stream().filter(wt -> wt.getSubstationId().equals(sub.getId())).collect(Collectors.toList());
+//            subWtsMap.put(sub.getId(),collect);
 
         });
 

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

@@ -1,6 +1,8 @@
 package com.gyee.generation.model.auto;
 
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -25,7 +27,7 @@ public class ProEconBrownoutsEvent extends Model {
      * 编号
      */
 
-
+    @TableId(value = "ID",type = IdType.INPUT)
     private String id;
 
     /**

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

@@ -1,5 +1,7 @@
 package com.gyee.generation.model.auto;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -23,7 +25,7 @@ public class ProEconBrownoutsEvent2 extends Model {
     /**
      * 编号
      */
-
+    @TableId(value = "ID",type = IdType.INPUT)
     private String id;
 
     /**

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

@@ -4,12 +4,11 @@ package com.gyee.generation.model.auto;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.util.Date;
-
-import io.swagger.models.auth.In;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 /**
  * <p>
  * 故障消缺及时率
@@ -28,7 +27,7 @@ public class ProEconFaultLiminatedefects extends Model {
      * 编号
      */
     @TableId(value = "ID",type = IdType.ASSIGN_ID)
-    private Integer id;
+    private Long id;
 
     /**
      * 风场编号

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

@@ -4,10 +4,11 @@ package com.gyee.generation.model.auto;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 /**
  * <p>
  * 1、切入是1
@@ -27,7 +28,7 @@ public class ProEconInputOrOutputSpeed extends Model {
      * 编号
      */
     @TableId(value = "ID",type = IdType.ASSIGN_ID)
-    private Integer id;
+    private Long id;
 
     /**
      * 风机编号

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

@@ -1,16 +1,14 @@
 package com.gyee.generation.model.auto;
 
 
-
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-
-import java.util.Date;
-
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 /**
  * <p>
  * 根据风电机状态判断通讯中断并记录。
@@ -29,7 +27,7 @@ public class ProEconInterruption extends Model {
      * 编号
      */
     @TableId(value = "ID",type = IdType.ASSIGN_ID)
-    private Integer id;
+    private Long id;
 
     /**
      * 风场编号

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

@@ -3,12 +3,11 @@ package com.gyee.generation.model.auto;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-
-import java.util.Date;
-
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 /**
  * <p>
  * 记录通讯中断表中的记录的分解过程。
@@ -27,7 +26,7 @@ public class ProEconInterruptionItem extends Model {
      * 编号
      */
     @TableId(value = "ID",type = IdType.ASSIGN_ID)
-    private Integer id;
+    private Long id;
 
     /**
      * 风场编号

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

@@ -4,10 +4,11 @@ package com.gyee.generation.model.auto;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.util.Date;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 /**
  * <p>
  * 与停机事件关联(限电停机时),数据库中无关联,程序控制
@@ -26,7 +27,7 @@ public class ProEconWindturbineStatus extends Model {
      * 编号
      */
     @TableId(value = "ID",type = IdType.ASSIGN_ID)
-    private Integer id;
+    private Long id;
 
     /**
      * 风场编号

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

@@ -32,7 +32,7 @@ public class CoefficientService {
     public Map<String, Map<String, Double>> coefficient(Date currentDate) throws Exception {
         //调度时间是第二天,currentDate 是第一天
 
-        currentDate = DateUtils.truncDay(currentDate);
+        currentDate = DateUtils.truncate(currentDate);
 
         Calendar c = Calendar.getInstance();
         c.setTime(currentDate);
@@ -54,7 +54,7 @@ public class CoefficientService {
         //遍历所有风机ID
         for (ProBasicEquipment wt : wtls) {
 
-
+//****************************************年功率一致性统计********************************************************************/
             List<ProEconActivePowerData> yearList;
 
             List<ProEconActivePowerData> queryYear = new ArrayList<>();
@@ -231,10 +231,10 @@ public class CoefficientService {
                 }
 
 
-                if (CacheContext.modelpowermap.containsKey(data.getModelId())) {
-                    if (CacheContext.modelpowermap.get(data.getModelId()).size() > 0) {
-                        if (CacheContext.modelpowermap.get(data.getModelId()).containsKey(speed)) {
-                            Double p = CacheContext.modelpowermap.get(data.getModelId()).get(speed).getEnsurePower();
+                if (CacheContext.theoreticalPowerMap.containsKey(data.getModelId())) {
+                    if (CacheContext.theoreticalPowerMap.get(data.getModelId()).size() > 0) {
+                        if (CacheContext.theoreticalPowerMap.get(data.getModelId()).containsKey(speed)) {
+                            Double p = CacheContext.theoreticalPowerMap.get(data.getModelId()).get(speed).getEnsurePower();
 
 
                             if (p != 0) {

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

@@ -40,11 +40,11 @@ public class EquipmentInfo15minuteService {
 
         Date end=c.getTime();
         c.add(Calendar.MINUTE,-15);
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconEquipmentInfo15minuteService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
                         && CacheContext.wtmap.containsKey(i.getWindturbineId())
            ).map(ProEconEquipmentInfo15minute::getId)
                 .collect(Collectors.toList());
@@ -67,7 +67,7 @@ public class EquipmentInfo15minuteService {
                 pewp.setLineId(wt.getLineId());
                 pewp.setProjectId(wt.getProjectId());
                 pewp.setRegionId(wt.getRegionId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
 
 

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

@@ -42,11 +42,11 @@ public class EquipmentInfo1Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconEquipmentInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
                         && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconEquipmentInfoDay1::getId)
                 .collect(Collectors.toList());
 
@@ -68,7 +68,7 @@ public class EquipmentInfo1Service {
                 pewp.setLineId(wt.getLineId());
                 pewp.setProjectId(wt.getProjectId());
                 pewp.setRegionId(wt.getRegionId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconEquipmentInfoDay1> pepid1ls =new ArrayList<>();
@@ -77,7 +77,7 @@ public class EquipmentInfo1Service {
                 if(cl.get(Calendar.DAY_OF_MONTH)!=1)
                 {
                     pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && CacheContext.wtmap.containsKey(i.getWindturbineId())
                             ).collect(Collectors.toList());
                 }

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

@@ -40,11 +40,11 @@ public class EquipmentInfo2Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconEquipmentInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
                         && CacheContext.wtmap.containsKey(i.getWindturbineId())
            ).map(ProEconEquipmentInfoDay2::getId)
                 .collect(Collectors.toList());
@@ -66,7 +66,7 @@ public class EquipmentInfo2Service {
                 pewp.setLineId(wt.getLineId());
                 pewp.setProjectId(wt.getProjectId());
                 pewp.setRegionId(wt.getRegionId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
                 //昨日的统计结果
                 List<ProEconEquipmentInfoDay2> pepidls =new ArrayList<>();
                 Calendar cl=Calendar.getInstance();
@@ -76,7 +76,7 @@ public class EquipmentInfo2Service {
 
                 {
                     pepidls = proEconEquipmentInfoDay2Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getWindturbineId().equals(wt.getId())
                             )
                             .collect(Collectors.toList());

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

@@ -39,11 +39,11 @@ public class EquipmentInfo3Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconEquipmentInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
                         && CacheContext.wtmap.containsKey(i.getWindturbineId())
                          ).map(ProEconEquipmentInfoDay3::getId)
                 .collect(Collectors.toList());
@@ -66,7 +66,7 @@ public class EquipmentInfo3Service {
                 pewp.setLineId(wt.getLineId());
                 pewp.setProjectId(wt.getProjectId());
                 pewp.setRegionId(wt.getRegionId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconEquipmentInfoDay3> pepidls =new ArrayList<>();
@@ -77,7 +77,7 @@ public class EquipmentInfo3Service {
 
                 {
                     pepidls = proEconEquipmentInfoDay3Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getWindturbineId().equals(wt.getId())
                                   )
                             .collect(Collectors.toList());

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

@@ -64,11 +64,11 @@ public class EquipmentInfo4Service {
 
         Date end = c.getTime();
 
-        Date begin = DateUtils.truncDay(c.getTime());
+        Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconEquipmentInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
                         && CacheContext.wtmap.containsKey(i.getWindturbineId())
                 ).map(ProEconEquipmentInfoDay4::getId)
                 .collect(Collectors.toList());
@@ -109,7 +109,7 @@ public class EquipmentInfo4Service {
                 pewp.setLineId(wt.getLineId());
                 pewp.setProjectId(wt.getProjectId());
                 pewp.setRegionId(wt.getRegionId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconEquipmentInfoDay4> pepidls = new ArrayList<>();
@@ -118,7 +118,7 @@ public class EquipmentInfo4Service {
                 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.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getWindturbineId().equals(wt.getId())
                             )
                             .collect(Collectors.toList());
@@ -128,7 +128,7 @@ public class EquipmentInfo4Service {
                 ProEconEquipmentInfoDay2 pepid2 = null;
                 List<ProEconEquipmentInfoDay2> pepid2ls;
                 pepid2ls = proEconEquipmentInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getWindturbineId().equals(wt.getId())
                         ).collect(Collectors.toList());
 
@@ -139,7 +139,7 @@ public class EquipmentInfo4Service {
                 ProEconEquipmentInfoDay3 pepid3 = null;
                 List<ProEconEquipmentInfoDay3> pepid3ls;
                 pepid3ls = proEconEquipmentInfoDay3Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getWindturbineId().equals(wt.getId())
                         ).collect(Collectors.toList());
 

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

@@ -1026,7 +1026,7 @@ public class EquipmentInfo5Service {
         Date end = c.getTime();
 
 
-        List<Integer> deleteitems = proEconFaultLiminatedefectsService.list().stream().filter(i ->
+        List<Long> deleteitems = proEconFaultLiminatedefectsService.list().stream().filter(i ->
                 (i.getDateTime().compareTo(begin) == 0 || i.getDateTime().after(begin))
                         && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
         ).map(ProEconFaultLiminatedefects::getId).collect(Collectors.toList());

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

@@ -39,7 +39,7 @@ public class EquipmentInfoDayTopService {
 
         //判断是否有重复记录,先删除重复记录
         List<Integer> idls = proEconEquipmentInfoDayTopService.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
                         && CacheContext.wtmap.containsKey(i.getWindturbineId())).map(ProEconEquipmentInfoDayTop::getId)
                 .collect(Collectors.toList());
 
@@ -112,12 +112,12 @@ public class EquipmentInfoDayTopService {
         peeidt.setLineId(wt.getLineId());
         peeidt.setProjectId(wt.getProjectId());
         peeidt.setWindturbineId(wt.getId());
-        peeidt.setRecordDate(DateUtils.truncDay(recordDate));
+        peeidt.setRecordDate(DateUtils.truncate(recordDate));
         peeidt.setYear(DateUtils.getYear(recordDate));
         peeidt.setMonth(DateUtils.getMonth(recordDate) + 1);
 
         List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
                         && i.getWindturbineId().equals(wt.getId())
                 ).collect(Collectors.toList());
 
@@ -159,7 +159,7 @@ public class EquipmentInfoDayTopService {
 
 
         List<ProEconEquipmentInfoDay2> pepid2ls = proEconEquipmentInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
                         && i.getWindturbineId().equals(wt.getId())
                 ).collect(Collectors.toList());
 
@@ -232,7 +232,7 @@ public class EquipmentInfoDayTopService {
         }
 
         List<ProEconEquipmentInfoDay4> pepid4ls = proEconEquipmentInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
                         && i.getWindturbineId().equals(wt.getId())
                 ).collect(Collectors.toList());
 

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

@@ -233,15 +233,15 @@ public class GoodnessOfFitService {
                 speed = StringUtils.round(item.getSpeed(), 1);
             }
             String windturbineId = item.getWindturbineId();
-            if (CacheContext.modelpowermap.containsKey(item.getModelId()))
+            if (CacheContext.theoreticalPowerMap.containsKey(item.getModelId()))
             {
-                if (CacheContext.modelpowermap.get(item.getModelId()).size() > 0)
+                if (CacheContext.theoreticalPowerMap.get(item.getModelId()).size() > 0)
                 {
 
 
-                    if (CacheContext.modelpowermap.get(item.getModelId()).containsKey(speed))
+                    if (CacheContext.theoreticalPowerMap.get(item.getModelId()).containsKey(speed))
                     {
-                        Double epower = CacheContext.modelpowermap.get(item.getModelId()).get(speed).getEnsurePower();
+                        Double epower = CacheContext.theoreticalPowerMap.get(item.getModelId()).get(speed).getEnsurePower();
 
 
                         buildtheMap(theMap, theList, windpowerstationId, item, speed, epower);

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

@@ -11,6 +11,7 @@ import com.gyee.generation.service.auto.IProEconInputOrOutputSpeedService;
 import com.gyee.generation.util.DateUtils;
 import com.gyee.generation.util.StringUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -31,99 +32,119 @@ public class InputOrOutPutService {
     @Resource
     private IProEconInputOrOutputSpeedService proEconInputOrOutputSpeedService;
 
+    @Value("${frequency.cutinandout}")
+    private Integer frequency;
 
-    private Map<String,Double> lastStatusMap=new HashMap<>();
+    private static Map<String,Double> wtLastStatusMap=new HashMap<>();
 
-    public void inputOrOutputSpeed() throws Exception {
-       
+    private static  Map<String,ProEconInputOrOutputSpeed> wtTimeStatusMap=new HashMap<>();
+
+    public void inputOrOutputSpeed(Date recordDate) throws Exception {
+
+        Date begin = DateUtils.addMinutes(recordDate, -frequency);
+        Date daybegin = DateUtils.addMinutes(recordDate, -frequency*2);
+
+        Date end = recordDate;
         for(ProBasicEquipment wt:CacheContext.wtls)
         {
 
             Map<String, ProBasicEquipmentPoint> pointmap= CacheContext.wtpAimap.get(wt.getNemCode());
 
-            double lastStatus=-1;
-            if(lastStatusMap.containsKey(wt.getId()))
-            {
-                 lastStatus=lastStatusMap.get(wt.getId());
-            }else
+            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());
+
+            if(!recordList.isEmpty())
             {
-                lastStatus = getLastStatus(pointmap);
+                for(ProEconInputOrOutputSpeed po:recordList)
+                {
+                    wtTimeStatusMap.put(String.valueOf(po.getRecordDate().getTime()),po);
+                }
             }
 
+            double lastStatus=-1;
+
 
             ProBasicEquipmentPoint mxzt= pointmap.get(ContantXk.MXZT);
 
-            PointData mxztData= edosUtil.getRealData(mxzt.getNemCode());
 
-            double status=mxztData.getPointValueInDouble();
-            if (!Objects.equals(lastStatus, status))
-            {
+            //获取5分钟没个间隔1秒钟,保证状态与时序库保持一致
+            List<PointData> statusls = edosUtil.getHistoryDatasSnap(mxzt.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000,null,1L);
+            List<PointData> ssfsls = edosUtil.getHistoryDatasSnap(mxzt.getNemCode(), begin.getTime() / 1000, end.getTime() / 1000,null,1L);
 
-                //    #region 切入切出风速
-                if (lastStatus == 0 && status == 2)
+            if(!statusls.isEmpty() && !ssfsls.isEmpty() && ssfsls.size()==statusls.size())
+            {
+                for(int i=0;i<statusls.size();i++)
                 {
-                    ProEconInputOrOutputSpeed input = new ProEconInputOrOutputSpeed();
-                    input.setWindturbineId(wt.getId());
-                    input.setWindpowerstationId(wt.getWindpowerstationId());
-                    input.setProjectId(wt.getProjectId());
-                    input.setLineId(wt.getLineId());
-                    input.setRecordDate(new Date());
-                    input.setInputOrOutput(1);
-
-                    ProBasicEquipmentPoint ssfs= pointmap.get(ContantXk.CJ_SSFS);
-                        double value =edosUtil.getRealData(ssfs.getNemCode()).getPointValueInDouble();
-                        input.setSpeed(value);
-
-                    proEconInputOrOutputSpeedService.save(input);
 
+                    if(wtLastStatusMap.containsKey(wt.getId()))
+                    {
+                        lastStatus=wtLastStatusMap.get(wt.getId());
+                    }
 
+                    PointData statuspo=statusls.get(i);
+                    PointData ssfspo=ssfsls.get(i);
+                    double status=StringUtils.round(statuspo.getPointValueInDouble(),0);
+
+                    if (!Objects.equals(lastStatus, status))
+                    {
+
+                        //    #region 切入切出风速
+                        if (lastStatus == 0 && status == 2)
+                        {
+                            ProEconInputOrOutputSpeed input = new ProEconInputOrOutputSpeed();
+                            input.setWindturbineId(wt.getId());
+                            input.setWindpowerstationId(wt.getWindpowerstationId());
+                            input.setProjectId(wt.getProjectId());
+                            input.setLineId(wt.getLineId());
+                            input.setRecordDate(DateUtils.truncate(new Date(statuspo.getPointTime())));
+                            input.setInputOrOutput(1);
+
+
+                            input.setSpeed(StringUtils.round(ssfspo.getPointValueInDouble(),2));
+
+                            if(!wtTimeStatusMap.containsKey(String.valueOf(statuspo.getPointTime())))
+                            {
+                                proEconInputOrOutputSpeedService.save(input);
+                            }
+
+                        }
+                        else if (lastStatus == 2 && status== 0)
+                        {
+                            ProEconInputOrOutputSpeed input = new ProEconInputOrOutputSpeed();
+                            input.setWindturbineId(wt.getId());
+                            input.setWindpowerstationId(wt.getWindpowerstationId());
+                            input.setProjectId(wt.getProjectId());
+                            input.setLineId(wt.getLineId());
+                            input.setRecordDate(DateUtils.truncate(new Date(statuspo.getPointTime())));
+                            input.setInputOrOutput(0);
+
+                            input.setSpeed(StringUtils.round(ssfspo.getPointValueInDouble(),2));
+
+                            if(!wtTimeStatusMap.containsKey(String.valueOf(statuspo.getPointTime())))
+                            {
+                                proEconInputOrOutputSpeedService.save(input);
+                            }
+                        }
+
+                        wtLastStatusMap.put(wt.getId(), status);
 
+                    }
                 }
-                else if (lastStatus == 2 && status== 0)
-                {
-                    ProEconInputOrOutputSpeed input = new ProEconInputOrOutputSpeed();
-                    input.setWindturbineId(wt.getId());
-                    input.setWindpowerstationId(wt.getWindpowerstationId());
-                    input.setProjectId(wt.getProjectId());
-                    input.setLineId(wt.getLineId());
-                    input.setRecordDate(new Date());
-                    input.setInputOrOutput(0);
-
-                    ProBasicEquipmentPoint ssfs= pointmap.get(ContantXk.CJ_SSFS);
-                    double value =edosUtil.getRealData(ssfs.getNemCode()).getPointValueInDouble();
-                    input.setSpeed(value);
-                    proEconInputOrOutputSpeedService.save(input);
-                }
-
-                lastStatusMap.put(wt.getId(), getLastStatus(pointmap));
-
             }
-            
-            
+
         }
 
-       
     }
 
-    private double getLastStatus(Map<String, ProBasicEquipmentPoint> pointmap) throws Exception {
-        double lastStatus;
-        ProBasicEquipmentPoint power= pointmap.get(ContantXk.CJ_SSGL);
-        double powerdata =edosUtil.getRealData(power.getNemCode()).getPointValueInDouble();
-        if (powerdata > 1)
-        {
-             lastStatus=powerdata == 9 ? 2 :  powerdata;
 
-        }
-        else
-        {
-             lastStatus=powerdata == 9 ? 0 :  powerdata;
-
-        }
-        return lastStatus;
-    }
 
     public void inputOrOutput(Date currentDate) {
-        currentDate = DateUtils.truncDay(currentDate);
+        currentDate = DateUtils.truncate(currentDate);
+//        Date end = DateUtils.addDays(currentDate, 1);
+//        Date daybegin =DateUtils.truncate(currentDate);
         Date end = currentDate;
         Date daybegin = DateUtils.addDays(currentDate, -1);
 
@@ -191,6 +212,7 @@ public class InputOrOutPutService {
 
 
                     newMethod(end, daybegin, monthbegin, yearbegin, wt.getId(), total1, total2);
+                    verify(total1);
 
                     proEconInOrOutSpeedTotalService.save(total1);
                     proEconInOrOutSpeedTotal2Service.save(total2);
@@ -202,6 +224,548 @@ public class InputOrOutPutService {
         }
     }
 
+    private  void verify(ProEconInOrOutSpeedTotal total1) {
+        //日小风切入
+        if (Double.isInfinite(total1.getDayInputSmall()) || Double.isNaN(total1.getDayInputSmall()))
+        {
+            total1.setDayInputSmall(0.0);
+        }else
+        {
+            total1.setDayInputSmall(StringUtils.round(total1.getDayInputSmall(),2));
+        }
+        //日小风切入最小值
+        if (Double.isInfinite(total1.getDayInputSmallMin()) || Double.isNaN(total1.getDayInputSmallMin()))
+        {
+            total1.setDayInputSmallMin(0.0);
+        }else
+        {
+            total1.setDayInputSmallMin(StringUtils.round(total1.getDayInputSmallMin(),2));
+        }
+        //日小风切入最大值
+        if (Double.isInfinite(total1.getDayInputSmallMax()) || Double.isNaN(total1.getDayInputSmallMax()))
+        {
+            total1.setDayInputSmallMax(0.0);
+        }else
+        {
+            total1.setDayInputSmallMax(StringUtils.round(total1.getDayInputSmallMax(),2));
+        }
+
+        //日大风切入
+        if (Double.isInfinite(total1.getDayInputBig()) || Double.isNaN(total1.getDayInputBig()))
+        {
+            total1.setDayInputBig(0.0);
+        }else
+        {
+            total1.setDayInputBig(StringUtils.round(total1.getDayInputBig(),2));
+        }
+        //日大风切入最大值
+        if (Double.isInfinite(total1.getDayInputBigMin()) || Double.isNaN(total1.getDayInputBigMin()))
+        {
+            total1.setDayInputBigMin(0.0);
+        }else
+        {
+            total1.setDayInputBigMin(StringUtils.round(total1.getDayInputBigMin(),2));
+        }
+        //日大风切入最大值
+        if (Double.isInfinite(total1.getDayInputBigMax()) || Double.isNaN(total1.getDayInputBigMax()))
+        {
+            total1.setDayInputBigMax(0.0);
+        }else
+        {
+            total1.setDayInputBigMax(StringUtils.round(total1.getDayInputBigMax(),2));
+        }
+
+        //日小风切出
+        if (Double.isInfinite(total1.getDayOutputSmall()) || Double.isNaN(total1.getDayOutputSmall()))
+        {
+            total1.setDayOutputSmall(0.0);
+        }else
+        {
+            total1.setDayOutputSmall(StringUtils.round(total1.getDayOutputSmall(),2));
+        }
+        //日小风切出最小值
+        if (Double.isInfinite(total1.getDayOutputSmallMin()) || Double.isNaN(total1.getDayOutputSmallMin()))
+        {
+            total1.setDayOutputSmallMin(0.0);
+        }else
+        {
+            total1.setDayOutputSmallMin(StringUtils.round(total1.getDayOutputSmallMin(),2));
+        }
+        //日小风切出最大值
+        if (Double.isInfinite(total1.getDayOutputSmallMax()) || Double.isNaN(total1.getDayOutputSmallMax()))
+        {
+            total1.setDayOutputSmallMax(0.0);
+        }else
+        {
+            total1.setDayOutputSmallMax(StringUtils.round(total1.getDayOutputSmallMax(),2));
+        }
+
+        //日大风切出
+        if (Double.isInfinite(total1.getDayOutputBig()) || Double.isNaN(total1.getDayOutputBig()))
+        {
+            total1.setDayOutputBig(0.0);
+        }else
+        {
+            total1.setDayOutputBig(StringUtils.round(total1.getDayOutputBig(),2));
+        }
+        //日大风切出最大值
+        if (Double.isInfinite(total1.getDayOutputBigMin()) || Double.isNaN(total1.getDayOutputBigMin()))
+        {
+            total1.setDayOutputBigMin(0.0);
+        }else
+        {
+            total1.setDayOutputBigMin(StringUtils.round(total1.getDayOutputBigMin(),2));
+        }
+        //日大风切出最大值
+        if (Double.isInfinite(total1.getDayOutputBigMax()) || Double.isNaN(total1.getDayOutputBigMax()))
+        {
+            total1.setDayOutputBigMax(0.0);
+        }else
+        {
+            total1.setDayOutputBigMax(StringUtils.round(total1.getDayOutputBigMax(),2));
+        }
+
+        //月小风切入
+        if (Double.isInfinite(total1.getMonthInputSmall()) || Double.isNaN(total1.getMonthInputSmall()))
+        {
+            total1.setMonthInputSmall(0.0);
+        }else
+        {
+            total1.setMonthInputSmall(StringUtils.round(total1.getMonthInputSmall(),2));
+        }
+        //月小风切入最小值
+        if (Double.isInfinite(total1.getMonthInputSmallMin()) || Double.isNaN(total1.getMonthInputSmallMin()))
+        {
+            total1.setMonthInputSmallMin(0.0);
+        }else
+        {
+            total1.setMonthInputSmallMin(StringUtils.round(total1.getMonthInputSmallMin(),2));
+        }
+        //月小风切入最大值
+        if (Double.isInfinite(total1.getMonthInputSmallMax()) || Double.isNaN(total1.getMonthInputSmallMax()))
+        {
+            total1.setMonthInputSmallMax(0.0);
+        }else
+        {
+            total1.setMonthInputSmallMax(StringUtils.round(total1.getMonthInputSmallMax(),2));
+        }
+
+        //月大风切入
+        if (Double.isInfinite(total1.getMonthInputBig()) || Double.isNaN(total1.getMonthInputBig()))
+        {
+            total1.setMonthInputBig(0.0);
+        }else
+        {
+            total1.setMonthInputBig(StringUtils.round(total1.getMonthInputBig(),2));
+        }
+        //月大风切入最大值
+        if (Double.isInfinite(total1.getMonthInputBigMin()) || Double.isNaN(total1.getMonthInputBigMin()))
+        {
+            total1.setMonthInputBigMin(0.0);
+        }else
+        {
+            total1.setMonthInputBigMin(StringUtils.round(total1.getMonthInputBigMin(),2));
+        }
+        //月大风切入最大值
+        if (Double.isInfinite(total1.getMonthInputBigMax()) || Double.isNaN(total1.getMonthInputBigMax()))
+        {
+            total1.setMonthInputBigMax(0.0);
+        }else
+        {
+            total1.setMonthInputBigMax(StringUtils.round(total1.getMonthInputBigMax(),2));
+        }
+
+        //月小风切出
+        if (Double.isInfinite(total1.getMonthOutputSmall()) || Double.isNaN(total1.getMonthOutputSmall()))
+        {
+            total1.setMonthOutputSmall(0.0);
+        }else
+        {
+            total1.setMonthOutputSmall(StringUtils.round(total1.getMonthOutputSmall(),2));
+        }
+        //月小风切出最小值
+        if (Double.isInfinite(total1.getMonthOutputSmallMin()) || Double.isNaN(total1.getMonthOutputSmallMin()))
+        {
+            total1.setMonthOutputSmallMin(0.0);
+        }else
+        {
+            total1.setMonthOutputSmallMin(StringUtils.round(total1.getMonthOutputSmallMin(),2));
+        }
+        //月小风切出最大值
+        if (Double.isInfinite(total1.getMonthOutputSmallMax()) || Double.isNaN(total1.getMonthOutputSmallMax()))
+        {
+            total1.setMonthOutputSmallMax(0.0);
+        }else
+        {
+            total1.setMonthOutputSmallMax(StringUtils.round(total1.getMonthOutputSmallMax(),2));
+        }
+
+        //月大风切出
+        if (Double.isInfinite(total1.getMonthOutputBig()) || Double.isNaN(total1.getMonthOutputBig()))
+        {
+            total1.setMonthOutputBig(0.0);
+        }else
+        {
+            total1.setMonthOutputBig(StringUtils.round(total1.getMonthOutputBig(),2));
+        }
+        //月大风切出最大值
+        if (Double.isInfinite(total1.getMonthOutputBigMin()) || Double.isNaN(total1.getMonthOutputBigMin()))
+        {
+            total1.setMonthOutputBigMin(0.0);
+        }else
+        {
+            total1.setMonthOutputBigMin(StringUtils.round(total1.getMonthOutputBigMin(),2));
+        }
+        //月大风切出最大值
+        if (Double.isInfinite(total1.getMonthOutputBigMax()) || Double.isNaN(total1.getMonthOutputBigMax()))
+        {
+            total1.setMonthOutputBigMax(0.0);
+        }else
+        {
+            total1.setMonthOutputBigMax(StringUtils.round(total1.getMonthOutputBigMax(),2));
+        }
+
+        //年小风切入
+        if (Double.isInfinite(total1.getYearInputSmall()) || Double.isNaN(total1.getYearInputSmall()))
+        {
+            total1.setYearInputSmall(0.0);
+        }else
+        {
+            total1.setYearInputSmall(StringUtils.round(total1.getYearInputSmall(),2));
+        }
+        //年小风切入最小值
+        if (Double.isInfinite(total1.getYearInputSmallMin()) || Double.isNaN(total1.getYearInputSmallMin()))
+        {
+            total1.setYearInputSmallMin(0.0);
+        }else
+        {
+            total1.setYearInputSmallMin(StringUtils.round(total1.getYearInputSmallMin(),2));
+        }
+        //年小风切入最大值
+        if (Double.isInfinite(total1.getYearInputSmallMax()) || Double.isNaN(total1.getYearInputSmallMax()))
+        {
+            total1.setYearInputSmallMax(0.0);
+        }else
+        {
+            total1.setYearInputSmallMax(StringUtils.round(total1.getYearInputSmallMax(),2));
+        }
+
+        //年大风切入
+        if (Double.isInfinite(total1.getYearInputBig()) || Double.isNaN(total1.getYearInputBig()))
+        {
+            total1.setYearInputBig(0.0);
+        }else
+        {
+            total1.setYearInputBig(StringUtils.round(total1.getYearInputBig(),2));
+        }
+        //年大风切入最大值
+        if (Double.isInfinite(total1.getYearInputBigMin()) || Double.isNaN(total1.getYearInputBigMin()))
+        {
+            total1.setYearInputBigMin(0.0);
+        }else
+        {
+            total1.setYearInputBigMin(StringUtils.round(total1.getYearInputBigMin(),2));
+        }
+        //年大风切入最大值
+        if (Double.isInfinite(total1.getYearInputBigMax()) || Double.isNaN(total1.getYearInputBigMax()))
+        {
+            total1.setYearInputBigMax(0.0);
+        }else
+        {
+            total1.setYearInputBigMax(StringUtils.round(total1.getYearInputBigMax(),2));
+        }
+
+        //年小风切出
+        if (Double.isInfinite(total1.getYearOutputSmall()) || Double.isNaN(total1.getYearOutputSmall()))
+        {
+            total1.setYearOutputSmall(0.0);
+        }else
+        {
+            total1.setYearOutputSmall(StringUtils.round(total1.getYearOutputSmall(),2));
+        }
+        //年小风切出最小值
+        if (Double.isInfinite(total1.getYearOutputSmallMin()) || Double.isNaN(total1.getYearOutputSmallMin()))
+        {
+            total1.setYearOutputSmallMin(0.0);
+        }else
+        {
+            total1.setYearOutputSmallMin(StringUtils.round(total1.getYearOutputSmallMin(),2));
+        }
+        //年小风切出最大值
+        if (Double.isInfinite(total1.getYearOutputSmallMax()) || Double.isNaN(total1.getYearOutputSmallMax()))
+        {
+            total1.setYearOutputSmallMax(0.0);
+        }else
+        {
+            total1.setYearOutputSmallMax(StringUtils.round(total1.getYearOutputSmallMax(),2));
+        }
+
+        //年大风切出
+        if (Double.isInfinite(total1.getYearOutputBig()) || Double.isNaN(total1.getYearOutputBig()))
+        {
+            total1.setYearOutputBig(0.0);
+        }else
+        {
+            total1.setYearOutputBig(StringUtils.round(total1.getYearOutputBig(),2));
+        }
+        //年大风切出最大值
+        if (Double.isInfinite(total1.getYearOutputBigMin()) || Double.isNaN(total1.getYearOutputBigMin()))
+        {
+            total1.setYearOutputBigMin(0.0);
+        }else
+        {
+            total1.setYearOutputBigMin(StringUtils.round(total1.getYearOutputBigMin(),2));
+        }
+        //年大风切出最大值
+        if (Double.isInfinite(total1.getYearOutputBigMax()) || Double.isNaN(total1.getYearOutputBigMax()))
+        {
+            total1.setYearOutputBigMax(0.0);
+        }else
+        {
+            total1.setYearOutputBigMax(StringUtils.round(total1.getYearOutputBigMax(),2));
+        }
+
+        //小风切入
+        if (Double.isInfinite(total1.getInputSmall()) || Double.isNaN(total1.getInputSmall()))
+        {
+            total1.setInputSmall(0.0);
+        }else
+        {
+            total1.setInputSmall(StringUtils.round(total1.getInputSmall(),2));
+        }
+        //小风切入最小值
+        if (Double.isInfinite(total1.getInputSmallMin()) || Double.isNaN(total1.getInputSmallMin()))
+        {
+            total1.setInputSmallMin(0.0);
+        }else
+        {
+            total1.setInputSmallMin(StringUtils.round(total1.getInputSmallMin(),2));
+        }
+        //小风切入最大值
+        if (Double.isInfinite(total1.getInputSmallMax()) || Double.isNaN(total1.getInputSmallMax()))
+        {
+            total1.setInputSmallMax(0.0);
+        }else
+        {
+            total1.setInputSmallMax(StringUtils.round(total1.getInputSmallMax(),2));
+        }
+
+        //大风切入
+        if (Double.isInfinite(total1.getInputBig()) || Double.isNaN(total1.getInputBig()))
+        {
+            total1.setInputBig(0.0);
+        }else
+        {
+            total1.setInputBig(StringUtils.round(total1.getInputBig(),2));
+        }
+        //大风切入最大值
+        if (Double.isInfinite(total1.getInputBigMin()) || Double.isNaN(total1.getInputBigMin()))
+        {
+            total1.setInputBigMin(0.0);
+        }else
+        {
+            total1.setInputBigMin(StringUtils.round(total1.getInputBigMin(),2));
+        }
+        //大风切入最大值
+        if (Double.isInfinite(total1.getInputBigMax()) || Double.isNaN(total1.getInputBigMax()))
+        {
+            total1.setInputBigMax(0.0);
+        }else
+        {
+            total1.setInputBigMax(StringUtils.round(total1.getInputBigMax(),2));
+        }
+
+        //小风切出
+        if (Double.isInfinite(total1.getOutputSmall()) || Double.isNaN(total1.getOutputSmall()))
+        {
+            total1.setOutputSmall(0.0);
+        }else
+        {
+            total1.setOutputSmall(StringUtils.round(total1.getOutputSmall(),2));
+        }
+        //小风切出最小值
+        if (Double.isInfinite(total1.getOutputSmallMin()) || Double.isNaN(total1.getOutputSmallMin()))
+        {
+            total1.setOutputSmallMin(0.0);
+        }else
+        {
+            total1.setOutputSmallMin(StringUtils.round(total1.getOutputSmallMin(),2));
+        }
+        //小风切出最大值
+        if (Double.isInfinite(total1.getOutputSmallMax()) || Double.isNaN(total1.getOutputSmallMax()))
+        {
+            total1.setOutputSmallMax(0.0);
+        }else
+        {
+            total1.setOutputSmallMax(StringUtils.round(total1.getOutputSmallMax(),2));
+        }
+
+        //大风切出
+        if (Double.isInfinite(total1.getOutputBig()) || Double.isNaN(total1.getOutputBig()))
+        {
+            total1.setOutputBig(0.0);
+        }else
+        {
+            total1.setOutputBig(StringUtils.round(total1.getOutputBig(),2));
+        }
+        //大风切出最大值
+        if (Double.isInfinite(total1.getOutputBigMin()) || Double.isNaN(total1.getOutputBigMin()))
+        {
+            total1.setOutputBigMin(0.0);
+        }else
+        {
+            total1.setOutputBigMin(StringUtils.round(total1.getOutputBigMin(),2));
+        }
+        //大风切出最大值
+        if (Double.isInfinite(total1.getOutputBigMax()) || Double.isNaN(total1.getOutputBigMax()))
+        {
+            total1.setOutputBigMax(0.0);
+        }else
+        {
+            total1.setOutputBigMax(StringUtils.round(total1.getOutputBigMax(),2));
+        }
+
+
+        //日小风切入合格率
+        if (Double.isInfinite(total1.getDayInputSmallRatio()) || Double.isNaN(total1.getDayInputSmallRatio()))
+        {
+            total1.setDayInputSmallRatio(0.0);
+        }else
+        {
+            total1.setDayInputSmallRatio(StringUtils.round(total1.getDayInputSmallRatio(),2));
+        }
+        //日小风切出合格率
+        if (Double.isInfinite(total1.getDayOutputSmallRatio()) || Double.isNaN(total1.getDayOutputSmallRatio()))
+        {
+            total1.setDayOutputSmallRatio(0.0);
+        }else
+        {
+            total1.setDayOutputSmallRatio(StringUtils.round(total1.getDayOutputSmallRatio(),2));
+        }
+
+        //日大风切入合格率
+        if (Double.isInfinite(total1.getDayInputBigRatio()) || Double.isNaN(total1.getDayInputBigRatio()))
+        {
+            total1.setDayInputBigRatio(0.0);
+        }else
+        {
+            total1.setDayInputBigRatio(StringUtils.round(total1.getDayInputBigRatio(),2));
+        }
+
+        //日大风切出合格率
+        if (Double.isInfinite(total1.getDayOutputBigRatio()) || Double.isNaN(total1.getDayOutputBigRatio()))
+        {
+            total1.setDayOutputBigRatio(0.0);
+        }else
+        {
+            total1.setDayOutputBigRatio(StringUtils.round(total1.getDayOutputBigRatio(),2));
+        }
+        //月小风切入合格率
+        if (Double.isInfinite(total1.getMonthInputSmallRatio()) || Double.isNaN(total1.getMonthInputSmallRatio()))
+        {
+            total1.setMonthInputSmallRatio(0.0);
+        }else
+        {
+            total1.setMonthInputSmallRatio(StringUtils.round(total1.getMonthInputSmallRatio(),2));
+        }
+        //月小风切出合格率
+        if (Double.isInfinite(total1.getMonthOutputSmallRatio()) || Double.isNaN(total1.getMonthOutputSmallRatio()))
+        {
+            total1.setMonthOutputSmallRatio(0.0);
+        }else
+        {
+            total1.setMonthOutputSmallRatio(StringUtils.round(total1.getMonthOutputSmallRatio(),2));
+        }
+
+        //月大风切入合格率
+        if (Double.isInfinite(total1.getMonthInputBigRatio()) || Double.isNaN(total1.getMonthInputBigRatio()))
+        {
+            total1.setMonthInputBigRatio(0.0);
+        }else
+        {
+            total1.setMonthInputBigRatio(StringUtils.round(total1.getMonthInputBigRatio(),2));
+        }
+
+        //月大风切出合格率
+        if (Double.isInfinite(total1.getMonthOutputBigRatio()) || Double.isNaN(total1.getMonthOutputBigRatio()))
+        {
+            total1.setMonthOutputBigRatio(0.0);
+        }else
+        {
+            total1.setMonthOutputBigRatio(StringUtils.round(total1.getMonthOutputBigRatio(),2));
+        }
+
+        //年小风切入合格率
+        if (Double.isInfinite(total1.getYearInputSmallRatio()) || Double.isNaN(total1.getYearInputSmallRatio()))
+        {
+            total1.setYearInputSmallRatio(0.0);
+        }else
+        {
+            total1.setYearInputSmallRatio(StringUtils.round(total1.getYearInputSmallRatio(),2));
+        }
+        //年小风切出合格率
+        if (Double.isInfinite(total1.getYearOutputSmallRatio()) || Double.isNaN(total1.getYearOutputSmallRatio()))
+        {
+            total1.setYearOutputSmallRatio(0.0);
+        }else
+        {
+            total1.setYearOutputSmallRatio(StringUtils.round(total1.getYearOutputSmallRatio(),2));
+        }
+
+        //年大风切入合格率
+        if (Double.isInfinite(total1.getYearInputBigRatio()) || Double.isNaN(total1.getYearInputBigRatio()))
+        {
+            total1.setYearInputBigRatio(0.0);
+        }else
+        {
+            total1.setYearInputBigRatio(StringUtils.round(total1.getYearInputBigRatio(),2));
+        }
+
+        //年大风切出合格率
+        if (Double.isInfinite(total1.getYearOutputBigRatio()) || Double.isNaN(total1.getYearOutputBigRatio()))
+        {
+            total1.setYearOutputBigRatio(0.0);
+        }else
+        {
+            total1.setYearOutputBigRatio(StringUtils.round(total1.getYearOutputBigRatio(),2));
+        }
+
+        //总小风切入合格率
+        if (Double.isInfinite(total1.getInputSmallRatio()) || Double.isNaN(total1.getInputSmallRatio()))
+        {
+            total1.setInputSmallRatio(0.0);
+        }else
+        {
+            total1.setInputSmallRatio(StringUtils.round(total1.getInputSmallRatio(),2));
+        }
+        //总小风切出合格率
+        if (Double.isInfinite(total1.getOutputSmallRatio()) || Double.isNaN(total1.getOutputSmallRatio()))
+        {
+            total1.setOutputSmallRatio(0.0);
+        }else
+        {
+            total1.setOutputSmallRatio(StringUtils.round(total1.getOutputSmallRatio(),2));
+        }
+
+        //总大风切入合格率
+        if (Double.isInfinite(total1.getInputBigRatio()) || Double.isNaN(total1.getInputBigRatio()))
+        {
+            total1.setInputBigRatio(0.0);
+        }else
+        {
+            total1.setInputBigRatio(StringUtils.round(total1.getInputBigRatio(),2));
+        }
+
+        //总大风切出合格率
+        if (Double.isInfinite(total1.getOutputBigMaxRatio()) || Double.isNaN(total1.getOutputBigMaxRatio()))
+        {
+            total1.setOutputBigMaxRatio(0.0);
+        }else
+        {
+            total1.setOutputBigMaxRatio(StringUtils.round(total1.getOutputBigMaxRatio(),2));
+        }
+    }
+
     private void newMethod(Date end, Date daybegin, Date monthbegin, Date yearbegin, String windturbineId, ProEconInOrOutSpeedTotal total1, ProEconInOrOutSpeedTotal2 total2) {
         buildDay(end, daybegin, windturbineId, total1, total2);
         buildMonth(end, monthbegin, windturbineId, total1, total2);

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

@@ -975,7 +975,7 @@ public class LimitEventService {
         }else
         {
             Calendar c=Calendar.getInstance();
-            c.setTime(DateUtils.truncDay(startDate));
+            c.setTime(DateUtils.truncate(startDate));
             c.add(Calendar.DAY_OF_MONTH,1);
            //获得1月1日零点值
             Date endtime=c.getTime();

File diff suppressed because it is too large
+ 468 - 506
realtime/generationXK-service/src/main/java/com/gyee/generation/service/LimitEventnewService.java


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

@@ -63,7 +63,7 @@ public class PowerCurveFittingByTimeService {
 
     public void cureFittingDay(Date recordDate) throws Exception {
         //日期变为昨天
-        Date end = DateUtils.addDays(DateUtils.truncDay(recordDate), -1);
+        Date end = DateUtils.addDays(DateUtils.truncate(recordDate), -1);
 
         Calendar c = Calendar.getInstance();
         c.setTime(end);
@@ -210,18 +210,18 @@ public class PowerCurveFittingByTimeService {
                 String modelid = CacheContext.wtmap.get(key).getModelId();
                 if (StringUtils.notEmp(modelid)) {
                     //获取模型功率曲线
-                    if (CacheContext.modelpowermap.containsKey(modelid)) {
-                        for (Double speed : CacheContext.modelpowermap.get(modelid).keySet()) {
+                    if (CacheContext.theoreticalPowerMap.containsKey(modelid)) {
+                        for (Double speed : CacheContext.theoreticalPowerMap.get(modelid).keySet()) {
                             PointVo point = new PointVo();
                             point.setX(speed);
-                            point.setY(CacheContext.modelpowermap.get(modelid).get(speed).getEnsurePower());
+                            point.setY(CacheContext.theoreticalPowerMap.get(modelid).get(speed).getEnsurePower());
 
                             bzglpowerPoints.add(point);
                         }
                     }
                 }
             }
-//*********************************************年曲线偏差记录**********************************************************/
+
 
 
             //*********************************************当日曲线偏差记录**********************************************************/
@@ -283,7 +283,7 @@ public class PowerCurveFittingByTimeService {
 
     public void cureFittingMonth(Date recordDate) throws Exception {
         //日期变为昨天
-        Date end = DateUtils.addDays(DateUtils.truncDay(recordDate), -1);
+        Date end = DateUtils.addDays(DateUtils.truncate(recordDate), -1);
 
         Calendar c = Calendar.getInstance();
         c.setTime(recordDate);
@@ -443,11 +443,11 @@ public class PowerCurveFittingByTimeService {
                 String modelid = CacheContext.wtmap.get(key).getModelId();
                 if (StringUtils.notEmp(modelid)) {
                     //获取模型功率曲线
-                    if (CacheContext.modelpowermap.containsKey(modelid)) {
-                        for (Double speed : CacheContext.modelpowermap.get(modelid).keySet()) {
+                    if (CacheContext.theoreticalPowerMap.containsKey(modelid)) {
+                        for (Double speed : CacheContext.theoreticalPowerMap.get(modelid).keySet()) {
                             PointVo point = new PointVo();
                             point.setX(speed);
-                            point.setY(CacheContext.modelpowermap.get(modelid).get(speed).getEnsurePower());
+                            point.setY(CacheContext.theoreticalPowerMap.get(modelid).get(speed).getEnsurePower());
 
                             bzglpowerPoints.add(point);
                         }
@@ -522,7 +522,7 @@ public class PowerCurveFittingByTimeService {
 
     public void cureFittingYear(Date recordDate) throws Exception {
         //日期变为昨天
-        Date end = DateUtils.addDays(DateUtils.truncDay(recordDate), -1);
+        Date end = DateUtils.addDays(DateUtils.truncate(recordDate), -1);
 
         Calendar c = Calendar.getInstance();
 
@@ -678,11 +678,11 @@ public class PowerCurveFittingByTimeService {
                 String modelid = CacheContext.wtmap.get(key).getModelId();
                 if (StringUtils.notEmp(modelid)) {
                     //获取模型功率曲线
-                    if (CacheContext.modelpowermap.containsKey(modelid)) {
-                        for (Double speed : CacheContext.modelpowermap.get(modelid).keySet()) {
+                    if (CacheContext.theoreticalPowerMap.containsKey(modelid)) {
+                        for (Double speed : CacheContext.theoreticalPowerMap.get(modelid).keySet()) {
                             PointVo point = new PointVo();
                             point.setX(speed);
-                            point.setY(CacheContext.modelpowermap.get(modelid).get(speed).getEnsurePower());
+                            point.setY(CacheContext.theoreticalPowerMap.get(modelid).get(speed).getEnsurePower());
 
                             bzglpowerPoints.add(point);
                         }

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

@@ -65,7 +65,7 @@ public class PowerCurveFittingService {
     public void cureFitting(Date nowDate, Date begion, int insertType, List<ProBasicEquipment> wtls) throws Exception {
 
         //日期变为昨天
-        Date current = DateUtils.addDays(DateUtils.truncDay(nowDate), -1);
+        Date current = DateUtils.addDays(DateUtils.truncate(nowDate), -1);
 
         Calendar c = Calendar.getInstance();
         c.setTime(current);
@@ -78,7 +78,7 @@ public class PowerCurveFittingService {
         Date begin3 = c.getTime();
         Date begin2 = DateUtils.addDays(current, -6);
 
-        Date end = DateUtils.truncDay(nowDate);
+        Date end = DateUtils.truncate(nowDate);
         if (begion.getTime() != new Date(0).getTime() && begion.getTime() != new Date(Long.MAX_VALUE).getTime()) {
             begin1 = begion;
         }
@@ -297,11 +297,11 @@ public class PowerCurveFittingService {
                 String modelid = CacheContext.wtmap.get(key).getModelId();
                 if (StringUtils.notEmp(modelid)) {
                     //获取模型功率曲线
-                    if (CacheContext.modelpowermap.containsKey(modelid)) {
-                        for (Double speed : CacheContext.modelpowermap.get(modelid).keySet()) {
+                    if (CacheContext.theoreticalPowerMap.containsKey(modelid)) {
+                        for (Double speed : CacheContext.theoreticalPowerMap.get(modelid).keySet()) {
                             PointVo point = new PointVo();
                             point.setX(speed);
-                            point.setY(CacheContext.modelpowermap.get(modelid).get(speed).getEnsurePower());
+                            point.setY(CacheContext.theoreticalPowerMap.get(modelid).get(speed).getEnsurePower());
 
                             bzglpowerPoints.add(point);
                         }

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

@@ -795,7 +795,7 @@ public class ShutdownService {
         }else
         {
             Calendar c=Calendar.getInstance();
-            c.setTime(DateUtils.truncDay(startDate));
+            c.setTime(DateUtils.truncate(startDate));
             c.add(Calendar.DAY_OF_MONTH,1);
             //获得1月1日零点值
             Date endtime=c.getTime();

+ 100 - 42
realtime/generationXK-service/src/main/java/com/gyee/generation/service/ShutdownnewService.java

@@ -13,6 +13,7 @@ import com.gyee.generation.util.StringUtils;
 import com.gyee.generation.util.realtimesource.IEdosUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -36,7 +37,8 @@ public class ShutdownnewService {
     private IProEconShutdownEvent2Service proEconShutdownEvent2Service;
     @Resource
     private IProEconInterruptionService proEconInterruptionService;
-
+    @Value("${frequency.shutdown}")
+    private Integer frequency;
 
 
     public static Logger logger = LoggerFactory.getLogger(ShutdownnewService.class);
@@ -55,7 +57,7 @@ public class ShutdownnewService {
 
     public void execShutdown(Date recordDate) throws Exception {
 
-        Date begin = DateUtils.addDays(DateUtils.truncDay(recordDate), -5);
+        Date begin = DateUtils.addMinutes(recordDate, -frequency);
 
 
         Date end = recordDate;
@@ -250,9 +252,19 @@ public class ShutdownnewService {
 
                         //获取数据库中的状态值,状态值变化存储,并清空
                         item=oldStatusMap.get(windturbineId);
-                        finishWindturbineStatus(windturbineId, item, currentStatus, currentTime);
-                        oldStatusMap.put(windturbineId,null);
-                        item=null;
+                        if(item==null)
+                        {
+                            item=new ProEconWindturbineStatus();
+                            initalWindturbineStatus(windturbineId, item, currentStatus, currentTime,stpo);
+                            oldStatusMap.put(windturbineId,item);
+                        }else
+                        {
+                            finishWindturbineStatus(windturbineId, item, currentStatus, currentTime);
+                            item =null;
+                            oldStatusMap.put(windturbineId,null);
+                        }
+
+
 
                     }
 
@@ -260,21 +272,51 @@ public class ShutdownnewService {
                     if(oldShutdownEvent.containsKey(windturbineId))
                     {
                         shutdwonEvent=oldShutdownEvent.get(windturbineId);
-                        shutdwonEvent = finishShutdownEvent(windturbineId, shutdwonEvent, currentStatus, currentTime);
+
+                        if(shutdwonEvent==null)
+                        {
+                            shutdwonEvent=new ProEconShutdownEvent();
+                            initalShutdownEvent(windturbineId, item, currentStatus, currentTime, shutdwonEvent);
+                            oldShutdownEvent.put(windturbineId,shutdwonEvent);
+                        }else
+                        {
+                            shutdwonEvent = finishShutdownEvent(windturbineId, shutdwonEvent, currentStatus, currentTime);
+                            oldShutdownEvent.put(windturbineId,null);
+                        }
+
 
                     }
                     if(oldInterrup.containsKey(windturbineId))
                     {
-
                         interrup=oldInterrup.get(windturbineId);
-                        interrup = finishInterruption(windturbineId, interrup, currentStatus, currentTime);
+                        if(interrup==null)
+                        {
+                            interrup=new ProEconInterruption();
+                            initalInterruption(windturbineId, item, currentTime, interrup);
+                            oldInterrup.put(windturbineId,interrup);
+                        }else
+                        {
+                            interrup = finishInterruption(windturbineId, interrup, currentStatus, currentTime);
+                            oldInterrup.put(windturbineId,null);
+                        }
+
+
                     }
 
                     if(oldShutdownEvent2.containsKey(windturbineId))
                     {
                         shutdwonEvent2=oldShutdownEvent2.get(windturbineId);
+                        if(shutdwonEvent2==null)
+                        {
+                            shutdwonEvent2=new ProEconShutdownEvent2();
+                            initalShutdownEvent2(windturbineId, item, currentStatus, currentTime, shutdwonEvent2);
+                            oldShutdownEvent2.put(windturbineId,shutdwonEvent2);
+                        }else
+                        {
+                            shutdwonEvent2 = finishShutdownEvent2(windturbineId, shutdwonEvent2, currentStatus, currentTime);
+                            oldShutdownEvent2.put(windturbineId,null);
+                        }
 
-                        shutdwonEvent2 = finishShutdownEvent2(windturbineId, shutdwonEvent2, currentStatus, currentTime);
                     }
 
                     lastStatus=currentStatus;
@@ -288,14 +330,18 @@ public class ShutdownnewService {
             {
                 //获取数据库查询是否有风机对应时间的记录,如果没有写入数据库
                 item=oldStatusMap.get(windturbineId);
-                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());
+                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());
+
+                    if(ls.isEmpty())
+                    {
+                        proEconWindturbineStatusService.save(item);
+                        oldStatusMap.put(windturbineId,null);
+                    }
+                }
 
-               if(ls.isEmpty())
-               {
-                   proEconWindturbineStatusService.save(item);
-                   oldStatusMap.put(windturbineId,null);
-               }
 
             }
 
@@ -305,15 +351,17 @@ public class ShutdownnewService {
 
                 shutdwonEvent=oldShutdownEvent.get(windturbineId);
 
-                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());
-
-                if(ls.isEmpty())
+                if(shutdwonEvent!=null)
                 {
-                    proEconShutdownEventService.save(shutdwonEvent);
-                    oldShutdownEvent.put(windturbineId,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());
 
+                    if(ls.isEmpty())
+                    {
+                        proEconShutdownEventService.save(shutdwonEvent);
+                        oldShutdownEvent.put(windturbineId,null);
+                    }
+                }
 
             }
             if(oldInterrup.containsKey(windturbineId))
@@ -321,29 +369,37 @@ public class ShutdownnewService {
 
                 interrup=oldInterrup.get(windturbineId);
 
-                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());
-
-                if(ls.isEmpty())
+                if(interrup!=null)
                 {
-                    proEconInterruptionService.save(interrup);
-                    oldInterrup.put(windturbineId,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());
+
+                    if(ls.isEmpty())
+                    {
+                        proEconInterruptionService.save(interrup);
+                        oldInterrup.put(windturbineId,null);
+                    }
                 }
 
+
             }
 
             if(oldShutdownEvent2.containsKey(windturbineId))
             {
                 shutdwonEvent2=oldShutdownEvent2.get(windturbineId);
 
-                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());
-
-                if(ls.isEmpty())
+                if(shutdwonEvent2!=null)
                 {
-                    proEconShutdownEvent2Service.save(shutdwonEvent2);
-                    oldShutdownEvent2.put(windturbineId,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());
+
+                    if(ls.isEmpty())
+                    {
+                        proEconShutdownEvent2Service.save(shutdwonEvent2);
+                        oldShutdownEvent2.put(windturbineId,null);
+                    }
                 }
+
             }
 
         }
@@ -452,31 +508,33 @@ public class ShutdownnewService {
             item.setLossPower(losspower);
 
             proEconWindturbineStatusService.saveOrUpdate(item);
+
         }
     }
 
     private static void initalInterruption(String windturbineId, ProEconWindturbineStatus item, Date stopTime, ProEconInterruption interrup) {
-        interrup.setProjectId(item.getProjectId());
+        interrup.setProjectId(CacheContext.wtmap.get(windturbineId).getProjectId());
         interrup.setStopTime(stopTime);
-        interrup.setWindpowerstationId(item.getWindpowerstationId());
+        interrup.setWindpowerstationId(CacheContext.wtmap.get(windturbineId).getWindpowerstationId());
         interrup.setWindturbineId(windturbineId);
     }
 
     private static void initalShutdownEvent2(String windturbineId, ProEconWindturbineStatus item, Integer currentStatus, Date stopTime, ProEconShutdownEvent2 shutdwonEvent2) {
         shutdwonEvent2.setId(StringUtils.getUUID());
-        shutdwonEvent2.setProjectId(item.getProjectId());
+        shutdwonEvent2.setProjectId(CacheContext.wtmap.get(windturbineId).getProjectId());
         shutdwonEvent2.setStatusCode(currentStatus);
         shutdwonEvent2.setStopTime(stopTime);
-        shutdwonEvent2.setWinpowerstationId(item.getWindpowerstationId());
+        shutdwonEvent2.setWinpowerstationId(CacheContext.wtmap.get(windturbineId).getWindpowerstationId());
         shutdwonEvent2.setWindturbineId(windturbineId);
     }
 
     private static void initalShutdownEvent(String windturbineId, ProEconWindturbineStatus item, Integer currentStatus, Date stopTime, ProEconShutdownEvent shutdwonEvent) {
+
         shutdwonEvent.setId(StringUtils.getUUID());
-        shutdwonEvent.setProjectId(item.getProjectId());
+        shutdwonEvent.setProjectId(CacheContext.wtmap.get(windturbineId).getProjectId());
         shutdwonEvent.setStatusCode(currentStatus);
         shutdwonEvent.setStopTime(stopTime);
-        shutdwonEvent.setWindpowerstationId(item.getWindpowerstationId());
+        shutdwonEvent.setWindpowerstationId(CacheContext.wtmap.get(windturbineId).getWindpowerstationId());
         shutdwonEvent.setWindturbineId(windturbineId);
     }
 
@@ -540,7 +598,7 @@ public class ShutdownnewService {
         }else
         {
             Calendar c=Calendar.getInstance();
-            c.setTime(DateUtils.truncDay(startDate));
+            c.setTime(DateUtils.truncate(startDate));
             c.add(Calendar.DAY_OF_MONTH,1);
             //获得1月1日零点值
             Date endtime=c.getTime();

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

@@ -5,7 +5,6 @@ import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.*;
-import com.gyee.generation.model.vo.ElectricityVo;
 import com.gyee.generation.model.vo.PointVo;
 import com.gyee.generation.service.auto.*;
 import com.gyee.generation.util.DateUtils;
@@ -15,6 +14,7 @@ import com.gyee.generation.util.statisticcs.Initial;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
+
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -1041,7 +1041,7 @@ public class TimelinessRateService {
         Date end = c.getTime();
 
 
-        List<Integer> deleteitems = proEconFaultLiminatedefectsService.list().stream().filter(i ->
+        List<Long> deleteitems = proEconFaultLiminatedefectsService.list().stream().filter(i ->
                 (i.getDateTime().compareTo(begin) == 0 || i.getDateTime().after(begin))
                         && (i.getDateTime().compareTo(end) == 0 || i.getDateTime().before(end))
         ).map(ProEconFaultLiminatedefects::getId).collect(Collectors.toList());

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

@@ -37,7 +37,7 @@ public class WindPowerInfo1Service {
     public void calRegionInfoDay(Date recordDate) throws Exception {
 
         List<ProEconPowerstationInfoDay1> wpinfodayls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.cp.getValue()))
                 .collect(Collectors.toList());
@@ -91,7 +91,7 @@ public class WindPowerInfo1Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -118,19 +118,19 @@ public class WindPowerInfo1Service {
                         ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
                         gf.setRegionId(cp.getId());
 
-                        gf.setRecordDate(DateUtils.truncDay(recordDate));
+                        gf.setRecordDate(DateUtils.truncate(recordDate));
                         gf.setForeignKeyId("-2");
                         gf.setLocation(Location.rg.getValue());
 
                         fd.setRegionId(cp.getId());
 
-                        fd.setRecordDate(DateUtils.truncDay(recordDate));
+                        fd.setRecordDate(DateUtils.truncate(recordDate));
                         fd.setForeignKeyId("-1");
                         fd.setLocation(Location.rg.getValue());
 
                         qb.setRegionId(cp.getId());
 
-                        qb.setRecordDate(DateUtils.truncDay(recordDate));
+                        qb.setRecordDate(DateUtils.truncate(recordDate));
                         qb.setForeignKeyId("0");
                         qb.setLocation(Location.rg.getValue());
 
@@ -168,7 +168,7 @@ public class WindPowerInfo1Service {
     public void calCompanyInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay1> wpinfodayls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
                         && i.getLocation().equals(Location.wp.getValue()))
                 .collect(Collectors.toList());
         if(!wpinfodayls.isEmpty())
@@ -221,7 +221,7 @@ public class WindPowerInfo1Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
                             && i.getLocation().equals(Location.cp.getValue())).map(ProEconPowerstationInfoDay1::getId)
                     .collect(Collectors.toList());
 
@@ -247,7 +247,7 @@ public class WindPowerInfo1Service {
                         ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
                         gf.setRegionId(cp.getRegionId());
                         gf.setCompanyId(cp.getId());
-                        gf.setRecordDate(DateUtils.truncDay(recordDate));
+                        gf.setRecordDate(DateUtils.truncate(recordDate));
                         gf.setForeignKeyId("-2");
                         gf.setLocation(Location.cp.getValue());
 
@@ -255,13 +255,13 @@ public class WindPowerInfo1Service {
 
                         fd.setRegionId(cp.getRegionId());
                         fd.setCompanyId(cp.getId());
-                        fd.setRecordDate(DateUtils.truncDay(recordDate));
+                        fd.setRecordDate(DateUtils.truncate(recordDate));
                         fd.setForeignKeyId("-1");
                         fd.setLocation(Location.cp.getValue());
 
                         qb.setRegionId(cp.getRegionId());
                         qb.setCompanyId(cp.getId());
-                        qb.setRecordDate(DateUtils.truncDay(recordDate));
+                        qb.setRecordDate(DateUtils.truncate(recordDate));
                         qb.setForeignKeyId("0");
                         qb.setLocation(Location.cp.getValue());
 
@@ -560,7 +560,7 @@ public class WindPowerInfo1Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
 
 
@@ -568,7 +568,7 @@ public class WindPowerInfo1Service {
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -588,7 +588,7 @@ public class WindPowerInfo1Service {
                Initial.initial(pewp);
                 pewp.setRegionId(wp.getRegionId());
                 pewp.setCompanyId(wp.getCompanyId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
                 pewp.setForeignKeyId("0");
                 pewp.setWindpowerstationId(wp.getId());
                 pewp.setLocation(Location.wp.getValue());
@@ -603,7 +603,7 @@ public class WindPowerInfo1Service {
 
                 {
                     pepid1ls = proEconPowerstationInfoDay1Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getWindpowerstationId().equals(wp.getId())
                                 && i.getLocation().equals(Location.wp.getValue()))
                         .collect(Collectors.toList());
@@ -629,11 +629,11 @@ public class WindPowerInfo1Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -655,7 +655,7 @@ public class WindPowerInfo1Service {
                 pewp.setWindpowerstationId(pj.getWindpowerstationId());
                 pewp.setProjectId(pj.getId());
                 pewp.setLocation(Location.pj.getValue());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconPowerstationInfoDay1> pepid1ls =new ArrayList<>();
@@ -667,7 +667,7 @@ public class WindPowerInfo1Service {
 
                 {
                     pepid1ls = proEconPowerstationInfoDay1Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getProjectId().equals(pj.getId())
                                     && i.getLocation().equals(Location.pj.getValue()))
                             .collect(Collectors.toList());
@@ -692,11 +692,11 @@ public class WindPowerInfo1Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay1Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -718,7 +718,7 @@ public class WindPowerInfo1Service {
                 pewp.setLineId(ln.getId());
                 pewp.setLocation(Location.ln.getValue());
                 pewp.setProjectId(ln.getProjectId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconPowerstationInfoDay1> pepid1ls =new ArrayList<>();
@@ -730,7 +730,7 @@ public class WindPowerInfo1Service {
 
                 {
                     pepid1ls = proEconPowerstationInfoDay1Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getLineId().equals(ln.getId())
                                     && i.getLocation().equals(Location.ln.getValue()))
                             .collect(Collectors.toList());

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

@@ -37,7 +37,7 @@ public class WindPowerInfo2Service {
     public void calRegionInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay2> wpinfodayls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.cp.getValue()))
                 .collect(Collectors.toList());
@@ -91,7 +91,7 @@ public class WindPowerInfo2Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -118,19 +118,19 @@ public class WindPowerInfo2Service {
                         ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
                         gf.setRegionId(cp.getId());
 
-                        gf.setRecordDate(DateUtils.truncDay(recordDate));
+                        gf.setRecordDate(DateUtils.truncate(recordDate));
                         gf.setForeignKeyId("-2");
                         gf.setLocation(Location.rg.getValue());
 
                         fd.setRegionId(cp.getId());
 
-                        fd.setRecordDate(DateUtils.truncDay(recordDate));
+                        fd.setRecordDate(DateUtils.truncate(recordDate));
                         fd.setForeignKeyId("-1");
                         fd.setLocation(Location.rg.getValue());
 
                         qb.setRegionId(cp.getId());
 
-                        qb.setRecordDate(DateUtils.truncDay(recordDate));
+                        qb.setRecordDate(DateUtils.truncate(recordDate));
                         qb.setForeignKeyId("0");
                         qb.setLocation(Location.rg.getValue());
 
@@ -168,7 +168,7 @@ public class WindPowerInfo2Service {
     public void calCompanyInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay2> wpinfodayls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.wp.getValue()))
                 .collect(Collectors.toList());
@@ -220,7 +220,7 @@ public class WindPowerInfo2Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -247,7 +247,7 @@ public class WindPowerInfo2Service {
                         ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
                         gf.setRegionId(cp.getRegionId());
                         gf.setCompanyId(cp.getId());
-                        gf.setRecordDate(DateUtils.truncDay(recordDate));
+                        gf.setRecordDate(DateUtils.truncate(recordDate));
                         gf.setForeignKeyId("-2");
                         gf.setLocation(Location.cp.getValue());
 
@@ -255,13 +255,13 @@ public class WindPowerInfo2Service {
 
                         fd.setRegionId(cp.getRegionId());
                         fd.setCompanyId(cp.getId());
-                        fd.setRecordDate(DateUtils.truncDay(recordDate));
+                        fd.setRecordDate(DateUtils.truncate(recordDate));
                         fd.setForeignKeyId("-1");
                         fd.setLocation(Location.cp.getValue());
 
                         qb.setRegionId(cp.getRegionId());
                         qb.setCompanyId(cp.getId());
-                        qb.setRecordDate(DateUtils.truncDay(recordDate));
+                        qb.setRecordDate(DateUtils.truncate(recordDate));
                         qb.setForeignKeyId("0");
                         qb.setLocation(Location.cp.getValue());
 
@@ -400,12 +400,12 @@ public class WindPowerInfo2Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -425,7 +425,7 @@ public class WindPowerInfo2Service {
                Initial.initial(pewp);
                 pewp.setRegionId(wp.getRegionId());
                 pewp.setCompanyId(wp.getCompanyId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
                 pewp.setForeignKeyId("0");
                 pewp.setWindpowerstationId(wp.getId());
                 pewp.setLocation(Location.wp.getValue());
@@ -440,7 +440,7 @@ public class WindPowerInfo2Service {
 
                 {
                     pepidls = proEconPowerstationInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getWindpowerstationId().equals(wp.getId())
                                 && i.getLocation().equals(Location.wp.getValue()))
                         .collect(Collectors.toList());
@@ -468,11 +468,11 @@ public class WindPowerInfo2Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -494,7 +494,7 @@ public class WindPowerInfo2Service {
                 pewp.setWindpowerstationId(pj.getWindpowerstationId());
                 pewp.setProjectId(pj.getId());
                 pewp.setLocation(Location.pj.getValue());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconPowerstationInfoDay2> pepidls =new ArrayList<>();
@@ -506,7 +506,7 @@ public class WindPowerInfo2Service {
 
                 {
                     pepidls = proEconPowerstationInfoDay2Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getProjectId().equals(pj.getId())
                                     && i.getLocation().equals(Location.pj.getValue()))
                             .collect(Collectors.toList());
@@ -531,11 +531,11 @@ public class WindPowerInfo2Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay2Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -557,7 +557,7 @@ public class WindPowerInfo2Service {
                 pewp.setLineId(ln.getId());
                 pewp.setLocation(Location.ln.getValue());
                 pewp.setProjectId(ln.getProjectId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconPowerstationInfoDay2> pepidls =new ArrayList<>();
@@ -569,7 +569,7 @@ public class WindPowerInfo2Service {
 
                 {
                     pepidls = proEconPowerstationInfoDay2Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getLineId().equals(ln.getId())
                                     && i.getLocation().equals(Location.ln.getValue()))
                             .collect(Collectors.toList());

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

@@ -35,7 +35,7 @@ public class WindPowerInfo3Service {
     public void calRegionInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay3> wpinfodayls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.cp.getValue()))
                 .collect(Collectors.toList());
@@ -89,7 +89,7 @@ public class WindPowerInfo3Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -116,19 +116,19 @@ public class WindPowerInfo3Service {
                     ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
                     gf.setRegionId(cp.getId());
 
-                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setRecordDate(DateUtils.truncate(recordDate));
                     gf.setForeignKeyId("-2");
                     gf.setLocation(Location.rg.getValue());
 
                     fd.setRegionId(cp.getId());
 
-                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setRecordDate(DateUtils.truncate(recordDate));
                     fd.setForeignKeyId("-1");
                     fd.setLocation(Location.rg.getValue());
 
                     qb.setRegionId(cp.getId());
 
-                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setRecordDate(DateUtils.truncate(recordDate));
                     qb.setForeignKeyId("0");
                     qb.setLocation(Location.rg.getValue());
 
@@ -166,7 +166,7 @@ public class WindPowerInfo3Service {
     public void calCompanyInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay3> wpinfodayls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.wp.getValue()))
                 .collect(Collectors.toList());
@@ -220,7 +220,7 @@ public class WindPowerInfo3Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -247,7 +247,7 @@ public class WindPowerInfo3Service {
                     ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
                     gf.setRegionId(cp.getRegionId());
                     gf.setCompanyId(cp.getId());
-                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setRecordDate(DateUtils.truncate(recordDate));
                     gf.setForeignKeyId("-2");
                     gf.setLocation(Location.cp.getValue());
 
@@ -255,13 +255,13 @@ public class WindPowerInfo3Service {
 
                     fd.setRegionId(cp.getRegionId());
                     fd.setCompanyId(cp.getId());
-                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setRecordDate(DateUtils.truncate(recordDate));
                     fd.setForeignKeyId("-1");
                     fd.setLocation(Location.cp.getValue());
 
                     qb.setRegionId(cp.getRegionId());
                     qb.setCompanyId(cp.getId());
-                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setRecordDate(DateUtils.truncate(recordDate));
                     qb.setForeignKeyId("0");
                     qb.setLocation(Location.cp.getValue());
 
@@ -400,7 +400,7 @@ public class WindPowerInfo3Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
 
 //        List<ProEconPowerstationInfoDay3> wpinfodayls=new ArrayList<>();
@@ -408,7 +408,7 @@ public class WindPowerInfo3Service {
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -428,7 +428,7 @@ public class WindPowerInfo3Service {
                 Initial.initial(pewp);
                 pewp.setRegionId(wp.getRegionId());
                 pewp.setCompanyId(wp.getCompanyId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
                 pewp.setForeignKeyId("0");
                 pewp.setWindpowerstationId(wp.getId());
                 pewp.setLocation(Location.wp.getValue());
@@ -443,7 +443,7 @@ public class WindPowerInfo3Service {
 
                 {
                     pepidls = proEconPowerstationInfoDay3Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getWindpowerstationId().equals(wp.getId())
                                     && i.getLocation().equals(Location.wp.getValue()))
                             .collect(Collectors.toList());
@@ -470,11 +470,11 @@ public class WindPowerInfo3Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -496,7 +496,7 @@ public class WindPowerInfo3Service {
                 pewp.setWindpowerstationId(pj.getWindpowerstationId());
                 pewp.setProjectId(pj.getId());
                 pewp.setLocation(Location.pj.getValue());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconPowerstationInfoDay3> pepidls =new ArrayList<>();
@@ -508,7 +508,7 @@ public class WindPowerInfo3Service {
 
                 {
                     pepidls = proEconPowerstationInfoDay3Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getProjectId().equals(pj.getId())
                                     && i.getLocation().equals(Location.pj.getValue()))
                             .collect(Collectors.toList());
@@ -533,11 +533,11 @@ public class WindPowerInfo3Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay3Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -559,7 +559,7 @@ public class WindPowerInfo3Service {
                 pewp.setLineId(ln.getId());
                 pewp.setLocation(Location.ln.getValue());
                 pewp.setProjectId(ln.getProjectId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconPowerstationInfoDay3> pepidls =new ArrayList<>();
@@ -571,7 +571,7 @@ public class WindPowerInfo3Service {
 
                 {
                     pepidls = proEconPowerstationInfoDay3Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getLineId().equals(ln.getId())
                                     && i.getLocation().equals(Location.ln.getValue()))
                             .collect(Collectors.toList());

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

@@ -42,7 +42,7 @@ public class WindPowerInfo4Service {
     public void calRegionInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay4> wpinfodayls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.cp.getValue()))
                 .collect(Collectors.toList());
@@ -88,7 +88,7 @@ public class WindPowerInfo4Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                    .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());
@@ -114,19 +114,19 @@ public class WindPowerInfo4Service {
                     ProBasicRegion cp = CacheContext.rgmap.get(entry.getKey());
                     gf.setRegionId(cp.getId());
 
-                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setRecordDate(DateUtils.truncate(recordDate));
                     gf.setForeignKeyId("-2");
                     gf.setLocation(Location.rg.getValue());
 
                     fd.setRegionId(cp.getId());
 
-                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setRecordDate(DateUtils.truncate(recordDate));
                     fd.setForeignKeyId("-1");
                     fd.setLocation(Location.rg.getValue());
 
                     qb.setRegionId(cp.getId());
 
-                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setRecordDate(DateUtils.truncate(recordDate));
                     qb.setForeignKeyId("0");
                     qb.setLocation(Location.rg.getValue());
 
@@ -163,7 +163,7 @@ public class WindPowerInfo4Service {
     public void calCompanyInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay4> wpinfodayls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.wp.getValue()))
                 .collect(Collectors.toList());
@@ -209,7 +209,7 @@ public class WindPowerInfo4Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                    .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());
@@ -235,20 +235,20 @@ public class WindPowerInfo4Service {
                     ProBasicCompany cp = CacheContext.cpmap.get(entry.getKey());
                     gf.setRegionId(cp.getRegionId());
                     gf.setCompanyId(cp.getId());
-                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setRecordDate(DateUtils.truncate(recordDate));
                     gf.setForeignKeyId("-2");
                     gf.setLocation(Location.cp.getValue());
 
 
                     fd.setRegionId(cp.getRegionId());
                     fd.setCompanyId(cp.getId());
-                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setRecordDate(DateUtils.truncate(recordDate));
                     fd.setForeignKeyId("-1");
                     fd.setLocation(Location.cp.getValue());
 
                     qb.setRegionId(cp.getRegionId());
                     qb.setCompanyId(cp.getId());
-                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setRecordDate(DateUtils.truncate(recordDate));
                     qb.setForeignKeyId("0");
                     qb.setLocation(Location.cp.getValue());
 
@@ -399,7 +399,7 @@ public class WindPowerInfo4Service {
 
         Date end = c.getTime();
 
-        Date begin = DateUtils.truncDay(c.getTime());
+        Date begin = DateUtils.truncate(c.getTime());
 
 
 //        List<ProEconPowerstationInfoDay4> wpinfodayls = new ArrayList<>();
@@ -407,7 +407,7 @@ public class WindPowerInfo4Service {
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .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());
@@ -425,7 +425,7 @@ public class WindPowerInfo4Service {
                 Initial.initial(pewp);
                 pewp.setRegionId(wp.getRegionId());
                 pewp.setCompanyId(wp.getCompanyId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
                 pewp.setForeignKeyId("0");
                 pewp.setWindpowerstationId(wp.getId());
                 pewp.setLocation(Location.wp.getValue());
@@ -439,7 +439,7 @@ public class WindPowerInfo4Service {
                 ProEconPowerstationInfoDay2 pepid2 = null;
                 List<ProEconPowerstationInfoDay2> pepid2ls;
                 pepid2ls = proEconPowerstationInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getWindpowerstationId().equals(wp.getId())
                                 && i.getLocation().equals(Location.wp.getValue())
                         ).collect(Collectors.toList());
@@ -451,7 +451,7 @@ public class WindPowerInfo4Service {
                 ProEconPowerstationInfoDay3 pepid3 = null;
                 List<ProEconPowerstationInfoDay3> pepid3ls;
                 pepid3ls = proEconPowerstationInfoDay3Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getWindpowerstationId().equals(wp.getId())
                                 && i.getLocation().equals(Location.wp.getValue())
                         ).collect(Collectors.toList());
@@ -463,7 +463,7 @@ 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.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getWindpowerstationId().equals(wp.getId())
                                     && i.getLocation().equals(Location.wp.getValue()))
                             .collect(Collectors.toList());
@@ -493,11 +493,11 @@ public class WindPowerInfo4Service {
 
         Date end = c.getTime();
 
-        Date begin = DateUtils.truncDay(c.getTime());
+        Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .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());
@@ -517,7 +517,7 @@ public class WindPowerInfo4Service {
                 pewp.setWindpowerstationId(pj.getWindpowerstationId());
                 pewp.setProjectId(pj.getId());
                 pewp.setLocation(Location.pj.getValue());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
 
                 List<ProEconPowerstationInfoDay4> pepidls = new ArrayList<>();
@@ -528,7 +528,7 @@ public class WindPowerInfo4Service {
                 ProEconPowerstationInfoDay2 pepid2 = null;
                 List<ProEconPowerstationInfoDay2> pepid2ls;
                 pepid2ls = proEconPowerstationInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getProjectId().equals(pj.getId())
                                 && i.getLocation().equals(Location.pj.getValue())
                         ).collect(Collectors.toList());
@@ -540,7 +540,7 @@ public class WindPowerInfo4Service {
                 ProEconPowerstationInfoDay3 pepid3 = null;
                 List<ProEconPowerstationInfoDay3> pepid3ls;
                 pepid3ls = proEconPowerstationInfoDay3Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getProjectId().equals(pj.getId())
                                 && i.getLocation().equals(Location.pj.getValue())
                         ).collect(Collectors.toList());
@@ -554,7 +554,7 @@ 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.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getProjectId().equals(pj.getId())
                                     && i.getLocation().equals(Location.pj.getValue()))
                             .collect(Collectors.toList());
@@ -583,11 +583,11 @@ public class WindPowerInfo4Service {
 
         Date end = c.getTime();
 
-        Date begin = DateUtils.truncDay(c.getTime());
+        Date begin = DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay4Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate)) == 0
+                .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());
@@ -607,7 +607,7 @@ public class WindPowerInfo4Service {
                 pewp.setLineId(ln.getId());
                 pewp.setLocation(Location.ln.getValue());
                 pewp.setProjectId(ln.getProjectId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
 
                 List<ProEconPowerstationInfoDay4> pepidls = new ArrayList<>();
@@ -618,7 +618,7 @@ public class WindPowerInfo4Service {
                 ProEconPowerstationInfoDay2 pepid2 = null;
                 List<ProEconPowerstationInfoDay2> pepid2ls;
                 pepid2ls = proEconPowerstationInfoDay2Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getLineId().equals(ln.getId())
                                 && i.getLocation().equals(Location.ln.getValue())
                         ).collect(Collectors.toList());
@@ -630,7 +630,7 @@ public class WindPowerInfo4Service {
                 ProEconPowerstationInfoDay3 pepid3 = null;
                 List<ProEconPowerstationInfoDay3> pepid3ls;
                 pepid3ls = proEconPowerstationInfoDay3Service.list().stream()
-                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                        .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                 && i.getLineId().equals(ln.getId())
                                 && i.getLocation().equals(Location.ln.getValue())
                         ).collect(Collectors.toList());
@@ -642,7 +642,7 @@ 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.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getLineId().equals(ln.getId())
                                     && i.getLocation().equals(Location.ln.getValue()))
                             .collect(Collectors.toList());

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

@@ -35,7 +35,7 @@ public class WindPowerInfo5Service {
     public void calRegionInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.cp.getValue()))
                 .collect(Collectors.toList());
@@ -89,7 +89,7 @@ public class WindPowerInfo5Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -116,19 +116,19 @@ public class WindPowerInfo5Service {
                     ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
                     gf.setRegionId(cp.getId());
 
-                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setRecordDate(DateUtils.truncate(recordDate));
                     gf.setForeignKeyId("-2");
                     gf.setLocation(Location.rg.getValue());
 
                     fd.setRegionId(cp.getId());
 
-                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setRecordDate(DateUtils.truncate(recordDate));
                     fd.setForeignKeyId("-1");
                     fd.setLocation(Location.rg.getValue());
 
                     qb.setRegionId(cp.getId());
 
-                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setRecordDate(DateUtils.truncate(recordDate));
                     qb.setForeignKeyId("0");
                     qb.setLocation(Location.rg.getValue());
 
@@ -166,7 +166,7 @@ public class WindPowerInfo5Service {
     public void calCompanyInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay5> wpinfodayls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.wp.getValue()))
                 .collect(Collectors.toList());
@@ -220,7 +220,7 @@ public class WindPowerInfo5Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -247,7 +247,7 @@ public class WindPowerInfo5Service {
                     ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
                     gf.setRegionId(cp.getRegionId());
                     gf.setCompanyId(cp.getId());
-                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setRecordDate(DateUtils.truncate(recordDate));
                     gf.setForeignKeyId("-2");
                     gf.setLocation(Location.cp.getValue());
 
@@ -255,13 +255,13 @@ public class WindPowerInfo5Service {
 
                     fd.setRegionId(cp.getRegionId());
                     fd.setCompanyId(cp.getId());
-                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setRecordDate(DateUtils.truncate(recordDate));
                     fd.setForeignKeyId("-1");
                     fd.setLocation(Location.cp.getValue());
 
                     qb.setRegionId(cp.getRegionId());
                     qb.setCompanyId(cp.getId());
-                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setRecordDate(DateUtils.truncate(recordDate));
                     qb.setForeignKeyId("0");
                     qb.setLocation(Location.cp.getValue());
 
@@ -354,7 +354,7 @@ public class WindPowerInfo5Service {
 
 //        Date end=c.getTime();
 //
-//        Date begin= DateUtils.truncDay(c.getTime());
+//        Date begin= DateUtils.truncate(c.getTime());
 
 
 //        List<ProEconPowerstationInfoDay5> wpinfodayls=new ArrayList<>();
@@ -362,7 +362,7 @@ public class WindPowerInfo5Service {
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -382,7 +382,7 @@ public class WindPowerInfo5Service {
                 Initial.initial(pewp);
                 pewp.setRegionId(wp.getRegionId());
                 pewp.setCompanyId(wp.getCompanyId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
                 pewp.setForeignKeyId("0");
                 pewp.setWindpowerstationId(wp.getId());
                 pewp.setLocation(Location.wp.getValue());
@@ -395,7 +395,7 @@ public class WindPowerInfo5Service {
 //
 //                {
 //                    pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
-//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
 //                                    && i.getWindpowerstationId().equals(wp.getId())
 //                                    && i.getLocation().equals(Location.wp.getValue()))
 //                            .collect(Collectors.toList());
@@ -421,11 +421,11 @@ public class WindPowerInfo5Service {
 
 //        Date end=c.getTime();
 //
-//        Date begin= DateUtils.truncDay(c.getTime());
+//        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -447,7 +447,7 @@ public class WindPowerInfo5Service {
                 pewp.setWindpowerstationId(pj.getWindpowerstationId());
                 pewp.setProjectId(pj.getId());
                 pewp.setLocation(Location.pj.getValue());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
 //                List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
@@ -457,7 +457,7 @@ public class WindPowerInfo5Service {
 //
 //                {
 //                    pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
-//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
 //                                    && i.getProjectId().equals(pj.getId())
 //                                    && i.getLocation().equals(Location.pj.getValue()))
 //                            .collect(Collectors.toList());
@@ -482,11 +482,11 @@ public class WindPowerInfo5Service {
 
 //        Date end=c.getTime();
 //
-//        Date begin= DateUtils.truncDay(c.getTime());
+//        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay5Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -508,7 +508,7 @@ public class WindPowerInfo5Service {
                 pewp.setLineId(ln.getId());
                 pewp.setLocation(Location.ln.getValue());
                 pewp.setProjectId(ln.getProjectId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
 //                List<ProEconPowerstationInfoDay5> pepid1ls =new ArrayList<>();
@@ -518,7 +518,7 @@ public class WindPowerInfo5Service {
 //
 //                {
 //                    pepid1ls = proEconPowerstationInfoDay5Service.list().stream()
-//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+//                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
 //                                    && i.getLineId().equals(ln.getId())
 //                                    && i.getLocation().equals(Location.ln.getValue()))
 //                            .collect(Collectors.toList());

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

@@ -39,7 +39,7 @@ public class WindPowerInfo6Service {
     public void calRegionInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.cp.getValue()))
                 .collect(Collectors.toList());
@@ -93,7 +93,7 @@ public class WindPowerInfo6Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -120,19 +120,19 @@ public class WindPowerInfo6Service {
                     ProBasicRegion cp=CacheContext.rgmap.get(entry.getKey());
                     gf.setRegionId(cp.getId());
 
-                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setRecordDate(DateUtils.truncate(recordDate));
                     gf.setForeignKeyId("-2");
                     gf.setLocation(Location.rg.getValue());
 
                     fd.setRegionId(cp.getId());
 
-                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setRecordDate(DateUtils.truncate(recordDate));
                     fd.setForeignKeyId("-1");
                     fd.setLocation(Location.rg.getValue());
 
                     qb.setRegionId(cp.getId());
 
-                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setRecordDate(DateUtils.truncate(recordDate));
                     qb.setForeignKeyId("0");
                     qb.setLocation(Location.rg.getValue());
 
@@ -170,7 +170,7 @@ public class WindPowerInfo6Service {
     public void calCompanyInfoDay(Date recordDate) {
 
         List<ProEconPowerstationInfoDay6> wpinfodayls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
 //                        && CacheContext.wpmap.containsKey(i.getWindpowerstationId())
                         && i.getLocation().equals(Location.wp.getValue()))
                 .collect(Collectors.toList());
@@ -224,7 +224,7 @@ public class WindPowerInfo6Service {
 
             //判断是否有重复记录,先删除重复记录
             List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                    .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                    .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());
@@ -251,7 +251,7 @@ public class WindPowerInfo6Service {
                     ProBasicCompany cp=CacheContext.cpmap.get(entry.getKey());
                     gf.setRegionId(cp.getRegionId());
                     gf.setCompanyId(cp.getId());
-                    gf.setRecordDate(DateUtils.truncDay(recordDate));
+                    gf.setRecordDate(DateUtils.truncate(recordDate));
                     gf.setForeignKeyId("-2");
                     gf.setLocation(Location.cp.getValue());
 
@@ -259,13 +259,13 @@ public class WindPowerInfo6Service {
 
                     fd.setRegionId(cp.getRegionId());
                     fd.setCompanyId(cp.getId());
-                    fd.setRecordDate(DateUtils.truncDay(recordDate));
+                    fd.setRecordDate(DateUtils.truncate(recordDate));
                     fd.setForeignKeyId("-1");
                     fd.setLocation(Location.cp.getValue());
 
                     qb.setRegionId(cp.getRegionId());
                     qb.setCompanyId(cp.getId());
-                    qb.setRecordDate(DateUtils.truncDay(recordDate));
+                    qb.setRecordDate(DateUtils.truncate(recordDate));
                     qb.setForeignKeyId("0");
                     qb.setLocation(Location.cp.getValue());
 
@@ -389,7 +389,7 @@ public class WindPowerInfo6Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
 
 //        List<ProEconPowerstationInfoDay6> wpinfodayls=new ArrayList<>();
@@ -397,7 +397,7 @@ public class WindPowerInfo6Service {
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -417,7 +417,7 @@ public class WindPowerInfo6Service {
                 Initial.initial(pewp);
                 pewp.setRegionId(wp.getRegionId());
                 pewp.setCompanyId(wp.getCompanyId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
                 pewp.setForeignKeyId("0");
                 pewp.setWindpowerstationId(wp.getId());
                 pewp.setLocation(Location.wp.getValue());
@@ -430,7 +430,7 @@ public class WindPowerInfo6Service {
 
                 {
                     pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getWindpowerstationId().equals(wp.getId())
                                     && i.getLocation().equals(Location.wp.getValue()))
                             .collect(Collectors.toList());
@@ -456,11 +456,11 @@ public class WindPowerInfo6Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -482,7 +482,7 @@ public class WindPowerInfo6Service {
                 pewp.setWindpowerstationId(pj.getWindpowerstationId());
                 pewp.setProjectId(pj.getId());
                 pewp.setLocation(Location.pj.getValue());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconPowerstationInfoDay6> pepid1ls =new ArrayList<>();
@@ -492,7 +492,7 @@ public class WindPowerInfo6Service {
 
                 {
                     pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getProjectId().equals(pj.getId())
                                     && i.getLocation().equals(Location.pj.getValue()))
                             .collect(Collectors.toList());
@@ -517,11 +517,11 @@ public class WindPowerInfo6Service {
 
         Date end=c.getTime();
 
-        Date begin= DateUtils.truncDay(c.getTime());
+        Date begin= DateUtils.truncate(c.getTime());
 
         //判断是否有重复记录,先删除重复记录
         List<String> idls = proEconPowerstationInfoDay6Service.list().stream()
-                .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(recordDate))==0
+                .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());
@@ -543,7 +543,7 @@ public class WindPowerInfo6Service {
                 pewp.setLineId(ln.getId());
                 pewp.setLocation(Location.ln.getValue());
                 pewp.setProjectId(ln.getProjectId());
-                pewp.setRecordDate(DateUtils.truncDay(recordDate));
+                pewp.setRecordDate(DateUtils.truncate(recordDate));
 
                 //昨日的统计结果
                 List<ProEconPowerstationInfoDay6> pepid1ls =new ArrayList<>();
@@ -553,7 +553,7 @@ public class WindPowerInfo6Service {
 
                 {
                     pepid1ls = proEconPowerstationInfoDay6Service.list().stream()
-                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncDay(cl.getTime())) == 0
+                            .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(cl.getTime())) == 0
                                     && i.getLineId().equals(ln.getId())
                                     && i.getLocation().equals(Location.ln.getValue()))
                             .collect(Collectors.toList());

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

@@ -1,264 +1,264 @@
-//package com.gyee.generation.task;
-//
-//
-//import com.gyee.common.util.DateUtils;
-//import com.gyee.generation.init.CacheContext;
-//import com.gyee.generation.service.*;
-//import com.xxl.job.core.context.XxlJobHelper;
-//import com.xxl.job.core.handler.annotation.XxlJob;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.stereotype.Component;
-//
-//import javax.annotation.Resource;
-//import java.util.Date;
-//
-///**
-// * @ClassName : SaticScheduleTask
-// * @Description : 调度
-// */
-//
-//
-//@Component
-//public class SaticSchedulePgTask {
-//
-//    private static Logger logger = LoggerFactory.getLogger(SaticSchedulePgTask.class);
-//
-//    @Resource
-//    private InputOrOutPutService inputOrOutPutService;
-//    @Resource
-//    private LimitEventService limitEventService;
-//    @Resource
-//    private PowerCurveFittingService powerCurveFittingService;
-//    @Resource
-//    private ShutdownService shutdownService;
-//    @Resource
-//    private WindPowerInfo1Service windPowerInfo1Service;
-//    @Resource
-//    private WindPowerInfo2Service windPowerInfo2Service;
-//    @Resource
-//    private WindPowerInfo3Service windPowerInfo3Service;
-//    @Resource
-//    private WindPowerInfo4Service windPowerInfo4Service;
-//    @Resource
-//    private WindPowerInfo5Service windPowerInfo5Service;
-//    @Resource
-//    private WindPowerInfo6Service windPowerInfo6Service;
-//    @Resource
-//    private EquipmentInfo1Service equipmentInfo1Service;
-//    @Resource
-//    private EquipmentInfo2Service equipmentInfo2Service;
-//    @Resource
-//    private EquipmentInfo3Service equipmentInfo3Service;
-//    @Resource
-//    private EquipmentInfo4Service equipmentInfo4Service;
-//    @Resource
-//    private EquipmentInfo5Service equipmentInfo5Service;
-//    @Resource
-//    private EquipmentInfoDayTopService equipmentInfoDayTopService;
-//    //3.添加定时任务
-//    /**
-//     * 切入切出统计
-//     * 每天执行一次
-//     */
-//
-//    @XxlJob("inputOrOutPut_PG")
-//    public void inputOrOutPut_PG()  {
-//
-//
-//        XxlJobHelper.log("切入切出统计调度程序执行开始!........");
-//        try {
-//            inputOrOutPutService.inputOrOutput(new Date());
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        XxlJobHelper.log("切入切出统计调度任务处理完成!........");
-//    }
-//
-//    /**
-//     * 停机记录
-//     * 每15分钟执行一次
-//     */
-//    @XxlJob("shutdown_PG")
-//    public void shutdown_PG()  {
-//
-//        XxlJobHelper.log("停机记录调度程序执行开始!........");
-//
-//        try {
-//            shutdownService.execShutdown();
-//            limitEventService.execBrownouts2();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        XxlJobHelper.log("停机记录调度任务处理完成!........");
-//    }
-//
-//    /**
-//     * 限电停机记录
-//     * 每15分钟执行一次
-//     */
-//    @XxlJob("brownouts_PG")
-//    public void brownouts_PG()  {
-//
-//        XxlJobHelper.log("限电停机记录调度程序执行开始!........");
-//
-//        try {
-//            limitEventService.execBrownouts();
-//            limitEventService.execBrownouts2();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        XxlJobHelper.log("限电停机记录调度任务处理完成!........");
-//    }
-//
-//    /**
-//     * 日、月、年功率曲线拟合
-//     * 每天执行一次
-//     */
-//    @XxlJob("powerCurveFitting_PG")
-//    public void powerCurveFitting_PG()  {
-//
-//        XxlJobHelper.log("日、月、年功率曲线拟合调度程序执行开始!........");
-//
-//        Date date=new Date();
-//        try {
-//            powerCurveFittingService.cureFitting(date,DateUtils.truncate(date),0, CacheContext.wtls);
-//
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//
-//        XxlJobHelper.log("日、月、年功率曲线拟合调度任务处理完成!........");
-//    }
-//
-//    /**
-//     * 设备指标统计
-//     *  15分钟只执行一次
-//     *
-//     */
-//    @XxlJob("equipment_PowerInfo_PG")
-//    public void equipment_PowerInfo_PG() throws Exception {
-//
-//        XxlJobHelper.log("项目指标调度程序执行开始!........");
-//        Date date=new Date();
-//
-//        equipmentInfo1Service.calEquipmentInfoDay(date);
-//        equipmentInfo2Service.calEquipmentInfoDay(date);
-//        equipmentInfo3Service.calEquipmentInfoDay(date);
-//        equipmentInfo4Service.calEquipmentInfoDay(date);
-//        equipmentInfo5Service.calEquipmentInfoDay(date);
-//
-//
-//        XxlJobHelper.log("项目指标调度程序执行完成!........");
-//
-//    }
-//    /**
-//     * 线路指标统计
-//     *  15分钟只执行一次
-//     *
-//     */
-//    @XxlJob("Line_PowerInfo_PG")
-//    public void Line_PowerInfo_PG() throws Exception {
-//
-//            XxlJobHelper.log("线路指标调度程序执行开始!........");
-//
-//            Date date=new Date();
-//
-//            windPowerInfo1Service.calLineInfoDay(date);
-//            windPowerInfo2Service.calLineInfoDay(date);
-//            windPowerInfo3Service.calLineInfoDay(date);
-//            windPowerInfo4Service.calLineInfoDay(date);
-//            windPowerInfo5Service.calLineInfoDay(date);
-//            windPowerInfo6Service.calLineInfoDay(date);
-//
-//          XxlJobHelper.log("线路指标调度程序执行完成!........");
-//
-//    }
-//
-//    /**
-//     * 线路指标统计
-//     *  15分钟只执行一次
-//     *
-//     */
-//    @XxlJob("project_PowerInfo_PG")
-//    public void project_PowerInfo_PG() throws Exception {
-//
-//        XxlJobHelper.log("项目指标调度程序执行开始!........");
-//        Date date=new Date();
-//
-//        windPowerInfo1Service.calProjectInfoDay(date);
-//        windPowerInfo2Service.calProjectInfoDay(date);
-//        windPowerInfo3Service.calProjectInfoDay(date);
-//        windPowerInfo4Service.calProjectInfoDay(date);
-//        windPowerInfo5Service.calProjectInfoDay(date);
-//        windPowerInfo6Service.calProjectInfoDay(date);
-//
-//        XxlJobHelper.log("项目指标调度程序执行完成!........");
-//
-//    }
-//
-//
-//    /**
-//     * 区域、公司、场站指标统计
-//     *  15分钟只执行一次
-//     *
-//     */
-//    @XxlJob("station_PowerInfo_PG")
-//    public void station_PowerInfo_PG() throws Exception {
-//
-//        XxlJobHelper.log("场站指标统计调度程序执行开始!........");
-//        Date date=new Date();
-//
-//        windPowerInfo1Service.calWindpowerInfoDay(date);
-//        windPowerInfo2Service.calWindpowerInfoDay(date);
-//        windPowerInfo3Service.calWindpowerInfoDay(date);
-//        windPowerInfo4Service.calWindpowerInfoDay(date);
-//        windPowerInfo5Service.calWindpowerInfoDay(date);
-//        windPowerInfo6Service.calWindpowerInfoDay(date);
-//
-//        XxlJobHelper.log("场站指标统计调度程序执行完成!........");
-//        XxlJobHelper.log("公司指标统计调度程序执行开始!........");
-//
-//
-//        windPowerInfo1Service.calWindpowerInfoDay(date);
-//        windPowerInfo2Service.calWindpowerInfoDay(date);
-//        windPowerInfo3Service.calWindpowerInfoDay(date);
-//        windPowerInfo4Service.calWindpowerInfoDay(date);
-//        windPowerInfo5Service.calWindpowerInfoDay(date);
-//        windPowerInfo6Service.calWindpowerInfoDay(date);
-//
-//        XxlJobHelper.log("公司指标统计调度程序执行完成!........");
-//        XxlJobHelper.log("区域指标统计调度程序执行开始!........");
-//
-//
-//        windPowerInfo1Service.calWindpowerInfoDay(date);
-//        windPowerInfo2Service.calWindpowerInfoDay(date);
-//        windPowerInfo3Service.calWindpowerInfoDay(date);
-//        windPowerInfo4Service.calWindpowerInfoDay(date);
-//        windPowerInfo5Service.calWindpowerInfoDay(date);
-//        windPowerInfo6Service.calWindpowerInfoDay(date);
-//
-//        XxlJobHelper.log("区域统计调度程序执行完成!........");
-//
-//    }
-//
-//    /**
-//     * 等级评估统计
-//     * 每天执行一次
-//     */
-//
-//    @XxlJob("equipmentInfoDayTop_PG")
-//    public void equipmentInfoDayTop_PG()  {
-//
-//
-//        XxlJobHelper.log("等级评估统计调度程序执行开始!........");
-//        try {
-//            equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//        XxlJobHelper.log("等级评估统计调度任务处理完成!........");
-//    }
-//
-//
-//}
+package com.gyee.generation.task;
+
+
+import com.gyee.common.util.DateUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.service.*;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.Date;
+
+/**
+ * @ClassName : SaticScheduleTask
+ * @Description : 调度
+ */
+
+
+@Component
+public class SaticSchedulePgTask {
+
+    private static Logger logger = LoggerFactory.getLogger(SaticSchedulePgTask.class);
+
+    @Resource
+    private InputOrOutPutService inputOrOutPutService;
+    @Resource
+    private LimitEventnewService limitEventnewService;
+    @Resource
+    private PowerCurveFittingService powerCurveFittingService;
+    @Resource
+    private ShutdownnewService shutdownnewService;
+    @Resource
+    private WindPowerInfo1Service windPowerInfo1Service;
+    @Resource
+    private WindPowerInfo2Service windPowerInfo2Service;
+    @Resource
+    private WindPowerInfo3Service windPowerInfo3Service;
+    @Resource
+    private WindPowerInfo4Service windPowerInfo4Service;
+    @Resource
+    private WindPowerInfo5Service windPowerInfo5Service;
+    @Resource
+    private WindPowerInfo6Service windPowerInfo6Service;
+    @Resource
+    private EquipmentInfo1Service equipmentInfo1Service;
+    @Resource
+    private EquipmentInfo2Service equipmentInfo2Service;
+    @Resource
+    private EquipmentInfo3Service equipmentInfo3Service;
+    @Resource
+    private EquipmentInfo4Service equipmentInfo4Service;
+    @Resource
+    private EquipmentInfo5Service equipmentInfo5Service;
+    @Resource
+    private EquipmentInfoDayTopService equipmentInfoDayTopService;
+    //3.添加定时任务
+    /**
+     * 切入切出统计
+     * 每天执行一次
+     */
+
+    @XxlJob("inputOrOutPut_PG")
+    public void inputOrOutPut_PG()  {
+
+
+        XxlJobHelper.log("切入切出统计调度程序执行开始!........");
+        try {
+            inputOrOutPutService.inputOrOutput(new Date());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        XxlJobHelper.log("切入切出统计调度任务处理完成!........");
+    }
+
+    /**
+     * 停机记录
+     * 每15分钟执行一次
+     */
+    @XxlJob("shutdown_PG")
+    public void shutdown_PG()  {
+
+        XxlJobHelper.log("停机记录调度程序执行开始!........");
+
+        try {
+            shutdownnewService.execShutdown(new Date());
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        XxlJobHelper.log("停机记录调度任务处理完成!........");
+    }
+
+    /**
+     * 限电停机记录
+     * 每15分钟执行一次
+     */
+    @XxlJob("brownouts_PG")
+    public void brownouts_PG()  {
+
+        XxlJobHelper.log("限电停机记录调度程序执行开始!........");
+
+        try {
+            limitEventnewService.execBrownouts(new Date());
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        XxlJobHelper.log("限电停机记录调度任务处理完成!........");
+    }
+
+    /**
+     * 日、月、年功率曲线拟合
+     * 每天执行一次
+     */
+    @XxlJob("powerCurveFitting_PG")
+    public void powerCurveFitting_PG()  {
+
+        XxlJobHelper.log("日、月、年功率曲线拟合调度程序执行开始!........");
+
+        Date date=new Date();
+        try {
+            powerCurveFittingService.cureFitting(date,DateUtils.truncate(date),0, CacheContext.wtls);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        XxlJobHelper.log("日、月、年功率曲线拟合调度任务处理完成!........");
+    }
+
+    /**
+     * 设备指标统计
+     *  15分钟只执行一次
+     *
+     */
+    @XxlJob("equipment_PowerInfo_PG")
+    public void equipment_PowerInfo_PG() throws Exception {
+
+        XxlJobHelper.log("项目指标调度程序执行开始!........");
+        Date date=new Date();
+
+        equipmentInfo1Service.calEquipmentInfoDay(date);
+        equipmentInfo2Service.calEquipmentInfoDay(date);
+        equipmentInfo3Service.calEquipmentInfoDay(date);
+        equipmentInfo4Service.calEquipmentInfoDay(date);
+        equipmentInfo5Service.calEquipmentInfoDay(date);
+
+
+        XxlJobHelper.log("项目指标调度程序执行完成!........");
+
+    }
+    /**
+     * 线路指标统计
+     *  15分钟只执行一次
+     *
+     */
+    @XxlJob("Line_PowerInfo_PG")
+    public void Line_PowerInfo_PG() throws Exception {
+
+            XxlJobHelper.log("线路指标调度程序执行开始!........");
+
+            Date date=new Date();
+
+            windPowerInfo1Service.calLineInfoDay(date);
+            windPowerInfo2Service.calLineInfoDay(date);
+            windPowerInfo3Service.calLineInfoDay(date);
+            windPowerInfo4Service.calLineInfoDay(date);
+            windPowerInfo5Service.calLineInfoDay(date);
+            windPowerInfo6Service.calLineInfoDay(date);
+
+          XxlJobHelper.log("线路指标调度程序执行完成!........");
+
+    }
+
+    /**
+     * 线路指标统计
+     *  15分钟只执行一次
+     *
+     */
+    @XxlJob("project_PowerInfo_PG")
+    public void project_PowerInfo_PG() throws Exception {
+
+        XxlJobHelper.log("项目指标调度程序执行开始!........");
+        Date date=new Date();
+
+        windPowerInfo1Service.calProjectInfoDay(date);
+        windPowerInfo2Service.calProjectInfoDay(date);
+        windPowerInfo3Service.calProjectInfoDay(date);
+        windPowerInfo4Service.calProjectInfoDay(date);
+        windPowerInfo5Service.calProjectInfoDay(date);
+        windPowerInfo6Service.calProjectInfoDay(date);
+
+        XxlJobHelper.log("项目指标调度程序执行完成!........");
+
+    }
+
+
+    /**
+     * 区域、公司、场站指标统计
+     *  15分钟只执行一次
+     *
+     */
+    @XxlJob("station_PowerInfo_PG")
+    public void station_PowerInfo_PG() throws Exception {
+
+        XxlJobHelper.log("场站指标统计调度程序执行开始!........");
+        Date date=new Date();
+
+        windPowerInfo1Service.calWindpowerInfoDay(date);
+        windPowerInfo2Service.calWindpowerInfoDay(date);
+        windPowerInfo3Service.calWindpowerInfoDay(date);
+        windPowerInfo4Service.calWindpowerInfoDay(date);
+        windPowerInfo5Service.calWindpowerInfoDay(date);
+        windPowerInfo6Service.calWindpowerInfoDay(date);
+
+        XxlJobHelper.log("场站指标统计调度程序执行完成!........");
+        XxlJobHelper.log("公司指标统计调度程序执行开始!........");
+
+
+        windPowerInfo1Service.calWindpowerInfoDay(date);
+        windPowerInfo2Service.calWindpowerInfoDay(date);
+        windPowerInfo3Service.calWindpowerInfoDay(date);
+        windPowerInfo4Service.calWindpowerInfoDay(date);
+        windPowerInfo5Service.calWindpowerInfoDay(date);
+        windPowerInfo6Service.calWindpowerInfoDay(date);
+
+        XxlJobHelper.log("公司指标统计调度程序执行完成!........");
+        XxlJobHelper.log("区域指标统计调度程序执行开始!........");
+
+
+        windPowerInfo1Service.calWindpowerInfoDay(date);
+        windPowerInfo2Service.calWindpowerInfoDay(date);
+        windPowerInfo3Service.calWindpowerInfoDay(date);
+        windPowerInfo4Service.calWindpowerInfoDay(date);
+        windPowerInfo5Service.calWindpowerInfoDay(date);
+        windPowerInfo6Service.calWindpowerInfoDay(date);
+
+        XxlJobHelper.log("区域统计调度程序执行完成!........");
+
+    }
+
+    /**
+     * 等级评估统计
+     * 每天执行一次
+     */
+
+    @XxlJob("equipmentInfoDayTop_PG")
+    public void equipmentInfoDayTop_PG()  {
+
+
+        XxlJobHelper.log("等级评估统计调度程序执行开始!........");
+        try {
+            equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        XxlJobHelper.log("等级评估统计调度任务处理完成!........");
+    }
+
+
+}

+ 10 - 10
realtime/generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java

@@ -231,14 +231,14 @@ public class EdosUtil implements IEdosUtil {
                             //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                             // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
                             // 则代表该时间节点快照有效,否则为0
-                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() + "000";
+                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() ;
                             ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
                             JSONObject jsonObjectSection = sectionResp.getBody();
 
                             if (jsonObjectSection != null) {
                                 List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
                                 if (sectionlist.size() > 0) {
-                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                    if(sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
                                         resultList.add(snapItem);
                                     }
                                     else{
@@ -307,13 +307,13 @@ public class EdosUtil implements IEdosUtil {
 
 
         long subTime =beginDate - pried;
-        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + beginDate + "000";
+        String rawUrl = baseURL + "/history/section?null=0&tagNames=" + pointid + "&ts=" + beginDate ;
         ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
         JSONObject jsonObjectSection = sectionResp.getBody();
         if (jsonObjectSection != null) {
             List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
             if (sectionlist.size() > 0) {
-                if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=beginDate){
+                if(sectionlist.get(0).getPointTime()<=beginDate){
                     resultList.add(sectionlist.get(0));
                 }
                 else{
@@ -518,14 +518,14 @@ public class EdosUtil implements IEdosUtil {
                             //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                             // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
                             // 则代表该时间节点快照有效,否则为0
-                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() + "000";
+                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" + point.getNemCode() + "&ts=" + snapItem.getPointTime() ;
                             ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
                             JSONObject jsonObjectSection = sectionResp.getBody();
 
                             if (jsonObjectSection != null) {
                                 List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
                                 if (sectionlist.size() > 0) {
-                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                    if(sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
                                         resultList.add(snapItem);
                                     }
                                     else{
@@ -1003,14 +1003,14 @@ public class EdosUtil implements IEdosUtil {
                             //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                             // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
                             // 则代表该时间节点快照有效,否则为0
-                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() + "000";
+                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() ;
                             ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
                             JSONObject jsonObjectSection = sectionResp.getBody();
 
                             if (jsonObjectSection != null) {
                                 List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
                                 if (sectionlist.size() > 0) {
-                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                    if(sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
                                         resultList.add(snapItem);
                                     }
                                     else{
@@ -1715,14 +1715,14 @@ public class EdosUtil implements IEdosUtil {
                             //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
                             // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
                             // 则代表该时间节点快照有效,否则为0
-                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() + "000";
+                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() ;
                             ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
                             JSONObject jsonObjectSection = sectionResp.getBody();
 
                             if (jsonObjectSection != null) {
                                 List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
                                 if (sectionlist.size() > 0) {
-                                    if(sectionlist.get(0).getPointTime()>=subTime&&sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+                                    if(sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
                                         resultList.add(snapItem);
                                     }
                                     else{

+ 12 - 3
realtime/generationXK-service/src/main/resources/application-xk.yml

@@ -86,9 +86,11 @@ logging:
     com.example: debug
 #db url
 db:
-  url: http://10.81.3.152:8011/ts
+#  url: http://127.0.0.1:8011/ts
+  url: http://192.168.11.250: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,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   #配置期次
@@ -107,7 +109,14 @@ curvefitting:
   #尺度
   scale: 0.01
 initialcode: INITIAL
-
+##调用区间间隔时长,需要与XXLJOB调度时长结合,保证查询区间时长大于调度时长,单位分钟
+frequency:
+  #停机
+  shutdown: 6
+  #限电
+  powerrationing: 6
+  #切入切出
+  cutinandout: 6
 
 
 

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

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

+ 1 - 1
realtime/generationXK-service/src/main/resources/xxl-job-executor.properties

@@ -1,5 +1,5 @@
 ### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
-xxl.job.admin.addresses=http://10.81.3.152:8175/xxl-job-admin
+xxl.job.admin.addresses=http://192.168.11.250:8175/xxl-job-admin
 
 ### xxl-job, access token
 xxl.job.accessToken=