xieshengjie 2 年 前
コミット
6a4e52c07f
19 ファイル変更846 行追加150 行削除
  1. 5 1
      common/src/main/java/com/gyee/common/contant/ContantXk.java
  2. 23 0
      common/src/main/java/com/gyee/common/util/algorithm/MathUtils.java
  3. 2 2
      realtime/generationXK-service/src/main/java/com/gyee/generation/config/GeneratorCodeConfig.java
  4. 69 69
      realtime/generationXK-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java
  5. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProBasicBranchController.java
  6. 13 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java
  7. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProBasicBranchMapper.java
  8. 3 3
      realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfoDay6Mapper.java
  9. 54 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicBranch.java
  10. 22 62
      realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay6.java
  11. 550 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo6Service.java
  12. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProBasicBranchService.java
  13. 3 3
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconEquipmentInfoDay6Service.java
  14. 20 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProBasicBranchServiceImpl.java
  15. 3 3
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfoDay6ServiceImpl.java
  16. 21 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java
  17. 0 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/TestService.java
  18. 4 4
      realtime/generationXK-service/src/main/java/com/gyee/generation/task/SaticSchedulePgTask.java
  19. 2 2
      realtime/generationXK-service/src/test/java/com/gyee/generation/GenerationTest.java

+ 5 - 1
common/src/main/java/com/gyee/common/contant/ContantXk.java

