xushili 1 rok pred
rodič
commit
71797747ef

+ 5 - 5
electricity/meter/src/main/resources/bootstrap.yaml

@@ -11,10 +11,10 @@ spring:
     nacos:
       discovery:
         # 服务注册地址
-        server-addr: 127.0.0.1:8848
+        server-addr: 192.168.10.18:8848
       config:
         # 配置中心地址
-        server-addr: 127.0.0.1:8848
+        server-addr: 192.168.10.18:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置
@@ -24,9 +24,9 @@ spring:
     type: SIMPLE
   datasource:
     driver-class-name: org.postgresql.Driver
-    url: jdbc:postgresql://192.168.181.218:5432/testdb
-    username: postgres
-    password: 123
+    url: jdbc:postgresql://192.168.10.18:5432/nx_dev
+    username: gdprod
+    password: gyee123
     type: com.alibaba.druid.pool.DruidDataSource
     druid:
       max-active: 20

+ 0 - 1
state/wind/src/main/java/com/gyee/gaia/Bootstrap.java

@@ -6,7 +6,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
 @EnableDiscoveryClient
-@MapperScan("com.gyee.gaia.dao")
 @SpringBootApplication(scanBasePackages = "com.gyee.gaia")
 public class Bootstrap {
 

+ 27 - 22
state/wind/src/main/java/com/gyee/gaia/state/wind/entity/WindturbineInfo.java

@@ -12,7 +12,6 @@ public class WindturbineInfo {
     private String name;
     private String id;
     private String modelId;
-    //private int status8;
     private long lastUpdateTs;
     private double YGGL;
 
@@ -72,22 +71,6 @@ public class WindturbineInfo {
             int statusCode = (int) getYGGL();
             if (statusCode == 6 || statusCode == 9) return 6;
             if (statusArray[5] > 0) return 5;
-            /*switch ((int)statusCode) {
-                case 0:
-                case 3:
-                case 4:
-                    return 2;   //待机
-                case 1:
-                case 2:
-                    return 2;
-                case 5:
-                    return 4;
-                case 6:
-                case 9:
-                    return 6;
-            }
-            return 0;*/
-
             //0	初始化 1停机过程 2停机状态 3待机状态 4启机状态 6维护状态 5发电状态 8自检状态 9维护状态
             switch (statusCode) {
                 case 0:
@@ -178,6 +161,32 @@ public class WindturbineInfo {
                     return 5;
             }
             return 0;
+        } else if ("LHDL_UP105-2000-S".equals(modelId)) {
+            //风机的8种原始状态:0-停机、 1-上电、2-待机、3-启动、4-并网、5-故障、6-维护、 7-离线
+            //如果机舱故障灯 或者 塔底故障灯 有一个为一,那么需要判断最高故障等级是否大于4如果大于4那么风机现在就是故障,
+            // 如果等于4,判断现在是否是待机状态,如果不是待机状态就是故障,如果小于4则不判断
+            if (statusArray[6] > 0) {
+                return 6;
+            }
+            if (statusArray[5] > 0) {
+                if(getYGGL()>4){
+                    return 5;
+                }else if(getYGGL() == 4 && statusArray[2] < 1){
+                    return 5;
+                }
+            }
+            if (statusArray[0] > 0) {
+                return 0;
+            } else if (statusArray[4] > 0) {
+                return 4;
+            } else if (statusArray[3] > 0) {
+                return 3;
+            } else if (statusArray[2] > 0) {
+                return 2;
+            } else if (statusArray[1] > 0) {
+                return 1;
+            }
+            return 2;
         } else {
             if (statusArray[6] > 0) {
                 return 6;
@@ -190,17 +199,13 @@ public class WindturbineInfo {
             } else if (statusArray[3] > 0) {
                 return 3;
             } else if (statusArray[2] > 0) {
-                //            if (getYGGL() > 1) {
-                //                return 4;
-                //            }
-                //            else
                 return 2;
             } else if (statusArray[1] > 0) {
                 return 1;
             }
 
             if (getYGGL() > 1) {
-                System.out.println("yggl=" + getYGGL());
+                //System.out.println("yggl=" + getYGGL());
                 return 4;
             } else
                 return 2;

+ 2 - 2
state/wind/src/main/java/com/gyee/gaia/state/wind/service/Status8Service.java

@@ -171,7 +171,7 @@ public class Status8Service {
         ucMap.keySet().toArray(strArr);
         log.info("加载风机测点, 风机号:" + wtInfo.getId());
         QueryWrapper<TestingPoint> tpwrapper = new QueryWrapper<>();
-        tpwrapper.eq("thing_type", "windturbine").eq("station_id", wtInfo.getId())
+        tpwrapper.eq("thing_type", "windturbine").eq("thing_id", wtInfo.getId())
                 .in("uniform_code", strArr);
         List<TestingPoint> list = testingPointService.list(tpwrapper);
 
@@ -180,7 +180,7 @@ public class Status8Service {
             try {
                 TagInfo tagInfo = new TagInfo();
                 tagInfo.setUniformCode(tsPoint.getUniformCode());
-                tagInfo.setId(tsPoint.getId());
+                tagInfo.setId(tsPoint.getCode());
                 //tagInfo.setTsDataType(tsPoint.getTsDataType());
                 tagInfo.setRelateStatus(ucMap.get(tsPoint.getUniformCode()));
                 //tagInfo.setStatusIndex(statusIndex);

+ 28 - 28
state/wind/src/main/resources/application-nx.yaml

@@ -19,8 +19,8 @@
     whtsUniformCode: WHTS8
     lxtsUniformCode: LXTS8
     windturbineGroups:
-      - station: SBQ_FDC
-        modelid: UP82_2
+      - station: NX_GDDL_SBQ_FDC_STA
+        modelid: LHDL_UP86
         TJ: DI059
         SD: DI057
         DJ: DI054
@@ -31,8 +31,8 @@
         #有功功率 -- AI130, 风速 -- AI005, 发电机转速 -- AI128, 转子转速 -- AI014, 偏航位置 -- AI034
         LX: AI005,AI128,AI014,AI034
         YGGL: AI130
-      - station: SBQ_FDC
-        modelid: UP97
+      - station: NX_GDDL_SBQ_FDC_STA
+        modelid: LHDL_UP97
         TJ: DI059
         SD: DI057
         DJ: DI054
@@ -43,20 +43,20 @@
         #有功功率 -- AI130, 风速 -- AI007, 发电机转速 -- AI128, 转子转速 -- AI014
         LX: AI007,AI128,AI014
         YGGL: AI130
-      - station: SBQ_FDC
-        modelid: UP105-2000-S
+      - station: NX_GDDL_SBQ_FDC_STA
+        modelid: LHDL_UP105-2000-S
         TJ: DI1884
         SD: DI1886
         DJ: DI1888
         QD: DI1881,DI1889
         BW: DI1885
-        GZ: NFDLZY_FXF #DI1882
+        GZ: DI1830,DI1857 #DI1882
         WH: DI1883
         #有功功率 -- AI130, 风速 -- AI022, 发电机转速 -- AI128, 叶轮转速 -- AI012, 偏航位置 -- AI034
         LX: AI022,AI128,AI012,AI034
-        YGGL: AI130
-      - station: NSS_FDC
-        modelid: UP82
+        YGGL: AI423 #故障等级借用
+      - station: NX_GDDL_NSS_FDC_STA
+        modelid: LHDL_UP82
         TJ: DI059
         SD: DI057
         DJ: DI054
@@ -67,8 +67,8 @@
         #有功功率 -- AI130, 风速 -- AI005, 发电机转速 -- AI128, 转子转速 -- AI014, 偏航位置 -- AI034
         LX: AI005,AI128,AI014,AI034
         YGGL: AI130
-      - station: MHS_FDC
-        modelid: UP77
+      - station: NX_GDDL_MHS_FDC_STA
+        modelid: LHDL_UP77
         TJ: DI059
         SD: DI057
         DJ: DI054
@@ -79,32 +79,32 @@
         #有功功率 -- AI130, 风速 -- AI005, 发电机转速 -- AI128, 转子转速 -- AI014, 偏航位置 -- AI034
         LX: AI005,AI128,AI014,AI034
         YGGL: AI130
-      - station: MHS_FDC
-        modelid: UP105-2000-S
+      - station: NX_GDDL_MHS_FDC_STA
+        modelid: LHDL_UP105-2000-S
         TJ: DI1884
         SD: DI1886
         DJ: DI1888
         QD: DI1881,DI1889
         BW: DI1885
-        GZ: NFDLZY_FXF #DI1882
+        GZ: DI1830,DI1857 #DI1882
         WH: DI1883
         #有功功率 -- AI130, 风速 -- AI022, 发电机转速 -- AI128, 叶轮转速 -- AI012, 偏航位置 -- AI034
         LX: AI022,AI128,AI012,AI034
-        YGGL: AI130
-      - station: XS_FDC
-        modelid: UP105-2000-S
+        YGGL: AI423 #故障等级借用
+      - station: NX_GDDL_XS_FDC_STA
+        modelid: LHDL_UP105-2000-S
         TJ: DI1884
         SD: DI1886
         DJ: DI1888
         QD: DI1881,DI1889
         BW: DI1885
-        GZ: NFDLZY_FXF #DI1882
+        GZ: DI1830,DI1857 #DI1882
         WH: DI1883
         #有功功率 -- AI130, 风速 -- AI022, 发电机转速 -- AI128, 叶轮转速 -- AI012, 偏航位置 -- AI034
         LX: AI022,AI128,AI012,AI034
-        YGGL: AI130
-      - station: XS_FDC
-        modelid: UP97
+        YGGL: AI423 #故障等级借用
+      - station: NX_GDDL_XS_FDC_STA
+        modelid: LHDL_UP97
         TJ: DI059
         SD: DI057
         DJ: DI054
@@ -115,8 +115,8 @@
         #有功功率 -- AI130, 风速 -- AI007, 发电机转速 -- AI128, 转子转速 -- AI014
         LX: AI007,AI128,AI014
         YGGL: AI130
-      - station: QS_FDC
-        modelid: CCWE-1500
+      - station: NX_GDDL_QS_FDC_STA
+        modelid: SYHC_CCWE-1500
         TJ: DI819
         SD:
         DJ: DI818
@@ -127,15 +127,15 @@
         #有功功率 -- AI130, 风速 -- AI022, 发电机转速 -- AI223, 转子转速 -- AI181
         LX: AI022,AI223,AI181,AI130
         YGGL: FJZTREAD   #风机运行状态码借用
-      - station: QS_FDC
-        modelid: UP105-2000-S
+      - station: NX_GDDL_QS_FDC_STA
+        modelid: LHDL_UP105-2000-S
         TJ: DI1884
         SD: DI1886
         DJ: DI1888
         QD: DI1881,DI1889
         BW: DI1885
-        GZ: NFDLZY_FXF #DI1882
+        GZ: DI1830,DI1857 #DI1882
         WH: DI1883
         #有功功率 -- AI130, 风速 -- AI022, 发电机转速 -- AI128, 叶轮转速 -- AI012, 偏航位置 -- AI034
         LX: AI022,AI128,AI012,AI034
-        YGGL: AI130
+        YGGL: AI423 #故障等级借用

+ 2 - 1
state/wind/src/main/resources/bootstrap.yaml

@@ -78,4 +78,5 @@ mybatis-plus:
     cache-enabled: false
     #配置JdbcTypeForNull, oracle数据库必须配置
     jdbc-type-for-null: 'null'
-    callSettersOnNulls: true
+    callSettersOnNulls: true
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

+ 509 - 0
资源文件/sql/nacos-pg.sql

@@ -0,0 +1,509 @@
+/*
+ * Copyright 1999-2018 Alibaba Group Holding Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+-- ----------------------------
+-- Table structure for config_info
+-- ----------------------------
+DROP TABLE IF EXISTS "config_info";
+CREATE TABLE "config_info"
+(
+    "id"                 bigserial    NOT NULL,
+    "data_id"            varchar(255) NOT NULL,
+    "group_id"           varchar(255),
+    "content"            text         NOT NULL,
+    "md5"                varchar(32),
+    "gmt_create"         timestamp(6) NOT NULL,
+    "gmt_modified"       timestamp(6) NOT NULL,
+    "src_user"           text,
+    "src_ip"             varchar(20),
+    "app_name"           varchar(128),
+    "tenant_id"          varchar(128),
+    "c_desc"             varchar(256),
+    "c_use"              varchar(64),
+    "effect"             varchar(64),
+    "type"               varchar(64),
+    "c_schema"           text,
+    "encrypted_data_key" text         NOT NULL
+)
+;
+
+COMMENT ON COLUMN "config_info"."id" IS 'id';
+COMMENT ON COLUMN "config_info"."data_id" IS 'data_id';
+COMMENT ON COLUMN "config_info"."content" IS 'content';
+COMMENT ON COLUMN "config_info"."md5" IS 'md5';
+COMMENT ON COLUMN "config_info"."gmt_create" IS '创建时间';
+COMMENT ON COLUMN "config_info"."gmt_modified" IS '修改时间';
+COMMENT ON COLUMN "config_info"."src_user" IS 'source user';
+COMMENT ON COLUMN "config_info"."src_ip" IS 'source ip';
+COMMENT ON COLUMN "config_info"."tenant_id" IS '租户字段';
+COMMENT ON COLUMN "config_info"."encrypted_data_key" IS '秘钥';
+COMMENT ON TABLE "config_info" IS 'config_info';
+
+
+-- ----------------------------
+-- Table structure for config_info_aggr
+-- ----------------------------
+DROP TABLE IF EXISTS "config_info_aggr";
+CREATE TABLE "config_info_aggr"
+(
+    "id"           bigserial    NOT NULL,
+    "data_id"      varchar(255) NOT NULL,
+    "group_id"     varchar(255) NOT NULL,
+    "datum_id"     varchar(255) NOT NULL,
+    "content"      text         NOT NULL,
+    "gmt_modified" timestamp(6) NOT NULL,
+    "app_name"     varchar(128),
+    "tenant_id"    varchar(128)
+)
+;
+COMMENT ON COLUMN "config_info_aggr"."id" IS 'id';
+COMMENT ON COLUMN "config_info_aggr"."data_id" IS 'data_id';
+COMMENT ON COLUMN "config_info_aggr"."group_id" IS 'group_id';
+COMMENT ON COLUMN "config_info_aggr"."datum_id" IS 'datum_id';
+COMMENT ON COLUMN "config_info_aggr"."content" IS '内容';
+COMMENT ON COLUMN "config_info_aggr"."gmt_modified" IS '修改时间';
+COMMENT ON COLUMN "config_info_aggr"."tenant_id" IS '租户字段';
+COMMENT ON TABLE "config_info_aggr" IS '增加租户字段';
+
+-- ----------------------------
+-- Records of config_info_aggr
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for config_info_beta
+-- ----------------------------
+DROP TABLE IF EXISTS "config_info_beta";
+CREATE TABLE "config_info_beta"
+(
+    "id"                 bigserial    NOT NULL,
+    "data_id"            varchar(255) NOT NULL,
+    "group_id"           varchar(128) NOT NULL,
+    "app_name"           varchar(128),
+    "content"            text         NOT NULL,
+    "beta_ips"           varchar(1024),
+    "md5"                varchar(32),
+    "gmt_create"         timestamp(6) NOT NULL,
+    "gmt_modified"       timestamp(6) NOT NULL,
+    "src_user"           text,
+    "src_ip"             varchar(20),
+    "tenant_id"          varchar(128),
+    "encrypted_data_key" text         NOT NULL
+)
+;
+COMMENT ON COLUMN "config_info_beta"."id" IS 'id';
+COMMENT ON COLUMN "config_info_beta"."data_id" IS 'data_id';
+COMMENT ON COLUMN "config_info_beta"."group_id" IS 'group_id';
+COMMENT ON COLUMN "config_info_beta"."app_name" IS 'app_name';
+COMMENT ON COLUMN "config_info_beta"."content" IS 'content';
+COMMENT ON COLUMN "config_info_beta"."beta_ips" IS 'betaIps';
+COMMENT ON COLUMN "config_info_beta"."md5" IS 'md5';
+COMMENT ON COLUMN "config_info_beta"."gmt_create" IS '创建时间';
+COMMENT ON COLUMN "config_info_beta"."gmt_modified" IS '修改时间';
+COMMENT ON COLUMN "config_info_beta"."src_user" IS 'source user';
+COMMENT ON COLUMN "config_info_beta"."src_ip" IS 'source ip';
+COMMENT ON COLUMN "config_info_beta"."tenant_id" IS '租户字段';
+COMMENT ON COLUMN "config_info_beta"."encrypted_data_key" IS '秘钥';
+COMMENT ON TABLE "config_info_beta" IS 'config_info_beta';
+
+-- ----------------------------
+-- Records of config_info_beta
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for config_info_tag
+-- ----------------------------
+DROP TABLE IF EXISTS "config_info_tag";
+CREATE TABLE "config_info_tag"
+(
+    "id"           bigserial    NOT NULL,
+    "data_id"      varchar(255) NOT NULL,
+    "group_id"     varchar(128) NOT NULL,
+    "tenant_id"    varchar(128),
+    "tag_id"       varchar(128) NOT NULL,
+    "app_name"     varchar(128),
+    "content"      text         NOT NULL,
+    "md5"          varchar(32),
+    "gmt_create"   timestamp(6) NOT NULL,
+    "gmt_modified" timestamp(6) NOT NULL,
+    "src_user"     text,
+    "src_ip"       varchar(20)
+)
+;
+COMMENT ON COLUMN "config_info_tag"."id" IS 'id';
+COMMENT ON COLUMN "config_info_tag"."data_id" IS 'data_id';
+COMMENT ON COLUMN "config_info_tag"."group_id" IS 'group_id';
+COMMENT ON COLUMN "config_info_tag"."tenant_id" IS 'tenant_id';
+COMMENT ON COLUMN "config_info_tag"."tag_id" IS 'tag_id';
+COMMENT ON COLUMN "config_info_tag"."app_name" IS 'app_name';
+COMMENT ON COLUMN "config_info_tag"."content" IS 'content';
+COMMENT ON COLUMN "config_info_tag"."md5" IS 'md5';
+COMMENT ON COLUMN "config_info_tag"."gmt_create" IS '创建时间';
+COMMENT ON COLUMN "config_info_tag"."gmt_modified" IS '修改时间';
+COMMENT ON COLUMN "config_info_tag"."src_user" IS 'source user';
+COMMENT ON COLUMN "config_info_tag"."src_ip" IS 'source ip';
+COMMENT ON TABLE "config_info_tag" IS 'config_info_tag';
+
+-- ----------------------------
+-- Records of config_info_tag
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for config_tags_relation
+-- ----------------------------
+DROP TABLE IF EXISTS "config_tags_relation";
+CREATE TABLE "config_tags_relation"
+(
+    "id"        bigserial    NOT NULL,
+    "tag_name"  varchar(128) NOT NULL,
+    "tag_type"  varchar(64),
+    "data_id"   varchar(255) NOT NULL,
+    "group_id"  varchar(128) NOT NULL,
+    "tenant_id" varchar(128),
+    "nid"       bigserial    NOT NULL
+)
+;
+COMMENT ON COLUMN "config_tags_relation"."id" IS 'id';
+COMMENT ON COLUMN "config_tags_relation"."tag_name" IS 'tag_name';
+COMMENT ON COLUMN "config_tags_relation"."tag_type" IS 'tag_type';
+COMMENT ON COLUMN "config_tags_relation"."data_id" IS 'data_id';
+COMMENT ON COLUMN "config_tags_relation"."group_id" IS 'group_id';
+COMMENT ON COLUMN "config_tags_relation"."tenant_id" IS 'tenant_id';
+COMMENT ON TABLE "config_tags_relation" IS 'config_tag_relation';
+
+-- ----------------------------
+-- Records of config_tags_relation
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for group_capacity
+-- ----------------------------
+DROP TABLE IF EXISTS "group_capacity";
+CREATE TABLE "group_capacity"
+(
+    "id"                bigserial    NOT NULL,
+    "group_id"          varchar(128) NOT NULL,
+    "quota"             int4         NOT NULL,
+    "usage"             int4         NOT NULL,
+    "max_size"          int4         NOT NULL,
+    "max_aggr_count"    int4         NOT NULL,
+    "max_aggr_size"     int4         NOT NULL,
+    "max_history_count" int4         NOT NULL,
+    "gmt_create"        timestamp(6) NOT NULL,
+    "gmt_modified"      timestamp(6) NOT NULL
+)
+;
+COMMENT ON COLUMN "group_capacity"."id" IS '主键ID';
+COMMENT ON COLUMN "group_capacity"."group_id" IS 'Group ID,空字符表示整个集群';
+COMMENT ON COLUMN "group_capacity"."quota" IS '配额,0表示使用默认值';
+COMMENT ON COLUMN "group_capacity"."usage" IS '使用量';
+COMMENT ON COLUMN "group_capacity"."max_size" IS '单个配置大小上限,单位为字节,0表示使用默认值';
+COMMENT ON COLUMN "group_capacity"."max_aggr_count" IS '聚合子配置最大个数,,0表示使用默认值';
+COMMENT ON COLUMN "group_capacity"."max_aggr_size" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值';
+COMMENT ON COLUMN "group_capacity"."max_history_count" IS '最大变更历史数量';
+COMMENT ON COLUMN "group_capacity"."gmt_create" IS '创建时间';
+COMMENT ON COLUMN "group_capacity"."gmt_modified" IS '修改时间';
+COMMENT ON TABLE "group_capacity" IS '集群、各Group容量信息表';
+
+-- ----------------------------
+-- Records of group_capacity
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for his_config_info
+-- ----------------------------
+DROP TABLE IF EXISTS "his_config_info";
+CREATE TABLE "his_config_info"
+(
+    "id"                 int8         NOT NULL,
+    "nid"                bigserial    NOT NULL,
+    "data_id"            varchar(255) NOT NULL,
+    "group_id"           varchar(128) NOT NULL,
+    "app_name"           varchar(128),
+    "content"            text         NOT NULL,
+    "md5"                varchar(32),
+    "gmt_create"         timestamp(6) NOT NULL DEFAULT '2010-05-05 00:00:00',
+    "gmt_modified"       timestamp(6) NOT NULL,
+    "src_user"           text,
+    "src_ip"             varchar(20),
+    "op_type"            char(10),
+    "tenant_id"          varchar(128),
+    "encrypted_data_key" text         NOT NULL
+)
+;
+COMMENT ON COLUMN "his_config_info"."app_name" IS 'app_name';
+COMMENT ON COLUMN "his_config_info"."tenant_id" IS '租户字段';
+COMMENT ON COLUMN "his_config_info"."encrypted_data_key" IS '秘钥';
+COMMENT ON TABLE "his_config_info" IS '多租户改造';
+
+
+-- ----------------------------
+-- Table structure for permissions
+-- ----------------------------
+DROP TABLE IF EXISTS "permissions";
+CREATE TABLE "permissions"
+(
+    "role"     varchar(50)  NOT NULL,
+    "resource" varchar(512) NOT NULL,
+    "action"   varchar(8)   NOT NULL
+)
+;
+
+-- ----------------------------
+-- Records of permissions
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for roles
+-- ----------------------------
+DROP TABLE IF EXISTS "roles";
+CREATE TABLE "roles"
+(
+    "username" varchar(50) NOT NULL,
+    "role"     varchar(50) NOT NULL
+)
+;
+
+-- ----------------------------
+-- Records of roles
+-- ----------------------------
+BEGIN;
+INSERT INTO "roles"
+VALUES ('nacos', 'ROLE_ADMIN');
+COMMIT;
+
+-- ----------------------------
+-- Table structure for tenant_capacity
+-- ----------------------------
+DROP TABLE IF EXISTS "tenant_capacity";
+CREATE TABLE "tenant_capacity"
+(
+    "id"                bigserial    NOT NULL,
+    "tenant_id"         varchar(128) NOT NULL,
+    "quota"             int4         NOT NULL,
+    "usage"             int4         NOT NULL,
+    "max_size"          int4         NOT NULL,
+    "max_aggr_count"    int4         NOT NULL,
+    "max_aggr_size"     int4         NOT NULL,
+    "max_history_count" int4         NOT NULL,
+    "gmt_create"        timestamp(6) NOT NULL,
+    "gmt_modified"      timestamp(6) NOT NULL
+)
+;
+COMMENT ON COLUMN "tenant_capacity"."id" IS '主键ID';
+COMMENT ON COLUMN "tenant_capacity"."tenant_id" IS 'Tenant ID';
+COMMENT ON COLUMN "tenant_capacity"."quota" IS '配额,0表示使用默认值';
+COMMENT ON COLUMN "tenant_capacity"."usage" IS '使用量';
+COMMENT ON COLUMN "tenant_capacity"."max_size" IS '单个配置大小上限,单位为字节,0表示使用默认值';
+COMMENT ON COLUMN "tenant_capacity"."max_aggr_count" IS '聚合子配置最大个数';
+COMMENT ON COLUMN "tenant_capacity"."max_aggr_size" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值';
+COMMENT ON COLUMN "tenant_capacity"."max_history_count" IS '最大变更历史数量';
+COMMENT ON COLUMN "tenant_capacity"."gmt_create" IS '创建时间';
+COMMENT ON COLUMN "tenant_capacity"."gmt_modified" IS '修改时间';
+COMMENT ON TABLE "tenant_capacity" IS '租户容量信息表';
+
+-- ----------------------------
+-- Records of tenant_capacity
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for tenant_info
+-- ----------------------------
+DROP TABLE IF EXISTS "tenant_info";
+CREATE TABLE "tenant_info"
+(
+    "id"            bigserial    NOT NULL,
+    "kp"            varchar(128) NOT NULL,
+    "tenant_id"     varchar(128),
+    "tenant_name"   varchar(128),
+    "tenant_desc"   varchar(256),
+    "create_source" varchar(32),
+    "gmt_create"    int8         NOT NULL,
+    "gmt_modified"  int8         NOT NULL
+)
+;
+COMMENT ON COLUMN "tenant_info"."id" IS 'id';
+COMMENT ON COLUMN "tenant_info"."kp" IS 'kp';
+COMMENT ON COLUMN "tenant_info"."tenant_id" IS 'tenant_id';
+COMMENT ON COLUMN "tenant_info"."tenant_name" IS 'tenant_name';
+COMMENT ON COLUMN "tenant_info"."tenant_desc" IS 'tenant_desc';
+COMMENT ON COLUMN "tenant_info"."create_source" IS 'create_source';
+COMMENT ON COLUMN "tenant_info"."gmt_create" IS '创建时间';
+COMMENT ON COLUMN "tenant_info"."gmt_modified" IS '修改时间';
+COMMENT ON TABLE "tenant_info" IS 'tenant_info';
+
+-- ----------------------------
+-- Records of tenant_info
+-- ----------------------------
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for users
+-- ----------------------------
+DROP TABLE IF EXISTS "users";
+CREATE TABLE "users"
+(
+    "username" varchar(50)  NOT NULL,
+    "password" varchar(500) NOT NULL,
+    "enabled"  boolean      NOT NULL
+)
+;
+
+-- ----------------------------
+-- Records of users
+-- ----------------------------
+BEGIN;
+INSERT INTO "users"
+VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);
+COMMIT;
+
+-- ----------------------------
+-- Indexes structure for table config_info
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_configinfo_datagrouptenant" ON "config_info" ("data_id","group_id","tenant_id");
+
+-- ----------------------------
+-- Primary Key structure for table config_info
+-- ----------------------------
+ALTER TABLE "config_info" ADD CONSTRAINT "config_info_pkey" PRIMARY KEY ("id");
+
+-- ----------------------------
+-- Indexes structure for table config_info_aggr
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_configinfoaggr_datagrouptenantdatum" ON "config_info_aggr" USING btree ("data_id","group_id","tenant_id","datum_id");
+
+-- ----------------------------
+-- Primary Key structure for table config_info_aggr
+-- ----------------------------
+ALTER TABLE "config_info_aggr" ADD CONSTRAINT "config_info_aggr_pkey" PRIMARY KEY ("id");
+
+-- ----------------------------
+-- Indexes structure for table config_info_beta
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_configinfobeta_datagrouptenant" ON "config_info_beta" USING btree ("data_id","group_id","tenant_id");
+
+-- ----------------------------
+-- Primary Key structure for table config_info_beta
+-- ----------------------------
+ALTER TABLE "config_info_beta" ADD CONSTRAINT "config_info_beta_pkey" PRIMARY KEY ("id");
+
+-- ----------------------------
+-- Indexes structure for table config_info_tag
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_configinfotag_datagrouptenanttag" ON "config_info_tag" USING btree ("data_id","group_id","tenant_id","tag_id");
+
+-- ----------------------------
+-- Primary Key structure for table config_info_tag
+-- ----------------------------
+ALTER TABLE "config_info_tag" ADD CONSTRAINT "config_info_tag_pkey" PRIMARY KEY ("id");
+
+-- ----------------------------
+-- Indexes structure for table config_tags_relation
+-- ----------------------------
+CREATE INDEX "idx_tenant_id" ON "config_tags_relation" USING btree (
+                                                                    "tenant_id"
+    );
+CREATE UNIQUE INDEX "uk_configtagrelation_configidtag" ON "config_tags_relation" USING btree (
+                                                                                              "id",
+                                                                                              "tag_name",
+                                                                                              "tag_type"
+    );
+
+-- ----------------------------
+-- Primary Key structure for table config_tags_relation
+-- ----------------------------
+ALTER TABLE "config_tags_relation" ADD CONSTRAINT "config_tags_relation_pkey" PRIMARY KEY ("nid");
+
+-- ----------------------------
+-- Indexes structure for table group_capacity
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_group_id" ON "group_capacity" USING btree (
+                                                                   "group_id"
+    );
+
+-- ----------------------------
+-- Primary Key structure for table group_capacity
+-- ----------------------------
+ALTER TABLE "group_capacity" ADD CONSTRAINT "group_capacity_pkey" PRIMARY KEY ("id");
+
+-- ----------------------------
+-- Indexes structure for table his_config_info
+-- ----------------------------
+CREATE INDEX "idx_did" ON "his_config_info" USING btree (
+                                                         "data_id"
+    );
+CREATE INDEX "idx_gmt_create" ON "his_config_info" USING btree (
+                                                                "gmt_create"
+    );
+CREATE INDEX "idx_gmt_modified" ON "his_config_info" USING btree (
+                                                                  "gmt_modified"
+    );
+
+-- ----------------------------
+-- Primary Key structure for table his_config_info
+-- ----------------------------
+ALTER TABLE "his_config_info" ADD CONSTRAINT "his_config_info_pkey" PRIMARY KEY ("nid");
+
+-- ----------------------------
+-- Indexes structure for table permissions
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_role_permission" ON "permissions" USING btree (
+                                                                       "role",
+                                                                       "resource",
+                                                                       "action"
+    );
+
+-- ----------------------------
+-- Indexes structure for table roles
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_username_role" ON "roles" USING btree (
+                                                               "username",
+                                                               "role"
+    );
+
+-- ----------------------------
+-- Indexes structure for table tenant_capacity
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_tenant_id" ON "tenant_capacity" USING btree (
+                                                                     "tenant_id"
+    );
+
+-- ----------------------------
+-- Primary Key structure for table tenant_capacity
+-- ----------------------------
+ALTER TABLE "tenant_capacity" ADD CONSTRAINT "tenant_capacity_pkey" PRIMARY KEY ("id");
+
+-- ----------------------------
+-- Indexes structure for table tenant_info
+-- ----------------------------
+CREATE UNIQUE INDEX "uk_tenant_info_kptenantid" ON "tenant_info" USING btree (
+                                                                              "kp",
+                                                                              "tenant_id"
+    );

+ 2 - 2
资源文件/sql/pro_econ_testing_point.sql

@@ -7,7 +7,7 @@ create table pro_econ_testing_point
     name                     varchar(250),
     model                    varchar(30),
     type_id                  varchar(30),
-    "original_uniform_code " varchar(30),
+    original_uniform_code    varchar(30),
     uniform_code             varchar(30),
     ucv1                     varchar(30),
     ucv2                     varchar(30),
@@ -29,7 +29,7 @@ comment on column pro_econ_testing_point.name is '描述';
 
 comment on column pro_econ_testing_point.model is '机型';
 
-comment on column pro_econ_testing_point."original_uniform_code " is '原始统一编码';
+comment on column pro_econ_testing_point.original_uniform_code is '原始统一编码';
 
 comment on column pro_econ_testing_point.uniform_code is '统一编码';