Jelajahi Sumber

宁夏风公司

王波 10 bulan lalu
induk
melakukan
7625f8b9b3
20 mengubah file dengan 542 tambahan dan 98 penghapusan
  1. 6 0
      .idea/vcs.xml
  2. 134 26
      .idea/workspace.xml
  3. 20 9
      runeconomy-xk/pom.xml
  4. 6 6
      runeconomy-xk/src/main/java/com/gyee/runeconomy/init/CacheContext.java
  5. 275 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/initalcache/CacheService.java
  6. 23 0
      runeconomy-xk/src/main/java/com/gyee/runeconomy/initalcache/test.java
  7. 2 1
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Forecast/ForecastService.java
  8. 8 8
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Windresourceanalysis/WindresourceanalysisService.java
  9. 3 2
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java
  10. 12 9
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java
  11. 3 2
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ComprehensiveService.java
  12. 9 8
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/LandformsService.java
  13. 6 5
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorService.java
  14. 3 2
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorprojectplanService.java
  15. 2 1
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorvalueService.java
  16. 2 1
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ProjectPlanService.java
  17. 6 3
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StatusService.java
  18. 10 7
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java
  19. 3 2
      runeconomy-xk/src/main/java/com/gyee/runeconomy/service/threerate/ThreeRateService.java
  20. 9 6
      runeconomy-xk/src/main/resources/application-yun.yml

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 134 - 26
.idea/workspace.xml

@@ -4,19 +4,51 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="c9251c3e-9f2f-4b6c-a5f7-503156fe13c0" name="Changes" comment="" />
+    <list default="true" id="c9251c3e-9f2f-4b6c-a5f7-503156fe13c0" name="Changes" comment="宁夏风公司">
+      <change afterPath="$PROJECT_DIR$/.idea/.gitignore" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/initalcache/CacheService.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/initalcache/test.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/pom.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/init/CacheContext.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/init/CacheContext.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Forecast/ForecastService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Forecast/ForecastService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Windresourceanalysis/WindresourceanalysisService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Windresourceanalysis/WindresourceanalysisService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ComprehensiveService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ComprehensiveService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/LandformsService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/LandformsService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorprojectplanService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorprojectplanService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorvalueService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorvalueService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ProjectPlanService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ProjectPlanService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StatusService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StatusService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/threerate/ThreeRateService.java" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/threerate/ThreeRateService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/runeconomy-xk/src/main/resources/application-yun.yml" beforeDir="false" afterPath="$PROJECT_DIR$/runeconomy-xk/src/main/resources/application-yun.yml" afterDir="false" />
+    </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
     <option name="LAST_RESOLUTION" value="IGNORE" />
   </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="Class" />
+      </list>
+    </option>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
   <component name="GitToolBoxStore">
     <option name="projectConfigVersion" value="5" />
   </component>
-  <component name="KubernetesApiPersistence"><![CDATA[{}]]></component>
-  <component name="KubernetesApiProvider"><![CDATA[{
-  "isMigrated": true
-}]]></component>
+  <component name="KubernetesApiPersistence">{}</component>
+  <component name="KubernetesApiProvider">{
+  &quot;isMigrated&quot;: true
+}</component>
   <component name="MarkdownSettingsMigration">
     <option name="stateVersion" value="1" />
   </component>
@@ -29,41 +61,77 @@
       </MavenGeneralSettings>
     </option>
   </component>
