Browse Source

Merge remote-tracking branch 'origin/master'

wangchangsheng 2 years ago
parent
commit
8682c7e8ae

+ 1 - 0
common/src/main/java/com/gyee/common/vo/benchmark/FjjxbVo.java

@@ -26,4 +26,5 @@ public class FjjxbVo  implements Serializable  {
     private Double xn;  //性能
     private Double fnlly;   //风能利用率
     private Double point;
+    private Integer ordernum;
 }

+ 1 - 0
common/src/main/java/com/gyee/common/vo/benchmark/FjjxbmxVo.java

@@ -33,4 +33,5 @@ public class FjjxbmxVo implements Serializable {
     private Double xn4;   //缺陷降出
     private Double fnlly;   //风能利用率
     private Double point;
+    private Integer ordernum;
 }

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/controller/ProBasicWeatherStationController.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 气象站名称 前端控制器
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-29
+ */
+@RestController
+@RequestMapping("//pro-basic-weather-station")
+public class ProBasicWeatherStationController {
+
+}

+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/mapper/auto/ProBasicWeatherStationMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.generation.mapper.auto;
+
+import com.gyee.generation.model.auto.ProBasicWeatherStation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 气象站名称 Mapper 接口
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-29
+ */
+public interface ProBasicWeatherStationMapper extends BaseMapper<ProBasicWeatherStation> {
+
+}

+ 80 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/model/auto/ProBasicWeatherStation.java

@@ -0,0 +1,80 @@
+package com.gyee.generation.model.auto;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 气象站名称
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProBasicWeatherStation extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    private String id;
+
+    /**
+     * 编码
+     */
+    private String nemCode;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 别名
+     */
+    private String aname;
+
+    /**
+     * 风场编号
+     */
+    private String windpowerstationId;
+
+    /**
+     * 顺序
+     */
+    private Integer orderNum;
+
+    /**
+     * 是否可用
+     */
+    private Integer isAble;
+
+    /**
+     * 备用1
+     */
+    private String spare1;
+
+    /**
+     * 备用2
+     */
+    private String spare2;
+
+    /**
+     * 备用3
+     */
+    private String spare3;
+
+    /**
+     * 备用4
+     */
+    private String spare4;
+
+    private BigDecimal capacity;
+
+
+}

+ 16 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/IProBasicWeatherStationService.java

@@ -0,0 +1,16 @@
+package com.gyee.generation.service.auto;
+
+import com.gyee.generation.model.auto.ProBasicWeatherStation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 气象站名称 服务类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-29
+ */
+public interface IProBasicWeatherStationService extends IService<ProBasicWeatherStation> {
+
+}

+ 20 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/auto/impl/ProBasicWeatherStationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.generation.service.auto.impl;
+
+import com.gyee.generation.model.auto.ProBasicWeatherStation;
+import com.gyee.generation.mapper.auto.ProBasicWeatherStationMapper;
+import com.gyee.generation.service.auto.IProBasicWeatherStationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 气象站名称 服务实现类
+ * </p>
+ *
+ * @author shilin
+ * @since 2022-11-29
+ */
+@Service
+public class ProBasicWeatherStationServiceImpl extends ServiceImpl<ProBasicWeatherStationMapper, ProBasicWeatherStation> implements IProBasicWeatherStationService {
+
+}

+ 32 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java

@@ -47,6 +47,10 @@ public class CacheService {
     private IProBasicModelPowerRdService proBasicModelPowerRdService;
     @Resource
     private IProBasicStatusPointService proBasicStatusPointService;
+    @Resource
+    private IProBasicWeatherStationService proBasicWeatherStationService;
+    @Resource
+    private IProBasicSquareService proBasicSquareService;
 
 
     public void initRedisCache(){
@@ -64,6 +68,20 @@ public class CacheService {
             redisService.set(i.getId(),s);
         });
 
+        log.info("--------------------------redisSQ");
+        List<ProBasicSquare> squareList = proBasicSquareService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        squareList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
         log.info("--------------------------redisLN");
         List<ProBasicLine> lineList = lineService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
         lineList.stream().forEach(i->{
@@ -106,6 +124,20 @@ public class CacheService {
             redisService.set(i.getId(),s);
         });
 
+        log.info("--------------------------redisWeatherWP");
+        List<ProBasicWeatherStation> weatherStationList = proBasicWeatherStationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        weatherStationList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i.getId());
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i.getId(),s);
+        });
+
         log.info("--------------------------redisWP");
         List<ProBasicPowerstation> wpList = windpowerstationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
 

