Browse Source

移植新版健康管理后台项目

shilin 1 year ago
parent
commit
108ebf0cdf
42 changed files with 1400 additions and 1809 deletions
  1. 16 3
      realtime/healthmodel-server/pom.xml
  2. 12 4
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/HealthmodelMain.java
  3. 35 137
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/config/GeneratorCodeConfig.java
  4. 0 102
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/config/MybatisConfig.java
  5. 9 4
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/init/CacheContext.java
  6. 4 2
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/AlarmcountMapper.java
  7. 2 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/AlarmsnapMapper.java
  8. 3 2
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/Alertrule2Mapper.java
  9. 2 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/AlertrulefailureMapper.java
  10. 2 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/AlertrulefailuresubMapper.java
  11. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconEarlyWarningMainMapper.java
  12. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconEarlyWarningSubMapper.java
  13. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconEquipmentInfoDayTopMapper.java
  14. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconFailureStatisticMainMapper.java
  15. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconFailureStatisticsSubMapper.java
  16. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartPowerstatticMainMapper.java
  17. 2 2
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartStatisticsMainMapper.java
  18. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartTemperatureMainMapper.java
  19. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartTemperatureSubMapper.java
  20. 1 5
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartWarnCountMapper.java
  21. 1 6
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartWarnCountSubMapper.java
  22. 6 11
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconWindturbineWarnCountMapper.java
  23. 3 0
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/model/auto/ProEconHealthReportTarget.java
  24. 3 0
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/model/auto/ProEconStateJudgmentDay.java
  25. 3 0
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/model/auto/ProEconStateJudgmentReal.java
  26. 437 402
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/HealthFactoryService.java
  27. 24 2
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/HealthInitialService.java
  28. 94 66
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/HealthJudgeService.java
  29. 438 6
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/HealthReportService.java
  30. 7 7
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/LosspowerratesService.java
  31. 48 13
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/MasterDataService.java
  32. 3 0
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/IProEconCurveFittingSubService.java
  33. 34 0
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconCurveFittingSubServiceImpl.java
  34. 3 27
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java
  35. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconPartWarnCountServiceImpl.java
  36. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconPartWarnCountSubServiceImpl.java
  37. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconWindturbineWarnCountServiceImpl.java
  38. 177 170
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/task/SaticScheduleTask.java
  39. 0 790
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/util/MongoEdosUtil.java
  40. 1 1
      realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/util/realtimesource/EdosUtil.java
  41. 17 31
      realtime/healthmodel-server/src/main/resources/application-jn.yml
  42. 2 2
      realtime/healthmodel-server/src/main/resources/xxl-job-executor.properties

+ 16 - 3
realtime/healthmodel-server/pom.xml

@@ -11,7 +11,6 @@
 
     <artifactId>healthmodel-server</artifactId>
 
-
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
@@ -19,10 +18,12 @@
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.target>1.8</maven.compiler.target>
         <maven.test.skip>true</maven.test.skip>
-        <commons.io.version>2.5</commons.io.version>
+        <pgsql.version>42.2.5</pgsql.version>
         <groovy.version>3.0.8</groovy.version>
         <spring-boot.version>2.3.7.RELEASE</spring-boot.version>
-        <pgsql.version>42.2.5</pgsql.version>
+        <mybatis-plus.boot.starter.version>3.5.3.1</mybatis-plus.boot.starter.version>
+        <mybatis-plus.generator.version>3.5.3.1</mybatis-plus.generator.version>
+
     </properties>
     <dependencies>
 
@@ -51,17 +52,29 @@
         </dependency>
 
         <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
             <optional>true</optional>
         </dependency>
+
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>${mybatis-plus.boot.starter.version}</version>
         </dependency>
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-generator</artifactId>
+            <version>${mybatis-plus.generator.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
+            <version>3.5.0</version>
         </dependency>
         <dependency>
             <groupId>org.freemarker</groupId>

+ 12 - 4
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/HealthmodelMain.java

@@ -1,12 +1,8 @@
 package com.gyee.healthmodel;
 
-import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
-import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
 
 /**
  * @ClassName : HealthmodelMain
@@ -16,5 +12,17 @@ import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfigurat
 public class HealthmodelMain {
     public static void main(String[] args) {
         SpringApplication.run(HealthmodelMain.class, args);
+
+
+        System.out.println("开始");
+//        SaticScheduleTask saticScheduleTask= SpringUtils.getBean("saticScheduleTask");
+//        saticScheduleTask.configureTasks1();
+//        saticScheduleTask.configureTasks2();
+//        saticScheduleTask.configureTasks3();
+//        saticScheduleTask.configureTasks4();
+//        saticScheduleTask.configureTasks6();
+//        saticScheduleTask.configureTasks7();
+//
+//        System.out.println("结束");
     }
 }

+ 35 - 137
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/config/GeneratorCodeConfig.java

@@ -1,149 +1,47 @@
 package com.gyee.healthmodel.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;
+import com.baomidou.mybatisplus.generator.FastAutoGenerator;
+import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
+import com.baomidou.mybatisplus.generator.config.querys.PostgreSqlQuery;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
 
-/**
- *@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+"\\realtime\\healthmodel-server\\src\\main\\java");
-        gc.setAuthor("shilin");
-        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.81.3.151:1521:gdsj");
-
-        dsc.setDriverName("org.postgresql.Driver");
-        dsc.setUsername("postgres");
-        dsc.setPassword("gd123");
-        dsc.setUrl("jdbc:postgresql://127.0.0.1:5432/IMS_NEM_JN");
-
-        mpg.setDataSource(dsc);
 
+    /**
+     * 数据源配置
+     */
+    private static final DataSourceConfig.Builder DATA_SOURCE_CONFIG = new DataSourceConfig
+            .Builder("jdbc:postgresql://127.0.0.1:5432/IMS_NEM_JN", "postgres", "gd123")
+            .dbQuery(new PostgreSqlQuery());
 
+    /**
+     * 输出路径
+     */
+    private static final String outputDir = System.getProperty("user.dir")+"\\web\\health\\src\\main\\java";
 
-        // 包配置
-        PackageConfig pc = new PackageConfig();
-//        pc.setModuleName(scanner("模块名"));
-        pc.setParent("com.gyee.healthmodel");
-        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);
+    public static void main(String[] args) {
 
-        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();
+        FastAutoGenerator.create(DATA_SOURCE_CONFIG)
+                .globalConfig(builder -> {
+                    builder.author("Shi Lin") // 设置作者
+                            .enableSwagger() // 开启 swagger 模式
+                            .fileOverride() // 覆盖已生成文件
+                            .outputDir(outputDir)   // 指定输出目录
+                            .disableOpenDir();   //禁止打开输出目录
+                })
+                .packageConfig(builder -> {
+                    builder.parent("com.gyee.health"); // 设置父包名
+                })
+                .strategyConfig(builder -> {
+                    builder.addInclude("pro_econ_part_warn_count"); // 设置需要生成的表名
+                    builder.addInclude("pro_econ_part_warn_count_sub"); // 设置需要生成的表名
+                    builder.addInclude("pro_econ_part_warn_count"); // 设置需要生成的表名
+                    builder.addInclude("pro_econ_part_warn_count"); // 设置需要生成的表名
+                })
+                .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
+                .execute();
     }
+
 }

+ 0 - 102
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/config/MybatisConfig.java

@@ -1,102 +0,0 @@
-package com.gyee.healthmodel.config;
-
-import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
-
-import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
-import com.gyee.healthmodel.dataSources.DataSourceType;
-import com.gyee.healthmodel.dataSources.DynamicDataSource;
-import org.apache.ibatis.session.SqlSessionFactory;
-
-import org.mybatis.spring.SqlSessionFactoryBean;
-import org.mybatis.spring.SqlSessionTemplate;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
-import org.springframework.jdbc.datasource.DataSourceTransactionManager;
-import org.springframework.transaction.PlatformTransactionManager;
-
-import javax.sql.DataSource;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Mybatis多数据源配置
- * 参考文章:https://www.cnblogs.com/geekdc/p/10963476.html
- * @ClassName: MybatisConfig
- * @author gyee
- * @date 2019-12-06 21:11
- */
-@Configuration
-@MapperScan("com.gyee.healthmodel.mapper")
-public class MybatisConfig {
-
-    @Bean(name = "master")
-    @ConfigurationProperties("spring.datasource.druid.master")
-    public DataSource masterDataSource()
-    {
-        return DruidDataSourceBuilder.create().build();
-    }
-
-    @Bean(name = "slave")
-    @ConfigurationProperties("spring.datasource.druid.slave")
-//    @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
-    public DataSource slaveDataSource()
-    {
-        return DruidDataSourceBuilder.create().build();
-    }
-
-    @Bean(name = "ticket")
-    @ConfigurationProperties("spring.datasource.druid.ticket")
-//    @ConditionalOnProperty(prefix = "spring.datasource.druid.ticket", name = "enabled", havingValue = "true")
-    public DataSource ticketDataSource()
-    {
-        return DruidDataSourceBuilder.create().build();
-    }
-
-    @Bean(name = "dynamicDataSource")
-    @Primary
-    public DynamicDataSource dataSource(@Qualifier("master")DataSource masterDataSource, @Qualifier("slave")DataSource slaveDataSource, @Qualifier("ticket")DataSource ticketDataSource)
-    {
-        Map<Object, Object> targetDataSources = new HashMap<>();
-        targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
-    	targetDataSources.put(DataSourceType.SLAVE.name(),slaveDataSource);
-        targetDataSources.put(DataSourceType.TICKET.name(),ticketDataSource);
-        return new DynamicDataSource(masterDataSource(), targetDataSources);
-    }
-
-    @Bean
-    public SqlSessionFactory sqlSessionFactory(DynamicDataSource dynamicDataSource) throws Exception {
-        MybatisSqlSessionFactoryBean factoryBean=new MybatisSqlSessionFactoryBean();
-        //SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
-        factoryBean.setDataSource(dynamicDataSource);
-//        factoryBean.setTypeAliasesPackage();
-        // 设置mapper.xml的位置路径
-//        Resource[] resources = new PathMatchingResourcePatternResolver().getResources("classpath*:mapper/**/*Mapper.xml");
-//        factoryBean.setMapperLocations(resources);
-        return factoryBean.getObject();
-    }
-    
-    /**
-     * 配置@Transactional注解事务
-     * @param dynamicDataSource
-     * @return
-     * @author gyee
-     * @Date 2019年12月7日 上午11:31:33
-     */
-    @Bean
-    public PlatformTransactionManager transactionManager(DynamicDataSource dynamicDataSource){
-        return new DataSourceTransactionManager(dynamicDataSource);
-    }
-
-    @Bean
-    public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory)
-    {
-        return new SqlSessionTemplate(sqlSessionFactory);
-    }
-}

+ 9 - 4
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/init/CacheContext.java

