Browse Source

修改日信息表

xieshengjie 2 years ago
parent
commit
8e39b1da29
43 changed files with 1758 additions and 4 deletions
  1. 43 1
      histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/infoday/InfodayService.java
  2. 3 3
      histroy/benchmarking-histroy-new/src/test/java/com/gyee/benchmarkinghistroy/BenchmarkingHistroyMainNewTest.java
  3. 65 0
      web/gdsx-ghost/pom.xml
  4. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/GhostMain.java
  5. 26 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/config/CorsConfig.java
  6. 150 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/config/GeneratorCodeConfig.java
  7. 23 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/config/MybatisPlusConfig.java
  8. 71 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/config/R.java
  9. 12 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/config/ResultCode.java
  10. 87 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/config/ResultInfo.java
  11. 37 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/config/Status.java
  12. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/WindpowerstationController.java
  13. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/WindturbineController.java
  14. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/Windturbineinfoday3Controller.java
  15. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/WindturbineinfodayController.java
  16. 50 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ghost/GhostController.java
  17. 50 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/init/CacheContext.java
  18. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/FanoperationMapper.java
  19. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindpowerstationMapper.java
  20. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindturbineMapper.java
  21. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/Windturbineinfoday3Mapper.java
  22. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindturbineinfodayMapper.java
  23. 66 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Fanoperation.java
  24. 62 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windpowerstation.java
  25. 50 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windturbine.java
  26. 178 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windturbineinfoday.java
  27. 116 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windturbineinfoday3.java
  28. 131 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/GhostService.java
  29. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IFanoperationService.java
  30. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindpowerstationService.java
  31. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindturbineService.java
  32. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindturbineinfoday3Service.java
  33. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindturbineinfodayService.java
  34. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/FanoperationServiceImpl.java
  35. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindpowerstationServiceImpl.java
  36. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindturbineServiceImpl.java
  37. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/Windturbineinfoday3ServiceImpl.java
  38. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindturbineinfodayServiceImpl.java
  39. 41 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/task/SaticScheduleTask.java
  40. 109 0
      web/gdsx-ghost/src/main/resources/application-dev.yml
  41. 4 0
      web/gdsx-ghost/src/main/resources/application.yml
  42. 27 0
      web/gdsx-ghost/src/test/java/com/gyee/ghost/GhostTest.java
  43. 1 0
      web/pom.xml

+ 43 - 1
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/infoday/InfodayService.java