+  <component name="MavenRunner">
+    <option name="skipTests" value="true" />
+  </component>
   <component name="ProjectColorInfo">{
   &quot;associatedIndex&quot;: 1
 }</component>
   <component name="ProjectId" id="2iwn3jPr2YFMSRwqKgOLfEkwsXR" />
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
   <component name="ProjectViewState">
     <option name="autoscrollFromSource" value="true" />
     <option name="autoscrollToSource" value="true" />
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent"><![CDATA[{
-  "keyToString": {
-    "RequestMappingsPanelOrder0": "0",
-    "RequestMappingsPanelOrder1": "1",
-    "RequestMappingsPanelWidth0": "75",
-    "RequestMappingsPanelWidth1": "75",
-    "RunOnceActivity.OpenProjectViewOnStart": "true",
-    "RunOnceActivity.ShowReadmeOnStart": "true",
-    "Spring Boot.RunEconomyApplication.executor": "Debug",
-    "WebServerToolWindowFactoryState": "false",
-    "kotlin-language-version-configured": "true",
-    "last_opened_file_path": "D:/work/workspaces/sis",
-    "node.js.detected.package.eslint": "true",
-    "node.js.detected.package.tslint": "true",
-    "node.js.selected.package.eslint": "(autodetect)",
-    "node.js.selected.package.tslint": "(autodetect)",
-    "nodejs_package_manager_path": "npm",
-    "settings.editor.selected.configurable": "spring",
-    "vue.rearranger.settings.migration": "true"
+  <component name="PropertiesComponent">{
+  &quot;keyToString&quot;: {
+    &quot;JUnit.test.test1.executor&quot;: &quot;Debug&quot;,
+    &quot;Maven.common [clean].executor&quot;: &quot;Run&quot;,
+    &quot;Maven.common [compile].executor&quot;: &quot;Run&quot;,
+    &quot;Maven.common [package].executor&quot;: &quot;Run&quot;,
+    &quot;Maven.runeconomy-xk [clean].executor&quot;: &quot;Run&quot;,
+    &quot;Maven.runeconomy-xk [compile].executor&quot;: &quot;Run&quot;,
+    &quot;Maven.runeconomy-xk [package].executor&quot;: &quot;Run&quot;,
+    &quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
+    &quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
+    &quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
+    &quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
+    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
+    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
+    &quot;Spring Boot.RunEconomyApplication.executor&quot;: &quot;Debug&quot;,
+    &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
+    &quot;git-widget-placeholder&quot;: &quot;master&quot;,
+    &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
+    &quot;last_opened_file_path&quot;: &quot;D:/work/workspaces/runeconomy-nx&quot;,
+    &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
+    &quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
+    &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
+    &quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
+    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
+    &quot;settings.editor.selected.configurable&quot;: &quot;reference.settings.project.maven.repository.indices&quot;,
+    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
   }
-}]]></component>
+}</component>
   <component name="ReactorSettings">
     <option name="notificationShown" value="true" />
   </component>
+  <component name="RecentsManager">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\work\workspaces\runeconomy-nx\runeconomy-xk\src\main\java\com\gyee\runeconomy" />
+    </key>
+    <key name="CopyClassDialog.RECENTS_KEY">
+      <recent name="com.gyee.runeconomy.initalcache" />
+    </key>
+  </component>
   <component name="RunManager" selected="Spring Boot.RunEconomyApplication">
+    <configuration name="test.test1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
+      <module name="runeconomy-xk" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.gyee.runeconomy.initalcache.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <option name="PACKAGE_NAME" value="com.gyee.runeconomy.initalcache" />
+      <option name="MAIN_CLASS_NAME" value="com.gyee.runeconomy.initalcache.test" />
+      <option name="METHOD_NAME" value="test1" />
+      <option name="TEST_OBJECT" value="method" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration default="true" type="JetRunConfigurationType">
       <module name="runeconomy-nx" />
       <method v="2">
@@ -91,6 +159,11 @@
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <recent_temporary>
+      <list>
+        <item itemvalue="JUnit.test.test1" />
+      </list>
+    </recent_temporary>
   </component>
   <component name="SharedIndexes">
     <attachedChunks>
@@ -110,13 +183,48 @@
       <updated>1720410312095</updated>
       <workItem from="1720410313228" duration="3048000" />
       <workItem from="1720420026232" duration="1223000" />
-      <workItem from="1720421274226" duration="538000" />
+      <workItem from="1720421274226" duration="3826000" />
+      <workItem from="1720573941117" duration="16513000" />
+      <workItem from="1720660217604" duration="5841000" />
+      <workItem from="1720788195694" duration="597000" />
+      <workItem from="1721005075742" duration="4647000" />
+      <workItem from="1721110176692" duration="2709000" />
+      <workItem from="1721266032572" duration="3438000" />
+      <workItem from="1721609765138" duration="2308000" />
+      <workItem from="1721696474474" duration="586000" />
+      <workItem from="1722317965884" duration="4144000" />
+      <workItem from="1722406210722" duration="132000" />
+      <workItem from="1722999793754" duration="327000" />
     </task>
+    <task id="LOCAL-00001" summary="宁夏风公司">
+      <option name="closed" value="true" />
+      <created>1720423579183</created>
+      <option name="number" value="00001" />
+      <option name="presentableId" value="LOCAL-00001" />
+      <option name="project" value="LOCAL" />
+      <updated>1720423579183</updated>
+    </task>
+    <option name="localTasksCounter" value="2" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     <option name="version" value="3" />
   </component>
+  <component name="Vcs.Log.Tabs.Properties">
+    <option name="TAB_STATES">
+      <map>
+        <entry key="MAIN">
+          <value>
+            <State />
+          </value>
+        </entry>
+      </map>
+    </option>
+  </component>
+  <component name="VcsManagerConfiguration">
+    <MESSAGE value="宁夏风公司" />
+    <option name="LAST_COMMIT_MESSAGE" value="宁夏风公司" />
+  </component>
   <component name="XSLT-Support.FileAssociations.UIState">
     <expand />
     <select />

+ 20 - 9
runeconomy-xk/pom.xml

@@ -40,11 +40,12 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
         </dependency>