+ 29 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/AccessStatusService.java

@@ -0,0 +1,29 @@
+package com.gyee.generation.service.realtimelibrary;
+/*
+@author   谢生杰
+@date   2022/11/29-9:56
+*/
+
+import com.gyee.generation.init.CacheContext;
+import com.gyee.generation.model.auto.ProBasicMeterPoint;
+import com.gyee.generation.model.auto.ProBasicPowerstation;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class AccessStatusService {
+
+    public void accessStatus(){
+
+
+        Map<String, ProBasicMeterPoint> meterpointMap = CacheContext.meterpointMap;
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
+
+        wpls.stream().forEach(wp->{
+
+        });
+
+    }
+}

+ 8 - 7
realtime/generationXK-service/src/main/resources/application-dev.yml

@@ -1,5 +1,5 @@
 server:
-  port: 7012
+  port: 7011
   servlet:
     context-path: /
 
@@ -9,6 +9,7 @@ spring:
     allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
   #redis集群
   redis:
+#    host: 124.70.18.168
     host: 192.168.11.250
     port: 6379
     timeout: 100000
@@ -33,12 +34,12 @@ spring:
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: org.postgresql.Driver
-    #    url: jdbc:postgresql://192.168.11.248:5432/eng_mctl
-    #    username: postgres
-    #    password: postgres
-    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD
+    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD?rewriteBatchedStatements=true
     username: postgres
     password: postgres
+#    url: jdbc:postgresql://124.70.75.91:5432/jn_test
+#    username: postgres
+#    password: gd123
     oracle-schema=:
     #    type: com.alibaba.druid.pool.DruidDataSource
     #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
@@ -86,10 +87,10 @@ logging:
     com.example: debug
 #db url
 db:
+#  url: http://127.0.0.1:8011/ts
   url: http://192.168.11.250:8011/ts
 #参与计算的场站
-#runWindpowerstation: SD_GDDL_RZLX_FDC_STA
-runWindpowerstation: SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_GDDL_BH1_FDC_STA,SD_GDDL_BH2_FDC_STA,SD_GDDL_CG_FDC_STA,SD_GDDL_FJ_FDC_STA,SD_GDDL_YS_FDC_STA,SD_GDDL_FXFC_FDC_STA,SD_GDDL_JNSS_FDC_STA,SD_GDDL_WFBH_FDC_STA,SD_GDDL_PLHS_FDC_STA,SD_GDDL_JNCQ_FDC_STA,SD_GDDL_LXLN_FDC_STA,SD_GDDL_LQJS_FDC_STA,SD_GDDL_ZYXD_FDC_STA,SD_GDDL_ZYFS_FDC_STA
+runWindpowerstation: SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_LYDL_BH1_FDC_STA,SD_LYDL_BH2_FDC_STA,SD_LYDL_CG_FDC_STA,SD_LYDL_FJ_FDC_STA,SD_LYDL_YS_FDC_STA,SD_SXNY_FXFC_FDC_STA,SD_SXNY_JNSS_FDC_STA,SD_SXNY_WFBH_FDC_STA,SD_SXNY_PLHS_FDC_STA,SD_SXNY_JNCQ_FDC_STA,SD_SXNY_LXLN_FDC_STA,SD_SXNY_LQJS_FDC_STA,SD_SXNY_ZYXD_FDC_STA,SD_SXNY_ZYFS_FDC_STA,SD_GHTZ_HZJ_GDC_STA
 #计算状态用ai或者di
 clauStatus:
   ai: GJY03_GC,YLZ01_GC,PTZ02_GC   #配置期次

