فهرست منبع

计算服务修改

xieshengjie 3 سال پیش
والد
کامیت
e6b42729c9

+ 1 - 0
common/src/main/java/com/gyee/common/contant/Contant.java

@@ -93,6 +93,7 @@ public class Contant {
     public static final String WHTJ = "WHTJ";  //维护停机台数
     public static final String XDTS = "XDTS";  //限电台数
     public static final String YXTS = "YXTS";  //运行台数
+    public static final String SLTS = "SLTS";  //运行台数
 
     public static final String ZSGL = "ZSGL";//风机自算功率
     public static final String ZZSGL = "ZZSGL";//场站自算功率

+ 84 - 30
realtime/generation-service/src/main/java/com/gyee/generation/service/StatusService.java

@@ -91,7 +91,7 @@ public class StatusService {
                         interruptionList.add(windturbinetestingpointnew.getCode());
                     }
                 });
-                Double status = 2.0;
+                Double status = 1.0;
                 Double mxstatus = 2.0;
                 try {
                     if (StringUtils.isEmpty(interruptionList)){
@@ -111,30 +111,67 @@ public class StatusService {
                                 Optional<Windturbinestatusdi> first = statusMap.get(wt.getId()).stream().filter(w -> w.getUniformcode().equals(Contant.AI422)).findFirst();
                                 if (first.isPresent()){
                                     Windturbinestatusdi windturbinestatusdi = first.get();
-                                    //联合动力
-                                    double pointValueInDouble = edosUtil.getRealData(windturbinestatusdi.getId()).getPointValueInDouble();
-                                    switch ((int) pointValueInDouble){
-                                        case 0:
-                                            mxstatus = 12.0;
-                                            break;
-                                        case 1:
-                                            mxstatus = 6.0;
-                                            break;
-                                        case 2:
-                                            mxstatus = 8.0;
-                                            break;
-                                        case 3:
-                                            mxstatus = 0.0;
-                                            break;
-                                        case 4:
-                                        case 5:
-                                            mxstatus = 2.0;
-                                            break;
-                                        case 6:
-                                            mxstatus = 1.0;
-                                            break;
-                                        default:
-                                            mxstatus = 2.0;
+                                    if (wt.getModelid().equals("EN141/2.6") || wt.getModelid().equals("EN141/3.2")){
+                                        //远景
+                                        int pointValueInDouble = (int) edosUtil.getRealData(windturbinestatusdi.getId()).getPointValueInDouble();
+                                        switch (pointValueInDouble){
+                                            case 1:
+                                            case 4:
+                                                mxstatus = 1.0;
+                                                break;
+                                            case 2:
+                                                mxstatus = 6.0;
+                                                break;
+                                            case 3:
+                                                mxstatus = 11.0;
+                                                break;
+                                            case 5:
+                                            case 6:
+                                                mxstatus = 2.0;
+                                                break;
+                                            case 7:
+                                                mxstatus = 4.0;
+                                                break;
+                                            case 8:
+                                                mxstatus = 12.0;
+                                                break;
+                                            case 9:
+                                                mxstatus = 0.0;
+                                                break;
+                                            case 10:
+                                                mxstatus = 10.0;
+                                                break;
+                                            case 11:
+                                            case 12:
+                                                mxstatus = 8.0;
+                                                break;
+                                        }
+                                    }else {
+                                        //联合动力
+                                        double pointValueInDouble = edosUtil.getRealData(windturbinestatusdi.getId()).getPointValueInDouble();
+                                        switch ((int) pointValueInDouble){
+                                            case 0:
+                                                mxstatus = 12.0;
+                                                break;
+                                            case 1:
+                                                mxstatus = 6.0;
+                                                break;
+                                            case 2:
+                                                mxstatus = 8.0;
+                                                break;
+                                            case 3:
+                                                mxstatus = 0.0;
+                                                break;
+                                            case 4:
+                                            case 5:
+                                                mxstatus = 2.0;
+                                                break;
+                                            case 6:
+                                                mxstatus = 1.0;
+                                                break;
+                                            default:
+                                                mxstatus = 2.0;
+                                        }
                                     }
                                 }
                             }
@@ -173,7 +210,7 @@ public class StatusService {
                         }else if(mxstatus == 8 || mxstatus == 9){
                             status = 4.0;
                         }else if(mxstatus == 10 || mxstatus == 11){
-                            status = 2.0;
+                            status = 6.0;
                         }else if(mxstatus == 12){
                             status = 3.0;
                         }
@@ -221,6 +258,7 @@ public class StatusService {
             AtomicInteger wpwhtj = new AtomicInteger();
             AtomicInteger wpxdts = new AtomicInteger();
             AtomicInteger wpyxts = new AtomicInteger();
+            AtomicInteger wpslts = new AtomicInteger();
             projects.stream().forEach(project->{
                 List<Line> lineList = prolinemap.get(project.getId());
                 Map<String, Windpowerstationpointnew> projectmap = propointmap.get(project.getId());
@@ -245,6 +283,7 @@ public class StatusService {
                 AtomicInteger prowhtj = new AtomicInteger();
                 AtomicInteger proxdts = new AtomicInteger();
                 AtomicInteger proyxts = new AtomicInteger();
+                AtomicInteger proslts = new AtomicInteger();
 
                 lineList.stream().forEach(line->{
                     List<Windturbine> windturbines = linewtmap.get(line.getId());
@@ -269,7 +308,7 @@ public class StatusService {
                     AtomicInteger whtj = new AtomicInteger();
                     AtomicInteger xdts = new AtomicInteger();
                     AtomicInteger yxts = new AtomicInteger();
-
+                    AtomicInteger slts = new AtomicInteger();
                     windturbines.stream().forEach(wt->{
                         Windturbinetestingpointnew windturbinetestingpointnew = wtpAimap.get(wt.getId()).get(Contant.ZTMX);
                         try {
@@ -408,10 +447,15 @@ public class StatusService {
                     resultList.add(hjslnumPoint);
 
                     //故障台数6-2
-                    gzts.addAndGet(gznum.intValue()+cngznum.intValue()+dwslnum.intValue()+hjslnum.intValue());
+                    gzts.addAndGet(gznum.intValue()+cngznum.intValue());
                     Windpowerstationpointnew gztsPointNew = linemap.get(Contant.GZTJ);
                     PointData gztjPoint = createWpPoint(gzts, gztsPointNew);
                     resultList.add(gztjPoint);
+                    //受累台数6-6
+                    slts.addAndGet(dwslnum.intValue()+hjslnum.intValue());
+                    Windpowerstationpointnew sltsPointNew = linemap.get(Contant.SLTS);
+                    PointData sltjPoint = createWpPoint(slts, sltsPointNew);
+                    resultList.add(sltjPoint);
 
                     //离线台数12
                     Windpowerstationpointnew lxnumPointNew = linemap.get(Contant.LXNUM);
@@ -510,9 +554,14 @@ public class StatusService {
                 resultList.add(hjslnumPoint);
                 //故障台数6-2
                 Windpowerstationpointnew gztsPointNew = projectmap.get(Contant.GZTJ);
-                progzts.addAndGet(progznum.intValue()+procngznum.intValue()+prodwslnum.intValue()+prohjslnum.intValue());
+                progzts.addAndGet(progznum.intValue()+procngznum.intValue());
                 PointData gztsPoint = createWpPoint(progzts, gztsPointNew);
                 resultList.add(gztsPoint);
+                //受累台数6-6
+                Windpowerstationpointnew sltsPointNew = projectmap.get(Contant.SLTS);
+                proslts.addAndGet(prodwslnum.intValue()+prohjslnum.intValue());
+                PointData sltsPoint = createWpPoint(proslts, sltsPointNew);
+                resultList.add(sltsPoint);
                 //离线台数12
                 Windpowerstationpointnew lxnumPointNew = projectmap.get(Contant.LXNUM);
                 Windpowerstationpointnew txzdPointNew = projectmap.get(Contant.TXZD);
@@ -597,9 +646,14 @@ public class StatusService {
             resultList.add(hjslnumPoint);
             //故障台数6-2
             Windpowerstationpointnew gztsPointNew = wpmap.get(Contant.GZTJ);
-            wpgzts.addAndGet(wpgznum.intValue()+wpcngznum.intValue()+wpdwslnum.intValue()+wphjslnum.intValue());
+            wpgzts.addAndGet(wpgznum.intValue()+wpcngznum.intValue());
             PointData gztsPoint = createWpPoint(wpgzts, gztsPointNew);
             resultList.add(gztsPoint);
+            //受累台数6-6
+            Windpowerstationpointnew sltsPointNew = wpmap.get(Contant.SLTS);
+            wpslts.addAndGet(wpdwslnum.intValue()+wphjslnum.intValue());
+            PointData sltsPoint = createWpPoint(wpslts, sltsPointNew);
+            resultList.add(sltsPoint);
             //离线台数12
             Windpowerstationpointnew lxnumPointNew = wpmap.get(Contant.LXNUM);
             Windpowerstationpointnew txzdPointNew = wpmap.get(Contant.TXZD);

+ 14 - 7
realtime/generation-service/src/main/java/com/gyee/generation/service/TheorypowerService.java

@@ -91,20 +91,27 @@ public class TheorypowerService {
                         Map<Double, Double> zsglMap = zszglMap.get(wt.getId());
                         Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
                         Windturbinetestingpointnew speedPointnew = windturbinetestingpointnewMap.get(Contant.AI022);
+                        Windturbinetestingpointnew ztmxPointnew = windturbinetestingpointnewMap.get(Contant.FJ5T);
                         Windturbinetestingpointnew wtzsgl = windturbinetestingpointnewMap.get(Contant.ZSGL);
                         Windturbinetestingpointnew wtbzgl = windturbinetestingpointnewMap.get(Contant.BZGL);
                         Double zzsgl = 0.0;
                         Double zbzgl = 0.0;
                         try {
+                            Double wtztmx = DoubleUtils.keepPrecision(edosUtil.getRealData(ztmxPointnew).getPointValueInDouble(),2);
                             Double wtspeed = DoubleUtils.keepPrecision(edosUtil.getRealData(speedPointnew).getPointValueInDouble(),2);
-                            if (zbzglMap.containsKey(wt.getModelid())){
-                                Map<Double, Double> doubleDoubleMap = zbzglMap.get(wt.getModelid());
-                                if(doubleDoubleMap.containsKey(wtspeed)){
-                                    zbzgl = doubleDoubleMap.get(wtspeed);
+                            if (wtztmx==2 || wtztmx==4 || wtztmx==0 || wtztmx==3){
+                                zbzgl = 0.0;
+                                zzsgl = 0.0;
+                            }else {
+                                if (zbzglMap.containsKey(wt.getModelid())){
+                                    Map<Double, Double> doubleDoubleMap = zbzglMap.get(wt.getModelid());
+                                    if(doubleDoubleMap.containsKey(wtspeed)){
+                                        zbzgl = doubleDoubleMap.get(wtspeed);
+                                    }
+                                }
+                                if (zsglMap.containsKey(wtspeed)){
+                                    zzsgl = zsglMap.get(wtspeed);
                                 }
-                            }
-                            if (zsglMap.containsKey(wtspeed)){
-                                zzsgl = zsglMap.get(wtspeed);
                             }
                         } catch (Exception e) {
                             e.printStackTrace();

+ 1 - 1
realtime/generation-service/src/main/resources/application-jn.yml

@@ -88,7 +88,7 @@ db:
 runWindpowerstation: GJY_FDC
 #计算状态用ai或者di
 clauStatus:
-  ai:    #配置期次
+  ai: GJY03_GC   #配置期次
   di: GJY02_GC
 
 #判断数据终端

+ 2 - 2
realtime/generation-service/src/test/java/com/gyee/generation/GenerationTest.java

@@ -47,13 +47,13 @@ public class GenerationTest {
     @Test
     public void test1() throws Exception {
 //        averageAndGeneratingService.saveAvespeedAndAvepowerAndScada();
-//        statusService.calculateStatus();
+        statusService.calculateStatusNumber();
 //        realtimeSpeedPowerService.calculateRealtimeSpeedPower();
 //        generationService.saveMeterpointValueRealtime();
 //        theorypowerService.fittingPower();
 //        theorypowerService.theropower();
 //        averageAndGeneratingService.saveAvespeedAndAvepowerAndScada();
-        fiveLossesService.lossesReal();
+//        fiveLossesService.lossesReal();
     }
 
 

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

@@ -55,6 +55,10 @@
             <groupId>com.alibaba.cloud</groupId>
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 10 - 8
web/monitor-web/src/main/java/com/gyee/monitor/service/matrix/MatrixService.java

@@ -54,14 +54,16 @@ public class MatrixService {
             comany.setOrdernum(0.0);
             wpls.add(comany);
             //如果有光伏将下面注释打开
-//            Windpowerstation fd = new Windpowerstation();
-//            fd.setId("-1");
-//            fd.setQuantity(wpls.stream().filter(i->i.getId().endsWith("FDC")).mapToDouble(Windpowerstation::getQuantity).sum());
-//            wpls.add(fd);
-//            Windpowerstation gf = new Windpowerstation();
-//            gf.setId("-2");
-//            gf.setQuantity(wpls.stream().filter(i->i.getId().endsWith("GDC")).mapToDouble(Windpowerstation::getQuantity).sum());
-//            wpls.add(gf);
+            Windpowerstation fd = new Windpowerstation();
+            fd.setId("-1");
+            fd.setOrdernum(0.0);
+            fd.setQuantity(wpls.stream().filter(i->i.getId().endsWith("FDC")).mapToDouble(Windpowerstation::getQuantity).sum());
+            wpls.add(fd);
+            Windpowerstation gf = new Windpowerstation();
+            gf.setId("-2");
+            gf.setOrdernum(0.0);
+            gf.setQuantity(wpls.stream().filter(i->i.getId().endsWith("GDC")).mapToDouble(Windpowerstation::getQuantity).sum());
+            wpls.add(gf);
         }
         SortUtils.sort(wpls,"ordernum",SortUtils.ASC);
         wpls.stream().forEach(wp-> {

+ 100 - 0
web/monitor-web/src/main/resources/application-jn.yml

@@ -0,0 +1,100 @@
+server:
+  port: 8089
+  servlet:
+    context-path: /
+
+
+spring:
+  application:
+    name: monitor-provider
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 10.81.3.155:8848
+        #指定yaml格式的配置
+        file-extension: yaml
+        cluster-name: master
+      username: nacos
+      password: nacos
+  #redis集群
+  redis:
+    host: 10.81.3.155
+    port: 6379
+    timeout: 100000
+    #    集群环境打开下面注释,单机不需要打开
+    #    cluster:
+    #      集群信息
+    #      nodes: xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx
+    #      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
+    #      maxRedirects: 3
+    password:
+    application:
+      name: test
+    jedis:
+      pool:
+        max-active: 8
+        min-idle: 0
+        max-idle: 8
+        max-wait: -1
+    database: 0
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: org.postgresql.Driver
+    url: jdbc:postgresql://10.81.3.151:5432/wisdom
+    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
+
+
+golden:
+  baseURL: http://10.81.3.152:8011/ts
+
+

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

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