@@ -82,9 +82,9 @@ public class CacheContext implements CommandLineRunner {
         log.info("-------------------------------缓存开始--------------------------------------");
       //  hpmap=healthpointsService.findAllMap();
         wpls = proBasicPowerstationService.list();
-        alarmrulels=alertrule2Service.list();
+//        alarmrulels=alertrule2Service.list();
 //
-//        wpls.stream().filter(i->i.getId().endsWith("FDC")).forEach(i->{
+//        wpls.stream().filter(i->i.getId().contains("FDC")).forEach(i->{
 //            wpmap.put(i.getId(),i);
 //        });
 //
@@ -107,8 +107,13 @@ public class CacheContext implements CommandLineRunner {
         //和风只部署芳山风电场
  //       wptempls.stream().filter(i->i.getId().equals("FS_FDC")).forEach(i->{
         wptempls.stream().forEach(i->{
-            wpls.add(i);
-            wpmap.put(i.getId(),i);
+
+            if(i.getId().contains("FDC"))
+            {
+                wpls.add(i);
+                wpmap.put(i.getId(),i);
+            }
+
         });
 
         List<ProBasicProject> pjtempls  = proBasicProjectService.list();

+ 4 - 2
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/AlarmcountMapper.java

@@ -1,5 +1,6 @@
 package com.gyee.healthmodel.mapper.auto;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.healthmodel.model.auto.Alarmcount;
 import com.gyee.healthmodel.model.vo.AlarmcountVo;
@@ -19,10 +20,11 @@ import java.util.List;
  */
 public interface AlarmcountMapper extends BaseMapper<Alarmcount> {
 
+    @DS("slave")
     @Select(" select * from alarmcount where time is not null and snapid=#{snapid} and  alarmdate>=#{beginDate} and alarmdate<=#{endDate}   ")
     public List<Alarmcount> findAlarmcount(@Param(value = "snapid") Long snapid,@Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate);
 
-
+    @DS("slave")
     @Select(" select s.alerttext as alertText,p.name as name ,s.windturbineid as wtId ,a.count as counts,a.time as times " +
             "    from   (select snapid,sum(count) as count,sum(time) as time from alarmcount" +
             "    where alarmdate>=#{beginDate} and  alarmdate<=#{endDate} group by snapid )" +
@@ -30,7 +32,7 @@ public interface AlarmcountMapper extends BaseMapper<Alarmcount> {
             " and s.windturbineid=#{wtId}  ")
     public List<AlarmcountVo> findAlarmCountByWt(@Param(value = "wtId") String wtId, @Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate);
 
-
+    @DS("slave")
     @Select(" select s.alerttext as alertText,p.name as name ,w.modelid as modelId ,a.count as counts,a.time as times " +
             "    from   (select snapid,sum(count) as count,sum(time) as time from alarmcount" +
             "    where alarmdate>=#{beginDate} and  alarmdate<=#{endDate} group by snapid )" +

+ 2 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/AlarmsnapMapper.java

@@ -1,5 +1,6 @@
 package com.gyee.healthmodel.mapper.auto;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.healthmodel.model.auto.Alarmsnap;
 import org.apache.ibatis.annotations.Param;
@@ -16,7 +17,7 @@ import java.util.List;
  * @since 2022-01-21
  */
 public interface AlarmsnapMapper extends BaseMapper<Alarmsnap> {
-
+    @DS("slave")
     @Select(" select * from alarmsnap where alertvalue=#{alertvalue}  and windturbineid=#{wtid} ")
     List<Alarmsnap> getAlarmsnapList(  @Param(value = "wtid")String wtid,@Param(value = "alertvalue") Long alertvalue);
 

+ 3 - 2
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/Alertrule2Mapper.java

@@ -1,5 +1,6 @@
 package com.gyee.healthmodel.mapper.auto;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.healthmodel.model.auto.Alertrule2;
 import org.apache.ibatis.annotations.Param;
@@ -17,11 +18,11 @@ import java.util.List;
  */
 public interface Alertrule2Mapper extends BaseMapper<Alertrule2> {
 
-
+    @DS("slave")
     @Select(" select * from alertrule2 where station=#{station} and modelid=#{modelid} ")
     List<Alertrule2> findAlertRuleList(@Param(value = "station") String station, @Param(value = "modelid")String modelid);
 
-
+    @DS("slave")
     @Select(" select * from alertrule2 where station=#{station} and modelid=#{modelid} and name=#{name} ")
     List<Alertrule2> getAlertRuleIdByName(@Param(value = "station") String station, @Param(value = "modelid")String modelid, @Param(value = "name")String name);
 

+ 2 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/AlertrulefailureMapper.java

@@ -1,5 +1,6 @@
 package com.gyee.healthmodel.mapper.auto;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.healthmodel.model.auto.Alertrulefailure;
 import org.apache.ibatis.annotations.Param;
@@ -17,7 +18,7 @@ import java.util.List;
  */
 public interface AlertrulefailureMapper extends BaseMapper<Alertrulefailure> {
 
-
+    @DS("slave")
     @Select(" select * from public.alertrulefailure f " +
             "where name=#{name} and model= #{model} order by name")
     public List<Alertrulefailure> getPartByAlertrule(@Param(value = "name") String name,@Param(value = "model") String model);

+ 2 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/AlertrulefailuresubMapper.java

@@ -1,5 +1,6 @@
 package com.gyee.healthmodel.mapper.auto;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.healthmodel.model.auto.Alertrulefailuresub;
 import org.apache.ibatis.annotations.Param;
@@ -16,7 +17,7 @@ import java.util.List;
  * @since 2022-01-21
  */
 public interface AlertrulefailuresubMapper extends BaseMapper<Alertrulefailuresub> {
-
+    @DS("slave")
     @Select(" select altype from alertrulefailuresub where tid=#{tid}  ")
     public List<String> getPartByAlertruleid(@Param(value = "tid") String tid);
 

File diff suppressed because it is too large
+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconEarlyWarningMainMapper.java


+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconEarlyWarningSubMapper.java

@@ -23,6 +23,6 @@ public interface ProEconEarlyWarningSubMapper extends BaseMapper<ProEconEarlyWar
     public int deleteEarlywarningsub(@Param(value = "record_date") Date recorddate);
 
 
-    @Insert("  INSERT INTO pro_econ_early_warning_sub(id,tid,record_date,wp_id,wp_name,wt_id,wt_name,name,event_id) VALUES(#{id,jdbcType=VARCHAR},#{tid,jdbcType=VARCHAR},#{record_date},#{wp_id,jdbcType=VARCHAR},#{wp_name,jdbcType=VARCHAR},#{wt_id,jdbcType=VARCHAR},#{wt_name,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{event_id,jdbcType=VARCHAR})  ")
+    @Insert("  INSERT INTO pro_econ_early_warning_sub(id,tid,record_date,wp_id,wp_name,wt_id,wt_name,name,event_id) VALUES(#{id,jdbcType=VARCHAR},#{tid,jdbcType=VARCHAR},#{record_date},#{wpId,jdbcType=VARCHAR},#{wpName,jdbcType=VARCHAR},#{wtId,jdbcType=VARCHAR},#{wtName,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{event_id,jdbcType=VARCHAR})  ")
     public int insertEarlywarningsub(ProEconEarlyWarningSub earlywarningsub);
 }

+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconEquipmentInfoDayTopMapper.java

@@ -19,6 +19,6 @@ import java.util.List;
 public interface ProEconEquipmentInfoDayTopMapper extends BaseMapper<ProEconEquipmentInfoDayTop> {
 
 
-    @Select(" select * from pro_econ_equipment_info_day_top t where types=1 and record_date=#{record_date}   ")
+    @Select(" select * from pro_econ_equipment_info_day_top t where types=2 and record_date=#{record_date}   ")
     public List<ProEconEquipmentInfoDayTop> findXnfx(@Param(value = "record_date") Date record_date);
 }

File diff suppressed because it is too large
+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconFailureStatisticMainMapper.java


+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconFailureStatisticsSubMapper.java

@@ -22,6 +22,6 @@ public interface ProEconFailureStatisticsSubMapper extends BaseMapper<ProEconFai
     public int deleteFailurestatisticssub(@Param(value = "recorddate") Date recorddate);
 
 
-    @Insert(" INSERT INTO pro_econ_failure_statistics_sub(id,tid,record_date,wp_id,wp_name,wt_id,wt_name,name,event_id) VALUES(#{id,jdbcType=VARCHAR},#{tid,jdbcType=VARCHAR},#{record_date},#{wp_id,jdbcType=VARCHAR},#{wp_name,jdbcType=VARCHAR},#{wt_id,jdbcType=VARCHAR},#{wt_name,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{event_id,jdbcType=VARCHAR}) ")
+    @Insert(" INSERT INTO pro_econ_failure_statistics_sub(id,tid,record_date,wp_id,wp_name,wt_id,wt_name,name,event_id) VALUES(#{id,jdbcType=VARCHAR},#{tid,jdbcType=VARCHAR},#{record_date},#{wpId,jdbcType=VARCHAR},#{wpName,jdbcType=VARCHAR},#{wtId,jdbcType=VARCHAR},#{wtName,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{event_id,jdbcType=VARCHAR}) ")
     public int insertFailurestatisticssub(ProEconFailureStatisticsSub failurestatisticssub);
 }

+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartPowerstatticMainMapper.java

@@ -23,6 +23,6 @@ public interface ProEconPartPowerstatticMainMapper extends BaseMapper<ProEconPar
     public int deletePartpowerstatticsmain(@Param(value = "recorddate") Date recorddate);
 
 
-    @Insert("  INSERT INTO pro_econ_part_powerstattic_main(id,record_date,wp_id,wp_name,wt_id,wt_name,model) VALUES(#{id,jdbcType=VARCHAR},#{record_date},#{wp_id,jdbcType=VARCHAR},#{wp_name,jdbcType=VARCHAR},#{wt_id,jdbcType=VARCHAR},#{wt_name,jdbcType=VARCHAR},#{model,jdbcType=VARCHAR}) ")
+    @Insert("  INSERT INTO pro_econ_part_powerstattic_main(id,record_date,wp_id,wp_name,wt_id,wt_name,model) VALUES(#{id,jdbcType=VARCHAR},#{record_date},#{wpId,jdbcType=VARCHAR},#{wpName,jdbcType=VARCHAR},#{wtId,jdbcType=VARCHAR},#{wtName,jdbcType=VARCHAR},#{model,jdbcType=VARCHAR}) ")
     public int insertPartpowerstatticsmain(ProEconPartPowerstatticMain partpowerstatticsmain);
 }

File diff suppressed because it is too large
+ 2 - 2
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartStatisticsMainMapper.java


+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartTemperatureMainMapper.java

@@ -23,6 +23,6 @@ public interface ProEconPartTemperatureMainMapper extends BaseMapper<ProEconPart
     public int deleteParttemperaturemain(@Param(value = "recorddate") Date recorddate);
 
 
-    @Insert(" INSERT INTO pro_econ_part_temperature_main(id,record_date,wp_id,wp_name,wt_id,wt_name,trange,tsnumber) VALUES(#{id,jdbcType=VARCHAR},#{record_date},#{wp_id,jdbcType=VARCHAR},#{wp_name,jdbcType=VARCHAR},#{wt_id,jdbcType=VARCHAR},#{wt_name,jdbcType=VARCHAR},#{trange,jdbcType=VARCHAR},#{tsnumber,jdbcType=INTEGER}) ")
+    @Insert(" INSERT INTO pro_econ_part_temperature_main(id,record_date,wp_id,wp_name,wt_id,wt_name,trange,tsnumber) VALUES(#{id,jdbcType=VARCHAR},#{record_date},#{wpId,jdbcType=VARCHAR},#{wpName,jdbcType=VARCHAR},#{wtId,jdbcType=VARCHAR},#{wtName,jdbcType=VARCHAR},#{trange,jdbcType=VARCHAR},#{tsnumber,jdbcType=INTEGER}) ")
     public int insertParttemperaturemain(ProEconPartTemperatureMain parttemperaturemain);
 }

+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartTemperatureSubMapper.java

@@ -23,6 +23,6 @@ public interface ProEconPartTemperatureSubMapper extends BaseMapper<ProEconPartT
     public int deleteParttemperaturesub(@Param(value = "recorddate") Date recorddate);
 
 
-    @Insert(" INSERT INTO pro_econ_part_temperature_sub(id,record_date,wp_id,wp_name,wt_id,wt_name,trange,tsnumber,pointname,partname) VALUES(#{id,jdbcType=VARCHAR},#{record_date},#{wp_id,jdbcType=VARCHAR},#{wp_name,jdbcType=VARCHAR},#{wt_id,jdbcType=VARCHAR},#{wt_name,jdbcType=VARCHAR},#{trange,jdbcType=VARCHAR},#{tsnumber,jdbcType=INTEGER},#{pointname,jdbcType=VARCHAR},#{partname,jdbcType=VARCHAR}) ")
+    @Insert(" INSERT INTO pro_econ_part_temperature_sub(id,record_date,wp_id,wp_name,wt_id,wt_name,trange,tsnumber,pointname,partname) VALUES(#{id,jdbcType=VARCHAR},#{record_date},#{wpId,jdbcType=VARCHAR},#{wpName,jdbcType=VARCHAR},#{wtId,jdbcType=VARCHAR},#{wtName,jdbcType=VARCHAR},#{trange,jdbcType=VARCHAR},#{tsnumber,jdbcType=INTEGER},#{pointname,jdbcType=VARCHAR},#{partname,jdbcType=VARCHAR}) ")
     public int insertParttemperaturesub(ProEconPartTemperatureSub parttemperaturesub);
 }

+ 1 - 5
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartWarnCountMapper.java

@@ -3,7 +3,6 @@ package com.gyee.healthmodel.mapper.auto;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.healthmodel.model.auto.ProEconPartWarnCount;
 import org.apache.ibatis.annotations.Delete;
-import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -24,10 +23,7 @@ public interface ProEconPartWarnCountMapper extends BaseMapper<ProEconPartWarnCo
     public int deletePartbjcountAll();
 
 
-    @Insert(" insert into pro_econ_part_warn_count(id,ln_id,record_date,alertrule_id,total,average_quantity,part)" +
-            " values(#{id,jdbcType=VARCHAR},#{ln_id,jdbcType=VARCHAR},#{record_date},#{alertrule_id,jdbcType=VARCHAR}," +
-            ",#{total,jdbcType=INTEGER},,#{average_quantity,jdbcType=DOUBLE},#{part,jdbcType=VARCHAR}) ")
-    public int insertPartbjcount(ProEconPartWarnCount ProEconPartWarnCount);
+
 
 
     @Delete(" delete from pro_econ_part_warn_count where record_date=#{record_date} ")

+ 1 - 6
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconPartWarnCountSubMapper.java

@@ -3,7 +3,6 @@ package com.gyee.healthmodel.mapper.auto;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.healthmodel.model.auto.ProEconPartWarnCountSub;
 import org.apache.ibatis.annotations.Delete;
-import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 
 /**
@@ -21,11 +20,7 @@ public interface ProEconPartWarnCountSubMapper extends BaseMapper<ProEconPartWar
     public int deletePartbjcountsub();
 
 
-    @Insert(" insert into pro_econ_part_warn_count_sub(id,pid,wt_id,record_date,alertrule_id,count,average_quantity,part) " +
-            "values( #{id,jdbcType=VARCHAR},#{pid,jdbcType=VARCHAR},#{wt_id,jdbcType=VARCHAR}," +
-            "#{record_date},#{alertrule_id,jdbcType=VARCHAR}," +
-            "#{total,jdbcType=INTEGER},#{average_quantity,jdbcType=DOUBLE},#{part,jdbcType=VARCHAR} ) ")
-    public int insertPartbjcountsub(ProEconPartWarnCountSub partbjcountsub);
+
 
     @Delete(" delete from pro_econ_part_warn_count_sub where pid=#{pid} ")
     public int deletePartbjcount(@Param(value = "pid") String pid);

+ 6 - 11
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/mapper/auto/ProEconWindturbineWarnCountMapper.java

@@ -3,7 +3,6 @@ package com.gyee.healthmodel.mapper.auto;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.gyee.healthmodel.model.auto.ProEconWindturbineWarnCount;
 import org.apache.ibatis.annotations.Delete;
-import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -25,18 +24,14 @@ public interface ProEconWindturbineWarnCountMapper extends BaseMapper<ProEconWin
     public int deleteWindturbineBjCountData();
 
 
-    @Insert(" insert into pro_econ_windturbine_warn_count (id,wtid,lnid,wpid,alertruleid,alertrulename,part,count,reference,recodedate) values(#{id,jdbcType=VARCHAR},#{wtid,jdbcType=VARCHAR},#{lnid,jdbcType=VARCHAR},#{wpid,jdbcType=VARCHAR},#{alertruleid,jdbcType=VARCHAR},#{alertrulename,jdbcType=VARCHAR},#{part,jdbcType=VARCHAR},#{count,jdbcType=INTEGER},#{reference,jdbcType=DOUBLE},#{recodedate}) ")
-    public int insertWindturbineBjCount(ProEconWindturbineWarnCount windturbinebjcount);
+    @Select(" select * from pro_econ_windturbine_warn_count where alertrule_id=#{alertrule_id}  and ln_id=#{ln_id}   ")
+    public List<ProEconWindturbineWarnCount> queryWindturbinebjCountByLineAndAlertrule(@Param(value = "alertrule_id") String alertrule_id, @Param(value = "ln_id")String ln_id);
 
+    @Select(" select ln_id from pro_econ_windturbine_warn_count where alertrule_id=#{alertrule_id}  group by ln_id   ")
+    public List<String> queryWindturbinebjCountLine(@Param(value = "alertrule_id") String alertrule_id);
 
-    @Select(" select * from pro_econ_windturbine_warn_count where alertruleid=#{alertruleid}  and lnid=#{lnid}   ")
-    public List<ProEconWindturbineWarnCount> queryWindturbinebjCountByLineAndAlertrule(@Param(value = "alertruleid") String alertruleid, @Param(value = "lnid")String lnid);
 
-    @Select(" select lnid from pro_econ_windturbine_warn_count where alertruleid=#{alertruleid}  group by lnid   ")
-    public List<String> queryWindturbinebjCountLine(@Param(value = "alertruleid") String alertruleid);
 
-
-
-    @Delete(" delete from ProEconWindturbineWarnCount where recodedate=#{recodedate} ")
-    public int deleteWindturbinebjcount(@Param(value = "recodedate") Date recodedate);
+    @Delete(" delete from pro_econ_windturbine_warn_count where record_date=#{record_date} ")
+    public int deleteWindturbinebjcount(@Param(value = "record_date") Date record_date);
 }

+ 3 - 0
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/model/auto/ProEconHealthReportTarget.java

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

+ 3 - 0
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/model/auto/ProEconStateJudgmentDay.java

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

+ 3 - 0
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/model/auto/ProEconStateJudgmentReal.java

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

+ 437 - 402
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/HealthFactoryService.java

@@ -22,416 +22,451 @@ import java.util.regex.Pattern;
 
 @Service
 public class HealthFactoryService {
-	
-	private final int DIGIT = 2;
-	@Autowired
-	private IProEconEquipmentInfoDay1Service  proEconEquipmentInfoDay1Service;
-	@Autowired
-	private IProEconCurveFittingSubService  proEconCurveFittingSubService;
-
-	public Object judegeHealth(HcEnum hc, ProBasicEquipment wt, Calendar c) throws Exception {
-		Object result = null;
-		if (StringUtils.notEmp(hc) && StringUtils.notEmp(wt.getId()) && StringUtils.notEmp(c)) {
-
-			if (StringUtils.notEmp(hc)) {
-				switch (hc) {
-				case DJPG_FS:
-					result = getDjpg(wt, result, c);
-					break;
-				case JKFX_CS:
-					result=getJkbj(wt, result, c);
-					break;
-				case QXPCL:
-					result=getQxqcl(wt, result, c);
-					break;
-				case XNSSL:
-					result=getXnssl(wt, result, c);
-					break;
-				case XFQRQC:
-					result=getQxpcfx(wt, result, c, hc);
-					break;
-				case ZCCL:
-					result=getQxpcfx(wt, result, c, hc);
-					break;
-				case DFEDCL:
-					result=getQxpcfx(wt, result, c, hc);
-					break;
+
+    private final int DIGIT = 2;
+    @Autowired
+    private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
+    @Autowired
+    private IProEconCurveFittingSubService proEconCurveFittingSubService;
+
+    public Object judegeHealth(HcEnum hc, ProBasicEquipment wt, Calendar c) throws Exception {
+        Object result = null;
+        if (StringUtils.notEmp(hc) && StringUtils.notEmp(wt.getId()) && StringUtils.notEmp(c)) {
+
+            if (StringUtils.notEmp(hc)) {
+                switch (hc) {
+                    case DJPG_FS:
+                        result = getDjpg(wt, result, c);
+                        break;
+                    case JKFX_CS:
+                        result = getJkbj(wt, result, c);
+                        break;
+                    case QXPCL:
+                        result = getQxqcl(wt, result, c);
+                        break;
+                    case XNSSL:
+                        result = getXnssl(wt, result, c);
+                        break;
+                    case XFQRQC:
+                        result = getQxpcfx(wt, result, c, hc);
+                        break;
+                    case ZCCL:
+                        result = getQxpcfx(wt, result, c, hc);
+                        break;
+                    case DFEDCL:
+                        result = getQxpcfx(wt, result, c, hc);
+                        break;
 //                case PHDFPC:
 //                    result=getPhdfpcfx(wt, result, c, hc);
 //                    break;
-				default:
-					break;
-				}
-			}
-
-		}
-
-		return result;
-	}
-	public List<StatejudgmentrecordVo> djpgorder(List<StatejudgmentrecordVo> list, String orderby, Integer number){
-		Map<String, Double> djpgmap =HealthInitialService.djpgmap;
-		List<StatejudgmentrecordVo> djpglist = new ArrayList<StatejudgmentrecordVo>();
-		Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
-			@Override
-			public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
-				if (orderby.equals("asc")) {
-					// 从小到大
-					return djpgmap.get(o1.getWtId()).compareTo(djpgmap.get(o2.getWtId()));
-				}else if (orderby.equals("desc")) {
-					return djpgmap.get(o2.getWtId()).compareTo(djpgmap.get(o1.getWtId()));
-				}else{
-					return djpgmap.get(o1.getWtId()).compareTo(djpgmap.get(o2.getWtId()));
-				}
-			}
- 
-		});
-		for (int i = 0; i < list.size(); i++) {
-			if (i==number) {
-				break;
-			}
-			djpglist.add(list.get(i));
-			
-		}
-		return djpglist;
-	}
-	
-	
-	public List<StatejudgmentrecordVo> jkfxorder(List<StatejudgmentrecordVo> list,String orderby,Integer number){
-		Map<String, Double> jkfxmap =HealthInitialService.jkfxmap;
-		List<StatejudgmentrecordVo> jkfxlist = new ArrayList<StatejudgmentrecordVo>();
-		Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
-			@Override
-			public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
-				if (orderby.equals("asc")) {
-					// 从小到大
-					return jkfxmap.get(o1.getWtId()).compareTo(jkfxmap.get(o2.getWtId()));
-				}else if (orderby.equals("desc")) {
-					return jkfxmap.get(o2.getWtId()).compareTo(jkfxmap.get(o1.getWtId()));
-				}else{
-					return jkfxmap.get(o1.getWtId()).compareTo(jkfxmap.get(o2.getWtId()));
-				}
-			}
- 
-		});
-		for (int i = 0; i < list.size(); i++) {
-			if (i==number) {
-				break;
-			}
-			jkfxlist.add(list.get(i));
-			
-		}
-		return jkfxlist;
-	}
-	
-	
-	public List<StatejudgmentrecordVo> qxpclorder(List<StatejudgmentrecordVo> list,String orderby,Integer number){
-		Map<String, Double> qxpclmap =HealthInitialService.qxpclmap;
-		List<StatejudgmentrecordVo> qxpcllist = new ArrayList<StatejudgmentrecordVo>();
-		Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
-			@Override
-			public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
-				if (orderby.equals("asc")) {
-					// 从小到大
-					return qxpclmap.get(o1.getWtId()).compareTo(qxpclmap.get(o2.getWtId()));
-				}else if (orderby.equals("desc")) {
-					return qxpclmap.get(o2.getWtId()).compareTo(qxpclmap.get(o1.getWtId()));
-				}else{
-					return qxpclmap.get(o1.getWtId()).compareTo(qxpclmap.get(o2.getWtId()));
-				}
-			}
- 
-		});
-		for (int i = 0; i < list.size(); i++) {
-			if (i==number) {
-				break;
-			}
-			qxpcllist.add(list.get(i));
-			
-		}
-		return qxpcllist;
-	}
-	
-	
-	public List<StatejudgmentrecordVo> xnsslorder(List<StatejudgmentrecordVo> list,String orderby,Integer number){
-		Map<String, Double> xnsslmap =HealthInitialService.xnsslmap;
-		List<StatejudgmentrecordVo> xnssllist = new ArrayList<StatejudgmentrecordVo>();
-		Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
-			@Override
-			public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
-				if (orderby.equals("asc")) {
-					// 从小到大
-					return xnsslmap.get(o1.getWtId()).compareTo(xnsslmap.get(o2.getWtId()));
-				}else if (orderby.equals("desc")) {
-					return xnsslmap.get(o2.getWtId()).compareTo(xnsslmap.get(o1.getWtId()));
-				}else{
-					return xnsslmap.get(o1.getWtId()).compareTo(xnsslmap.get(o2.getWtId()));
-				}
-			}
- 
-		});
-		for (int i = 0; i < list.size(); i++) {
-			if (i==number) {
-				break;
-			}
-			xnssllist.add(list.get(i));
-			
-		}
-		return xnssllist;
-	}
-	
-	public List<StatejudgmentrecordVo> xfqrqcorder(List<StatejudgmentrecordVo> list,String orderby,Integer number){
-		Map<String, Double> xfqrqcmap =HealthInitialService.xfpdmap;
-		List<StatejudgmentrecordVo> xfqrqclist = new ArrayList<StatejudgmentrecordVo>();
-		Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
-			@Override
-			public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
-				if (orderby.equals("asc")) {
-					// 从小到大
-					return xfqrqcmap.get(o1.getWtId()).compareTo(xfqrqcmap.get(o2.getWtId()));
-				}else if (orderby.equals("desc")) {
-					return xfqrqcmap.get(o2.getWtId()).compareTo(xfqrqcmap.get(o1.getWtId()));
-				}else{
-					return xfqrqcmap.get(o1.getWtId()).compareTo(xfqrqcmap.get(o2.getWtId()));
-				}
-			}
- 
-		});
-		for (int i = 0; i < list.size(); i++) {
-			if (i==number) {
-				break;
-			}
-			xfqrqclist.add(list.get(i));
-			
-		}
-		return xfqrqclist;
-	}
-	
-	public List<StatejudgmentrecordVo> clpdorder(List<StatejudgmentrecordVo> list,String orderby,Integer number){
-		Map<String, Double> clpdmap =HealthInitialService.clpdmap;
-		List<StatejudgmentrecordVo> clpdlist = new ArrayList<StatejudgmentrecordVo>();
-		Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
-			@Override
-			public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
-				if (orderby.equals("asc")) {
-					// 从小到大
-					return clpdmap.get(o1.getWtId()).compareTo(clpdmap.get(o2.getWtId()));
-				}else if (orderby.equals("desc")) {
-					return clpdmap.get(o2.getWtId()).compareTo(clpdmap.get(o1.getWtId()));
-				}else{
-					return clpdmap.get(o1.getWtId()).compareTo(clpdmap.get(o2.getWtId()));
-				}
-			}
- 
-		});
-		for (int i = 0; i < list.size(); i++) {
-			if (i==number) {
-				break;
-			}
-			clpdlist.add(list.get(i));
-			
-		}
-		return clpdlist;
-	}
-	
-	public List<StatejudgmentrecordVo> dfclpdorder(List<StatejudgmentrecordVo> list,String orderby,Integer number){
-		Map<String, Double> dfclpdmap =HealthInitialService.dfpdmap;
-		List<StatejudgmentrecordVo> dfclpdlist = new ArrayList<StatejudgmentrecordVo>();
-		Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
-			@Override
-			public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
-				if (orderby.equals("asc")) {
-					// 从小到大
-					return dfclpdmap.get(o1.getWtId()).compareTo(dfclpdmap.get(o2.getWtId()));
-				}else if (orderby.equals("desc")) {
-					return dfclpdmap.get(o2.getWtId()).compareTo(dfclpdmap.get(o1.getWtId()));
-				}else{
-					return dfclpdmap.get(o1.getWtId()).compareTo(dfclpdmap.get(o2.getWtId()));
-				}
-			}
- 
-		});
-		for (int i = 0; i < list.size(); i++) {
-			if (i==number) {
-				break;
-			}
-			dfclpdlist.add(list.get(i));
-			
-		}
-		return dfclpdlist;
-	}
-	
-	public Integer getNumber(String top){
-		String regEx = "[^0-9]";// 匹配指定范围内的数字
-
-		// Pattern是一个正则表达式经编译后的表现模式
+                    default:
+                        break;
+                }
+            }
+
+        }
+
+        return result;
+    }
+
+    public List<StatejudgmentrecordVo> djpgorder(List<StatejudgmentrecordVo> list, String orderby, Integer number) {
+        Map<String, Double> djpgmap = HealthInitialService.djpgmap;
+        List<StatejudgmentrecordVo> djpglist = new ArrayList<StatejudgmentrecordVo>();
+        Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
+            @Override
+            public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
+                if (orderby.equals("asc")) {
+                    // 从小到大
+                    return djpgmap.get(o1.getWtId()).compareTo(djpgmap.get(o2.getWtId()));
+                } else if (orderby.equals("desc")) {
+                    return djpgmap.get(o2.getWtId()).compareTo(djpgmap.get(o1.getWtId()));
+                } else {
+                    return djpgmap.get(o1.getWtId()).compareTo(djpgmap.get(o2.getWtId()));
+                }
+            }
+
+        });
+        for (int i = 0; i < list.size(); i++) {
+            if (i == number) {
+                break;
+            }
+            djpglist.add(list.get(i));
+
+        }
+        return djpglist;
+    }
+
+
+    public List<StatejudgmentrecordVo> jkfxorder(List<StatejudgmentrecordVo> list, String orderby, Integer number) {
+        Map<String, Double> jkfxmap = HealthInitialService.jkfxmap;
+        List<StatejudgmentrecordVo> jkfxlist = new ArrayList<StatejudgmentrecordVo>();
+        Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
+            @Override
+            public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
+                if (orderby.equals("asc")) {
+                    // 从小到大
+                    return jkfxmap.get(o1.getWtId()).compareTo(jkfxmap.get(o2.getWtId()));
+                } else if (orderby.equals("desc")) {
+                    return jkfxmap.get(o2.getWtId()).compareTo(jkfxmap.get(o1.getWtId()));
+                } else {
+                    return jkfxmap.get(o1.getWtId()).compareTo(jkfxmap.get(o2.getWtId()));
+                }
+            }
+
+        });
+        for (int i = 0; i < list.size(); i++) {
+            if (i == number) {
+                break;
+            }
+            jkfxlist.add(list.get(i));
+
+        }
+        return jkfxlist;
+    }
+
+
+    public List<StatejudgmentrecordVo> qxpclorder(List<StatejudgmentrecordVo> list, String orderby, Integer number) {
+        Map<String, Double> qxpclmap = HealthInitialService.qxpclmap;
+        List<StatejudgmentrecordVo> qxpcllist = new ArrayList<StatejudgmentrecordVo>();
+        Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
+            @Override
+            public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
+                if (orderby.equals("asc")) {
+                    // 从小到大
+                    return qxpclmap.get(o1.getWtId()).compareTo(qxpclmap.get(o2.getWtId()));
+                } else if (orderby.equals("desc")) {
+                    return qxpclmap.get(o2.getWtId()).compareTo(qxpclmap.get(o1.getWtId()));
+                } else {
+                    return qxpclmap.get(o1.getWtId()).compareTo(qxpclmap.get(o2.getWtId()));
+                }
+            }
+
+        });
+        for (int i = 0; i < list.size(); i++) {
+            if (i == number) {
+                break;
+            }
+            qxpcllist.add(list.get(i));
+
+        }
+        return qxpcllist;
+    }
+
+
+    public List<StatejudgmentrecordVo> xnsslorder(List<StatejudgmentrecordVo> list, String orderby, Integer number) {
+        Map<String, Double> xnsslmap = HealthInitialService.xnsslmap;
+        List<StatejudgmentrecordVo> xnssllist = new ArrayList<StatejudgmentrecordVo>();
+        Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
+            @Override
+            public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
+                if (orderby.equals("asc")) {
+                    // 从小到大
+                    return xnsslmap.get(o1.getWtId()).compareTo(xnsslmap.get(o2.getWtId()));
+                } else if (orderby.equals("desc")) {
+                    return xnsslmap.get(o2.getWtId()).compareTo(xnsslmap.get(o1.getWtId()));
+                } else {
+                    return xnsslmap.get(o1.getWtId()).compareTo(xnsslmap.get(o2.getWtId()));
+                }
+            }
+
+        });
+        for (int i = 0; i < list.size(); i++) {
+            if (i == number) {
+                break;
+            }
+            xnssllist.add(list.get(i));
+
+        }
+        return xnssllist;
+    }
+
+    public List<StatejudgmentrecordVo> xfqrqcorder(List<StatejudgmentrecordVo> list, String orderby, Integer number) {
+        Map<String, Double> xfqrqcmap = HealthInitialService.xfpdmap;
+        List<StatejudgmentrecordVo> xfqrqclist = new ArrayList<StatejudgmentrecordVo>();
+        Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
+            @Override
+            public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
+                if (orderby.equals("asc")) {
+                    // 从小到大
+                    return xfqrqcmap.get(o1.getWtId()).compareTo(xfqrqcmap.get(o2.getWtId()));
+                } else if (orderby.equals("desc")) {
+                    return xfqrqcmap.get(o2.getWtId()).compareTo(xfqrqcmap.get(o1.getWtId()));
+                } else {
+                    return xfqrqcmap.get(o1.getWtId()).compareTo(xfqrqcmap.get(o2.getWtId()));
+                }
+            }
+
+        });
+        for (int i = 0; i < list.size(); i++) {
+            if (i == number) {
+                break;
+            }
+            xfqrqclist.add(list.get(i));
+
+        }
+        return xfqrqclist;
+    }
+
+    public List<StatejudgmentrecordVo> clpdorder(List<StatejudgmentrecordVo> list, String orderby, Integer number) {
+        Map<String, Double> clpdmap = HealthInitialService.clpdmap;
+        List<StatejudgmentrecordVo> clpdlist = new ArrayList<StatejudgmentrecordVo>();
+        Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
+            @Override
+            public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
+                if (orderby.equals("asc")) {
+                    // 从小到大
+                    return clpdmap.get(o1.getWtId()).compareTo(clpdmap.get(o2.getWtId()));
+                } else if (orderby.equals("desc")) {
+                    return clpdmap.get(o2.getWtId()).compareTo(clpdmap.get(o1.getWtId()));
+                } else {
+                    return clpdmap.get(o1.getWtId()).compareTo(clpdmap.get(o2.getWtId()));
+                }
+            }
+
+        });
+        for (int i = 0; i < list.size(); i++) {
+            if (i == number) {
+                break;
+            }
+            clpdlist.add(list.get(i));
+
+        }
+        return clpdlist;
+    }
+
+    public List<StatejudgmentrecordVo> dfclpdorder(List<StatejudgmentrecordVo> list, String orderby, Integer number) {
+        Map<String, Double> dfclpdmap = HealthInitialService.dfpdmap;
+        List<StatejudgmentrecordVo> dfclpdlist = new ArrayList<StatejudgmentrecordVo>();
+        Collections.sort(list, new Comparator<StatejudgmentrecordVo>() {
+            @Override
+            public int compare(StatejudgmentrecordVo o1, StatejudgmentrecordVo o2) {
+                if (orderby.equals("asc")) {
+                    // 从小到大
+                    return dfclpdmap.get(o1.getWtId()).compareTo(dfclpdmap.get(o2.getWtId()));
+                } else if (orderby.equals("desc")) {
+                    return dfclpdmap.get(o2.getWtId()).compareTo(dfclpdmap.get(o1.getWtId()));
+                } else {
+                    return dfclpdmap.get(o1.getWtId()).compareTo(dfclpdmap.get(o2.getWtId()));
+                }
+            }
+
+        });
+        for (int i = 0; i < list.size(); i++) {
+            if (i == number) {
+                break;
+            }
+            dfclpdlist.add(list.get(i));
+
+        }
+        return dfclpdlist;
+    }
+
+    public Integer getNumber(String top) {
+        String regEx = "[^0-9]";// 匹配指定范围内的数字
+
+        // Pattern是一个正则表达式经编译后的表现模式
         Pattern p = Pattern.compile(regEx);
 
-		// 一个Matcher对象是一个状态机器,它依据Pattern对象做为匹配模式对字符串展开匹配检查。
+        // 一个Matcher对象是一个状态机器,它依据Pattern对象做为匹配模式对字符串展开匹配检查。
         Matcher m = p.matcher(top);
 
-		// 将输入的字符串中非数字部分用空格取代并存入一个字符串
+        // 将输入的字符串中非数字部分用空格取代并存入一个字符串
         String string = m.replaceAll(" ").trim();
 
-       return Integer.parseInt(string);
-	}
-	private Object getXnssl(ProBasicEquipment wt, Object result, Calendar c) throws Exception {
-
-		Map<String, LossPowerRateVo> lwmap = HealthInitialService.lwmap;// 获得每台风机性能损失基准值
-		Map<String, List<ProEconEquipmentInfoDay1>> wimap = HealthInitialService.wimap;// 获得每台风机三天损失电量统计
-
-		double jzz = 0.0;
-
-		if (lwmap.containsKey(wt.getId())) {
-			try {
-				LossPowerRateVo losspower = lwmap.get(wt.getId());
-				jzz = losspower.getRate();
-			} catch (Exception e) {
-				jzz = 0.0;
-				System.out.println(wt.getId());
-			}
-
-		}
-
-		if (wimap.containsKey(wt.getId())) {
-			double xnssrate1 = 0.0;
-			double xnssrate2 = 0.0;
-			double xnssrate3 = 0.0;
-			// 获得风机近三天性能损失率
-			Map<String, List<Double>> xnssrateMap = proEconEquipmentInfoDay1Service.findLosspowerMap(wimap, wt);
-
-			if (xnssrateMap.containsKey(wt.getId())) {
-				List<Double> xnssratels = xnssrateMap.get(wt.getId());
-				if (xnssratels.size() >= 3) {
-					xnssrate1 = null != xnssratels.get(0) ? xnssratels.get(0)
-							: 0.0;
-					xnssrate2 = null != xnssratels.get(1) ? xnssratels.get(1)
-							: 0.0;
-					xnssrate3 = null != xnssratels.get(2) ? xnssratels.get(2)
-							: 0.0;
-					if (xnssrate1 > jzz && xnssrate2 > jzz && xnssrate3 > jzz) {
-						result = true;
-					} else {
-						result = false;
-					}
-				} else if (xnssratels.size() < 3) {
-					return false;
-				}
-
-
-				
-			}
-
-		}
-		return result;
-	}
-
-	private Object getQxqcl(ProBasicEquipment wt, Object result, Calendar c) throws Exception {
-		int number = 0;
-		double jzz = 0.0;
-		Map<String, Double> cfsbase = HealthInitialService.cfsbase;
-		if (cfsbase.containsKey(wt.getId())) {
-			jzz = cfsbase.get(wt.getId());
-		}
-
-		for (int i = 0; i < 3; i++) {
-			c.add(Calendar.DAY_OF_MONTH, -1);
-			Map<String, List<ProEconCurveFittingSub>> daymap = proEconCurveFittingSubService.findCurvefittingmapByDate(DateUtils.truncate(c.getTime()), wt.getId(),5.0,10.0);
-			double temp = getNuberValue(daymap, wt);
-
-			if (temp > jzz) {
-				number++;
-			}
-		}
-
-		if (number == 3) {
-			result = true;
-		} else {
-			result = false;
-		}
-		return result;
-	}
-	
-	
-	private Object getJkbj(ProBasicEquipment wt, Object result, Calendar c) throws Exception {
-		
-		
-		Map<String, Double> yxmap =HealthInitialService.yxmap;
-		
-		if(yxmap.containsKey(wt.getId()))
-		{
-			result =yxmap.get(wt.getId());
-		}else
-		{
-			result=0;
-		}
-	
-		return result;
-	}
-
-	private Object getDjpg(ProBasicEquipment wt, Object result, Calendar c) throws Exception {
-		
-		
-		Map<String, Double> xnmap =HealthInitialService.xnmap;
-		
-		if(xnmap.containsKey(wt.getId()))
-		{
-			result =xnmap.get(wt.getId());
-		}else
-		{
-			result=0;
-		}
-	
-		return result;
-	}
-	public double getNuberValue(Map<String, List<ProEconCurveFittingSub>> daymap, ProBasicEquipment wt) {
-
-		if (daymap.containsKey(wt.getId())) {
-
-			List<ProEconCurveFittingSub> cfsls = daymap.get(wt.getId());
-			if (!cfsls.isEmpty()) {
-
-				double result = 0.0;
-				for (ProEconCurveFittingSub sub : cfsls) {
-					double value = null != sub.getDeviationRate2() ? sub.getDeviationRate2() : 0;
-					result = result + value;
-				}
-
-				result = new BigDecimal(result).divide(new BigDecimal(cfsls.size()), DIGIT, RoundingMode.HALF_EVEN).doubleValue();
-				return result;
-			}
-
-		}
-		return 0.0;
-	}
-	
-	
-	private Object getQxpcfx(ProBasicEquipment wt, Object result, Calendar c,HcEnum hc) throws Exception {
-
-		Map<String, List<ProEconCurveFittingSub>> cfmap =null;
-		c.add(Calendar.DAY_OF_MONTH, -1);
-		switch (hc) {
-		
-		case XFQRQC:
-			cfmap =proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 3.0, 5.0);
-			double qxpc1 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
-			result=Math.abs(qxpc1);
-			break;
-		case ZCCL:
-			cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 5.0, 11.0);
-			double qxpc2 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
-			result=Math.abs(qxpc2);
-			break;
-		case DFEDCL:
-			cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 11.0, 25.0);
-			double qxpc3 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
-			result=Math.abs(qxpc3);
-			break;
-		default:
-			break;
-		}
-
-		return result;
-	}
+        return Integer.parseInt(string);
+    }
+
+    private Object getXnssl(ProBasicEquipment wt, Object result, Calendar c) throws Exception {
+
+        Map<String, LossPowerRateVo> lwmap = HealthInitialService.lwmap;// 获得每台风机性能损失基准值
+        Map<String, List<ProEconEquipmentInfoDay1>> wimap = HealthInitialService.wimap;// 获得每台风机三天损失电量统计
+
+        double jzz = 0.0;
+        result=false;
+        if (lwmap.containsKey(wt.getId())) {
+            try {
+                LossPowerRateVo losspower = lwmap.get(wt.getId());
+                jzz = losspower.getRate();
+            } catch (Exception e) {
+                jzz = 0.0;
+                System.out.println(wt.getId());
+            }
+
+        }
+
+        if (wimap.containsKey(wt.getId())) {
+            double xnssrate1 = 0.0;
+            double xnssrate2 = 0.0;
+            double xnssrate3 = 0.0;
+            // 获得风机近三天性能损失率
+            Map<String, List<Double>> xnssrateMap = proEconEquipmentInfoDay1Service.findLosspowerMap(wimap, wt);
+
+            if (xnssrateMap.containsKey(wt.getId())) {
+                List<Double> xnssratels = xnssrateMap.get(wt.getId());
+                if (xnssratels.size() >= 3) {
+                    xnssrate1 = null != xnssratels.get(0) ? xnssratels.get(0)
+                            : 0.0;
+                    xnssrate2 = null != xnssratels.get(1) ? xnssratels.get(1)
+                            : 0.0;
+                    xnssrate3 = null != xnssratels.get(2) ? xnssratels.get(2)
+                            : 0.0;
+                    if (xnssrate1 > jzz && xnssrate2 > jzz && xnssrate3 > jzz) {
+                        result = true;
+                    } else {
+                        result = false;
+                    }
+                } else if (xnssratels.size() < 3) {
+                    return false;
+                }
+
+
+            }
+
+        }
+
+        return result;
+    }
+
+    private Object getQxqcl(ProBasicEquipment wt, Object result, Calendar c) throws Exception {
+        int number = 0;
+        double jzz = 0.0;
+        Map<String, Double> cfsbase = HealthInitialService.cfsbase;
+        if (cfsbase.containsKey(wt.getId())) {
+            jzz = cfsbase.get(wt.getId());
+        }
+
+        result=false;
+        Map<String, List<ProEconCurveFittingSub>> daymap = proEconCurveFittingSubService.findCurvefittingmapByDate(DateUtils.truncate(c.getTime()), 5.0, 10.0);
+        for (int i = 0; i < 3; i++) {
+            c.add(Calendar.DAY_OF_MONTH, -1);
+
+            double temp = getNuberValue(daymap, wt);
+
+            if (temp > jzz) {
+                number++;
+            }
+        }
+
+        if (number == 3) {
+            result = true;
+        } else {
+            result = false;
+        }
+        return result;
+    }
+
+
+    private Object getJkbj(ProBasicEquipment wt, Object result, Calendar c) throws Exception {
+
+
+        Map<String, Double> yxmap = HealthInitialService.yxmap;
+
+        if (yxmap.containsKey(wt.getId())) {
+            result = yxmap.get(wt.getId());
+        } else {
+            result = 0;
+        }
+
+        return result;
+    }
+
+    private Object getDjpg(ProBasicEquipment wt, Object result, Calendar c) throws Exception {
+
+
+        Map<String, Double> xnmap = HealthInitialService.djpgmap;
+
+        if (xnmap.containsKey(wt.getId())) {
+            result = xnmap.get(wt.getId());
+        } else {
+            result = 0;
+        }
+
+        return result;
+    }
+
+    public double getNuberValue(Map<String, List<ProEconCurveFittingSub>> daymap, ProBasicEquipment wt) {
+
+        if (daymap.containsKey(wt.getId())) {
+
+            List<ProEconCurveFittingSub> cfsls = daymap.get(wt.getId());
+            if (!cfsls.isEmpty()) {
+
+                double result = 0.0;
+                for (ProEconCurveFittingSub sub : cfsls) {
+                    double value = null != sub.getDeviationRate2() ? sub.getDeviationRate2() : 0;
+                    result = result + value;
+                }
+
+                result = new BigDecimal(result).divide(new BigDecimal(cfsls.size()), DIGIT, RoundingMode.HALF_EVEN).doubleValue();
+                return result;
+            }
+
+        }
+        return 0.0;
+    }
+
+
+    private Object getQxpcfx(ProBasicEquipment wt, Object result, Calendar c, HcEnum hc) throws Exception {
+
+//		Map<String, List<ProEconCurveFittingSub>> cfmap =null;
+//		c.add(Calendar.DAY_OF_MONTH, -1);
+//		switch (hc) {
+//
+//		case XFQRQC:
+//			cfmap =proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 3.0, 5.0);
+//			double qxpc1 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//			result=Math.abs(qxpc1);
+//			break;
+//		case ZCCL:
+//			cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 5.0, 11.0);
+//			double qxpc2 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//			result=Math.abs(qxpc2);
+//			break;
+//		case DFEDCL:
+//			cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 11.0, 25.0);
+//			double qxpc3 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//			result=Math.abs(qxpc3);
+//			break;
+//		default:
+//			break;
+//		}
+        Map<String, Double> xfpdmap = HealthInitialService.xfpdmap;
+        Map<String, Double> clpdmap = HealthInitialService.clpdmap;
+        Map<String, Double> dfpdmap = HealthInitialService.dfpdmap;
+        switch (hc) {
+
+            case XFQRQC:
+                if (xfpdmap.containsKey(wt.getId())) {
+                    result = xfpdmap.get(wt.getId());
+                }else
+                {
+                    result = 0.0;
+                }
+                break;
+            case ZCCL:
+                if (clpdmap.containsKey(wt.getId())) {
+                    result = clpdmap.get(wt.getId());
+                }else
+                {
+                    result = 0.0;
+                }
+
+                break;
+            case DFEDCL:
+                if (dfpdmap.containsKey(wt.getId())) {
+                    result = dfpdmap.get(wt.getId());
+                }else
+                {
+                    result = 0.0;
+                }
+                break;
+            default:
+                break;
+        }
+
+
+        return result;
+    }
 
 
 //    private Object getPhdfpcfx(ProBasicEquipment wt, Object result, Calendar c,HcEnum hc) throws Exception {
@@ -453,5 +488,5 @@ public class HealthFactoryService {
 //        }
 //        return result;
 //    }
-	
+
 }

+ 24 - 2
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/HealthInitialService.java

@@ -40,7 +40,7 @@ public class HealthInitialService {
     public static Map<String, List<ProEconEquipmentInfoDay1>> wimap;
     public static Map<String, List<ProEconCurveFittingMain>> cfvmap;
     public static Map<String, Double> yxmap;
-    public static Map<String, Double> xnmap;
+
     public static Map<String, Double> cfsbase;
 
     /***********************************************************************************/
@@ -56,14 +56,18 @@ public class HealthInitialService {
 //    public static Map<String, Integer>phdfpcmap;
     /************************************************************************************/
 
+    public static Map<String, Double> djpgchagemap;
+    public static Map<String, Double> xfpdchagemap;
+    public static Map<String, Double> clpdchagemap;
 
+    public static Map<String, Double> dfpdchagemap;
     public void healthInitial() throws Exception {
 
         Calendar c = Calendar.getInstance();
         c.set(Calendar.HOUR_OF_DAY, 0);
         c.set(Calendar.MINUTE, 0);
         c.set(Calendar.SECOND, 0);
-
+        c.add(Calendar.DAY_OF_MONTH, -1);
 
         lwmap = losspowerratesService.findLosspowerrateMap();// 获得每台风机性能损失基准值
         wimap = proEconEquipmentInfoDay1Service.findEconEquipmentInfoDay1Map(c);// 获得每台风机三天损失电量统计
@@ -89,4 +93,22 @@ public class HealthInitialService {
 
     }
 
+
+    public void healthChangeInitial() throws Exception {
+
+        Calendar c = Calendar.getInstance();
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.add(Calendar.DAY_OF_MONTH, -1);
+
+        // 性能分析风机得分map
+        djpgchagemap = proEconEquipmentInfoDayTopService.findXnfx(c.getTime());
+
+        xfpdchagemap = masterDataService.findxfpd();
+        clpdchagemap = masterDataService.findclpd();
+        dfpdchagemap = masterDataService.finddfpd();
+
+
+    }
 }

+ 94 - 66
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/HealthJudgeService.java

@@ -72,7 +72,7 @@ public class HealthJudgeService {
 
     public void changeHealthModelValue() throws Exception {
 
-//        healthInitialService.healthInitial();// 初始化函数算法模型数据
+        healthInitialService.healthChangeInitial();// 初始化函数算法模型数据
 
         List<String> codels = new ArrayList<String>();
         codels.add(ContantXk.JKZT002);
@@ -83,7 +83,7 @@ public class HealthJudgeService {
         List<ProEconStateJudgmentReal> pols = new ArrayList<>();
         for (ProBasicEquipment wt : CacheContext.wtls) {
 
-            if (wt.getWindpowerstationId().endsWith("FDC")) {
+            if (wt.getWindpowerstationId().contains("FDC")) {
 
                 ProEconStateJudgmentReal po = new ProEconStateJudgmentReal();
                 po.setId(com.gyee.common.model.StringUtils.getUUID());
@@ -101,6 +101,10 @@ public class HealthJudgeService {
                     if (point.getPointValueInDouble() == StatusDetailValue.GZ.getCode()) {
                         fjzt = StatusDetailValue.GZ.getCode();
                     }
+
+                    if (point.getPointValueInDouble() == StatusDetailValue.JX.getCode()) {
+                        fjzt = StatusDetailValue.JX.getCode();
+                    }
                 }
 
 //                String[] points = new String[codels.size()];
@@ -119,7 +123,7 @@ public class HealthJudgeService {
 
                 ProBasicEquipmentPoint fjjkzf = proBasicEquipmentPointsService.getEquipmentPoint(wt.getId(), ContantXk.JKZT100);
                 List<PointData> ssvalues = realApiUtil.getRealData(points);
-//                DNAVal[] ssvalues = realApiUtil.getRealtimeTagValues(points);
+
 
                 PointData fjjkzfpoint = new PointData();
                 fjjkzfpoint.setEdnaId(fjjkzf.getNemCode());
@@ -137,84 +141,112 @@ public class HealthJudgeService {
                 }
 
 
-                fjjkzfpoint.setPointValueInDouble(score);
-                realApiUtil.updatePoint(fjjkzfpoint);
 
                 // 出现故障状态,直接降到10分 差
-                if (fjzt ==StatusDetailValue.GZ.getCode()) {
+                if (fjzt ==StatusDetailValue.GZ.getCode() || fjzt ==StatusDetailValue.JX.getCode()) {
                     score = 10.0;
                     statejudgment.append("1-");
                 } else {
                     statejudgment.append("0-");
                 }
-                // 齿轮箱、发电机、变浆、主控健康运行状态同时大于等于2
-                if (clxzt >= 2 && fdjzt >= 2 && bjzt >= 2 && zkzt >= 2 || (clxzt == 4 || fdjzt == 4 || bjzt == 4 || zkzt == 4)) {
+
+                if(clxzt==4 || fdjzt==4 || bjzt==4 || zkzt==4)
+                {
                     score = setScoreValue(score);
                     statejudgment.append("1-");
-                } else {
+                }else if(clxzt==3 || fdjzt==3 || bjzt==3 || zkzt==3)
+                {
+                    score = setScoreValue(score);
+                    statejudgment.append("1-");
+                }else {
                     statejudgment.append("0-");
                 }
 
-                Map<String, Double> xnmap = proEconEquipmentInfoDayTopService.findXnfx(Calendar.getInstance().getTime());
 
+//                Map<String, Double> xnmap = proEconEquipmentInfoDayTopService.findXnfx(Calendar.getInstance().getTime());
+                Map<String, Double> xnmap=HealthInitialService.djpgchagemap;
                 if (xnmap.containsKey(wt.getId())) {
                     double djpgscore = xnmap.get(wt.getId());
                     if (djpgscore < 60) {
                         setScoreValue(score);
                         statejudgment.append("1-");
+                    }else {
+                        statejudgment.append("0-");
                     }
                 } else {
                     statejudgment.append("0-");
                 }
 
-                Map<String, List<ProEconCurveFittingSub>> cfmap = null;
-                Calendar c = Calendar.getInstance();
-                c.add(Calendar.DAY_OF_MONTH, -1);
-
-
-                cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 3.0, 5.0);
-                double qxpc1 = proEconCurveFittingSubService.getNuberValue(cfmap, wt);
-                double xfqrqc = Math.abs(qxpc1);
-                //小风曲线偏差
-                if (xfqrqc > 5) {
-                    setScoreValue(score);
-                    statejudgment.append("1-");
-                } else {
+//                Map<String, List<ProEconCurveFittingSub>> cfmap = null;
+//                Calendar c = Calendar.getInstance();
+//                c.add(Calendar.DAY_OF_MONTH, -1);
+//
+//
+////                cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 3.0, 5.0);
+//
+//                double qxpc1 = proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//                double xfqrqc = Math.abs(qxpc1);
+                Map<String, Double> xfpdmap=HealthInitialService.xfpdchagemap;
+                if(xfpdmap.containsKey(wt.getId()))
+                {
+                    double xfqrqc =xfpdmap.get(wt.getId());
+                    //小风曲线偏差
+                    if (xfqrqc > 5) {
+                        setScoreValue(score);
+                        statejudgment.append("1-");
+                    } else {
+                        statejudgment.append("0-");
+                    }
+                }else {
                     statejudgment.append("0-");
                 }
-                cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 5.0, 11.0);
-                double qxpc2 = proEconCurveFittingSubService.getNuberValue(cfmap, wt);
-                double zcclqc = Math.abs(qxpc2);
-                //正常出力曲线偏差
-                if (zcclqc > 5) {
-                    setScoreValue(score);
-                    statejudgment.append("1-");
-                } else {
+
+//                cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 5.0, 11.0);
+//                double qxpc2 = proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//                double zcclqc = Math.abs(qxpc2);
+
+                Map<String, Double> clpdmap=HealthInitialService.clpdchagemap;
+                if(clpdmap.containsKey(wt.getId()))
+                {
+                    double zcclqc =clpdmap.get(wt.getId());
+                    //正常出力曲线偏差
+                    if (zcclqc > 5) {
+                        setScoreValue(score);
+                        statejudgment.append("1-");
+                    } else {
+                        statejudgment.append("0-");
+                    }
+                }else {
                     statejudgment.append("0-");
                 }
-                cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 11.0, 25.0);
-                double qxpc3 = proEconCurveFittingSubService.getNuberValue(cfmap, wt);
-                double dfqrqc = Math.abs(qxpc3);
-                //大风曲线偏差
-                if (dfqrqc > 5) {
-                    setScoreValue(score);
-                    statejudgment.append("1-");
-                } else {
+//
+//                cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 11.0, 25.0);
+//                double qxpc3 = proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//                double dfqrqc = Math.abs(qxpc3);
+
+                Map<String, Double> dfpdmap=HealthInitialService.dfpdchagemap;
+                if(dfpdmap.containsKey(wt.getId()))
+                {
+                    double dfqrqc =dfpdmap.get(wt.getId());
+                    //大风曲线偏差
+                    if (dfqrqc > 5) {
+                        setScoreValue(score);
+                        statejudgment.append("1-");
+                    } else {
+                        statejudgment.append("0-");
+                    }
+                }else {
                     statejudgment.append("0-");
                 }
 
-                fjjkzf = proBasicEquipmentPointsService.getEquipmentPoint(wt.getId(), ContantXk.JKZT100);
 
-                fjjkzfpoint = new PointData();
-                fjjkzfpoint.setEdnaId(fjjkzf.getNemCode());
-                fjjkzfpoint.setPointTime(new BigDecimal(new Date().getTime()).divide(new BigDecimal(1000), 0, RoundingMode.HALF_EVEN).longValue());
+                po.setStateJudgment(String.valueOf(statejudgment.substring(0, statejudgment.length() - 1)));
+
+                pols.add(po);
 
                 fjjkzfpoint.setPointValueInDouble(score);
                 realApiUtil.updatePoint(fjjkzfpoint);
 
-                po.setStateJudgment(String.valueOf(statejudgment.substring(0, statejudgment.length() - 1)));
-
-                pols.add(po);
             }
         }
 
@@ -222,9 +254,11 @@ public class HealthJudgeService {
         proEconStateJudgmentRealService.deleteProEconStateJudgmentReal();
 
         if (!pols.isEmpty()) {
-            for (ProEconStateJudgmentReal po : pols) {
-                proEconStateJudgmentRealService.insertStatejudgmentrecord(po);
-            }
+
+            proEconStateJudgmentRealService.saveOrUpdateBatch(pols);
+//            for (ProEconStateJudgmentReal po : pols) {
+//                proEconStateJudgmentRealService.insertStatejudgmentrecord(po);
+//            }
         }
         System.out.println("结束健康模型分数计算!");
     }
@@ -233,16 +267,17 @@ public class HealthJudgeService {
         if (score >= 60) {
             score = score - 20.0;
         } else if (score < 60 && score >= 30) {
-            score = score - 10.0;
+            score = score -10;
         } else {
             score = 10.0;
         }
         return score;
     }
 
-    public void healthJudge3() throws Exception {
+    public void healthJudge() throws Exception {
 
         ScriptJava sj = new ScriptJava();
+
         healthInitialService.healthInitial();// 初始化函数算法模型数据
 
         Map<String, Integer> maps = new HashMap<>();
@@ -250,7 +285,7 @@ public class HealthJudgeService {
         Map<String, List<ProEconHealthSystemSub>> hsmap = new HashMap<>();
 
         Map<String, HcEnum> hcmap = new HashMap<>();
-        /*Map<String, Alertrulesub> submap = new HashMap<>();*/
+
         Map<String, Object> parmarsmap = new HashMap<>();
 
         for (HcEnum e : HcEnum.values()) {
@@ -261,15 +296,6 @@ public class HealthJudgeService {
         Map<String, List<ProEconHealthSystemSub>> map = proEconHealthSystemSubService.queryHealthSystemSubMap();
         if (!hsls.isEmpty()) {
             for (ProEconHealthSystem hs : hsls) {
-//				List<ProEconHealthSystemSub> subls = proEconHealthSystemSubService.queryHealthSystemSub(hs.getId());
-//				if (!subls.isEmpty()) {
-//					StringBuilder sb = new StringBuilder();
-//					sb.append(hs.getWpId()).append("_").append(hs.getModelId());
-//					if (!hsmap.containsKey(String.valueOf(sb))) {
-//						hsmap.put(String.valueOf(sb), subls);
-//					}
-//
-//				}
 
                 if (map.containsKey(hs.getId())) {
                     List<ProEconHealthSystemSub> subls = map.get(hs.getId());
@@ -290,7 +316,7 @@ public class HealthJudgeService {
         proEconStateJudgmentDayService.deleteProEconStateJudgmentDay();
         List<ProEconStateJudgmentDay> polist = new ArrayList<>();
         for (ProBasicEquipment wt : CacheContext.wtls) {
-            if (wt.getWindpowerstationId().endsWith("FDC")) {
+            if (wt.getWindpowerstationId().contains("FDC")) {
 
                 StringBuilder sb = new StringBuilder();
                 sb.append(wt.getWindpowerstationId()).append("_").append(wt.getModelId());
@@ -394,6 +420,7 @@ public class HealthJudgeService {
                         }
 
                     });
+
                     for (int i = 0; i < rlist.size(); i++) {
                         ProEconStateJudgmentDay po = rlist.get(i);
                         Boolean isHave = false;
@@ -448,7 +475,7 @@ public class HealthJudgeService {
                             if (maps.containsKey(po.getWpId())) {
                                 int temp = maps.get(po.getWpId()) + 1;
                                 if (temp > 2) {
-                                    po.setJudgmentDescribe("健康指标未达到推荐级别,不予推荐!");
+                                    po.setJudgmentDescribe("设备健康情况不良,但推荐等级偏低,还需继续观察!");
                                 } else {
                                     po.setJudgmentDescribe("健康报告达到推荐级别,推荐检修!");
                                 }
@@ -462,10 +489,11 @@ public class HealthJudgeService {
                             po.setJudgmentDescribe("健康指标未达到推荐级别,不予推荐!");
                         }
 
-                        proEconStateJudgmentDayService.insertProEconStateJudgmentDay(po);
-                    }
 
+                     //  proEconStateJudgmentDayService.save(po);
+                    }
 
+                    proEconStateJudgmentDayService.saveOrUpdateBatch(rlist);
                 }
 
             }
@@ -490,7 +518,7 @@ public class HealthJudgeService {
         Date date = c.getTime();
         c.add(Calendar.DAY_OF_MONTH, -1);
         Date endDate = c.getTime();
-        c.add(Calendar.DAY_OF_MONTH, -8);
+        c.add(Calendar.DAY_OF_MONTH, -15);
         Date beginDate = c.getTime();
         Map<String, ResultVo> map = new HashMap<String, ResultVo>();
         List<String> resultList = new ArrayList<String>();

+ 438 - 6
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/HealthReportService.java

@@ -128,6 +128,7 @@ public class HealthReportService {
 
 
         List<String> namels = new ArrayList<>();
+        namels.add("fdl");
         namels.add("qxpc35");
         namels.add("qxpc511");
         namels.add("qxpc11");
@@ -141,6 +142,7 @@ public class HealthReportService {
         namels.add("sbklyl");
         namels.add("xnpf");
         namels.add("jxss");
+        namels.add("jxss");
         namels.add("gzss");
         namels.add("slss");
         namels.add("xdss");
@@ -157,11 +159,12 @@ public class HealthReportService {
         List<ProEconHealthReportMain> hrmls = new ArrayList<>();
         List<ProEconHealthReportTarget> hrtls = new ArrayList<>();
         for (ProBasicEquipment wt : CacheContext.wtls) {
-            if (!wt.getId().contains("_F_")) {
+            if (!wt.getWindpowerstationId().contains("FDC")) {
                 continue;
             }
 
             ProEconHealthReportMain po = totalProEconHealthReportMain(recordDate, eid1map, eid2map, eid4map, eidTopmap, eid1LastMonth1map, eid2LastMonth1map, eid4LastMonth1map, eidTopLastMonth1map, eid1LastMonth2map, eid2LastMonth2map, eid4LastMonth2map, eidTopLastMonth2map, sjmap, whmap, stmap, rlxs, syrlxs, wt);
+           po.setId(StringUtils.getUUID());
             hrmls.add(po);
             Map<String, ProEconHealthReportTarget> hrmap = new LinkedHashMap<>();
             for (String name : namels) {
@@ -190,8 +193,39 @@ public class HealthReportService {
 
         }
 
-        proEconHealthReportMainService.saveOrUpdateBatch(hrmls);
-        proEconHealthReportTargetService.saveOrUpdateBatch(hrtls);
+        List<ProEconHealthReportMain> templs=new ArrayList<>();
+        for(ProEconHealthReportMain vo:hrmls)
+        {
+            templs.add(vo);
+            if(templs.size()==100)
+            {
+                proEconHealthReportMainService.saveOrUpdateBatch(templs);
+                templs=new ArrayList<>();
+            }
+        }
+
+        if(!templs.isEmpty())
+        {
+            proEconHealthReportMainService.saveOrUpdateBatch(templs);
+        }
+
+        List<ProEconHealthReportTarget> temp2ls=new ArrayList<>();
+        for(ProEconHealthReportTarget vo:hrtls)
+        {
+            temp2ls.add(vo);
+            if(temp2ls.size()==100)
+            {
+                proEconHealthReportTargetService.saveOrUpdateBatch(temp2ls);
+                temp2ls=new ArrayList<>();
+            }
+        }
+
+        if(!temp2ls.isEmpty())
+        {
+            proEconHealthReportTargetService.saveOrUpdateBatch(temp2ls);
+        }
+//        proEconHealthReportMainService.saveOrUpdateBatch(hrmls);
+//        proEconHealthReportTargetService.saveOrUpdateBatch(hrtls);
     }
 
     /**
@@ -835,7 +869,13 @@ public class HealthReportService {
                 int daysdiff = DateUtils.daysDiff(recordDate, sd.getStopTime());
                 double monthdiff = new BigDecimal(daysdiff).divide(new BigDecimal(30), 2, BigDecimal.ROUND_HALF_UP).doubleValue();
                 po.setJxjgsc(monthdiff);
+            }else
+            {
+                po.setJxjgsc(0.0);
             }
+        }else
+        {
+            po.setJxjgsc(0.0);
         }
         //月度故障次数
         if (stmap.containsKey(wt.getId())) {
@@ -843,7 +883,13 @@ public class HealthReportService {
 
             if (StringUtils.notEmp(sd) && StringUtils.notEmp(sd.getStopNum())) {
                 po.setYgzcs(Double.parseDouble(String.valueOf(sd.getStopNum())));
+            }else
+            {
+                po.setYgzcs(0.0);
             }
+        }else
+        {
+            po.setYgzcs(0.0);
         }
 
         if (eid1map.containsKey(wt.getId())) {
@@ -862,6 +908,10 @@ public class HealthReportService {
             }
             //月风能利用率
             po.setYfnlyl(fnlyl);
+        }else
+        {
+            po.setYfnlyl(0.0);
+            po.setMonthFdl(0.0);
         }
 
 
@@ -883,6 +933,9 @@ public class HealthReportService {
             }
 
             po.setYfnlylhb(fnlylhb);
+        }else
+        {
+            po.setYfnlylhb(0.0);
         }
 
 
@@ -898,6 +951,10 @@ public class HealthReportService {
             }
             po.setYlyxs(lyxs);
 
+        }else
+        {
+            po.setYlyxs(0.0);
+
         }
 
         if (eid2LastMonth1map.containsKey(wt.getId())) {
@@ -917,6 +974,10 @@ public class HealthReportService {
             }
 
             po.setYlyxshb(lyxshb);
+        }else
+        {
+            po.setYlyxshb(0.0);
+
         }
 
 
@@ -945,6 +1006,16 @@ public class HealthReportService {
             double ymttf = eid4.getYmttf();
             po.setYmttf(ymttf);
 
+        }else
+        {
+            po.setY35mqxpcl(0.0);
+            po.setY511mqxpcl(0.0);
+            po.setY11mycqxpcl(0.0);
+            po.setYqxpcbbzsj(0.0);
+            po.setYmtbf(0.0);
+            po.setYmttr(0.0);
+            po.setYmttf(0.0);
+
         }
         if (eid4LastMonth1map.containsKey(wt.getId())) {
 
@@ -962,6 +1033,10 @@ public class HealthReportService {
             po.setYlyxshb(yqxpcbhb);
 
 
+        }else
+        {
+            po.setYlyxshb(0.0);
+
         }
 
         return po;
@@ -975,7 +1050,9 @@ public class HealthReportService {
             ProEconEquipmentInfoDay1 eid1 = eid1map.get(wt.getId());
 
             double yfdl = eid1.getYfdl();
-
+            ProEconHealthReportTarget fdlpo = hrmap.get("fdl");
+            fdlpo.setName("发电量");
+            fdlpo.setMonthValue(yfdl);
             double yllfdl = eid1.getYllfdl();
 
 
@@ -1027,13 +1104,60 @@ public class HealthReportService {
             ProEconHealthReportTarget llfdlpo = hrmap.get("llfdl");
             llfdlpo.setName("理论发电量");
             llfdlpo.setMonthValue(yllfdl);
+        }else
+        {
+            ProEconHealthReportTarget fdlpo = hrmap.get("fdl");
+            fdlpo.setName("发电量");
+            fdlpo.setMonthValue(0.0);
+
+            //当月风能利用率
+            double fnlyl = 0;
+            ProEconHealthReportTarget po = hrmap.get("fnlyl");
+            po.setName("风能利用率");
+            //月风能利用率
+            po.setMonthValue(fnlyl);
+
+
+            ProEconHealthReportTarget jxsspo = hrmap.get("jxss");
+            jxsspo.setName("检修损失电量");
+            jxsspo.setMonthValue(0.0);
+
+
+            ProEconHealthReportTarget gzsspo = hrmap.get("gzss");
+            gzsspo.setName("故障损失电量");
+            gzsspo.setMonthValue(0.0);
+
+            ProEconHealthReportTarget slsspo = hrmap.get("slss");
+            slsspo.setName("受累损失电量");
+            slsspo.setMonthValue(0.0);
+
+            ProEconHealthReportTarget xdsspo = hrmap.get("xdss");
+            xdsspo.setName("限电损失电量");
+
+            xdsspo.setMonthValue(0.0);
+            ProEconHealthReportTarget xnsspo = hrmap.get("xnss");
+            xnsspo.setName("性能损失电量");
+            xnsspo.setMonthValue(0.0);
+
+            ProEconHealthReportTarget fspo = hrmap.get("fs");
+            fspo.setName("风速");
+            fspo.setMonthValue(0.0);
+
+            ProEconHealthReportTarget llfdlpo = hrmap.get("llfdl");
+            llfdlpo.setName("理论发电量");
+            llfdlpo.setMonthValue(0.0);
         }
 
 
         if (eid1LastMonth1map.containsKey(wt.getId())) {
             ProEconEquipmentInfoDay1 eid1 = eid1LastMonth1map.get(wt.getId());
 
+
             double yfdl = eid1.getYfdl();
+            ProEconHealthReportTarget fdlpo = hrmap.get("fdl");
+            fdlpo.setLastMonth1Value(yfdl);
+
+
             double yllfdl = eid1.getYllfdl();
             //上月月风能利用率
             double fnlyl = 0.0;
@@ -1083,6 +1207,55 @@ public class HealthReportService {
             ProEconHealthReportTarget llfdlpo = hrmap.get("llfdl");
             llfdlpo.setName("理论发电量");
             llfdlpo.setLastMonth1Value(yllfdl);
+        }else
+        {
+
+            ProEconHealthReportTarget fdlpo = hrmap.get("fdl");
+            fdlpo.setLastMonth1Value(0.0);
+
+            //上月月风能利用率
+            double fnlyl = 0.0;
+            ProEconHealthReportTarget po = hrmap.get("fnlyl");
+
+            po.setLastMonth1Value(fnlyl);
+
+            double jxss = 0.0;
+            ProEconHealthReportTarget jxsspo = hrmap.get("jxss");
+            jxsspo.setName("检修损失电量");
+
+            jxsspo.setLastMonth1Value(jxss);
+
+            double gzss = 0.0;
+            ProEconHealthReportTarget gzsspo = hrmap.get("gzss");
+            gzsspo.setName("故障损失电量");
+
+            gzsspo.setLastMonth1Value(gzss);
+
+            double slss =0.0;
+            ProEconHealthReportTarget slsspo = hrmap.get("slss");
+            slsspo.setName("受累损失电量");
+
+            slsspo.setLastMonth1Value(slss);
+
+            double xdss = 0.0;
+            ProEconHealthReportTarget xdsspo = hrmap.get("xdss");
+            xdsspo.setName("限电损失电量");
+
+            xdsspo.setLastMonth1Value(xdss);
+
+            double xnss = 0.0;
+            ProEconHealthReportTarget xnsspo = hrmap.get("xnss");
+            xnsspo.setName("性能损失电量");
+            xnsspo.setLastMonth1Value(xnss);
+
+            double fs = 0.0;
+            ProEconHealthReportTarget fspo = hrmap.get("fs");
+            fspo.setName("风速");
+            fspo.setLastMonth1Value(fs);
+
+            ProEconHealthReportTarget llfdlpo = hrmap.get("llfdl");
+            llfdlpo.setName("理论发电量");
+            llfdlpo.setLastMonth1Value(0.0);
         }
 
 
@@ -1090,6 +1263,9 @@ public class HealthReportService {
             ProEconEquipmentInfoDay1 eid1 = eid1LastMonth2map.get(wt.getId());
 
             double yfdl = eid1.getYfdl();
+            ProEconHealthReportTarget fdlpo = hrmap.get("fdl");
+            fdlpo.setLastMonth2Value(yfdl);
+
             double yllfdl = eid1.getYllfdl();
             //前两月月风能利用率
             double fnlyl = 0.0;
@@ -1140,6 +1316,58 @@ public class HealthReportService {
             ProEconHealthReportTarget llfdlpo = hrmap.get("llfdl");
             llfdlpo.setName("理论发电量");
             llfdlpo.setLastMonth2Value(yllfdl);
+        }else
+        {
+
+            double yfdl = 0.0;
+            ProEconHealthReportTarget fdlpo = hrmap.get("fdl");
+            fdlpo.setLastMonth2Value(yfdl);
+
+
+            //前两月月风能利用率
+            double fnlyl = 0.0;
+
+            ProEconHealthReportTarget po = hrmap.get("fnlyl");
+
+            po.setLastMonth2Value(fnlyl);
+
+            double jxss = 0.0;
+            ProEconHealthReportTarget jxsspo = hrmap.get("jxss");
+            jxsspo.setName("检修损失电量");
+
+            jxsspo.setLastMonth2Value(jxss);
+
+            double gzss = 0.0;
+            ProEconHealthReportTarget gzsspo = hrmap.get("gzss");
+            gzsspo.setName("故障损失电量");
+
+            gzsspo.setLastMonth2Value(gzss);
+
+            double slss = 0.0;
+            ProEconHealthReportTarget slsspo = hrmap.get("slss");
+            slsspo.setName("受累损失电量");
+
+            slsspo.setLastMonth2Value(slss);
+
+            double xdss = 0.0;
+            ProEconHealthReportTarget xdsspo = hrmap.get("xdss");
+            xdsspo.setName("限电损失电量");
+
+            xdsspo.setLastMonth2Value(xdss);
+
+            double xnss = 0.0;
+            ProEconHealthReportTarget xnsspo = hrmap.get("xnss");
+            xnsspo.setName("性能损失电量");
+            xnsspo.setLastMonth2Value(xnss);
+
+            double fs = 0.0;
+            ProEconHealthReportTarget fspo = hrmap.get("fs");
+            fspo.setName("风速");
+            fspo.setLastMonth2Value(fs);
+
+            ProEconHealthReportTarget llfdlpo = hrmap.get("llfdl");
+            llfdlpo.setName("理论发电量");
+            llfdlpo.setLastMonth2Value(0.0);
         }
 
 
@@ -1155,13 +1383,13 @@ public class HealthReportService {
             }
 
             ProEconHealthReportTarget po = hrmap.get("sbklyl");
-            po.setName("设备利用率");
+            po.setName("设备利用率");
             //设备利用率
             po.setMonthValue(sbklyl);
 
             double yxxs = eid2.getYyxxs();
             ProEconHealthReportTarget yxxspo = hrmap.get("yxxs");
-            yxxspo.setName("运行小时");
+            yxxspo.setName("运行小时");
             yxxspo.setMonthValue(yxxs);
 
             double djxs = eid2.getYdjxs();
@@ -1184,6 +1412,40 @@ public class HealthReportService {
             xdxspo.setName("限电小时");
             xdxspo.setMonthValue(xdxs);
 
+        }else
+        {
+            double ygzxsmx = 0.0;
+            //当月设备利用率
+            double sbklyl = 0.0;
+            ProEconHealthReportTarget po = hrmap.get("sbklyl");
+            po.setName("设备可利用率");
+            //设备利用率
+            po.setMonthValue(sbklyl);
+
+            double yxxs = 0.0;
+            ProEconHealthReportTarget yxxspo = hrmap.get("yxxs");
+            yxxspo.setName("运行小时");
+            yxxspo.setMonthValue(yxxs);
+
+            double djxs = 0.0;
+            ProEconHealthReportTarget djxspo = hrmap.get("djxs");
+            djxspo.setName("待机小时");
+            djxspo.setMonthValue(djxs);
+
+            double jxxs = 0.0;
+            ProEconHealthReportTarget jxxspo = hrmap.get("jxxs");
+            jxxspo.setName("检修小时");
+            jxxspo.setMonthValue(jxxs);
+
+            double gzxs = 0.0;
+            ProEconHealthReportTarget gzxspo = hrmap.get("gzxs");
+            gzxspo.setName("故障小时");
+            gzxspo.setMonthValue(gzxs);
+
+            double xdxs = 0.0;
+            ProEconHealthReportTarget xdxspo = hrmap.get("xdxs");
+            xdxspo.setName("限电小时");
+            xdxspo.setMonthValue(xdxs);
         }
 
         if (eid2LastMonth1map.containsKey(wt.getId())) {
@@ -1225,6 +1487,42 @@ public class HealthReportService {
             ProEconHealthReportTarget xdxspo = hrmap.get("xdxs");
             xdxspo.setName("限电小时");
             xdxspo.setLastMonth1Value(xdxs);
+        }else
+        {
+
+            double ygzxsmx =0.0;
+            //当月设备利用率
+            double sbklyl = 0.0;
+
+            ProEconHealthReportTarget po = hrmap.get("sbklyl");
+            //设备利用率
+            po.setLastMonth1Value(sbklyl);
+
+
+            double yxxs = 0.0;
+            ProEconHealthReportTarget yxxspo = hrmap.get("yxxs");
+            yxxspo.setName("月运行小时");
+            yxxspo.setLastMonth1Value(yxxs);
+
+            double djxs = 0.0;
+            ProEconHealthReportTarget djxspo = hrmap.get("djxs");
+            djxspo.setName("待机小时");
+            djxspo.setLastMonth1Value(djxs);
+
+            double jxxs = 0.0;
+            ProEconHealthReportTarget jxxspo = hrmap.get("jxxs");
+            jxxspo.setName("检修小时");
+            jxxspo.setLastMonth1Value(jxxs);
+
+            double gzxs = 0.0;
+            ProEconHealthReportTarget gzxspo = hrmap.get("gzxs");
+            gzxspo.setName("故障小时");
+            gzxspo.setLastMonth1Value(gzxs);
+
+            double xdxs = 0.0;
+            ProEconHealthReportTarget xdxspo = hrmap.get("xdxs");
+            xdxspo.setName("限电小时");
+            xdxspo.setLastMonth1Value(xdxs);
         }
 
         if (eid2LastMonth2map.containsKey(wt.getId())) {
@@ -1265,6 +1563,41 @@ public class HealthReportService {
             ProEconHealthReportTarget xdxspo = hrmap.get("xdxs");
             xdxspo.setName("限电小时");
             xdxspo.setLastMonth2Value(xdxs);
+        }else
+        {
+
+            double ygzxsmx = 0.0;
+            //当月设备利用率
+            double sbklyl = 0.0;
+
+            ProEconHealthReportTarget po = hrmap.get("sbklyl");
+            //设备利用率
+            po.setLastMonth2Value(sbklyl);
+
+            double yxxs = 0.0;
+            ProEconHealthReportTarget yxxspo = hrmap.get("yxxs");
+            yxxspo.setName("月运行小时");
+            yxxspo.setLastMonth2Value(yxxs);
+
+            double djxs = 0.0;
+            ProEconHealthReportTarget djxspo = hrmap.get("djxs");
+            djxspo.setName("待机小时");
+            djxspo.setLastMonth2Value(djxs);
+
+            double jxxs = 0.0;
+            ProEconHealthReportTarget jxxspo = hrmap.get("jxxs");
+            jxxspo.setName("检修小时");
+            jxxspo.setLastMonth2Value(jxxs);
+
+            double gzxs = 0.0;
+            ProEconHealthReportTarget gzxspo = hrmap.get("gzxs");
+            gzxspo.setName("故障小时");
+            gzxspo.setLastMonth2Value(gzxs);
+
+            double xdxs = 0.0;
+            ProEconHealthReportTarget xdxspo = hrmap.get("xdxs");
+            xdxspo.setName("限电小时");
+            xdxspo.setLastMonth2Value(xdxs);
         }
 
         if (eid4map.containsKey(wt.getId())) {
@@ -1299,6 +1632,37 @@ public class HealthReportService {
             double yxfqcfs = eid4.getYxfqcfs();
             yxfqcfspo.setName("小风切出风速");
             yxfqcfspo.setMonthValue(yxfqcfs);
+        }else
+        {
+
+
+            ProEconHealthReportTarget y35mqxpclpo = hrmap.get("qxpc35");
+            ProEconHealthReportTarget y511mqxpclpo = hrmap.get("qxpc511");
+            ProEconHealthReportTarget y11mycqxpclpo = hrmap.get("qxpc11");
+            ProEconHealthReportTarget ydfqrfspo = hrmap.get("xfqr");
+            ProEconHealthReportTarget yxfqcfspo = hrmap.get("xfqc");
+            //当月3-5米曲线偏差率
+            double y35mqxpcl = 0.0;
+            y35mqxpclpo.setName("3-5米曲线偏差率");
+            y35mqxpclpo.setMonthValue(y35mqxpcl);
+            //当月5-11米曲线偏差率
+            double y511mqxpcl = 0.0;
+            y511mqxpclpo.setName("5-11米曲线偏差率");
+            y511mqxpclpo.setMonthValue(y511mqxpcl);
+            //当月11米以上曲线偏差率
+            double y11mycqxpcl = 0.0;
+            y11mycqxpclpo.setName("11米以上曲线偏差率");
+            y11mycqxpclpo.setMonthValue(y11mycqxpcl);
+
+
+            //月小风切入风速
+            double yxfqrfs = 0.0;
+            ydfqrfspo.setName("小风切入风速");
+            ydfqrfspo.setMonthValue(yxfqrfs);
+            // 月小风切出风速
+            double yxfqcfs =0.0;
+            yxfqcfspo.setName("小风切出风速");
+            yxfqcfspo.setMonthValue(yxfqcfs);
         }
         if (eid4LastMonth1map.containsKey(wt.getId())) {
 
@@ -1329,6 +1693,31 @@ public class HealthReportService {
             yxfqcfspo.setLastMonth1Value(yxfqcfs);
 
 
+        }else
+        {
+
+            ProEconHealthReportTarget y35mqxpclpo = hrmap.get("qxpc35");
+            ProEconHealthReportTarget y511mqxpclpo = hrmap.get("qxpc511");
+            ProEconHealthReportTarget y11mycqxpclpo = hrmap.get("qxpc11");
+            ProEconHealthReportTarget ydfqrfspo = hrmap.get("xfqr");
+            ProEconHealthReportTarget yxfqcfspo = hrmap.get("xfqc");
+
+            //上月3-5米曲线偏差率
+            double y35mqxpcl = 0.0;
+            y35mqxpclpo.setLastMonth1Value(y35mqxpcl);
+            //上月5-11米曲线偏差率
+            double y511mqxpcl = 0.;
+            y511mqxpclpo.setLastMonth1Value(y511mqxpcl);
+            //上月11米以上曲线偏差率
+            double y11mycqxpcl = 0.;
+            y11mycqxpclpo.setLastMonth1Value(y11mycqxpcl);
+
+            //月大风切入风速
+            double ydfqrfs = 0.;
+            ydfqrfspo.setLastMonth1Value(ydfqrfs);
+            // 月小风切出风速
+            double yxfqcfs = 0.;
+            yxfqcfspo.setLastMonth1Value(yxfqcfs);
         }
 
         if (eid4LastMonth2map.containsKey(wt.getId())) {
@@ -1354,6 +1743,29 @@ public class HealthReportService {
             // 月小风切出风速
             double yxfqcfs = eid4.getYxfqcfs();
             yxfqcfspo.setLastMonth2Value(yxfqcfs);
+        }else
+        {
+
+            ProEconHealthReportTarget y35mqxpclpo = hrmap.get("qxpc35");
+            ProEconHealthReportTarget y511mqxpclpo = hrmap.get("qxpc511");
+            ProEconHealthReportTarget y11mycqxpclpo = hrmap.get("qxpc11");
+            ProEconHealthReportTarget ydfqrfspo = hrmap.get("xfqr");
+            ProEconHealthReportTarget yxfqcfspo = hrmap.get("xfqc");
+            //前两月3-5米曲线偏差率
+            double y35mqxpcl = 0.0;
+            y35mqxpclpo.setLastMonth2Value(y35mqxpcl);
+            //前两月5-11米曲线偏差率
+            double y511mqxpcl = 0.0;
+            y511mqxpclpo.setLastMonth2Value(y511mqxpcl);
+            //前两月11米以上曲线偏差率
+            double y11mycqxpcl = 0.0;
+            y11mycqxpclpo.setLastMonth2Value(y11mycqxpcl);
+            //月大风切入风速
+            double ydfqrfs = 0.0;
+            ydfqrfspo.setLastMonth2Value(ydfqrfs);
+            // 月小风切出风速
+            double yxfqcfs = 0.0;
+            yxfqcfspo.setLastMonth2Value(yxfqcfs);
         }
 
 
@@ -1365,6 +1777,13 @@ public class HealthReportService {
             double dayScore = eid4.getDayScore();
             xndfpo.setName("性能评价");
             xndfpo.setMonthValue(dayScore);
+        }else
+        {
+            ProEconHealthReportTarget xndfpo = hrmap.get("xnpf");
+            //当月性能等级评估分数
+            double dayScore = 0.0;
+            xndfpo.setName("性能评价");
+            xndfpo.setMonthValue(dayScore);
         }
         if (eidTopLastMonth1map.containsKey(wt.getId())) {
 
@@ -1374,6 +1793,14 @@ public class HealthReportService {
             double dayScore = eid4.getDayScore();
 
             xndfpo.setLastMonth1Value(dayScore);
+        }else
+        {
+
+            //上月性能等级评估分数
+            ProEconHealthReportTarget xndfpo = hrmap.get("xnpf");
+            double dayScore = 0.0;
+
+            xndfpo.setLastMonth1Value(dayScore);
         }
         if (eidTopLastMonth2map.containsKey(wt.getId())) {
 
@@ -1383,6 +1810,11 @@ public class HealthReportService {
             double dayScore = eid4.getDayScore();
 
             xndfpo.setLastMonth2Value(dayScore);
+        }else
+        {
+            //前两月性能等级评估分数
+            ProEconHealthReportTarget xndfpo = hrmap.get("xnpf");
+            xndfpo.setLastMonth2Value(0.0);
         }
 
         ProEconHealthReportTarget fdjpo = hrmap.get("fdj");

+ 7 - 7
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/LosspowerratesService.java

@@ -6,8 +6,9 @@ import com.gyee.healthmodel.init.CacheContext;
 import com.gyee.healthmodel.model.auto.ProBasicEquipment;
 import com.gyee.healthmodel.model.vo.LossPowerRateVo;
 import com.gyee.healthmodel.service.auto.IProBasicEquipmentPointService;
+import com.gyee.healthmodel.util.IRealTimeDataBaseUtil;
 import com.gyee.healthmodel.util.MathUtil;
-import com.gyee.healthmodel.util.realtimesource.IEdosUtil;
+import com.gyee.healthmodel.util.RealTimeDataBaseFactory;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -26,8 +27,7 @@ public class LosspowerratesService {
     private final int DIGIT=2;
 
 
-    @Resource
-    private  IEdosUtil edosUtil;
+    private  IRealTimeDataBaseUtil edosUtil= RealTimeDataBaseFactory.createRealTimeDataBase();
     @Resource
     private IProBasicEquipmentPointService proBasicEquipmentPointService;
 
@@ -39,7 +39,7 @@ public class LosspowerratesService {
 
         /************************************************获得性能损失率基准值开始*********************************************************************/
 
-        List<String> jczbls = new ArrayList<>();
+
 
 //        public static final String  NLLFDLZS= "NLLFDLZS";//年理论发电量
 //        public static final String  NGZSSDL= "NGZSSDL";//年故障损失电量
@@ -57,7 +57,7 @@ public class LosspowerratesService {
 //        public static final String  NCWSLTQSSDL= "NCWSLTQSSDL";//年场外受累天气损失电量
         for(ProBasicEquipment wt :CacheContext.wtls)
         {
-
+            List<String> jczbls = new ArrayList<>();
             jczbls.add(proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.NLLFDLZS).getNemCode());
 
             jczbls.add(proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.NGZSSDL).getNemCode());
@@ -106,9 +106,9 @@ public class LosspowerratesService {
                 
                 double ssdl=gzssdl+jxssdl+djssdl+xnssdl+xdssdl+slssdl;
 
-                if(ssdl!=0)
+                if(llfdl!=0)
                 {
-                    rate=new BigDecimal(llfdl).divide(new BigDecimal(ssdl), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    rate=new BigDecimal(ssdl).divide(new BigDecimal(llfdl), 2, RoundingMode.HALF_EVEN).doubleValue();
                 }
                 LossPowerRateVo lw=new LossPowerRateVo();
                 lw.setTime(format.format(new Date()));

+ 48 - 13
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/MasterDataService.java

@@ -57,17 +57,21 @@ public class MasterDataService {
 			if (w.getWindpowerstationId().endsWith("GDC")) {
 				continue;
 			}
-			List<ProEconEquipmentInfoDay1> list = wimap.get(w.getId());
-			double deviatio=0.0;
-			for (ProEconEquipmentInfoDay1 c : list) {
-				if (c!=null) {
-					deviatio+=c.getRxnssdl();
-				}else{
-					deviatio+=0;
-				}
+			if(wimap.containsKey(w.getId()))
+			{
+				List<ProEconEquipmentInfoDay1> list = wimap.get(w.getId());
+				double deviatio=0.0;
+				for (ProEconEquipmentInfoDay1 c : list) {
+					if (c!=null) {
+						deviatio+=c.getRxnssdl();
+					}else{
+						deviatio+=0;
+					}
 
+				}
+				map.put(w.getId(), deviatio);
 			}
-			map.put(w.getId(), deviatio);
+
 
 		}
 		return map;
@@ -76,15 +80,28 @@ public class MasterDataService {
 		Map<String,Double> map = new HashMap<String, Double>();
 		Calendar c = Calendar.getInstance();
 		c.add(Calendar.DAY_OF_MONTH, -1);
-		for (ProBasicEquipment wt : CacheContext.wtls) {
+//		for (ProBasicEquipment wt : CacheContext.wtls) {
+//			if (wt.getWindpowerstationId().endsWith("GDC")) {
+//				continue;
+//			}
+//			Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 3.0, 5.0);
+//			double qxpc1 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//			map.put(wt.getId(), Math.abs(qxpc1));
+//
+//		}
+		Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(),  3.0, 5.0);
+
+			for (ProBasicEquipment wt : CacheContext.wtls) {
 			if (wt.getWindpowerstationId().endsWith("GDC")) {
 				continue;
 			}
-			Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 3.0, 5.0);
 			double qxpc1 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
 			map.put(wt.getId(), Math.abs(qxpc1));
 
 		}
+
+
+
 		return map;
 	}
 
@@ -92,11 +109,20 @@ public class MasterDataService {
 		Map<String,Double> map = new HashMap<String, Double>();
 		Calendar c = Calendar.getInstance();
 		c.add(Calendar.DAY_OF_MONTH, -1);
+//		for (ProBasicEquipment wt : CacheContext.wtls) {
+//			if (wt.getWindpowerstationId().endsWith("GDC")) {
+//				continue;
+//			}
+//			Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 5.0, 11.0);
+//			double qxpc1 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//			map.put(wt.getId(), Math.abs(qxpc1));
+//		}
+		Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(),  5.0, 11.0);
 		for (ProBasicEquipment wt : CacheContext.wtls) {
 			if (wt.getWindpowerstationId().endsWith("GDC")) {
 				continue;
 			}
-			Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 5.0, 11.0);
+
 			double qxpc1 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
 			map.put(wt.getId(), Math.abs(qxpc1));
 		}
@@ -107,11 +133,20 @@ public class MasterDataService {
 		Map<String,Double> map = new HashMap<String, Double>();
 		Calendar c = Calendar.getInstance();
 		c.add(Calendar.DAY_OF_MONTH, -1);
+//		for (ProBasicEquipment wt : CacheContext.wtls) {
+//			if (wt.getWindpowerstationId().endsWith("GDC")) {
+//				continue;
+//			}
+//			Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 11.0, 25.0);
+//			double qxpc1 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
+//			map.put(wt.getId(), Math.abs(qxpc1));
+//		}
+		Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), 11.0, 25.0);
 		for (ProBasicEquipment wt : CacheContext.wtls) {
 			if (wt.getWindpowerstationId().endsWith("GDC")) {
 				continue;
 			}
-			Map<String, List<ProEconCurveFittingSub>> cfmap = proEconCurveFittingSubService.findCurvefittingmapByDate(c.getTime(), wt.getId(), 11.0, 25.0);
+
 			double qxpc1 =proEconCurveFittingSubService.getNuberValue(cfmap, wt);
 			map.put(wt.getId(), Math.abs(qxpc1));
 		}

+ 3 - 0
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/IProEconCurveFittingSubService.java

@@ -20,6 +20,9 @@ public interface IProEconCurveFittingSubService extends IService<ProEconCurveFit
 
     public int deleteProEconCurveFittingSubByDay(Date recodedate);
 
+    public Map<String, List<ProEconCurveFittingSub>> findCurvefittingmapByDate(Date recorddate,  Double min, Double max);
+
+
     public Map<String, List<ProEconCurveFittingSub>> findCurvefittingmapByDate(Date recorddate, String wtId, Double min, Double max);
 
     public double getNuberValue(Map<String, List<ProEconCurveFittingSub>> daymap, ProBasicEquipment wt);

+ 34 - 0
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconCurveFittingSubServiceImpl.java

@@ -34,7 +34,41 @@ public class ProEconCurveFittingSubServiceImpl extends ServiceImpl<ProEconCurveF
     public int deleteProEconCurveFittingSubByDay(Date recodedate) {
         return  proEconCurveFittingSubMapper.deleteProEconCurveFittingSubByDay(recodedate);
     }
+    public Map<String, List<ProEconCurveFittingSub>> findCurvefittingmapByDate(Date recorddate,  Double min, Double max)  {
 
+        Map<String, List<ProEconCurveFittingSub>> cfvmap=new HashMap<>();
+
+
+        QueryWrapper<ProEconCurveFittingSub> qw = new QueryWrapper<>();
+//        qw.eq("windturbine_id",wtId);
+
+        Date endDate= DateUtils.addDays(recorddate,1);
+        qw.ge("record_date",recorddate);
+        qw.le("record_date",endDate);
+        qw.ge("speed",min);
+        qw.le("speed",max);
+
+        List<ProEconCurveFittingSub>  cfvls=proEconCurveFittingSubMapper.selectList(qw);
+
+
+        if (!cfvls.isEmpty()) {
+
+            for (ProEconCurveFittingSub cfv : cfvls) {
+
+                if (cfvmap.containsKey(cfv.getWindturbineId())) {
+                    List<ProEconCurveFittingSub> ls = cfvmap.get(cfv.getWindturbineId());
+                    ls.add(cfv);
+                    cfvmap.put(cfv.getWindturbineId(), ls);
+                } else {
+                    List<ProEconCurveFittingSub> ls = new ArrayList<ProEconCurveFittingSub>();
+                    ls.add(cfv);
+                    cfvmap.put(cfv.getWindturbineId(), ls);
+                }
+            }
+        }
+        return cfvmap;
+
+    }
     public Map<String, List<ProEconCurveFittingSub>> findCurvefittingmapByDate(Date recorddate, String wtId, Double min, Double max)  {
 
         Map<String, List<ProEconCurveFittingSub>> cfvmap=new HashMap<>();

+ 3 - 27
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java

@@ -220,9 +220,9 @@ public class ProEconEquipmentInfoDayTopServiceImpl extends ServiceImpl<ProEconEq
 
         Calendar cal = Calendar.getInstance();
         cal.setTime(recodedate);
-        cal.set(Calendar.DAY_OF_MONTH, -1);
+        cal.add(Calendar.DAY_OF_MONTH, -1);
 
-        recodedate= com.gyee.healthmodel.util.DateUtils.truncate(recodedate);
+        recodedate= DateUtils.truncate(recodedate);
 
         // 故障分析风机得分map
         Map<String, Double> xnmap = new HashMap<String, Double>();
@@ -232,7 +232,7 @@ public class ProEconEquipmentInfoDayTopServiceImpl extends ServiceImpl<ProEconEq
 
         if (!day1ls.isEmpty()  ) {
             for (ProEconEquipmentInfoDayTop po : day1ls) {
-                xnmap.put(po.getWindturbineId(), getScore(po));
+                xnmap.put(po.getWindturbineId(), po.getDayScore());
             }
 
 
@@ -242,29 +242,5 @@ public class ProEconEquipmentInfoDayTopServiceImpl extends ServiceImpl<ProEconEq
         return xnmap;
     }
 
-    private double getScore(ProEconEquipmentInfoDayTop po) {
-        double score = 0.0;
-        if (po.getDayLevel().equals("AAA")) {
-            score = 100.0;
-        } else if (po.getDayLevel().equals("AA")) {
-            score = 90.0;
-        } else if (po.getDayLevel().equals("A")) {
-            score = 80.0;
-        } else if (po.getDayLevel().equals("BBB")) {
-            score = 75.0;
-
-        } else if (po.getDayLevel().equals("BB")) {
-            score = 65.0;
-
-        } else if (po.getDayLevel().equals("B")) {
-            score = 60.0;
-        } else if (po.getDayLevel().equals("C")) {
-            score = 40.0;
-
-        } else if (po.getDayLevel().equals("C-")) {
-            score = 0.0;
-        }
 
-        return score;
-    }
 }

+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconPartWarnCountServiceImpl.java

@@ -34,7 +34,7 @@ public class ProEconPartWarnCountServiceImpl extends ServiceImpl<ProEconPartWarn
     }
 
     public int insertPartbjcount(ProEconPartWarnCount partbjcount){
-        return  proEconPartWarnCountMapper.insertPartbjcount(partbjcount);
+        return  proEconPartWarnCountMapper.insert(partbjcount);
     }
 
 

+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconPartWarnCountSubServiceImpl.java

@@ -29,6 +29,6 @@ public class ProEconPartWarnCountSubServiceImpl extends ServiceImpl<ProEconPartW
     }
 
     public int insertPartbjcountsub(ProEconPartWarnCountSub partbjcountsub){
-        return  proEconPartWarnCountSubMapper.insertPartbjcountsub(partbjcountsub);
+        return  proEconPartWarnCountSubMapper.insert(partbjcountsub);
     }
 }

+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/service/auto/impl/ProEconWindturbineWarnCountServiceImpl.java

@@ -31,7 +31,7 @@ public class ProEconWindturbineWarnCountServiceImpl extends ServiceImpl<ProEconW
     }
 
     public int insertWindturbineBjCount(ProEconWindturbineWarnCount windturbinebjcount){
-        return  proEconWindturbineWarnCountMapper.insertWindturbineBjCount(windturbinebjcount);
+        return  proEconWindturbineWarnCountMapper.insert(windturbinebjcount);
     }
 
     public List<ProEconWindturbineWarnCount> queryWindturbinebjCountByLineAndAlertrule(String alertruleid, String lnid)

+ 177 - 170
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/task/SaticScheduleTask.java

@@ -1,170 +1,177 @@
-//package com.gyee.healthmodel.task;
-//
-//
-//import com.gyee.healthmodel.service.HealthJudgeService;
-//import com.gyee.healthmodel.service.RecommenmainsService;
-//import com.xxl.job.core.context.XxlJobHelper;
-//import com.xxl.job.core.handler.annotation.XxlJob;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.stereotype.Component;
-//
-//import javax.annotation.Resource;
-//
-///**
-// * @ClassName : SaticScheduleTask
-// * @Author : xieshengjie
-// * @Date: 2021/1/21 19:43
-// * @Description : 调度
-// */
-//@Component
-//public class SaticScheduleTask {
-//
-//    private static Logger logger = LoggerFactory.getLogger(SaticScheduleTask.class);
-//    @Resource
-//    private LosspowerratesService losspowerratesService;
-//
-//    @Resource
-//    private HealthJudgeService healthJudgeService;
-//
-//    @Resource
-//    private RecommenmainsService recommenmainsService;
-//    //3.添加定时任务
-//
-//
-//
-//
-//    @XxlJob("healthmodel-wtHealthModelValue")
-//    public void configureTasks0()  {
-//
-//
-//        XxlJobHelper.log("风机健康状态判断调度程序执行开始!........");
-//
-//        try {
-//
-//            healthJudgeService.changeHealthModelValue();
-//        } catch (Exception e) {
-//
-//            e.printStackTrace();
-//        }
-//
-//        XxlJobHelper.log("风机健康状态判断调度程序执行完成!........");
-//    }
-//    /**
-//     * 风机损失率统计
-//     */
-//    //@Scheduled(cron = "0 37 1 * * ?")
-//    //或直接指定时间间隔,例如:5秒
-//    //@Scheduled(fixedRate=5000)
-//    @XxlJob("healthmodel-wtLossRateStatistics")
-//    public void configureTasks1()  {
-//
-//
-//        XxlJobHelper.log("风机损失率统计调度程序执行开始!........");
-//
-//        try {
-//
-//            losspowerratesService.saveLosspowerrate();
-//        } catch (Exception e) {
-//
-//            e.printStackTrace();
-//        }
-//
-//        XxlJobHelper.log("风机损失率统计调度任务处理完成!........");
-//    }
-//
-//    /**
-//     * 风机健康诊断
-//     */
-//    //@Scheduled(cron = "0 45 7 * * ?")
-//    //或直接指定时间间隔,例如:5秒
-//    //@Scheduled(fixedRate=5000)
-//    @XxlJob("healthmodel-wtHealthDiagnosis")
-//    public void configureTasks2()  {
-//
-//
-//        XxlJobHelper.log("风机健康诊断调度程序执行开始!........");
-//
-//        try {
-//
-//            healthJudgeService.healthJudge3();
-//        } catch (Exception e) {
-//
-//            e.printStackTrace();
-//        }
-//
-//        XxlJobHelper.log("风机健康诊断调度任务处理完成!........");
-//    }
-//
-//    /**
-//     * 风机健康推荐检修
-//     */
-//    //@Scheduled(cron = "0 20 8 * * ?")
-//    //或直接指定时间间隔,例如:5秒
-//    //@Scheduled(fixedRate=5000)
-//    @XxlJob("healthmodel-wtHealthRecommended")
-//    public void configureTasks3()  {
-//
-//
-//        XxlJobHelper.log("风机健康推荐检修调度程序执行开始!........");
-//
-//        try {
-//
-//            recommenmainsService.recommenMainWt();
-//        } catch (Exception e) {
-//
-//            e.printStackTrace();
-//        }
-//
-//        XxlJobHelper.log("风机健康推荐检修调度任务处理完成!........");
-//    }
-//
-//
-//    /**
-//     * 风机报警统计
-//     */
-//    //@Scheduled(cron = "0 0 2 * * ?")
-//    //或直接指定时间间隔,例如:5秒
-//    //@Scheduled(fixedRate=5000)
-//    @XxlJob("healthmodel-wtAlarmStatistics")
-//    public void configureTasks4()  {
-//
-//
-//        XxlJobHelper.log("风机报警统计调度程序执行开始!........");
-//
-//        try {
-//
-//            healthJudgeService.saveWindturbineBjCount();
-//        } catch (Exception e) {
-//
-//            e.printStackTrace();
-//        }
-//
-//        XxlJobHelper.log("风机报警统计调度任务处理完成!........");
-//    }
-//
-//
-//
-//    /**
-//     * 部件报警统计
-//     */
-//    //@Scheduled(cron = "0 0 3 * * ?")
-//    //或直接指定时间间隔,例如:5秒
-//    //@Scheduled(fixedRate=5000)
-//    @XxlJob("healthmodel-partAlarmStatistics")
-//    public void configureTasks5()  {
-//
-//
-//        XxlJobHelper.log("部件报警统计调度程序执行开始!........");
-//
-//        try {
-//
-//            healthJudgeService.savePartbjcount();
-//        } catch (Exception e) {
-//
-//            e.printStackTrace();
-//        }
-//
-//        XxlJobHelper.log("部件报警统计调度任务处理完成!........");
-//    }
-//}
+package com.gyee.healthmodel.task;
+
+
+import com.gyee.healthmodel.service.HealthJudgeService;
+import com.gyee.healthmodel.service.HealthReportService;
+import com.gyee.healthmodel.service.RecommenmainsService;
+import com.xxl.job.core.context.XxlJobHelper;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.Date;
+
+/**
+ * @ClassName : SaticScheduleTask
+ * @Author : xieshengjie
+ * @Date: 2021/1/21 19:43
+ * @Description : 调度
+ */
+@Component
+public class SaticScheduleTask {
+
+    private static Logger logger = LoggerFactory.getLogger(SaticScheduleTask.class);
+
+
+    @Resource
+    private HealthJudgeService healthJudgeService;
+
+    @Resource
+    private RecommenmainsService recommenmainsService;
+
+    @Resource
+    private HealthReportService healthReportService;
+    //3.添加定时任务
+
+
+
+
+    @XxlJob("healthmodel-wtHealthModelValue")
+    public void configureTasks1()  {
+
+
+        XxlJobHelper.log("风机健康状态判断调度程序执行开始!........");
+
+        try {
+
+            healthJudgeService.changeHealthModelValue();
+        } catch (Exception e) {
+
+            e.printStackTrace();
+        }
+
+        XxlJobHelper.log("风机健康状态判断调度程序执行完成!........");
+    }
+
+
+    /**
+     * 风机健康诊断
+     */
+    //@Scheduled(cron = "0 45 7 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    @XxlJob("healthmodel-wtHealthDiagnosis")
+    public void configureTasks2()  {
+
+
+        XxlJobHelper.log("风机健康诊断调度程序执行开始!........");
+
+        try {
+
+            healthJudgeService.healthJudge();
+        } catch (Exception e) {
+
+            e.printStackTrace();
+        }
+
+        XxlJobHelper.log("风机健康诊断调度任务处理完成!........");
+    }
+
+    /**
+     * 风机健康推荐检修
+     */
+    //@Scheduled(cron = "0 20 8 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    @XxlJob("healthmodel-wtHealthRecommended")
+    public void configureTasks3()  {
+
+
+        XxlJobHelper.log("风机健康推荐检修调度程序执行开始!........");
+
+        try {
+
+            recommenmainsService.recommenMainWt();
+        } catch (Exception e) {
+
+            e.printStackTrace();
+        }
+
+        XxlJobHelper.log("风机健康推荐检修调度任务处理完成!........");
+    }
+
+    /**
+     * 健康报告数据生成
+     */
+    //@Scheduled(cron = "0 40 8 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    @XxlJob("healthmodel-createHealthReport")
+    public void configureTasks4()  {
+
+
+        XxlJobHelper.log("健康报告数据生成调度程序执行开始!........");
+
+        try {
+
+            healthReportService.createHealthReport(new Date());
+        } catch (Exception e) {
+
+            e.printStackTrace();
+        }
+
+        XxlJobHelper.log("健康报告数据生成调度任务处理完成!........");
+    }
+
+
+
+    /**
+     * 风机报警统计
+     */
+    //@Scheduled(cron = "0 0 2 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    @XxlJob("healthmodel-wtAlarmStatistics")
+    public void configureTasks6()  {
+
+
+        XxlJobHelper.log("风机报警统计调度程序执行开始!........");
+
+        try {
+
+            healthJudgeService.saveWindturbineBjCount();
+        } catch (Exception e) {
+
+            e.printStackTrace();
+        }
+
+        XxlJobHelper.log("风机报警统计调度任务处理完成!........");
+    }
+
+
+
+    /**
+     * 部件报警统计
+     */
+    //@Scheduled(cron = "0 0 3 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    @XxlJob("healthmodel-partAlarmStatistics")
+    public void configureTasks7()  {
+
+
+        XxlJobHelper.log("部件报警统计调度程序执行开始!........");
+
+        try {
+
+            healthJudgeService.savePartbjcount();
+        } catch (Exception e) {
+
+            e.printStackTrace();
+        }
+
+        XxlJobHelper.log("部件报警统计调度任务处理完成!........");
+    }
+}

+ 0 - 790
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/util/MongoEdosUtil.java

@@ -1,790 +0,0 @@
-package com.gyee.healthmodel.util;
-
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.gyee.common.model.DNAStatVal;
-import com.gyee.common.model.DNAVal;
-import com.gyee.common.model.PointData;
-import com.gyee.healthmodel.model.auto.ProBasicPowerstationPoint;
-import com.gyee.healthmodel.model.auto.ProBasicEquipmentPoint;
-import com.gyee.healthmodel.util.realtimesource.IEdosUtil;
-import com.gyee.healthmodel.util.realtimesource.StringUtil;
-import com.gyee.healthmodel.util.realtimesource.timeseries.ErrorRequest;
-import com.gyee.healthmodel.util.realtimesource.timeseries.JsonObjectHelper;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-/**
- */
-@Component
-public class MongoEdosUtil implements IEdosUtil {
-
-    private RestTemplate restTemplate =new RestTemplate();
-    private static String baseURL = "http://192.168.2.216:8090/mogodb";
-    @Override
-    public PointData getRealData(ProBasicPowerstationPoint point) throws Exception {
-        try {
-            Optional<String> keys = Optional.ofNullable(point.getNemCode());
-
-
-            String url = baseURL + "/getRealData.action?";
-            if (keys.isPresent())
-                url = url + "point=" + keys.get();
-            String s = HttpClientUtil.doGet(url);
-            JSONObject jsonObject=JSONObject.parseObject(s);
-            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
-            return pointData;
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestError(point.getNemCode());
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-
-
-
-    @Override
-    public List<PointData> getHistoryDatasSnap(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
-        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
-        Optional<String> thingType = Optional.ofNullable(point.getModelId());
-        Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
-        Optional<Long> startTs = Optional.ofNullable(beginDate);
-        Optional<Long> endTs = Optional.ofNullable(endDate);
-        Optional<Long> counts = Optional.ofNullable(count);
-        Optional<Long> prieds = Optional.ofNullable(pried);
-        //通过时间区间和时间间隔获取点数
-
-
-        try {
-            String url = baseURL + "/getHistoryDatasSnap.action?";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "point=" + tagName.get();
-            if (startTs.isPresent())
-                url = url + "&begin=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&end=" + endTs.get();
-            if (counts.isPresent())
-                url = url + "&count=" + counts.get();
-            if (prieds.isPresent())
-                url = url + "&pried=" + prieds.get();
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-
-            return pointDatas;
-
-
-
-
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getNemCode());
-            } else {
-                throw exception;
-            }
-        }
-
-    }
-
-
-
-
-
-    @Override
-    public List<PointData> getHistoryDatasRaw(ProBasicPowerstationPoint point, Long beginDate, Long endDate) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
-        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
-        Optional<String> thingType = Optional.ofNullable(point.getModelId());
-        Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
-        Optional<Long> startTs = Optional.ofNullable(beginDate);
-        Optional<Long> endTs = Optional.ofNullable(endDate);
-
-        try {
-            String url = baseURL + "/getHistoryDatasRaw.action?";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "point=" + tagName.get();
-
-
-            if (startTs.isPresent())
-                url = url + "&begin=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&end=" + endTs.get();
-
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-           return pointDatas;
-
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getNemCode());
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public PointData getRealData(ProBasicEquipmentPoint point) throws Exception {
-        Optional<String> keys = Optional.ofNullable(point.getId());
-        Optional<String> thingType = Optional.ofNullable(point.getModelId());
-        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
-        Optional<String> uniformCodes = Optional.ofNullable(point.getUniformCode());
-
-        try {
-            String url = baseURL + "/getRealData.action?";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (keys.isPresent())
-                url = url + "point=" + keys.get();
-
-            String s = HttpClientUtil.doGet(url);
-            JSONObject jsonObject=JSONObject.parseObject(s);
-            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
-            return pointData;
-
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestError(point.getId());
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public List<PointData> getHistoryDatasSnap(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
-
-        Optional<String> tagName = Optional.ofNullable(point.getId());
-        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
-        Optional<String> thingType = Optional.ofNullable(point.getModelId());
-        Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
-        Optional<Long> startTs = Optional.ofNullable(beginDate);
-        Optional<Long> endTs = Optional.ofNullable(endDate);
-        Optional<Long> counts = Optional.ofNullable(count);
-        Optional<Long> prieds = Optional.ofNullable(pried);
-        //通过时间区间和时间间隔获取点数
-
-        try {
-            String url = baseURL + "/getHistoryDatasSnap.action?";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "point=" + tagName.get();
-
-            if (startTs.isPresent())
-                url = url + "&begin=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&end=" + endTs.get();
-            if (counts.isPresent())
-                url = url + "&count=" + counts.get();
-            if (prieds.isPresent())
-                url = url + "&pried=" + prieds.get();
-
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-            return pointDatas;
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getId());
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-
-    @Override
-    public List<PointData> getHistoryDatasRaw(ProBasicEquipmentPoint point, Long beginDate, Long endDate) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getId());
-        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
-        Optional<String> thingType = Optional.ofNullable(point.getModelId());
-        Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
-        Optional<Long> startTs = Optional.ofNullable(beginDate);
-        Optional<Long> endTs = Optional.ofNullable(endDate);
-        try {
-            String url = baseURL + "/getHistoryDatasRaw.action?";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "point=" + tagName.get();
-            if (startTs.isPresent())
-                url = url + "&begin=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&end=" + endTs.get();
-
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-            return pointDatas;
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getId());
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public PointData getRealData(String pointid) throws Exception {
-        Optional<String> keys = Optional.ofNullable(pointid);
-        String url = baseURL + "/getRealData.action?";
-        try {
-            if (keys.isPresent())
-                url = url + "point=" + keys.get();
-            else
-                return null;
-
-            String s = HttpClientUtil.doGet(url);
-            JSONObject jsonObject=JSONObject.parseObject(s);
-            PointData pointData = JSONObject.toJavaObject(jsonObject, PointData.class);
-            return pointData;
-
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestError(pointid);
-            } else {
-                return ErrorRequest.RequestError(pointid);
-            }
-        }
-    }
-
-    @Override
-    public List<PointData> getRealData(String... pointids) throws Exception {
-        String pointIdString = StringUtil.join(pointids, ",");
-        Optional<String> keys = Optional.ofNullable(pointIdString);
-        String url = baseURL + "/getRealData.action?1=1";
-        try {
-            if (keys.isPresent())
-                url = url + "&point=" + keys.get();
-            else {
-                return ErrorRequest.RequestListError(pointids);
-            }
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-            return pointDatas;
-
-
-
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(pointids);
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-
-
-    @Override
-    public List<PointData> getRealData(List<String> pointids) throws Exception {
-        String pointIdString = StringUtil.join(pointids.toArray(), ",");
-        Optional<String> keys = Optional.ofNullable(pointIdString);
-        String url = baseURL + "/getRealData.action?";
-        try {
-            if (keys.isPresent())
-                url = url + "keys=" + keys.get();
-            else {
-                String[] arr = new String[pointids.size()];
-                return ErrorRequest.RequestListError(pointids.toArray(arr));
-            }
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-            return pointDatas;
-
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                String[] arr = new String[pointids.size()];
-                return ErrorRequest.RequestListError(pointids.toArray(arr));
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public Map<String, Double> getRealDataMap(String... pointids) throws Exception {
-        return null;
-    }
-
-
-	  @Override
-	    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception {
-	        Optional<String> tagName = Optional.ofNullable(pointid);
-	        Optional<Long> startTs = Optional.ofNullable(beginDate);
-	        Optional<Long> endTs = Optional.ofNullable(endDate);
-          Optional<Long> counts = Optional.ofNullable(count);
-          Optional<Long> prieds = Optional.ofNullable(pried);
-
-
-          try {
-              String url = baseURL + "/getHistoryDatasSnap.action?";
-              //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-              if (tagName.isPresent())
-                  url = url + "point=" + tagName.get();
-
-              if (startTs.isPresent())
-                  url = url + "&begin=" + startTs.get();
-              if (endTs.isPresent())
-                  url = url + "&end=" + endTs.get();
-              if (counts.isPresent())
-                  url = url + "&count=" + counts.get();
-              if (prieds.isPresent())
-                  url = url + "&pried=" + prieds.get();
-
-
-              String s = HttpClientUtil.doGet(url);
-              List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-              return pointDatas;
-
-
-	        } catch (HttpClientErrorException exception) {
-	            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-	                System.out.println("404请求错误");
-	                return ErrorRequest.RequestListError(pointid);
-	            } else {
-	                throw exception;
-	            }
-	        }
-
-	    }
-
-
-    @Override
-    public List<PointData> getHistoryDatasRaw(String pointid, Long beginDate, Long endDate) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(pointid);
-        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
-        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
-
-        try {
-            String url = baseURL + "/history/raw?null=0";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "&tagName=" + tagName.get();
-            if (startTs.isPresent())
-                url = url + "&startTs=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&endTs=" + endTs.get();
-
-            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
-
-            JSONArray jsonArray = resp.getBody();
-            if (jsonArray != null)
-                return JsonObjectHelper.phrasePointData(jsonArray, pointid);
-            else {
-                return ErrorRequest.RequestListError(pointid);
-            }
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(pointid);
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public List<PointData> getHistStat(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getId());
-        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
-        Optional<String> thingType = Optional.ofNullable(point.getModelId());
-        Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
-        Optional<Long> startTs = Optional.ofNullable(beginDate);
-        Optional<Long> endTs = Optional.ofNullable(endDate);
-        Optional<Long> counts = Optional.ofNullable(count);
-        Optional<Long> prieds = Optional.ofNullable(pried);
-        Optional<Integer> types = Optional.ofNullable(type);
-
-
-        try {
-            String url = baseURL + "/getHistStat.action?";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "point=" + tagName.get();
-            if (startTs.isPresent())
-                url = url + "&begin=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&end=" + endTs.get();
-            if (counts.isPresent())
-                url = url + "&count=" + counts.get();
-            if (prieds.isPresent())
-                url = url + "&pried=" + prieds.get();
-            if (types.isPresent())
-                url = url + "&type=" + types.get();
-
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-            return pointDatas;
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getId());
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public List<PointData> getHistStat(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point.getNemCode());
-        Optional<String> thingId = Optional.ofNullable(point.getWindpowerstationId());
-        Optional<String> thingType = Optional.ofNullable(point.getModelId());
-        Optional<String> uniformCode = Optional.ofNullable(point.getUniformCode());
-        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
-        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
-        Optional<Long> counts = Optional.ofNullable(count);
-        Optional<Long> prieds = Optional.ofNullable(pried);
-        Optional<Integer> types = Optional.ofNullable(type);
-
-
-        try {
-            String url = baseURL + "/getHistStat.action?";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "point=" + tagName.get();
-
-            if (startTs.isPresent())
-                url = url + "&begin=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&end=" + endTs.get();
-            if (counts.isPresent())
-                url = url + "&count=" + counts.get();
-            if (prieds.isPresent())
-                url = url + "&pried=" + prieds.get();
-            if (types.isPresent())
-                url = url + "&type=" + types.get();
-
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-            return pointDatas;
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(point.getNemCode());
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public List<PointData> getHistStat(String pointid, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(pointid);
-        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
-        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
-        Optional<Long> counts = Optional.ofNullable(count);
-        Optional<Long> prieds = Optional.ofNullable(pried);
-        Optional<Integer> types = Optional.ofNullable(type);
-
-
-        try {
-            String url = baseURL + "/getHistStat.action?";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "point=" + tagName.get();
-
-            if (startTs.isPresent())
-                url = url + "&begin=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&end=" + endTs.get();
-            if (counts.isPresent())
-                url = url + "&count=" + counts.get();
-            if (prieds.isPresent())
-                url = url + "&pried=" + prieds.get();
-            if (types.isPresent())
-                url = url + "&type=" + types.get();
-
-            String s = HttpClientUtil.doGet(url);
-            List<PointData> pointDatas = JSONArray.parseArray(s, PointData.class);
-            return pointDatas;
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                return ErrorRequest.RequestListError(pointid);
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public DNAStatVal[] getHistStat(String point, Long beginDate, Long endDate, Integer pried) throws Exception {
-        Optional<String> tagName = Optional.ofNullable(point);
-        Optional<Long> startTs = Optional.ofNullable(beginDate * 1000);
-        Optional<Long> endTs = Optional.ofNullable(endDate * 1000);
-        //通过时间区间和时间间隔获取点数
-        Optional<Integer> interval = Optional.ofNullable(pried);
-
-        try {
-            String url = baseURL + "/history/stat?null=0";
-            //tagName 或thingType,thingId,uniformCode可以确定一个标签点
-            if (tagName.isPresent())
-                url = url + "&tagName=" + tagName.get();
-            if (startTs.isPresent())
-                url = url + "&startTs=" + startTs.get();
-            if (endTs.isPresent())
-                url = url + "&endTs=" + endTs.get();
-            if (interval.isPresent())
-                url = url + "&interval=" + interval.get();
-
-            //System.out.println(restTemplate.getForEntity(url, JSONArray.class));
-            ResponseEntity<JSONArray> resp = restTemplate.getForEntity(url, JSONArray.class);
-            if (resp != null) {
-                JSONArray jsonArray = resp.getBody();
-                if (jsonArray == null || jsonArray.size() <= 0) {
-                    DNAStatVal[] dnaVal = new DNAStatVal[1];
-                    DNAVal errorData = new DNAVal();
-                    errorData.Status = 0;
-
-                    DNAStatVal val = new DNAStatVal();
-                    val.avg = errorData;
-                    val.max = errorData;
-                    val.min = errorData;
-                    dnaVal[0] = val;
-                    return dnaVal;
-                } else {
-                    return JsonObjectHelper.phraseDNAVal(jsonArray);
-                }
-            } else {
-                return null;
-            }
-
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                DNAStatVal val = new DNAStatVal();
-                DNAStatVal[] dnaVal = new DNAStatVal[1];
-                DNAVal errorData = new DNAVal();
-                errorData.Status = 0;
-                val.avg = errorData;
-                val.max = errorData;
-                val.min = errorData;
-                dnaVal[0] = val;
-                return dnaVal;
-
-            } else {
-                DNAStatVal val = new DNAStatVal();
-                DNAStatVal[] dnaVal = new DNAStatVal[1];
-                DNAVal errorData = new DNAVal();
-                errorData.Status = 0;
-                val.avg = errorData;
-                val.max = errorData;
-                val.min = errorData;
-                dnaVal[0] = val;
-                return dnaVal;
-            }
-        }
-    }
-
-    private JSONObject convertPointData(PointData pd) {
-        JSONObject jo = new JSONObject();
-        jo.put("tagName", pd.getEdnaId());
-        JSONObject joo = new JSONObject();
-        joo.put("ts", pd.getPointTime()*1000);
-        joo.put("status", 0);
-        joo.put("doubleValue", pd.getPointValueInDouble());
-        jo.put("tsData", joo);
-        return jo;
-    }
-
-    @Override
-    public void updatePoint(PointData point) throws Exception {
-        String url = baseURL + "/history";
-        try {
-            String result = restTemplate.postForObject(url, convertPointData(point), String.class);
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                return;
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public DNAVal[] getRealtimeTagValues(String... tagNames) throws Exception {
-        String pointIdString = StringUtil.join(tagNames, ",");
-        Optional<String> keys = Optional.ofNullable(pointIdString);
-        String url = baseURL + "/latest?null=0";
-        try {
-            if (keys.isPresent())
-                url = url + "&keys=" + keys.get();
-            else
-                return null;
-
-            ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
-            JSONObject jsonObject = resp.getBody();
-            if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty()){
-                return JsonObjectHelper.phraseDNAVal(jsonObject,tagNames);
-            } else {
-            	  DNAVal[] errorResult = new DNAVal[tagNames.length];
-                  for(int i=0;i<tagNames.length;i++)
-                  {
-                  	 DNAVal val = new DNAVal();
-                       val.Status = 0;
-                       errorResult[i] = val;
-                  }
-                  return errorResult;
-            }
-
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-                DNAVal[] errorResult = new DNAVal[tagNames.length];
-                for(int i=0;i<tagNames.length;i++)
-                {
-                	 DNAVal val = new DNAVal();
-                     val.Status = 0;
-                     errorResult[i] = val;
-                }
-                return errorResult;
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public void updatePoint(List<PointData> pointls) throws Exception {
-        String url = baseURL + "/history/batch";
-        List<JSONObject> writeList = new ArrayList<>();
-
-        for (PointData entity : pointls) {
-            writeList.add(convertPointData(entity));
-        }
-        try {
-            String result = restTemplate.postForObject(url, writeList, String.class);
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                return;
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public void sendSinglePoint(PointData point) throws Exception {
-        String url = baseURL + "/latest";
-
-
-        try {
-            String result = restTemplate.postForObject(url, convertPointData(point), String.class);
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                return;
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public void sendMultiPoint(List<PointData> pointls) throws Exception {
-
-        String url = baseURL + "/latest/batch";
-        List<JSONObject> writeList = new ArrayList<>();
-
-        for (PointData entity : pointls) {
-            writeList.add(convertPointData(entity));
-        }
-        try {
-            String result = restTemplate.postForObject(url, writeList, String.class);
-        } catch (HttpClientErrorException exception) {
-            if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                System.out.println("404请求错误");
-            } else {
-                throw exception;
-            }
-        }
-    }
-
-    @Override
-    public void sendMultiPoint(String[] realvalue, DNAVal[] pointls) throws Exception {
-        String url = baseURL + "/latest/batch";
-
-        List<JSONObject> writeDataList = new ArrayList<>();
-        if (realvalue != null && pointls != null & realvalue.length == pointls.length) {
-            for (int i = 0; i < realvalue.length; i++) {
-                PointData writeData = new PointData();
-                writeData.setEdnaId(realvalue[i]);
-                writeData.setPointValueInDouble(pointls[i].DValue);
-                writeData.setPointTime((long)pointls[i].Time);
-                JSONObject jsonObject=convertPointData(writeData);
-                writeDataList.add(jsonObject);
-            }
-
-            try {
-                String result = restTemplate.postForObject(url, writeDataList, String.class);
-            } catch (HttpClientErrorException exception) {
-                if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
-                    System.out.println("404请求错误");
-                } else {
-                    throw exception;
-                }
-            }
-        } else
-            return;
-    }
-
-    //多点切面数据
-    @Override
-    public DNAVal[] getHistMatrix(String[] nameList, int tTime) throws Exception {
-        String tagNameString = StringUtil.join(nameList, ",");
-        Long time = Long.valueOf(tTime);
-        Optional<String> tagName = Optional.ofNullable(tagNameString);
-        Optional<Long> ts = Optional.ofNullable(time * 1000);
-        String url = baseURL + "/history/section?tagNames=" + tagName.get() + "&ts=" + ts.get();
-        try {
-            ResponseEntity<JSONObject> resp = restTemplate.getForEntity(url, JSONObject.class);
-            JSONObject jsonObject = resp.getBody();
-            if (StringUtils.isNotEmpty(jsonObject) && !jsonObject.isEmpty())
-            {
-            	 return JsonObjectHelper.phraseDNAVal(jsonObject,nameList);
-            }
-            else {
-                DNAVal[] errorResult = new DNAVal[nameList.length];
-                for(int i=0;i<nameList.length;i++)
-                {
-                	 DNAVal val = new DNAVal();
-                     val.Status = 0;
-                     errorResult[i] = val;
-                }
-                return errorResult;
-            }
-        } catch (Exception e) {
-        	  DNAVal[] errorResult = new DNAVal[nameList.length];
-              for(int i=0;i<nameList.length;i++)
-              {
-              	 DNAVal val = new DNAVal();
-                   val.Status = 0;
-                   errorResult[i] = val;
-              }
-              return errorResult;
-        }
-    }
-
-
-}

+ 1 - 1
realtime/healthmodel-server/src/main/java/com/gyee/healthmodel/util/realtimesource/EdosUtil.java

@@ -8,8 +8,8 @@ import com.gyee.common.model.DNAVal;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
 import com.gyee.healthmodel.config.V2Config;
-import com.gyee.healthmodel.model.auto.ProBasicPowerstationPoint;
 import com.gyee.healthmodel.model.auto.ProBasicEquipmentPoint;
+import com.gyee.healthmodel.model.auto.ProBasicPowerstationPoint;
 import com.gyee.healthmodel.util.IRealTimeDataBaseUtil;
 import com.gyee.healthmodel.util.realtimesource.timeseries.ErrorRequest;
 import com.gyee.healthmodel.util.realtimesource.timeseries.JsonObjectHelper;

+ 17 - 31
realtime/healthmodel-server/src/main/resources/application-jn.yml

@@ -1,10 +1,10 @@
 # 项目相关配置
 gyee:
   #实时数据库Url
-  baseurl: http://10.81.3.155:8011/ts
-  healthurl: http://10.81.3.155:8011/ts
+  baseurl: http://10.81.3.160:8011/ts
+  healthurl: http://10.81.3.160:8011/ts
   #实时数据库选择
-  realtimedataBase: mongodb #数据查询模式 golden、hwy
+  realtimedataBase: golden #数据查询模式 golden、hwy
   initialcode: INITIAL
   firstIntegratedTime: 2000-05-13
 server:
@@ -38,17 +38,20 @@ spring:
     exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
-    #外网
-    url: jdbc:postgresql://10.81.3.151:5432/IMS_NEM_JN
-    username: postgres
-    password: postgres
-    driver-class-name: org.postgresql.Driver
-    oracle-schema=:
-    #    type: com.alibaba.druid.pool.DruidDataSource
-    #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
-    #    username: root
-    #    password: root
-    #    driver-class-name: com.mysql.jdbc.Driver
+    dynamic:
+      primary: master #设置默认的数据源或者数据源组,默认值即为master
+      strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+      datasource:
+        master:
+          url: jdbc:postgresql://10.81.3.151:5432/IMS_NEM_JN
+          username: postgres
+          password: postgres
+          driver-class-name: org.postgresql.Driver
+        slave:
+          url: jdbc:postgresql://10.81.3.151:5432/wisdom
+          username: postgres
+          password: gd123
+          driver-class-name: org.postgresql.Driver
     druid:
       max-active: 20
       initial-size: 1
@@ -59,22 +62,6 @@ spring:
       test-while-idle: true
       test-on-borrow: false
       test-on-return: false
-      #StatViewServlet配置。(因为暴露的监控信息比较敏感,支持密码加密和访问ip限定)
-      stat-view-servlet:
-        enabled: true
-        url-pattern: /druid/*
-        #可以增加访问账号密码【去掉注释就可以】
-        #login-username: admin
-        #login-password: admin
-      filter:
-        stat:
-          log-slow-sql: true
-          slow-sql-millis: 1000
-          merge-sql: false
-        wall:
-          config:
-            multi-statement-allow: true
-
   servlet:
     multipart:
       # 开启 multipart 上传功能
@@ -86,7 +73,6 @@ spring:
       # 最大请求大小
       max-request-size: 215MB
 
-
 logging:
   level:
     root: info

+ 2 - 2
realtime/healthmodel-server/src/main/resources/xxl-job-executor.properties

@@ -5,12 +5,12 @@ xxl.job.admin.addresses=http://10.81.3.152:8175/xxl-job-admin
 xxl.job.accessToken=
 
 ### xxl-job executor appname
-xxl.job.executor.appname=healthmodel-job
+xxl.job.executor.appname=healthmodel-job-new
 ### xxl-job executor registry-address: default use address to registry , otherwise use ip:port if address is null
 xxl.job.executor.address=
 ### xxl-job executor server-info
 xxl.job.executor.ip=
-xxl.job.executor.port=9113
+xxl.job.executor.port=9116
 ### xxl-job executor log-path
 xxl.job.executor.logpath=d:\\jobs\\healthmodel-job
 ### xxl-job executor log-retention-days