Browse Source

修复经济运行bug

xieshengjie 2 years ago
parent
commit
015747e4da

+ 6 - 1
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/init/CacheContext.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.TypeReference;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.gyee.benchmarkinghistroy.model.auto.*;
 import com.gyee.benchmarkinghistroy.service.auto.*;
+import com.gyee.benchmarkinghistroy.service.benchmarking.BenchmarkingHistroyService;
 import com.gyee.benchmarkinghistroy.util.redis.RedisService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -27,7 +28,8 @@ public class CacheContext implements CommandLineRunner {
 
 
     private static final Logger log = LoggerFactory.getLogger(CacheContext.class);
-
+    @Autowired
+    private BenchmarkingHistroyService benchmarkingHistroyService;
     @Autowired
     private IWindturbineService windturbineService;
     @Autowired
@@ -113,6 +115,9 @@ public class CacheContext implements CommandLineRunner {
         wtpAimap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, Windturbinetestingpointnew>>>() {
         });
 
+//        benchmarkingHistroyService.saveEquipmentdayinfo("2022-07-01","2022-07-03");
+//        benchmarkingHistroyService.saveEquipmentdaydetailed("2022-07-01","2022-07-03");
+
 
         log.info("-------------------------------缓存结束--------------------------------------");
     }

+ 22 - 21
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/service/benchmarking/BenchmarkingHistroyService.java

@@ -8,6 +8,7 @@ import com.gyee.common.contant.Contant;
 import com.gyee.common.model.PointData;
 import com.gyee.common.model.StringUtils;
 import com.gyee.common.util.DateUtils;
+import com.gyee.common.util.DoubleUtils;
 import com.gyee.common.util.RandomUtil;
 import com.gyee.common.vo.benchmark.OpeVo;
 import org.springframework.stereotype.Service;
