Browse Source

切入切出接口,月度单机分析接口

shilin 2 years ago
parent
commit
49efa0e04b

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

@@ -1,13 +1,11 @@
 package com.gyee.generation;
 
-import com.gyee.generation.service.WtAlysisDayService;
+import com.gyee.generation.service.initalcache.CacheService;
 import com.gyee.generation.util.SpringUtils;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
-import java.util.Date;
-
 /**
  * @ClassName : GenerationMain
  * @Author : xieshengjie
@@ -122,6 +120,9 @@ public class GenerationMain {
 
 //        EquipmentInfoDayTopService equipmentInfoDayTopService= SpringUtils.getBean("equipmentInfoDayTopService");
 //        equipmentInfoDayTopService.calEquipmentInfoDayTop(new Date());
+//        equipmentInfoDayTopService.calEquipmentInfoMonthTop(new Date());
+//        equipmentInfoDayTopService.calEquipmentInfoYearTop(new Date());
+
 //        Calendar c=Calendar.getInstance();
 //        c.set(Calendar.MONTH,7);
 //        c.set(Calendar.DAY_OF_MONTH,31);
@@ -133,8 +134,8 @@ public class GenerationMain {
 //        System.out.println("执行用时"+ DateUtils.secondsDiff(date,end) +"秒");
 //        System.out.println("计算完成");
 //
-//        CacheService cacheService= SpringUtils.getBean("cacheService");
-//        cacheService.initRedisCache();
+        CacheService cacheService= SpringUtils.getBean("cacheService");
+        cacheService.initRedisCache();
 //
 //        PowerCurveFittingModelService powerCurveFittingModelService= SpringUtils.getBean("powerCurveFittingModelService");
 //        powerCurveFittingModelService.cureFittingModel();
@@ -142,8 +143,8 @@ public class GenerationMain {
 //        WindturbineGoodnessService windturbineGoodnessService= SpringUtils.getBean("windturbineGoodnessService");
 //        windturbineGoodnessService.calWindturbineGoodness(new Date());
 
-        WtAlysisDayService wtAlysisDayService= SpringUtils.getBean("wtAlysisDayService");
-        wtAlysisDayService.calEquipmentInfoDay(new Date());
-
+//        WtAlysisDayService wtAlysisDayService= SpringUtils.getBean("wtAlysisDayService");
+//        wtAlysisDayService.calEquipmentInfoDay(new Date());
+System.out.println("完成");
     }
 }

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

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

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

@@ -1,68 +1,68 @@
-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")
-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();
-    */
-
-
-}
+//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")
+//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();
+//    */
+//
+//
+//}

+ 37 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProEconWpwindDayInfoController.java

@@ -0,0 +1,37 @@
+package com.gyee.generation.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 1、日风向平均风速
+2、日风向最大风速
+3、日风向次数
+4、日风向频率
+5、日风向静风次数
+6、日风向静风频率
+7、月风向平均风速
+8、月风向最大风速
+9、月风向次数
+10、月风向频率
+11、月风向静风次数
+12、月风向静风频率
+13、年风向平均风速
+14、年风向最大风速
+15、年风向次数
+16、年风向频率
+17、年风向静风次数
+18、年风向静风频率 前端控制器
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-25
+ */
+@RestController
+@RequestMapping("//pro-econ-wpwind-day-info")
+public class ProEconWpwindDayInfoController {
+
+}

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

@@ -0,0 +1,33 @@
+package com.gyee.generation.mapper.auto;
+
+import com.gyee.generation.model.auto.ProEconWpwindDayInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 1、日风向平均风速
+2、日风向最大风速
+3、日风向次数
+4、日风向频率
+5、日风向静风次数
+6、日风向静风频率
+7、月风向平均风速
+8、月风向最大风速
+9、月风向次数
+10、月风向频率
+11、月风向静风次数
+12、月风向静风频率
+13、年风向平均风速
+14、年风向最大风速
+15、年风向次数
+16、年风向频率
+17、年风向静风次数
+18、年风向静风频率 Mapper 接口
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-25
+ */
+public interface ProEconWpwindDayInfoMapper extends BaseMapper<ProEconWpwindDayInfo> {
+
+}

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

