xieshengjie 2 роки тому
батько
коміт
35034e10d6
21 змінених файлів з 4049 додано та 42 видалено
  1. 20 0
      cache/src/main/java/com/gyee/cache/controller/CompanysController.java
  2. 8 4
      cache/src/main/java/com/gyee/cache/init/CacheContext.java
  3. 16 0
      cache/src/main/java/com/gyee/cache/mapper/auto/CompanysMapper.java
  4. 28 0
      cache/src/main/java/com/gyee/cache/model/auto/Companys.java
  5. 16 0
      cache/src/main/java/com/gyee/cache/service/auto/ICompanysService.java
  6. 20 0
      cache/src/main/java/com/gyee/cache/service/auto/impl/CompanysServiceImpl.java
  7. 6 1
      common/src/main/java/com/gyee/common/contant/ContantXk.java
  8. 1 1
      realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java
  9. 16 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/initalcache/CacheService.java
  10. 3793 0
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java
  11. 0 30
      realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/TheoreticalPowerService.java
  12. 3 2
      realtime/generationXK-service/src/main/resources/application-dev.yml
  13. 1 1
      realtime/generationXK-service/src/main/resources/application.yml
  14. 8 0
      realtime/generationregion-service/pom.xml
  15. 20 0
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/controller/CompanysController.java
  16. 8 2
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/init/CacheContext.java
  17. 16 0
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/mapper/auto/CompanysMapper.java
  18. 28 0
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/model/auto/Companys.java
  19. 3 1
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/service/RegionRealtimeService.java
  20. 17 0
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/service/auto/ICompanysService.java
  21. 21 0
      realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/service/auto/impl/CompanysServiceImpl.java

+ 20 - 0
cache/src/main/java/com/gyee/cache/controller/CompanysController.java

@@ -0,0 +1,20 @@
+package com.gyee.cache.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+@RestController
+@RequestMapping("//companys")
+public class CompanysController {
+
+}

+ 8 - 4
cache/src/main/java/com/gyee/cache/init/CacheContext.java