@@ -84,7 +84,7 @@ public class InfodayService {
                 double maxpower = 0;
                 double minpower = 0;
                 try {
-                    ztmxSnap = edosUtil.getHistoryDatasSnap(ztmxpoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, null, 60l);
+                    ztmxSnap = edosUtil.getHistoryDatasSnap(ztmxpoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, 1440l, 60l);
                     ssfsSnap = edosUtil.getHistoryDatasSnap(ssfsPoint, samedayZero.getTime() / 1000, addDays.getTime() / 1000, null, 60l);
                     scadafdl = edosUtil.getSectionData(fdlPoint, endOfDay.getTime()).getPointValueInDouble();
                     scadayfdl = edosUtil.getSectionData(yfdlPoint, endOfDay.getTime()).getPointValueInDouble();
@@ -256,6 +256,10 @@ public class InfodayService {
             delQW.eq("recorddate",DateUtils.parseDate(day));
             windpowerinfodayService.remove(delQW);
 
+            QueryWrapper<Windturbineinfoday> wtinfodayQW = new QueryWrapper<>();
+            wtinfodayQW.eq("recorddate",DateUtils.parseDate(day));
+            List<Windturbineinfoday> windturbineinfodayList = windturbineinfodayService.list(wtinfodayQW);
+
 
             lines.stream().forEach(line -> {
                 Map<String, Windpowerstationpointnew> linepointnewMap = lnPointmap.get(line.getId());
@@ -341,6 +345,20 @@ public class InfodayService {
                 windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
                 windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
                 windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
+
+
+                List<Windturbineinfoday> collect = windturbineinfodayList.stream().filter(windturbineinfoday -> CacheContext.wmap.get(windturbineinfoday.getWindturbineid()).getLineid().equals(line.getId())).collect(Collectors.toList());
+                Double runhours = collect.stream().mapToDouble((i) -> i.getRunhours()).summaryStatistics().getSum();
+                Double stophours = collect.stream().mapToDouble((i) -> i.getStophours()).summaryStatistics().getSum();
+                Double faulthours = collect.stream().mapToDouble((i) -> i.getFaulthours()).summaryStatistics().getSum();
+                Double maintainhours = collect.stream().mapToDouble((i) -> i.getMaintainhours()).summaryStatistics().getSum();
+                Double interrupthours = collect.stream().mapToDouble((i) -> i.getInterrupthours()).summaryStatistics().getSum();
+                windpowerinfoday.setRunhours(runhours);
+                windpowerinfoday.setStophours(stophours);
+                windpowerinfoday.setFaulthours(faulthours);
+                windpowerinfoday.setMaintainhours(maintainhours);
+                windpowerinfoday.setInterrupthours(interrupthours);
+
                 resultList.add(windpowerinfoday);
             });
 
@@ -428,6 +446,18 @@ public class InfodayService {
                 windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
                 windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
                 windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
+
+                List<Windturbineinfoday> collect = windturbineinfodayList.stream().filter(windturbineinfoday -> CacheContext.wmap.get(windturbineinfoday.getWindturbineid()).getProjectid().equals(project.getId())).collect(Collectors.toList());
+                Double runhours = collect.stream().mapToDouble((i) -> i.getRunhours()).summaryStatistics().getSum();
+                Double stophours = collect.stream().mapToDouble((i) -> i.getStophours()).summaryStatistics().getSum();
+                Double faulthours = collect.stream().mapToDouble((i) -> i.getFaulthours()).summaryStatistics().getSum();
+                Double maintainhours = collect.stream().mapToDouble((i) -> i.getMaintainhours()).summaryStatistics().getSum();
+                Double interrupthours = collect.stream().mapToDouble((i) -> i.getInterrupthours()).summaryStatistics().getSum();
+                windpowerinfoday.setRunhours(runhours);
+                windpowerinfoday.setStophours(stophours);
+                windpowerinfoday.setFaulthours(faulthours);
+                windpowerinfoday.setMaintainhours(maintainhours);
+                windpowerinfoday.setInterrupthours(interrupthours);
                 resultList.add(windpowerinfoday);
             });
             wplist.stream().forEach(wp -> {
@@ -514,6 +544,18 @@ public class InfodayService {
                 windpowerinfoday.setYearbe(DoubleUtils.keepPrecision(ngwgwdl,2));
                 windpowerinfoday.setMonthae(DoubleUtils.keepPrecision(ynwgwdl,2));
                 windpowerinfoday.setYearae(DoubleUtils.keepPrecision(nnwgwdl,2));
+
+                List<Windturbineinfoday> collect = windturbineinfodayList.stream().filter(windturbineinfoday -> CacheContext.wmap.get(windturbineinfoday.getWindturbineid()).getWindpowerstationid().equals(wp.getId())).collect(Collectors.toList());
+                Double runhours = collect.stream().mapToDouble((i) -> i.getRunhours()).summaryStatistics().getSum();
+                Double stophours = collect.stream().mapToDouble((i) -> i.getStophours()).summaryStatistics().getSum();
+                Double faulthours = collect.stream().mapToDouble((i) -> i.getFaulthours()).summaryStatistics().getSum();
+                Double maintainhours = collect.stream().mapToDouble((i) -> i.getMaintainhours()).summaryStatistics().getSum();
+                Double interrupthours = collect.stream().mapToDouble((i) -> i.getInterrupthours()).summaryStatistics().getSum();
+                windpowerinfoday.setRunhours(runhours);
+                windpowerinfoday.setStophours(stophours);
+                windpowerinfoday.setFaulthours(faulthours);
+                windpowerinfoday.setMaintainhours(maintainhours);
+                windpowerinfoday.setInterrupthours(interrupthours);
                 resultList.add(windpowerinfoday);
             });
             windpowerinfodayService.saveBatch(resultList);

+ 3 - 3
histroy/benchmarking-histroy-new/src/test/java/com/gyee/benchmarkinghistroy/BenchmarkingHistroyMainNewTest.java

@@ -45,10 +45,10 @@ public  class BenchmarkingHistroyMainNewTest {
 //        benchmarkingHistroyService.saveOperationrecord(date,date);
 //        benchmarkingHistroyService.saveBeanchmarkList(date,date);
 //        benchmarkingHistroyService.saveBenchmark(date,date);
-//        infodayService.saveWindturbineinfoday(date,date);
+        infodayService.saveWindturbineinfoday(date,date);
 //        infodayService.saveWindturbineinfoday3(date,date);
-        infodayService.saveWindpowerinfoday(date,date);
-        infodayService.saveWindpowerinfoday3(date,date);
+//        infodayService.saveWindpowerinfoday(date,date);
+//        infodayService.saveWindpowerinfoday3(date,date);
     }
 
     @Test

+ 65 - 0
web/gdsx-ghost/pom.xml

@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>web</artifactId>
+        <groupId>com.gyee</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gdsx-ghost</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>com.gyee</groupId>
+            <artifactId>common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.7</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/GhostMain.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost;/*
+@author   谢生杰
+@date   2022/8/3-15:24
+*/
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@MapperScan("com.gyee.ghost.mapper")
+public class GhostMain {
+    public static void main(String[] args) {
+        SpringApplication.run(GhostMain.class,args);
+    }
+}

+ 26 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/config/CorsConfig.java

@@ -0,0 +1,26 @@
+package com.gyee.ghost.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @ClassName : CorsConfig
+ * @Author : xieshengjie
+ * @Date: 2021/6/28 20:00
+ * @Description :
+ */
+@Configuration
+public class CorsConfig implements WebMvcConfigurer {
+
+    static final String[] ORIGINS = new String[]{"GET", "POST", "PUT", "DELETE"};  //请求方式
+
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**") //所有的当前站点的请求地址,都支持跨域访问
+                .allowedOrigins("*")// 所有的外部域都可跨域访问,这里注意2.4.0以后是allowedOriginPatterns,以前是allowedOrigins
+                .allowCredentials(true)  //是否支持跨域用户凭证
+                .allowedMethods(ORIGINS) //当前站点支持的跨域请求类型是什么
+                .maxAge(3600);  //超是时长,单位为秒。
+    }
+}

+ 150 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/config/GeneratorCodeConfig.java

@@ -0,0 +1,150 @@
+package com.gyee.ghost.config;
+
+
+import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+
+import java.util.Scanner;
+
+/**
+ *@ClassName GeneratorCodeConfig
+ *@Description 自动生成mybatisplus的相关代码
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:26
+ *@Version 1.0
+ **/
+public class GeneratorCodeConfig {
+    public static String scanner(String tip) {
+        Scanner scanner = new Scanner(System.in);
+        StringBuilder help = new StringBuilder();
+        help.append("请输入" + tip + ":");
+        System.out.println(help.toString());
+        if (scanner.hasNext()) {
+            String ipt = scanner.next();
+            if (StringUtils.isNotEmpty(ipt)) {
+                return ipt;
+            }
+        }
+        throw new MybatisPlusException("请输入正确的" + tip + "!");
+    }
+
+    public static void main(String[] args) {
+        // 代码生成器
+        AutoGenerator mpg = new AutoGenerator();
+
+        // 全局配置
+        GlobalConfig gc = new GlobalConfig();
+        String projectPath = System.getProperty("user.dir");
+        gc.setOutputDir(projectPath + "/src/main/java");
+        gc.setAuthor("谢生杰");
+        gc.setOpen(false);
+        //实体属性 Swagger2 注解
+        gc.setSwagger2(false);
+        mpg.setGlobalConfig(gc);
+
+        // 数据源配置
+        DataSourceConfig dsc = new DataSourceConfig();
+//        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true");
+//        dsc.setDriverName("com.mysql.jdbc.Driver");
+//        dsc.setUsername("root");
+//        dsc.setPassword("root");
+//        mpg.setDataSource(dsc);
+
+//        dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
+//        dsc.setUsername("gdprod");
+//        dsc.setPassword("gd123");
+//        dsc.setUrl("jdbc:oracle:thin:@10.83.68.165:1521:gdsj");
+//        mpg.setDataSource(dsc);
+
+        dsc.setDriverName("org.postgresql.Driver");
+        dsc.setUsername("gdprod");
+        dsc.setPassword("gd123");
+        dsc.setUrl("jdbc:postgresql://10.81.3.151:5432/wisdom");
+        mpg.setDataSource(dsc);
+
+
+
+        // 包配置
+        PackageConfig pc = new PackageConfig();
+//        pc.setModuleName(scanner("模块名"));
+        pc.setParent("com.gyee.ghost");
+        pc.setEntity("model.auto");
+        pc.setMapper("mapper.auto");
+        pc.setService("service.auto");
+        pc.setServiceImpl("service.auto.impl");
+        mpg.setPackageInfo(pc);
+
+        // 自定义配置
+//        InjectionConfig cfg = new InjectionConfig() {
+//            @Override
+//            public void initMap() {
+//                // to do nothing
+//            }
+//        };
+
+        // 如果模板引擎是 freemarker
+//        String templatePath = "/templates/mapper.xml.ftl";
+        // 如果模板引擎是 velocity
+        // String templatePath = "/templates/mapper.xml.vm";
+
+        // 自定义输出配置
+//        List<FileOutConfig> focList = new ArrayList<>();
+        // 自定义配置会被优先输出
+//        focList.add(new FileOutConfig(templatePath) {
+//            @Override
+//            public String outputFile(TableInfo tableInfo) {
+//                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
+//                return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
+//                        + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+//            }
+//        });
+        /*
+        cfg.setFileCreate(new IFileCreate() {
+            @Override
+            public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
+                // 判断自定义文件夹是否需要创建
+                checkDir("调用默认方法创建的目录");
+                return false;
+            }
+        });
+        */
+//        cfg.setFileOutConfigList(focList);
+//        mpg.setCfg(cfg);
+
+        // 配置模板
+        TemplateConfig templateConfig = new TemplateConfig();
+
+        // 配置自定义输出模板
+        //指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
+        // templateConfig.setEntity("templates/entity2.java");
+        // templateConfig.setService();
+        // templateConfig.setController();
+
+        templateConfig.setXml(null);
+        mpg.setTemplate(templateConfig);
+
+        // 策略配置
+        StrategyConfig strategy = new StrategyConfig();
+        strategy.setNaming(NamingStrategy.underline_to_camel);
+        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+        strategy.setSuperEntityClass("com.baomidou.mybatisplus.extension.activerecord.Model");
+        strategy.setEntityLombokModel(true);
+        strategy.setRestControllerStyle(true);
+
+        strategy.setEntityLombokModel(true);
+        // 公共父类
+//        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
+        // 写于父类中的公共字段
+//        strategy.setSuperEntityColumns("id");
+        strategy.setInclude(scanner("表名,多个英文逗号分割").split(","));
+        strategy.setControllerMappingHyphenStyle(true);
+        strategy.setTablePrefix(pc.getModuleName() + "_");
+        mpg.setStrategy(strategy);
+        mpg.setTemplateEngine(new FreemarkerTemplateEngine());
+        mpg.execute();
+    }
+}

+ 23 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/config/MybatisPlusConfig.java

@@ -0,0 +1,23 @@
+package com.gyee.ghost.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ *@ClassName MybatisPlusConfig
+ *@Description 配置分页插件
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:24
+ *@Version 1.0
+ **/
+@Configuration
+public class MybatisPlusConfig {
+    /**
+     * 分页插件
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        return new PaginationInterceptor();
+    }
+}

+ 71 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/config/R.java

@@ -0,0 +1,71 @@
+package com.gyee.ghost.config;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @ClassName : R
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 16:59
+ * @Description : 结果集
+ */
+@Data
+public class R {
+    @ApiModelProperty(value = "是否成功")
+    private Boolean success;
+    @ApiModelProperty(value = "返回码")
+    private Integer code;
+    @ApiModelProperty(value = "返回消息")
+    private String message;
+    @ApiModelProperty(value = "总数量")
+    private Integer count;
+    @ApiModelProperty(value = "返回数据")
+    private Object data = new Object();
+    private R(){}
+    public static R ok(){
+        R r = new R();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setMessage("成功");
+        return r;
+    }
+    public static R ok(Integer count){
+        R r = new R();
+        r.setSuccess(true);
+        r.setCode(ResultCode.SUCCESS);
+        r.setMessage("成功");
+        r.setCount(count);
+        return r;
+    }
+    public static R error(){
+        R r = new R();
+        r.setSuccess(false);
+        r.setCode(ResultCode.ERROR);
+        r.setMessage("失败");
+        return r;
+    }
+    public R success(Boolean success){
+        this.setSuccess(success);
+        return this;
+    }
+    public R message(String message){
+        this.setMessage(message);
+        return this;
+    }
+    public R code(Integer code){
+        this.setCode(code);
+        return this;
+    }
+//    public R data(String key, Object value){
+//        this.data.put(key, value);
+//        return this;
+//    }
+//    public R data(Map<String, Object> map){
+//        this.setData(map);
+//        return this;
+//    }
+    public R data(Object value){
+        this.setData(value);
+        return this;
+    }
+}

+ 12 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/config/ResultCode.java

@@ -0,0 +1,12 @@
+package com.gyee.ghost.config;
+
+/**
+ * @ClassName : ResultCode
+ * @Author : xieshengjie
+ * @Date: 2021/5/16 17:01
+ * @Description : 结果状态
+ */
+public class ResultCode {
+    public static Integer SUCCESS = 200;
+    public static Integer ERROR = 500;
+}

+ 87 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/config/ResultInfo.java

@@ -0,0 +1,87 @@
+package com.gyee.ghost.config;
+
+import lombok.Data;
+
+/**
+ *@ClassName ResultInfo
+ *@Description 返回结果类统一封装
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:53
+ *@Version 1.0
+ **/
+@Data
+public class ResultInfo {
+    // 状态码
+    private Integer code;
+    // 消息
+    private String message;
+    // 数据对象
+    private Object result;
+
+    private Integer total;
+
+    /**
+     * 无参构造器
+     */
+    public ResultInfo() {
+        super();
+    }
+
+    public ResultInfo(Status status) {
+        super();
+        this.code = status.code;
+        this.message = status.message;
+    }
+
+    public ResultInfo result(Object result) {
+        this.result = result;
+        return this;
+    }
+
+    public ResultInfo message(String message) {
+        this.message = message;
+        return this;
+    }
+    public ResultInfo total(Integer total) {
+        this.total = total;
+        return this;
+    }
+
+    /**
+     * 只返回状态,状态码,消息
+     *
+     * @param code
+     * @param message
+     */
+    public ResultInfo(Integer code, String message) {
+        super();
+        this.code = code;
+        this.message = message;
+    }
+
+    /**
+     * 只返回状态,状态码,数据对象
+     *
+     * @param code
+     * @param result
+     */
+    public ResultInfo(Integer code, Object result) {
+        super();
+        this.code = code;
+        this.result = result;
+    }
+
+    /**
+     * 返回全部信息即状态,状态码,消息,数据对象
+     *
+     * @param code
+     * @param message
+     * @param result
+     */
+    public ResultInfo(Integer code, String message, Object result) {
+        super();
+        this.code = code;
+        this.message = message;
+        this.result = result;
+    }
+}

+ 37 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/config/Status.java

@@ -0,0 +1,37 @@
+package com.gyee.ghost.config;
+/**
+ *@ClassName Status
+ *@Description 枚举类对象
+ *@Author 谢生杰
+ *@Date 2020/9/25 18:54
+ *@Version 1.0
+ **/
+public enum Status {
+    // 公共
+    SUCCESS(2000, "成功"),
+    UNKNOWN_ERROR(9998,"未知异常"),
+    SYSTEM_ERROR(9999, "系统异常"),
+
+
+    INSUFFICIENT_PERMISSION(4003, "权限不足"),
+
+    WARN(9000, "失败"),
+    REQUEST_PARAMETER_ERROR(1002, "请求参数错误"),
+
+    // 登录
+    LOGIN_EXPIRE(2001, "未登录或者登录失效"),
+    LOGIN_CODE_ERROR(2002, "登录验证码错误"),
+    LOGIN_ERROR(2003, "用户名不存在或密码错误"),
+    LOGIN_USER_STATUS_ERROR(2004, "用户状态不正确"),
+    LOGOUT_ERROR(2005, "退出失败,token不存在"),
+    LOGIN_USER_NOT_EXIST(2006, "该用户不存在"),
+    LOGIN_USER_EXIST(2007, "该用户已存在");
+
+    public int code;
+    public String message;
+
+    Status(int code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/WindpowerstationController.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@RestController
+@RequestMapping("//windpowerstation")
+public class WindpowerstationController {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/WindturbineController.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@RestController
+@RequestMapping("//windturbine")
+public class WindturbineController {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/Windturbineinfoday3Controller.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@RestController
+@RequestMapping("//windturbineinfoday3")
+public class Windturbineinfoday3Controller {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/WindturbineinfodayController.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@RestController
+@RequestMapping("//windturbineinfoday")
+public class WindturbineinfodayController {
+
+}

+ 50 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ghost/GhostController.java

@@ -0,0 +1,50 @@
+package com.gyee.ghost.controller.ghost;/*
+@author   谢生杰
+@date   2022/8/3-16:36
+*/
+
+import com.gyee.common.config.R;
+import com.gyee.common.model.StringUtils;
+import com.gyee.ghost.init.CacheContext;
+import com.gyee.ghost.model.auto.Fanoperation;
+import com.gyee.ghost.model.auto.Windpowerstation;
+import com.gyee.ghost.service.auto.GhostService;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@RestController
+@RequestMapping("//ghost")
+public class GhostController {
+
+    @Resource
+    private GhostService ghostService;
+
+    @GetMapping("/wplist")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R function(){
+        List<Windpowerstation> resultList = CacheContext.wpls;
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok((long) resultList.size()).data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+
+    @GetMapping("/function")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R function(
+            @RequestParam(value = "wpid",required = true)String wpid,
+            @RequestParam(value = "beginDate",required = true)String beginDate,
+            @RequestParam(value = "endDate",required = true)String endDate){
+        List<Fanoperation> resultList = ghostService.listFunction(wpid,beginDate,endDate);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok((long) resultList.size()).data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
+}

+ 50 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/init/CacheContext.java

@@ -0,0 +1,50 @@
+package com.gyee.ghost.init;
+
+
+
+import com.gyee.ghost.model.auto.Windpowerstation;
+import com.gyee.ghost.model.auto.Windturbine;
+import com.gyee.ghost.service.auto.IWindpowerstationService;
+import com.gyee.ghost.service.auto.IWindturbineService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @ClassName : CacheContext
+ * @Author : xieshengjie
+ * @Date: 2021/5/18 9:35
+ * @Description : 缓存
+ */
+@Component
+public class CacheContext implements CommandLineRunner {
+    Logger logger = LoggerFactory.getLogger(CacheContext.class);
+    @Resource
+    private IWindturbineService windturbineService;
+    @Resource
+    private IWindpowerstationService windpowerstationService;
+
+    public static List<Windturbine> wtls = new ArrayList<>();
+    public static Map<String,Windturbine> wtmap = new HashMap<>();
+
+    public static List<Windpowerstation> wpls = new ArrayList<>();
+
+
+    @Override
+    public void run(String... args) throws Exception {
+        wtls = windturbineService.list();
+        wtls.stream().forEach(wt->{
+            wtmap.put(wt.getId(),wt);
+        });
+
+        wpls = windpowerstationService.list();
+    }
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/FanoperationMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.gyee.ghost.model.auto.Fanoperation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface FanoperationMapper extends BaseMapper<Fanoperation> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindpowerstationMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.gyee.ghost.model.auto.Windpowerstation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface WindpowerstationMapper extends BaseMapper<Windpowerstation> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindturbineMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.gyee.ghost.model.auto.Windturbine;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface WindturbineMapper extends BaseMapper<Windturbine> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/Windturbineinfoday3Mapper.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.gyee.ghost.model.auto.Windturbineinfoday3;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface Windturbineinfoday3Mapper extends BaseMapper<Windturbineinfoday3> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/WindturbineinfodayMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.gyee.ghost.model.auto.Windturbineinfoday;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface WindturbineinfodayMapper extends BaseMapper<Windturbineinfoday> {
+
+}

+ 66 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Fanoperation.java

@@ -0,0 +1,66 @@
+package com.gyee.ghost.model.auto;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Fanoperation extends Model {
+
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "ID",type = IdType.INPUT)
+    private String id;
+
+    private String windturbineid;
+
+    private String windturbinename;
+
+    private String windpowerstationid;
+
+    private Double generatingcapacity;
+
+    private Double theoreticalcapacity;
+
+    private Double daynhgzssdl;
+
+    private Double daynhwhssdl;
+
+    private Double daynhxdssdl;
+
+    private Double daynhqfdl;
+
+    private Double daynhcfdl;
+
+    private Double availability;
+
+    private Double powerfactor;
+
+    private Double runtime;
+
+    private Double maintime;
+
+    private Double faulttime;
+
+    private Double stoptime;
+
+    private Double stormtime;
+
+    private Double offtime;
+
+    private Date recorddate;
+
+
+}

+ 62 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windpowerstation.java

@@ -0,0 +1,62 @@
+package com.gyee.ghost.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Windpowerstation extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String code;
+
+    private String name;
+
+    private String address;
+
+    private String telephone;
+
+    private Double capacity;
+
+    private String capacityunit;
+
+    private Double quantity;
+
+    private String aname;
+
+    private Double longitude;
+
+    private Double latitude;
+
+    private String photo;
+
+    private String companyid;
+
+    private String systemmanufact;
+
+    private String headfarm;
+
+    private String headfarmphone;
+
+    private String model;
+
+    private Double ordernum;
+
+    private Double altitude;
+
+    private Double height;
+
+
+}

+ 50 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windturbine.java

@@ -0,0 +1,50 @@
+package com.gyee.ghost.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Windturbine extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String code;
+
+    private String windpowerstationid;
+
+    private Double longitude;
+
+    private Double latitude;
+
+    private String modelid;
+
+    private String status;
+
+    private String projectid;
+
+    private String lineid;
+
+    private Date firstintegratedtime;
+
+    private String photo;
+
+    private String name;
+
+    private String standardid;
+
+
+}

+ 178 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windturbineinfoday.java

@@ -0,0 +1,178 @@
+package com.gyee.ghost.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Windturbineinfoday extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    private String windturbineid;
+
+    private Double runhours;
+
+    private Double stophours;
+
+    private Double faulthours;
+
+    private Double maintainhours;
+
+    private Double interrupthours;
+
+    private Double generatingcapacity;
+
+    private Double speed;
+
+    private Double power;
+
+    private Date recorddate;
+
+    private Double gridelectricity;
+
+    private Double buyelectricity;
+
+    private Double instop;
+
+    private Double outstop;
+
+    private Double runtime;
+
+    private Double stoptime;
+
+    private Double faulttime;
+
+    private Double maintaintime;
+
+    private Double interrupttime;
+
+    private Double monthgc;
+
+    private Double yeargc;
+
+    private Double theorygeneration;
+
+    private Double lossofpower;
+
+    private Double fieldelectricity;
+
+    private Double generatingcapacity2;
+
+    private String windpowerstationid;
+
+    private String projectid;
+
+    private String lineid;
+
+    private Double maxspeed;
+
+    private Double minspeed;
+
+    private Double totalgc;
+
+    private Double totalgc2;
+
+    private Double theorygenerationzs;
+
+    private Double windhours;
+
+    private Double maxpower;
+
+    private Double minpower;
+
+    private Double monthruntime;
+
+    private Double monhtstoptime;
+
+    private Double monthfaulttime;
+
+    private Double monthmaintaintime;
+
+    private Double monthinterrupttime;
+
+    private Double yearruntime;
+
+    private Double yearstoptime;
+
+    private Double yearfaulttime;
+
+    private Double yearmaintaintime;
+
+    private Double yearinterrupttime;
+
+    private Double monthspeed;
+
+    private Double yearspeed;
+
+    private Double daycalendarhours;
+
+    private Double monthcalendarhours;
+
+    private Double yearcalendarhours;
+
+    private Double lossofpower1;
+
+    private Double lossofpower2;
+
+    private Double lossofpower3;
+
+    private Double lossofpower4;
+
+    private Double dayzhcydl;
+
+    private Double monthzhcydl;
+
+    private Double yearzhcydl;
+
+    private Double daysbklyl;
+
+    private Double monthsbklyl;
+
+    private Double yearsbklyl;
+
+    private Double daydxkyxs;
+
+    private Double monthdxkyxs;
+
+    private Double yeardxkyxs;
+
+    private Double monthwindhours;
+
+    private Double yearwindhours;
+
+    private Double daylyxs;
+
+    private Double monthlyxs;
+
+    private Double yearlyxs;
+
+    private Double brownoutstime;
+
+    private Double monthbrownoutstime;
+
+    private Double yearbrownoutstime;
+
+    private Double mainlossin;
+
+    private Double faultlossin;
+
+    private Double electriclossout;
+
+    private Double weatherlossout;
+
+
+}

+ 116 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Windturbineinfoday3.java

@@ -0,0 +1,116 @@
+package com.gyee.ghost.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Windturbineinfoday3 extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    private String windpowerstationid;
+
+    private String projectid;
+
+    private String lineid;
+
+    private String windturbineid;
+
+    private Double daydl1;
+
+    private Double daydl2;
+
+    private Double daypower;
+
+    private Double dayspeed;
+
+    private Double daymaxpower;
+
+    private Double dayminpower;
+
+    private Double daymaxspeed;
+
+    private Double dayminspeed;
+
+    private Double daynhgl;
+
+    private Double daynhdl;
+
+    private Double daynhgzssdl;
+
+    private Double daynhwhssdl;
+
+    private Double daynhxdssdl;
+
+    private Double daynhqfdl;
+
+    private Double daynhcfdl;
+
+    private Double daynhpcl;
+
+    private Double daynhgl2;
+
+    private Double daynhdl2;
+
+    private Double daynhgzssdl2;
+
+    private Double daynhwhssdl2;
+
+    private Double daynhxdssdl2;
+
+    private Double daynhqfdl2;
+
+    private Double daynhcfdl2;
+
+    private Double daynhpcl2;
+
+    private Double daybzgl;
+
+    private Double daybzdl;
+
+    private Double daybzgzssdl;
+
+    private Double daybzwhssdl;
+
+    private Double daybzxdssdl;
+
+    private Double daybzqfdl;
+
+    private Double daybzcfdl;
+
+    private Double daybzpcl;
+
+    private Double dayllgl;
+
+    private Double daylldl;
+
+    private Double dayllgzssdl;
+
+    private Double dayllwhssdl;
+
+    private Double dayllxdssdl;
+
+    private Double dayllqfdl;
+
+    private Double dayllcfdl;
+
+    private Double dayllpcl;
+
+    private Date recorddate;
+
+
+}

+ 131 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/GhostService.java

@@ -0,0 +1,131 @@
+package com.gyee.ghost.service.auto;/*
+@author   谢生杰
+@date   2022/8/3-15:52
+*/
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gyee.common.model.StringUtils;
+import com.gyee.common.util.CommonUtils;
+import com.gyee.common.util.DateUtils;
+import com.gyee.common.util.DoubleUtils;
+import com.gyee.ghost.init.CacheContext;
+import com.gyee.ghost.model.auto.Fanoperation;
+import com.gyee.ghost.model.auto.Windturbine;
+import com.gyee.ghost.model.auto.Windturbineinfoday;
+import com.gyee.ghost.model.auto.Windturbineinfoday3;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+@Service
+public class GhostService {
+    @Resource
+    private IWindturbineinfodayService windturbineinfodayService;
+    @Resource
+    private IWindturbineinfoday3Service windturbineinfoday3Service;
+    @Resource
+    private IFanoperationService fanoperationService;
+    /**
+     * 存储fanoperation运行分析表
+     */
+    public void saveFanoperation(String beginDate,String endDate){
+        List<String> days = DateUtils.getDays(beginDate, endDate);
+        days.stream().forEach(day->{
+
+
+            List<Fanoperation> resultList = new ArrayList<>();
+            Date date = DateUtils.parseDate(day);
+
+            QueryWrapper<Fanoperation> delQw = new QueryWrapper<>();
+            delQw.eq("recorddate",date);
+            fanoperationService.remove(delQw);
+
+
+            QueryWrapper<Windturbineinfoday> windturbineinfodayQueryWrapper = new QueryWrapper<>();
+            windturbineinfodayQueryWrapper.eq("recorddate",date);
+            List<Windturbineinfoday> windturbineinfodayList = windturbineinfodayService.list(windturbineinfodayQueryWrapper);
+
+            QueryWrapper<Windturbineinfoday3> windturbineinfoday3QueryWrapper = new QueryWrapper<>();
+            windturbineinfoday3QueryWrapper.eq("recorddate",date);
+            List<Windturbineinfoday3> windturbineinfoday3List = windturbineinfoday3Service.list(windturbineinfoday3QueryWrapper);
+
+            List<Windturbine> wtls = CacheContext.wtls;
+            wtls.stream().forEach(wt->{
+                Fanoperation fanoperation = new Fanoperation();
+                fanoperation.setId(CommonUtils.getUUID());
+                fanoperation.setWindturbineid(wt.getId());
+                fanoperation.setWindturbinename(wt.getName());
+                fanoperation.setWindpowerstationid(wt.getWindpowerstationid());
+                Optional<Windturbineinfoday> optionalWindturbineinfoday = windturbineinfodayList.stream().filter(w -> w.getWindturbineid().equals(wt.getId())).findFirst();
+                Optional<Windturbineinfoday3> optionalWindturbineinfoday3 = windturbineinfoday3List.stream().filter(w -> w.getWindturbineid().equals(wt.getId())).findFirst();
+
+                if (optionalWindturbineinfoday.isPresent()){
+                    Windturbineinfoday windturbineinfoday = optionalWindturbineinfoday.get();
+                    fanoperation.setGeneratingcapacity(DoubleUtils.keepPrecision(windturbineinfoday.getGeneratingcapacity(),2));
+                    fanoperation.setAvailability(DoubleUtils.keepPrecision(windturbineinfoday.getDaysbklyl(),2));
+                    fanoperation.setRuntime(DoubleUtils.keepPrecision(windturbineinfoday.getRuntime(),2));
+                    fanoperation.setMaintime(DoubleUtils.keepPrecision(windturbineinfoday.getMaintaintime(),2));
+                    fanoperation.setFaulttime(DoubleUtils.keepPrecision(windturbineinfoday.getFaulttime(),2));
+                    fanoperation.setStoptime(DoubleUtils.keepPrecision(windturbineinfoday.getStoptime(),2));
+                    fanoperation.setOfftime(DoubleUtils.keepPrecision(windturbineinfoday.getInterrupttime(),2));
+                }
+                if (optionalWindturbineinfoday3.isPresent()){
+                    Windturbineinfoday3 windturbineinfoday3 = optionalWindturbineinfoday3.get();
+                    fanoperation.setDaynhgzssdl(DoubleUtils.keepPrecision(windturbineinfoday3.getDaynhgzssdl(),2));
+                    fanoperation.setDaynhwhssdl(DoubleUtils.keepPrecision(windturbineinfoday3.getDaynhwhssdl(),2));
+                    fanoperation.setDaynhxdssdl(DoubleUtils.keepPrecision(windturbineinfoday3.getDaynhxdssdl(),2));
+                    fanoperation.setDaynhqfdl(DoubleUtils.keepPrecision(windturbineinfoday3.getDaynhqfdl(),2));
+                    fanoperation.setDaynhcfdl(DoubleUtils.keepPrecision(windturbineinfoday3.getDaynhcfdl(),2));
+                }
+                fanoperation.setTheoreticalcapacity(DoubleUtils.keepPrecision((fanoperation.getGeneratingcapacity()+fanoperation.getDaynhgzssdl()+fanoperation.getDaynhwhssdl()+fanoperation.getDaynhxdssdl()+fanoperation.getDaynhqfdl()+fanoperation.getDaynhcfdl()),2));
+                fanoperation.setRecorddate(date);
+                fanoperation.setStormtime(0.0);
+
+
+
+                resultList.add(fanoperation);
+            });
+
+            fanoperationService.saveBatch(resultList);
+
+        });
+    }
+
+    /**
+     * 查询运行分析
+     * @return
+     * @param beginDate
+     * @param endDate
+     */
+    public List<Fanoperation> listFunction(String wpid,String beginDate, String endDate) {
+        List<Fanoperation> resultList = new ArrayList<>();
+        Date begin = DateUtils.parseDate(beginDate);
+        Date end = DateUtils.parseDate(endDate);
+        QueryWrapper<Fanoperation> qw = new QueryWrapper<>();
+        qw.select("windturbineid,windturbinename,sum(generatingcapacity) generatingcapacity,sum(theoreticalcapacity) theoreticalcapacity,sum(daynhgzssdl) daynhgzssdl,sum(daynhwhssdl) daynhwhssdl,sum(daynhxdssdl) daynhxdssdl,sum(daynhqfdl) daynhqfdl,sum(daynhcfdl) daynhcfdl,avg(availability) availability,avg(powerfactor) powerfactor,sum(runtime) runtime,sum(maintime) maintime,sum(faulttime) faulttime,sum(stoptime) stoptime,sum(stormtime) stormtime,sum(offtime) offtime");
+        qw.ge("recorddate",begin).le("recorddate",end);
+        if (StringUtils.isNotEmpty(wpid)){
+            qw.eq("windpowerstationid",wpid);
+        }
+        qw.groupBy("windturbineid,windturbinename");
+        List<Fanoperation> list = fanoperationService.list(qw);
+        resultList.addAll(list);
+
+        qw.clear();
+        qw.select("sum(generatingcapacity) generatingcapacity,sum(theoreticalcapacity) theoreticalcapacity,sum(daynhgzssdl) daynhgzssdl,sum(daynhwhssdl) daynhwhssdl,sum(daynhxdssdl) daynhxdssdl,sum(daynhqfdl) daynhqfdl,sum(daynhcfdl) daynhcfdl,avg(availability) availability,avg(powerfactor) powerfactor,sum(runtime) runtime,sum(maintime) maintime,sum(faulttime) faulttime,sum(stoptime) stoptime,sum(stormtime) stormtime,sum(offtime) offtime");
+        qw.ge("recorddate",begin).le("recorddate",end);
+        if (StringUtils.isNotEmpty(wpid)){
+            qw.eq("windpowerstationid",wpid);
+        }
+        List<Fanoperation> hjlist = fanoperationService.list(qw);
+        if (StringUtils.isNotEmpty(hjlist)){
+            resultList.add(hjlist.get(0));
+        }
+        return resultList;
+    }
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IFanoperationService.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.gyee.ghost.model.auto.Fanoperation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface IFanoperationService extends IService<Fanoperation> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindpowerstationService.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.gyee.ghost.model.auto.Windpowerstation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface IWindpowerstationService extends IService<Windpowerstation> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindturbineService.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.gyee.ghost.model.auto.Windturbine;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface IWindturbineService extends IService<Windturbine> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindturbineinfoday3Service.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.gyee.ghost.model.auto.Windturbineinfoday3;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface IWindturbineinfoday3Service extends IService<Windturbineinfoday3> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IWindturbineinfodayService.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.gyee.ghost.model.auto.Windturbineinfoday;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+public interface IWindturbineinfodayService extends IService<Windturbineinfoday> {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/FanoperationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.gyee.ghost.model.auto.Fanoperation;
+import com.gyee.ghost.mapper.auto.FanoperationMapper;
+import com.gyee.ghost.service.auto.IFanoperationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Service
+public class FanoperationServiceImpl extends ServiceImpl<FanoperationMapper, Fanoperation> implements IFanoperationService {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindpowerstationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.gyee.ghost.model.auto.Windpowerstation;
+import com.gyee.ghost.mapper.auto.WindpowerstationMapper;
+import com.gyee.ghost.service.auto.IWindpowerstationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Service
+public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMapper, Windpowerstation> implements IWindpowerstationService {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindturbineServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.gyee.ghost.model.auto.Windturbine;
+import com.gyee.ghost.mapper.auto.WindturbineMapper;
+import com.gyee.ghost.service.auto.IWindturbineService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Service
+public class WindturbineServiceImpl extends ServiceImpl<WindturbineMapper, Windturbine> implements IWindturbineService {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/Windturbineinfoday3ServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.gyee.ghost.model.auto.Windturbineinfoday3;
+import com.gyee.ghost.mapper.auto.Windturbineinfoday3Mapper;
+import com.gyee.ghost.service.auto.IWindturbineinfoday3Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Service
+public class Windturbineinfoday3ServiceImpl extends ServiceImpl<Windturbineinfoday3Mapper, Windturbineinfoday3> implements IWindturbineinfoday3Service {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/WindturbineinfodayServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.gyee.ghost.model.auto.Windturbineinfoday;
+import com.gyee.ghost.mapper.auto.WindturbineinfodayMapper;
+import com.gyee.ghost.service.auto.IWindturbineinfodayService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-03
+ */
+@Service
+public class WindturbineinfodayServiceImpl extends ServiceImpl<WindturbineinfodayMapper, Windturbineinfoday> implements IWindturbineinfodayService {
+
+}

+ 41 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/task/SaticScheduleTask.java

@@ -0,0 +1,41 @@
+package com.gyee.ghost.task;
+
+
+import com.gyee.common.util.DateUtils;
+import com.gyee.ghost.service.auto.GhostService;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+
+import javax.annotation.Resource;
+
+/**
+ * @ClassName : SaticScheduleTask
+ * @Author : xieshengjie
+ * @Date: 2021/1/21 19:43
+ * @Description : 调度
+ */
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+public class SaticScheduleTask {
+
+    @Resource
+    private GhostService ghostService;
+
+    /**
+     * 风电统计分析
+     */
+    @Scheduled(cron = "0 0 1 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    private void analysisTasks() {
+        String yesterday = DateUtils.getYesterdayStr("yyyy-MM-dd");
+        try {
+            ghostService.saveFanoperation(yesterday,yesterday);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+}

+ 109 - 0
web/gdsx-ghost/src/main/resources/application-dev.yml

@@ -0,0 +1,109 @@
+server:
+  port: 8082
+  servlet:
+    context-path: /
+
+
+spring:
+  application:
+    name:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+#  cloud:
+#    nacos:
+#      discovery:
+#        server-addr: 192.168.2.216:8848
+#        #指定yaml格式的配置
+#        file-extension: yaml
+#        cluster-name: master
+#      username: nacos
+#      password: nacos
+  #redis集群
+#  redis:
+##    host: 10.83.68.94
+#    host: 192.168.2.202
+#    port: 6379
+#    timeout: 100000
+#    #    集群环境打开下面注释,单机不需要打开
+#    #    cluster:
+#    #      集群信息
+#    #      nodes: xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx
+#    #      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
+#    #      maxRedirects: 3
+#    password:
+#    application:
+#      name: test
+#    jedis:
+#      pool:
+#        max-active: 8
+#        min-idle: 0
+#        max-idle: 8
+#        max-wait: -1
+#    database: 1
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+#    driver-class-name: oracle.jdbc.OracleDriver
+    #外网
+#    url: jdbc:oracle:thin:@10.83.68.165:1521:gdsj
+#    url: jdbc:oracle:thin:@192.168.2.215:1521:gdsj
+#    username: gdprod
+#    password: gd123
+#    oracle-schema=:
+
+#    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
+#    username: root
+#    password: root
+#    driver-class-name: com.mysql.jdbc.Driver
+
+    driver-class-name: org.postgresql.Driver
+    url: jdbc:postgresql://10.81.3.151:5432/wisdom
+    username: gdprod
+    password: gd123
+    oracle-schema=:
+
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+#db url
+db:
+  url: http://10.81.3.152:8011/ts
+
+

+ 4 - 0
web/gdsx-ghost/src/main/resources/application.yml

@@ -0,0 +1,4 @@
+spring:
+  profiles:
+#    active: hf
+    active: dev

+ 27 - 0
web/gdsx-ghost/src/test/java/com/gyee/ghost/GhostTest.java

@@ -0,0 +1,27 @@
+package com.gyee.ghost;/*
+@author   谢生杰
+@date   2022/8/3-17:10
+*/
+
+import com.gyee.ghost.service.auto.GhostService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+
+@SpringBootTest
+@RunWith(SpringRunner.class)
+@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
+public class GhostTest {
+    @Resource
+    private GhostService ghostService;
+
+    @Test
+    public void test1(){
+        ghostService.saveFanoperation("2022-08-01","2022-08-01");
+    }
+}

+ 1 - 0
web/pom.xml

@@ -34,6 +34,7 @@
 <!--        <module>initialpoint</module>-->
         <module>alarm-hb</module>
         <module>configurationpoint</module>
+        <module>gdsx-ghost</module>
     </modules>