Bläddra i källkod

增加准确率分区表配置

xusl 3 månader sedan
förälder
incheckning
e06c4a5cd1

+ 7 - 0
cpp-admin/src/main/java/com/cpp/web/core/config/sharding/ShardingTablesLoadRunner.java

@@ -1,12 +1,14 @@
 package com.cpp.web.core.config.sharding;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.cpp.web.domain.accuracy.AccuracyPassRate;
 import com.cpp.web.domain.alarm.AbnormalAlarm;
 import com.cpp.web.domain.cloud.ForecastPowerShortTermCloud;
 import com.cpp.web.domain.cloud.ForecastPowerUltraShortTermCloud;
 import com.cpp.web.domain.cloud.NwpCloud;
 import com.cpp.web.domain.datafactory.ParsingLog;
 import com.cpp.web.domain.station.*;
+import com.cpp.web.service.accuracy.AccuracyPassRateService;
 import com.cpp.web.service.alarm.AbnormalAlarmService;
 import com.cpp.web.service.cloud.ForecastPowerShortTermCloudService;
 import com.cpp.web.service.cloud.ForecastPowerUltraShortTermCloudService;
@@ -53,6 +55,7 @@ public class ShardingTablesLoadRunner{
     private final PowerStationStatusDataService powerStationStatusDataService;
     private final ParsingLogService parsingLogService;
     private final ForecastPowerShortTermSendService forecastPowerShortTermSendService;
+    private final AccuracyPassRateService accuracyPassRateService;
 
 
     @PostConstruct
@@ -132,6 +135,10 @@ public class ShardingTablesLoadRunner{
         nwpStationLambdaQueryWrapper.eq(NwpStation::getTime, new Date()).last("limit 1");
         nwpStationService.list(nwpStationLambdaQueryWrapper);
 
+        // 读取已有分表,进行缓存
+        LambdaQueryWrapper<AccuracyPassRate> accuracyPassRateLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        accuracyPassRateLambdaQueryWrapper.eq(AccuracyPassRate::getTime, new Date()).last("limit 1");
+        accuracyPassRateService.list(accuracyPassRateLambdaQueryWrapper);
 
 
         log.info(">>>>>>>>>> 【ShardingTablesLoadRunner】缓存已有分表成功 <<<<<<<<<<");

+ 4 - 2
cpp-admin/src/main/resources/application.yml

@@ -110,8 +110,10 @@ mybatis-plus:
   # 配置mapper的扫描,找到所有的mapper.xml映射文件
   mapper-locations: classpath*:mapper/**/*Mapper.xml
   # 加载全局的配置文件
-  config-location: classpath:mybatis/mybatis-config.xml
-
+#  config-location: classpath:mybatis/mybatis-config.xml
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志
+    # log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl #关闭sql日志
 # PageHelper分页插件
 pagehelper:
   helperDialect: mysql

+ 7 - 1
cpp-admin/src/main/resources/sharding.yaml

@@ -154,6 +154,12 @@ rules:
         standard:
           shardingColumn: time
           shardingAlgorithmName: auto-custom
+    cpp_accuracy_pass_rate:
+      actualDataNodes: cpp.cpp_accuracy_pass_rate
+      tableStrategy:
+        standard:
+          shardingColumn: time
+          shardingAlgorithmName: auto-custom
   shardingAlgorithms:
     auto-custom:
       type: CLASS_BASED
@@ -173,4 +179,4 @@ rules:
 
 props:
   sql-show: false
-  allow-range-query-with-inline-sharding: true
+  allow-range-query-with-inline-sharding: true

+ 2 - 2
cpp-ui/src/views/statistics/reportData/index.vue

@@ -209,7 +209,7 @@ export default {
     },
     changeDataSource(row) {
       if (row.cellValue === "E1") {
-        return "ftp(场站端)"
+        return "sftp(场站端)"
       }
       if (row.cellValue === "E2") {
         return "云端(中心端)"
@@ -218,7 +218,7 @@ export default {
         return "集中预测(控制端)"
       }
       if (row.cellValue === "E4") {
-        return "ftp(场站端经集中调控)"
+        return "sftp(场站端经集中调控)"
       }
     },
     changeFileName(row) {