-<!--        <dependency>-->
-<!--            <groupId>org.springframework.boot</groupId>-->
-<!--            <artifactId>spring-boot-starter-test</artifactId>-->
-<!--            <scope>test</scope>-->
-<!--        </dependency>-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+            <version>2.3.7.RELEASE</version>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-websocket</artifactId>
@@ -55,9 +56,9 @@
             <optional>true</optional>
         </dependency>
         <dependency>
-            <groupId>org.example</groupId>
+            <groupId>com.gyee</groupId>
             <artifactId>common</artifactId>
-            <version>${project.version}</version>
+            <version>1.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.alibaba</groupId>
@@ -156,8 +157,18 @@
             <artifactId>feign-jackson</artifactId>
             <version>11.8</version>
         </dependency>
-
-
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-test</artifactId>
+        </dependency>
 
 
     </dependencies>

+ 6 - 6
runeconomy-xk/src/main/java/com/gyee/runeconomy/init/CacheContext.java

@@ -81,7 +81,7 @@ public class CacheContext implements CommandLineRunner {
     @Resource
     private IProBasicPowerstationService windpowerstationService;
 
-    public static List<ProBasicBranch> bnls = new ArrayList<>();
+//    public static List<ProBasicBranch> bnls = new ArrayList<>();
     public static List<ProBasicEquipment> wtls = new ArrayList<>();
     public static List<ProBasicProject> pjls = new ArrayList<>();
     public static List<ProBasicLine> lnls = new ArrayList<>();
@@ -107,7 +107,7 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, List<ProBasicPowerstation>> cpwpmap = new HashMap<>();
     public static Map<String, List<ProBasicPowerstation>> wpmapls = new HashMap<>();
     public static Map<String, List<ProBasicPowerstation>> stationls = new HashMap<>();
-    public static Map<String, List<ProBasicBranch>> wtbnmap = new HashMap<>();
+//    public static Map<String, List<ProBasicBranch>> wtbnmap = new HashMap<>();
     public static Map<String, List<ProBasicCompany>> rgcpmap = new HashMap<>();
     public static Map<String, ProBasicSquare> sqmap = new HashMap<>();
     public static Map<String, ProBasicPowerstation> wpmap = new HashMap<>();
@@ -123,7 +123,7 @@ public class CacheContext implements CommandLineRunner {
     public static Map<String, List<ProBasicEquipment>> rgwtlsmap = new HashMap<>();
     public static Map<String, Map<String, ProBasicEquipment>> cmwtmap = new HashMap<>();
     public static Map<String, List<ProBasicEquipment>> sqwtmap = new HashMap<>();
-    public static Map<String, Map<String, ProBasicEquipmentPoint>> bnAimap = new HashMap<>();
+//    public static Map<String, Map<String, ProBasicEquipmentPoint>> bnAimap = new HashMap<>();
     public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = new HashMap<>();// 风电机测点AI表
     public static Map<String, Map<String, ProBasicEquipmentPoint>> wtpointmap = new HashMap<>();//风机测点
     public static Map<String, Map<String, ProBasicPowerstationPoint>> linepointmap = new HashMap<>();
@@ -540,9 +540,9 @@ public class CacheContext implements CommandLineRunner {
                 if (wp.getId().endsWith("FDC_STA")) {
                     wplsf.add(wp);
                 }
-                if (wp.getId().endsWith("GDC_STA")) {
-                    wplsG.add(wp);
-                }
+//                if (wp.getId().endsWith("GDC_STA")) {
+//                    wplsG.add(wp);
+//                }
 
                 if (wpmapls.containsKey(wp.getId())) {
                     List<ProBasicPowerstation> ls = wpmapls.get(wp.getId());

+ 275 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/initalcache/CacheService.java

@@ -0,0 +1,275 @@
+package com.gyee.runeconomy.initalcache;/*
+@author   谢生杰
+@date   2022/11/3-9:14
+*/
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
+import com.gyee.runeconomy.model.auto.*;
+import com.gyee.runeconomy.service.auto.*;
+import com.gyee.runeconomy.util.redis.RedisService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+@Slf4j
+public class CacheService {
+
+    @Autowired
+    private RedisService redisService;
+    @Autowired
+    private IProBasicEquipmentService windturbineService;
+    @Autowired
+    private IProBasicLineService lineService;
+    @Autowired
+    private IProBasicProjectService projectService;
+    @Resource
+    private IProBasicSubStationService subStationService;
+    @Autowired
+    private IProBasicPowerstationService windpowerstationService;
+    @Autowired
+    private IProBasicEquipmentPointService windturbinetestingpointnewService;
+    @Autowired
+    private IProBasicPowerstationPointService windpowerstationpointnewService;
+    @Autowired
+    private IProBasicCompanyService companyService;
+    @Autowired
+    private IProBasicRegionService regionsService;
+    @Resource
+    private IProBasicModelPowerRdService proBasicModelPowerRdService;
+    @Resource
+    private IProBasicStatusPointService proBasicStatusPointService;
+    @Resource
+    private IProBasicWeatherStationService proBasicWeatherStationService;
+    @Resource
+    private IProBasicSquareService proBasicSquareService;
+    @Resource
+    private IProBasicBranchService proBasicBranchService;
+    @Resource
+    private IProBasicEnergyGroupService energyGroupService;
+//    @Resource
+//    private IProBasicSubStationTestpointService proBasicSubStationTestpointService;
+
+    public void initRedisCache(){
+        redisService.select(10);
+        log.info("--------------------------redisWT");
+//        List<ProBasicEquipment> windturbineList = windturbineService.list().stream().filter(i->(
+//                i.getWindpowerstationId().equals("SXJ_KGDL_XWT_FDC_STA")
+//                        ||
+//                i.getWindpowerstationId().equals("SXJ_KGDL_GJY_FDC_STA") ||
+//                        i.getWindpowerstationId().equals("SXJ_KGDL_NJL_FDC_STA") ||
+//                        i.getWindpowerstationId().equals("SXJ_KGDL_PDL_FDC_STA")  ||
+//                        i.getWindpowerstationId().equals("SXJ_KGDL_ZK_FDC_STA")
+//        ) &&  i.getIsable().equals(1)).collect(Collectors.toList());
+
+        List<ProBasicEquipment> windturbineList = windturbineService.list().stream().filter(i-> i.getIsable().equals(1)).collect(Collectors.toList());
+
+        log.info("--------------------------windturbineList"+windturbineList.size());
+        windturbineList.stream().forEach(i->{
+            Map<String, ProBasicEquipmentPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicEquipmentPoint> qw = new QueryWrapper<>();
+            qw.eq("windturbine_id",i.getId());
+            List<ProBasicEquipmentPoint> windturbinetestingpointai2List = windturbinetestingpointnewService.list(qw);
+            log.info("--------------------------windturbinetestingpointai2List"+windturbinetestingpointai2List.size());
+            windturbinetestingpointai2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            log.info("--------------------------codeaimap"+codeaimap.size());
+            String s = JSONObject.toJSONString(codeaimap);
+            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->{
+            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("--------------------------redisPJ");
+        List<ProBasicProject> projectList = projectService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        projectList.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("--------------------------redisSubWP");
+//        redisService.select(9);
+//        List<ProBasicSubStation> subStationList = subStationService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+//        subStationList.stream().forEach(i->{
+//            Map<String, ProBasicSubStationTestpoint> codeaimap = new HashMap<>();
+//            QueryWrapper<ProBasicSubStationTestpoint> qw = new QueryWrapper<>();
+//            qw.eq("windpowerstation_id",i.getId());
+//            List<ProBasicSubStationTestpoint> windpowerstationtestingpoint2List = proBasicSubStationTestpointService.list(qw);
+//            windpowerstationtestingpoint2List.stream().forEach(x->{
+//                codeaimap.put(x.getUniformCode(),x);
+//            });
+//            String s = JSONObject.toJSONString(codeaimap);
+//            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());
+
+        wpList.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("--------------------------redisCOMPANY");
+        List<ProBasicCompany> coms = companyService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+//        List<String> comList = coms.stream().map(i->i.getId()).collect(Collectors.toList());
+        List<String> comList = new ArrayList<>();
+        coms.stream().forEach(company -> {
+            comList.add(company.getId()+"0");
+            comList.add(company.getId()+"-1");
+            comList.add(company.getId()+"-2");
+        });
+        comList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i);
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i,s);
+        });
+
+        log.info("--------------------------redisREGION");
+        List<ProBasicRegion> regs = regionsService.list().stream().filter(i->i.getIsAble().equals(1)).collect(Collectors.toList());
+        List<String> regList = new ArrayList<>();
+//        List<String> regList = regs.stream().map(i->i.getId()).collect(Collectors.toList());
+        regs.stream().forEach(region -> {
+            regList.add(region.getId()+"0");
+            regList.add(region.getId()+"-1");
+            regList.add(region.getId()+"-2");
+        });
+        regList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i);
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i,s);
+        });
+        log.info("--------------------------redisGroup");
+        List<ProBasicEnergyGroup> groups = energyGroupService.list().stream().filter(i->i.getIsAble().equals(1) && !i.getParentid().equals("0")).collect(Collectors.toList());
+        List<String> groupList = new ArrayList<>();
+//        List<String> regList = regs.stream().map(i->i.getId()).collect(Collectors.toList());
+        groups.stream().forEach(group -> {
+            groupList.add(group.getId()+"0");
+            groupList.add(group.getId()+"-1");
+            groupList.add(group.getId()+"-2");
+        });
+        groupList.stream().forEach(i->{
+            Map<String, ProBasicPowerstationPoint> codeaimap = new HashMap<>();
+            QueryWrapper<ProBasicPowerstationPoint> qw = new QueryWrapper<>();
+            qw.eq("windpowerstation_id",i);
+            List<ProBasicPowerstationPoint> windpowerstationtestingpoint2List = windpowerstationpointnewService.list(qw);
+            windpowerstationtestingpoint2List.stream().forEach(x->{
+                codeaimap.put(x.getUniformCode(),x);
+            });
+            String s = JSONObject.toJSONString(codeaimap);
+            redisService.set(i,s);
+        });
+        redisService.select(10);
+        log.info("--------------------------redis理论保证功率");
+        Map<String, Map<Double, ProBasicModelPowerRd>> powerrdMap = new HashMap<>();
+
+        List<ProBasicModelPowerRd> proBasicModelPowerRds = proBasicModelPowerRdService.list();
+        proBasicModelPowerRds.stream().forEach(powerrd->{
+            if (powerrdMap.containsKey(powerrd.getModelId())){
+                powerrdMap.get(powerrd.getModelId()).put(powerrd.getSpeed(),powerrd);
+            }else {
+                Map<Double,ProBasicModelPowerRd> powerMap = new HashMap<>();
+                powerMap.put(powerrd.getSpeed(),powerrd);
+                powerrdMap.put(powerrd.getModelId(),powerMap);
+            }
+        });
+        redisService.set("ZLLGL", JSONObject.toJSONString(powerrdMap));
+
+        log.info("--------------------------redis十三种状态");
+        Map<String, List<ProBasicStatusPoint>> sszztMap = new HashMap<>();
+        List<ProBasicStatusPoint> windturbinestatusdis = proBasicStatusPointService.list();
+        windturbinestatusdis.stream().forEach(w->{
+            if (sszztMap.containsKey(w.getWindturbineId())){
+                sszztMap.get(w.getWindturbineId()).add(w);
+            }else {
+                List<ProBasicStatusPoint> wdisList = new ArrayList<>();
+                wdisList.add(w);
+                sszztMap.put(w.getWindturbineId(),wdisList);
+            }
+        });
+        redisService.set("SSZZT", JSONObject.toJSONString(sszztMap));
+
+        log.info("--------------------------完成");
+    }
+}

