From 8224781011071b80d6ede23b197276ef047184b9 Mon Sep 17 00:00:00 2001 From: Raod <1130305001@qq.com> Date: Tue, 22 Jun 2021 16:13:40 +0800 Subject: [PATCH] flyway --- report-core/pom.xml | 7 + .../gaea/business/ReportApplication.java | 5 +- .../gaea/business/code/ResponseCode.java | 33 ++ .../dashboard/dao/entity/ReportDashboard.java | 14 +- .../data/dataSet/dao/entity/DataSet.java | 4 +- .../service/impl/DataSetParamServiceImpl.java | 8 +- .../service/impl/JsTransformServiceImpl.java | 4 +- .../dataSource/dao/entity/DataSource.java | 4 +- .../dataSource/pool/util/DriverClassUtil.java | 6 +- .../service/impl/DataSourceServiceImpl.java | 36 +- .../data/report/dao/entity/Report.java | 4 +- .../modules/dict/dao/entity/GaeaDict.java | 4 +- .../service/impl/GaeaFileServiceImpl.java | 12 +- .../src/main/resources/bootstrap-dev.yml | 7 + .../db/migration/V1.0.0__init_db.sql | 25 ++ .../db/migration/V1.0.1__create_tables.sql | 321 ++++++++++++++++++ 16 files changed, 440 insertions(+), 54 deletions(-) create mode 100644 report-core/src/main/resources/db/migration/V1.0.0__init_db.sql create mode 100644 report-core/src/main/resources/db/migration/V1.0.1__create_tables.sql diff --git a/report-core/pom.xml b/report-core/pom.xml index da3c9e3b..372f3517 100644 --- a/report-core/pom.xml +++ b/report-core/pom.xml @@ -67,6 +67,13 @@ spring-boot-starter-gaea-log + + org.flywaydb + flyway-core + 5.2.1 + + + com.alibaba diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/ReportApplication.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/ReportApplication.java index ce50103e..45d32084 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/ReportApplication.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/ReportApplication.java @@ -11,10 +11,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * @since 2021-02-03 */ @EnabledGaeaConfiguration -@SpringBootApplication(scanBasePackages = { - "com.anjiplus.template.gaea", - "com.anji.plus" -}) +@SpringBootApplication @MapperScan(basePackages = { "com.anjiplus.template.gaea.business.modules.*.dao", "com.anjiplus.template.gaea.business.modules.*.**.dao", diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/code/ResponseCode.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/code/ResponseCode.java index d4c5ed63..06f80598 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/code/ResponseCode.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/code/ResponseCode.java @@ -65,4 +65,37 @@ public interface ResponseCode { * 组件未加载 */ String COMPONENT_NOT_LOAD = "Component.load.check.error"; + + String AUTH_PASSWORD_NOTSAME = "1001"; + String USER_PASSWORD_CONFIG_PASSWORD_CANOT_EQUAL = "1002"; + String OLD_PASSWORD_ERROR = "1003"; + String USER_ONTEXIST_ORGINFO = "1004"; + String USER_ONTEXIST_ROLEINFO = "1005"; + String MENU_TABLE_CODE_EXIST = "1006"; + String USER_CODE_ISEXIST = "1007"; + String ROLE_CODE_ISEXIST = "1008"; + String MENU_CODE_ISEXIST = "1009"; + String ORG_CODE_ISEXIST = "1010"; + String SEARCHNAME_ISEXIST = "1011"; + String SETTINGNAME_ISEXIST = "1012"; + String DICCODE_ISEXIST = "1013"; + String DEVICEID_LENGTH = "1014"; + String USERINFO_EMPTY = "1015"; + String FILE_EMPTY_FILENAME = "2001"; + String FILE_SUFFIX_UNSUPPORTED = "2002"; + String FILE_UPLOAD_ERROR = "2003"; + String FILE_ONT_EXSIT = "2004"; + String LIST_IS_EMPTY = "2005"; + String PUSHCODE_NEED_UNIQUE = "3001"; + String RECEIVER_IS_EMPTY = "3002"; + String DATA_SOURCE_CONNECTION_FAILED = "4001"; + String DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY = "4002"; + String EXECUTE_SQL_ERROR = "4003"; + String INCOMPLETE_PARAMETER_REPLACEMENT_VALUES = "4004"; + String EXECUTE_JS_ERROR = "4005"; + String ANALYSIS_DATA_ERROR = "4006"; + String REPORT_CODE_ISEXIST = "4007"; + String SET_CODE_ISEXIST = "4008"; + String SOURCE_CODE_ISEXIST = "4009"; + String CLASS_NOT_FOUND = "4010"; } diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dashboard/dao/entity/ReportDashboard.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dashboard/dao/entity/ReportDashboard.java index 24623063..6be5bad3 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dashboard/dao/entity/ReportDashboard.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dashboard/dao/entity/ReportDashboard.java @@ -2,15 +2,11 @@ package com.anjiplus.template.gaea.business.modules.data.dashboard.dao.entity; import com.anji.plus.gaea.annotation.Unique; -import com.anjiplus.template.gaea.common.RespCommonCode; -import lombok.Data; -import io.swagger.annotations.ApiModelProperty; - import com.anji.plus.gaea.curd.entity.GaeaBaseEntity; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.baomidou.mybatisplus.annotation.TableName; - -import javax.validation.constraints.*; -import java.sql.Timestamp; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; /** * @description 大屏设计 entity @@ -21,7 +17,7 @@ import java.sql.Timestamp; @Data public class ReportDashboard extends GaeaBaseEntity { @ApiModelProperty(value = "报表编码") - @Unique(code = RespCommonCode.REPORT_CODE_ISEXIST) + @Unique(code = ResponseCode.REPORT_CODE_ISEXIST) private String reportCode; @ApiModelProperty(value = "看板标题") @@ -55,4 +51,4 @@ public class ReportDashboard extends GaeaBaseEntity { private Integer sort; -} \ No newline at end of file +} diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSet/dao/entity/DataSet.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSet/dao/entity/DataSet.java index 05da2eb0..fec167bd 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSet/dao/entity/DataSet.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSet/dao/entity/DataSet.java @@ -3,7 +3,7 @@ package com.anjiplus.template.gaea.business.modules.data.dataSet.dao.entity; import com.anji.plus.gaea.annotation.Unique; import com.anji.plus.gaea.curd.entity.GaeaBaseEntity; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -17,7 +17,7 @@ import lombok.Data; @Data public class DataSet extends GaeaBaseEntity { @ApiModelProperty(value = "数据集编码") - @Unique(code = RespCommonCode.SET_CODE_ISEXIST) + @Unique(code = ResponseCode.SET_CODE_ISEXIST) private String setCode; @ApiModelProperty(value = "数据集名称") diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSetParam/service/impl/DataSetParamServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSetParam/service/impl/DataSetParamServiceImpl.java index 554caf60..e85e34c6 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSetParam/service/impl/DataSetParamServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSetParam/service/impl/DataSetParamServiceImpl.java @@ -8,7 +8,7 @@ import com.anjiplus.template.gaea.business.modules.data.dataSetParam.dao.DataSet import com.anjiplus.template.gaea.business.modules.data.dataSetParam.dao.entity.DataSetParam; import com.anjiplus.template.gaea.business.modules.data.dataSetParam.service.DataSetParamService; import com.anjiplus.template.gaea.business.modules.data.dataSetParam.util.ParamsResolverHelper; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -60,7 +60,7 @@ public class DataSetParamServiceImpl implements DataSetParamService { dynSentence = ParamsResolverHelper.resolveParams(contextData, dynSentence); } if (dynSentence.contains("${")) { - throw BusinessExceptionBuilder.build(RespCommonCode.INCOMPLETE_PARAMETER_REPLACEMENT_VALUES, dynSentence); + throw BusinessExceptionBuilder.build(ResponseCode.INCOMPLETE_PARAMETER_REPLACEMENT_VALUES, dynSentence); } return dynSentence; } @@ -102,7 +102,7 @@ public class DataSetParamServiceImpl implements DataSetParamService { return Boolean.parseBoolean(engine.get("result").toString()); } catch (Exception ex) { - throw BusinessExceptionBuilder.build(RespCommonCode.EXECUTE_JS_ERROR, ex.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.EXECUTE_JS_ERROR, ex.getMessage()); } } @@ -133,4 +133,4 @@ public class DataSetParamServiceImpl implements DataSetParamService { return true; } -} \ No newline at end of file +} diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSetTransform/service/impl/JsTransformServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSetTransform/service/impl/JsTransformServiceImpl.java index 1c41d583..73208467 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSetTransform/service/impl/JsTransformServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSetTransform/service/impl/JsTransformServiceImpl.java @@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.anji.plus.gaea.exception.BusinessExceptionBuilder; import com.anjiplus.template.gaea.business.modules.data.dataSetTransform.controller.dto.DataSetTransformDto; import com.anjiplus.template.gaea.business.modules.data.dataSetTransform.service.TransformStrategy; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import jdk.nashorn.api.scripting.ScriptObjectMirror; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -56,7 +56,7 @@ public class JsTransformServiceImpl implements TransformStrategy { ScriptObjectMirror result = (ScriptObjectMirror) engine.get("result"); return result.values().stream().map(o -> JSONObject.parseObject(JSONObject.toJSONString(o))).collect(Collectors.toList()); } catch (Exception ex) { - throw BusinessExceptionBuilder.build(RespCommonCode.EXECUTE_JS_ERROR, ex.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.EXECUTE_JS_ERROR, ex.getMessage()); } } } diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/dao/entity/DataSource.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/dao/entity/DataSource.java index 4999ab5a..cf10e553 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/dao/entity/DataSource.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/dao/entity/DataSource.java @@ -3,7 +3,7 @@ package com.anjiplus.template.gaea.business.modules.data.dataSource.dao.entity; import com.anji.plus.gaea.annotation.Unique; import com.anji.plus.gaea.curd.entity.GaeaBaseEntity; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -17,7 +17,7 @@ import lombok.Data; @Data public class DataSource extends GaeaBaseEntity { @ApiModelProperty(value = "数据源编码") - @Unique(code = RespCommonCode.SOURCE_CODE_ISEXIST) + @Unique(code = ResponseCode.SOURCE_CODE_ISEXIST) private String sourceCode; @ApiModelProperty(value = "数据源名称") diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/pool/util/DriverClassUtil.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/pool/util/DriverClassUtil.java index da1f71de..5f3973f3 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/pool/util/DriverClassUtil.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/pool/util/DriverClassUtil.java @@ -1,7 +1,7 @@ package com.anjiplus.template.gaea.business.modules.data.dataSource.pool.util; import com.anji.plus.gaea.exception.BusinessExceptionBuilder; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import org.apache.commons.lang3.StringUtils; import java.util.HashMap; @@ -62,7 +62,7 @@ public final class DriverClassUtil { try { Class.forName(driverClass); } catch (ClassNotFoundException e) { - throw BusinessExceptionBuilder.build(RespCommonCode.CLASS_NOT_FOUND, e.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.CLASS_NOT_FOUND, e.getMessage()); } } @@ -83,7 +83,7 @@ public final class DriverClassUtil { } } - throw BusinessExceptionBuilder.build(RespCommonCode.CLASS_NOT_FOUND, "Can't auto find match driver class for url: " + url); + throw BusinessExceptionBuilder.build(ResponseCode.CLASS_NOT_FOUND, "Can't auto find match driver class for url: " + url); } } diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/service/impl/DataSourceServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/service/impl/DataSourceServiceImpl.java index a6d2e991..cea9d3ae 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/service/impl/DataSourceServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/dataSource/service/impl/DataSourceServiceImpl.java @@ -17,7 +17,7 @@ import com.anjiplus.template.gaea.business.modules.data.dataSource.dao.entity.Da import com.anjiplus.template.gaea.business.modules.data.dataSource.pool.constant.JdbcConstants; import com.anjiplus.template.gaea.business.modules.data.dataSource.pool.util.JdbcUtil; import com.anjiplus.template.gaea.business.modules.data.dataSource.service.DataSourceService; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.extern.slf4j.Slf4j; @@ -99,7 +99,7 @@ public class DataSourceServiceImpl implements DataSourceService { testHttp(dto); break; default: - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY); } return true; @@ -117,7 +117,7 @@ public class DataSourceServiceImpl implements DataSourceService { case JdbcConstants.HTTP: return executeHttp(dto); default: - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY); } } @@ -137,7 +137,7 @@ public class DataSourceServiceImpl implements DataSourceService { case JdbcConstants.MYSQL: return mysqlTotal(sourceDto, dto); default: - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_TYPE_DOES_NOT_MATCH_TEMPORARILY); } } @@ -174,10 +174,10 @@ public class DataSourceServiceImpl implements DataSourceService { try { exchange = restTemplate.exchange(dto.getApiUrl(), HttpMethod.valueOf(dto.getMethod()), entity, JSONObject.class); } catch (Exception e) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); } if (exchange.getStatusCode().isError()) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, exchange.getBody()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, exchange.getBody()); } List result; try { @@ -200,7 +200,7 @@ public class DataSourceServiceImpl implements DataSourceService { result.add(jsonObject); } } catch (Exception e) { - throw BusinessExceptionBuilder.build(RespCommonCode.ANALYSIS_DATA_ERROR, e.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.ANALYSIS_DATA_ERROR, e.getMessage()); } return result; } @@ -229,19 +229,19 @@ public class DataSourceServiceImpl implements DataSourceService { Object value = rs.getObject(t); jo.put(t, value); } catch (SQLException throwable) { - throw BusinessExceptionBuilder.build(RespCommonCode.EXECUTE_SQL_ERROR, throwable.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.EXECUTE_SQL_ERROR, throwable.getMessage()); } }); list.add(jo); } return list; } catch (Exception throwable) { - throw BusinessExceptionBuilder.build(RespCommonCode.EXECUTE_SQL_ERROR, throwable.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.EXECUTE_SQL_ERROR, throwable.getMessage()); } finally { try { pooledConnection.close(); } catch (SQLException throwable) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, throwable.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, throwable.getMessage()); } } } @@ -260,10 +260,10 @@ public class DataSourceServiceImpl implements DataSourceService { try { exchange = restTemplate.exchange(dto.getApiUrl(), HttpMethod.valueOf(dto.getMethod()), entity, JSONObject.class); } catch (Exception e) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); } if (exchange.getStatusCode().isError()) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, exchange.getBody()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, exchange.getBody()); } JSONObject body = exchange.getBody(); List result = new ArrayList<>(); @@ -284,7 +284,7 @@ public class DataSourceServiceImpl implements DataSourceService { log.info("数据库测试连接成功:{}", catalog); unPooledConnection.close(); } catch (Exception e) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); } } @@ -305,10 +305,10 @@ public class DataSourceServiceImpl implements DataSourceService { try { exchange = restTemplate.exchange(apiUrl, HttpMethod.valueOf(method), entity, Object.class); if (exchange.getStatusCode().isError()) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, exchange.getBody()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, exchange.getBody()); } } catch (RestClientException e) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); } } @@ -330,10 +330,10 @@ public class DataSourceServiceImpl implements DataSourceService { try { exchange = restTemplate.exchange(apiUrl, HttpMethod.valueOf(method), entity, Object.class); if (exchange.getStatusCode().isError()) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, exchange.getBody()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, exchange.getBody()); } } catch (RestClientException e) { - throw BusinessExceptionBuilder.build(RespCommonCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); + throw BusinessExceptionBuilder.build(ResponseCode.DATA_SOURCE_CONNECTION_FAILED, e.getMessage()); } } @@ -381,4 +381,4 @@ public class DataSourceServiceImpl implements DataSourceService { } -} \ No newline at end of file +} diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/report/dao/entity/Report.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/report/dao/entity/Report.java index b60b8a78..c6a99a64 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/report/dao/entity/Report.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/data/report/dao/entity/Report.java @@ -2,7 +2,7 @@ package com.anjiplus.template.gaea.business.modules.data.report.dao.entity; import com.anji.plus.gaea.annotation.Unique; import com.anji.plus.gaea.curd.entity.GaeaBaseEntity; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -21,7 +21,7 @@ public class Report extends GaeaBaseEntity { private String reportName; @ApiModelProperty(value = "报表编码") - @Unique(code = RespCommonCode.REPORT_CODE_ISEXIST) + @Unique(code = ResponseCode.REPORT_CODE_ISEXIST) private String reportCode; @ApiModelProperty(value = "分组") diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/dao/entity/GaeaDict.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/dao/entity/GaeaDict.java index 6fb79734..a2c68e9a 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/dao/entity/GaeaDict.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/dict/dao/entity/GaeaDict.java @@ -2,7 +2,7 @@ package com.anjiplus.template.gaea.business.modules.dict.dao.entity; import com.anji.plus.gaea.annotation.Unique; import com.anji.plus.gaea.curd.entity.GaeaBaseEntity; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; @@ -22,7 +22,7 @@ public class GaeaDict extends GaeaBaseEntity implements Serializable { /** * 字典编码 */ - @Unique(code = RespCommonCode.DICCODE_ISEXIST) + @Unique(code = ResponseCode.DICCODE_ISEXIST) private String dictCode; /** diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/file/service/impl/GaeaFileServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/file/service/impl/GaeaFileServiceImpl.java index 259e3a8d..92b82517 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/file/service/impl/GaeaFileServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/file/service/impl/GaeaFileServiceImpl.java @@ -9,7 +9,7 @@ import com.anjiplus.template.gaea.business.modules.export.dao.GaeaExportMapper; import com.anjiplus.template.gaea.business.modules.export.dao.entity.GaeaExport; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.anjiplus.template.gaea.common.RespCommonCode; +import com.anjiplus.template.gaea.business.code.ResponseCode; import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper; import com.anji.plus.gaea.exception.BusinessExceptionBuilder; import com.anjiplus.template.gaea.common.util.StringPatternUtil; @@ -74,14 +74,14 @@ public class GaeaFileServiceImpl implements GaeaFileService { try { String fileName = file.getOriginalFilename(); if (StringUtils.isBlank(fileName)) { - throw BusinessExceptionBuilder.build(RespCommonCode.FILE_EMPTY_FILENAME); + throw BusinessExceptionBuilder.build(ResponseCode.FILE_EMPTY_FILENAME); } String suffixName = fileName.substring(fileName.lastIndexOf(".")); //白名单校验(不区分大小写) List list = new ArrayList(Arrays.asList(whiteList.split("\\|"))); list.addAll(list.stream().map(String::toUpperCase).collect(Collectors.toList())); if (!list.contains(suffixName)) { - throw BusinessExceptionBuilder.build(RespCommonCode.FILE_SUFFIX_UNSUPPORTED); + throw BusinessExceptionBuilder.build(ResponseCode.FILE_SUFFIX_UNSUPPORTED); } // 生成文件唯一性标识 String fileId = UUID.randomUUID().toString(); @@ -104,7 +104,7 @@ public class GaeaFileServiceImpl implements GaeaFileService { } catch (Exception e) { TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); log.error("file upload error: {}", e); - throw BusinessExceptionBuilder.build(RespCommonCode.FILE_UPLOAD_ERROR); + throw BusinessExceptionBuilder.build(ResponseCode.FILE_UPLOAD_ERROR); } } @@ -118,12 +118,12 @@ public class GaeaFileServiceImpl implements GaeaFileService { queryWrapper.eq(GaeaFile::getFileId, fileId); GaeaFile gaeaFile = gaeaFileMapper.selectOne(queryWrapper); if (null == gaeaFile) { - throw BusinessExceptionBuilder.build(RespCommonCode.FILE_ONT_EXSIT); + throw BusinessExceptionBuilder.build(ResponseCode.FILE_ONT_EXSIT); } //解析文件路径、文件名和后缀 String filePath = gaeaFile.getFilePath(); if (StringUtils.isBlank(filePath)) { - throw BusinessExceptionBuilder.build(RespCommonCode.FILE_ONT_EXSIT); + throw BusinessExceptionBuilder.build(ResponseCode.FILE_ONT_EXSIT); } String filename = filePath.substring(filePath.lastIndexOf(File.separator)); String fileSuffix = filename.substring(filename.lastIndexOf(".")); diff --git a/report-core/src/main/resources/bootstrap-dev.yml b/report-core/src/main/resources/bootstrap-dev.yml index e8c4e1d6..c5650e52 100644 --- a/report-core/src/main/resources/bootstrap-dev.yml +++ b/report-core/src/main/resources/bootstrap-dev.yml @@ -24,6 +24,13 @@ spring: port: 6379 password: appuser@anji database: 1 + flyway: + baseline-on-migrate: true + #数据库连接配置 + url: ${spring.datasource.url} + user: ${spring.datasource.username} + password: ${spring.datasource.password} + placeholder-replacement: false generator: enabled: true workspace: /workspace/gaea diff --git a/report-core/src/main/resources/db/migration/V1.0.0__init_db.sql b/report-core/src/main/resources/db/migration/V1.0.0__init_db.sql new file mode 100644 index 00000000..87a651c2 --- /dev/null +++ b/report-core/src/main/resources/db/migration/V1.0.0__init_db.sql @@ -0,0 +1,25 @@ +CREATE +DATABASE IF NOT EXISTS `aj_report` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; + +USE +`aj_report`; + +CREATE TABLE `flyway_schema_history` +( + `installed_rank` int(11) NOT NULL, + `version` varchar(50) DEFAULT NULL, + `description` varchar(200) NOT NULL, + `type` varchar(20) NOT NULL, + `script` varchar(1000) NOT NULL, + `checksum` int(11) DEFAULT NULL, + `installed_by` varchar(100) NOT NULL, + `installed_on` timestamp NOT NULL DEFAULT current_timestamp(), + `execution_time` int(11) NOT NULL, + `success` tinyint(1) NOT NULL, + PRIMARY KEY (`installed_rank`), + KEY `flyway_schema_history_s_idx` (`success`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +insert into `flyway_schema_history`(`installed_rank`, `version`, `description`, `type`, `script`, `checksum`, + `installed_by`, `installed_on`, `execution_time`, `success`) +values (1, '1', '<< Flyway Baseline >>', 'BASELINE', '<< Flyway Baseline >>', NULL, 'admin', now(), 0, 1); diff --git a/report-core/src/main/resources/db/migration/V1.0.1__create_tables.sql b/report-core/src/main/resources/db/migration/V1.0.1__create_tables.sql new file mode 100644 index 00000000..1f72ff60 --- /dev/null +++ b/report-core/src/main/resources/db/migration/V1.0.1__create_tables.sql @@ -0,0 +1,321 @@ +/* + Navicat Premium Data Transfer + + Source Server : 10.108.26.197gaea-dev + Source Server Type : MySQL + Source Server Version : 50728 + Source Host : 10.108.26.197:3306 + Source Schema : aj_report + + Target Server Type : MySQL + Target Server Version : 50728 + File Encoding : 65001 + + Date: 22/06/2021 15:38:42 +*/ + +SET NAMES utf8mb4; +SET +FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for gaea_dict +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_dict`; +CREATE TABLE `gaea_dict` +( + `id` int(11) NOT NULL AUTO_INCREMENT, + `dict_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典名称', + `dict_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典编码', + `remark` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新用户', + `update_time` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(11) NULL DEFAULT NULL COMMENT '版本', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 49 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数组字典' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_dict_item +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_dict_item`; +CREATE TABLE `gaea_dict_item` +( + `id` int(11) NOT NULL AUTO_INCREMENT, + `dict_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据字典编码', + `item_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典项名称', + `item_value` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字典项值', + `item_extend` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '字典扩展项', + `enabled` int(1) NULL DEFAULT 1 COMMENT '1:启用 0:禁用', + `locale` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '语言标识', + `remark` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '描述', + `sort` int(11) NULL DEFAULT NULL COMMENT '排序', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新用户', + `update_time` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(11) NULL DEFAULT NULL COMMENT '版本', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 269 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据字典项' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_export +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_export`; +CREATE TABLE `gaea_export` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `file_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件在t_file中的id,前端传它来读流接口显示,http://auth/file/download/fileId', + `file_title` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件标题,比如:对账单报表6月份报表', + `result_start_time` datetime(0) NULL DEFAULT NULL COMMENT '导出前,查询的数据开始时间', + `result_end_time` datetime(0) NULL DEFAULT NULL COMMENT '导出前,查询的数据结束时间', + `result_size` bigint(20) NOT NULL DEFAULT 0 COMMENT '导出查询结果,数据总条数', + `file_create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP (0) COMMENT '文件导出触发时间', + `file_finish_time` datetime(0) NULL DEFAULT NULL COMMENT '文件生成完成时间', + `file_status` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '文件状态,creating生成中,success生成成功,failed生成失败', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + `version` int(8) NULL DEFAULT NULL COMMENT '版本号', + `remark` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 190 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '导出中心' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_file +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_file`; +CREATE TABLE `gaea_file` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `file_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '生成的唯一uuid', + `file_path` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件在linux中的完整目录,比如/app/dist/export/excel/${fileid}.xlsx', + `url_path` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '通过接口的下载完整http路径', + `file_instruction` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件内容说明,比如 对账单(202001~202012)', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `create_time` timestamp(0) NULL DEFAULT NULL, + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `update_time` timestamp(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP (0), + `version` int(11) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 291 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_report +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_report`; +CREATE TABLE `gaea_report` +( + `id` bigint(11) NOT NULL AUTO_INCREMENT, + `report_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', + `report_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报表编码', + `report_group` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分组', + `report_type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报表类型', + `report_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报表描述', + `enable_flag` int(1) NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG', + `delete_flag` int(1) NULL DEFAULT 0 COMMENT '0--未删除 1--已删除 DIC_NAME=DELETE_FLAG', + `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(8) NULL DEFAULT NULL COMMENT '版本号', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `UNIQUE_REPORT_CODE`(`report_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 183 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_report_dashboard +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_report_dashboard`; +CREATE TABLE `gaea_report_dashboard` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '看板id', + `report_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '报表编码', + `title` varchar(254) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '看板标题', + `width` bigint(20) NULL DEFAULT NULL COMMENT '宽度px', + `height` bigint(20) NULL DEFAULT NULL COMMENT '高度px', + `background_color` varchar(24) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '背景色', + `background_image` varchar(254) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '背景图片', + `preset_line` varchar(4096) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作台中的辅助线', + `refresh_seconds` int(11) NULL DEFAULT NULL COMMENT '自动刷新间隔秒,数据字典REFRESH_TYPE', + `enable_flag` int(1) NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG', + `delete_flag` int(1) NULL DEFAULT 0 COMMENT ' 0--未删除 1--已删除 DIC_NAME=DEL_FLAG', + `sort` int(11) NULL DEFAULT 0 COMMENT '排序,降序', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `create_time` datetime(0) NULL DEFAULT NULL, + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `update_time` datetime(0) NULL DEFAULT NULL, + `version` int(8) NULL DEFAULT NULL COMMENT '版本号', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `UNIQUE_REPORT_CODE`(`report_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 264 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_report_dashboard_widget +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_report_dashboard_widget`; +CREATE TABLE `gaea_report_dashboard_widget` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '组件id', + `report_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '报表编码', + `type` varchar(24) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件类型参考字典DASHBOARD_PANEL_TYPE', + `setup` varchar(4096) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件的渲染属性json', + `data` varchar(4096) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件的数据属性json', + `collapse` varchar(4096) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件的配置属性json', + `position` varchar(4096) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件的大小位置属性json', + `enable_flag` int(1) NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG', + `delete_flag` int(1) NULL DEFAULT 0 COMMENT ' 0--未删除 1--已删除 DIC_NAME=DEL_FLAG', + `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序,图层的概念', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `create_time` datetime(0) NULL DEFAULT NULL, + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `update_time` datetime(0) NULL DEFAULT NULL, + `version` int(8) NULL DEFAULT NULL COMMENT '版本号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 6286 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_report_data_set +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_report_data_set`; +CREATE TABLE `gaea_report_data_set` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `set_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据集编码', + `set_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据集名称', + `set_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据集描述', + `source_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源编码', + `dyn_sentence` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '动态查询sql或者接口中的请求体', + `case_result` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '结果案例', + `enable_flag` int(1) NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG', + `delete_flag` int(1) NULL DEFAULT 0 COMMENT '0--未删除 1--已删除 DIC_NAME=DELETE_FLAG', + `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(8) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `unique_set_code`(`set_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 46 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据集管理' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_report_data_set_param +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_report_data_set_param`; +CREATE TABLE `gaea_report_data_set_param` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `set_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据集编码', + `param_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数名', + `param_desc` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数描述', + `param_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数类型,字典=', + `sample_item` varchar(1080) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数示例项', + `required_flag` int(1) NULL DEFAULT 1 COMMENT '0--非必填 1--必填 DIC_NAME=REQUIRED_FLAG', + `validation_rules` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'js校验字段值规则,满足校验返回 true', + `order_num` int(11) NULL DEFAULT NULL COMMENT '排序', + `enable_flag` int(1) NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG', + `delete_flag` int(1) NULL DEFAULT 0 COMMENT '0--未删除 1--已删除 DIC_NAME=DELETE_FLAG', + `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(8) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 59 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据集查询参数' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_report_data_set_transform +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_report_data_set_transform`; +CREATE TABLE `gaea_report_data_set_transform` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `set_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据集编码', + `transform_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据转换类型,DIC_NAME=TRANSFORM_TYPE; js,javaBean,字典转换', + `transform_script` varchar(10800) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据转换script,处理逻辑', + `order_num` int(2) NULL DEFAULT NULL COMMENT '排序,执行数据转换顺序', + `enable_flag` int(1) NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG', + `delete_flag` int(1) NULL DEFAULT 0 COMMENT '0--未删除 1--已删除 DIC_NAME=DELETE_FLAG', + `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(8) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 36 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据集数据转换' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_report_data_source +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_report_data_source`; +CREATE TABLE `gaea_report_data_source` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `source_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源编码', + `source_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源名称', + `source_desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源描述', + `source_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源类型 DIC_NAME=SOURCE_TYPE; mysql,orace,sqlserver,elasticsearch,接口,javaBean,数据源类型字典中item-extend动态生成表单', + `source_config` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源连接配置json:关系库{ jdbcUrl:\'\', username:\'\', password:\'\' } ES{ hostList:\' ip1:9300, + ip2:9300, + ip3:9300\', clusterName:\'elasticsearch_cluster\' } 接口{ apiUrl:\' http://ip:port/url\', method:\'\' } javaBean{ beanNamw:\' xxx\' }', + `enable_flag` int(1) NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG', + `delete_flag` int(1) NULL DEFAULT 0 COMMENT '0--未删除 1--已删除 DIC_NAME=DELETE_FLAG', + `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(8) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `unique_source_code`(`source_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 43 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '数据源管理' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_report_excel +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_report_excel`; +CREATE TABLE `gaea_report_excel` +( + `id` bigint(11) NOT NULL AUTO_INCREMENT, + `report_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报表编码', + `set_codes` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据集编码,以|分割', + `set_param` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据集查询参数', + `json_str` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '报表json串', + `enable_flag` int(1) NULL DEFAULT 1 COMMENT '0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG', + `delete_flag` int(1) NULL DEFAULT 0 COMMENT '0--未删除 1--已删除 DIC_NAME=DELETE_FLAG', + `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(8) NULL DEFAULT NULL COMMENT '版本号', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `UNIQUE_REPORT_CODE`(`report_code`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 207 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for gaea_ui_i18n +-- ---------------------------- +DROP TABLE IF EXISTS `gaea_ui_i18n`; +CREATE TABLE `gaea_ui_i18n` +( + `id` int(11) NOT NULL AUTO_INCREMENT, + `locale` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'zh' COMMENT '语言标识', + `cata_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '行业标识', + `system` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属系统', + `module` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, + `code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字段编码', + `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字段名称', + `remark` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '业务描述', + `refer` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联表名', + `enabled` int(1) NOT NULL DEFAULT 1 COMMENT '启用状态:1:启用 0:禁用', + `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新用户', + `update_time` timestamp(0) NULL DEFAULT NULL COMMENT '更新时间', + `version` int(11) NULL DEFAULT NULL COMMENT '版本', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 4765 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '字段命名国际化管理' ROW_FORMAT = Dynamic; + +SET +FOREIGN_KEY_CHECKS = 1;