@@ -106,18 +107,18 @@ public class BenchmarkingHistroyService {
                 equipmentdayinfo.setProjectid(wt.getProjectid());
                 equipmentdayinfo.setWindpowerstationid(wt.getWindpowerstationid());
                 equipmentdayinfo.setRecorddate(DateUtils.parseDate(d));
-                equipmentdayinfo.setGenecapacity(wtDataMap.get(wt.getId()+"_RFDL"));
-                equipmentdayinfo.setSpeed(wtDataMap.get(wt.getId()+"_AI022"));
+                equipmentdayinfo.setGenecapacity(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RFDL"),2));
+                equipmentdayinfo.setSpeed(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_AI022"),2));
                 //维护:RJXSSDL-ZS,RLZSSDL-ZS
-                equipmentdayinfo.setDaynhwhssdl(wtDataMap.get(wt.getId()+"_RJXSSDL-ZS") + wtDataMap.get(wt.getId()+"_RLZSSDL-ZS"));
+                equipmentdayinfo.setDaynhwhssdl(DoubleUtils.keepPrecision((wtDataMap.get(wt.getId()+"_RJXSSDL-ZS") + wtDataMap.get(wt.getId()+"_RLZSSDL-ZS")),2));
                 //故障:RGZSSDL-ZS,NSZSSDL-ZS
-                equipmentdayinfo.setDaynhgzssdl(wtDataMap.get(wt.getId()+"_RGZSSDL-ZS") + wtDataMap.get(wt.getId()+"_NSZSSDL-ZS"));
+                equipmentdayinfo.setDaynhgzssdl(DoubleUtils.keepPrecision((wtDataMap.get(wt.getId()+"_RGZSSDL-ZS") + wtDataMap.get(wt.getId()+"_NSZSSDL-ZS")),2));
                 //限电:RQFSSDL-ZS,RXDSSDL-ZS
-                equipmentdayinfo.setDaynhxdssdl(wtDataMap.get(wt.getId()+"_RQFSSDL-ZS") + wtDataMap.get(wt.getId()+"_RXDSSDL-ZS"));
+                equipmentdayinfo.setDaynhxdssdl(DoubleUtils.keepPrecision((wtDataMap.get(wt.getId()+"_RQFSSDL-ZS") + wtDataMap.get(wt.getId()+"_RXDSSDL-ZS")),2));
                 //性能:RDJSSDL-ZS,RSTSSDL-ZS,RXNSSDL-ZS,RQXSSDL-ZS(集团项目需把发电欠发去掉)
-                equipmentdayinfo.setDaynhqfdl(wtDataMap.get(wt.getId()+"_RDJSSDL-ZS") + wtDataMap.get(wt.getId()+"_RSTSSDL-ZS") + wtDataMap.get(wt.getId()+"_RXNSSDL-ZS") + wtDataMap.get(wt.getId()+"_RQXSSDL-ZS"));
+                equipmentdayinfo.setDaynhqfdl(DoubleUtils.keepPrecision((wtDataMap.get(wt.getId()+"_RDJSSDL-ZS") + wtDataMap.get(wt.getId()+"_RSTSSDL-ZS") + wtDataMap.get(wt.getId()+"_RXNSSDL-ZS") + wtDataMap.get(wt.getId()+"_RQXSSDL-ZS")),2));
                 //受累:RWZSSDL-ZS,RTZSSDL-ZS
-                equipmentdayinfo.setDaynhcfdl(wtDataMap.get(wt.getId()+"_RWZSSDL-ZS") + wtDataMap.get(wt.getId()+"_RTZSSDL-ZS"));
+                equipmentdayinfo.setDaynhcfdl(DoubleUtils.keepPrecision((wtDataMap.get(wt.getId()+"_RWZSSDL-ZS") + wtDataMap.get(wt.getId()+"_RTZSSDL-ZS")),2));
                 equipmentdayinfo.setTherogenecapacity(equipmentdayinfo.getGenecapacity()+equipmentdayinfo.getDaynhwhssdl()+equipmentdayinfo.getDaynhgzssdl()+equipmentdayinfo.getDaynhxdssdl()+equipmentdayinfo.getDaynhqfdl()+equipmentdayinfo.getDaynhcfdl());
                 resultList.add(equipmentdayinfo);
             });
@@ -165,25 +166,25 @@ public class BenchmarkingHistroyService {
                 equipmentdayinfo.setProjectid(wt.getProjectid());
                 equipmentdayinfo.setWindpowerstationid(wt.getWindpowerstationid());
                 equipmentdayinfo.setRecorddate(DateUtils.parseDate(d));
-                equipmentdayinfo.setGenecapacity(wtDataMap.get(wt.getId()+"_RFDL"));
-                equipmentdayinfo.setSpeed(wtDataMap.get(wt.getId()+"_AI022"));
+                equipmentdayinfo.setGenecapacity(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RFDL"),2));
+                equipmentdayinfo.setSpeed(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_AI022"),2));
                 //维护:RJXSSDL-ZS,RLZSSDL-ZS
-                equipmentdayinfo.setDaynhwhssdl1(wtDataMap.get(wt.getId()+"_RJXSSDL-ZS"));
-                equipmentdayinfo.setDaynhwhssdl2(wtDataMap.get(wt.getId()+"_RLZSSDL-ZS"));
+                equipmentdayinfo.setDaynhwhssdl1(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RJXSSDL-ZS"),2));
+                equipmentdayinfo.setDaynhwhssdl2(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RLZSSDL-ZS"),2));
                 //故障:RGZSSDL-ZS,NSZSSDL-ZS
-                equipmentdayinfo.setDaynhgzssdl1(wtDataMap.get(wt.getId()+"_RGZSSDL-ZS"));
-                equipmentdayinfo.setDaynhgzssdl2(wtDataMap.get(wt.getId()+"_NSZSSDL-ZS"));
+                equipmentdayinfo.setDaynhgzssdl1(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RGZSSDL-ZS"),2));
+                equipmentdayinfo.setDaynhgzssdl2(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_NSZSSDL-ZS"),2));
                 //限电:RQFSSDL-ZS,RXDSSDL-ZS
-                equipmentdayinfo.setDaynhxdssdl1(wtDataMap.get(wt.getId()+"_RQFSSDL-ZS"));
-                equipmentdayinfo.setDaynhxdssdl2(wtDataMap.get(wt.getId()+"_RXDSSDL-ZS"));
+                equipmentdayinfo.setDaynhxdssdl1(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RQFSSDL-ZS"),2));
+                equipmentdayinfo.setDaynhxdssdl2(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RXDSSDL-ZS"),2));
                 //性能:RDJSSDL-ZS,RSTSSDL-ZS,RXNSSDL-ZS,RQXSSDL-ZS
-                equipmentdayinfo.setDaynhqfdl1(wtDataMap.get(wt.getId()+"_RDJSSDL-ZS"));
-                equipmentdayinfo.setDaynhqfdl2(wtDataMap.get(wt.getId()+"_RSTSSDL-ZS"));
-                equipmentdayinfo.setDaynhqfdl3(wtDataMap.get(wt.getId()+"_RXNSSDL-ZS"));
-                equipmentdayinfo.setDaynhqfdl4(wtDataMap.get(wt.getId()+"_RQXSSDL-ZS"));
+                equipmentdayinfo.setDaynhqfdl1(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RDJSSDL-ZS"),2));
+                equipmentdayinfo.setDaynhqfdl2(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RSTSSDL-ZS"),2));
+                equipmentdayinfo.setDaynhqfdl3(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RXNSSDL-ZS"),2));
+                equipmentdayinfo.setDaynhqfdl4(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RQXSSDL-ZS"),2));
                 //受累:RWZSSDL-ZS,RTZSSDL-ZS
-                equipmentdayinfo.setDaynhcfdl1(wtDataMap.get(wt.getId()+"_RWZSSDL-ZS"));
-                equipmentdayinfo.setDaynhcfdl2(wtDataMap.get(wt.getId()+"_RTZSSDL-ZS"));
+                equipmentdayinfo.setDaynhcfdl1(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RWZSSDL-ZS"),2));
+                equipmentdayinfo.setDaynhcfdl2(DoubleUtils.keepPrecision(wtDataMap.get(wt.getId()+"_RTZSSDL-ZS"),2));
 
                 equipmentdayinfo.setTherogenecapacity(equipmentdayinfo.getGenecapacity()+equipmentdayinfo.getDaynhwhssdl1()+equipmentdayinfo.getDaynhwhssdl2()
                         +equipmentdayinfo.getDaynhgzssdl1()+equipmentdayinfo.getDaynhgzssdl2()

File diff suppressed because it is too large
+ 790 - 790
histroy/benchmarking-histroy-new/src/main/java/com/gyee/benchmarkinghistroy/util/realtimesource/MongoEdosUtil.java


+ 10 - 0
web/monitor-web/pom.xml

@@ -14,6 +14,16 @@
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 20 - 1
web/monitor-web/src/main/resources/application-test.yml

@@ -1,7 +1,26 @@
 server:
+#  port: 8089
+#  servlet:
+#    context-path: /
+  # 服务器的HTTP端口,默认为8080
   port: 8089
   servlet:
+    # 应用的访问路径
     context-path: /
+  # undertow 配置
+  undertow:
+    # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
+    max-http-post-size: -1
+  # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
+  # 每块buffer的空间大小,越小的空间被利用越充分
+  buffer-size: 512
+  # 是否分配的直接内存
+  direct-buffers: true
+  threads:
+    # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
+    io: 8
+    # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
+    worker: 256
 
 
 spring:
@@ -98,4 +117,4 @@ logging:
 
 
 golden:
-  baseURL: http://10.83.68.97:8011/ts
+  baseURL: http://10.83.68.96:8011/ts

+ 1 - 1
web/monitor-web/src/main/resources/application.yml

@@ -1,4 +1,4 @@
 spring:
   profiles:
 #    active: dev
-    active: jn
+    active: test