@@ -166,7 +166,7 @@ public class ContantXk {
     public static final String  KYGL= "KYGL";//设备可用功率
 
 
-    public static final String  CJ_SSFS= "AI066";//设备风速
+    public static final String  CJ_SSFS= "AI066";//设备风速,光照
     public static final String  CJ_SSGL= "AI114";//设备有功功率
     public static final String  CJ_FDZTXZSGD= "AI061";//发电状态下的转速给定
     public static final String  CJ_SCADA_YGSD= "AI003";//scada有功设定值
@@ -185,6 +185,10 @@ public class ContantXk {
     public static final String FCCFTFX70 = "FCCFTFX70";//测风塔70米风向
     public static final String CJ_FX = "AI067";//风向
 
+    public static final String NBQSRGL = "AIG067";   //逆变器输入功率
+    public static final String NBQSCGL = "AI114";   //逆变器输出功率
+    public static final String ZLDL = "AI114";   //支路电流
+
 
     public static final String FCCFTWD = "FCCFTWD";//测风塔温度
     public static final String QXZWD = "QXZWD";//气象站温度

+ 23 - 0
common/src/main/java/com/gyee/common/util/algorithm/MathUtils.java

@@ -0,0 +1,23 @@
+package com.gyee.common.util.algorithm;/*
+@author   谢生杰
+@date   2023/3/15-11:04
+*/
+
+public class MathUtils {
+
+    //标准差σ=sqrt(s^2)
+    public static double standardDiviation(Double[] x) {
+        int m=x.length;
+        double sum=0;
+        for(int i=0;i<m;i++){//求和
+            sum+=x[i];
+        }
+        double dAve=sum/m;//求平均值
+        double dVar=0;
+        for(int i=0;i<m;i++){//求方差
+            dVar+=(x[i]-dAve)*(x[i]-dAve);
+        }
+        //reture Math.sqrt(dVar/(m-1));
+        return Math.sqrt(dVar/m);
+    }
+}

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

@@ -40,7 +40,7 @@ public class GeneratorCodeConfig {
         GlobalConfig gc = new GlobalConfig();
         String projectPath = System.getProperty("user.dir");
         gc.setOutputDir(projectPath+"/realtime/generationXK-service"+ "/src/main/java");
-        gc.setAuthor("shilin");
+        gc.setAuthor("xieshengjie");
         gc.setOpen(false);
         //实体属性 Swagger2 注解
         gc.setSwagger2(false);
@@ -61,7 +61,7 @@ public class GeneratorCodeConfig {
         dsc.setDriverName("org.postgresql.Driver");
         dsc.setUsername("postgres");
         dsc.setPassword("gd123");
-        dsc.setUrl("jdbc:postgresql://127.0.0.1:5432/IMS_NEM");
+        dsc.setUrl("jdbc:postgresql://124.70.75.91:5432/sd20230309");
 //        dsc.setDriverName("org.postgresql.Driver");
 //        dsc.setUsername("postgres");
 //        dsc.setPassword("postgres");

+ 69 - 69
realtime/generationXK-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java

@@ -1,70 +1,70 @@
-//package com.gyee.generation.config;
-//
-//
-//import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.context.EnvironmentAware;
-//import org.springframework.context.annotation.Bean;
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.context.annotation.PropertySource;
-//import org.springframework.core.env.Environment;
-//
-///**
-// * xxl-job config
-// *
-// * @author xuxueli 2017-04-28
-// */
-//
-//
-//@Configuration
+package com.gyee.generation.config;
+
+
+import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.EnvironmentAware;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.env.Environment;
+
+/**
+ * xxl-job config
+ *
+ * @author xuxueli 2017-04-28
+ */
+
+
+@Configuration
 //@PropertySource("classpath:xxl-job-executor.properties")
-////@PropertySource("classpath:xxl-job-executorWPXNY.properties")
-////@PropertySource("classpath:xxl-job-executorRG.properties")
-//public class XxlJobConfig implements EnvironmentAware {
-//    private Environment env;
-//
-//
-//    @Override
-//    public void setEnvironment(Environment environment) {
-//        this.env=environment;
-//    }
-//
-//    private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
-//
-//
-//
-//    @Bean
-//    public XxlJobSpringExecutor xxlJobExecutor() {
-//        logger.info(">>>>>>>>>>> xxl-job config init.");
-//        XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
-//        xxlJobSpringExecutor.setAdminAddresses(env.getProperty("xxl.job.admin.addresses"));
-//        xxlJobSpringExecutor.setAppname(env.getProperty("xxl.job.executor.appname"));
-//        xxlJobSpringExecutor.setAddress(env.getProperty("xxl.job.executor.address"));
-//        xxlJobSpringExecutor.setIp(env.getProperty("xxl.job.executor.ip"));
-//        xxlJobSpringExecutor.setPort(Integer.parseInt(env.getProperty("xxl.job.executor.port")));
-//        xxlJobSpringExecutor.setAccessToken(env.getProperty("xxl.job.accessToken"));
-//        xxlJobSpringExecutor.setLogPath(env.getProperty("xxl.job.executor.logpath"));
-//        xxlJobSpringExecutor.setLogRetentionDays(Integer.parseInt(env.getProperty("xxl.job.executor.logretentiondays")));
-//        return xxlJobSpringExecutor;
-//    }
-//
-//    /**
-//     * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
-//     *
-//     *      1、引入依赖:
-//     *          <dependency>
-//     *             <groupId>org.springframework.cloud</groupId>
-//     *             <artifactId>spring-cloud-commons</artifactId>
-//     *             <version>${version}</version>
-//     *         </dependency>
-//     *
-//     *      2、配置文件,或者容器启动变量
-//     *          spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
-//     *
-//     *      3、获取IP
-//     *          String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
-//     */
-//
-//
-//}
+//@PropertySource("classpath:xxl-job-executorWPLY.properties")
+@PropertySource("classpath:xxl-job-executorRG.properties")
+public class XxlJobConfig implements EnvironmentAware {
+    private Environment env;
+
+
+    @Override
+    public void setEnvironment(Environment environment) {
+        this.env=environment;
+    }
+
+    private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
+
+
+
+    @Bean
+    public XxlJobSpringExecutor xxlJobExecutor() {
+        logger.info(">>>>>>>>>>> xxl-job config init.");
+        XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
+        xxlJobSpringExecutor.setAdminAddresses(env.getProperty("xxl.job.admin.addresses"));
+        xxlJobSpringExecutor.setAppname(env.getProperty("xxl.job.executor.appname"));
+        xxlJobSpringExecutor.setAddress(env.getProperty("xxl.job.executor.address"));
+        xxlJobSpringExecutor.setIp(env.getProperty("xxl.job.executor.ip"));
+        xxlJobSpringExecutor.setPort(Integer.parseInt(env.getProperty("xxl.job.executor.port")));
+        xxlJobSpringExecutor.setAccessToken(env.getProperty("xxl.job.accessToken"));
+        xxlJobSpringExecutor.setLogPath(env.getProperty("xxl.job.executor.logpath"));
+        xxlJobSpringExecutor.setLogRetentionDays(Integer.parseInt(env.getProperty("xxl.job.executor.logretentiondays")));
+        return xxlJobSpringExecutor;
+    }
+
+    /**
+     * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
+     *
+     *      1、引入依赖:
+     *          <dependency>
+     *             <groupId>org.springframework.cloud</groupId>
+     *             <artifactId>spring-cloud-commons</artifactId>
+     *             <version>${version}</version>
+     *         </dependency>
+     *
+     *      2、配置文件,或者容器启动变量
+     *          spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
+     *
+     *      3、获取IP
+     *          String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
+     */
+
+
+}

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

@@ -0,0 +1,20 @@
+package com.gyee.generation.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author xieshengjie
+ * @since 2023-03-15
+ */
+@RestController
+@RequestMapping("//pro-basic-branch")
+public class ProBasicBranchController {
+
+}

+ 13 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -66,6 +66,8 @@ public class CacheContext implements CommandLineRunner {
     private IProBasicModelPowerRdService proBasicModelPowerRdService;
     @Resource
     private IProBasicWeatherStationService proBasicWeatherStationService;
+    @Resource
+    private IProBasicBranchService proBasicBranchService;
 
     @Value("${runWindpowerstation}")
     private String runWindpowerstation;
@@ -132,6 +134,7 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, Map<Double,ProEconWtPowerCurveFitting>> curveFittingPowerMap = new HashMap<>(); //自算,最优功率
     public static Map<String,List<ProBasicStatusPoint>> statusMap = new HashMap<>();
     public static Map<String,Map<String, ProBasicPowerstationPoint>> wspointmap =new HashMap<>();
+    public static Map<String,Map<String, ProBasicEquipmentPoint>> zlpointmap =new HashMap<>();
     @Override
     public void run(String... args) throws Exception {
         logger.info("缓存开始------------------------------------------------------------");
@@ -285,6 +288,16 @@ public class CacheContext implements CommandLineRunner {
             wspointmap.put(p.getId(),stringWindpowerstationpointnewMap);
 
         });
+        //支路
+        List<ProBasicBranch> basicBranches = proBasicBranchService.list();
+        if (basicBranches!=null && basicBranches.size()>0){
+            basicBranches.stream().forEach(b->{
+                String wsString = redisService.get(b.getId());
+                Map<String, ProBasicEquipmentPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(wsString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
+                });
+                zlpointmap.put(b.getId(),stringWindpowerstationpointnewMap);
+            });
+        }
 
         wtls = proBasicEquipmentService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationId()) && i.getIsable()==1).collect(Collectors.toList());
         logger.info(wtls.size()+"");

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

@@ -0,0 +1,16 @@
+package com.gyee.generation.mapper.auto;
+
+import com.gyee.generation.model.auto.ProBasicBranch;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author xieshengjie
+ * @since 2023-03-15
+ */
+public interface ProBasicBranchMapper extends BaseMapper<ProBasicBranch> {
+
+}

+ 3 - 3
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProEconEquipmentInfoDay6Mapper.java

@@ -5,11 +5,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * <p>
- * 离散率转换效率 Mapper 接口
+ *  Mapper 接口
  * </p>
  *
- * @author shilin
- * @since 2022-11-01
+ * @author xieshengjie
+ * @since 2023-03-15
  */
 public interface ProEconEquipmentInfoDay6Mapper extends BaseMapper<ProEconEquipmentInfoDay6> {
 

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

@@ -0,0 +1,54 @@
+package com.gyee.generation.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author xieshengjie
+ * @since 2023-03-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProBasicBranch extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String nemCode;
+
+    private String windpowerstationId;
+
+    private String projectId;
+
+    private String lineId;
+
+    private String name;
+
+    private String aname;
+
+    private String types;
+
+    private Integer isAble;
+
+    private String spare1;
+
+    private String spare2;
+
+    private String spare3;
+
+    private String spare4;
+
+    private String inteverId;
+
+    private String combinerId;
+
+    private String squareId;
+
+
+}

+ 22 - 62
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProEconEquipmentInfoDay6.java

@@ -4,109 +4,69 @@ 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.time.LocalDate;
 import java.util.Date;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 /**
  * <p>
- * 离散率转换效率
+ * 
  * </p>
  *
- * @author shilin
- * @since 2022-11-01
+ * @author xieshengjie
+ * @since 2023-03-15
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class ProEconEquipmentInfoDay6 extends Model {
 
     private static final long serialVersionUID = 1L;
-
-    /**
-     * 编号
-     */
-    @TableId(value = "ID",type = IdType.ASSIGN_ID)
+    @TableId(value = "ID",type = IdType.INPUT)
     private String id;
 
-    /**
-     * 逆变器编号
-     */
     private String windturbineId;
 
-    /**
-     * 日期
-     */
     private Date recordDate;
 
-    /**
-     * 风场编号
-     */
     private String windpowerstationId;
 
-    /**
-     * 项目编号
-     */
     private String projectId;
 
-    /**
-     * 线路编号
-     */
     private String lineId;
 
-    /**
-     * 公司编号
-     */
     private String companyId;
 
-    /**
-     * 区域编号
-     */
     private String regionId;
 
-    /**
-     * 日系统效率(PR)
-     */
-    private Double rxtxl;
-
-    /**
-     * 日离散率
-     */
     private Double rlsl;
 
-    /**
-     * 日逆变器转换效率
-     */
     private Double rnbqzhxl;
 
-    /**
-     * 月系统效率(PR)
-     */
-    private Double yxtxl;
-
-    /**
-     * 月离散率
-     */
     private Double ylsl;
 
-    /**
-     * 月逆变器转换效率
-     */
     private Double ynbqzhxl;
 
-    /**
-     * 年系统效率(PR)
-     */
-    private Double nxtxl;
-
-    /**
-     * 年离散率
-     */
     private Double nlsl;
 
-    /**
-     * 年逆变器转换效率
-     */
     private Double nnbqzhxl;
 
+    private Double rzdjlgl;
+
+    private Double rzdzlgl;
+
+    private Double yzdjlgl;
+
+    private Double yzdzlgl;
+
+    private Double nzdjlgl;
+
+    private Double nzdzlgl;
+
+    private Double rxtxl;
+    private Double yxtxl;
+    private Double nxtxl;
+
 
 }

+ 550 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/EquipmentInfo6Service.java

@@ -0,0 +1,550 @@
+package com.gyee.generation.service;/*
+@author   谢生杰
+@date   2023/3/15-8:54
+*/
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.contant.ContantXk;
+import com.gyee.common.model.PointData;
+import com.gyee.common.util.CommonUtils;
+import com.gyee.common.util.DateUtils;
+import com.gyee.common.util.DoubleUtils;
+import com.gyee.common.util.algorithm.MathUtils;
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.*;
+import com.gyee.generation.service.auto.IProBasicBranchService;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay6Service;
+import com.gyee.generation.service.auto.IProEconPowerstationInfoDay7Service;
+import com.gyee.generation.util.StringUtils;
+import com.gyee.generation.util.realtimesource.IEdosUtil;
+import com.gyee.generation.util.statisticcs.Initial;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.ArrayStack;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+@Slf4j
+public class EquipmentInfo6Service {
+    @Resource
+    private IEdosUtil edosUtil;
+    @Resource
+    private IProBasicBranchService proBasicBranchService;
+    @Resource
+    private IProEconEquipmentInfoDay6Service proEconEquipmentInfoDay6Service;
+    @Resource
+    private IProEconPowerstationInfoDay7Service proEconPowerstationInfoDay7Service;
+
+
+    public void saveEquipmentInfo6(String begin,String end){
+        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
+        Map<String, Map<String, ProBasicEquipmentPoint>> zlpointmap = CacheContext.zlpointmap;
+        Map<String, ProEconEquipmentmodel> modelMap = CacheContext.modelMap;
+        List<String> days = DateUtils.getDays(begin, end);
+
+        days.stream().forEach(day->{
+            List<ProEconEquipmentInfoDay6> resultList = new ArrayList<>();
+            Date date = DateUtils.parseDate(day);
+            Date beforeDay = DateUtils.addDays(date, -1);
+
+            //删除存在的当天记录
+            QueryWrapper<ProEconEquipmentInfoDay6> removeQw = new QueryWrapper<>();
+            removeQw.eq("record_date",date);
+            proEconEquipmentInfoDay6Service.remove(removeQw);
+            //查询前一天记录
+            QueryWrapper<ProEconEquipmentInfoDay6> beforeQw = new QueryWrapper<>();
+            beforeQw.eq("record_date",beforeDay);
+            List<ProEconEquipmentInfoDay6> beforeList = proEconEquipmentInfoDay6Service.list(beforeQw);
+
+            Date startOfDay = DateUtils.getStartOfDay(date);
+            Date endOfDay = DateUtils.getEndOfDay(date);
+            int month = DateUtils.getMonth(date);
+            int day1 = DateUtils.getDay(date);
+            for (ProBasicEquipment wt : CacheContext.wtls.stream().filter(i->i.getEquipmentCategory()==-2).collect(Collectors.toList())) {
+                Optional<ProEconEquipmentInfoDay6> first = beforeList.stream().filter(i -> i.getWindturbineId().equals(wt.getId())).findFirst();
+                QueryWrapper<ProBasicBranch> qw = new QueryWrapper<>();
+                qw.eq("intever_id",wt.getId());
+                List<ProBasicBranch> basicBranches = proBasicBranchService.list(qw);
+
+                ProEconEquipmentInfoDay6 rate = new ProEconEquipmentInfoDay6();
+
+                rate.setId(CommonUtils.getUUID());
+                rate.setRecordDate(date);
+                rate.setWindpowerstationId(wt.getWindpowerstationId());
+                rate.setProjectId(wt.getProjectId());
+                rate.setLineId(wt.getLineId());
+                rate.setWindturbineId(wt.getId());
+                rate.setCompanyId(wt.getCompanyId());
+                rate.setRegionId(wt.getRegionId());
+                if (wtpAimap.containsKey(wt.getId())){
+                    double aveZlgl = 0;
+                    double aveJlgl = 0;
+
+                    Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
+
+                    if(equipmentPointMap.containsKey(ContantXk.RFDL) && equipmentPointMap.containsKey(ContantXk.CJ_SSFS)){
+                        ProBasicEquipmentPoint rfdlPoint = equipmentPointMap.get(ContantXk.RFDL);
+                        ProBasicEquipmentPoint gzqdPoint = equipmentPointMap.get(ContantXk.CJ_SSFS);
+                        double rfdl = 0;
+                        double gzqd = 0;
+                        try {
+                            rfdl = edosUtil.getSectionData(rfdlPoint, endOfDay.getTime() / 1000).getPointValueInDouble();
+                            List<PointData> gzqdPointdata = edosUtil.getHistoryDatasSnap(gzqdPoint, startOfDay.getTime() / 1000, endOfDay.getTime() / 1000, null, 1800l);
+                            gzqd = gzqdPointdata.stream().mapToDouble(PointData::getPointValueInDouble).sum();
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        double xtxl = rfdl / (gzqd / 1000 * modelMap.get(wt.getModelId()).getPowerProduction());
+                        rate.setRxtxl(xtxl);
+
+                        if (first.isPresent()){
+                            ProEconEquipmentInfoDay6 wtBefore = first.get();
+                            if (day1==1){
+                                rate.setYxtxl(xtxl);
+                            }else {
+                                rate.setYxtxl((xtxl+wtBefore.getYxtxl())/2);
+                            }
+
+                            if (day1==1 && month==1){
+                                rate.setNxtxl(xtxl);
+                            }else {
+                                rate.setNxtxl((xtxl+wtBefore.getNxtxl())/2);
+                            }
+                        }else {
+                            rate.setYzdzlgl(xtxl);
+                            rate.setNzdzlgl(xtxl);
+                        }
+                    }
+
+
+
+                    if(equipmentPointMap.containsKey(ContantXk.NBQSRGL))   //逆变器直流功率
+                    {
+                        ProBasicEquipmentPoint point= equipmentPointMap.get(ContantXk.NBQSRGL);
+                        List<PointData> pointls= null;
+                        try {
+                            pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), startOfDay.getTime()/1000, endOfDay.getTime()/1000,null,1800l);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        if(!pointls.isEmpty())
+                        {
+                            DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                            //最大功率
+                            rate.setRzdzlgl(summaryStatistics.getMax());
+                            aveZlgl=summaryStatistics.getAverage();
+
+                            if (first.isPresent()){
+                                ProEconEquipmentInfoDay6 wtBefore = first.get();
+                                if (day1==1){
+                                    rate.setYzdzlgl(summaryStatistics.getMax());
+                                }else {
+                                    rate.setYzdzlgl(summaryStatistics.getMax()>wtBefore.getYzdzlgl()?summaryStatistics.getMax():wtBefore.getYzdzlgl());
+                                }
+
+                                if (day1==1 && month==1){
+                                    rate.setNzdzlgl(summaryStatistics.getMax());
+                                }else {
+                                    rate.setNzdzlgl(summaryStatistics.getMax()>wtBefore.getNzdzlgl()?summaryStatistics.getMax():wtBefore.getNzdzlgl());
+                                }
+                            }else {
+                                rate.setYzdzlgl(summaryStatistics.getMax());
+                                rate.setNzdzlgl(summaryStatistics.getMax());
+                            }
+
+                        }
+                    }
+
+                    if(equipmentPointMap.containsKey(ContantXk.NBQSCGL))   //逆变器交流功率
+                    {
+                        ProBasicEquipmentPoint point= equipmentPointMap.get(ContantXk.NBQSCGL);
+                        List<PointData> pointls= null;
+                        try {
+                            pointls = edosUtil.getHistoryDatasSnap(point.getNemCode(), startOfDay.getTime()/1000, endOfDay.getTime()/1000,null,1800l);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        if(!pointls.isEmpty())
+                        {
+                            DoubleSummaryStatistics summaryStatistics=pointls.stream().mapToDouble(PointData::getPointValueInDouble).summaryStatistics();
+                            //最大功率
+                            rate.setRzdjlgl(summaryStatistics.getMax());
+                            aveJlgl=summaryStatistics.getAverage();
+
+                            if (first.isPresent()){
+                                ProEconEquipmentInfoDay6 wtBefore = first.get();
+                                if (day1==1){
+                                    rate.setYzdjlgl(summaryStatistics.getMax());
+                                }else {
+                                    rate.setYzdjlgl(summaryStatistics.getMax()>wtBefore.getYzdjlgl()?summaryStatistics.getMax():wtBefore.getYzdjlgl());
+
+                                }
+                                if (day1==1 && month==1){
+                                    rate.setNzdjlgl(summaryStatistics.getMax());
+                                }else {
+                                    rate.setNzdjlgl(summaryStatistics.getMax()>wtBefore.getNzdjlgl()?summaryStatistics.getMax():wtBefore.getNzdjlgl());
+
+                                }
+                            }else {
+                                rate.setYzdjlgl(summaryStatistics.getMax());
+                                rate.setNzdjlgl(summaryStatistics.getMax());
+                            }
+                        }
+                    }
+                    rate.setRnbqzhxl(aveZlgl!=0? DoubleUtils.keepPrecision(aveJlgl/aveZlgl*100,2):0);
+                    if (first.isPresent()){
+                        ProEconEquipmentInfoDay6 wtBefore = first.get();
+                        if (day1==1){
+                            rate.setYnbqzhxl(rate.getRnbqzhxl());
+                        }else {
+                            rate.setYnbqzhxl((wtBefore.getYnbqzhxl()+rate.getRnbqzhxl())/2);
+                        }
+
+                        if (day1==1 && month==1){
+                            rate.setNnbqzhxl(rate.getRnbqzhxl());
+                        }else {
+                            rate.setNnbqzhxl((wtBefore.getNnbqzhxl()+rate.getRnbqzhxl())/2);
+                        }
+                    }else {
+                        rate.setYnbqzhxl(rate.getRnbqzhxl());
+                        rate.setNnbqzhxl(rate.getRnbqzhxl());
+                    }
+
+
+                    ProBasicEquipmentPoint equipmentPoint = zlpointmap.get(basicBranches.get(0).getId()).get(ContantXk.ZLDL);
+                    List<PointData> pointls= null;
+                    try {
+                        pointls = edosUtil.getHistoryDatasSnap(equipmentPoint.getNemCode(),startOfDay.getTime()/1000,endOfDay.getTime()/1000,null,1800l);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    Map<String,List<PointData>> zltempMap = new HashMap<>();
+                    for (int j = 0; j<basicBranches.size();j++) {
+                        ProBasicEquipmentPoint point = zlpointmap.get(basicBranches.get(j).getId()).get(ContantXk.ZLDL);
+                        List<PointData> points= null;
+                        try {
+                            points = edosUtil.getHistoryDatasSnap(point.getNemCode(),startOfDay.getTime()/1000,endOfDay.getTime()/1000,null,1800l);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        zltempMap.put(basicBranches.get(j).getId(),points);
+                    }
+                    double lslSum = 0;
+                    for (int i = 0;i<pointls.size();i++){
+                        List<Double> tempList = new ArrayList<>();
+                        int sum = 0;
+                        for (int j = 0; j<basicBranches.size();j++) {
+                            tempList.add(zltempMap.get(j).get(i).getPointValueInDouble());
+                            sum += zltempMap.get(j).get(i).getPointValueInDouble();
+                        }
+                        Double[] array = (Double[]) tempList.toArray();
+                        double bzfc = MathUtils.standardDiviation(array);
+                        int ave = sum / basicBranches.size();
+                        double lsl = bzfc / ave * 100;
+                        lslSum += lsl;
+                    }
+
+                    double rlsl = DoubleUtils.keepPrecision(lslSum/pointls.size(),2);
+                    rate.setRlsl(rlsl);
+                    if (first.isPresent()){
+                        ProEconEquipmentInfoDay6 wtBefore = first.get();
+                        if (day1==1){
+                            rate.setYlsl(rlsl);
+                        }else {
+                            rate.setYlsl((wtBefore.getYlsl()+rlsl)/2);
+                        }
+
+                        if (day1==1 && month==1){
+                            rate.setNlsl(rlsl);
+                        }else {
+                            rate.setNlsl((wtBefore.getNlsl()+rlsl)/2);
+                        }
+                    }else {
+                        rate.setYlsl(rlsl);
+                        rate.setNlsl(rlsl);
+                    }
+                }
+                resultList.add(rate);
+            }
+            proEconEquipmentInfoDay6Service.saveBatch(resultList);
+        });
+    }
+
+    public void savePowerstationInfo(String begin,String end){
+        List<String> days = DateUtils.getDays(begin, end);
+
+
+
+        days.stream().forEach(day->{
+
+            Date date = DateUtils.parseDate(day);
+            QueryWrapper<ProEconEquipmentInfoDay6> qw = new QueryWrapper<>();
+            qw.eq("record_date",date);
+            List<ProEconEquipmentInfoDay6> list = proEconEquipmentInfoDay6Service.list(qw);
+
+
+            Map<String, List<ProBasicCompany>> rgcpmap = CacheContext.rgcpmap;
+            Map<String, List<ProBasicPowerstation>> cpwpmap = CacheContext.cpwpmap;
+            Map<String, List<ProBasicProject>> wppromap = CacheContext.wppromap;
+            Map<String, List<ProBasicLine>> prolinemap = CacheContext.prolinemap;
+            Map<String, List<ProBasicEquipment>> lnwtmap = CacheContext.lnwtmap;
+            Map<String, ProBasicProject> pjmap = CacheContext.pjmap;
+            Map<String, ProBasicPowerstation> wpmap = CacheContext.wpmap;
+
+            List<ProBasicRegion> rgls = CacheContext.rgls;
+            List<ProBasicLine> lnls = CacheContext.lnls;
+            List<ProBasicProject> pjls = CacheContext.pjls;
+            List<ProBasicPowerstation> wpls = CacheContext.wpls;
+            List<ProBasicCompany> cpls = CacheContext.cpls;
+
+            List<ProEconPowerstationInfoDay7> lnResultlist = new ArrayList<>();
+            lnls.stream().forEach(ln->{
+                List<ProEconEquipmentInfoDay6> equipmentInfoDay6s = list.stream().filter(i -> i.getLineId().equals(ln.getId())).collect(Collectors.toList());
+                if (StringUtils.isNotEmpty(equipmentInfoDay6s)){
+                    double rxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRxtxl).average().getAsDouble();
+                    double yxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYxtxl).average().getAsDouble();
+                    double nxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNxtxl).average().getAsDouble();
+                    double rlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRlsl).average().getAsDouble();
+                    double ylsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYlsl).average().getAsDouble();
+                    double nlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNlsl).average().getAsDouble();
+                    double rzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRnbqzhxl).average().getAsDouble();
+                    double yzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYnbqzhxl).average().getAsDouble();
+                    double nzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNnbqzhxl).average().getAsDouble();
+                    ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = new ProEconPowerstationInfoDay7();
+                    proEconPowerstationInfoDay7.setId(CommonUtils.getUUID());
+                    proEconPowerstationInfoDay7.setForeignKeyId(ln.getId());
+                    proEconPowerstationInfoDay7.setRecordDate(date);
+                    proEconPowerstationInfoDay7.setWindpowerstationId(pjmap.get(ln.getProjectId()).getWindpowerstationId());
+                    proEconPowerstationInfoDay7.setProjectId(ln.getProjectId());
+                    proEconPowerstationInfoDay7.setLineId(ln.getId());
+                    proEconPowerstationInfoDay7.setCompanyId(wpmap.get(pjmap.get(ln.getProjectId()).getWindpowerstationId()).getCompanyId());
+                    proEconPowerstationInfoDay7.setRegionId(wpmap.get(pjmap.get(ln.getProjectId()).getWindpowerstationId()).getRegionId());
+                    proEconPowerstationInfoDay7.setLocation("ln");
+                    proEconPowerstationInfoDay7.setRxtxlpr(DoubleUtils.keepPrecision(rxtxl,2));
+                    proEconPowerstationInfoDay7.setYxtxlpr(DoubleUtils.keepPrecision(yxtxl,2));
+                    proEconPowerstationInfoDay7.setNxtxlpr(DoubleUtils.keepPrecision(nxtxl,2));
+                    proEconPowerstationInfoDay7.setRlsl(DoubleUtils.keepPrecision(rlsl,2));
+                    proEconPowerstationInfoDay7.setYlsl(DoubleUtils.keepPrecision(ylsl,2));
+                    proEconPowerstationInfoDay7.setNlsl(DoubleUtils.keepPrecision(nlsl,2));
+                    proEconPowerstationInfoDay7.setRnbqzhxl(DoubleUtils.keepPrecision(rzhxl,2));
+                    proEconPowerstationInfoDay7.setYnbqzhxl(DoubleUtils.keepPrecision(yzhxl,2));
+                    proEconPowerstationInfoDay7.setNnbqzhxl(DoubleUtils.keepPrecision(nzhxl,2));
+                    lnResultlist.add(proEconPowerstationInfoDay7);
+                }
+            });
+            proEconPowerstationInfoDay7Service.saveBatch(lnResultlist);
+
+            List<ProEconPowerstationInfoDay7> pjResultlist = new ArrayList<>();
+            pjls.stream().forEach(pj->{
+                List<ProEconEquipmentInfoDay6> equipmentInfoDay6s = list.stream().filter(i -> i.getProjectId().equals(pj.getId())).collect(Collectors.toList());
+                if (StringUtils.isNotEmpty(equipmentInfoDay6s)){
+                    double rxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRxtxl).average().getAsDouble();
+                    double yxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYxtxl).average().getAsDouble();
+                    double nxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNxtxl).average().getAsDouble();
+                    double rlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRlsl).average().getAsDouble();
+                    double ylsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYlsl).average().getAsDouble();
+                    double nlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNlsl).average().getAsDouble();
+                    double rzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRnbqzhxl).average().getAsDouble();
+                    double yzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYnbqzhxl).average().getAsDouble();
+                    double nzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNnbqzhxl).average().getAsDouble();
+                    ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = new ProEconPowerstationInfoDay7();
+                    proEconPowerstationInfoDay7.setId(CommonUtils.getUUID());
+                    proEconPowerstationInfoDay7.setForeignKeyId(pj.getId());
+                    proEconPowerstationInfoDay7.setRecordDate(date);
+                    proEconPowerstationInfoDay7.setWindpowerstationId(pjmap.get(pj.getId()).getWindpowerstationId());
+                    proEconPowerstationInfoDay7.setProjectId(pj.getId());
+                    proEconPowerstationInfoDay7.setCompanyId(wpmap.get(pjmap.get(pj.getId()).getWindpowerstationId()).getCompanyId());
+                    proEconPowerstationInfoDay7.setRegionId(wpmap.get(pjmap.get(pj.getId()).getWindpowerstationId()).getRegionId());
+                    proEconPowerstationInfoDay7.setLocation("pj");
+                    proEconPowerstationInfoDay7.setRxtxlpr(DoubleUtils.keepPrecision(rxtxl,2));
+                    proEconPowerstationInfoDay7.setYxtxlpr(DoubleUtils.keepPrecision(yxtxl,2));
+                    proEconPowerstationInfoDay7.setNxtxlpr(DoubleUtils.keepPrecision(nxtxl,2));
+                    proEconPowerstationInfoDay7.setRlsl(DoubleUtils.keepPrecision(rlsl,2));
+                    proEconPowerstationInfoDay7.setYlsl(DoubleUtils.keepPrecision(ylsl,2));
+                    proEconPowerstationInfoDay7.setNlsl(DoubleUtils.keepPrecision(nlsl,2));
+                    proEconPowerstationInfoDay7.setRnbqzhxl(DoubleUtils.keepPrecision(rzhxl,2));
+                    proEconPowerstationInfoDay7.setYnbqzhxl(DoubleUtils.keepPrecision(yzhxl,2));
+                    proEconPowerstationInfoDay7.setNnbqzhxl(DoubleUtils.keepPrecision(nzhxl,2));
+                    pjResultlist.add(proEconPowerstationInfoDay7);
+                }
+            });
+            proEconPowerstationInfoDay7Service.saveBatch(pjResultlist);
+
+
+            List<ProEconPowerstationInfoDay7> wpResultlist = new ArrayList<>();
+            wpls.stream().forEach(wp->{
+                List<ProEconEquipmentInfoDay6> equipmentInfoDay6s = list.stream().filter(i -> i.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
+                if (StringUtils.isNotEmpty(equipmentInfoDay6s)){
+                    double rxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRxtxl).average().getAsDouble();
+                    double yxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYxtxl).average().getAsDouble();
+                    double nxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNxtxl).average().getAsDouble();
+                    double rlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRlsl).average().getAsDouble();
+                    double ylsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYlsl).average().getAsDouble();
+                    double nlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNlsl).average().getAsDouble();
+                    double rzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRnbqzhxl).average().getAsDouble();
+                    double yzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYnbqzhxl).average().getAsDouble();
+                    double nzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNnbqzhxl).average().getAsDouble();
+                    ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = new ProEconPowerstationInfoDay7();
+                    proEconPowerstationInfoDay7.setId(CommonUtils.getUUID());
+                    proEconPowerstationInfoDay7.setForeignKeyId(wp.getId());
+                    proEconPowerstationInfoDay7.setRecordDate(date);
+                    proEconPowerstationInfoDay7.setWindpowerstationId(wp.getId());
+                    proEconPowerstationInfoDay7.setCompanyId(wp.getCompanyId());
+                    proEconPowerstationInfoDay7.setRegionId(wp.getRegionId());
+                    proEconPowerstationInfoDay7.setLocation("wp");
+                    proEconPowerstationInfoDay7.setRxtxlpr(DoubleUtils.keepPrecision(rxtxl,2));
+                    proEconPowerstationInfoDay7.setYxtxlpr(DoubleUtils.keepPrecision(yxtxl,2));
+                    proEconPowerstationInfoDay7.setNxtxlpr(DoubleUtils.keepPrecision(nxtxl,2));
+                    proEconPowerstationInfoDay7.setRlsl(DoubleUtils.keepPrecision(rlsl,2));
+                    proEconPowerstationInfoDay7.setYlsl(DoubleUtils.keepPrecision(ylsl,2));
+                    proEconPowerstationInfoDay7.setNlsl(DoubleUtils.keepPrecision(nlsl,2));
+                    proEconPowerstationInfoDay7.setRnbqzhxl(DoubleUtils.keepPrecision(rzhxl,2));
+                    proEconPowerstationInfoDay7.setYnbqzhxl(DoubleUtils.keepPrecision(yzhxl,2));
+                    proEconPowerstationInfoDay7.setNnbqzhxl(DoubleUtils.keepPrecision(nzhxl,2));
+                    wpResultlist.add(proEconPowerstationInfoDay7);
+                }
+            });
+            proEconPowerstationInfoDay7Service.saveBatch(wpResultlist);
+
+
+            List<ProEconPowerstationInfoDay7> cp0Resultlist = new ArrayList<>();
+            cpls.stream().forEach(cp->{
+                List<ProEconEquipmentInfoDay6> equipmentInfoDay6s = list.stream().filter(i -> i.getCompanyId().equals(cp.getId())).collect(Collectors.toList());
+                if (StringUtils.isNotEmpty(equipmentInfoDay6s)){
+                    double rxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRxtxl).average().getAsDouble();
+                    double yxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYxtxl).average().getAsDouble();
+                    double nxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNxtxl).average().getAsDouble();
+                    double rlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRlsl).average().getAsDouble();
+                    double ylsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYlsl).average().getAsDouble();
+                    double nlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNlsl).average().getAsDouble();
+                    double rzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRnbqzhxl).average().getAsDouble();
+                    double yzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYnbqzhxl).average().getAsDouble();
+                    double nzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNnbqzhxl).average().getAsDouble();
+                    ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = new ProEconPowerstationInfoDay7();
+                    proEconPowerstationInfoDay7.setId(CommonUtils.getUUID());
+                    proEconPowerstationInfoDay7.setForeignKeyId(cp.getId()+"0");
+                    proEconPowerstationInfoDay7.setRecordDate(date);
+                    proEconPowerstationInfoDay7.setCompanyId(cp.getId());
+                    proEconPowerstationInfoDay7.setRegionId(cp.getRegionId());
+                    proEconPowerstationInfoDay7.setLocation("cp");
+                    proEconPowerstationInfoDay7.setRxtxlpr(DoubleUtils.keepPrecision(rxtxl,2));
+                    proEconPowerstationInfoDay7.setYxtxlpr(DoubleUtils.keepPrecision(yxtxl,2));
+                    proEconPowerstationInfoDay7.setNxtxlpr(DoubleUtils.keepPrecision(nxtxl,2));
+                    proEconPowerstationInfoDay7.setRlsl(DoubleUtils.keepPrecision(rlsl,2));
+                    proEconPowerstationInfoDay7.setYlsl(DoubleUtils.keepPrecision(ylsl,2));
+                    proEconPowerstationInfoDay7.setNlsl(DoubleUtils.keepPrecision(nlsl,2));
+                    proEconPowerstationInfoDay7.setRnbqzhxl(DoubleUtils.keepPrecision(rzhxl,2));
+                    proEconPowerstationInfoDay7.setYnbqzhxl(DoubleUtils.keepPrecision(yzhxl,2));
+                    proEconPowerstationInfoDay7.setNnbqzhxl(DoubleUtils.keepPrecision(nzhxl,2));
+                    cp0Resultlist.add(proEconPowerstationInfoDay7);
+                }
+            });
+            proEconPowerstationInfoDay7Service.saveBatch(cp0Resultlist);
+
+            List<ProEconPowerstationInfoDay7> cp2Resultlist = new ArrayList<>();
+            cpls.stream().forEach(cp->{
+                List<ProEconEquipmentInfoDay6> equipmentInfoDay6s = list.stream().filter(i -> i.getCompanyId().equals(cp.getId())).collect(Collectors.toList());
+                if (StringUtils.isNotEmpty(equipmentInfoDay6s)){
+                    double rxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRxtxl).average().getAsDouble();
+                    double yxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYxtxl).average().getAsDouble();
+                    double nxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNxtxl).average().getAsDouble();
+                    double rlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRlsl).average().getAsDouble();
+                    double ylsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYlsl).average().getAsDouble();
+                    double nlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNlsl).average().getAsDouble();
+                    double rzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRnbqzhxl).average().getAsDouble();
+                    double yzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYnbqzhxl).average().getAsDouble();
+                    double nzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNnbqzhxl).average().getAsDouble();
+                    ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = new ProEconPowerstationInfoDay7();
+                    proEconPowerstationInfoDay7.setId(CommonUtils.getUUID());
+                    proEconPowerstationInfoDay7.setForeignKeyId(cp.getId()+"-2");
+                    proEconPowerstationInfoDay7.setRecordDate(date);
+                    proEconPowerstationInfoDay7.setCompanyId(cp.getId());
+                    proEconPowerstationInfoDay7.setRegionId(cp.getRegionId());
+                    proEconPowerstationInfoDay7.setLocation("cp");
+                    proEconPowerstationInfoDay7.setRxtxlpr(DoubleUtils.keepPrecision(rxtxl,2));
+                    proEconPowerstationInfoDay7.setYxtxlpr(DoubleUtils.keepPrecision(yxtxl,2));
+                    proEconPowerstationInfoDay7.setNxtxlpr(DoubleUtils.keepPrecision(nxtxl,2));
+                    proEconPowerstationInfoDay7.setRlsl(DoubleUtils.keepPrecision(rlsl,2));
+                    proEconPowerstationInfoDay7.setYlsl(DoubleUtils.keepPrecision(ylsl,2));
+                    proEconPowerstationInfoDay7.setNlsl(DoubleUtils.keepPrecision(nlsl,2));
+                    proEconPowerstationInfoDay7.setRnbqzhxl(DoubleUtils.keepPrecision(rzhxl,2));
+                    proEconPowerstationInfoDay7.setYnbqzhxl(DoubleUtils.keepPrecision(yzhxl,2));
+                    proEconPowerstationInfoDay7.setNnbqzhxl(DoubleUtils.keepPrecision(nzhxl,2));
+                    cp2Resultlist.add(proEconPowerstationInfoDay7);
+                }
+            });
+            proEconPowerstationInfoDay7Service.saveBatch(cp2Resultlist);
+
+            List<ProEconPowerstationInfoDay7> rp0Resultlist = new ArrayList<>();
+            rgls.stream().forEach(rg->{
+                List<ProEconEquipmentInfoDay6> equipmentInfoDay6s = list.stream().filter(i -> i.getRegionId().equals(rg.getId())).collect(Collectors.toList());
+                if (StringUtils.isNotEmpty(equipmentInfoDay6s)){
+                    double rxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRxtxl).average().getAsDouble();
+                    double yxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYxtxl).average().getAsDouble();
+                    double nxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNxtxl).average().getAsDouble();
+                    double rlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRlsl).average().getAsDouble();
+                    double ylsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYlsl).average().getAsDouble();
+                    double nlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNlsl).average().getAsDouble();
+                    double rzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRnbqzhxl).average().getAsDouble();
+                    double yzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYnbqzhxl).average().getAsDouble();
+                    double nzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNnbqzhxl).average().getAsDouble();
+                    ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = new ProEconPowerstationInfoDay7();
+                    proEconPowerstationInfoDay7.setId(CommonUtils.getUUID());
+                    proEconPowerstationInfoDay7.setForeignKeyId(rg.getId()+"0");
+                    proEconPowerstationInfoDay7.setRecordDate(date);
+                    proEconPowerstationInfoDay7.setRegionId(rg.getId());
+                    proEconPowerstationInfoDay7.setLocation("rg");
+                    proEconPowerstationInfoDay7.setRxtxlpr(DoubleUtils.keepPrecision(rxtxl,2));
+                    proEconPowerstationInfoDay7.setYxtxlpr(DoubleUtils.keepPrecision(yxtxl,2));
+                    proEconPowerstationInfoDay7.setNxtxlpr(DoubleUtils.keepPrecision(nxtxl,2));
+                    proEconPowerstationInfoDay7.setRlsl(DoubleUtils.keepPrecision(rlsl,2));
+                    proEconPowerstationInfoDay7.setYlsl(DoubleUtils.keepPrecision(ylsl,2));
+                    proEconPowerstationInfoDay7.setNlsl(DoubleUtils.keepPrecision(nlsl,2));
+                    proEconPowerstationInfoDay7.setRnbqzhxl(DoubleUtils.keepPrecision(rzhxl,2));
+                    proEconPowerstationInfoDay7.setYnbqzhxl(DoubleUtils.keepPrecision(yzhxl,2));
+                    proEconPowerstationInfoDay7.setNnbqzhxl(DoubleUtils.keepPrecision(nzhxl,2));
+                    rp0Resultlist.add(proEconPowerstationInfoDay7);
+                }
+            });
+            proEconPowerstationInfoDay7Service.saveBatch(rp0Resultlist);
+
+            List<ProEconPowerstationInfoDay7> rp2Resultlist = new ArrayList<>();
+            rgls.stream().forEach(rg->{
+                List<ProEconEquipmentInfoDay6> equipmentInfoDay6s = list.stream().filter(i -> i.getRegionId().equals(rg.getId())).collect(Collectors.toList());
+                if (StringUtils.isNotEmpty(equipmentInfoDay6s)){
+                    double rxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRxtxl).average().getAsDouble();
+                    double yxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYxtxl).average().getAsDouble();
+                    double nxtxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNxtxl).average().getAsDouble();
+                    double rlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRlsl).average().getAsDouble();
+                    double ylsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYlsl).average().getAsDouble();
+                    double nlsl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNlsl).average().getAsDouble();
+                    double rzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getRnbqzhxl).average().getAsDouble();
+                    double yzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getYnbqzhxl).average().getAsDouble();
+                    double nzhxl = equipmentInfoDay6s.stream().mapToDouble(ProEconEquipmentInfoDay6::getNnbqzhxl).average().getAsDouble();
+                    ProEconPowerstationInfoDay7 proEconPowerstationInfoDay7 = new ProEconPowerstationInfoDay7();
+                    proEconPowerstationInfoDay7.setId(CommonUtils.getUUID());
+                    proEconPowerstationInfoDay7.setForeignKeyId(rg.getId()+"-2");
+                    proEconPowerstationInfoDay7.setRecordDate(date);
+                    proEconPowerstationInfoDay7.setRegionId(rg.getId());
+                    proEconPowerstationInfoDay7.setLocation("rg");
+                    proEconPowerstationInfoDay7.setRxtxlpr(DoubleUtils.keepPrecision(rxtxl,2));
+                    proEconPowerstationInfoDay7.setYxtxlpr(DoubleUtils.keepPrecision(yxtxl,2));
+                    proEconPowerstationInfoDay7.setNxtxlpr(DoubleUtils.keepPrecision(nxtxl,2));
+                    proEconPowerstationInfoDay7.setRlsl(DoubleUtils.keepPrecision(rlsl,2));
+                    proEconPowerstationInfoDay7.setYlsl(DoubleUtils.keepPrecision(ylsl,2));
+                    proEconPowerstationInfoDay7.setNlsl(DoubleUtils.keepPrecision(nlsl,2));
+                    proEconPowerstationInfoDay7.setRnbqzhxl(DoubleUtils.keepPrecision(rzhxl,2));
+                    proEconPowerstationInfoDay7.setYnbqzhxl(DoubleUtils.keepPrecision(yzhxl,2));
+                    proEconPowerstationInfoDay7.setNnbqzhxl(DoubleUtils.keepPrecision(nzhxl,2));
+                    rp2Resultlist.add(proEconPowerstationInfoDay7);
+                }
+            });
+            proEconPowerstationInfoDay7Service.saveBatch(rp2Resultlist);
+
+        });
+    }
+
+}

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