@@ -14,6 +14,7 @@ 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;
@@ -67,6 +68,8 @@ public class CacheContext implements CommandLineRunner {
     private IModelpowerService modelpowerService;
     @Autowired
     private IRegionsService regionsService;
+    @Resource
+    private ICompanysService companysService;
 
 
 
@@ -352,10 +355,11 @@ public class CacheContext implements CommandLineRunner {
         List<Windpowerstation> wpList = windpowerstationService.list();
         List<String> wpids = wpList.stream().map(i -> i.getId()).collect(Collectors.toList());
         List<Regions> regions = regionsService.list();
-        regions.stream().forEach(region -> {
-            wpids.add(region.getId()+"0");
-            wpids.add(region.getId()+"-1");
-            wpids.add(region.getId()+"-2");
+        List<Companys> companyList = companysService.list();
+        companyList.stream().forEach(company -> {
+            wpids.add(company.getId()+"0");
+            wpids.add(company.getId()+"-1");
+            wpids.add(company.getId()+"-2");
         });
         wpids.add("QY0");
         wpids.add("QY-1");

+ 16 - 0
cache/src/main/java/com/gyee/cache/mapper/auto/CompanysMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.cache.mapper.auto;
+
+import com.gyee.cache.model.auto.Companys;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+public interface CompanysMapper extends BaseMapper<Companys> {
+
+}

+ 28 - 0
cache/src/main/java/com/gyee/cache/model/auto/Companys.java

@@ -0,0 +1,28 @@
+package com.gyee.cache.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Companys extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String name;
+
+    private String rid;
+
+
+}

+ 16 - 0
cache/src/main/java/com/gyee/cache/service/auto/ICompanysService.java

@@ -0,0 +1,16 @@
+package com.gyee.cache.service.auto;
+
+import com.gyee.cache.model.auto.Companys;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+public interface ICompanysService extends IService<Companys> {
+
+}

+ 20 - 0
cache/src/main/java/com/gyee/cache/service/auto/impl/CompanysServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.cache.service.auto.impl;
+
+import com.gyee.cache.model.auto.Companys;
+import com.gyee.cache.mapper.auto.CompanysMapper;
+import com.gyee.cache.service.auto.ICompanysService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+@Service
+public class CompanysServiceImpl extends ServiceImpl<CompanysMapper, Companys> implements ICompanysService {
+
+}

+ 6 - 1
common/src/main/java/com/gyee/common/contant/ContantXk.java

@@ -24,6 +24,7 @@ public class ContantXk {
     public static final String  RFDL= "RFDL";//日发电量
     public static final String  RKYDL= "RKYDL";//日可用电量
     public static final String  RLLFDL= "RLLFDL";//日理论发电量
+    public static final String  RLLFDLZS= "RLLFDLZS"; //日理论发电量自算
     public static final String  RGZSSDL= "RGZSSDL";//日故障损失电量
     public static final String  RCNSLGZSSDL= "RCNSLGZSSDL";//日场内受累故障损失电量
     public static final String  RJXSSDL= "RJXSSDL";//日检修损失电量
@@ -43,6 +44,7 @@ public class ContantXk {
     public static final String  YFDL= "YFDL";//月发电量
     public static final String  YKYDL= "YKYDL";//月可用电量
     public static final String  YLLFDL= "YLLFDL";//月理论发电量
+    public static final String  YLLFDLZS= "YLLFDLZS";//月理论发电量自算
     public static final String  YGZSSDL= "YGZSSDL";//月故障损失电量
     public static final String  YCNSLGZSSDL= "YCNSLGZSSDL";//月场内受累故障损失电量
     public static final String  YJXSSDL= "YJXSSDL";//月检修损失电量
@@ -62,6 +64,7 @@ public class ContantXk {
     public static final String  NFDL= "NFDL";//年发电量
     public static final String  NKYDL= "NKYDL";//年可用电量
     public static final String  NLLFDL= "NLLFDL";//年理论发电量
+    public static final String  NLLFDLZS= "NLLFDLZS";//年理论发电量
     public static final String  NGZSSDL= "NGZSSDL";//年故障损失电量
     public static final String  NCNSLGZSSDL= "NCNSLGZSSDL";//年场内受累故障损失电量
     public static final String  NJXSSDL= "NJXSSDL";//年检修损失电量
@@ -81,6 +84,7 @@ public class ContantXk {
     public static final String  FDL15= "FDL15";//15分钟发电量
     public static final String  KYDL15= "KYDL15";//15分钟可用电量
     public static final String  LLFDL15= "LLFDL15";//15分钟理论发电量
+    public static final String  LLFDL15ZS= "LLFDL15ZS";//15分钟理论发电量
     public static final String  GZSSDL15= "GZSSDL15";//15分钟故障损失电量
     public static final String  CNSLGZSSDL15= "CNSLGZSSDL15";//15分钟场内受累故障损失电量
     public static final String  JXSSDL15= "JXSSDL15";//15分钟检修损失电量
@@ -156,7 +160,8 @@ public class ContantXk {
     public static final String  CJ_FDZTXZSGD= "AI061";//发电状态下的转速给定
     public static final String  CJ_SCADA_YGSD= "AI003";//scada有功设定值
     public static final String  CJ_YLZSGD= "AI110";//叶轮转速给定
-
+    public static final String  CJ_FDL= "AI121";//发电量
+    public static final String  CJ_DWGL = "AI056";  //电网功率
 
     public static final String TPOINT_WP_AGC = "AGC002";// agc
     public static final String TPOINT_WP_CXGL = "AGC001";// 出线功率SSFS

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -151,7 +151,7 @@ public class CacheContext implements CommandLineRunner {
             }
         }
 
-        cpls=proBasicCompanyService.list().stream().filter(i->i.getIsAble()==1).collect(Collectors.toList());
+        cpls=proBasicCompanyService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
         if (!cpls.isEmpty())
         {
             for(ProBasicCompany sq:cpls)

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

@@ -30,6 +30,8 @@ public class CacheService {
     private IProBasicLineService lineService;
     @Autowired
     private IProBasicProjectService projectService;
+    @Resource
+    private IProBasicSubStationService subStationService;
     @Autowired
     private IProBasicPowerstationService windpowerstationService;
     @Autowired
@@ -87,6 +89,20 @@ public class CacheService {
             redisService.set(i.getId(),s);
         });
 
+        log.info("--------------------------redisSubWP");
+        List<ProBasicSubStation> subStationList = subStationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        subStationList.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());
 

Різницю між файлами не показано, бо вона завелика
+ 3793 - 0
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CycleCalculationService.java


+ 0 - 30
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/TheoreticalPowerService.java

@@ -52,35 +52,5 @@ public class TheoreticalPowerService {
         CacheContext.curveFittingPowerMap = resultMap;
     }
 
-    /**
-     * 实时存储理论,保证,自算,最优,可用
-     */
-    public void saveWtRealTheoreticalPower(){
-
-        Date currentDate = DateUtils.getCurrentDate();
-
-        List<ProBasicEquipment> wtls = CacheContext.wtls;
-        Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
-        wtls.stream().forEach(wt->{
-            Map<String, ProBasicEquipmentPoint> basicEquipmentPointMap = wtpAimap.get(wt.getId());
-            //理论功率测点
-            ProBasicEquipmentPoint llglPoint = basicEquipmentPointMap.get(ContantXk.LLGL);
-            //保证功率测点
-            ProBasicEquipmentPoint bzglPoint = basicEquipmentPointMap.get(ContantXk.BZGL);
-            //自算功率测点
-            ProBasicEquipmentPoint zsglPoint = basicEquipmentPointMap.get(ContantXk.ZSGL);
-            //最优功率测点
-            ProBasicEquipmentPoint zyglPoint = basicEquipmentPointMap.get(ContantXk.ZYGL);
-            //可用功率测点
-            ProBasicEquipmentPoint kyglPoint = basicEquipmentPointMap.get(ContantXk.KYGL);
-
-
-
 
-
-
-
-        });
-
-    }
 }

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

@@ -36,7 +36,7 @@ spring:
     #    url: jdbc:postgresql://192.168.11.248:5432/eng_mctl
     #    username: postgres
     #    password: postgres
-    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM
+    url: jdbc:postgresql://192.168.11.248:5432/IMS_NEM_SD
     username: postgres
     password: postgres
     oracle-schema=:
@@ -88,7 +88,7 @@ logging:
 db:
   url: http://localhost:8011/ts
 #参与计算的场站
-runWindpowerstation: HN_GDDL_HZJ_GDC_STA,HN_GDDL_MHS_FDC_STA,HN_LYDL_MCH_GDC_STA,HN_LYDL_NSS_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
 #计算状态用ai或者di
 clauStatus:
   ai: GJY03_GC,YLZ01_GC,PTZ02_GC   #配置期次
@@ -108,6 +108,7 @@ curvefitting:
   scale: 0.01
 shutdown:
   keystr: test1,test2
+initialcode: INITIAL
 
 
 

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

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

+ 8 - 0
realtime/generationregion-service/pom.xml

@@ -88,6 +88,14 @@
             <groupId>org.postgresql</groupId>
             <artifactId>postgresql</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.data</groupId>
+            <artifactId>spring-data-redis</artifactId>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 20 - 0
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/controller/CompanysController.java

@@ -0,0 +1,20 @@
+package com.gyee.regionrealtime.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+@RestController
+@RequestMapping("//companys")
+public class CompanysController {
+
+}

+ 8 - 2
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/init/CacheContext.java

@@ -3,9 +3,11 @@ package com.gyee.regionrealtime.init;
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
+import com.gyee.regionrealtime.model.auto.Companys;
 import com.gyee.regionrealtime.model.auto.Regions;
 import com.gyee.regionrealtime.model.auto.Windpowerstation;
 import com.gyee.regionrealtime.model.auto.Windpowerstationpointnew;
+import com.gyee.regionrealtime.service.auto.ICompanysService;
 import com.gyee.regionrealtime.service.auto.IRegionsService;
 import com.gyee.regionrealtime.service.auto.IWindpowerstationService;
 import com.gyee.regionrealtime.util.redis.RedisService;
@@ -33,6 +35,9 @@ public class CacheContext implements CommandLineRunner {
     private IWindpowerstationService windpowerstationService;
     @Resource
     private IRegionsService regionsService;
+    @Resource
+    private ICompanysService companysService;
+
 
     @Resource
     private RedisService redisService;
@@ -43,6 +48,7 @@ public class CacheContext implements CommandLineRunner {
 
     public static List<Windpowerstation> wpls = new ArrayList<>();
     public static List<Regions> regions = new ArrayList<>();
+    public static List<Companys> companys = new ArrayList<>();
 
     @Override
     public void run(String... args) throws Exception {
@@ -51,8 +57,8 @@ public class CacheContext implements CommandLineRunner {
         wpls = windpowerstationService.list();
 
         regions = regionsService.list();
-
-        regions.stream().forEach(region -> {
+        companys = companysService.list();
+        companys.stream().forEach(region -> {
             String region0 = region.getId() + "0";
             String region1 = region.getId() + "-1";
             String region2 = region.getId() + "-2";

+ 16 - 0
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/mapper/auto/CompanysMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.regionrealtime.mapper.auto;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.regionrealtime.model.auto.Companys;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+public interface CompanysMapper extends BaseMapper<Companys> {
+
+}

+ 28 - 0
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/model/auto/Companys.java

@@ -0,0 +1,28 @@
+package com.gyee.regionrealtime.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Companys extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String name;
+
+    private String rid;
+
+
+}

+ 3 - 1
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/service/RegionRealtimeService.java

@@ -4,6 +4,7 @@ import com.gyee.common.contant.Contant;
 import com.gyee.common.model.PointData;
 import com.gyee.common.util.DateUtils;
 import com.gyee.regionrealtime.init.CacheContext;
+import com.gyee.regionrealtime.model.auto.Companys;
 import com.gyee.regionrealtime.model.auto.Regions;
 import com.gyee.regionrealtime.model.auto.Windpowerstation;
 import com.gyee.regionrealtime.model.auto.Windpowerstationpointnew;
@@ -33,12 +34,13 @@ public class RegionRealtimeService {
     public void regionRealtime(String type) throws Exception {
         List<PointData> resultList = new ArrayList<>();
         List<Regions> regions = CacheContext.regions;
+        List<Companys> companys = CacheContext.companys;
         List<Windpowerstation> wpls = CacheContext.wpls;
         Map<String, Map<String, Windpowerstationpointnew>> wppointmap = CacheContext.wppointmap;
         Date samedayZero = DateUtils.getSamedayZero();
         Date addDays = DateUtils.addDays(samedayZero, 1);
 
-        regions.stream().forEach(region -> {
+        companys.stream().forEach(region -> {
             List<Windpowerstation> windpowerstations = wpls.stream().filter(wp -> wp.getCompanyid().equals(region.getId())).collect(Collectors.toList());
             Map<String, Windpowerstationpointnew> regionMap = wppointmap.get(region.getId()+type);
             if (type.equals("-1")){

+ 17 - 0
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/service/auto/ICompanysService.java

@@ -0,0 +1,17 @@
+package com.gyee.regionrealtime.service.auto;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.regionrealtime.model.auto.Companys;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+public interface ICompanysService extends IService<Companys> {
+
+}

+ 21 - 0
realtime/generationregion-service/src/main/java/com/gyee/regionrealtime/service/auto/impl/CompanysServiceImpl.java

@@ -0,0 +1,21 @@
+package com.gyee.regionrealtime.service.auto.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.regionrealtime.mapper.auto.CompanysMapper;
+import com.gyee.regionrealtime.model.auto.Companys;
+import com.gyee.regionrealtime.service.auto.ICompanysService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-11-09
+ */
+@Service
+public class CompanysServiceImpl extends ServiceImpl<CompanysMapper, Companys> implements ICompanysService {
+
+}