+ 1 - 2
realtime/generationXK-service/src/main/resources/application-xk.yml

@@ -90,8 +90,7 @@ db:
   url: http://127.0.0.1:8011/ts
   #url: http://192.168.11.250:8011/ts
 #参与计算的场站
-#runWindpowerstation: SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_GDDL_BH1_FDC_STA,SD_GDDL_BH2_FDC_STA,SD_GDDL_CG_FDC_STA,SD_GDDL_FJ_FDC_STA,SD_GDDL_YS_FDC_STA,SD_GDDL_FXFC_FDC_STA,SD_GDDL_JNSS_FDC_STA,SD_GDDL_WFBH_FDC_STA,SD_GDDL_PLHS_FDC_STA,SD_GDDL_JNCQ_FDC_STA,SD_GDDL_LXLN_FDC_STA,SD_GDDL_LQJS_FDC_STA,SD_GDDL_ZYXD_FDC_STA,SD_GDDL_ZYFS_FDC_STA
-runWindpowerstation: SD_GDDL_RZLX_FDC_STA
+runWindpowerstation: SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_LYDL_BH1_FDC_STA,SD_LYDL_BH2_FDC_STA,SD_LYDL_CG_FDC_STA,SD_LYDL_FJ_FDC_STA,SD_LYDL_YS_FDC_STA,SD_SXNY_FXFC_FDC_STA,SD_SXNY_JNSS_FDC_STA,SD_SXNY_WFBH_FDC_STA,SD_SXNY_PLHS_FDC_STA,SD_SXNY_JNCQ_FDC_STA,SD_SXNY_LXLN_FDC_STA,SD_SXNY_LQJS_FDC_STA,SD_SXNY_ZYXD_FDC_STA,SD_SXNY_ZYFS_FDC_STA,SD_GHTZ_HZJ_GDC_STA
 #计算状态用ai或者di
 clauStatus:
   ai: GJY03_GC,YLZ01_GC,PTZ02_GC   #配置期次

+ 2 - 2
realtime/generationXK-service/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: xk
-#    active: dev
+#    active: xk
+    active: dev
 
 #    active: td

+ 2 - 2
realtime/pom.xml

@@ -12,7 +12,7 @@
     <artifactId>realtime</artifactId>
     <packaging>pom</packaging>
     <modules>
-        <module>failurestatistics-server</module>
+<!--        <module>failurestatistics-server</module>-->
         <module>meteorologicalcollection</module>
         <module>datatraining-server</module>
         <module>healthmodel-server</module>
@@ -20,7 +20,7 @@
         <module>generationTD-service</module>
         <module>generationGF-service</module>
         <module>generationGFTD-service</module>
-        <module>failurestatistics-server-cph</module>
+<!--        <module>failurestatistics-server-cph</module>-->
         <module>datatraining-server-cph</module>
         <module>healthmodel-server-cph</module>
         <module>generationregion-service</module>

+ 14 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java

