Преглед на файлове

历史计算服务修正优化

shilin преди 1 година
родител
ревизия
8cf745e36f
променени са 49 файла, в които са добавени 1832 реда и са изтрити 1752 реда
  1. BIN
      realtime/failurestatistics-server/lib/xxl-job-core-2.3.1-SNAPSHOT.jar
  2. 1 1
      realtime/failurestatistics-server/pom.xml
  3. 67 0
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/config/XxlJobConfig.java
  4. 53 8
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/init/CacheContext.java
  5. 0 211
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/init/Constant.java
  6. 5 5
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconPartPowerstatticMainMapper.java
  7. 5 5
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconPartpowerStatticsSubMapper.java
  8. 14 0
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconRecommenMainMapper.java
  9. 9 7
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconShutdownEventMapper.java
  10. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProBasicStatusPoint.java
  11. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPartPowerstatticMain.java
  12. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPartpowerStatticsSub.java
  13. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay1.java
  14. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay2.java
  15. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay3.java
  16. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay4.java
  17. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay5.java
  18. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay6.java
  19. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay7.java
  20. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconRecommenMain.java
  21. 1 13
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/custom/ShutdowneventVo.java
  22. 4 3
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/custom/export/TsPointData.java
  23. 106 105
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/dto/response/EconHomePagePointRateDTO.java
  24. 8 7
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/dto/response/ProEconPointCodeDTO.java
  25. 130 148
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/PartpowerstatticsService.java
  26. 7 7
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/PartstatisticsService.java
  27. 98 118
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/ParttemperatureService.java
  28. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/Shutdownevent2Service.java
  29. 103 0
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/ShutdowneventService.java
  30. 3 3
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconPartPowerstatticMainService.java
  31. 3 3
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconPartpowerStatticsSubService.java
  32. 0 10
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconPointCodeService.java
  33. 1 1
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconShutdownEvent2Service.java
  34. 3 3
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconEarlyWarningSubServiceImpl.java
  35. 3 3
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java
  36. 3 3
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconPartPowerstatticMainServiceImpl.java
  37. 6 6
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconPartpowerStatticsSubServiceImpl.java
  38. 0 628
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconPointCodeServiceImpl.java
  39. 5 5
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconShutdownEvent2ServiceImpl.java
  40. 2 2
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/task/SaticScheduleTask.java
  41. 209 435
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/util/DateUtils.java
  42. 215 0
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/util/IRealTimeDataBaseUtil.java
  43. 344 0
      realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/util/SortUtils.java
  44. 78 0
      realtime/failurestatistics-server/src/main/resources/application-hb.yml
  45. 78 0
      realtime/failurestatistics-server/src/main/resources/application-hbn.yml
  46. 78 0
      realtime/failurestatistics-server/src/main/resources/application-hf.yml
  47. 79 0
      realtime/failurestatistics-server/src/main/resources/application-hwy.yml
  48. 79 0
      realtime/failurestatistics-server/src/main/resources/application-jn.yml
  49. 20 0
      realtime/failurestatistics-server/src/main/resources/xxl-job-executor.properties

BIN
realtime/failurestatistics-server/lib/xxl-job-core-2.3.1-SNAPSHOT.jar


+ 1 - 1
realtime/failurestatistics-server/pom.xml

@@ -9,7 +9,7 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>failurestatistics-server-cph</artifactId>
+    <artifactId>failurestatistics-server</artifactId>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+ 67 - 0
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/config/XxlJobConfig.java

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

+ 53 - 8
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/init/CacheContext.java

@@ -5,14 +5,15 @@ import com.gyee.failurestatistics.model.auto.*;
 import com.gyee.failurestatistics.service.auto.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @ClassName : CacheContext
@@ -26,19 +27,19 @@ public class CacheContext implements CommandLineRunner {
 
     private static final Logger log = LoggerFactory.getLogger(CacheContext.class);
 
-    @Autowired
+    @Resource
     private IProBasicEquipmentService  proBasicEquipmentService;
-    @Autowired
+    @Resource
     private IProBasicPowerstationService  proBasicPowerstationService;
-    @Autowired
+    @Resource
     private IProBasicProjectService proBasicProjectService;
-    @Autowired
+    @Resource
     private IProBasicLineService  proBasicLineService;
-    @Autowired
+    @Resource
     private IProEconEquipmentmodelService  proEconEquipmentmodelService;
-    @Autowired
+    @Resource
     private IProBasicEquipmentPointService  proBasicEquipmentPointService;
-    @Autowired
+    @Resource
     private IProBasicPowerstationPointService  proBasicPowerstationPointService;
 
     public static Map<String, ProBasicEquipment> wtmap = new HashMap<String, ProBasicEquipment>(); // 风电机MAP
@@ -63,6 +64,11 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, ProBasicLine> lnmap = new HashMap<String, ProBasicLine>(); // 线路MAP
     public static List<ProEconEquipmentmodel> mlls = new ArrayList<ProEconEquipmentmodel>();// 风电机模型LIST集合
     public static Map<String, ProEconEquipmentmodel> mlmap = new HashMap<String, ProEconEquipmentmodel>();// 风电机模型
+
+    public static Map<String, Map<String, ProBasicPowerstationPoint>> lnPointmap = new HashMap<>();//线路测点
+    public static Map<String, Map<String, ProBasicPowerstationPoint>> pjPointmap = new HashMap<>(); //期次测点
+    public static List<ProBasicPowerstationPoint> powerpointls = new ArrayList<>();
+    public static Map<String, Map<String, ProBasicPowerstationPoint>> pointwpmap = new HashMap<>();
     @Override
     public void run(String... args) throws Exception {
 
@@ -169,6 +175,45 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
+
+        Map<String, ProBasicPowerstationPoint> items = null;
+        powerpointls = proBasicPowerstationPointService.list().stream().filter(i -> i.getId() != null).collect(Collectors.toList());
+        if (powerpointls != null && !powerpointls.isEmpty()) {
+            for (int i = 0; i < powerpointls.size(); i++) {
+
+                if (pjmap.containsKey(powerpointls.get(i).getWindpowerstationId())) {
+                    ProBasicPowerstationPoint point = powerpointls.get(i);
+                    if (pjPointmap.containsKey(point.getWindpowerstationId())) {
+                        items = pjPointmap.get(point.getWindpowerstationId());
+                        items.put(point.getUniformCode(), point);
+                    } else {
+                        items = new HashMap<String, ProBasicPowerstationPoint>();
+                        pjPointmap.put(point.getWindpowerstationId(), items);
+                        items.put(point.getUniformCode(), point);
+                    }
+                } else if (lnmap.containsKey(powerpointls.get(i).getWindpowerstationId())) {
+                    ProBasicPowerstationPoint point = powerpointls.get(i);
+                    if (lnPointmap.containsKey(point.getWindpowerstationId())) {
+                        items = lnPointmap.get(point.getWindpowerstationId());
+                        items.put(point.getUniformCode(), point);
+                    } else {
+                        items = new HashMap<String, ProBasicPowerstationPoint>();
+                        lnPointmap.put(point.getWindpowerstationId(), items);
+                        items.put(point.getUniformCode(), point);
+                    }
+                } else {
+                    ProBasicPowerstationPoint point = powerpointls.get(i);
+                    if (pointwpmap.containsKey(point.getWindpowerstationId())) {
+                        items = pointwpmap.get(point.getWindpowerstationId());
+                        items.put(point.getUniformCode(), point);
+                    } else {
+                        items = new HashMap<String, ProBasicPowerstationPoint>();
+                        pointwpmap.put(point.getWindpowerstationId(), items);
+                        items.put(point.getUniformCode(), point);
+                    }
+                }
+            }
+        }
         log.info("-------------------------------缓存结束--------------------------------------");
     }
 //  取redis

+ 0 - 211
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/init/Constant.java

@@ -1,211 +0,0 @@
-package com.gyee.failurestatistics.init;
-
-/**
- * 
- * 
- * 项目名称:nxfd 类名称:Constant 类描述: 创建人:石林 创建时间:2014-3-4 上午10:07:03 修改人:shilinno1
- * 修改时间:2014-3-4 上午10:07:03 修改备注:
- * 
- * @version
- * 
- */
-public class Constant {
-    /**
-     * EdnaAPI 时间间隔
-     */
-    public static final Long EDNAAPI_PRIED = 30l;
-    public static final Long TOP_PRIED = 1800l;
-
-    public static final String TPOINT_ALL_RFDL = "RFDL"; // 汇总日发电量
-    public static final String TPOINT_ALL_YFDL = "YFDL"; // 汇总月发电量
-    public static final String TPOINT_ALL_NFDL = "NFDL"; // 汇总年发电量
-    public static final String TPOINT_ALL_SJGL = "RPJGL"; // 汇总日实际功率
-    public static final String TPOINT_ALL_PJFS = "RPJFS"; // 汇总日平均风速
-
-    public static final String TPOINT_WP_FGLYC = "FCFGCDQ0001,FCFGCDQ0003,FCFGCDQ0005,FCFGCDQ0007,FCFGCDQ0009,FCFGCDQ0011,FCFGCDQ0013,FCFGCDQ0015";
-    public static final String TPOINT_WP_FGLYC2 = "FCFGCDQ0002,FCFGCDQ0004,FCFGCDQ0006,FCFGCDQ0008,FCFGCDQ0010,FCFGCDQ0012,FCFGCDQ0014,FCFGCDQ0016";
-    public static final String TPOINT_WP_FGLYC24 = "FCFGCDQ0004,FCFGCDQ0008,FCFGCDQ0012,FCFGCDQ0016";
-    public static final String ycPoints2 = "FCFGCDQ0001,FCFGCDQ0002,FCFGCDQ0003,FCFGCDQ0004,FCFGCDQ0005,FCFGCDQ0006,FCFGCDQ0007,FCFGCDQ0008,FCFGCDQ0009,FCFGCDQ0010,FCFGCDQ0011,FCFGCDQ0012,FCFGCDQ0013,FCFGCDQ0014,FCFGCDQ0015,FCFGCDQ0016";
-    public static final String TPOINT_WP_YCGL = "RPJGL"; // 风场预测功率短期次天00:00:00
-    public static final String TPOINT_WP_PJFS = "RPJFS"; // 电场日平均风速
-
-    public static final String TPOINT_WP_SWDL = "SWDLB"; // 风场上网电量
-    public static final String TPOINT_WP_GWDL = "GWGWB"; // 风场购网电量
-    public static final String TPOINT_WP_NWGWDL = "NWGWB"; // 农网购网电量
-    /**
-     * 空气温度
-     */
-    public static final String TPOINT_WP_FCCFTWD = "FCCFTWD";// 温度
-
-    public static int WAITING_STATUS = 0;// 待机
-    public static int RUN_STATUS = 1;// 并网
-    public static int FAULT_STATUS = 2;// 故障停机
-    public static int INTERRUPTION_STATUS = 3;// 通讯中断
-    public static int MAINTENANCE_STATUS = 4;// 维护停机
-    public static String FAULT_NAME = "故障";
-    public static String MAINTENANCE_NAME = "维护";
-    public static String WAITING_NAME = "待机";
-    public static String RUN_NAME = "运行";
-    public static String INTERRUPTION_NAME = "离线";
-
-    public static final String TPOINT_WP_SJGL = "SSZGL"; // 日实际功率
-    public static final String TPOINT_WP_SFDL = "SFDL";// 总发电量(升压站)
-    public static final String TPOINT_WP_SSFS = "SSFS"; // 实时平均风速
-    public static final String TPOINT_WP_RFDL = "RFDLB"; // 日发电量
-    public static final String TPOINT_WP_YFDL = "YFDLB"; // 月发电量
-    public static final String TPOINT_WP_NFDL = "NFDLB"; // 年发电量
-
-    public static final String TPOINT_WT_RFDL = "RFDL";// 风机日发电量与SCADA日风场发电量
-    public static final String TPOINT_WT_DCRFDL = "AI064";// 导出单机发电量
-    public static final String TPOINT_WT_YFDL = "YFDL";// 风机月发电量
-    public static final String TPOINT_WT_NFDL = "NFDL";// 风机年发电量
-
-    public static final String TPOINT_WT_RFDL2 = "RFDLREAD";// 逆变器日发电量
-
-    public static final String TPOINT_WT_XDTS = "XDTS";// 限电台数
-    public static final String TPOINT_WT_YXTS = "YXTS";// 运行台数
-    public static final String TPOINT_WT_DJTS = "DJTS"; // 待机台数
-    public static final String TPOINT_WT_WHTJ = "WHTJ";// 维护台数
-    public static final String TPOINT_WT_GZTJ = "GZTJ";// 故障台数
-    public static final String TPOINT_WT_TXZD = "TXZD";// 离线台数
-
-    public static final String TPOINT_WT_U1YZDL = "AI061";// U1项绕组电流
-    public static final String TPOINT_WT_U2YZDL = "AI062";// U2项绕组电流
-    public static final String TPOINT_WT_U3YZDL = "AI063";// U3项绕组电流
-    public static final String TPOINT_WT_U1YZDY = "AI058";// U1项绕组电压
-    public static final String TPOINT_WT_U2YZDY = "AI059";// U2项绕组电压
-    public static final String TPOINT_WT_U3YZDY = "AI060";// U3项绕组电压
-    public static final String TPOINT_WT_FDJZS = "AI128";// 发电机转速
-    public static final String TPOINT_WT_U1YZWD = "AI045";// U1绕组温度
-    public static final String TPOINT_WT_V1YZWD = "AI047";// V1绕组温度
-    public static final String TPOINT_WT_W1YZWD = "AI049";// W1绕组温度
-    public static final String TPOINT_WT_YLZS = "AI012";// 叶轮转速
-    public static final String TPOINT_WT_FJJJJ = "AI085";// 风机浆距角
-	public static final String TPOINT_WT_DWZWD = "AI038";// 齿轮箱轴1温度
-    public static final String TPOINT_WT_GWZWD = "AI039";// 齿轮箱轴2温度
-    public static final String TPOINT_WT_CLXWD = "AI041";// 齿轮箱油温
-    public static final String TPOINT_WT_BJJD1 = "AI076";// 变桨角度1
-    public static final String TPOINT_WT_PHWZ = "AI034";// 偏航位置
-    public static final String TPOINT_WT_PJFS = "RPJFS"; // 日平均风速
-    public static final String TPOINT_WT_FJGL = "AI130";// 风机功率
-    public static final String TPOINT_WT_PJGL = "RPJGL";// 风机平均功率
-    public static final String TPOINT_WT_GLYS = "AI067";// 功率因数
-    public static final String TPOINT_WT_JCWWD = "AI056";// 机舱外温度
-    public static final String TPOINT_WT_JCWD = "AI057";// 机舱温度
-    public static final String TPOINT_WT_TDGWD = "AI069";// 塔底柜温度
-    public static final String TPOINT_WT_JCGWD = "AI069";// 机舱柜温度
-    public static final String TPOINT_WT_FJFX = "AI008";// 风机风向
-    public static final String TPOINT_WT_DFJD = "AI036";// 对风角度
-    public static final String TPOINT_WT_FJPL = "AI068";// 风机频率
-    public static final String TPOINT_WT_WGGL = "AI131";// 无功功率
-    public static final String TPOINT_WT_FJKYL = "AI001";// 风机可用率
-    public static final String TPOINT_WT_FJZSXZ = "AI051";// 风机转速限值
-    public static final String TPOINT_WT_FJSSFS = "AI022";// 风机实时风速
-
-    public static final String TPOINT_WT_FDJZCAWD = "AI052";// 发电机轴承A温度
-    public static final String TPOINT_WT_FDJZCBWD = "AI053";// 发电机轴承B温度
-
-    public static final String TPOINT_WT_FJGLKZXZ = "AI426";// UP97 取值 功率控制限值
-    public static final String TPOINT_WT_LLGL = "BZGL";// 风机理论功率
-    public static final String TPOINT_WT_YFGL = "ZSGL";// 风机应发功率
-    public static final String TPOINT_WT_RFDLBZ = "RFDLZS";// 日理论发电量
-
-    // public static final String TPOINT_WT_RFDLBZ = "RFDLLL";//日理论发电量
-
-    public static final String TPOINT_WT_RFDLZS = "RFDLZS";// 日应发电量
-
-    public static final String TPOINT_WT_NBQJLDY = "AIG061";// 逆变器交流电压
-    public static final String TPOINT_WT_NBQJLDL = "AIG060";// 逆变器交流电流
-    public static final String TPOINT_WT_NBQZLDY = "AIG081";// 逆变器直流电压
-    public static final String TPOINT_WT_NBQZLDL = "AIG078";// 逆变器直流电流
-
-    public static final String TPOINT_WT_NBQPL = "AIG073";// 逆变器频率
-    public static final String TPOINT_WT_NBQGLYSSZ = "AIG069";// 功率因数设置
-    public static final String TPOINT_WT_NBQGLYSSZ2 = "AIG104";// 功率因数设置
-    public static final String TPOINT_WT_NBQZFDL = "AIG064";// 逆变相总发电量
-    public static final String TPOINT_WT_NBQKQWD = "AIG071";// 逆变器空气温度
-    public static final String TPOINT_WT_NBQXL = "AIG072";// 逆变器效率
-
-    public static final String RFDLD = "RFDLD"; // 日理论发电量
-    public static final String RFDLE = "RFDLE"; // 日应发发电量
-    public static final String FJZT = "FJZT"; // 风场状态
-
-    public static final String ZBZGL = "ZBZGL";// 理论功率
-    public static final String ZSGLZZSGL = "ZZSGL";// 应发功率
-
-    public static final String RLZSSDL = "RLZSSDL"; // 日场内受累检修
-    public static final String RSZSSDL = "RSZSSDL"; // 日场内受累故障
-    public static final String RWZSSDL = "RWZSSDL"; // 日场外受累电网
-    public static final String RTZSSDL = "RTZSSDL"; // 日场外受累天气
-
-    public static final String YLZSSDL = "YLZSSDL"; // 月场内受累检修
-    public static final String YSZSSDL = "YSZSSDL"; // 月场内受累故障
-    public static final String YWZSSDL = "YWZSSDL"; // 月场外受累电网
-    public static final String YTZSSDL = "YTZSSDL"; // 月场外受累天气
-
-    public static final String NLZSSDL = "NLZSSDL"; // 年场内受累检修
-    public static final String NSZSSDL = "NSZSSDL"; // 年场内受累故障
-    public static final String NWZSSDL = "NWZSSDL"; // 年场外受累电网
-    public static final String NTZSSDL = "NTZSSDL"; // 年场外受累天气
-
-    public static final String RQFSSDL = "RQFSSDL"; // 日欠发损失电量
-    public static final String RGZSSDL = "RGZSSDL"; // 日故障损失电量
-    public static final String RJXSSDL = "RJXSSDL"; // 日检修损失电量
-    public static final String RXDSSDL = "RXDSSDL"; // 日限电损失电量
-
-    public static final String YQFSSDL = "YQFSSDL"; // 月欠发损失电量
-    public static final String YGZSSDL = "YGZSSDL"; // 月故障损失电量
-    public static final String YJXSSDL = "YJXSSDL"; // 月检修损失电量
-    public static final String YXDSSDL = "YXDSSDL"; // 月限电损失电量
-
-    public static final String NQFSSDL = "NQFSSDL"; // 年欠发损失电量
-    public static final String NGZSSDL = "NGZSSDL"; // 年故障损失电量
-    public static final String NJXSSDL = "NJXSSDL"; // 年检修损失电量
-    public static final String NXDSSDL = "NXDSSDL"; // 年限电损失电量
-
-    public static final String FCCFTFS10 = "FCCFTFS10";// 测风塔10米风速
-    public static final String FCCFTFS30 = "FCCFTFS30";// 测风塔30米风速
-    public static final String FCCFTFS50 = "FCCFTFS50";// 测风塔50米风速
-    public static final String FCCFTFS60 = "FCCFTFS60";// 测风塔60米风速
-    public static final String FCCFTFS70 = "FCCFTFS70";// 测风塔70米风速
-    public static final String FCCFTFS80 = "FCCFTFS80";// 测风塔80米风速
-
-    public static final String FCCFTFX10 = "FCCFTFX10";// 测风塔10米风向
-    public static final String FCCFTFX30 = "FCCFTFX30";// 测风塔30米风向
-    public static final String FCCFTFX50 = "FCCFTFX50";// 测风塔50米风向
-    public static final String FCCFTFX60 = "FCCFTFX60";// 测风塔60米风向
-    public static final String FCCFTFX70 = "FCCFTFX70";// 测风塔70米风向
-    public static final String FCCFTFX80 = "FCCFTFX80";// 测风塔80米风向
-
-    public static final String FCCFTWD = "FCCFTWD";// 测风塔温度
-    public static final String FCCFTSD = "FCCFTSD";// 测风塔湿度
-    public static final String FCCFTYQ = "FCCFTYQ";// 测风塔压强
-    
-    public static final String FJJKJL = "JKJL001";//风机健康状态值
-    public static final String CLXJKJL = "JKJL002";//齿轮箱健康状态值
-    public static final String FDJJKJL = "JKJL003";//发电机健康状态值
-    public static final String BJJKJL = "JKJL004";//变浆健康值
-    public static final String ZKJKJL = "JKJL005";//主控健康状态值
-    
-    public static final String FJLHSL = "JKSLLH001";//风机良好健康状态数量
-    public static final String FJZCSL = "JKSLHG001";//风机正常健康状态数量
-    public static final String FJZYSL = "JKSLZY001";//风机注意健康状态数量
-    public static final String FJYZSL = "JKSLYZ001";//风机严重健康状态数量
-    
-    public static final String YCFJJKZT4HOUR = "JKYC001";//风机健康状态未来4小时
-    public static final String YCFJJKZT1DAY = "JKYC006";//风机健康状态未来1天
-    public static final String YCFJJKZT3DAY = "JKYC011";//风机健康状态未来3天
-    public static final String YCFJJKZT7DAY = "JKYC016";//风机健康状态未来7天
-    public static final String YCFJJKZT1MONTH = "JKYC021";//风机健康状态未来1个月
-    
-    public static final String FJJKZZ = "JKZT100";//风机健康总状态得分
-    
-    public static final String FJJKZT = "JKZT001";//风机健康状态
-    public static final String CLXJKZT = "JKZT002";//齿轮箱健康状态
-    public static final String FDJJKZT = "JKZT003";//发电机健康状态
-    public static final String BJJKZT = "JKZT004";//变浆健康
-    public static final String ZKJKZT = "JKZT005";//主控健康状态
-    
-    
-    
-}

+ 5 - 5
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconPartPowerstatticMainMapper.java

@@ -1,7 +1,7 @@
 package com.gyee.failurestatistics.mapper.auto;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.gyee.failurestatistics.model.auto.ProEconPartPowerstatticMain;
+import com.gyee.failurestatistics.model.auto.ProEconPartPowerStatticMain;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
@@ -16,13 +16,13 @@ import java.util.Date;
  * @author shilin
  * @since 2023-04-24
  */
-public interface ProEconPartPowerstatticMainMapper extends BaseMapper<ProEconPartPowerstatticMain> {
+public interface ProEconPartPowerstatticMainMapper extends BaseMapper<ProEconPartPowerStatticMain> {
 
 
-    @Delete(" delete from pro_econ_part_powerstattic_main where record_date=#{recorddate} ")
+    @Delete(" delete from pro_econ_part_power_stattic_main where record_date=#{recorddate} ")
     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}) ")
-    public int insertPartpowerstatticsmain(ProEconPartPowerstatticMain partpowerstatticsmain);
+    @Insert("  INSERT INTO pro_econ_part_power_stattic_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}) ")
+    public int insertPartpowerstatticsmain(ProEconPartPowerStatticMain partpowerstatticsmain);
 }

+ 5 - 5
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconPartpowerStatticsSubMapper.java

@@ -1,7 +1,7 @@
 package com.gyee.failurestatistics.mapper.auto;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.gyee.failurestatistics.model.auto.ProEconPartpowerStatticsSub;
+import com.gyee.failurestatistics.model.auto.ProEconPartPowerStatticsSub;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
@@ -16,12 +16,12 @@ import java.util.Date;
  * @author shilin
  * @since 2023-04-24
  */
-public interface ProEconPartpowerStatticsSubMapper extends BaseMapper<ProEconPartpowerStatticsSub> {
+public interface ProEconPartpowerStatticsSubMapper extends BaseMapper<ProEconPartPowerStatticsSub> {
 
-    @Delete(" delete from pro_econ_partpower_stattics_sub where record_date=#{recorddate} ")
+    @Delete(" delete from pro_econ_part_power_stattics_sub where record_date=#{recorddate} ")
     public int deletePartpowerstatticssub(@Param(value = "recorddate") Date recorddate);
 
 
-    @Insert("  INSERT INTO pro_econ_partpower_stattics_sub(id,tid,record_date,partid,name,datavalue,power,earlywarningvalue,criticalvalue) VALUES(#{id,jdbcType=VARCHAR},#{tid,jdbcType=VARCHAR},#{record_date},#{partid,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{datavalue,jdbcType=DECIMAL},#{power,jdbcType=VARCHAR},#{earlywarningvalue,jdbcType=DECIMAL},#{criticalvalue,jdbcType=DECIMAL})")
-    public int insertPartpowerstatticssub(ProEconPartpowerStatticsSub partpowerstatticssub);
+    @Insert("  INSERT INTO pro_econ_part_power_stattics_sub(id,tid,record_date,partid,name,datavalue,power,earlywarningvalue,criticalvalue) VALUES(#{id,jdbcType=VARCHAR},#{tid,jdbcType=VARCHAR},#{record_date},#{partid,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{datavalue,jdbcType=DECIMAL},#{power,jdbcType=VARCHAR},#{earlywarningvalue,jdbcType=DECIMAL},#{criticalvalue,jdbcType=DECIMAL})")
+    public int insertPartpowerstatticssub(ProEconPartPowerStatticsSub partpowerstatticssub);
 }

Файловите разлики са ограничени, защото са твърде много
+ 14 - 0
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconRecommenMainMapper.java


+ 9 - 7
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/mapper/auto/ProEconShutdownEventMapper.java

@@ -24,10 +24,10 @@ public interface ProEconShutdownEventMapper extends BaseMapper<ProEconShutdownEv
 
 
     @Select("<script> select * from pro_econ_shutdown_event where  " +
-            "  <when test='wpId !=null'>  windpowerstation_id = #{wpId}   </when> " +
-            "  <when test='wtId !=null && wpId==null '> windturbine_id = #{wtId}   </when> " +
-            "  <when test='wtId !=null && wpId!=null '> and windturbine_id = #{wtId}   </when> " +
-            "  and stop_time >= #{beginDate}  and stop_time <= #{endDate} " +
+
+            "  <when test='wtId !=null  '> windturbine_id = #{wtId}   </when> " +
+            "  <when test='wpId !=null'>  and windpowerstation_id = #{wpId}   </when> " +
+            "  and stop_time >= #{beginDate}  and stop_time &lt;= #{endDate} " +
             "  <when test='type !=null  '> and status_code = #{type}   </when> " +
             " order by windturbine_id,start_time desc" +
             "</script>")
@@ -48,7 +48,7 @@ public interface ProEconShutdownEventMapper extends BaseMapper<ProEconShutdownEv
     List<SimpleVo> countStopByPj();
 
 
-    @Select("select * from pro_econ_shutdown_event t  where  t.stop_time>=#{beginDate}   and  t.stop_time<=#{endDate} and t.status_code=2  and t.warning_id is null and t.stop_time is not null  order by t.windturbine_id")
+    @Select("select * from pro_econ_shutdown_event t  where  t.stop_time>=#{beginDate}   and  t.stop_time<=#{endDate} and t.stoptype_id<>'wh'  and t.warning_id is null and t.stop_time is not null  order by t.windturbine_id")
     public List<ProEconShutdownEvent> queryShutdowneventList(@Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate);
 
     @Select(" select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime,s.category2 stopTypeId " +
@@ -63,7 +63,9 @@ public interface ProEconShutdownEventMapper extends BaseMapper<ProEconShutdownEv
     public List<ShutdowneventVo> queryAlerthistoryList(@Param(value = "alerthistory")String alerthistory, @Param(value = "windturbineid")String windturbineid, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
 
 
-    @Update("update pro_econ_shutdown_event t  set t.warning_id=#{warning_id},t.stop_type_id=#{stop_type_id}  where t.id=#{stopid}")
-    public int  updateShutdownevent(@Param(value = "warning_id") String warning_id, @Param(value = "stop_type_id")String stop_type_id, @Param(value = "stopid")String stopid);
+    @Update("update pro_econ_shutdown_event t  set t.warning_id=#{warning_id},t.stoptype_id=#{stoptype_id}  where t.id=#{stopid}")
+    public int  updateShutdownevent(@Param(value = "warning_id") String warning_id, @Param(value = "stoptype_id")String stoptype_id, @Param(value = "stopid")String stopid);
 
 }
+
+

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProBasicStatusPoint.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 
 /**
  * <p>

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPartPowerstatticMain.java

@@ -16,7 +16,7 @@ import java.util.Date;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class ProEconPartPowerstatticMain extends Model {
+public class ProEconPartPowerStatticMain extends Model {
 
     private static final long serialVersionUID = 1L;
 

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPartpowerStatticsSub.java

@@ -17,7 +17,7 @@ import java.util.Date;
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class ProEconPartpowerStatticsSub extends Model {
+public class ProEconPartPowerStatticsSub extends Model {
 
     private static final long serialVersionUID = 1L;
 

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay1.java

@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 import java.util.Date;
 
 /**

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay2.java

@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 import java.util.Date;
 
 /**

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay3.java

@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 import java.util.Date;
 
 /**

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay4.java

@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 import java.util.Date;
 
 /**

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay5.java

@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 import java.util.Date;
 
 /**

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay6.java

@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 import java.util.Date;
 
 /**

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconPowerstationInfoDay7.java

@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 import java.util.Date;
 
 /**

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/auto/ProEconRecommenMain.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.math.Double;
+
 import java.util.Date;
 
 /**

+ 1 - 13
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/custom/ShutdowneventVo.java

@@ -1,8 +1,6 @@
 
 package com.gyee.failurestatistics.model.custom;
 
-import com.gyee.failurestatistics.init.Constant;
-
 import java.util.Date;
 
 
@@ -181,16 +179,6 @@ public class ShutdowneventVo {
 	public void setStatusCode(Integer statusCode) {
 		this.statusCode = statusCode;
 	}
-	public String getStatusName(){
-		String result = null;
-		if(statusCode != null){
-			if(statusCode==2){
-				result = Constant.FAULT_NAME;
-			}else if(statusCode==4){
-				result = Constant.MAINTENANCE_NAME;
-			}
-		}
-		return result;
-	}
+
 	
 }	

+ 4 - 3
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/custom/export/TsPointData.java

@@ -1,6 +1,7 @@
 package com.gyee.failurestatistics.model.custom.export;
 
-import java.math.Double;
+
+import java.math.BigDecimal;
 
 public class TsPointData {
 
@@ -29,8 +30,8 @@ public class TsPointData {
     }
 
     public void setDoubleValue(double doubleValue) {
-        Double bg = new Double(doubleValue);
-        double v = bg.setScale(2, Double.ROUND_HALF_UP).doubleValue();
+        BigDecimal bg = new BigDecimal(doubleValue);
+        double v = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
         this.doubleValue = v;
     }
 }

+ 106 - 105
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/dto/response/EconHomePagePointRateDTO.java

@@ -2,7 +2,8 @@ package com.gyee.failurestatistics.model.dto.response;
 
 import lombok.Data;
 
-import java.math.Double;
+import java.math.BigDecimal;
+
 
 /**
  * 经济运行首页指标率响应类
@@ -16,354 +17,354 @@ public class EconHomePagePointRateDTO {
     /**
      * 故障损失率
      */
-    private Double currGzsll;
-    private Double ringGzslzzl;
-    private Double withGzslzzl;
+    private BigDecimal currGzsll;
+    private BigDecimal ringGzslzzl;
+    private BigDecimal withGzslzzl;
 
     /**
      * 检修损失率
      */
-    private Double currJxsll;
-    private Double ringJxslzzl;
-    private Double withJxslzzl;
+    private BigDecimal currJxsll;
+    private BigDecimal ringJxslzzl;
+    private BigDecimal withJxslzzl;
 
 
     /**
      * 限电损失率
      */
-    private Double currXdsll;
-    private Double ringXdslzzl;
-    private Double withXdslzzl;
+    private BigDecimal currXdsll;
+    private BigDecimal ringXdslzzl;
+    private BigDecimal withXdslzzl;
 
     /**
      * 受累损失率
      */
-    private Double currSlsll;
-    private Double ringSlslzzl;
-    private Double withSlslzzl;
+    private BigDecimal currSlsll;
+    private BigDecimal ringSlslzzl;
+    private BigDecimal withSlslzzl;
 
 
     /**
      * 性能损失率
      */
-    private Double currXNsll;
-    private Double ringXnslzzl;
-    private Double withXnslzzl;
+    private BigDecimal currXNsll;
+    private BigDecimal ringXnslzzl;
+    private BigDecimal withXnslzzl;
 
 
     /**
      * 复位及时率/综合效率
      */
-    private Double currFwjsl;
-    private Double ringFwjszzl;
-    private Double withFwjszzl;
+    private BigDecimal currFwjsl;
+    private BigDecimal ringFwjszzl;
+    private BigDecimal withFwjszzl;
 
     /**
      * 状态转换率/离散率
      */
-    private Double currZtzhl;
-    private Double ringZtzhzzl;
-    private Double withZtzhzzl;
+    private BigDecimal currZtzhl;
+    private BigDecimal ringZtzhzzl;
+    private BigDecimal withZtzhzzl;
 
     /**
      * 消缺及时率/转换效率
      */
-    private Double currXqjsl;
-    private Double ringXqjszzl;
-    private Double withXqjszzl;
+    private BigDecimal currXqjsl;
+    private BigDecimal ringXqjszzl;
+    private BigDecimal withXqjszzl;
 
     /**
      * 综合常用电率
      */
-    private Double currZhcydl;
-    private Double ringZhcydzzl;
-    private Double withZhcydzzl;
+    private BigDecimal currZhcydl;
+    private BigDecimal ringZhcydzzl;
+    private BigDecimal withZhcydzzl;
     /**
      * 功率曲线符合率
      */
-    private Double currGlqxfhl;
-    private Double ringGlqxfhzzl;
-    private Double withGlqxfhzzl;
+    private BigDecimal currGlqxfhl;
+    private BigDecimal ringGlqxfhzzl;
+    private BigDecimal withGlqxfhzzl;
 
     /**
      * 设备可利用率
      */
-    private Double currSbklyl;
-    private Double ringSbklyzzl;
-    private Double withSbklyzzl;
+    private BigDecimal currSbklyl;
+    private BigDecimal ringSbklyzzl;
+    private BigDecimal withSbklyzzl;
 
-    public Double getCurrGzsll() {
+    public BigDecimal getCurrGzsll() {
         if(null == currGzsll){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currGzsll = compare100(currGzsll);
         return currGzsll;
     }
 
-    public Double getRingGzslzzl() {
+    public BigDecimal getRingGzslzzl() {
         if(null == ringGzslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringGzslzzl = compare100(ringGzslzzl);
         return ringGzslzzl;
     }
 
-    public Double getWithGzslzzl() {
+    public BigDecimal getWithGzslzzl() {
         if(null == withGzslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withGzslzzl = compare100(withGzslzzl);
         return withGzslzzl;
     }
 
-    public Double getCurrJxsll() {
+    public BigDecimal getCurrJxsll() {
         if(null == currJxsll){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currJxsll = compare100(currJxsll);
         return currJxsll;
     }
 
-    public Double getRingJxslzzl() {
+    public BigDecimal getRingJxslzzl() {
         if(null == ringJxslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringJxslzzl = compare100(ringJxslzzl);
         return ringJxslzzl;
     }
 
-    public Double getWithJxslzzl() {
+    public BigDecimal getWithJxslzzl() {
         if(null == withJxslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withJxslzzl = compare100(withJxslzzl);
         return withJxslzzl;
     }
 
-    public Double getCurrXdsll() {
+    public BigDecimal getCurrXdsll() {
         if(null == currXdsll){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currXdsll = compare100(currXdsll);
         return currXdsll;
     }
 
-    public Double getRingXdslzzl() {
+    public BigDecimal getRingXdslzzl() {
         if(null == ringXdslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringXdslzzl = compare100(ringXdslzzl);
         return ringXdslzzl;
     }
 
-    public Double getWithXdslzzl() {
+    public BigDecimal getWithXdslzzl() {
         if(null == withXdslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withXdslzzl = compare100(withXdslzzl);
         return withXdslzzl;
     }
 
-    public Double getCurrSlsll() {
+    public BigDecimal getCurrSlsll() {
         if(null == currSlsll){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currSlsll = compare100(currSlsll);
         return currSlsll;
     }
 
-    public Double getRingSlslzzl() {
+    public BigDecimal getRingSlslzzl() {
         if(null == ringSlslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringSlslzzl = compare100(ringSlslzzl);
         return ringSlslzzl;
     }
 
-    public Double getWithSlslzzl() {
+    public BigDecimal getWithSlslzzl() {
         if(null == withSlslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withSlslzzl = compare100(withSlslzzl);
         return withSlslzzl;
     }
 
-    public Double getCurrXNsll() {
+    public BigDecimal getCurrXNsll() {
         if(null == currXNsll){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currXNsll = compare100(currXNsll);
         return currXNsll;
     }
 
-    public Double getRingXnslzzl() {
+    public BigDecimal getRingXnslzzl() {
         if(null == ringXnslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringXnslzzl = compare100(ringXnslzzl);
         return ringXnslzzl;
     }
 
-    public Double getWithXnslzzl() {
+    public BigDecimal getWithXnslzzl() {
         if(null == withXnslzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withXnslzzl = compare100(withXnslzzl);
         return withXnslzzl;
     }
 
-    public Double getCurrFwjsl() {
+    public BigDecimal getCurrFwjsl() {
         if(null == currFwjsl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currFwjsl = compare100(currFwjsl);
         return currFwjsl;
     }
 
-    public Double getRingFwjszzl() {
+    public BigDecimal getRingFwjszzl() {
         if(null == ringFwjszzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringFwjszzl = compare100(ringFwjszzl);
         return ringFwjszzl;
     }
 
-    public Double getWithFwjszzl() {
+    public BigDecimal getWithFwjszzl() {
         if(null == withFwjszzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withFwjszzl = compare100(withFwjszzl);
         return withFwjszzl;
     }
 
-    public Double getCurrZtzhl() {
+    public BigDecimal getCurrZtzhl() {
         if(null == currZtzhl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currZtzhl = compare100(currZtzhl);
         return currZtzhl;
     }
 
-    public Double getRingZtzhzzl() {
+    public BigDecimal getRingZtzhzzl() {
         if(null == ringZtzhzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringZtzhzzl = compare100(ringZtzhzzl);
         return ringZtzhzzl;
     }
 
-    public Double getWithZtzhzzl() {
+    public BigDecimal getWithZtzhzzl() {
         if(null == withZtzhzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withZtzhzzl = compare100(withZtzhzzl);
         return withZtzhzzl;
     }
 
-    public Double getCurrXqjsl() {
+    public BigDecimal getCurrXqjsl() {
         if(null == currXqjsl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currXqjsl = compare100(currXqjsl);
         return currXqjsl;
     }
 
-    public Double getRingXqjszzl() {
+    public BigDecimal getRingXqjszzl() {
         if(null == ringXqjszzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringXqjszzl = compare100(ringXqjszzl);
         return ringXqjszzl;
     }
 
-    public Double getWithXqjszzl() {
+    public BigDecimal getWithXqjszzl() {
         if(null == withXqjszzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withXqjszzl = compare100(withXqjszzl);
         return withXqjszzl;
     }
 
-    public Double getCurrZhcydl() {
+    public BigDecimal getCurrZhcydl() {
         if(null == currZhcydl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currZhcydl = compare100(currZhcydl);
         return currZhcydl;
     }
 
-    public Double getRingZhcydzzl() {
+    public BigDecimal getRingZhcydzzl() {
         if(null == ringZhcydzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringZhcydzzl = compare100(ringZhcydzzl);
         return ringZhcydzzl;
     }
 
-    public Double getWithZhcydzzl() {
+    public BigDecimal getWithZhcydzzl() {
         if(null == withZhcydzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withZhcydzzl = compare100(withZhcydzzl);
         return withZhcydzzl;
     }
 
-    public Double getCurrGlqxfhl() {
+    public BigDecimal getCurrGlqxfhl() {
         if(null == currGlqxfhl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currGlqxfhl = compare100(currGlqxfhl);
         return currGlqxfhl;
     }
 
-    public Double getRingGlqxfhzzl() {
+    public BigDecimal getRingGlqxfhzzl() {
         if(null == ringGlqxfhzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringGlqxfhzzl = compare100(ringGlqxfhzzl);
         return ringGlqxfhzzl;
     }
 
-    public Double getWithGlqxfhzzl() {
+    public BigDecimal getWithGlqxfhzzl() {
         if(null == withGlqxfhzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withGlqxfhzzl = compare100(withGlqxfhzzl);
         return withGlqxfhzzl;
     }
 
-    public Double getCurrSbklyl() {
+    public BigDecimal getCurrSbklyl() {
         if(null == currSbklyl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         currSbklyl = compare100(currSbklyl);
         return currSbklyl;
     }
 
-    public Double getRingSbklyzzl() {
+    public BigDecimal getRingSbklyzzl() {
         if(null == ringSbklyzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         ringSbklyzzl = compare100(ringSbklyzzl);
         return ringSbklyzzl;
     }
 
-    public Double getWithSbklyzzl() {
+    public BigDecimal getWithSbklyzzl() {
         if(null == withSbklyzzl){
-            return new Double(0.00);
+            return new BigDecimal(0.00);
         }
         withSbklyzzl = compare100(withSbklyzzl);
         return withSbklyzzl;
     }
 
-    private Double compare100(Double a) {
-        Double b = new Double(100);
+    private BigDecimal compare100(BigDecimal a) {
+        BigDecimal b = new BigDecimal(100);
         if (b.compareTo(a) == -1) {
-            a = new Double(100);
+            a = new BigDecimal(100);
         }
 
-        if (a.compareTo(Double.ZERO) == -1) {
-            a = new Double(0);
+        if (a.compareTo(BigDecimal.ZERO) == -1) {
+            a = new BigDecimal(0);
         }
         return a;
 

+ 8 - 7
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/model/dto/response/ProEconPointCodeDTO.java

@@ -2,7 +2,8 @@ package com.gyee.failurestatistics.model.dto.response;
 
 import lombok.Data;
 
-import java.math.Double;
+import java.math.BigDecimal;
+
 
 @Data
 public class ProEconPointCodeDTO {
@@ -10,23 +11,23 @@ public class ProEconPointCodeDTO {
     private String stationname;
     private String stationcode;
     private String description;
-    private Double value;
+    private BigDecimal value;
 
 
-    public Double getValue() {
+    public BigDecimal getValue() {
         return compare100(value);
     }
 
 
-    private Double compare100(Double a) {
+    private BigDecimal compare100(BigDecimal a) {
 
         if (null == a) {
-            a = new Double(0);
+            a = new BigDecimal(0);
 
         }
 
-        if (a.compareTo(Double.ZERO) == -1) {
-            a = new Double(0);
+        if (a.compareTo(BigDecimal.ZERO) == -1) {
+            a = new BigDecimal(0);
         }
         return a;
 

Файловите разлики са ограничени, защото са твърде много
+ 130 - 148
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/PartpowerstatticsService.java


+ 7 - 7
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/PartstatisticsService.java

@@ -1,13 +1,13 @@
 package com.gyee.failurestatistics.service;
 
+import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
 import com.gyee.failurestatistics.init.CacheContext;
-import com.gyee.failurestatistics.init.Constant;
-import com.gyee.failurestatistics.model.auto.ProEconPartStatisticsMain;
-import com.gyee.failurestatistics.model.auto.ProBasicPowerstation;
 import com.gyee.failurestatistics.model.auto.ProBasicEquipment;
 import com.gyee.failurestatistics.model.auto.ProBasicEquipmentPoint;
+import com.gyee.failurestatistics.model.auto.ProBasicPowerstation;
+import com.gyee.failurestatistics.model.auto.ProEconPartStatisticsMain;
 import com.gyee.failurestatistics.service.auto.IProEconPartStatisticsMainService;
 import com.gyee.failurestatistics.util.DateUtils;
 import com.gyee.failurestatistics.util.IRealTimeDataBaseUtil;
@@ -147,10 +147,10 @@ public class PartstatisticsService {
 
                     if(StringUtils.notEmp(map) && !map.isEmpty())
                     {
-                        getPartTargetValue(wt, Constant.CLXJKZT, endDate, beginDate, daynum, map,clxmap);
-                        getPartTargetValue(wt, Constant.FDJJKZT, endDate, beginDate, daynum, map,fdjxmap);
-                        getPartTargetValue(wt, Constant.BJJKZT, endDate, beginDate, daynum, map,bjmap);
-                        getPartTargetValue(wt, Constant.ZKJKZT, endDate, beginDate, daynum, map,zkxmap);
+                        getPartTargetValue(wt, ContantXk.JKZT002, endDate, beginDate, daynum, map,clxmap);
+                        getPartTargetValue(wt, ContantXk.JKZT003, endDate, beginDate, daynum, map,fdjxmap);
+                        getPartTargetValue(wt, ContantXk.JKZT004, endDate, beginDate, daynum, map,bjmap);
+                        getPartTargetValue(wt, ContantXk.JKZT005, endDate, beginDate, daynum, map,zkxmap);
                     }
 
 

+ 98 - 118
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/ParttemperatureService.java

@@ -1,9 +1,9 @@
 package com.gyee.failurestatistics.service;
 
+import com.gyee.common.contant.ContantXk;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
 import com.gyee.failurestatistics.init.CacheContext;
-import com.gyee.failurestatistics.init.Constant;
 import com.gyee.failurestatistics.model.auto.*;
 import com.gyee.failurestatistics.service.auto.IProEconPartTemperatureMainService;
 import com.gyee.failurestatistics.service.auto.IProEconPartTemperatureSubService;
@@ -35,26 +35,6 @@ public class ParttemperatureService {
     SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
 
-    private String CLXSRZYW1 = "AI038";// 齿轮箱输入轴油温1
-    private String CLXSRZYW2 = "AI039";// 齿轮箱输入轴油温2
-    private String CLXRKYW = "AI040";// 齿轮箱入口温度
-    private String CLXYW = "AI041";// 齿轮箱油温
-
-    private String FDJZCWDA = "AI052";// 发电机轴承温度A
-    private String FDJZCWDB = "AI053";// 发电机轴承温度B
-    private String FDJUXYZWD = "AI045";// 发电机U相绕组温度
-    private String FDJVXYZWD = "AI047";// 发电机V相绕组温度
-    private String FDJWXYZWD = "AI049";// 发电机W相绕组温度
-    private String FDJLQFWD = "AI054";// 发电机冷却风温度
-
-    private String BJDRQWD = "AI113";// 变浆电容器温度
-    private String BJDRDY = "AI116";// 变浆电容温度
-    private String BJDLQWD = "AI239";// 变浆电流器温度
-    private String BJDJWD = "AI242";// 电机温度
-    private String BJKZGWD = "AI233";// 变浆控制柜温度
-
-    private String TDGWD = "AI069";// 塔底柜温度
-    private String TDJGWD = "AI070";// 塔顶机柜温度
 
     public void deleteParttemperaturemain(Date recodedate) {
         proEconPartTemperatureMainService.deleteParttemperaturemain(recodedate);
@@ -116,29 +96,29 @@ public class ParttemperatureService {
 
             if(StringUtils.notEmp(map) && !map.isEmpty())
             {
-                Map<String, Double> wdmap = getWdValue(wt, Constant.TPOINT_WT_JCWD, endDate, beginDate, map);
+                Map<String, Double> wdmap = getWdValue(wt, ContantXk.AI074, endDate, beginDate, map);
 
 
-                Map<String, Double> cLXSRZYW1map = getPartTargetValue(wt, CLXSRZYW1, endDate, beginDate, map,63,0);
-                Map<String, Double> cLXSRZYW2map = getPartTargetValue(wt, CLXSRZYW2, endDate, beginDate, map,63,0);
-                Map<String, Double> cLXRKYWmap = getPartTargetValue(wt, CLXRKYW, endDate, beginDate, map,63,0);
-                Map<String, Double> cLXYWmap = getPartTargetValue(wt, CLXYW, endDate, beginDate, map,60,0);
+                Map<String, Double> cLXSRZYW1map = getPartTargetValue(wt, ContantXk.AI042, endDate, beginDate, map,63,0);
+                Map<String, Double> cLXSRZYW2map = getPartTargetValue(wt, ContantXk.AI043, endDate, beginDate, map,63,0);
+                Map<String, Double> cLXRKYWmap = getPartTargetValue(wt, ContantXk.AI038, endDate, beginDate, map,63,0);
+                Map<String, Double> cLXYWmap = getPartTargetValue(wt, ContantXk.AI039, endDate, beginDate, map,60,0);
 
-                Map<String, Double> fDJZCWDAmap = getPartTargetValue(wt, FDJZCWDA, endDate, beginDate, map,45,0);
-                Map<String, Double> fDJZCWDBmap = getPartTargetValue(wt, FDJZCWDB, endDate, beginDate, map,45,0);
-                Map<String, Double> fDJUXYZWDmap = getPartTargetValue(wt, FDJUXYZWD, endDate, beginDate, map,110,0);
-                Map<String, Double> fDJVXYZWDmap = getPartTargetValue(wt, FDJVXYZWD, endDate, beginDate, map,110,0);
-                Map<String, Double> fDJWXYZWDmap = getPartTargetValue(wt, FDJWXYZWD, endDate, beginDate, map,110,0);
-                Map<String, Double> fDJLQFWDmap = getPartTargetValue(wt, FDJLQFWD, endDate, beginDate, map,50,0);
+                Map<String, Double> fDJZCWDAmap = getPartTargetValue(wt, ContantXk.AI092, endDate, beginDate, map,45,0);
+                Map<String, Double> fDJZCWDBmap = getPartTargetValue(wt, ContantXk.AI062, endDate, beginDate, map,45,0);
+                Map<String, Double> fDJUXYZWDmap = getPartTargetValue(wt, ContantXk.AI004, endDate, beginDate, map,110,0);
+                Map<String, Double> fDJVXYZWDmap = getPartTargetValue(wt, ContantXk.AI006, endDate, beginDate, map,110,0);
+                Map<String, Double> fDJWXYZWDmap = getPartTargetValue(wt, ContantXk.AI008, endDate, beginDate, map,110,0);
+                Map<String, Double> fDJLQFWDmap = getPartTargetValue(wt, ContantXk.AI059, endDate, beginDate, map,50,0);
 
-                Map<String, Double> bJDRQWDmap = getPartTargetValue(wt, BJDRQWD, endDate, beginDate, map,35,0);
-                Map<String, Double> bJDRDYmap = getPartTargetValue(wt, BJDRDY, endDate, beginDate, map,70,0);
-                Map<String, Double> bJDLQWDmap = getPartTargetValue(wt, BJDLQWD, endDate, beginDate, map,50,0);
-                Map<String, Double> bJDJWDmap = getPartTargetValue(wt, BJDJWD, endDate, beginDate, map,50,0);
-                Map<String, Double> bJKZGWDmap = getPartTargetValue(wt, BJKZGWD, endDate, beginDate, map,45,0);
+                Map<String, Double> bJDRQWDmap = getPartTargetValue(wt, ContantXk.AI050, endDate, beginDate, map,35,0);
+                Map<String, Double> bJDRDYmap = getPartTargetValue(wt, ContantXk.AI076, endDate, beginDate, map,70,0);
+                Map<String, Double> bJDLQWDmap = getPartTargetValue(wt, ContantXk.AI020, endDate, beginDate, map,50,0);
+                Map<String, Double> bJDJWDmap = getPartTargetValue(wt, ContantXk.AI045, endDate, beginDate, map,50,0);
+                Map<String, Double> bJKZGWDmap = getPartTargetValue(wt, ContantXk.AI029, endDate, beginDate, map,45,0);
 
-                Map<String, Double> tDGWDmap = getPartTargetValue(wt, TDGWD, endDate, beginDate, map,35,0);
-                Map<String, Double> tDJGWDmap = getPartTargetValue(wt, TDJGWD, endDate, beginDate, map,35,0);
+                Map<String, Double> tDGWDmap = getPartTargetValue(wt, ContantXk.AI085, endDate, beginDate, map,35,0);
+                Map<String, Double> tDJGWDmap = getPartTargetValue(wt, ContantXk.AI099, endDate, beginDate, map,35,0);
 
 
                 Map<String, Map<String, Integer>> pointmap =new HashMap<>();
@@ -151,26 +131,26 @@ public class ParttemperatureService {
                         Map.Entry<String, Double> wdentry = (Map.Entry<String, Double>) wdit.next();
 
 
-                        setPointValues(CLXSRZYW1, cLXSRZYW1map, pointmap, wdentry);
-                        setPointValues(CLXSRZYW2, cLXSRZYW2map, pointmap, wdentry);
-                        setPointValues(CLXRKYW, cLXRKYWmap, pointmap, wdentry);
-                        setPointValues(CLXYW, cLXYWmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI042, cLXSRZYW1map, pointmap, wdentry);
+                        setPointValues(ContantXk.AI043, cLXSRZYW2map, pointmap, wdentry);
+                        setPointValues(ContantXk.AI038, cLXRKYWmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI039, cLXYWmap, pointmap, wdentry);
 
-                        setPointValues(FDJZCWDA, fDJZCWDAmap, pointmap, wdentry);
-                        setPointValues(FDJZCWDB, fDJZCWDBmap, pointmap, wdentry);
-                        setPointValues(FDJUXYZWD, fDJUXYZWDmap, pointmap, wdentry);
-                        setPointValues(FDJVXYZWD, fDJVXYZWDmap, pointmap, wdentry);
-                        setPointValues(FDJWXYZWD, fDJWXYZWDmap, pointmap, wdentry);
-                        setPointValues(FDJLQFWD, fDJLQFWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI092, fDJZCWDAmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI062, fDJZCWDBmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI004, fDJUXYZWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI006, fDJVXYZWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI008, fDJWXYZWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI059, fDJLQFWDmap, pointmap, wdentry);
 
-                        setPointValues(BJDRQWD, bJDRQWDmap, pointmap, wdentry);
-                        setPointValues(BJDRDY, bJDRDYmap, pointmap, wdentry);
-                        setPointValues(BJDLQWD, bJDLQWDmap, pointmap, wdentry);
-                        setPointValues(BJDJWD, bJDJWDmap, pointmap, wdentry);
-                        setPointValues(BJKZGWD, bJKZGWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI050, bJDRQWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI076, bJDRDYmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI020, bJDLQWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI045, bJDJWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI029, bJKZGWDmap, pointmap, wdentry);
 
-                        setPointValues(TDGWD, tDGWDmap, pointmap, wdentry);
-                        setPointValues(TDJGWD, tDJGWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI085, tDGWDmap, pointmap, wdentry);
+                        setPointValues(ContantXk.AI099, tDJGWDmap, pointmap, wdentry);
                     }
 
 
@@ -276,68 +256,68 @@ public class ParttemperatureService {
 
     private void initialCodeValue(List<String> codels, Map<String, String> codeParentmap, Map<String, String> codenamemap) {
 
-        codels.add(CLXSRZYW1);
-        codels.add(CLXSRZYW2);
-        codels.add(CLXRKYW);
-        codels.add(CLXYW);
-
-        codels.add(FDJZCWDA);
-        codels.add(FDJZCWDB);
-        codels.add(FDJUXYZWD);
-        codels.add(FDJVXYZWD);
-        codels.add(FDJWXYZWD);
-        codels.add(FDJLQFWD);
-
-        codels.add(BJDRQWD);
-        codels.add(BJDRDY);
-        codels.add(BJDLQWD);
-        codels.add(BJDJWD);
-        codels.add(BJKZGWD);
-
-        codels.add(TDGWD);
-        codels.add(TDJGWD);
-
-        codeParentmap.put(CLXSRZYW1, "clx");
-        codeParentmap.put(CLXSRZYW2, "clx");
-        codeParentmap.put(CLXRKYW, "clx");
-        codeParentmap.put(CLXYW, "clx");
-
-        codeParentmap.put(FDJZCWDA, "fdj");
-        codeParentmap.put(FDJZCWDB, "fdj");
-        codeParentmap.put(FDJUXYZWD, "fdj");
-        codeParentmap.put(FDJVXYZWD, "fdj");
-        codeParentmap.put(FDJWXYZWD, "fdj");
-        codeParentmap.put(FDJLQFWD, "fdj");
-
-        codeParentmap.put(BJDRQWD, "bj");
-        codeParentmap.put(BJDRDY, "bj");
-        codeParentmap.put(BJDLQWD, "bj");
-        codeParentmap.put(BJDJWD, "bj");
-        codeParentmap.put(BJKZGWD, "bj");
-
-        codeParentmap.put(TDGWD, "zk");
-        codeParentmap.put(TDJGWD, "zk");
-
-        codenamemap.put(CLXSRZYW1, "齿轮箱输入轴油温1");
-        codenamemap.put(CLXSRZYW2, "齿轮箱输入轴油温2");
-        codenamemap.put(CLXRKYW, "齿轮箱入口温度");
-        codenamemap.put(CLXYW, "齿轮箱油温");
-
-        codenamemap.put(FDJZCWDA, "发电机轴承温度A");
-        codenamemap.put(FDJZCWDB, "发电机轴承温度B");
-        codenamemap.put(FDJUXYZWD, "发电机U相绕组温度");
-        codenamemap.put(FDJVXYZWD, "发电机V相绕组温度");
-        codenamemap.put(FDJWXYZWD, "发电机W相绕组温度");
-        codenamemap.put(FDJLQFWD, "发电机冷却风温度");
-
-        codenamemap.put(BJDRQWD, "变浆电容器温度");
-        codenamemap.put(BJDRDY, "变浆电容温度");
-        codenamemap.put(BJDLQWD, "变浆电流器温度");
-        codenamemap.put(BJDJWD, "电机温度");
-        codenamemap.put(BJKZGWD, "变浆控制柜温度");
-
-        codenamemap.put(TDGWD, "塔底柜温度");
-        codenamemap.put(TDJGWD, "塔顶机柜温度");
+        codels.add(ContantXk.AI042);
+        codels.add(ContantXk.AI043);
+        codels.add(ContantXk.AI038);
+        codels.add(ContantXk.AI039);
+
+        codels.add(ContantXk.AI092);
+        codels.add(ContantXk.AI062);
+        codels.add(ContantXk.AI004);
+        codels.add(ContantXk.AI006);
+        codels.add(ContantXk.AI008);
+        codels.add(ContantXk.AI059);
+
+        codels.add(ContantXk.AI050);
+        codels.add(ContantXk.AI076);
+        codels.add(ContantXk.AI020);
+        codels.add(ContantXk.AI045);
+        codels.add(ContantXk.AI029);
+
+        codels.add(ContantXk.AI085);
+        codels.add(ContantXk.AI099);
+
+        codeParentmap.put(ContantXk.AI042, "clx");
+        codeParentmap.put(ContantXk.AI043, "clx");
+        codeParentmap.put(ContantXk.AI038, "clx");
+        codeParentmap.put(ContantXk.AI039, "clx");
+
+        codeParentmap.put(ContantXk.AI092, "fdj");
+        codeParentmap.put(ContantXk.AI062, "fdj");
+        codeParentmap.put(ContantXk.AI004, "fdj");
+        codeParentmap.put(ContantXk.AI006, "fdj");
+        codeParentmap.put(ContantXk.AI008, "fdj");
+        codeParentmap.put(ContantXk.AI059, "fdj");
+
+        codeParentmap.put(ContantXk.AI050, "bj");
+        codeParentmap.put(ContantXk.AI076, "bj");
+        codeParentmap.put(ContantXk.AI020, "bj");
+        codeParentmap.put(ContantXk.AI045, "bj");
+        codeParentmap.put(ContantXk.AI029, "bj");
+
+        codeParentmap.put(ContantXk.AI085, "zk");
+        codeParentmap.put(ContantXk.AI099, "zk");
+
+        codenamemap.put(ContantXk.AI042, "齿轮箱输入轴油温1");
+        codenamemap.put(ContantXk.AI043, "齿轮箱输入轴油温2");
+        codenamemap.put(ContantXk.AI038, "齿轮箱入口温度");
+        codenamemap.put(ContantXk.AI039, "齿轮箱油温");
+
+        codenamemap.put(ContantXk.AI092, "发电机轴承温度A");
+        codenamemap.put(ContantXk.AI062, "发电机轴承温度B");
+        codenamemap.put(ContantXk.AI004, "发电机U相绕组温度");
+        codenamemap.put(ContantXk.AI006, "发电机V相绕组温度");
+        codenamemap.put(ContantXk.AI008, "发电机W相绕组温度");
+        codenamemap.put(ContantXk.AI059, "发电机冷却风温度");
+
+        codenamemap.put(ContantXk.AI050, "变浆电容器温度");
+        codenamemap.put(ContantXk.AI076, "变浆电容温度");
+        codenamemap.put(ContantXk.AI020, "变浆电流器温度");
+        codenamemap.put(ContantXk.AI045, "电机温度");
+        codenamemap.put(ContantXk.AI029, "变浆控制柜温度");
+
+        codenamemap.put(ContantXk.AI085, "塔底柜温度");
+        codenamemap.put(ContantXk.AI099, "塔顶机柜温度");
     }
 
     private int setPointValue(String step,Map<String, Double> pointmap) {

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/Shutdownevent2Service.java

@@ -5,7 +5,7 @@ import com.gyee.failurestatistics.model.auto.ProBasicPowerstation;
 import com.gyee.failurestatistics.model.auto.ProEconShutdownEvent2;
 import com.gyee.failurestatistics.service.auto.IProEconShutdownEvent2Service;
 import com.gyee.failurestatistics.util.StringUtils;
-import com.gyee.failurestatistics.vo.ShutdowneventVo;
+import com.gyee.failurestatistics.model.custom.ShutdowneventVo;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;

+ 103 - 0
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/ShutdowneventService.java

@@ -0,0 +1,103 @@
+package com.gyee.failurestatistics.service;
+
+import com.gyee.failurestatistics.init.CacheContext;
+import com.gyee.failurestatistics.model.auto.ProBasicPowerstation;
+import com.gyee.failurestatistics.model.auto.ProEconShutdownEvent;
+import com.gyee.failurestatistics.service.auto.IProEconShutdownEventService;
+import com.gyee.failurestatistics.util.StringUtils;
+import com.gyee.failurestatistics.model.custom.ShutdowneventVo;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @ClassName : EarlywarningService
+ * @Description : 报警统计service
+ */
+@Service
+public class ShutdowneventService {
+
+
+    @Resource
+    private IProEconShutdownEventService  proEconShutdownEventService;
+
+    private final String  ALARMHISTORY="ALARMHISTORY";
+
+
+
+
+    public void updateShutdownevent() throws Exception {
+
+        Calendar c = Calendar.getInstance();
+//        c.set(Calendar.YEAR,2021);
+//        c.set(Calendar.MONTH,11);
+//        c.set(Calendar.DAY_OF_MONTH,17);
+
+
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        Date beginDate=c.getTime();
+        c.add(Calendar.DAY_OF_MONTH,1);
+        Date endDate=c.getTime();
+
+
+        List<ProEconShutdownEvent> sls=proEconShutdownEventService.queryShutdowneventList(beginDate, endDate);
+
+        if(!sls.isEmpty())
+        {
+            for(ProEconShutdownEvent sd:sls)
+            {
+                if(StringUtils.notEmp(sd.getWindturbineId()) && StringUtils.notEmp(sd.getWindpowerstationId())  && CacheContext.wpmap.containsKey(sd.getWindpowerstationId()))
+                {
+                    ProBasicPowerstation wp=CacheContext.wpmap.get(sd.getWindpowerstationId());
+                    String wpname=wp.getId().substring(0,wp.getId().indexOf("_"));
+
+                    StringBuilder alerthistory1=new StringBuilder(ALARMHISTORY).append("_").append(wpname).append("_");
+                    Calendar cal = Calendar.getInstance();
+                    cal.set(Calendar.HOUR_OF_DAY, 0);
+                    cal.set(Calendar.MINUTE, 0);
+                    cal.set(Calendar.SECOND, 0);
+
+//                    cal.set(Calendar.YEAR,2021);
+//                    cal.set(Calendar.MONTH,11);
+//                    cal.set(Calendar.DAY_OF_MONTH,17);
+
+
+                    int year=cal.get(Calendar.YEAR);
+                    int month=cal.get(Calendar.MONTH)+1;
+
+                    alerthistory1.append(year);
+                    if(month<10)
+                    {
+                        alerthistory1.append("0").append(month);
+                    }else
+                    {
+                        alerthistory1.append(month);
+                    }
+
+                    cal.setTime(sd.getStopTime());
+                    Date endTime=cal.getTime();
+                    cal.add(Calendar.MINUTE,-15);
+                    Date beginTime=cal.getTime();
+                    List<ShutdowneventVo> vos= proEconShutdownEventService.queryAlerthistoryList(String.valueOf(alerthistory1),sd.getWindturbineId(),beginTime,endTime);
+                    if(!vos.isEmpty())
+                    {
+                        ShutdowneventVo vo=vos.get(0);
+                        if(StringUtils.notEmp(vo.getWarningId()) && StringUtils.notEmp(vo.getStopTypeId()) && StringUtils.notEmp(vo.getId()))
+                        {
+                            proEconShutdownEventService.updateShutdownevent(vo.getWarningId(),vo.getStopTypeId(),vo.getId());
+                        }
+                    }
+
+                }
+            }
+        }
+
+
+    }
+}

+ 3 - 3
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconPartPowerstatticMainService.java

@@ -1,7 +1,7 @@
 package com.gyee.failurestatistics.service.auto;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.gyee.failurestatistics.model.auto.ProEconPartPowerstatticMain;
+import com.gyee.failurestatistics.model.auto.ProEconPartPowerStatticMain;
 
 import java.util.Date;
 
@@ -13,10 +13,10 @@ import java.util.Date;
  * @author shilin
  * @since 2023-04-24
  */
-public interface IProEconPartPowerstatticMainService extends IService<ProEconPartPowerstatticMain> {
+public interface IProEconPartPowerstatticMainService extends IService<ProEconPartPowerStatticMain> {
 
     public int deletePartpowerstatticsmain(Date recodedate);
 
-    public int insertPartpowerstatticsmain(ProEconPartPowerstatticMain partpowerstatticsmain);
+    public int insertPartpowerstatticsmain(ProEconPartPowerStatticMain partpowerstatticsmain);
 
 }

+ 3 - 3
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconPartpowerStatticsSubService.java

@@ -1,7 +1,7 @@
 package com.gyee.failurestatistics.service.auto;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.gyee.failurestatistics.model.auto.ProEconPartpowerStatticsSub;
+import com.gyee.failurestatistics.model.auto.ProEconPartPowerStatticsSub;
 
 import java.util.Date;
 
@@ -13,9 +13,9 @@ import java.util.Date;
  * @author shilin
  * @since 2023-04-24
  */
-public interface IProEconPartpowerStatticsSubService extends IService<ProEconPartpowerStatticsSub> {
+public interface IProEconPartpowerStatticsSubService extends IService<ProEconPartPowerStatticsSub> {
 
     public int deletePartpowerstatticssub(Date recodedate);
 
-    public int insertPartpowerstatticssub(ProEconPartpowerStatticsSub partpowerstatticssub);
+    public int insertPartpowerstatticssub(ProEconPartPowerStatticsSub partpowerstatticssub);
 }

+ 0 - 10
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconPointCodeService.java

@@ -2,10 +2,6 @@ package com.gyee.failurestatistics.service.auto;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.gyee.failurestatistics.model.auto.ProEconPointCode;
-import com.gyee.failurestatistics.model.dto.response.ProEconPointCodeDTO;
-
-import java.util.Date;
-import java.util.List;
 
 /**
  * <p>
@@ -18,10 +14,4 @@ import java.util.List;
 public interface IProEconPointCodeService extends IService<ProEconPointCode> {
 
 
-    List<ProEconPointCode> getEconPointCodeList();
-
-    ProEconPointCode getProEconPointCode(String nemCode);
-
-    List<ProEconPointCodeDTO>  getEconPointRanking(String regionId, String companyId, String pointCode, Date date, String dateType, boolean popup, String statype);
-
 }

+ 1 - 1
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/IProEconShutdownEvent2Service.java

@@ -2,7 +2,7 @@ package com.gyee.failurestatistics.service.auto;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.gyee.failurestatistics.model.auto.ProEconShutdownEvent2;
-import com.gyee.failurestatistics.vo.ShutdowneventVo;
+import com.gyee.failurestatistics.model.custom.ShutdowneventVo;
 
 import java.util.Date;
 import java.util.List;

+ 3 - 3
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconEarlyWarningSubServiceImpl.java

@@ -21,15 +21,15 @@ import java.util.Date;
 public class ProEconEarlyWarningSubServiceImpl extends ServiceImpl<ProEconEarlyWarningSubMapper, ProEconEarlyWarningSub> implements IProEconEarlyWarningSubService {
 
     @Resource
-    private ProEconEarlyWarningSubMapper earlywarningsubMapper;
+    private ProEconEarlyWarningSubMapper proEconEarlyWarningSubMapper;
 
     @Override
     public int deleteEarlywarningsub(Date recodedate) {
-        return earlywarningsubMapper.deleteEarlywarningsub(recodedate);
+        return proEconEarlyWarningSubMapper.deleteEarlywarningsub(recodedate);
     }
 
     @Override
     public int insertEarlywarningsub(ProEconEarlyWarningSub earlywarningsub) {
-        return  earlywarningsubMapper.insertEarlywarningsub(earlywarningsub);
+        return  proEconEarlyWarningSubMapper.insertEarlywarningsub(earlywarningsub);
     }
 }

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

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.gyee.common.model.StringUtils;
-import com.gyee.common.util.DateUtils;
+import com.gyee.failurestatistics.util.DateUtils;
 import com.gyee.common.vo.healthmanager.CompareVo;
 import com.gyee.failurestatistics.init.CacheContext;
 import com.gyee.failurestatistics.mapper.auto.ProEconEquipmentInfoDayTopMapper;
@@ -185,8 +185,8 @@ public class ProEconEquipmentInfoDayTopServiceImpl extends ServiceImpl<ProEconEq
 
         if(com.gyee.failurestatistics.util.StringUtils.notEmp(beginDate) &&  com.gyee.failurestatistics.util.StringUtils.notEmp(endDate) &&  com.gyee.failurestatistics.util.StringUtils.isNotEmpty(wtId)){
 
-            String begin= com.gyee.failurestatistics.util.DateUtils.formatDateTime(com.gyee.failurestatistics.util.DateUtils.truncate(beginDate));
-            String end= com.gyee.failurestatistics.util.DateUtils.formatDateTime(com.gyee.failurestatistics.util.DateUtils.truncate(endDate));
+            String begin= DateUtils.formatDateTime(com.gyee.failurestatistics.util.DateUtils.truncate(beginDate));
+            String end= DateUtils.formatDateTime(com.gyee.failurestatistics.util.DateUtils.truncate(endDate));
 
             QueryWrapper<ProEconEquipmentInfoDayTop> qw = new QueryWrapper<>();
 

+ 3 - 3
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconPartPowerstatticMainServiceImpl.java

@@ -2,7 +2,7 @@ package com.gyee.failurestatistics.service.auto.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.gyee.failurestatistics.mapper.auto.ProEconPartPowerstatticMainMapper;
-import com.gyee.failurestatistics.model.auto.ProEconPartPowerstatticMain;
+import com.gyee.failurestatistics.model.auto.ProEconPartPowerStatticMain;
 import com.gyee.failurestatistics.service.auto.IProEconPartPowerstatticMainService;
 import org.springframework.stereotype.Service;
 
@@ -18,7 +18,7 @@ import java.util.Date;
  * @since 2023-04-24
  */
 @Service
-public class ProEconPartPowerstatticMainServiceImpl extends ServiceImpl<ProEconPartPowerstatticMainMapper, ProEconPartPowerstatticMain> implements IProEconPartPowerstatticMainService {
+public class ProEconPartPowerstatticMainServiceImpl extends ServiceImpl<ProEconPartPowerstatticMainMapper, ProEconPartPowerStatticMain> implements IProEconPartPowerstatticMainService {
 
 
     @Resource
@@ -30,7 +30,7 @@ public class ProEconPartPowerstatticMainServiceImpl extends ServiceImpl<ProEconP
     }
 
     @Override
-    public int insertPartpowerstatticsmain(ProEconPartPowerstatticMain partpowerstatticsmain) {
+    public int insertPartpowerstatticsmain(ProEconPartPowerStatticMain partpowerstatticsmain) {
         return  proEconPartPowerstatticMainMapper.insertPartpowerstatticsmain(partpowerstatticsmain);
     }
 

+ 6 - 6
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconPartpowerStatticsSubServiceImpl.java

@@ -2,7 +2,7 @@ package com.gyee.failurestatistics.service.auto.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.gyee.failurestatistics.mapper.auto.ProEconPartpowerStatticsSubMapper;
-import com.gyee.failurestatistics.model.auto.ProEconPartpowerStatticsSub;
+import com.gyee.failurestatistics.model.auto.ProEconPartPowerStatticsSub;
 import com.gyee.failurestatistics.service.auto.IProEconPartpowerStatticsSubService;
 import org.springframework.stereotype.Service;
 
@@ -18,18 +18,18 @@ import java.util.Date;
  * @since 2023-04-24
  */
 @Service
-public class ProEconPartpowerStatticsSubServiceImpl extends ServiceImpl<ProEconPartpowerStatticsSubMapper, ProEconPartpowerStatticsSub> implements IProEconPartpowerStatticsSubService {
+public class ProEconPartpowerStatticsSubServiceImpl extends ServiceImpl<ProEconPartpowerStatticsSubMapper, ProEconPartPowerStatticsSub> implements IProEconPartpowerStatticsSubService {
 
     @Resource
-    private ProEconPartpowerStatticsSubMapper partpowerstatticssubMapper;
+    private ProEconPartpowerStatticsSubMapper proEconPartpowerStatticsSubMapper;
 
     @Override
     public int deletePartpowerstatticssub(Date recodedate) {
-        return  partpowerstatticssubMapper.deletePartpowerstatticssub(recodedate);
+        return  proEconPartpowerStatticsSubMapper.deletePartpowerstatticssub(recodedate);
     }
 
     @Override
-    public int insertPartpowerstatticssub(ProEconPartpowerStatticsSub partpowerstatticssub) {
-        return  partpowerstatticssubMapper.insertPartpowerstatticssub(partpowerstatticssub);
+    public int insertPartpowerstatticssub(ProEconPartPowerStatticsSub partpowerstatticssub) {
+        return  proEconPartpowerStatticsSubMapper.insertPartpowerstatticssub(partpowerstatticssub);
     }
 }

+ 0 - 628
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconPointCodeServiceImpl.java

@@ -35,633 +35,5 @@ import java.util.stream.Collectors;
 public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMapper, ProEconPointCode> implements IProEconPointCodeService {
 
 
-    @Autowired
-    private IProEconPowerstationInfoDay1Service proEconPowerstationInfoDay1Service;
-
-    @Autowired
-    private ProBasicPowerstationServiceImpl proBasicPowerstationService;
-
-    @Autowired
-    private IProEconPowerstationInfoDay4Service proEconPowerstationInfoDay4Service;
-
-
-
-    @Override
-    public List<ProEconPointCode> getEconPointCodeList() {
-        QueryWrapper<ProEconPointCode> qw = new QueryWrapper<>();
-        List<ProEconPointCode> list = baseMapper.selectList(qw);
-        return list;
-    }
-
-    @Override
-    public ProEconPointCode getProEconPointCode(String nemCode) {
-        QueryWrapper<ProEconPointCode> qw = new QueryWrapper<>();
-
-        if (StringUtils.isNotEmpty(nemCode)) {
-            qw.lambda().eq(ProEconPointCode::getNemCode, nemCode);
-        }
-        ProEconPointCode one = baseMapper.selectOne(qw);
-        return one;
-    }
-
-    @Override
-    public List<ProEconPointCodeDTO> getEconPointRanking(String regionId, String companyId, String pointCode, Date date, String dateType, boolean popup, String statype) {
-        List<ProBasicPowerstation> powerstationList = proBasicPowerstationService.getProBasicPowerstationlist(regionId, companyId, statype);
-
-        ProEconPointCode proEconPointCode = getProEconPointCode(pointCode);
-        if (null == proEconPointCode){
-            proEconPointCode = getProEconPointCode("fnlyl");
-            pointCode = "fnlyl";
-        }
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-
-        switch (pointCode) {
-            case "fdl":
-                dtos = fdl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "qfdl":
-                dtos = qfdl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "fnlyl":
-                dtos = fnlyl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "slssdl":
-                dtos = slssdl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "jxssdl":
-                dtos = jxssdl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "xdjclssdl":
-                dtos = xdjclssdl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "gzssdl":
-                dtos = gzssdl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "xnssdl":
-                dtos = xnssdl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "fwjsl":
-                dtos = fwjsl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "ztzhjsl":
-                dtos = ztzhjsl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "gzxqjsl":
-                dtos = gzxqjsl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "slssl":
-                dtos = slssl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "jxssl":
-                dtos = jxssl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "xdjclssl":
-                dtos = xdjclssl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "gzssl":
-                dtos = gzssl(powerstationList, date, dateType, proEconPointCode);
-                break;
-            case "xnssl":
-                dtos = xnssl(powerstationList, date, dateType, proEconPointCode);
-                break;
-        }
-
-
-        List<String> newsto = dtos.stream().map(ProEconPointCodeDTO::getStationcode).collect(Collectors.toList());
-        List<String> newsta = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-        List<String> reduce1 = newsta.stream().filter(item -> !newsto.contains(item)).collect(Collectors.toList());
-        for (String i : reduce1) {
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(proEconPointCode.getDescription() + "(" + proEconPointCode.getUnit() + ")");
-            if(null == CacheContext.wpmap.get(i)){
-                continue;
-            }
-            dto.setStationcode(null == CacheContext.wpmap.get(i) ? "" : CacheContext.wpmap.get(i).getNemCode());
-            dto.setStationname(null == CacheContext.wpmap.get(i) ? "" : CacheContext.wpmap.get(i).getName());
-            dtos.add(dto);
-        }
-        List<ProEconPointCodeDTO> dtoss = dtos.stream().sorted(Comparator.comparing(ProEconPointCodeDTO::getValue).reversed()).limit(popup ? dtos.size() : 5).collect(Collectors.toList());
-        return dtoss;
-    }
-
-
-    /**
-     * 发电量
-     */
-    private List<ProEconPointCodeDTO> fdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(i.getRfdl().divide(new BigDecimal(pointCode.getRatio()), 2, BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "y":
-                    dto.setValue(i.getYfdl().divide(new BigDecimal(pointCode.getRatio()), 2, BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "n":
-                    dto.setValue(i.getNfdl().divide(new BigDecimal(pointCode.getRatio()), 2, BigDecimal.ROUND_HALF_UP));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-
-    /**
-     * 欠发电量
-     */
-    private List<ProEconPointCodeDTO> qfdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(i.getRqfdl().divide(new BigDecimal(pointCode.getRatio()), 2, BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "y":
-                    dto.setValue(i.getYqfdl().divide(new BigDecimal(pointCode.getRatio()), 2, BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "n":
-                    dto.setValue(i.getNqfdl().divide(new BigDecimal(pointCode.getRatio()), 2, BigDecimal.ROUND_HALF_UP));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-
-    // 风能利用率
-    private List<ProEconPointCodeDTO> fnlyl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            if(compare0(i.getRllfdl())){
-                switch (dateType) {
-                    case "r":
-                        //发电量/理论发电量*100
-                        //divide(fdinfo.getRllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))
-                        dto.setValue(i.getRfdl().divide(i.getRllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())));
-                        break;
-                    case "y":
-                        dto.setValue(i.getRfdl().divide(i.getYllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())));
-                        break;
-                    case "n":
-                        dto.setValue(i.getRfdl().divide(i.getNllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())));
-                        break;
-                }
-                dto.setValue(compare100(dto.getValue()));
-            }
-
-
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /**
-     * 受累损失电量
-     */
-    private List<ProEconPointCodeDTO> slssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue((i.getRcwsltqssdl().add(i.getRcwsldwssdl())).divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "y":
-                    dto.setValue((i.getYcwsltqssdl().add(i.getYcwsldwssdl())).divide(new BigDecimal(pointCode.getRatio()),2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "n":
-                    dto.setValue((i.getNcwsltqssdl().add(i.getNcwsldwssdl())).divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-
-    /** 检修损失电量 */
-    private List<ProEconPointCodeDTO> jxssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(i.getRjxssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "y":
-                    dto.setValue(i.getYjxssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "n":
-                    dto.setValue(i.getNjxssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /** 限电损失电量*/
-    private List<ProEconPointCodeDTO> xdjclssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue((i.getRxdtjssdl().add(i.getRxdjclssdl())).divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "y":
-                    dto.setValue((i.getYxdtjssdl().add(i.getYxdjclssdl())).divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "n":
-                    dto.setValue((i.getNxdtjssdl().add(i.getNxdjclssdl())).divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-   /** 故障损失电量*/
-    private List<ProEconPointCodeDTO> gzssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(i.getRgzssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "y":
-                    dto.setValue(i.getYgzssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "n":
-                    dto.setValue(i.getNgzssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /** 性能损失电量*/
-    private List<ProEconPointCodeDTO> xnssdl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(i.getRxnssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "y":
-                    dto.setValue(i.getYxnssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-                case "n":
-                    dto.setValue(i.getNxnssdl().divide(new BigDecimal(pointCode.getRatio()), 2,BigDecimal.ROUND_HALF_UP));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-   /** 复位及时率 */
-    private List<ProEconPointCodeDTO> fwjsl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay4> list = proEconPowerstationInfoDay4Service.getEconThreeRateCurvelist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(compare100(i.getRfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-                case "y":
-                    dto.setValue(compare100(i.getYfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-                case "n":
-                    dto.setValue(compare100(i.getNfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /** 状态转换及时率 */
-    private List<ProEconPointCodeDTO> ztzhjsl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay4> list = proEconPowerstationInfoDay4Service.getEconThreeRateCurvelist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(compare100(i.getRztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-                case "y":
-                    dto.setValue(compare100(i.getYztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-                case "n":
-                    dto.setValue(compare100(i.getNztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /** 故障消缺及时率 */
-    private List<ProEconPointCodeDTO> gzxqjsl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay4> list = proEconPowerstationInfoDay4Service.getEconThreeRateCurvelist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(compare100(i.getRgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-                case "y":
-                    dto.setValue(compare100(i.getYgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-                case "n":
-                    dto.setValue(compare100(i.getNgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
-                    break;
-            }
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /** 受累损失率 */
-    private List<ProEconPointCodeDTO> slssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-
-                switch (dateType) {
-                    case "r":
-                        dto.setValue(compare0(i.getRllfdl())?(i.getRcwsltqssdl().add(i.getRcwsldwssdl())).divide(i.getRllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())): new BigDecimal(0));
-                        break;
-                    case "y":
-                        dto.setValue(compare0(i.getYllfdl())?(i.getYcwsltqssdl().add(i.getYcwsldwssdl())).divide(i.getYllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                        break;
-                    case "n":
-                        dto.setValue(compare0(i.getNllfdl())?(i.getNcwsltqssdl().add(i.getNcwsldwssdl())).divide(i.getNllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                        break;
-                }
-                dto.setValue(compare100(dto.getValue()));
-
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /** 检修损失率 */
-    private List<ProEconPointCodeDTO> jxssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-
-
-            switch (dateType) {
-                case "r":
-                    dto.setValue(compare0(i.getRllfdl())?i.getRjxssdl().divide(i.getRllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())): new BigDecimal(0));
-                    break;
-                case "y":
-                    dto.setValue(compare0(i.getYllfdl())?i.getYjxssdl().divide(i.getYllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                    break;
-                case "n":
-                    dto.setValue(compare0(i.getNllfdl())?i.getNjxssdl().divide(i.getNllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                    break;
-            }
-            dto.setValue(compare100(dto.getValue()));
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /** 限电损失率 */
-    private List<ProEconPointCodeDTO> xdjclssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(compare0(i.getRllfdl())?i.getRxdtjssdl().divide(i.getRxdjclssdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())): new BigDecimal(0));
-                    break;
-                case "y":
-                    dto.setValue(compare0(i.getYllfdl())?i.getYxdtjssdl().divide(i.getYxdjclssdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                    break;
-                case "n":
-                    dto.setValue(compare0(i.getNllfdl())?i.getNxdtjssdl().divide(i.getNxdjclssdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                    break;
-            }
-            dto.setValue(compare100(dto.getValue()));
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-   /** 故障损失率*/
-    private List<ProEconPointCodeDTO> gzssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(compare0(i.getRllfdl())?i.getRgzssdl().divide(i.getRllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())): new BigDecimal(0));
-                    break;
-                case "y":
-                    dto.setValue(compare0(i.getYllfdl())?i.getYgzssdl().divide(i.getYllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                    break;
-                case "n":
-                    dto.setValue(compare0(i.getNllfdl())?i.getNgzssdl().divide(i.getNllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                    break;
-            }
-            dto.setValue(compare100(dto.getValue()));
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-    /** 性能损失率 */
-    private List<ProEconPointCodeDTO> xnssl(List<ProBasicPowerstation> powerstationList, Date date, String dateType, ProEconPointCode pointCode) {
-        List<String> stationlist = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
-
-        List<ProEconPowerstationInfoDay1> list = proEconPowerstationInfoDay1Service.getEconFiveLosslist(stationlist, date);
-        List<ProEconPointCodeDTO> dtos = new ArrayList<>();
-        list.stream().forEach(i -> {
-
-            ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
-            dto.setDescription(pointCode.getDescription() + "(" + pointCode.getUnit() + ")");
-            dto.setStationcode(i.getForeignKeyId());
-            dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
-            switch (dateType) {
-                case "r":
-                    dto.setValue(compare0(i.getRllfdl())?i.getRxnssdl().divide(i.getRllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())): new BigDecimal(0));
-                    break;
-                case "y":
-                    dto.setValue(compare0(i.getYllfdl())?i.getYxnssdl().divide(i.getYllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                    break;
-                case "n":
-                    dto.setValue(compare0(i.getNllfdl())?i.getNxnssdl().divide(i.getNllfdl(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(pointCode.getRatio())):new BigDecimal(0));
-                    break;
-            }
-            dto.setValue(compare100(dto.getValue()));
-            dtos.add(dto);
-        });
-
-        return dtos;
-    }
-
-
-
-    private BigDecimal compare100(BigDecimal a) {
-        BigDecimal b = new BigDecimal(100);
-
-        if (null == a) {
-            a = new BigDecimal(0);
-
-        }
-        if (b.compareTo(a) == -1) {
-            a = new BigDecimal(100);
-
-        }
-
-        if (a.compareTo(BigDecimal.ZERO) == -1) {
-            a = new BigDecimal(0);
-        }
-        return a;
-
-    }
-
-    private boolean compare0(BigDecimal a) {
-        BigDecimal b = new BigDecimal(0.00);
-        if (b.compareTo(a.setScale(2, BigDecimal.ROUND_HALF_UP)) == 0) {
-            return false;
-        }
-        return true;
-    }
 
 }

+ 5 - 5
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/service/auto/impl/ProEconShutdownEvent2ServiceImpl.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.gyee.failurestatistics.mapper.auto.ProEconShutdownEvent2Mapper;
 import com.gyee.failurestatistics.model.auto.ProEconShutdownEvent2;
 import com.gyee.failurestatistics.service.auto.IProEconShutdownEvent2Service;
-import com.gyee.failurestatistics.vo.ShutdowneventVo;
+import com.gyee.failurestatistics.model.custom.ShutdowneventVo;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -24,23 +24,23 @@ public class ProEconShutdownEvent2ServiceImpl extends ServiceImpl<ProEconShutdow
 
 
     @Resource
-    private ProEconShutdownEvent2Mapper shutdownevent2Mapper;
+    private ProEconShutdownEvent2Mapper proEconShutdownEvent2Mapper;
     @Override
     public List<ProEconShutdownEvent2> queryShutdowneventList(Date beginDate, Date endDate) {
 
-        return shutdownevent2Mapper.queryShutdowneventList(beginDate, endDate);
+        return proEconShutdownEvent2Mapper.queryShutdowneventList(beginDate, endDate);
     }
 
     @Override
     public List<ShutdowneventVo> queryAlerthistoryList(String alerthistory, String windturbineid, Date beginDate, Date endDate) {
 
-        return shutdownevent2Mapper.queryAlerthistoryList(alerthistory,windturbineid,beginDate, endDate);
+        return proEconShutdownEvent2Mapper.queryAlerthistoryList(alerthistory,windturbineid,beginDate, endDate);
     }
 
     @Override
     public int  updateShutdownevent(String warningid, String stoptypeid, String stopid)
     {
 
-        return shutdownevent2Mapper.updateShutdownevent(warningid,stoptypeid,stopid);
+        return proEconShutdownEvent2Mapper.updateShutdownevent(warningid,stoptypeid,stopid);
     }
 }

+ 2 - 2
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/task/SaticScheduleTask.java

@@ -33,7 +33,7 @@ public class SaticScheduleTask {
     @Resource
     private ParttemperatureService parttemperatureService;
     @Resource
-    private ShutdowneventService shutdownevent2Service;
+    private ShutdowneventService shutdowneventService;
     /**
      * 故障统计
      */
@@ -48,7 +48,7 @@ public class SaticScheduleTask {
 
         try {
 
-            shutdownevent2Service.updateShutdownevent();
+            shutdowneventService.updateShutdownevent();
         } catch (Exception e) {
 
             e.printStackTrace();

+ 209 - 435
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/util/DateUtils.java

@@ -1,275 +1,210 @@
 package com.gyee.failurestatistics.util;
 
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import java.lang.management.ManagementFactory;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.TimeZone;
 
 /**
- * 
- * 
- * 项目名称:nxfd 类名称:DateUtils 类描述: 创建人:石林 创建时间:2015-3-30 上午11:42:54 修改人:shilinno1
- * 修改时间:2015-3-30 上午11:42:54 修改备注:
- * 
- * @version
- * 
+ * 日期处理
+ * @ClassName: DateUtils
+ * @author gyee
+ * @date 2019-06-23 00:53
+ * @version V1.0
  */
-public class DateUtils {
-
-    private static final String format = "yyyy-MM-dd";
-    private static final String format1 = "yyyy-MM-dd HH:mm:ss";
-    private static final String format2 = "MM/dd/yyyy HH:mm:ss";
-
-    // 第一次调用get将返回null
-
-    private static ThreadLocal<SimpleDateFormat> threadLocal = new ThreadLocal<SimpleDateFormat>();
-
-    // 获取线程的变量副本,如果不覆盖initialValue,第一次get返回null,故需要初始化一个SimpleDateFormat,并set到threadLocal中
-
-    public static SimpleDateFormat getFormat() {
-
-        SimpleDateFormat df = (SimpleDateFormat) threadLocal.get();
-
-        if (df == null) {
-            df = new SimpleDateFormat(format);
-            threadLocal.set(df);
-        }
-
-        return df;
+public class DateUtils  extends org.apache.commons.lang3.time.DateUtils {
+    /**
+     * 时间格式(yyyy-MM-dd)
+     */
+    public final static String DATE_PATTERN = "yyyy-MM-dd";
+    /**
+     * 时间格式(yyyy-MM-dd HH:mm:ss)
+     */
+    public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
 
+    public static String format(Date date) {
+        return format(date, DATE_PATTERN);
     }
 
-    public static SimpleDateFormat getFormat1() {
-
-        SimpleDateFormat df1 = (SimpleDateFormat) threadLocal.get();
-
-        if (df1 == null) {
-            df1 = new SimpleDateFormat(format1);
-            threadLocal.set(df1);
+    public static String formatDateTime(Date date) {
+        return format(date, DATE_TIME_PATTERN);
+    }
+    /**
+     * 时间转换
+     *
+     * @param date
+     * @param pattern
+     * @return
+     */
+    public static String format(Date date, String pattern) {
+        if (date != null) {
+            SimpleDateFormat df = new SimpleDateFormat(pattern);
+            return df.format(date);
         }
-
-        return df1;
-
+        return null;
+    }
+    public static Date parseLongToDate(long time) {
+        return new Date(time);
+    }
+    /**
+     * 时间转换
+     *
+     * @param time
+     * @param pattern
+     * @return
+     */
+    public static String format(Long time, String pattern) {
+        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
+        Date date = new Date(time);
+        String format = sdf.format(date);
+        return format;
     }
 
-    public static SimpleDateFormat getFormat2() {
 
-        SimpleDateFormat df2 = (SimpleDateFormat) threadLocal.get();
+    public static String YYYY = "yyyy";
 
-        if (df2 == null) {
-            df2 = new SimpleDateFormat(format2);
-            threadLocal.set(df2);
-        }
+    public static String YYYY_MM = "yyyy-MM";
 
-        return df2;
+    public static String YYYY_MM_DD = "yyyy-MM-dd";
 
-    }
+    public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
 
-    private DateUtils() {
-    }
+    public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
 
-    /**
-     * 获取系统日期(无时分秒毫秒)
-     * 
-     * @return
-     */
-    public static Date today() {
-        return truncate(now());
-    }
+    private static String[] parsePatterns = {
+            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
+            "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
+            "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
 
     /**
-     * 获取系统时间
-     * 
-     * @return
+     * 获取当前Date型日期
+     *
+     * @return Date() 当前日期
      */
-    public static Date now() {
+    public static Date getNowDate() {
         return new Date();
     }
 
     /**
-     * 根据年月日生成日期对象
-     * 
-     * @param y
-     * @param m
-     * @param d
-     * @return
+     * 获取当前日期, 默认格式为yyyy-MM-dd
+     *
+     * @return String
      */
-    public static Date cons(int y, int m, int d) {
-        Calendar cal = Calendar.getInstance();
-        cal.set(y, m, d, 0, 0, 0);
-        return cal.getTime();
+    public static String getDate() {
+        return dateTimeNow(YYYY_MM_DD);
     }
 
-    public static String toDate(Date date) {
-        return getFormat1().format(date);
+    public static final String getTime() {
+        return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
     }
 
-    public static String toDate2(Date date) {
-        return getFormat2().format(date);
+    public static final String dateTimeNow() {
+        return dateTimeNow(YYYYMMDDHHMMSS);
     }
 
-    public static String toDate1(Date date) {
-        return getFormat().format(date);
+    public static final String dateTimeNow(final String format) {
+        return parseDateToStr(format, new Date());
     }
 
-    /**
-     * 根据年月日时分秒生成日期对象
-     * 
-     * @param y
-     * @param m
-     * @param d
-     * @param h
-     * @param mi
-     * @param s
-     * @return
-     */
-    public static Date cons(int y, int m, int d, int h, int mi, int s) {
-        Calendar cal = Calendar.getInstance();
-        cal.set(y, m, d, h, mi, s);
-        return cal.getTime();
+    public static final String dateTime(final Date date) {
+        return parseDateToStr(YYYY_MM_DD, date);
     }
 
-    /**
-     * 将指定时间转化为 Calendar
-     * 
-     * @param date
-     * @return
-     */
-    public static Calendar getCal(Date date) {
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        return cal;
+    public static final String parseDateToStr(final String format, final Date date) {
+        return new SimpleDateFormat(format).format(date);
+    }
+
+    public static final Date dateTime(final String format, final String ts) {
+        try {
+            return new SimpleDateFormat(format).parse(ts);
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
+        }
     }
 
     /**
-     * 将时间的时分秒毫秒字段去掉
-     * 
-     * @param date
-     * @return
+     * 日期路径 即年/月/日 如2018/08/08
      */
-    public static Date truncate(Date date) {
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        cal.set(Calendar.HOUR_OF_DAY, 0);
-        cal.set(Calendar.MINUTE, 0);
-        cal.set(Calendar.SECOND, 0);
-        cal.set(Calendar.MILLISECOND, 0);
-        return cal.getTime();
+    public static final String datePath() {
+        Date now = new Date();
+        return DateFormatUtils.format(now, "yyyy/MM/dd");
     }
 
     /**
-     * 去掉日期中日及下级字段
-     * 
-     * @param date
-     * @return
+     * 日期路径 即年/月/日 如20180808
      */
-    public static Date truncDay(Date date) {
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        cal.set(Calendar.DAY_OF_MONTH, 1);
-        cal.set(Calendar.HOUR_OF_DAY, 0);
-        cal.set(Calendar.MINUTE, 0);
-        cal.set(Calendar.SECOND, 0);
-        cal.set(Calendar.MILLISECOND, 0);
-        return cal.getTime();
+    public static final String dateTime() {
+        Date now = new Date();
+        return DateFormatUtils.format(now, "yyyyMMdd");
     }
 
     /**
-     * 去掉日期中的月及下级字段
-     * 
-     * @param date
-     * @return
+     * 日期型字符串转化为日期 格式
      */
-    public static Date truncMonth(Date date) {
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        cal.set(Calendar.MONTH, 0);
-        cal.set(Calendar.DAY_OF_MONTH, 1);
-        cal.set(Calendar.HOUR_OF_DAY, 0);
-        cal.set(Calendar.MINUTE, 0);
-        cal.set(Calendar.SECOND, 0);
-        cal.set(Calendar.MILLISECOND, 0);
-        return cal.getTime();
+    public static Date parseDate(Object str) {
+        if (str == null) {
+            return null;
+        }
+        try {
+            return parseDate(str.toString(), parsePatterns);
+        } catch (ParseException e) {
+            return null;
+        }
     }
 
     /**
-     * 在指定时间上加指定的天数
-     * 
-     * @param date
-     * @param day
-     * @return
+     * 获取服务器启动时间
      */
-    public static Date addDays(Date date, int day) {
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        cal.add(Calendar.DAY_OF_MONTH, day);
-        return cal.getTime();
+    public static Date getServerStartDate() {
+        long time = ManagementFactory.getRuntimeMXBean().getStartTime();
+        return new Date(time);
     }
 
     /**
-     * 在指定的时间上加指定的月数
-     * 
-     * @param date
-     * @param month
-     * @return
+     * 计算两个时间差
      */
-    public static Date addMonths(Date date, int month) {
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        cal.add(Calendar.MONTH, month);
-        return cal.getTime();
+    public static String getDatePoor(Date endDate, Date nowDate) {
+        long nd = 1000 * 24 * 60 * 60;
+        long nh = 1000 * 60 * 60;
+        long nm = 1000 * 60;
+        // long ns = 1000;
+        // 获得两个时间的毫秒时间差异
+        long diff = endDate.getTime() - nowDate.getTime();
+        // 计算差多少天
+        long day = diff / nd;
+        // 计算差多少小时
+        long hour = diff % nd / nh;
+        // 计算差多少分钟
+        long min = diff % nd % nh / nm;
+        // 计算差多少秒//输出结果
+        // long sec = diff % nd % nh % nm / ns;
+        return day + "天" + hour + "小时" + min + "分钟";
     }
 
     /**
-     * 在指定的时间上加指定的月数
-     * 
+     * 将时间的时分秒毫秒字段去掉
+     *
      * @param date
-     * @param month
      * @return
      */
-    public static Date addYears(Date date, int year) {
+    public static Date truncate(Date date) {
         Calendar cal = Calendar.getInstance();
         cal.setTime(date);
-        cal.add(Calendar.YEAR, year);
+        cal.set(Calendar.HOUR_OF_DAY, 0);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
         return cal.getTime();
     }
 
     /**
-     * 在指定时间上加指定的小时
-     * 
-     * @param date
-     * @param day
-     * @return
-     */
-    public static Date addHours(Date date, int hour) {
-        return new Date(date.getTime() + hour * 3600 * 1000);
-    }
-
-    /**
-     * 在指定时间上加指定的分钟
-     * 
-     * @param date
-     * @param day
-     * @return
-     */
-    public static Date addMinutes(Date date, int m) {
-        return new Date(date.getTime() + m * 60 * 1000);
-    }
-
-    /**
-     * 在指定时间上加指定的秒
-     * 
-     * @param date
-     * @param day
-     * @return
-     */
-    public static Date addSeconds(Date date, int s) {
-        return new Date(date.getTime() + s * 1000);
-    }
-
-    /**
      * 计算两个时间之间差的天数(取整后)
-     * 
+     *
      * @param d1
      * @param d2
      * @return
@@ -279,18 +214,39 @@ public class DateUtils {
     }
 
     /**
-     * 计算两个时间之间差的小时数(取整后)
-     * 
-     * @param d1
-     * @param d2
+     * 将字符串日期转换成日期类型
+     *
+     * @param time
      * @return
      */
-    public static int hoursDiff(Date d1, Date d2) {
-        return (int) Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (60 * 60 * 1000));
+    public static Date parseStrtoDate(String time) {
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Date dateTime = null;
+        try {
+            dateTime = sdf.parse(time);
+        } catch (ParseException e) {
+            e.printStackTrace();
+
+        }
+        return dateTime;
+    }
+
+    public static Date parseStrtoDate(String time,String pattern) {
+
+        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
+        Date dateTime = null;
+        try {
+            dateTime = sdf.parse(time);
+        } catch (ParseException e) {
+            e.printStackTrace();
+
+        }
+        return dateTime;
     }
 
-    public static double hoursDiff1(Date d1, Date d2) {
-        return Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (double) (60 * 60 * 1000));
+    public static int hoursDiff1(Date d1, Date d2) {
+        return (int)Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (double) (60 * 60 * 1000));
     }
 
     public static double hoursDiff2(Date d1, Date d2) {
@@ -299,7 +255,7 @@ public class DateUtils {
 
     /**
      * 计算两个时间之间差的分钟数(取整后)
-     * 
+     *
      * @param d1
      * @param d2
      * @return
@@ -310,7 +266,7 @@ public class DateUtils {
 
     /**
      * 计算两个时间之间差的分钟数(取整后)
-     * 
+     *
      * @param d1
      * @param d2
      * @return
@@ -320,98 +276,17 @@ public class DateUtils {
     }
 
     /**
-     * 计算两个时间之间差的毫秒数(取整后)
-     * 
-     * @param d1
-     * @param d2
-     * @return
-     */
-    public static long millisecondDiff(Date d1, Date d2) {
-        return Math.abs(d1.getTime() - d2.getTime());
-    }
-
-    /**
-     * 计算两个时间之间差的秒数(取整后)
-     * 
-     * @param d1
-     * @param d2
-     * @return
-     */
-    public static int secondsDiff(Date d1, Date d2) {
-        return (int) Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (1000));
-    }
-
-    /**
-     * 计算两个时间之间的月差
-     * 
-     * @param d1
-     * @param d2
-     * @return
-     */
-    public static int monthsDiff(Date d1, Date d2) {
-        Calendar cal1 = Calendar.getInstance();
-        Calendar cal2 = Calendar.getInstance();
-        cal1.setTime(d1);
-        cal2.setTime(d2);
-
-        return (int) Math.abs((cal1.get(Calendar.YEAR) - cal2.get(Calendar.YEAR)) * 12 + cal1.get(Calendar.MONTH) - cal2.get(Calendar.MONTH));
-
-    }
-
-    /**
-     * 获得指定时间的月数
-     * 
-     * @param date
-     * @return
-     */
-    public static int getMonth(Date date) {
-        Calendar cd = Calendar.getInstance();
-        cd.setTime(date);
-        return cd.get(Calendar.MONTH);
-    }
-
-    /**
-     * 获得指定时间的年数
-     * 
-     * @param date
-     * @return
-     */
-    public static int getYear(Date date) {
-        Calendar cd = Calendar.getInstance();
-        cd.setTime(date);
-        return cd.get(Calendar.YEAR);
-    }
-
-    /**
-     * 获取指定时间的天数
-     * 
-     * @param date
+     * 获取系统时间
+     *
      * @return
      */
-    public static int getDay(Date date) {
-        Calendar cd = Calendar.getInstance();
-        cd.setTime(date);
-        return cd.get(Calendar.DAY_OF_MONTH);
-    }
-
-    public static int getCurrentMonthLastDay() {
-        Calendar a = Calendar.getInstance();
-        a.set(Calendar.DATE, 1);
-        a.roll(Calendar.DATE, -1);
-        int maxDate = a.get(Calendar.DATE);
-        return maxDate;
-    }
-
-    public static int getMonthDays(Date date) {
-        Calendar cal = Calendar.getInstance();
-        cal.set(DateUtils.getYear(date), DateUtils.getMonth(date), DateUtils.getDay(date));
-        int dayst = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
-        return dayst;
+    public static Date now() {
+        return new Date();
     }
 
     /**
      * 获取当前月的第一天
-     * 
+     *
      * @return
      */
     public static String getCurrtenFirstDay() {
@@ -419,183 +294,82 @@ public class DateUtils {
         Calendar c = Calendar.getInstance();
         // c.add(Calendar.MONTH, 0);
         c.set(Calendar.DAY_OF_MONTH, 1);
-        return getFormat().format(c.getTime());
+        return new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
     }
 
     /**
      * 获取当前月的最后一天
-     * 
+     *
      * @return
      */
     public static String getCurrtenLastDay() {
 
         Calendar ca = Calendar.getInstance();
         ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
-        return getFormat().format(ca.getTime());
+        return new SimpleDateFormat("yyyy-MM-dd").format(ca.getTime());
     }
-
     /**
-     * 获取当前月的第一天
-     * 
+     * 计算两个时间之间差的小时数(取整后)
+     *
+     * @param d1
+     * @param d2
      * @return
      */
-    public static Date getCurrtenFirstDate() {
-
-        Calendar c = Calendar.getInstance();
-        c.set(Calendar.DAY_OF_MONTH, c.getActualMinimum(Calendar.DAY_OF_MONTH));
-        c.set(Calendar.HOUR_OF_DAY, 0);
-        c.set(Calendar.MINUTE, 0);
-        c.set(Calendar.SECOND, 1);
-        return c.getTime();
+    public static int hoursDiff(Date d1, Date d2) {
+        return (int) Math.floor(Math.abs((d1.getTime() - d2.getTime())) / (60 * 60 * 1000));
     }
 
     /**
-     * 获取当前月的最后一天
-     * 
+     * 获取当前整点数
+     *
      * @return
      */
-    public static Date getCurrtenLastDate() {
+    public static Date getCurrHourTime(Date date) {
+        Calendar ca = Calendar.getInstance();
+        int minute = ca.get(Calendar.MINUTE);
+        if (minute < 30) {
+            ca.set(Calendar.MINUTE, 30);
+        } else {
+            ca.add(Calendar.HOUR, 1);
+            ca.set(Calendar.MINUTE, 0);
+        }
 
-        Calendar c = Calendar.getInstance();
-        c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
-        c.set(Calendar.HOUR_OF_DAY, 23);
-        c.set(Calendar.MINUTE, 59);
-        c.set(Calendar.SECOND, 59);
-        return c.getTime();
+        ca.set(Calendar.SECOND, 5);
+        date = ca.getTime();
+
+        return date;
     }
 
-    public static Date parseDate(String date) {
+    //普通时间转为UTC
+    public static String localToUTC(String localTimeStr) {
         try {
-            return getFormat().parse(date);
+            Date localDate = getLocalSDF().parse(localTimeStr);
+            return getUTCSDF().format(localDate);
         } catch (ParseException e) {
             e.printStackTrace();
         }
         return null;
     }
-
-    public static Date parseDate1(String date) {
+    //UTC转为普通时间
+    public static String utcToLocal(String utcTimeStr) {
         try {
-            return getFormat1().parse(date);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
+            Date date = getUTCSDF().parse(utcTimeStr);
+            return getLocalSDF().format(date);
 
-    public static Date parseDate2(String date) {
-        try {
-            return getFormat2().parse(date);
         } catch (ParseException e) {
             e.printStackTrace();
         }
         return null;
     }
 
-    public static Date parseLongToDate(long time) {
-        return new Date(time);
-    }
-
-    /**
-     * 转换Edna时间格式为标准格式
-     * 
-     * @param pointTime
-     * @return
-     */
-    public static String convertEdnaTime2(String pointTime, Boolean isNoSec) {
-        StringBuffer sb = new StringBuffer();
-        String[] dt = pointTime.split(" ");
-        String[] ymd = dt[0].split("-");
-        String[] hms = dt[1].split(":");
-        sb.append(ymd[0]).append("-");
-        if (ymd[1].length() == 1) {
-            sb.append("0").append(ymd[1]);
-        } else {
-            sb.append(ymd[1]);
-        }
-        if (ymd[2].length() == 1) {
-            sb.append("-").append("0").append(ymd[2]);
-        } else {
-            sb.append("-").append(ymd[2]);
-        }
-        if (hms[0].length() == 1) {
-            sb.append(" ").append("0").append(hms[0]);
-        } else {
-            sb.append(" ").append(hms[0]);
-        }
-        if (hms[1].length() == 1) {
-            sb.append(":").append("0").append(hms[1]);
-        } else {
-            sb.append(":").append(hms[1]);
-        }
-
-        if (isNoSec) {
-            sb.append(":").append("00");
-        } else {
-            if (hms[2].length() == 1) {
-                sb.append(":").append("0").append(hms[2]);
-            } else {
-                sb.append(":").append(hms[2]);
-            }
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * 转换Edna时间格式为标准格式
-     * 
-     * @param pointTime
-     * @return
-     */
-    public static String convertEdnaTime(String pointTime, Boolean isNoSec) {
-        String date = getFormat().format(new Date());
-        StringBuffer sb = new StringBuffer();
-        String[] dt = pointTime.split(" ");
-        String[] ymd = dt[0].split("/");
-        String[] hms = dt[1].split(":");
-        if (ymd[2].length() == 2) {
-            sb.append(date.substring(0, 2)).append(ymd[2]).append("-");
-        }
-        if (ymd[0].length() == 1) {
-            sb.append("0").append(ymd[0]);
-        } else {
-            sb.append(ymd[0]);
-        }
-        if (ymd[1].length() == 1) {
-            sb.append("-").append("0").append(ymd[1]);
-        } else {
-            sb.append("-").append(ymd[1]);
-        }
-        if (hms[0].length() == 1) {
-            sb.append(" ").append("0").append(hms[0]);
-        } else {
-            sb.append(" ").append(hms[0]);
-        }
-        if (hms[1].length() == 1) {
-            sb.append(":").append("0").append(hms[1]);
-        } else {
-            sb.append(":").append(hms[1]);
-        }
-
-        if (isNoSec) {
-            sb.append(":").append("00");
-        } else {
-            if (hms[2].length() == 1) {
-                sb.append(":").append("0").append(hms[2]);
-            } else {
-                sb.append(":").append(hms[2]);
-            }
-        }
-
-        return sb.toString();
-    }
-
-    public static String convertEdnaTime(String pointTime) {
-        return convertEdnaTime2(pointTime, false);
+    private static SimpleDateFormat getLocalSDF() {
+        return new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
     }
 
-    public static void main(String[] args) {
-        System.out.println(DateUtils.getMonthDays(DateUtils.today()));
+    private static SimpleDateFormat getUTCSDF() {
+        SimpleDateFormat utcSDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+        utcSDF.setTimeZone(TimeZone.getTimeZone("UTC"));
+        return utcSDF;
     }
 
 }

+ 215 - 0
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/util/IRealTimeDataBaseUtil.java

@@ -0,0 +1,215 @@
+package com.gyee.failurestatistics.util;
+
+
+import com.gyee.common.model.DNAStatVal;
+import com.gyee.common.model.DNAVal;
+import com.gyee.common.model.PointData;
+import com.gyee.failurestatistics.model.auto.ProBasicPowerstationPoint;
+import com.gyee.failurestatistics.model.auto.ProBasicEquipmentPoint;
+
+import java.util.List;
+import java.util.Map;
+
+
+public interface IRealTimeDataBaseUtil {
+    /**
+     * 通过风场测点获得测点实时数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @returns
+     * @throws Exception
+     */
+    public PointData getRealData(ProBasicPowerstationPoint point) throws Exception;
+
+    /**
+     * 通过风场测点获得测点历史快照数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风场测点获得测点历史存储数据,存多少取多少
+     * @param point 只是用了code字段,作为唯一标识
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(ProBasicPowerstationPoint point, Long beginDate, Long endDate) throws Exception;
+
+    /**
+     * 通过风机测点获得测点实时数据
+     * @param point 只是用了id字段,作为唯一标识
+     * @return
+     * @throws Exception
+     */
+    public PointData getRealData(ProBasicEquipmentPoint point) throws Exception;
+
+    /**
+     * 通过风机测点获得历史快照
+     * @param point  只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风机测点获得测点历史存储数据,存多少取多少
+     * @param point 只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(ProBasicEquipmentPoint point, Long beginDate, Long endDate) throws Exception;
+
+
+    /**
+     * 通过风机测点获得测点实时数据
+     * @param pointid 测点编号
+     * @return
+     * @throws Exception
+     */
+    public PointData getRealData(String pointid) throws Exception;
+
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的数组
+     * @return 列表集合
+     * @throws Exception
+     */
+    public List<PointData> getRealData(String... pointids) throws Exception;
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的列表
+     * @return 列表集合
+     * @throws Exception
+     */
+    public List<PointData> getRealData(List<String> pointids) throws Exception;
+    /**
+     * 通过全局点名获得测点实时数据 读取多个点
+     * @param pointids 测点的数组
+     * @return Map集合
+     * @throws Exception
+     */
+    public Map<String, Double> getRealDataMap(String... pointids) throws Exception;
+
+    /**
+     * 通过全局点名获得历史数据快照
+     * @param pointid  全局点名
+     * @param beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasSnap(String pointid, Long beginDate, Long endDate, Long count, Long pried) throws Exception;
+
+    /**
+     * 通过风机测点获得测点历史存储数据,存多少取多少
+     * @param pointid 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistoryDatasRaw(String pointid, Long beginDate, Long endDate) throws Exception;
+
+
+    /**
+     * 通过风机测点获得测点指定时间周期的统计数据
+     * @param point 只是用了id字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(ProBasicEquipmentPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过风场测点获得测点指定时间周期的统计数据
+     * @param point 只是用了code字段,作为唯一标识
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(ProBasicPowerstationPoint point, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过全局点名获得测点指定时间周期的统计数据
+     * @param pointid 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param count  点数
+     * @param pried  时间间隔
+     * @type 0、最大值。1、最小值。、平均值
+     * @return
+     * @throws Exception
+     */
+    public List<PointData> getHistStat(String pointid, Long beginDate, Long endDate, Long count, Long pried, int type) throws Exception;
+
+    /**
+     * 通过全局点名获得测点指定时间周期的统计数据 同时返回max、min、avg数据
+     * @param point 全局点名
+     * @param  beginDate 开始时间(秒级)
+     * @param endDate 结束时间(秒级)
+     * @param pried  时间间隔
+     * @return
+     * @throws Exception
+     */
+    public DNAStatVal[] getHistStat(String point, Long beginDate, Long endDate, Integer pried) throws Exception;
+    /**
+     * 补录单点历史数据
+     * @param point 测点对象
+     * @return
+     * @throws Exception
+     */
+    public void updatePoint(PointData point) throws Exception;
+
+    /**
+     * 批量查询实时数据
+     * @param tagNames 测点字符串数组
+     * @return
+     * @throws Exception
+     */
+
+    public DNAVal[] getRealtimeTagValues(String... tagNames) throws Exception;
+
+    /**
+     * 批量插入历史数据
+     * @param pointls 测点对象集合
+     * @throws Exception
+     */
+    public void updatePoint(List<PointData> pointls) throws Exception;
+
+    /**
+     *
+     * @param nameList 测点名称列表集合
+     * @param tTime  时间点(秒级)
+     * @return
+     * @throws Exception
+     */
+    public DNAVal[] getHistMatrix(String[] nameList, long tTime) throws Exception;
+
+
+    public void sendSinglePoint(PointData point) throws Exception;
+
+    public void sendMultiPoint(List<PointData> pointls) throws Exception;
+}

+ 344 - 0
realtime/failurestatistics-server/src/main/java/com/gyee/failurestatistics/util/SortUtils.java

@@ -0,0 +1,344 @@
+package com.gyee.failurestatistics.util;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @ClassName : SortUtils
+ * @Author : xieshengjie
+ * @Date: 2021/6/5 20:06
+ * @Description : 排序
+ */
+public class SortUtils {
+    public static final String DESC = "desc";
+    public static final String ASC = "asc";
+
+    /**
+     * 对list中的元素按升序排列.
+     *
+     * @param list
+     *            排序集合
+     * @param field
+     *            排序字段
+     * @return
+     */
+    public static List<?> sort(List<?> list, final String field) {
+        return sort(list, field, null);
+    }
+
+    /**
+     * 对list中的元素进行排序.
+     *
+     * @param list
+     *            排序集合
+     * @param field
+     *            排序字段
+     * @param sort
+     *            排序方式: SortListUtil.DESC(降序) SortListUtil.ASC(升序).
+     * @return
+     */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public static List<?> sort(List<?> list, final String field,
+                               final String sort) {
+        Collections.sort(list, new Comparator() {
+            public int compare(Object a, Object b) {
+                int ret = 0;
+                try {
+                    Field f = a.getClass().getDeclaredField(field);
+                    f.setAccessible(true);
+                    Class<?> type = f.getType();
+
+                    if (type == int.class) {
+                        ret = ((Integer) f.getInt(a)).compareTo((Integer) f
+                                .getInt(b));
+                    } else if (type == double.class) {
+                        ret = ((Double) f.getDouble(a)).compareTo((Double) f
+                                .getDouble(b));
+                    } else if (type == long.class) {
+                        ret = ((Long) f.getLong(a)).compareTo((Long) f
+                                .getLong(b));
+                    } else if (type == float.class) {
+                        ret = ((Float) f.getFloat(a)).compareTo((Float) f
+                                .getFloat(b));
+                    } else if (type == Date.class) {
+                        ret = ((Date) f.get(a)).compareTo((Date) f.get(b));
+                    } else if (isImplementsOf(type, Comparable.class)) {
+                        ret = ((Comparable) f.get(a)).compareTo((Comparable) f
+                                .get(b));
+                    } else {
+                        ret = String.valueOf(f.get(a)).compareTo(
+                                String.valueOf(f.get(b)));
+                    }
+
+                } catch (SecurityException e) {
+                    e.printStackTrace();
+                } catch (NoSuchFieldException e) {
+                    e.printStackTrace();
+                } catch (IllegalArgumentException e) {
+                    e.printStackTrace();
+                } catch (IllegalAccessException e) {
+                    e.printStackTrace();
+                }
+                if (sort != null && sort.toLowerCase().equals(DESC)) {
+                    return -ret;
+                } else {
+                    return ret;
+                }
+            }
+        });
+        return list;
+    }
+
+    /**
+     * 对list中的元素按fields和sorts进行排序,
+     * fields[i]指定排序字段,sorts[i]指定排序方式.如果sorts[i]为空则默认按升序排列.
+     *
+     * @param list
+     *            排序集合
+     * @param fields
+     *            排序字段-数组(一个或多个)
+     * @param sorts
+     *            排序规则-数组(一个或多个)
+     * @return
+     */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public static List<?> sort(List<?> list, String[] fields, String[] sorts) {
+        if (fields != null && fields.length > 0) {
+            for (int i = fields.length - 1; i >= 0; i--) {
+                final String field = fields[i];
+                String tmpSort = ASC;
+                if (sorts != null && sorts.length > i && sorts[i] != null) {
+                    tmpSort = sorts[i];
+                }
+                final String sort = tmpSort;
+                Collections.sort(list, new Comparator() {
+                    public int compare(Object a, Object b) {
+                        int ret = 0;
+                        try {
+                            Field f = a.getClass().getDeclaredField(field);
+                            f.setAccessible(true);
+                            Class<?> type = f.getType();
+                            if (type == int.class) {
+                                ret = ((Integer) f.getInt(a))
+                                        .compareTo((Integer) f.getInt(b));
+                            } else if (type == double.class) {
+                                ret = ((Double) f.getDouble(a))
+                                        .compareTo((Double) f.getDouble(b));
+                            } else if (type == long.class) {
+                                ret = ((Long) f.getLong(a)).compareTo((Long) f
+                                        .getLong(b));
+                            } else if (type == float.class) {
+                                ret = ((Float) f.getFloat(a))
+                                        .compareTo((Float) f.getFloat(b));
+                            } else if (type == Date.class) {
+                                ret = ((Date) f.get(a)).compareTo((Date) f
+                                        .get(b));
+                            } else if (isImplementsOf(type, Comparable.class)) {
+                                ret = ((Comparable) f.get(a))
+                                        .compareTo((Comparable) f.get(b));
+                            } else {
+                                ret = String.valueOf(f.get(a)).compareTo(
+                                        String.valueOf(f.get(b)));
+                            }
+
+                        } catch (SecurityException e) {
+                            e.printStackTrace();
+                        } catch (NoSuchFieldException e) {
+                            e.printStackTrace();
+                        } catch (IllegalArgumentException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        }
+
+                        if (sort != null && sort.toLowerCase().equals(DESC)) {
+                            return -ret;
+                        } else {
+                            return ret;
+                        }
+                    }
+                });
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 默认按正序排列
+     *
+     * @param list
+     *            排序集合
+     * @param method
+     *            排序方法 "getXxx()"
+     * @return
+     */
+    public static List<?> sortByMethod(List<?> list, final String method) {
+        return sortByMethod(list, method, null);
+    }
+
+    /**
+     * 集合排序
+     *
+     * @param list
+     *            排序集合
+     * @param method
+     *            排序方法 "getXxx()"
+     * @param sort
+     *            排序方式: SortListUtil.DESC(降序) SortListUtil.ASC(升序).
+     * @return
+     */
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    public static List<?> sortByMethod(List<?> list, final String method,
+                                       final String sort) {
+        Collections.sort(list, new Comparator() {
+            public int compare(Object a, Object b) {
+                int ret = 0;
+                try {
+                    Method m = a.getClass().getMethod(method, null);
+                    m.setAccessible(true);
+                    Class<?> type = m.getReturnType();
+                    if (type == int.class) {
+                        ret = ((Integer) m.invoke(a, null))
+                                .compareTo((Integer) m.invoke(b, null));
+                    } else if (type == double.class) {
+                        ret = ((Double) m.invoke(a, null)).compareTo((Double) m
+                                .invoke(b, null));
+                    } else if (type == long.class) {
+                        ret = ((Long) m.invoke(a, null)).compareTo((Long) m
+                                .invoke(b, null));
+                    } else if (type == float.class) {
+                        ret = ((Float) m.invoke(a, null)).compareTo((Float) m
+                                .invoke(b, null));
+                    } else if (type == Date.class) {
+                        ret = ((Date) m.invoke(a, null)).compareTo((Date) m
+                                .invoke(b, null));
+                    } else if (isImplementsOf(type, Comparable.class)) {
+                        ret = ((Comparable) m.invoke(a, null))
+                                .compareTo((Comparable) m.invoke(b, null));
+                    } else {
+                        ret = String.valueOf(m.invoke(a, null)).compareTo(
+                                String.valueOf(m.invoke(b, null)));
+                    }
+
+                    if (isImplementsOf(type, Comparable.class)) {
+                        ret = ((Comparable) m.invoke(a, null))
+                                .compareTo((Comparable) m.invoke(b, null));
+                    } else {
+                        ret = String.valueOf(m.invoke(a, null)).compareTo(
+                                String.valueOf(m.invoke(b, null)));
+                    }
+
+                } catch (NoSuchMethodException ne) {
+                    System.out.println(ne);
+                } catch (IllegalAccessException ie) {
+                    System.out.println(ie);
+                } catch (InvocationTargetException it) {
+                    System.out.println(it);
+                }
+
+                if (sort != null && sort.toLowerCase().equals(DESC)) {
+                    return -ret;
+                } else {
+                    return ret;
+                }
+            }
+        });
+        return list;
+    }
+
+    @SuppressWarnings("unchecked")
+    public static List<?> sortByMethod(List<?> list, final String methods[],
+                                       final String sorts[]) {
+        if (methods != null && methods.length > 0) {
+            for (int i = methods.length - 1; i >= 0; i--) {
+                final String method = methods[i];
+                String tmpSort = ASC;
+                if (sorts != null && sorts.length > i && sorts[i] != null) {
+                    tmpSort = sorts[i];
+                }
+                final String sort = tmpSort;
+                Collections.sort(list, new Comparator() {
+                    public int compare(Object a, Object b) {
+                        int ret = 0;
+                        try {
+                            Method m = a.getClass().getMethod(method, null);
+                            m.setAccessible(true);
+                            Class<?> type = m.getReturnType();
+                            if (type == int.class) {
+                                ret = ((Integer) m.invoke(a, null))
+                                        .compareTo((Integer) m.invoke(b, null));
+                            } else if (type == double.class) {
+                                ret = ((Double) m.invoke(a, null))
+                                        .compareTo((Double) m.invoke(b, null));
+                            } else if (type == long.class) {
+                                ret = ((Long) m.invoke(a, null))
+                                        .compareTo((Long) m.invoke(b, null));
+                            } else if (type == float.class) {
+                                ret = ((Float) m.invoke(a, null))
+                                        .compareTo((Float) m.invoke(b, null));
+                            } else if (type == Date.class) {
+                                ret = ((Date) m.invoke(a, null))
+                                        .compareTo((Date) m.invoke(b, null));
+                            } else if (isImplementsOf(type, Comparable.class)) {
+                                ret = ((Comparable) m.invoke(a, null))
+                                        .compareTo((Comparable) m.invoke(b,
+                                                null));
+                            } else {
+                                ret = String.valueOf(m.invoke(a, null))
+                                        .compareTo(
+                                                String.valueOf(m
+                                                        .invoke(b, null)));
+                            }
+
+                        } catch (NoSuchMethodException ne) {
+                            System.out.println(ne);
+                        } catch (IllegalAccessException ie) {
+                            System.out.println(ie);
+                        } catch (InvocationTargetException it) {
+                            System.out.println(it);
+                        }
+
+                        if (sort != null && sort.toLowerCase().equals(DESC)) {
+                            return -ret;
+                        } else {
+                            return ret;
+                        }
+                    }
+                });
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 判断对象实现的所有接口中是否包含szInterface
+     *
+     * @param clazz
+     * @param szInterface
+     * @return
+     */
+    public static boolean isImplementsOf(Class<?> clazz, Class<?> szInterface) {
+        boolean flag = false;
+
+        Class<?>[] face = clazz.getInterfaces();
+        for (Class<?> c : face) {
+            if (c == szInterface) {
+                flag = true;
+            } else {
+                flag = isImplementsOf(c, szInterface);
+            }
+        }
+
+        if (!flag && null != clazz.getSuperclass()) {
+            return isImplementsOf(clazz.getSuperclass(), szInterface);
+        }
+
+        return flag;
+    }
+
+}

+ 78 - 0
realtime/failurestatistics-server/src/main/resources/application-hb.yml

@@ -0,0 +1,78 @@
+# 项目相关配置
+gyee:
+  #实时数据库Url
+  baseurl: http://192.168.2.198:8011/ts
+  healthurl: http://192.168.2.198:8012/ts
+  #实时数据库选择
+  realtimedataBase: mongodb #数据查询模式 golden、hwy
+  initialcode: INITIAL
+server:
+  port: 8161
+  servlet:
+    context-path: /
+
+management:
+  health:
+    redis:
+      enabled: false
+
+spring:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: oracle.jdbc.OracleDriver
+    #外网
+    url: jdbc:oracle:thin:@192.168.2.215:1521:gdsj
+    username: gdprod
+    password: gd123
+    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
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+
+edos:
+  baseURL: http://10.0.118.73:8011/ts

+ 78 - 0
realtime/failurestatistics-server/src/main/resources/application-hbn.yml

@@ -0,0 +1,78 @@
+# 项目相关配置
+gyee:
+  #实时数据库Url
+  baseurl: http://10.83.68.96:8011/ts
+  healthurl: http://10.83.68.96:8012/ts
+  #实时数据库选择
+  realtimedataBase: mongodb #数据查询模式 golden、hwy
+  initialcode: INITIAL
+server:
+  port: 8161
+  servlet:
+    context-path: /
+
+management:
+  health:
+    redis:
+      enabled: false
+
+spring:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: oracle.jdbc.OracleDriver
+    #外网
+    url: jdbc:oracle:thin:@10.83.68.165:1521:gdsj
+    username: gdprod
+    password: gd123
+    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
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+
+edos:
+  baseURL: http://10.0.118.73:8011/ts

+ 78 - 0
realtime/failurestatistics-server/src/main/resources/application-hf.yml

@@ -0,0 +1,78 @@
+# 项目相关配置
+gyee:
+  #实时数据库Url
+  baseurl: http://10.0.118.73:8011/ts
+  healthurl: http://10.0.118.73:8011/ts
+  #实时数据库选择
+  realtimedataBase: mongodb #数据查询模式 golden、hwy
+  initialcode: INITIAL
+server:
+  port: 8161
+  servlet:
+    context-path: /
+
+management:
+  health:
+    redis:
+      enabled: false
+
+spring:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: oracle.jdbc.OracleDriver
+    #外网
+    url: jdbc:oracle:thin:@10.0.118.71:1521:gdsj
+    username: gdprod
+    password: gd123
+    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
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+
+edos:
+  baseURL: http://10.0.118.73:8011/ts

+ 79 - 0
realtime/failurestatistics-server/src/main/resources/application-hwy.yml

@@ -0,0 +1,79 @@
+# 项目相关配置
+gyee:
+  #实时数据库Url
+
+  baseurl: http://123.60.213.70:8011/ts
+
+  #实时数据库选择
+  realtimedataBase: mongodb #数据查询模式 golden、hwy
+  initialcode: INITIAL
+server:
+  port: 8161
+  servlet:
+    context-path: /
+
+management:
+  health:
+    redis:
+      enabled: false
+
+spring:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: oracle.jdbc.OracleDriver
+    #外网
+    url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+    username: nxfdprod
+    password: gdnxfd123
+    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
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+
+edos:
+  baseURL: http://10.0.118.73:8011/ts

+ 79 - 0
realtime/failurestatistics-server/src/main/resources/application-jn.yml

@@ -0,0 +1,79 @@
+# 项目相关配置
+gyee:
+  #实时数据库Url
+  baseurl: http://10.81.3.155:8011/ts
+  healthurl: http://10.81.3.155:8011/ts
+  #实时数据库选择
+  realtimedataBase: mongodb #数据查询模式 golden、hwy
+  initialcode: INITIAL
+server:
+  port: 8161
+  servlet:
+    context-path: /
+
+management:
+  health:
+    redis:
+      enabled: false
+
+spring:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    #外网
+    driver-class-name: org.postgresql.Driver
+    url: jdbc:postgresql://10.81.3.151:5432/IMS_NEM_JN
+    username: postgres
+    password: postgres
+
+    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
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+
+edos:
+  baseURL: http://10.0.118.73:8011/ts

+ 20 - 0
realtime/failurestatistics-server/src/main/resources/xxl-job-executor.properties

@@ -0,0 +1,20 @@
+### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
+#xxl.job.admin.addresses=http://192.168.2.198:8175/xxl-job-admin
+#xxl.job.admin.addresses=http://10.0.118.76:8175/xxl-job-admin
+xxl.job.admin.addresses=http://10.81.3.152:8175/xxl-job-admin
+
+### xxl-job, access token
+xxl.job.accessToken=
+
+### xxl-job executor appname
+xxl.job.executor.appname=failurestatistics-job
+### 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=9112
+### xxl-job executor log-path
+xxl.job.executor.logpath=d:\\jobs\\failurestatistics-job
+### xxl-job executor log-retention-days
+xxl.job.executor.logretentiondays=30
+