@@ -95,4 +95,8 @@ public class ProEconWindturbineGoodness extends Model {
 
     private String companyId;
     private String types;
+
+    private Double daySpeed;
+    private Double monthSpeed;
+    private Double yearSpeed;
 }

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

@@ -0,0 +1,641 @@
+package com.gyee.generation.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDate;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 1、日风向平均风速
+2、日风向最大风速
+3、日风向次数
+4、日风向频率
+5、日风向静风次数
+6、日风向静风频率
+7、月风向平均风速
+8、月风向最大风速
+9、月风向次数
+10、月风向频率
+11、月风向静风次数
+12、月风向静风频率
+13、年风向平均风速
+14、年风向最大风速
+15、年风向次数
+16、年风向频率
+17、年风向静风次数
+18、年风向静风频率
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProEconWpwindDayInfo extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    private String windpowerstationid;
+
+    private LocalDate recorddate;
+
+    private BigDecimal ca;
+
+    private BigDecimal cb;
+
+    private BigDecimal cc;
+
+    private BigDecimal cd;
+
+    private BigDecimal cf;
+
+    private BigDecimal cg;
+
+    private BigDecimal e;
+
+    private BigDecimal ese;
+
+    private BigDecimal se;
+
+    private BigDecimal sse;
+
+    private BigDecimal s;
+
+    private BigDecimal ssw;
+
+    private BigDecimal sw;
+
+    private BigDecimal wsw;
+
+    private BigDecimal w;
+
+    private BigDecimal wnw;
+
+    private BigDecimal nw;
+
+    private BigDecimal nnw;
+
+    private BigDecimal n;
+
+    private BigDecimal nne;
+
+    private BigDecimal ne;
+
+    private BigDecimal ene;
+
+    private BigDecimal e2;
+
+    private BigDecimal ese2;
+
+    private BigDecimal se2;
+
+    private BigDecimal sse2;
+
+    private BigDecimal s2;
+
+    private BigDecimal ssw2;
+
+    private BigDecimal sw2;
+
+    private BigDecimal wsw2;
+
+    private BigDecimal w2;
+
+    private BigDecimal wnw2;
+
+    private BigDecimal nw2;
+
+    private BigDecimal nnw2;
+
+    private BigDecimal n2;
+
+    private BigDecimal nne2;
+
+    private BigDecimal ne2;
+
+    private BigDecimal ene2;
+
+    private BigDecimal e3;
+
+    private BigDecimal ese3;
+
+    private BigDecimal se3;
+
+    private BigDecimal sse3;
+
+    private BigDecimal s3;
+
+    private BigDecimal ssw3;
+
+    private BigDecimal sw3;
+
+    private BigDecimal wsw3;
+
+    private BigDecimal w3;
+
+    private BigDecimal wnw3;
+
+    private BigDecimal nw3;
+
+    private BigDecimal nnw3;
+
+    private BigDecimal n3;
+
+    private BigDecimal nne3;
+
+    private BigDecimal ne3;
+
+    private BigDecimal ene3;
+
+    private BigDecimal e4;
+
+    private BigDecimal ese4;
+
+    private BigDecimal se4;
+
+    private BigDecimal sse4;
+
+    private BigDecimal s4;
+
+    private BigDecimal ssw4;
+
+    private BigDecimal sw4;
+
+    private BigDecimal wsw4;
+
+    private BigDecimal w4;
+
+    private BigDecimal wnw4;
+
+    private BigDecimal nw4;
+
+    private BigDecimal nnw4;
+
+    private BigDecimal n4;
+
+    private BigDecimal nne4;
+
+    private BigDecimal ne4;
+
+    private BigDecimal ene4;
+
+    private BigDecimal e5;
+
+    private BigDecimal ese5;
+
+    private BigDecimal se5;
+
+    private BigDecimal sse5;
+
+    private BigDecimal s5;
+
+    private BigDecimal ssw5;
+
+    private BigDecimal sw5;
+
+    private BigDecimal wsw5;
+
+    private BigDecimal w5;
+
+    private BigDecimal wnw5;
+
+    private BigDecimal nw5;
+
+    private BigDecimal nnw5;
+
+    private BigDecimal n5;
+
+    private BigDecimal nne5;
+
+    private BigDecimal ne5;
+
+    private BigDecimal ene5;
+
+    private BigDecimal e6;
+
+    private BigDecimal ese6;
+
+    private BigDecimal se6;
+
+    private BigDecimal sse6;
+
+    private BigDecimal s6;
+
+    private BigDecimal ssw6;
+
+    private BigDecimal sw6;
+
+    private BigDecimal wsw6;
+
+    private BigDecimal w6;
+
+    private BigDecimal wnw6;
+
+    private BigDecimal nw6;
+
+    private BigDecimal nnw6;
+
+    private BigDecimal n6;
+
+    private BigDecimal nne6;
+
+    private BigDecimal ne6;
+
+    private BigDecimal ene6;
+
+    private BigDecimal e7;
+
+    private BigDecimal ese7;
+
+    private BigDecimal se7;
+
+    private BigDecimal sse7;
+
+    private BigDecimal s7;
+
+    private BigDecimal ssw7;
+
+    private BigDecimal sw7;
+
+    private BigDecimal wsw7;
+
+    private BigDecimal w7;
+
+    private BigDecimal wnw7;
+
+    private BigDecimal nw7;
+
+    private BigDecimal nnw7;
+
+    private BigDecimal n7;
+
+    private BigDecimal nne7;
+
+    private BigDecimal ne7;
+
+    private BigDecimal ene7;
+
+    private BigDecimal e8;
+
+    private BigDecimal ese8;
+
+    private BigDecimal se8;
+
+    private BigDecimal sse8;
+
+    private BigDecimal s8;
+
+    private BigDecimal ssw8;
+
+    private BigDecimal sw8;
+
+    private BigDecimal wsw8;
+
+    private BigDecimal w8;
+
+    private BigDecimal wnw8;
+
+    private BigDecimal nw8;
+
+    private BigDecimal nnw8;
+
+    private BigDecimal n8;
+
+    private BigDecimal nne8;
+
+    private BigDecimal ne8;
+
+    private BigDecimal ene8;
+
+    private BigDecimal e9;
+
+    private BigDecimal ese9;
+
+    private BigDecimal se9;
+
+    private BigDecimal sse9;
+
+    private BigDecimal s9;
+
+    private BigDecimal ssw9;
+
+    private BigDecimal sw9;
+
+    private BigDecimal wsw9;
+
+    private BigDecimal w9;
+
+    private BigDecimal wnw9;
+
+    private BigDecimal nw9;
+
+    private BigDecimal nnw9;
+
+    private BigDecimal n9;
+
+    private BigDecimal nne9;
+
+    private BigDecimal ne9;
+
+    private BigDecimal ene9;
+
+    private BigDecimal e10;
+
+    private BigDecimal ese10;
+
+    private BigDecimal se10;
+
+    private BigDecimal sse10;
+
+    private BigDecimal s10;
+
+    private BigDecimal ssw10;
+
+    private BigDecimal sw10;
+
+    private BigDecimal wsw10;
+
+    private BigDecimal w10;
+
+    private BigDecimal wnw10;
+
+    private BigDecimal nw10;
+
+    private BigDecimal nnw10;
+
+    private BigDecimal n10;
+
+    private BigDecimal nne10;
+
+    private BigDecimal ne10;
+
+    private BigDecimal ene10;
+
+    private BigDecimal e11;
+
+    private BigDecimal ese11;
+
+    private BigDecimal se11;
+
+    private BigDecimal sse11;
+
+    private BigDecimal s11;
+
+    private BigDecimal ssw11;
+
+    private BigDecimal sw11;
+
+    private BigDecimal wsw11;
+
+    private BigDecimal w11;
+
+    private BigDecimal wnw11;
+
+    private BigDecimal nw11;
+
+    private BigDecimal nnw11;
+
+    private BigDecimal n11;
+
+    private BigDecimal nne11;
+
+    private BigDecimal ne11;
+
+    private BigDecimal ene11;
+
+    private BigDecimal e12;
+
+    private BigDecimal ese12;
+
+    private BigDecimal se12;
+
+    private BigDecimal sse12;
+
+    private BigDecimal s12;
+
+    private BigDecimal ssw12;
+
+    private BigDecimal sw12;
+
+    private BigDecimal wsw12;
+
+    private BigDecimal w12;
+
+    private BigDecimal wnw12;
+
+    private BigDecimal nw12;
+
+    private BigDecimal nnw12;
+
+    private BigDecimal n12;
+
+    private BigDecimal nne12;
+
+    private BigDecimal ne12;
+
+    private BigDecimal ene12;
+
+    private BigDecimal e13;
+
+    private BigDecimal ese13;
+
+    private BigDecimal se13;
+
+    private BigDecimal sse13;
+
+    private BigDecimal s13;
+
+    private BigDecimal ssw13;
+
+    private BigDecimal sw13;
+
+    private BigDecimal wsw13;
+
+    private BigDecimal w13;
+
+    private BigDecimal wnw13;
+
+    private BigDecimal nw13;
+
+    private BigDecimal nnw13;
+
+    private BigDecimal n13;
+
+    private BigDecimal nne13;
+
+    private BigDecimal ne13;
+
+    private BigDecimal ene13;
+
+    private BigDecimal e14;
+
+    private BigDecimal ese14;
+
+    private BigDecimal se14;
+
+    private BigDecimal sse14;
+
+    private BigDecimal s14;
+
+    private BigDecimal ssw14;
+
+    private BigDecimal sw14;
+
+    private BigDecimal wsw14;
+
+    private BigDecimal w14;
+
+    private BigDecimal wnw14;
+
+    private BigDecimal nw14;
+
+    private BigDecimal nnw14;
+
+    private BigDecimal n14;
+
+    private BigDecimal nne14;
+
+    private BigDecimal ne14;
+
+    private BigDecimal ene14;
+
+    private BigDecimal e15;
+
+    private BigDecimal ese15;
+
+    private BigDecimal se15;
+
+    private BigDecimal sse15;
+
+    private BigDecimal s15;
+
+    private BigDecimal ssw15;
+
+    private BigDecimal sw15;
+
+    private BigDecimal wsw15;
+
+    private BigDecimal w15;
+
+    private BigDecimal wnw15;
+
+    private BigDecimal nw15;
+
+    private BigDecimal nnw15;
+
+    private BigDecimal n15;
+
+    private BigDecimal nne15;
+
+    private BigDecimal ne15;
+
+    private BigDecimal ene15;
+
+    private BigDecimal e16;
+
+    private BigDecimal ese16;
+
+    private BigDecimal se16;
+
+    private BigDecimal sse16;
+
+    private BigDecimal s16;
+
+    private BigDecimal ssw16;
+
+    private BigDecimal sw16;
+
+    private BigDecimal wsw16;
+
+    private BigDecimal w16;
+
+    private BigDecimal wnw16;
+
+    private BigDecimal nw16;
+
+    private BigDecimal nnw16;
+
+    private BigDecimal n16;
+
+    private BigDecimal nne16;
+
+    private BigDecimal ne16;
+
+    private BigDecimal ene16;
+
+    private BigDecimal e17;
+
+    private BigDecimal ese17;
+
+    private BigDecimal se17;
+
+    private BigDecimal sse17;
+
+    private BigDecimal s17;
+
+    private BigDecimal ssw17;
+
+    private BigDecimal sw17;
+
+    private BigDecimal wsw17;
+
+    private BigDecimal w17;
+
+    private BigDecimal wnw17;
+
+    private BigDecimal nw17;
+
+    private BigDecimal nnw17;
+
+    private BigDecimal n17;
+
+    private BigDecimal nne17;
+
+    private BigDecimal ne17;
+
+    private BigDecimal ene17;
+
+    private BigDecimal e18;
+
+    private BigDecimal ese18;
+
+    private BigDecimal se18;
+
+    private BigDecimal sse18;
+
+    private BigDecimal s18;
+
+    private BigDecimal ssw18;
+
+    private BigDecimal sw18;
+
+    private BigDecimal wsw18;
+
+    private BigDecimal w18;
+
+    private BigDecimal wnw18;
+
+    private BigDecimal nw18;
+
+    private BigDecimal nnw18;
+
+    private BigDecimal n18;
+
+    private BigDecimal nne18;
+
+    private BigDecimal ne18;
+
+    private BigDecimal ene18;
+
+    private BigDecimal ch;
+
+    private BigDecimal ci;
+
+    private BigDecimal cj;
+
+
+}

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