@@ -140,15 +140,19 @@ public class BenchmarkingService {
             if (sttype.equals("1")){
                 vo.setId(i.getWindpowerstationId());
                 vo.setName(CacheContext.wpmap.get(i.getWindpowerstationId().trim()).getName());
+                vo.setOrdernum(CacheContext.wpmap.get(i.getWindpowerstationId().trim()).getOrderNum());
             }else if(sttype.equals("2")){
                 vo.setId(i.getProjectId());
                 vo.setName(CacheContext.pjmap.get(i.getProjectId().trim()).getName());
+                vo.setOrdernum(CacheContext.pjmap.get(i.getProjectId().trim()).getOrderNum());
             }else if(sttype.equals("3")){
                 vo.setId(i.getLineId());
                 vo.setName(CacheContext.lnmap.get(i.getLineId().trim()).getName());
+                vo.setOrdernum(CacheContext.lnmap.get(i.getLineId().trim()).getOrderNum());
             }else{
                 vo.setId(i.getWindturbineId());
                 vo.setName(CacheContext.wtmap.get(i.getWindturbineId().trim()).getName());
+                vo.setOrdernum(CacheContext.wtmap.get(i.getWindturbineId().trim()).getOrderNum());
             }
             vo.setSjfdl(BigDecimalUtils.divide(new BigDecimal(i.getRfdl()),new BigDecimal(10000),2).doubleValue());
             vo.setLlfdl(BigDecimalUtils.divide(new BigDecimal(i.getRllfdl()),new BigDecimal(10000),2).doubleValue());
@@ -173,6 +177,7 @@ public class BenchmarkingService {
             sl.updateAndGet(v -> new Double((double) (v + vo.getSl())));
             resultList.add(vo);
         });
+        SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
         FjjxbVo vo = new FjjxbVo();
         vo.setId("hj");
         vo.setName("合计");
@@ -260,15 +265,19 @@ public class BenchmarkingService {
             if (sttype.equals("1")){
                 vo.setId(i.getWindpowerstationId());
                 vo.setName(CacheContext.wpmap.get(i.getWindpowerstationId().trim()).getName());
+                vo.setOrdernum(CacheContext.wpmap.get(i.getWindpowerstationId().trim()).getOrderNum());
             }else if(sttype.equals("2")){
                 vo.setId(i.getProjectId());
                 vo.setName(CacheContext.pjmap.get(i.getProjectId().trim()).getName());
+                vo.setOrdernum(CacheContext.pjmap.get(i.getProjectId().trim()).getOrderNum());
             }else if(sttype.equals("3")){
                 vo.setId(i.getLineId());
                 vo.setName(CacheContext.lnmap.get(i.getLineId().trim()).getName());
+                vo.setOrdernum(CacheContext.lnmap.get(i.getLineId().trim()).getOrderNum());
             }else{
                 vo.setId(i.getWindturbineId());
                 vo.setName(CacheContext.wtmap.get(i.getWindturbineId().trim()).getName());
+                vo.setOrdernum(CacheContext.wtmap.get(i.getWindturbineId().trim()).getOrderNum());
             }
             vo.setSjfdl(DoubleUtils.keepPrecision(i.getRfdl()/10000,2));
             vo.setLlfdl(DoubleUtils.keepPrecision(i.getRllfdl()/10000,2));
@@ -304,6 +313,7 @@ public class BenchmarkingService {
             sl2.updateAndGet(v -> new Double((double) (v + vo.getSl2())));
             resultList.add(vo);
         });
+        SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
         FjjxbmxVo vo = new FjjxbmxVo();
         vo.setId("hj");
         vo.setName("合计");
@@ -588,7 +598,7 @@ public class BenchmarkingService {
                 SortUtils.sort(resultList,target,SortUtils.DESC);
             }
         }else {
-            SortUtils.sort(resultList,"fdl",SortUtils.ASC);
+            SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
         }
         return wxsslVoList;
     }
@@ -632,7 +642,7 @@ public class BenchmarkingService {
                 SortUtils.sort(resultList,target,SortUtils.DESC);
             }
         }else {
-            SortUtils.sort(resultList,"fdl",SortUtils.ASC);
+            SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
         }
         return wxsslVoList;
     }
@@ -739,7 +749,7 @@ public class BenchmarkingService {
         for (int i=0;i<resultList.size();i++){
             resultList.get(i).setSlsslpm(i+1);
         }
-
+        SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
         return resultList;
     }
 
@@ -766,7 +776,7 @@ public class BenchmarkingService {
                 SortUtils.sort(resultList,target,SortUtils.DESC);
             }
         }else {
-            SortUtils.sort(resultList,"fdl",SortUtils.ASC);
+            SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
         }
         return wxsslVoList;
     }