+ 23 - 0
runeconomy-xk/src/main/java/com/gyee/runeconomy/initalcache/test.java

@@ -0,0 +1,23 @@
+package com.gyee.runeconomy.initalcache;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+
+@SpringBootTest
+@RunWith(SpringRunner.class)
+@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
+public class test {
+    @Resource
+    private CacheService cacheService;
+
+    @Test
+    public void test1() throws Exception {
+        cacheService.initRedisCache();
+    }
+}

+ 2 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Forecast/ForecastService.java

@@ -468,7 +468,8 @@ public class ForecastService {
 
 //        List<ProBasicPowerstation> wplLs = CacheContext.wpls;
 
-        List<ProBasicPowerstation> wplLs = tokenService.getWpls(request);
+//        List<ProBasicPowerstation> wplLs = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wplLs = CacheContext.wpls;
 
         SortUtils.sort(wplLs, "orderNum", SortUtils.ASC);
 

+ 8 - 8
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/Windresourceanalysis/WindresourceanalysisService.java

@@ -92,14 +92,14 @@ public class WindresourceanalysisService {
 //                    avenum = ave.get(0).getPointValueInDouble() / 10;
 //                    maxsnum = maxs.get(0).getPointValueInDouble() / 10;
 //                    minsnum = mins.get(0).getPointValueInDouble() /10;
-                    avenum = ave.get(0).getPointValueInDouble();
-                    maxsnum = maxs.get(0).getPointValueInDouble();
-                    minsnum = mins.get(0).getPointValueInDouble();
+                    avenum = (ave != null && !ave.isEmpty()) ? ave.get(0).getPointValueInDouble() : 0.0;
+                    maxsnum = (maxs != null && !maxs.isEmpty()) ? maxs.get(0).getPointValueInDouble() : 0.0;
+                    minsnum = (mins != null && !mins.isEmpty()) ? mins.get(0).getPointValueInDouble() : 0.0;
 
                 } else {
-                    avenum = ave.get(0).getPointValueInDouble();
-                    maxsnum = maxs.get(0).getPointValueInDouble();
-                    minsnum = mins.get(0).getPointValueInDouble();
+                    avenum = (ave != null && !ave.isEmpty()) ? ave.get(0).getPointValueInDouble() : 0.0;
+                    maxsnum = (maxs != null && !maxs.isEmpty()) ? maxs.get(0).getPointValueInDouble() : 0.0;
+                    minsnum = (mins != null && !mins.isEmpty()) ? mins.get(0).getPointValueInDouble() : 0.0;
                 }
 
                 vo.setWpid(wp.getWindpowerstationId());
@@ -116,9 +116,9 @@ public class WindresourceanalysisService {
                 List<PointData> ave = edosUtil.getHistStat(pjfx, startTime.getTime() / 1000, endTime.getTime() / 1000, (long) 1, null, 2);
                 double avefx = 0.0;
                 if (wp.getId().contains("NJLF01")) {
-                    avefx = ave.get(0).getPointValueInDouble() / 10;
+                    avefx = (ave != null && !ave.isEmpty()) ? ave.get(0).getPointValueInDouble() / 10 : 0.0;
                 }else {
-                    avefx = ave.get(0).getPointValueInDouble();
+                    avefx = (ave != null && !ave.isEmpty()) ? ave.get(0).getPointValueInDouble(): 0.0;
                 }
                 vo.setPjfx(StringUtils.round(avefx, 2));
                 vos.add(vo);

+ 3 - 2
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java

@@ -67,8 +67,9 @@ public class ProEconEquipmentInfoDayTopServiceImpl extends ServiceImpl<ProEconEq
 
         List<String> wpids = new ArrayList<>();
 
-        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wplist = tokenService.getWpls(request);
+//        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//        List<ProBasicPowerstation> wplist = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wplist = CacheContext.wpls;
         //场站模糊查询
         if (StringUtils.isNotEmpty(companyId)) {
             wplist = wplist.stream().filter(wp -> wp.getRegionId().equals(companyId) || wp.getCompanyId().equals(companyId)).collect(Collectors.toList());

+ 12 - 9
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/bmk/BenchmarkingService.java

@@ -74,8 +74,9 @@ public class BenchmarkingService {
 
     public List<ProBasicSubStation> subByCplist(String companyids, String type) {
 
-        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicSubStation> list = tokenService.getSubwpls(request);
+//        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//        List<ProBasicSubStation> list = tokenService.getSubwpls(request);
+        List<ProBasicSubStation> list = CacheContext.subwpls;
 
 
         if (StringUtils.isNotEmpty(type) && !type.equals("0")) {
@@ -90,9 +91,9 @@ public class BenchmarkingService {
 
     public List<ProBasicPowerstation> wpByCplist(String companyids, String type) {
 
-        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> list = tokenService.getWpls(request);
-//        List<ProBasicPowerstation> list = CacheContext.wpls;
+//        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//        List<ProBasicPowerstation> list = tokenService.getWpls(request);
+        List<ProBasicPowerstation> list = CacheContext.wpls;
 
         if (StringUtils.isNotEmpty(type) && !type.equals("0")) {
             String finalType = type.equals("-1") ? "_FDC" : "_GDC";
@@ -482,8 +483,9 @@ public class BenchmarkingService {
 
     public List<WxsslVo> wxssl(String companys, String type, String wpids, String projectids, String lineids, String beginDate, String endDate, String target, String sort) {
         List<WxsslVo> resultList = new ArrayList<>();
-        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+//        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
         QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
         StringBuilder sb = new StringBuilder();
 
@@ -859,8 +861,9 @@ public class BenchmarkingService {
      */
     private Map<String, Object> getWxsslSortVos(QueryWrapper<ProEconEquipmentInfoDay1> qw, Integer total, List<WxsslVo> resultList, String type, int pageNum, int pageSize) {
         Map<String, Object> resultMap = new HashMap<>();
-        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+//        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
         Map<String, Integer> station = wpls
                 .stream().collect(Collectors.toMap(ProBasicPowerstation::getId, ProBasicPowerstation::getOrderNum));
 

+ 3 - 2
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ComprehensiveService.java

@@ -69,8 +69,9 @@ public class ComprehensiveService {
     public List<CompreVo> listing(String company, String type, String targets) {
 
         List<CompreVo> resultList = new ArrayList<>();
-        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+//        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
         Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
         if (company.endsWith("ZGS")) {
             wpls = wpls.stream().filter(wp -> wp.getCompanyId().equals(company)).collect(Collectors.toList());

+ 9 - 8
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/LandformsService.java

@@ -112,21 +112,22 @@ public class LandformsService {
         Map<String, Double> modelpower = CacheContext.modelpower;
         Map<String, List<ProBasicEquipment>> sqwtmap = CacheContext.sqwtmap;
         Map<String, Map<String, ProBasicEquipmentPoint>> wtpAimap = CacheContext.wtpAimap;
-        Map<String, List<ProBasicBranch>> wtbnmap = CacheContext.wtbnmap;
-        Map<String, Map<String, ProBasicEquipmentPoint>> bnAimap = CacheContext.bnAimap;
+//        Map<String, List<ProBasicBranch>> wtbnmap = CacheContext.wtbnmap;
+//        Map<String, List<ProBasicBranch>> wtbnmap = CacheContext.wtbnmap;
+//        Map<String, Map<String, ProBasicEquipmentPoint>> bnAimap = CacheContext.bnAimap;
         List<ProBasicEquipment> equipments = sqwtmap.get(squareid);
         equipments.stream().forEach(wt -> {
             List<String> equipointids = new ArrayList<>();
             Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
             ProBasicEquipmentPoint powerPoint = equipmentPointMap.get(ContantXk.CJ_SSGL);
             equipointids.add(powerPoint.getNemCode());
-            List<ProBasicBranch> branches = wtbnmap.get(wt.getId());
+//            List<ProBasicBranch> branches = wtbnmap.get(wt.getId());
 
-            branches.stream().forEach(bn -> {
-                Map<String, ProBasicEquipmentPoint> pointMap = bnAimap.get(bn.getId());
-                ProBasicEquipmentPoint zldlPoint = pointMap.get(ContantXk.ZLDL);
-                equipointids.add(zldlPoint.getNemCode());
-            });
+//            branches.stream().forEach(bn -> {
+//                Map<String, ProBasicEquipmentPoint> pointMap = bnAimap.get(bn.getId());
+//                ProBasicEquipmentPoint zldlPoint = pointMap.get(ContantXk.ZLDL);
+//                equipointids.add(zldlPoint.getNemCode());
+//            });
             List<PointData> realData = null;
             try {
                 realData = edosUtil.getRealData(equipointids);

+ 6 - 5
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorService.java

@@ -66,8 +66,9 @@ public class MonitorService {
             if (CacheContext.wpmapls.containsKey(wpId)) {
                 wplist = CacheContext.wpmapls.get(wpId);
             }
-            HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-            List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+//            HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//            List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+            List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
 
             for (ProBasicPowerstation wp : wplsToken) {
                 if (wpId.contains(FD)) {
@@ -604,9 +605,9 @@ public class MonitorService {
                 nfdl = edosUtil.getRealData(nfdlvalue).getPointValueInDouble();
 
                 //光照指数
-                List<ProBasicPowerstation> czlss = CacheContext.wplsG.stream().filter(w -> w.getOrderNum().equals(15)).collect(Collectors.toList());
-                ProBasicPowerstationPoint gzzsvalue = proBasicPowerstationPointService.getPowerstationPoint(czlss.get(0).getId(), ContantXk.GCGZQD);
-                gzzs = edosUtil.getRealData(gzzsvalue).getPointValueInDouble();
+//                List<ProBasicPowerstation> czlss = CacheContext.wplsG.stream().filter(w -> w.getOrderNum().equals(15)).collect(Collectors.toList());
+//                ProBasicPowerstationPoint gzzsvalue = proBasicPowerstationPointService.getPowerstationPoint(czlss.get(0).getId(), ContantXk.GCGZQD);
+//                gzzs = edosUtil.getRealData(gzzsvalue).getPointValueInDouble();
 
                 //风能利用率
                 ProBasicPowerstationPoint fnlylvalue = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.FNLYL);

+ 3 - 2
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorprojectplanService.java

@@ -60,8 +60,9 @@ public class MonitorprojectplanService {
             if (CacheContext.wpmapls.containsKey(wpId)) {
                 wplist = CacheContext.wpmapls.get(wpId);
             }
-            HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-            List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+//            HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//            List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+            List<ProBasicPowerstation> wplsToken = wplist;
             for (ProBasicPowerstation wp : wplsToken) {
                 if (wpId.contains(FD)) {
                     if (wp.getId().endsWith("FDC_STA")) {

+ 2 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MonitorvalueService.java

@@ -126,7 +126,8 @@ public class MonitorvalueService {
                 wplist = CacheContext.wpmapls.get(wpId);
             }
             HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-            List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+//            List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+            List<ProBasicPowerstation> wplsToken = wplist;
             for (ProBasicPowerstation wp : wplsToken) {
                 if (wpId.contains(FD)) {
                     if (wp.getId().endsWith("FDC_STA")) {

+ 2 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/ProjectPlanService.java

@@ -69,7 +69,8 @@ public class ProjectPlanService {
                 wplist = CacheContext.wpmapls.get(wpId);
             }
             HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-            List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+//            List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+            List<ProBasicPowerstation> wplsToken = wplist;
             for (ProBasicPowerstation wp : wplsToken) {
                 if (wpId.contains(FD)) {
                     if (wp.getId().endsWith("FDC_STA")) {

+ 6 - 3
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/StatusService.java

@@ -35,12 +35,15 @@ public class StatusService {
     public List<StatusVo> monitor(String company, String type) {
         List<StatusVo> resultList = new ArrayList<>();
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+//        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
 
-        List<ProBasicSubStation> subwpls = tokenService.getSubwpls(request);
+//        List<ProBasicSubStation> subwpls = tokenService.getSubwpls(request);
+        List<ProBasicSubStation> subwpls = CacheContext.subwpls;
 //        List<ProBasicWeatherStation> weawpls = CacheContext.weawpls;
 
-        List<ProBasicWeatherStation> weawpls = tokenService.getWeawpls(request);
+//        List<ProBasicWeatherStation> weawpls = tokenService.getWeawpls(request);
+        List<ProBasicWeatherStation> weawpls = CacheContext.weawpls;
         Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
         Map<String, Map<String, ProBasicPowerstationPoint>> weatherwppointmap = CacheContext.weatherwppointmap;
 

+ 10 - 7
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/specific/SpecificService.java

@@ -412,9 +412,9 @@ public class SpecificService {
      */
     private void setCenterYtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
 
-        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
-
+//        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
         String yearString = yearmonth.split("-")[0];
         String year = String.valueOf(Integer.parseInt(yearString) - 1);
         String yearMonth = year + "-" + yearmonth.split("-")[1];
@@ -444,7 +444,7 @@ public class SpecificService {
         List<ProEconPowerstationInfoDay7> tq1List = proEconPowerstationInfoDay7Service.list(qw1);
         if (StringUtils.isNotEmpty(tqList)) {
             tqList.stream().forEach(i -> {
-                Optional<SpecificCenterVo> optionMonth = monthresultList.stream().filter(j -> j.getWpid().equals(i.getWindpowerstationId())).findFirst();
+                Optional<SpecificCenterVo> optionMonth = monthresultList.stream().filter(j -> j.getWpid().equals(i.getForeignKeyId())).findFirst();
                 SpecificCenterVo leftVo = optionMonth.get();
                 if (optionMonth.isPresent()) {
                     leftVo.setTqmtbf(DoubleUtils.keepPrecision(i.getYmtbf().doubleValue(), 2));
@@ -502,7 +502,8 @@ public class SpecificService {
     private void setCenterNtqInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) throws ParseException {
 
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+//        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
         String yearString = yearmonth.split("-")[0];
         String year = String.valueOf(Integer.parseInt(yearString) - 1);
         QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
@@ -582,7 +583,8 @@ public class SpecificService {
     private void setCenterDyInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> monthresultList) {
 
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+//        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
         QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
         QueryWrapper<ProEconPowerstationInfoDay7> qw1 = new QueryWrapper<>();
         qw.select("foreign_key_id,sum(rmtbf) ymtbf,sum(rmttr) ymttr,avg(rfwjsl) yfwjsl,avg(rztzhjsl) yztzhjsl,avg(rgzxqjsl) ygzxqjsl");
@@ -658,7 +660,8 @@ public class SpecificService {
     private void setCenterDnInfo(String companys, String type, String yearmonth, List<SpecificCenterVo> yearresultList) {
 
         HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+//        List<ProBasicPowerstation> wplsToken = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wplsToken = CacheContext.wpls;
 
         QueryWrapper<ProEconPowerstationInfoDay4> qw = new QueryWrapper<>();
         QueryWrapper<ProEconPowerstationInfoDay7> qw1 = new QueryWrapper<>();

+ 3 - 2
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/threerate/ThreeRateService.java

@@ -105,8 +105,9 @@ public class ThreeRateService {
      */
     public List<QxjslDTO> getDefectsEliminatRateList(String companyId, String windpowerstationId, String beginDate, String endDate) {
 
-        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
-        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+//        HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
+//        List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
+        List<ProBasicPowerstation> wpls = CacheContext.wpls;
         Map<String, Integer> station = wpls
                 .stream().collect(Collectors.toMap(ProBasicPowerstation::getId, ProBasicPowerstation::getOrderNum));
 

+ 9 - 6
runeconomy-xk/src/main/resources/application-yun.yml

@@ -38,16 +38,19 @@ spring:
         min-idle: 0
         max-idle: 8
         max-wait: -1
-    database: 8
+    database: 10
   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/IMS_NEM_JN
-    url: jdbc:postgresql://123.60.219.66:5432/IMS_NEM_JN
-    username: postgres
-    password: gyeepd@123
+#    url: jdbc:postgresql://123.60.219.66:5432/IMS_NEM_JN
+#    username: postgres
+#    password: gyeepd@123
+    url: jdbc:postgresql://rm-cn-adn3tj2bu00032so.rwlb.rds.aliyuncs.com:5432/admin_1?useSSL=true&serverTimezone=UTC
+    username: admin_1
+    password: Admin123
     oracle-schema=:
     druid:
       max-active: 10
@@ -98,8 +101,8 @@ logging:
 initialcode: INITIAL
 db:
   #  URL1: http://10.81.3.162:8011/ts
-  URL1: http://192.168.2.232:8011/ts
-  URL2: http://192.168.2.232:8011/ts
+  URL1: http://47.94.243.115:8011/ts
+  URL2: http://47.94.243.115:8011/ts
 #  URL2: http://10.81.3.162:8012/ts
 
 #