@@ -0,0 +1,16 @@
+package com.gyee.generation.service.auto;
+
+import com.gyee.generation.model.auto.ProBasicBranch;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author xieshengjie
+ * @since 2023-03-15
+ */
+public interface IProBasicBranchService extends IService<ProBasicBranch> {
+
+}

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

@@ -5,11 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
 
 /**
  * <p>
- * 离散率转换效率 服务类
+ *  服务类
  * </p>
  *
- * @author shilin
- * @since 2022-11-01
+ * @author xieshengjie
+ * @since 2023-03-15
  */
 public interface IProEconEquipmentInfoDay6Service extends IService<ProEconEquipmentInfoDay6> {
 

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

@@ -0,0 +1,20 @@
+package com.gyee.generation.service.auto.impl;
+
+import com.gyee.generation.model.auto.ProBasicBranch;
+import com.gyee.generation.mapper.auto.ProBasicBranchMapper;
+import com.gyee.generation.service.auto.IProBasicBranchService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author xieshengjie
+ * @since 2023-03-15
+ */
+@Service
+public class ProBasicBranchServiceImpl extends ServiceImpl<ProBasicBranchMapper, ProBasicBranch> implements IProBasicBranchService {
+
+}

+ 3 - 3
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProEconEquipmentInfoDay6ServiceImpl.java

@@ -8,11 +8,11 @@ import org.springframework.stereotype.Service;
 
 /**
  * <p>
- * 离散率转换效率 服务实现类
+ *  服务实现类
  * </p>
  *
- * @author shilin
- * @since 2022-11-01
+ * @author xieshengjie
+ * @since 2023-03-15
  */
 @Service
 public class ProEconEquipmentInfoDay6ServiceImpl extends ServiceImpl<ProEconEquipmentInfoDay6Mapper, ProEconEquipmentInfoDay6> implements IProEconEquipmentInfoDay6Service {

+ 21 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.generation.model.auto.*;
 import com.gyee.generation.service.auto.*;
+import com.gyee.generation.util.StringUtils;
 import com.gyee.generation.util.redis.RedisService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -51,6 +52,8 @@ public class CacheService {
     private IProBasicWeatherStationService proBasicWeatherStationService;
     @Resource
     private IProBasicSquareService proBasicSquareService;
+    @Resource
+    private IProBasicBranchService proBasicBranchService;
 
 
     public void initRedisCache(){
@@ -68,6 +71,22 @@ public class CacheService {
             redisService.set(i.getId(),s);
         });
 
+        log.info("--------------------------redisZL");
+        List<ProBasicBranch> branchList = proBasicBranchService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        if (StringUtils.isNotEmpty(branchList)){
+            branchList.stream().forEach(i->{
+                Map<String, ProBasicEquipmentPoint> codeaimap = new HashMap<>();
+                QueryWrapper<ProBasicEquipmentPoint> qw = new QueryWrapper<>();
+                qw.eq("windturbine_id",i.getId());
+                List<ProBasicEquipmentPoint> windturbinetestingpointai2List = windturbinetestingpointnewService.list(qw);
+                windturbinetestingpointai2List.stream().forEach(x->{
+                    codeaimap.put(x.getUniformCode(),x);
+                });
+                String s = JSONObject.toJSONString(codeaimap);
+                redisService.set(i.getId(),s);
+            });
+        }
+
         log.info("--------------------------redisSQ");
         List<ProBasicSquare> squareList = proBasicSquareService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
         squareList.stream().forEach(i->{
@@ -96,6 +115,8 @@ public class CacheService {
             redisService.set(i.getId(),s);
         });
 
+
+
         log.info("--------------------------redisPJ");
         List<ProBasicProject> projectList = projectService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
         projectList.stream().forEach(i->{

+ 0 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/TestService.java

@@ -7,7 +7,6 @@ import com.gyee.common.contant.Contant;
 import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
-import com.gyee.common.model.auto.Windturbine;
 import com.gyee.common.util.SortUtils;
 import com.gyee.common.vo.matrix.MatrixVo;
 import com.gyee.generation.init.CacheContext;

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

@@ -404,9 +404,9 @@ public class SaticSchedulePgTask {
 
         XxlJobHelper.log("等级评估统计调度程序执行开始!........");
         try {
-//            equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
-//            equipmentInfoDayTopService.calEquipmentInfoMonthTop(new Date());
-//            equipmentInfoDayTopService.calEquipmentInfoYearTop(new Date());
+            equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
+            equipmentInfoDayTopService.calEquipmentInfoMonthTop(new Date());
+            equipmentInfoDayTopService.calEquipmentInfoYearTop(new Date());
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -438,7 +438,7 @@ public class SaticSchedulePgTask {
 
         XxlJobHelper.log("分析数据统计调度程序执行开始!........");
         try {
-//            wtAlysisDayService.calEquipmentInfoDay(new Date());
+            wtAlysisDayService.calEquipmentInfoDay(new Date());
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 2 - 2
realtime/generationXK-service/src/test/java/com/gyee/generation/GenerationTest.java

@@ -62,10 +62,10 @@ public class GenerationTest {
     public void test2() throws Exception {
 
 //        electricityMeteringService.saveGenerationDatas();
-//        realtimeService.savaRealtimeTarget();
+        realtimeService.savaRealtimeTarget();
 //        cycleCalculationService.saveCyle();
 //        statusService.powerRationing();
-        statusService.statusReal();
+//        statusService.statusReal();
 //        statusService.calculateStatusNumber();
 //        regionCalService.companyCal();
 //        regionCalService.RegionCal();