@@ -80,7 +80,7 @@ public class EquipmentInfoDayTopService {
                 ProEconEquipmentInfoDayTop top =topls.get(i);
                 top.setDayRank(i+1);
             }
-
+            proEconEquipmentInfoDayTopService.saveBatch(topls);
         }
 
     }
@@ -206,7 +206,7 @@ public class EquipmentInfoDayTopService {
         peeidt.setRecordDate(DateUtils.truncate(recordDate));
         peeidt.setYear(DateUtils.getYear(recordDate));
         peeidt.setMonth(DateUtils.getMonth(recordDate) + 1);
-
+        initial(peeidt);
         List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
                 .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
                         && i.getWindturbineId().equals(wt.getId())
@@ -326,7 +326,7 @@ public class EquipmentInfoDayTopService {
         peeidt.setRecordDate(DateUtils.truncate(recordDate));
         peeidt.setYear(DateUtils.getYear(recordDate));
         peeidt.setMonth(DateUtils.getMonth(recordDate) + 1);
-
+        initial(peeidt);
         List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
                 .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
                         && i.getWindturbineId().equals(wt.getId())
@@ -446,7 +446,7 @@ public class EquipmentInfoDayTopService {
         peeidt.setRecordDate(DateUtils.truncate(recordDate));
         peeidt.setYear(DateUtils.getYear(recordDate));
         peeidt.setMonth(DateUtils.getMonth(recordDate) + 1);
-
+        initial(peeidt);
         List<ProEconEquipmentInfoDay1> pepid1ls = proEconEquipmentInfoDay1Service.list().stream()
                 .filter(i -> i.getRecordDate().compareTo(DateUtils.truncate(recordDate)) == 0
                         && i.getWindturbineId().equals(wt.getId())
@@ -1141,6 +1141,321 @@ public class EquipmentInfoDayTopService {
 
         return filedls;
     }
+
+    private void initial(ProEconEquipmentInfoDayTop po)
+    {
+        /**
+         * 发电量
+         */
+        po.setDayfdl(0.0);
+
+        /**
+         * 发电量月
+         */
+        po.setMonthfdl(0.0);
+
+        /**
+         * 发电量年
+         */
+        po.setYearfdl(0.0);
+
+        /**
+         * 理论发电量
+         */
+        po.setDayllfdl(0.0);
+
+        /**
+         * 理论发电量月
+         */
+        po.setMonthllfdl(0.0);
+
+        /**
+         * 理论发电量年
+         */
+        po.setYearllfdl(0.0);
+
+        /**
+         * 平均风速
+         */
+        po.setDayfs(0.0);
+
+        /**
+         * 月平均风速
+         */
+        po.setMonthfs(0.0);
+
+        /**
+         * 年平均风速
+         */
+        po.setYearfs(0.0);
+
+        /**
+         * 平均功率
+         */
+        po.setDaygl(0.0);
+
+        /**
+         * 月平均功率
+         */
+        po.setMonthgl(0.0);
+
+        /**
+         * 年平均功率
+         */
+        po.setYeargl(0.0);
+
+        /**
+         * 故障损失电量
+         */
+        po.setDaygzssdl(0.0);
+
+        /**
+         * 月故障损失电量
+         */
+        po.setMonthgzssdl(0.0);
+
+        /**
+         * 年故障损失电量
+         */
+        po.setYeargzssdl(0.0);
+
+        /**
+         * 日限电损失电量
+         */
+        po.setDayxdssdl(0.0);
+
+        /**
+         * 月限电损失电量
+         */
+        po.setMonthxdssdl(0.0);
+
+        /**
+         * 年限电损失电量
+         */
+        po.setYearxdssdl(0.0);
+
+        /**
+         * 日维护损失电量
+         */
+        po.setDaywhssdl(0.0);
+
+        /**
+         * 月维护损失电量
+         */
+        po.setMonthwhssdl(0.0);
+
+        /**
+         * 年维护损失电量
+         */
+        po.setYearwhssdl(0.0);
+
+        /**
+         * 日性能损失电量
+         */
+        po.setDayxnssdl(0.0);
+
+        /**
+         * 月性能损失电量
+         */
+        po.setMonthxnssdl(0.0);
+
+        /**
+         * 年性能损失电量
+         */
+        po.setYearxnssdl(0.0);
+
+        /**
+         * 日故障时间
+         */
+        po.setDaygzsj(0.0);
+
+        /**
+         * 月故障时间
+         */
+        po.setMonthgzsj(0.0);
+
+        /**
+         * 年故障时间
+         */
+        po.setYeargzsj(0.0);
+
+        /**
+         * 日维护时间
+         */
+        po.setDaywhsj(0.0);
+
+        /**
+         * 月维护时间
+         */
+        po.setMonthwhsj(0.0);
+
+        /**
+         * 年维护时间
+         */
+        po.setYearwhsj(0.0);
+
+        /**
+         * 日运行时间
+         */
+        po.setDayyxsj(0.0);
+
+        /**
+         * 月运行时间
+         */
+        po.setMonthyxsj(0.0);
+
+        /**
+         * 年运行时间
+         */
+        po.setYearyxsj(0.0);
+
+        /**
+         * 日停机时间
+         */
+        po.setDaytjsj(0.0);
+
+        /**
+         * 月停机时间
+         */
+        po.setMonthtjsj(0.0);
+
+        /**
+         * 年停机时间
+         */
+        po.setYeartjsj(0.0);
+
+        /**
+         * 日利用小时数
+         */
+        po.setDaylyxs(0.0);
+
+        /**
+         * 月利用小时数
+         */
+        po.setMonthlyxs(0.0);
+
+        /**
+         * 年利用小时数
+         */
+        po.setYearlyxs(0.0);
+
+        /**
+         * 日拟合优度
+         */
+        po.setDaynhyd(0.0);
+
+        /**
+         * 月拟合优度
+         */
+        po.setMonthnhyd(0.0);
+
+        /**
+         * 年拟合优度
+         */
+        po.setYearnhyd(0.0);
+
+        /**
+         * 日设备可利用率
+         */
+        po.setDaysbklyl(0.0);
+
+        /**
+         * 月设备可利用率
+         */
+        po.setMonthsbklyl(0.0);
+
+        /**
+         * 年设备可利用率
+         */
+        po.setYearsbklyl(0.0);
+
+        /**
+         * 日等效可用系数
+         */
+        po.setDaydxkyxs(0.0);
+
+        /**
+         * 月等效可用系数
+         */
+        po.setMonthdxkyxs(0.0);
+
+        /**
+         * 年等效可用系数
+         */
+        po.setYeardxkyxs(0.0);
+
+        /**
+         * 有效风时数
+         */
+        po.setDayyxfss(0.0);
+
+        /**
+         * 月有效风时数
+         */
+        po.setMonthyxfss(0.0);
+
+        /**
+         * 年有效风时数
+         */
+        po.setYearyxfss(0.0);
+
+        /**
+         * 日小风切入
+         */
+        po.setDayxfqr(0.0);
+
+        /**
+         * 月小风切入
+         */
+        po.setMonthxfqr(0.0);
+
+        /**
+         * 年小风切入
+         */
+        po.setYearxfqr(0.0);
+
+        /**
+         * 日静风频率
+         */
+        po.setDayjfpl(0.0);
+
+        /**
+         * 月静风频率
+         */
+        po.setMonthjfpl(0.0);
+
+        /**
+         * 年静风频率
+         */
+        po.setYearjfpl(0.0);
+
+        /**
+         * 日功率一致性系数
+         */
+        po.setDayglyzxxs(0.0);
+
+        /**
+         * 月功率一致性系数
+         */
+        po.setMonthglyzxxs(0.0);
+
+        /**
+         * 年功率一致性系数
+         */
+        po.setYearglyzxxs(0.0);
+
+
+        /**
+         * 综合排名
+         */
+        po.setDayRank(0);
+
+
+        /**
+         * 分数
+         */
+        po.setDayScore(0.0);
+    }
 }
 
 

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

@@ -3,7 +3,9 @@ package com.gyee.generation.service;
 
 import com.gyee.generation.init.CacheContext;
 import com.gyee.generation.model.auto.ProBasicEquipment;
+import com.gyee.generation.model.auto.ProEconEquipmentInfoDay1;
 import com.gyee.generation.model.auto.ProEconWindturbineGoodness;
+import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
 import com.gyee.generation.service.auto.IProEconWindturbineGoodnessService;
 import com.gyee.generation.util.DateUtils;
 import org.springframework.stereotype.Service;
@@ -22,6 +24,10 @@ public class WindturbineGoodnessService {
     @Resource
     private IProEconWindturbineGoodnessService proEconWindturbineGoodnessService;
 
+    @Resource
+    private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
+
+
     public void calWindturbineGoodness(Date recordDate) throws Exception {
 
 
@@ -44,14 +50,21 @@ public class WindturbineGoodnessService {
         for(ProBasicEquipment wt: CacheContext.wtls)
         {
 
-            Map<String, Map<String, Double>> coefficientMap=coefficientService.coefficient(wt.getId(),recordDate);
-            Map<String, Map<String,Double>> fitMap=goodnessOfFitService.goodnessOfFit(wt.getId(),recordDate);
+            Map<String, Map<String, Double>> coefficientMap=coefficientService.coefficient(wt.getId(),DateUtils.truncate(recordDate));
+            Map<String, Map<String,Double>> fitMap=goodnessOfFitService.goodnessOfFit(wt.getId(),DateUtils.truncate(recordDate));
+
+          List<ProEconEquipmentInfoDay1> day1ls=  proEconEquipmentInfoDay1Service.list().stream().filter(i->
+                    i.getWindturbineId().equals(wt.getId())
+            && i.getRecordDate().compareTo(DateUtils.truncate(recordDate))==0
+            ).collect(Collectors.toList());
+
             ProEconWindturbineGoodness po=new ProEconWindturbineGoodness();
             po.setModelId(wt.getModelId());
             po.setWindturbineId(wt.getId());
             po.setRecordDate(DateUtils.truncate(recordDate));
             po.setWindtpowerstationId(wt.getWindpowerstationId());
             po.setCompanyId(wt.getCompanyId());
+
             if(wt.getWindpowerstationId().contains("FDC"))
             {
                 po.setTypes("-1");
@@ -65,6 +78,16 @@ public class WindturbineGoodnessService {
             po.setDayCoefficient(0.0);
             po.setMonthCoefficient(0.0);
             po.setYearCoefficient(0.0);
+            po.setDaySpeed(0.0);
+            po.setMonthSpeed(0.0);
+            po.setYearSpeed(0.0);
+
+            if(!day1ls.isEmpty())
+            {
+                po.setDaySpeed(day1ls.get(0).getRpjfs());
+                po.setMonthSpeed(day1ls.get(0).getYpjfs());
+                po.setYearSpeed(day1ls.get(0).getYpjfs());
+            }
             if(fitMap.containsKey(wt.getId()))
             {
                 Map<String, Double> map=fitMap.get(wt.getId());

+ 33 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProEconWpwindDayInfoService.java

@@ -0,0 +1,33 @@
+package com.gyee.generation.service.auto;
+
+import com.gyee.generation.model.auto.ProEconWpwindDayInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 1、日风向平均风速
+2、日风向最大风速
+3、日风向次数
+4、日风向频率
+5、日风向静风次数
+6、日风向静风频率
+7、月风向平均风速
+8、月风向最大风速
+9、月风向次数
+10、月风向频率
+11、月风向静风次数
+12、月风向静风频率
+13、年风向平均风速
+14、年风向最大风速
+15、年风向次数
+16、年风向频率
+17、年风向静风次数
+18、年风向静风频率 服务类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-25
+ */
+public interface IProEconWpwindDayInfoService extends IService<ProEconWpwindDayInfo> {
+
+}

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

@@ -0,0 +1,37 @@
+package com.gyee.generation.service.auto.impl;
+
+import com.gyee.generation.model.auto.ProEconWpwindDayInfo;
+import com.gyee.generation.mapper.auto.ProEconWpwindDayInfoMapper;
+import com.gyee.generation.service.auto.IProEconWpwindDayInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 1、日风向平均风速
+2、日风向最大风速
+3、日风向次数
+4、日风向频率
+5、日风向静风次数
+6、日风向静风频率
+7、月风向平均风速
+8、月风向最大风速
+9、月风向次数
+10、月风向频率
+11、月风向静风次数
+12、月风向静风频率
+13、年风向平均风速
+14、年风向最大风速
+15、年风向次数
+16、年风向频率
+17、年风向静风次数
+18、年风向静风频率 服务实现类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-25
+ */
+@Service
+public class ProEconWpwindDayInfoServiceImpl extends ServiceImpl<ProEconWpwindDayInfoMapper, ProEconWpwindDayInfo> implements IProEconWpwindDayInfoService {
+
+}

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

@@ -4,8 +4,7 @@ package com.gyee.generation.service.initalcache;/*
 */
 
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.gyee.generation.model.auto.*;
+import com.gyee.generation.model.auto.ProBasicModelPowerRd;
 import com.gyee.generation.service.auto.*;
 import com.gyee.generation.util.redis.RedisService;
 import lombok.extern.slf4j.Slf4j;
@@ -13,11 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 @Service
 @Slf4j
@@ -50,7 +47,7 @@ public class CacheService {
 
 
     public void initRedisCache(){
-//        log.info("--------------------------redisWT");
+        log.info("--------------------------redisWT");
 //        List<ProBasicEquipment> windturbineList = windturbineService.list().stream().filter(i->i.getIsable().equals(1)).collect(Collectors.toList());
 //        windturbineList.stream().forEach(i->{
 //            Map<String, ProBasicEquipmentPoint> codeaimap = new HashMap<>();
@@ -173,7 +170,8 @@ public class CacheService {
                 powerrdMap.put(powerrd.getModelId(),powerMap);
             }
         });
-        redisService.set("ZLLGL", JSONObject.toJSONString(powerrdMap));
+//        redisService.set("ZLLGL", JSONObject.toJSONString(powerrdMap));
+        redisService.set("ZLLGLLS", JSONObject.toJSONString(proBasicModelPowerRds));
 
 //        log.info("--------------------------redis十三种状态");
 //        Map<String,List<ProBasicStatusPoint>> sszztMap = new HashMap<>();

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

@@ -9,8 +9,8 @@ spring:
     allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
   #redis集群
   redis:
-    #host: 127.0.0.1
-    host: 192.168.11.250
+    host: 124.70.18.168
+    #host: 192.168.11.250
     port: 6379
     timeout: 100000
     #    集群环境打开下面注释,单机不需要打开
@@ -19,7 +19,7 @@ spring:
 #      nodes: 10.83.68.151:6379,10.83.68.152:6379,10.83.68.153:6379,10.83.68.154:6379,10.83.68.155:6379,10.83.68.156:6379,10.83.68.157:6379,10.83.68.158:6379,10.83.68.159:6379
 #      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
 #      maxRedirects: 3
-    password:
+    password: gdnxfd123
     application:
       name: test
     jedis:
@@ -28,18 +28,18 @@ spring:
         min-idle: 0
         max-idle: 8
         max-wait: -1
-    database: 9
+    database: 0
   autoconfigure:
     exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: org.postgresql.Driver
-    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD?rewriteBatchedStatements=true
+#    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD?rewriteBatchedStatements=true
+#    username: postgres
+#    password: postgres
+    url: jdbc:postgresql://124.70.75.91:5432/jn_test
     username: postgres
-    password: postgres
-#    url: jdbc:postgresql://120.46.148.180:5432/postgres
-#    username: gdprod
-#    password: gd123
+    password: gd123
     oracle-schema=:
     #    type: com.alibaba.druid.pool.DruidDataSource
     #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
@@ -87,8 +87,8 @@ logging:
     com.example: debug
 #db url
 db:
-  #url: http://127.0.0.1:8011/ts
-  url: http://192.168.11.250:8011/ts
+  url: http://127.0.0.1:8011/ts
+  #url: http://192.168.11.250:8011/ts
 #参与计算的场站
 #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