Browse Source

添加晋能首页新指标

shilin 2 years ago
parent
commit
0a0751f908

+ 26 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/common/conf/AccessConfig.java

@@ -0,0 +1,26 @@
+package com.gyee.frame.common.conf;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * 预警配置
+ */
+@Component
+@ConfigurationProperties(prefix = "accesslist")
+public class AccessConfig {
+
+    private static Map<String,String> wpmap;
+
+
+    public static Map<String, String> getWpmap() {
+        return wpmap;
+    }
+
+    public  void setWpmap(Map<String, String> wpmap) {
+        AccessConfig.wpmap = wpmap;
+    }
+}
+

+ 95 - 3
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -1,6 +1,7 @@
 package com.gyee.frame.service.websocket;
 
 
+import com.gyee.frame.common.conf.AccessConfig;
 import com.gyee.frame.common.conf.V2Config;
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
@@ -128,7 +129,6 @@ public class GenreSetPushService {
                 }
 
 
-
                 Map<String, Double> sftjmap = new HashMap<>();//省份装机容量和台数统计
                 for (Windpowerstation wp : wplist) {
 
@@ -1778,9 +1778,58 @@ public class GenreSetPushService {
                 }
 
 
+                double fd_zjrl=0;
+                double gf_zjrl=0;
+                double qjny_fj_ts=0;
+                double qjny_gf_zcts=0;
+                double qjny_gf_jzts=0;
+
+                double jr_fj_ts=0;
+                double jr_gf_zcts=0;
+                double jr_gf_jzts=0;
+
+                double fd_r_ycdl=0;
+                double fd_y_ycdl=0;
+                double gf_r_ycdl=0;
+                double gf_y_ycdl=0;
+
+
+
+                Calendar c = Calendar.getInstance();
+
+               c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
+                int daynum = c.get(Calendar.DAY_OF_MONTH);
 
                 Map<String, Double> sftjmap = new HashMap<>();//省份装机容量和台数统计
                 for (Windpowerstation wp : wplist) {
+                    String rfdlpoint=windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WP_RFDL).getCode();
+
+                    String yfdlpoint=windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(wp.getId(), Constant.TPOINT_WP_YFDL).getCode();
+
+
+                    PointData rfdldata = realApiUtil.getRealData(rfdlpoint);
+                    PointData yfdldata = realApiUtil.getRealData(yfdlpoint);
+
+                    double rfdl=MathUtil.twoBit(rfdldata.getPointValueInDouble()/1000);
+                    double yfdl=MathUtil.twoBit(yfdldata.getPointValueInDouble()/1000);
+
+                    if(wp.getId().endsWith("FDC"))
+                    {
+                        fd_r_ycdl =fd_r_ycdl+(rfdl * YCFDLXS) ;
+
+                        c = Calendar.getInstance();
+                        double yycfdl = (yfdl + fd_r_ycdl * (daynum - c.get(Calendar.DAY_OF_MONTH))) * YCFDLXS;
+                        fd_y_ycdl=fd_y_ycdl+yycfdl;
+                    }else
+                    {
+                        gf_r_ycdl =gf_r_ycdl+(rfdl * YCFDLXS) ;
+
+                        c = Calendar.getInstance();
+                        double yycfdl = (yfdl + gf_r_ycdl * (daynum - c.get(Calendar.DAY_OF_MONTH))) * YCFDLXS;
+                        gf_y_ycdl=gf_y_ycdl+yycfdl;
+                    }
+
+
 
                     if (StringUtils.notEmp(wp.getCompanyid()) && sftjmap.containsKey(wp.getCompanyid() + "_zjrl")) {
 
@@ -1794,6 +1843,8 @@ public class GenreSetPushService {
 
                     if(wp.getId().endsWith("GDC") && InitialRunner.gp_sqmap.containsKey(wp.getId()))
                     {
+
+                        gf_zjrl=gf_zjrl+wp.getCapacity();
                         List<Square> sqls=InitialRunner.gp_sqmap.get(wp.getId());
                         for(Square sq:sqls)
                         {
@@ -1806,13 +1857,21 @@ public class GenreSetPushService {
                                     {
                                         List<Inverter> nbqls=InitialRunner.sq_nbqmap.get(sq.getId());
                                         temp = temp + nbqls.size();
+
+                                        qjny_gf_zcts=qjny_gf_zcts + nbqls.size();
+                                        if(AccessConfig.getWpmap().containsKey(wp.getId()))
+                                        {
+                                            jr_gf_zcts=jr_gf_zcts + nbqls.size();
+                                        }
                                     }
 
                                     sftjmap.put(wp.getPhoto() + "_zc_zjts", temp);
                                 } else {
-                                    double temp = wp.getCapacity();
+                                    double temp = wp.getQuantity();
                                     sftjmap.put(wp.getPhoto() + "_zc_zjts", temp);
                                 }
+
+
                             }else
                             {
                                 if (StringUtils.notEmp(wp.getPhoto()) && sftjmap.containsKey(wp.getPhoto() + "_jz_zjts")) {
@@ -1822,10 +1881,16 @@ public class GenreSetPushService {
                                     {
                                         List<Inverter> nbqls=InitialRunner.sq_nbqmap.get(sq.getId());
                                         temp = temp + nbqls.size();
+
+                                        qjny_gf_jzts=qjny_gf_jzts + nbqls.size();
+                                        if(AccessConfig.getWpmap().containsKey(wp.getId()))
+                                        {
+                                            jr_gf_jzts=jr_gf_jzts + nbqls.size();
+                                        }
                                     }
                                     sftjmap.put(wp.getPhoto() + "_jz_zjts", temp);
                                 } else {
-                                    double temp = wp.getCapacity();
+                                    double temp = wp.getQuantity();
                                     sftjmap.put(wp.getPhoto() + "_jz_zjts", temp);
                                 }
                             }
@@ -1838,14 +1903,41 @@ public class GenreSetPushService {
 
                             double temp = sftjmap.get(wp.getPhoto() + "_zjts");
                             temp = temp + wp.getQuantity();
+
+
                             sftjmap.put(wp.getPhoto() + "_zjts", temp);
                         } else {
                             double temp = wp.getQuantity();
                             sftjmap.put(wp.getPhoto() + "_zjts", temp);
                         }
+
+                        fd_zjrl=fd_zjrl+wp.getCapacity();
+                        qjny_fj_ts=qjny_fj_ts + wp.getQuantity();
+                        if(AccessConfig.getWpmap().containsKey(wp.getId()))
+                        {
+                            jr_fj_ts=jr_fj_ts + wp.getQuantity();
+                        }
                     }
 
                 }
+
+
+
+                Map<String,Double> newpointmap=new HashMap<>();
+
+                newpointmap.put("fd_zjrl",StringUtils.round(fd_zjrl,2));
+                newpointmap.put("gf_zjrl",StringUtils.round(gf_zjrl,2));
+                newpointmap.put("qjny_fj_ts",StringUtils.round(qjny_fj_ts,2));
+                newpointmap.put("qjny_gf_zcts",StringUtils.round(qjny_gf_zcts,2));
+                newpointmap.put("qjny_gf_jzts",StringUtils.round(qjny_gf_jzts,2));
+                newpointmap.put("jr_fj_ts",StringUtils.round(jr_fj_ts,2));
+                newpointmap.put("jr_gf_zcts",StringUtils.round(jr_gf_zcts,2));
+                newpointmap.put("jr_gf_jzts",StringUtils.round(jr_gf_jzts,2));
+                newpointmap.put("fd_r_ycdl",StringUtils.round(fd_r_ycdl,2));
+                newpointmap.put("fd_y_ycdl",StringUtils.round(fd_y_ycdl,2));
+                newpointmap.put("gf_r_ycdl",StringUtils.round(gf_r_ycdl,2));
+                newpointmap.put("gf_y_ycdl",StringUtils.round(gf_y_ycdl,2));
+                map.put("newpointmap",newpointmap);
 //                for (Windpowerstation wp : wplist) {
 //
 //                    if (StringUtils.notEmp(wp.getCompanyid()) && sftjmap.containsKey(wp.getCompanyid() + "_zjrl")) {

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

@@ -219,6 +219,27 @@ ztconfig:
       - A
     SY_GDC_DNLB:
       - A
+accesslist:
+  wpmap:
+    GJY_FDC: GJY_FDC
+    BHB3_FDC: BHB3_FDC
+    BHB_FDC: BHB_FDC
+    DJY_FDC: DJY_FDC
+    HSM_FDC: HSM_FDC
+    NJL_FDC: NJL_FDC
+    PDL_FDC: PDL_FDC
+    PTZ_FDC: PTZ_FDC
+    SY_GDC: SY_GDC
+    XWT_FDC: XWT_FDC
+    YF_FDC: YF_FDC
+    YLZ_FDC: YLZ_FDC
+    YTY_FDC: YTY_FDC
+    ZK_FDC: ZK_FDC
+
+
+
+
+
 #mysql 8.0
 
 #spring: