diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4b83fbd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,76 @@
+# For Java
+*.lck
+target/
+*.json
+log/
+logback-test.xml
+
+
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+# Image snapshot diff
+__diff_output__/
+/jest-stare
+
+*.iml
+.idea/
+.ipr
+.iws
+*~
+~*
+*.diff
+*.patch
+*.bak
+.DS_Store
+Thumbs.db
+.project
+.*proj
+.svn/
+*.swp
+*.swo
+*.log
+*.log.*
+*.json.gzip
+node_modules/
+.buildpath
+.settings
+dist
+npm-debug.log
+nohup.out
+_site
+_data
+report.html
+/lib
+/es
+elasticsearch-*
+config/base.yaml
+/.vscode/
+/coverage
+/.history
+*.tmp
+!**/nacos/target
+**/nacos/data/*
+**/nacos/logs/*
+**/seata/bin/*
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..84bf080
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,22 @@
+# 基础镜像
+FROM bellsoft/liberica-openjre-rocky:21
+# FROM bellsoft/liberica-openjre-rocky:17
+# FROM bellsoft/liberica-openjre-rocky:11
+# FROM bellsoft/liberica-openjre-rocky:8
+LABEL maintainer=yunzhupaas-team
+
+# 设置时区
+ENV TZ=Asia/Shanghai
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+# 指定运行时的工作目录
+WORKDIR /data/yunzhupaassoft/univerApi
+
+# 将构建产物jar包拷贝到运行时目录中
+COPY yunzhupaas-datareport-univer-admin/target/*.jar ./yunzhupaas-univer-admin.jar
+
+# 指定容器内运行端口
+EXPOSE 32000
+
+# 指定容器启动时要运行的命令
+ENTRYPOINT ["/bin/sh","-c","java -javaagent:./yunzhupaas-univer-admin.jar -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom --add-opens java.base/java.lang=ALL-UNNAMED -XX:+DisableAttachMechanism -jar yunzhupaas-univer-admin.jar"]
diff --git a/README b/README
deleted file mode 100644
index e69de29..0000000
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7286ec8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,383 @@
+> 特别说明:源码、JDK、数据库、Redis等安装或存放路径禁止包含中文、空格、特殊字符等
+
+## 一 环境要求
+
+### 1.1 开发环境
+
+| 类目 | 版本说明或建议 |
+| --- |------------------|
+| 硬件 | 开发电脑建议使用I3及以上CPU,16G及以上内存 |
+| 操作系统 | Windows 10/11,MacOS |
+| JDK | 默认使用JDK 21,如需要切换JDK 8/11/17版本请参考文档调整代码,推荐使用 `OpenJDK`,如 `Liberica JDK`、`Eclipse Temurin`、`Alibaba Dragonwell`、`BiSheng` 等发行版; |
+| Maven | 依赖管理工具,推荐使用 `3.6.3` 及以上版本 |
+| Redis | 数据缓存,推荐使用 `5.0` 及以上版本 |
+| 数据库 | 兼容 `MySQL 5.7.x/8.x`、`SQLServer 2012+`、`Oracle 11g`、`PostgreSQL 12+`、`达梦数据库(DM8)`、`人大金仓数据库(KingbaseES_V8R6)` |
+| IDE | 代码集成开发环境,推荐使用 `IDEA2024` 及以上版本,兼容 `Eclipse`、 `Spring Tool Suite` 等IDE工具 |
+| 文件存储 | 默认使用本地存储,兼容 `MinIO` 及多个云对象存储,如 `阿里云 OSS`、`华为云 OBS`、`七牛云 Kodo`、`腾讯云 COS` 等; |
+
+### 1.2 运行环境
+
+> 适用于测试或生产环境
+
+| 类目 | 版本说明或建议 |
+| --- |-----------------------------------------------|
+| 服务器配置 | 建议至少在 `4C/16G/50G` 的机器配置下运行;|
+| 操作系统 | 建议使用 `Windows Server 2019` 及以上版本或主流 `Linux` 发行版本,推荐使用 `Linux` 环境;兼容 `统信UOS`,`OpenEuler`,`麒麟服务器版` 等信创环境; |
+| JRE | 默认使用JRE 21,如需要切换JRE 8/11/17版本请参考文档调整代码;推荐使用 `OpenJDK`,如 `Liberica JDK`、`Eclipse Temurin`、`Alibaba Dragonwell`、`BiSheng` 等发行版; |
+| Redis | 数据缓存,推荐使用 `5.0` 及以上版本 |
+| 数据库 | 兼容 `MySQL 5.7.x/8.x`、`SQLServer 2012+`、`Oracle 11g`、`PostgreSQL 12+`、`达梦数据库(DM8)`、`人大金仓数据库(KingbaseES_V8R6)` |
+| 文件存储 | 默认使用本地存储,兼容 `MinIO` 及多个云对象存储,如 `阿里云 OSS`、`华为云 OBS`、`七牛云 Kodo`、`腾讯云 COS` 等; |
+
+## 二 关联项目
+
+| 项目 | 分支 | 说明 |
+|--------------------|---------------|------------|
+| yunzhupaas-common | v5.2.x-stable | 项目基础依赖源码 |
+| yunzhupaas-java-datareport-univer-core | v5.2.x-stable | Univer报表核心依赖源码 |
+
+## 三 Maven私服配置
+
+> 建议使用 Apache Maven 3.6.3 及以上版本
以解决依赖无法从公共Maven仓库下载的问题
通过官方私服下载依赖完成后,由于IDEA的缓存可能会出现部分报红,重启IDEA即可
+
+打开Maven安装目录中的 `conf/settings.xml` 文件,
+在 `` 中添加如下内容
+
+```xml
+
+ maven-releases
+ admin
+ admin123
+
+```
+
+在 `` 中添加
+
+```xml
+
+ maven-releases
+ *
+ maven-releases
+ https://repository.yunzhupaas.com/repository/maven-public/
+
+```
+
+## 四 开发环境
+
+### 4.1 导入数据库脚本
+
+> 以 MySQL数据库为例
字符集:`utf8mb4`
排序规则:`utf8mb4_general_ci`
+
+在MySQL创建 `yunzhupaas_init` 数据库,并将 `yunzhupaas-database/MySQL/yunzhupaas_db_init.sql` 导入;
+
+### 4.2 导入依赖
+
+详见 `yunzhupaas-java-datareport-univer-core` 项目中的 `README.md` 文档说明
+
+### 4.3 项目配置
+
+打开编辑 `yunzhupaas-datareport-univer-admin/src/main/resources/application.yml`
+
+#### 4.3.1 指定环境配置
+
+环境说明:
+
+- `application-dev.yml` 开发环境(默认)
+- `application-preview.yml` 预生产环境
+- `application-test.yml` 测试环境
+- `application-prod.yml` 生产环境
+
+> 以开发环境为例,根据实际需求修改
+
+```yaml
+# application.yml第 6 行,可选值:dev(开发环境-默认)、test(测试环境)、preview(预生产环境)、prod(生产环境)
+active: dev
+```
+
+#### 4.3.2 配置域名
+
+打开编辑 `yunzhupaas-datareport-univer-admin/src/main/resources/application.yml` ,修改以下配置
+
+```yaml
+ ApiDomain: http://127.0.0.1:30000 #主项目后端域名(文档预览中使用)
+ FrontDomain: http://127.0.0.1:3100 #前端域名(文档预览中使用)
+ AppDomain: http://127.0.0.1:8080 #app/h5端域名配置(文档预览中使用)
+```
+#### 4.3.3 调整运行端口
+> 根据实际需求调整
+
+打开编辑 `yunzhupaas-datareport-univer-admin/src/main/resources/application-dev.yml`,第 5 行
+
+```yaml
+port: 32000 # 默认运行端口
+```
+
+#### 4.3.4 数据源配置
+
+配置参数说明:
+
+- `db-type`:数据库类型(可选值:`MySQL`、`SQLServer`、`Oracle`、`PostgreSQL`、`DM`、`KingbaseES`)
+- `host`:数据库主机地址
+- `port`:数据库端口
+- `dbname`:平台初始库
+- `username`:数据库用户名
+- `password`:数据库密码
+- `db-schema`:数据库模式
+- `prepare-url`:自定义JDBC连接配置
+
+打开编辑 `yunzhupaas-datareport-univer-admin/src/main/resources/application-dev.yml`,修改以下配置
+
+##### 4.3.4.1 MySQL数据库
+
+```yaml
+ datasource:
+ db-type: MySQL
+ host: 127.0.0.1
+ port: 3306
+ db-name: yunzhupaas_init
+ username: dbuser
+ password: dbpasswd
+ db-schema:
+ prepare-url:
+```
+
+##### 4.3.4.2 SQLServer数据库
+
+```yaml
+ datasource:
+ db-type: SQLServer
+ host: 127.0.0.1
+ port: 1433
+ db-name: yunzhupaas_init
+ username: dbuser
+ password: dbpasswd
+ db-schema:
+ prepare-url:
+```
+
+##### 4.3.4.3 Oracle数据库
+
+```yaml
+ datasource:
+ db-type: Oracle
+ host: 127.0.0.1
+ port: 1521
+ db-name:
+ username: YUNZHUPAAS_INIT
+ password: dbpasswd
+ db-schema:
+ prepare-url: jdbc:oracle:thin:@127.0.0.1:1521:ORCL
+```
+
+##### 4.3.4.4 PostgreSQL数据库配置
+
+```yaml
+ datasource:
+ db-type: PostgreSQL
+ host: 127.0.0.1
+ port: 5432
+ db-name: yunzhupaas_init
+ username: postgres
+ password: dbpasswd
+ db-schema: public
+ prepare-url:
+```
+
+##### 4.3.4.5 达梦(DM8)数据库
+
+```yaml
+ datasource:
+ db-type: DM
+ host: 127.0.0.1
+ port: 5236
+ db-name: YUNZHUPAAS_INIT
+ username: DBUSER
+ password: dbpasswd
+ db-schema:
+ prepare-url:
+ tablespace: MAIN
+```
+
+##### 4.3.4.6 人大金仓(KingbaseES_V8R6)数据库
+
+```yaml
+ datasource:
+ db-type: KingbaseES
+ host: 127.0.0.1
+ port: 54321
+ db-name: yunzhupaas_init
+ username: system
+ password: dbpasswd
+ db-schema: public
+ prepare-url:
+```
+
+#### 4.3.5 Redis配置
+
+打开编辑 `yunzhupaas-datareport-univer-admin/src/main/resources/application-dev.yml`,修改以下配置
+> 支持单机模式和集群模式,配置默认为单机模式
+
+**若使用Redis单机模式**
+> 第 71-82 行
+
+```yaml
+ redis:
+ database: 1 #缓存库编号
+ host: 127.0.0.1
+ port: 6379
+ password: 123456 # 密码为空时,请将本行注释
+ timeout: 3000 #超时时间(单位:秒)
+ lettuce: #Lettuce为Redis的Java驱动包
+ pool:
+ max-active: 8 # 连接池最大连接数
+ max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ min-idle: 0 # 连接池中的最小空闲连接
+ max-idle: 8 # 连接池中的最大空闲连接
+```
+
+**若使用Redis集群模式**
+> 第 85-101 行
+
+```yaml
+ redis:
+ cluster:
+ nodes:
+ - 192.168.0.225:6380
+ - 192.168.0.225:6381
+ - 192.168.0.225:6382
+ - 192.168.0.225:6383
+ - 192.168.0.225:6384
+ - 192.168.0.225:6385
+ password: 123456 # 密码为空时,请将本行注释
+ timeout: 3000 # 超时时间(单位:秒)
+ lettuce: #Lettuce为Redis的Java驱动包
+ pool:
+ max-active: 8 # 连接池最大连接数
+ max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ min-idle: 0 # 连接池中的最小空闲连接
+ max-idle: 8 # 连接池中的最大空闲连接
+```
+
+#### 4.3.6 静态资源配置
+
+打开编辑 `yunzhupaas-datareport-univer-admin/src/main/resources/application-dev.yml` ,修改以下配置(第 121-166 行)
+> 默认使用本地存储,兼容 `MinIO` 及多个云对象存储,如阿里云 OSS、华为云 OBS、七牛云 Kodo、腾讯云 COS等
+
+```yaml
+ # ===================== 文件存储配置 =====================
+ file-storage: #文件存储配置,不使用的情况下可以不写
+ default-platform: local-plus-1 #默认使用的存储平台
+ thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】
+ local-plus: # 本地存储升级版
+ - platform: local-plus-1 # 存储平台标识
+ enable-storage: true #启用存储
+ enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高)
+ domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名
+ base-path: D:/project/yunzhupaas-resources/ # 基础路径
+ path-patterns: /** # 访问路径
+ storage-path: # 存储路径
+ aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写
+ - platform: aliyun-oss-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ end-point: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/
+ base-path: hy/ # 基础路径
+ qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写
+ - platform: qiniu-kodo-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/
+ base-path: base/ # 基础路径
+ tencent-cos: # 腾讯云 COS
+ - platform: tencent-cos-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ secret-id: ??
+ secret-key: ??
+ region: ?? #存仓库所在地域
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/
+ base-path: hy/ # 基础路径
+ minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里
+ - platform: minio-1 # 存储平台标识
+ enable-storage: true # 启用存储
+ access-key: Q9jJs2b6Tv
+ secret-key: Thj2WkpLu9DhmJyJ
+ end-point: http://192.168.0.207:9000/
+ bucket-name: yunzhupaassoftoss
+ domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/
+ base-path: # 基础路径
+```
+
+### 4.4 执行调试或运行
+
+#### 4.4.1 `yunzhupaas-java-datareport-univer-core` 项目未使用加密
+
+- 在IDEA中, 展开右侧 `Maven` 中 `Profiles` 去除勾选 `encrypted` 选项, 再点击 Maven `刷新` 图标刷新Maven
+- 找到 `yunzhupaas-datareport-univer-admin/src/main/java/yunzhupaas/ReportUniverApplication.java`,右击运行即可。
+
+若使用JDK9及以上版本,在IDEA中,打开 `Edit Configurations` VM启动参数添加如下参数:
+
+ ```bash
+ --add-opens java.base/java.lang=ALL-UNNAMED
+ ```
+
+#### 4.4.2 `yunzhupaas-java-datareport-univer-core` 项目使用加密
+
+- 在IDEA中,展开右侧 `Maven` 中 `Profiles` 勾选 `encrypted` 选项, 再点击Maven `刷新` 图标刷新Maven
+- 在IDEA中,双击右侧 `Maven` 中 `yunzhupaas-datareport-univer` > `clean` 将会自动安装加密打包插件, 并创建创建 `yunzhupaas-datareport-univer-entity/target/copylib` 复制依赖包用于下一步运行
+
+**参数说明**:
+
+```bash
+# 打开项目中`yunzhupaas-datareport-univer-entity/target/copylib` 目录, 复制Jar包 `yunzhupaas-datareport-univer-model-版本号.jar` 的文件名
+-javaagent:项目存放路径/yunzhupaas-datareport-univer-entity/target/copylib/yunzhupaas-datareport-univer-model-当前版本号.jar(上面复制的文件名)="decryptProjectPathPrefix=yunzhupaas-datareport-univer-common___yunzhupaas-datareport-univer-model"
+```
+
+- 在IDEA中,打开 `Edit Configurations` VM启动参数添加如下参数
+
+若使用 JDK8 运行,需要替换下方命令示例中的Jar包路径
+
+ ``` bash
+-XX:+DisableAttachMechanism
+-javaagent:D:/Projects/IdeaProjects/yunzhupaas-java-datareport-univer/yunzhupaas-datareport-univer-entity/target/copylib/yunzhupaas-datareport-univer-model-5.1.0-RELEASE.jar="decryptProjectPathPrefix=yunzhupaas-datareport-univer-common___yunzhupaas-datareport-univer-model"
+ ```
+
+若使用JDK 9及以上版本,需要替换下方命令示例中的Jar包路径
+
+ ``` bash
+--add-opens java.base/java.lang=ALL-UNNAMED
+-XX:+DisableAttachMechanism
+-javaagent:D:/Projects/IdeaProjects/yunzhupaas-java-datareport-univer/yunzhupaas-datareport-univer-entity/target/copylib/yunzhupaas-datareport-univer-model-5.1.0-RELEASE.jar="decryptProjectPathPrefix=yunzhupaas-datareport-univer-common___yunzhupaas-datareport-univer-model"
+ ```
+## 五 项目发布
+
+### 5.1 `yunzhupaas-java-datareport-univer-core` 项目未使用加密
+
+- 在IDEA中, 展开右侧 `Maven` 中 `Profiles` 去除勾选 `encrypted` 选项, 再点击Maven `刷新` 图标刷新Maven
+- 在IDEA中,双击右侧Maven中 `yunzhupaas-datareport-univer` > `Lifecycle` > `clean` 清理项目
+- 在IDEA中,双击右侧Maven中 `yunzhupaas-datareport-univer` > `Lifecycle` > `package` 打包项目
+- 打开 `yunzhupaas-datareport-univer/yunzhupaas-datareport-univer-entity/target`,将 `yunzhupaas-datareport-univer-admin-5.1.0-RELEASE.jar` 上传至服务器
+
+### 5.2 `yunzhupaas-java-datareport-univer-core` 项目使用加密
+
+- 在IDEA中, 展开右侧 `Maven` 中 `Profiles` 勾选 `encrypted` 选项, 再点击Maven `刷新` 图标刷新Maven
+- 在IDEA中,双击右侧 `Maven` > `yunzhupaas-java-datareport-univer` > `clean` 将会自动安装加密打包插件
+- 在IDEA中,双击右侧 `Maven` > `yunzhupaas-java-datareport-univer` > `Lifecycle` > `package` 打包项目
+- 打开 `yunzhupaas-datareport-univer/yunzhupaas-datareport-univer-admin/target`,将 `yunzhupaas-datareport-univer-admin-5.1.0-RELEASE.jar` 上传至服务器
+- 启动命令
+
+**若使用 JDK/JRE 8 运行**
+
+```bash
+java -javaagent:./yunzhupaas-datareport-univer-admin-5.1.0-RELEASE.jar -XX:+DisableAttachMechanism -jar yunzhupaas-datareport-univer-admin-5.1.0-RELEASE.jar
+ ```
+
+**若使用 JDK/JRE 9及以上版本运行**
+
+```bash
+java -javaagent:./yunzhupaas-datareport-univer-admin-5.1.0-RELEASE.jar --add-opens java.base/java.lang=ALL-UNNAMED -XX:+DisableAttachMechanism -jar yunzhupaas-datareport-univer-admin-5.1.0-RELEASE.jar
+ ```
diff --git a/allatori/allatori.xml b/allatori/allatori.xml
new file mode 100644
index 0000000..ddd45d1
--- /dev/null
+++ b/allatori/allatori.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/allatori/class-winter-maven-plugin-pom.xml b/allatori/class-winter-maven-plugin-pom.xml
new file mode 100644
index 0000000..b8cef5e
--- /dev/null
+++ b/allatori/class-winter-maven-plugin-pom.xml
@@ -0,0 +1,37 @@
+
+
+ 4.0.0
+
+ com.idea-aedi
+ class-winter-core
+ enhance-2.9.4
+
+
+
+ com.idea-aedi
+ class-winter-core
+ ${project.version}
+
+
+
+ org.apache.maven
+ maven-plugin-api
+ 3.8.1
+
+
+
+ org.apache.maven.plugin-tools
+ maven-plugin-annotations
+ 3.6.1
+ provided
+
+
+
+ org.apache.maven
+ maven-project
+ 2.2.1
+
+
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..cd46753
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,49 @@
+
+
+ 4.0.0
+
+
+ com.yunzhupaas
+ yunzhupaas-datareport-univer-core
+ 5.2.0-RELEASE
+
+
+ yunzhupaas-datareport-univer
+ 5.2.0-RELEASE
+ pom
+
+
+ yunzhupaas-datareport-univer-entity
+ yunzhupaas-datareport-univer-biz
+ yunzhupaas-datareport-univer-controller
+ yunzhupaas-datareport-univer-admin
+
+
+
+
+
+
+ boot3
+
+ [17,)
+
+
+
+
+
+
+ boot2
+
+ (,17)
+
+
+
+
+
+
+
+
+
+
diff --git a/yunzhupaas-datareport-univer-admin/pom.xml b/yunzhupaas-datareport-univer-admin/pom.xml
new file mode 100644
index 0000000..25dc454
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/pom.xml
@@ -0,0 +1,52 @@
+
+
+ 4.0.0
+
+ com.yunzhupaas
+ yunzhupaas-datareport-univer
+ 5.2.0-RELEASE
+
+
+ yunzhupaas-datareport-univer-admin
+
+
+
+
+ com.yunzhupaas
+ yunzhupaas-common-security
+ ${project.version}
+
+
+ com.yunzhupaas
+ yunzhupaas-datareport-univer-controller
+ ${project.version}
+
+
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ com.yunzhupaas.ReportUniverApplication
+ ZIP
+
+
+
+
+ repackage
+
+
+
+
+
+
+
diff --git a/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/ReportUniverApplication.java b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/ReportUniverApplication.java
new file mode 100644
index 0000000..452fcde
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/ReportUniverApplication.java
@@ -0,0 +1,17 @@
+package com.yunzhupaas;
+
+import cn.xuyanwu.spring.file.storage.EnableFileStorage;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@EnableFileStorage
+public class ReportUniverApplication {
+
+ public static void main(String[] args) {
+ SpringApplication springApplication = new SpringApplication(ReportUniverApplication.class);
+ springApplication.run(args);
+ System.out.println("鎶ヨ〃鍚姩瀹屾垚");
+ }
+
+}
diff --git a/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/aop/DataSourceBindAspect.java b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/aop/DataSourceBindAspect.java
new file mode 100644
index 0000000..5d2c765
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/aop/DataSourceBindAspect.java
@@ -0,0 +1,78 @@
+package com.yunzhupaas.aop;
+
+import cn.dev33.satoken.context.SaHolder;
+import com.yunzhupaas.base.UserInfo;
+import com.yunzhupaas.config.ConfigValueUtil;
+import com.yunzhupaas.database.util.NotTenantPluginHolder;
+import com.yunzhupaas.database.util.TenantDataSourceUtil;
+import com.yunzhupaas.util.StringUtil;
+import com.yunzhupaas.util.TenantHolder;
+import com.yunzhupaas.util.UserProvider;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ * @author 云筑产品开发平台组
+ * @version V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date 2024/3/15 17:12
+ */
+@Slf4j
+@Aspect
+@Component
+@Order(1)
+public class DataSourceBindAspect {
+
+ @Autowired
+ private ConfigValueUtil configValueUtil;
+
+ @Pointcut("(execution(* com.yunzhupaas.*.controller.*.*(..)) || execution(* com.yunzhupaas.controller.*.*(..))))")
+ public void bindDataSource() {
+
+ }
+
+ /**
+ * NoDataSourceBind 不需要绑定数据库的注解
+ *
+ * @param pjp
+ * @return
+ * @throws Throwable
+ */
+ @Around("bindDataSource() && !@annotation(com.yunzhupaas.util.NoDataSourceBind)")
+ public Object doAroundService(ProceedingJoinPoint pjp) throws Throwable {
+ if (configValueUtil.isMultiTenancy()) {
+ if (StringUtil.isEmpty(TenantHolder.getDatasourceId())) {
+ UserInfo userInfo = UserProvider.getUser();
+ String url = null;
+ try {
+ url = SaHolder.getRequest().getRequestPath();
+ } catch (Exception ee) {
+ }
+ log.error("租户" + userInfo.getTenantId() + "数据库不存在, URL: {}, TOKEN: {}", url, userInfo.getToken());
+ return null;
+ }
+ return pjp.proceed();
+ }
+ Object obj = pjp.proceed();
+ return obj;
+ }
+
+ @Around("bindDataSource() && @annotation(com.yunzhupaas.util.NoDataSourceBind)")
+ public Object doAroundService2(ProceedingJoinPoint pjp) throws Throwable {
+ try {
+ NotTenantPluginHolder.setNotSwitchAlwaysFlag();
+ // Filter中提前设置租户信息, 不需要切库的方法进行清除切库
+ TenantDataSourceUtil.clearLocalTenantInfo();
+ return pjp.proceed();
+ } finally {
+ NotTenantPluginHolder.clearNotSwitchAlwaysFlag();
+ }
+ }
+}
diff --git a/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/config/AuthFilter.java b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/config/AuthFilter.java
new file mode 100644
index 0000000..43cd5c9
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/config/AuthFilter.java
@@ -0,0 +1,120 @@
+package com.yunzhupaas.config;
+
+import cn.dev33.satoken.context.SaHolder;
+import cn.dev33.satoken.exception.NotLoginException;
+import cn.dev33.satoken.filter.SaServletFilter;
+import cn.dev33.satoken.router.SaHttpMethod;
+import cn.dev33.satoken.router.SaRouter;
+import cn.dev33.satoken.stp.StpUtil;
+import cn.dev33.satoken.util.SaResult;
+import com.yunzhupaas.base.ActionResultCode;
+import com.yunzhupaas.constant.MsgCode;
+import com.yunzhupaas.consts.AuthConsts;
+import com.yunzhupaas.properties.GatewayWhite;
+import com.yunzhupaas.util.IpUtil;
+import com.yunzhupaas.util.StringUtil;
+import com.yunzhupaas.util.UserProvider;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpHeaders;
+
+import jakarta.servlet.http.HttpServletRequest;
+
+/**
+ * 网关验证token
+ *
+ * @author 云筑产品开发平台组
+ * @version V3.1.0
+ * @copyright 深圳市乐程软件有限公司(http://www.szlecheng.cn)
+ * @date 2024-03-24
+ */
+@Slf4j
+@Configuration
+public class AuthFilter {
+
+ private static final String ALL = "*";
+ private static final String MAX_AGE = "18000L";
+
+ // 注册 Sa-Token全局过滤器
+ @Bean
+ public SaServletFilter getSaReactorFilter(GatewayWhite gatewayWhite) {
+ return new SaServletFilter()
+ // 拦截地址
+ .addInclude("/**")
+ .setExcludeList(gatewayWhite.excludeUrl)
+ // 鉴权方法:每次访问进入
+ .setAuth(obj -> {
+ if (log.isInfoEnabled()) {
+ log.info("请求路径: {}", SaHolder.getRequest().getRequestPath());
+ }
+ // 拦截路径
+ SaRouter.match(gatewayWhite.blockUrl).match(o -> {
+ // 禁止访问URL 排除白名单
+ String ip = getIpAddr();
+ for (String o1 : gatewayWhite.whiteIp) {
+ if (ip.startsWith(o1)) {
+ return false;
+ }
+ }
+ log.info("非白名单IP访问限制接口:{}, {}", SaHolder.getRequest().getRequestPath(), ip);
+ return true;
+ }).back(MsgCode.AD101.get());
+ // 测试不验证 鉴权服务重启测试模式不清除Token就够了
+ // SaRouter.match((r)->"true".equals(configValueUtil.getTestVersion())).stop();
+ // 白名单不拦截
+ SaRouter.match(gatewayWhite.whiteUrl).stop();
+ // 内部请求不拦截
+ SaRouter.match(t -> {
+ String innerToken = SaHolder.getRequest().getHeader(AuthConsts.INNER_TOKEN_KEY);
+ return UserProvider.isValidInnerToken(innerToken);
+ }).stop();
+ // 登录校验 -- 拦截所有路由
+ SaRouter.match("/**", r -> {
+ // 兼容Net、Java大小写不一致问题
+ String token = StpUtil.getTokenValueNotCut();
+ if (!StringUtil.isEmpty(token)) {
+ String[] tokenArr = token.split(" ");
+ if (StpUtil.getLoginIdByToken(tokenArr[tokenArr.length - 1]) != null) {
+ return;
+ }
+ }
+ throw NotLoginException.newInstance(StpUtil.getLoginType(), NotLoginException.INVALID_TOKEN,
+ NotLoginException.INVALID_TOKEN_MESSAGE, token);
+ }).stop();
+ }).setError(e -> {
+ SaHolder.getResponse().addHeader("Content-Type", "application/json; charset=utf-8");
+ if (e instanceof NotLoginException) {
+ return SaResult.error(ActionResultCode.SessionOverdue.getMessage())
+ .setCode(ActionResultCode.SessionOverdue.getCode());
+ }
+ log.error(e.getMessage(), e);
+ return SaResult.error(MsgCode.AD102.get()).setCode(ActionResultCode.Exception.getCode());
+ })
+ // 前置函数:在每次认证函数之前执行
+ .setBeforeAuth(obj -> {
+ HttpServletRequest request = (HttpServletRequest) SaHolder.getRequest().getSource();
+ // ---------- 设置跨域响应头 ----------
+ SaHolder.getResponse()
+ // 允许指定域访问跨域资源
+ .setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, request.getHeader(HttpHeaders.ORIGIN))
+ // 允许的header参数
+ .setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, ALL)
+ // 允许所有请求方式
+ .setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, ALL)
+ .setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true")
+ .setHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, ALL)
+ // 有效时间
+ .setHeader(HttpHeaders.ACCESS_CONTROL_MAX_AGE, MAX_AGE);
+
+ // 如果是预检请求,则立即返回到前端
+ SaRouter.match(SaHttpMethod.OPTIONS)
+ .back();
+ });
+ }
+
+ public static String getIpAddr() {
+ return IpUtil.getIpAddr();
+ }
+
+}
diff --git a/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/config/ReportAutoConfiguration.java b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/config/ReportAutoConfiguration.java
new file mode 100644
index 0000000..147f085
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/config/ReportAutoConfiguration.java
@@ -0,0 +1,39 @@
+package com.yunzhupaas.config;
+
+import com.yunzhupaas.consts.ApiConst;
+import com.yunzhupaas.properties.GatewayWhite;
+import com.yunzhupaas.properties.GatewayWhiteProperties;
+import com.yunzhupaas.properties.ReportProperties;
+import com.yunzhupaas.config.YunzhupaasOauthConfig;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration(proxyBeanMethods = false)
+public class ReportAutoConfiguration {
+
+ @Bean
+ @ConfigurationProperties(prefix = GatewayWhite.PREFIX)
+ public GatewayWhite getGateWhite() {
+ return new GatewayWhiteProperties();
+ }
+
+ @Bean
+ @ConfigurationProperties(prefix = ReportProperties.PREFIX)
+ public ReportProperties getReportProperties() {
+ return new ReportProperties();
+ }
+
+ @Bean
+ public ApiConst initReportApiConst(YunzhupaasOauthConfig yunzhupaasOauthConfig) {
+ ApiConst.ME = yunzhupaasOauthConfig.getYunzhupaasDomain() + "/api/oauth/me";
+ ApiConst.DATASET_LIST = yunzhupaasOauthConfig.getYunzhupaasDomain() + "/api/system/DataSet/getList";
+ ApiConst.DATASET_SAVE = yunzhupaasOauthConfig.getYunzhupaasDomain() + "/api/system/DataSet/save";
+ ApiConst.DATASET_DATA = yunzhupaasOauthConfig.getYunzhupaasDomain() + "/api/system/DataSet/Data";
+ ApiConst.SAVE_MENU = yunzhupaasOauthConfig.getYunzhupaasDomain() + "/api/system/Menu/saveReportMenu";
+ ApiConst.GET_MENU = yunzhupaasOauthConfig.getYunzhupaasDomain() + "/api/system/Menu/getReportMenu";
+ ApiConst.PARAMETER_DATA = yunzhupaasOauthConfig.getYunzhupaasDomain() + "/api/system/DataSet/parameterData";
+ return new ApiConst();
+ }
+
+}
diff --git a/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/properties/GatewayWhiteProperties.java b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/properties/GatewayWhiteProperties.java
new file mode 100644
index 0000000..1e7e347
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/java/com/yunzhupaas/properties/GatewayWhiteProperties.java
@@ -0,0 +1,8 @@
+package com.yunzhupaas.properties;
+
+/**
+ * 鏍规嵁闇€姹傞噸鍐欑綉鍏砋RL
+ */
+public class GatewayWhiteProperties extends GatewayWhite {
+
+}
diff --git a/yunzhupaas-datareport-univer-admin/src/main/resources/application-dev.yml b/yunzhupaas-datareport-univer-admin/src/main/resources/application-dev.yml
new file mode 100644
index 0000000..541afa0
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/resources/application-dev.yml
@@ -0,0 +1,166 @@
+# 应用服务器
+server:
+ tomcat:
+ uri-encoding: UTF-8 #tomcat编码
+ port: 32000 #tomcat端口
+
+spring:
+ devtools: #spring开发者工具模块
+ restart:
+ enabled: true #热部署开关
+ freemarker:
+ cache: false #spring内置freemarker缓存
+ thymeleaf:
+ cache: false #spring内置thymeleaf缓存
+
+ # ===================== 数据源配置 =====================
+ exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid
+ datasource:
+ db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL,请严格按可选值填写)
+ host: mysql.szlecheng.cn
+ port: 13306
+ username: jnpfsoft
+ password: ZtRmzjij4CiaXpSE
+ db-name: jnpfsoft
+ db-schema: #金仓达梦选填
+ prepare-url: #自定义url
+
+ # ===================== 动态多数据源 =====================
+ dynamic:
+ primary: master #设置默认的数据源或者数据源组,默认值即为master
+ strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+ druid:
+ # 空闲时执行连接测试
+ test-while-idle: true
+ # 连接测试最小间隔
+ time-between-eviction-runs-millis: 60000
+ # 获取连接等待3秒 根据网络情况设定
+ max-wait: 3000
+ # 初始化4个连接
+ initial-size: 4
+ # 最大20个连接
+ max-active: 20
+ # 最少保持4个空闲连接
+ min-idle: 4
+ # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错)
+ keep-alive: true
+ # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置
+ #filters: slf4j
+ slf4j:
+ statementLogEnabled: true
+ resultSetLogEnabled: false
+ connectionLogEnabled: false
+ dataSourceLogEnabled: false
+ statementCreateAfterLogEnabled: false
+ statementCloseAfterLogEnabled: false
+ statementExecuteAfterLogEnabled: false
+ #打印SQL替换参数
+ statementExecutableSqlLogEnable: true
+ statementPrepareAfterLogEnabled: false
+ statementPrepareCallAfterLogEnabled: false
+ statementParameterSetLogEnabled: false
+ # datasource:
+ # master:
+ # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
+ # username: ${spring.datasource.username}
+ # password: ${spring.datasource.password}
+ # driver-class-name: com.mysql.cj.jdbc.Driver
+
+ # ===================== Redis配置 =====================
+ # redis单机模式
+ redis:
+ database: 1 #缓存库编号
+ host: 127.0.0.1
+ port: 6379
+ password: redis_JtjYRD # 密码为空时,请将本行注释
+ timeout: 3000 #超时时间(单位:秒)
+ lettuce: #Lettuce为Redis的Java驱动包
+ pool:
+ max-active: 8 # 连接池最大连接数
+ max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ min-idle: 0 # 连接池中的最小空闲连接
+ max-idle: 8 # 连接池中的最大空闲连接
+
+# redis集群模式
+# redis:
+# cluster:
+# nodes:
+# - 192.168.0.225:6380
+# - 192.168.0.225:6381
+# - 192.168.0.225:6382
+# - 192.168.0.225:6383
+# - 192.168.0.225:6384
+# - 192.168.0.225:6385
+# password: 123456 # 密码为空时,请将本行注释
+# timeout: 3000 # 超时时间(单位:秒)
+# lettuce: #Lettuce为Redis的Java驱动包
+# pool:
+# max-active: 8 # 连接池最大连接数
+# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+# min-idle: 0 # 连接池中的最小空闲连接
+# max-idle: 8 # 连接池中的最大空闲连接
+
+# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html
+springdoc:
+ default-flat-param-object: true
+ api-docs:
+ enabled: true
+#SpringDoc增强
+#knife4j:
+# basic: #接口文档访问鉴权
+# enable: true
+# username: yunzhupaas
+# password: 123456
+
+config:
+ # ===================== 是否开启测试环境 =====================
+ TestVersion: false
+ # ===================== ApacheShardingSphere 配置开关 =====================
+ sharding-sphere-enabled: false
+ # ===================== 文件存储配置 =====================
+ file-storage: #文件存储配置,不使用的情况下可以不写
+ default-platform: local-plus-1 #默认使用的存储平台
+ thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】
+ local-plus: # 本地存储升级版
+ - platform: local-plus-1 # 存储平台标识
+ enable-storage: true #启用存储
+ enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高)
+ domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名
+ base-path: /data/wwwroot/yunzhupaas-resources/ # 基础路径
+ path-patterns: /** # 访问路径
+ storage-path: # 存储路径
+ aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写
+ - platform: aliyun-oss-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ end-point: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/
+ base-path: hy/ # 基础路径
+ qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写
+ - platform: qiniu-kodo-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/
+ base-path: base/ # 基础路径
+ tencent-cos: # 腾讯云 COS
+ - platform: tencent-cos-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ secret-id: ??
+ secret-key: ??
+ region: ?? #存仓库所在地域
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/
+ base-path: hy/ # 基础路径
+ minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里
+ - platform: minio-1 # 存储平台标识
+ enable-storage: true # 启用存储
+ access-key: Q9jJs2b6Tv
+ secret-key: Thj2WkpLu9DhmJyJ
+ end-point: http://192.168.0.207:9000/
+ bucket-name: yunzhupaassoftoss
+ domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/
+ base-path: # 基础路径
diff --git a/yunzhupaas-datareport-univer-admin/src/main/resources/application-preview.yml b/yunzhupaas-datareport-univer-admin/src/main/resources/application-preview.yml
new file mode 100644
index 0000000..88ffed4
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/resources/application-preview.yml
@@ -0,0 +1,166 @@
+# 应用服务器
+server:
+ tomcat:
+ uri-encoding: UTF-8 #tomcat编码
+ port: 32000 #tomcat端口
+
+spring:
+ devtools: #spring开发者工具模块
+ restart:
+ enabled: true #热部署开关
+ freemarker:
+ cache: false #spring内置freemarker缓存
+ thymeleaf:
+ cache: false #spring内置thymeleaf缓存
+
+ # ===================== 数据源配置 =====================
+ exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid
+ datasource:
+ db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL,请严格按可选值填写)
+ host: 127.0.0.1
+ port: 3306
+ username: root
+ password: 123456
+ db-name: yunzhupaas_init
+ db-schema: #金仓达梦选填
+ prepare-url: #自定义url
+
+ # ===================== 动态多数据源 =====================
+ dynamic:
+ primary: master #设置默认的数据源或者数据源组,默认值即为master
+ strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+ druid:
+ # 空闲时执行连接测试
+ test-while-idle: true
+ # 连接测试最小间隔
+ time-between-eviction-runs-millis: 60000
+ # 获取连接等待3秒 根据网络情况设定
+ max-wait: 3000
+ # 初始化4个连接
+ initial-size: 4
+ # 最大20个连接
+ max-active: 20
+ # 最少保持4个空闲连接
+ min-idle: 4
+ # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错)
+ keep-alive: true
+ # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置
+ #filters: slf4j
+ slf4j:
+ statementLogEnabled: true
+ resultSetLogEnabled: false
+ connectionLogEnabled: false
+ dataSourceLogEnabled: false
+ statementCreateAfterLogEnabled: false
+ statementCloseAfterLogEnabled: false
+ statementExecuteAfterLogEnabled: false
+ #打印SQL替换参数
+ statementExecutableSqlLogEnable: true
+ statementPrepareAfterLogEnabled: false
+ statementPrepareCallAfterLogEnabled: false
+ statementParameterSetLogEnabled: false
+ # datasource:
+ # master:
+ # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
+ # username: ${spring.datasource.username}
+ # password: ${spring.datasource.password}
+ # driver-class-name: com.mysql.cj.jdbc.Driver
+
+ # ===================== Redis配置 =====================
+ # redis单机模式
+ redis:
+ database: 1 #缓存库编号
+ host: 127.0.0.1
+ port: 6379
+ password: 123456 # 密码为空时,请将本行注释
+ timeout: 3000 #超时时间(单位:秒)
+ lettuce: #Lettuce为Redis的Java驱动包
+ pool:
+ max-active: 8 # 连接池最大连接数
+ max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ min-idle: 0 # 连接池中的最小空闲连接
+ max-idle: 8 # 连接池中的最大空闲连接
+
+# redis集群模式
+# redis:
+# cluster:
+# nodes:
+# - 192.168.0.225:6380
+# - 192.168.0.225:6381
+# - 192.168.0.225:6382
+# - 192.168.0.225:6383
+# - 192.168.0.225:6384
+# - 192.168.0.225:6385
+# password: 123456 # 密码为空时,请将本行注释
+# timeout: 3000 # 超时时间(单位:秒)
+# lettuce: #Lettuce为Redis的Java驱动包
+# pool:
+# max-active: 8 # 连接池最大连接数
+# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+# min-idle: 0 # 连接池中的最小空闲连接
+# max-idle: 8 # 连接池中的最大空闲连接
+
+# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html
+springdoc:
+ default-flat-param-object: true
+ api-docs:
+ enabled: true
+#SpringDoc增强
+#knife4j:
+# basic: #接口文档访问鉴权
+# enable: true
+# username: yunzhupaas
+# password: 123456
+
+config:
+ # ===================== 是否开启测试环境 =====================
+ TestVersion: false
+ # ===================== ApacheShardingSphere 配置开关 =====================
+ sharding-sphere-enabled: false
+ # ===================== 文件存储配置 =====================
+ file-storage: #文件存储配置,不使用的情况下可以不写
+ default-platform: local-plus-1 #默认使用的存储平台
+ thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】
+ local-plus: # 本地存储升级版
+ - platform: local-plus-1 # 存储平台标识
+ enable-storage: true #启用存储
+ enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高)
+ domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名
+ base-path: /data/wwwroot/yunzhupaas-resources/ # 基础路径
+ path-patterns: /** # 访问路径
+ storage-path: # 存储路径
+ aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写
+ - platform: aliyun-oss-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ end-point: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/
+ base-path: hy/ # 基础路径
+ qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写
+ - platform: qiniu-kodo-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/
+ base-path: base/ # 基础路径
+ tencent-cos: # 腾讯云 COS
+ - platform: tencent-cos-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ secret-id: ??
+ secret-key: ??
+ region: ?? #存仓库所在地域
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/
+ base-path: hy/ # 基础路径
+ minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里
+ - platform: minio-1 # 存储平台标识
+ enable-storage: true # 启用存储
+ access-key: Q9jJs2b6Tv
+ secret-key: Thj2WkpLu9DhmJyJ
+ end-point: http://192.168.0.207:9000/
+ bucket-name: yunzhupaassoftoss
+ domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/
+ base-path: # 基础路径
diff --git a/yunzhupaas-datareport-univer-admin/src/main/resources/application-prod.yml b/yunzhupaas-datareport-univer-admin/src/main/resources/application-prod.yml
new file mode 100644
index 0000000..88ffed4
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/resources/application-prod.yml
@@ -0,0 +1,166 @@
+# 应用服务器
+server:
+ tomcat:
+ uri-encoding: UTF-8 #tomcat编码
+ port: 32000 #tomcat端口
+
+spring:
+ devtools: #spring开发者工具模块
+ restart:
+ enabled: true #热部署开关
+ freemarker:
+ cache: false #spring内置freemarker缓存
+ thymeleaf:
+ cache: false #spring内置thymeleaf缓存
+
+ # ===================== 数据源配置 =====================
+ exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid
+ datasource:
+ db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL,请严格按可选值填写)
+ host: 127.0.0.1
+ port: 3306
+ username: root
+ password: 123456
+ db-name: yunzhupaas_init
+ db-schema: #金仓达梦选填
+ prepare-url: #自定义url
+
+ # ===================== 动态多数据源 =====================
+ dynamic:
+ primary: master #设置默认的数据源或者数据源组,默认值即为master
+ strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+ druid:
+ # 空闲时执行连接测试
+ test-while-idle: true
+ # 连接测试最小间隔
+ time-between-eviction-runs-millis: 60000
+ # 获取连接等待3秒 根据网络情况设定
+ max-wait: 3000
+ # 初始化4个连接
+ initial-size: 4
+ # 最大20个连接
+ max-active: 20
+ # 最少保持4个空闲连接
+ min-idle: 4
+ # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错)
+ keep-alive: true
+ # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置
+ #filters: slf4j
+ slf4j:
+ statementLogEnabled: true
+ resultSetLogEnabled: false
+ connectionLogEnabled: false
+ dataSourceLogEnabled: false
+ statementCreateAfterLogEnabled: false
+ statementCloseAfterLogEnabled: false
+ statementExecuteAfterLogEnabled: false
+ #打印SQL替换参数
+ statementExecutableSqlLogEnable: true
+ statementPrepareAfterLogEnabled: false
+ statementPrepareCallAfterLogEnabled: false
+ statementParameterSetLogEnabled: false
+ # datasource:
+ # master:
+ # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
+ # username: ${spring.datasource.username}
+ # password: ${spring.datasource.password}
+ # driver-class-name: com.mysql.cj.jdbc.Driver
+
+ # ===================== Redis配置 =====================
+ # redis单机模式
+ redis:
+ database: 1 #缓存库编号
+ host: 127.0.0.1
+ port: 6379
+ password: 123456 # 密码为空时,请将本行注释
+ timeout: 3000 #超时时间(单位:秒)
+ lettuce: #Lettuce为Redis的Java驱动包
+ pool:
+ max-active: 8 # 连接池最大连接数
+ max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ min-idle: 0 # 连接池中的最小空闲连接
+ max-idle: 8 # 连接池中的最大空闲连接
+
+# redis集群模式
+# redis:
+# cluster:
+# nodes:
+# - 192.168.0.225:6380
+# - 192.168.0.225:6381
+# - 192.168.0.225:6382
+# - 192.168.0.225:6383
+# - 192.168.0.225:6384
+# - 192.168.0.225:6385
+# password: 123456 # 密码为空时,请将本行注释
+# timeout: 3000 # 超时时间(单位:秒)
+# lettuce: #Lettuce为Redis的Java驱动包
+# pool:
+# max-active: 8 # 连接池最大连接数
+# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+# min-idle: 0 # 连接池中的最小空闲连接
+# max-idle: 8 # 连接池中的最大空闲连接
+
+# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html
+springdoc:
+ default-flat-param-object: true
+ api-docs:
+ enabled: true
+#SpringDoc增强
+#knife4j:
+# basic: #接口文档访问鉴权
+# enable: true
+# username: yunzhupaas
+# password: 123456
+
+config:
+ # ===================== 是否开启测试环境 =====================
+ TestVersion: false
+ # ===================== ApacheShardingSphere 配置开关 =====================
+ sharding-sphere-enabled: false
+ # ===================== 文件存储配置 =====================
+ file-storage: #文件存储配置,不使用的情况下可以不写
+ default-platform: local-plus-1 #默认使用的存储平台
+ thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】
+ local-plus: # 本地存储升级版
+ - platform: local-plus-1 # 存储平台标识
+ enable-storage: true #启用存储
+ enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高)
+ domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名
+ base-path: /data/wwwroot/yunzhupaas-resources/ # 基础路径
+ path-patterns: /** # 访问路径
+ storage-path: # 存储路径
+ aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写
+ - platform: aliyun-oss-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ end-point: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/
+ base-path: hy/ # 基础路径
+ qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写
+ - platform: qiniu-kodo-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/
+ base-path: base/ # 基础路径
+ tencent-cos: # 腾讯云 COS
+ - platform: tencent-cos-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ secret-id: ??
+ secret-key: ??
+ region: ?? #存仓库所在地域
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/
+ base-path: hy/ # 基础路径
+ minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里
+ - platform: minio-1 # 存储平台标识
+ enable-storage: true # 启用存储
+ access-key: Q9jJs2b6Tv
+ secret-key: Thj2WkpLu9DhmJyJ
+ end-point: http://192.168.0.207:9000/
+ bucket-name: yunzhupaassoftoss
+ domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/
+ base-path: # 基础路径
diff --git a/yunzhupaas-datareport-univer-admin/src/main/resources/application-test.yml b/yunzhupaas-datareport-univer-admin/src/main/resources/application-test.yml
new file mode 100644
index 0000000..88ffed4
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/resources/application-test.yml
@@ -0,0 +1,166 @@
+# 应用服务器
+server:
+ tomcat:
+ uri-encoding: UTF-8 #tomcat编码
+ port: 32000 #tomcat端口
+
+spring:
+ devtools: #spring开发者工具模块
+ restart:
+ enabled: true #热部署开关
+ freemarker:
+ cache: false #spring内置freemarker缓存
+ thymeleaf:
+ cache: false #spring内置thymeleaf缓存
+
+ # ===================== 数据源配置 =====================
+ exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure #排除自动配置,手动配置druid
+ datasource:
+ db-type: MySQL #数据库类型(可选值 MySQL、SQLServer、Oracle、DM、KingbaseES、PostgreSQL,请严格按可选值填写)
+ host: 127.0.0.1
+ port: 3306
+ username: root
+ password: 123456
+ db-name: yunzhupaas_init
+ db-schema: #金仓达梦选填
+ prepare-url: #自定义url
+
+ # ===================== 动态多数据源 =====================
+ dynamic:
+ primary: master #设置默认的数据源或者数据源组,默认值即为master
+ strict: true #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+ druid:
+ # 空闲时执行连接测试
+ test-while-idle: true
+ # 连接测试最小间隔
+ time-between-eviction-runs-millis: 60000
+ # 获取连接等待3秒 根据网络情况设定
+ max-wait: 3000
+ # 初始化4个连接
+ initial-size: 4
+ # 最大20个连接
+ max-active: 20
+ # 最少保持4个空闲连接
+ min-idle: 4
+ # 空闲连接保活, 超过配置的空闲时间会进行连接检查完成保活操作(数据库自身会断开达到空闲时间的连接, 程序使用断开的连接会报错)
+ keep-alive: true
+ # 解除注释后Druid连接池打印SQL语句 忽略日志等级配置
+ #filters: slf4j
+ slf4j:
+ statementLogEnabled: true
+ resultSetLogEnabled: false
+ connectionLogEnabled: false
+ dataSourceLogEnabled: false
+ statementCreateAfterLogEnabled: false
+ statementCloseAfterLogEnabled: false
+ statementExecuteAfterLogEnabled: false
+ #打印SQL替换参数
+ statementExecutableSqlLogEnable: true
+ statementPrepareAfterLogEnabled: false
+ statementPrepareCallAfterLogEnabled: false
+ statementParameterSetLogEnabled: false
+ # datasource:
+ # master:
+ # url: jdbc:mysql://${spring.datasource.host}:${spring.datasource.port}/${spring.datasource.dbname}?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
+ # username: ${spring.datasource.username}
+ # password: ${spring.datasource.password}
+ # driver-class-name: com.mysql.cj.jdbc.Driver
+
+ # ===================== Redis配置 =====================
+ # redis单机模式
+ redis:
+ database: 1 #缓存库编号
+ host: 127.0.0.1
+ port: 6379
+ password: 123456 # 密码为空时,请将本行注释
+ timeout: 3000 #超时时间(单位:秒)
+ lettuce: #Lettuce为Redis的Java驱动包
+ pool:
+ max-active: 8 # 连接池最大连接数
+ max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ min-idle: 0 # 连接池中的最小空闲连接
+ max-idle: 8 # 连接池中的最大空闲连接
+
+# redis集群模式
+# redis:
+# cluster:
+# nodes:
+# - 192.168.0.225:6380
+# - 192.168.0.225:6381
+# - 192.168.0.225:6382
+# - 192.168.0.225:6383
+# - 192.168.0.225:6384
+# - 192.168.0.225:6385
+# password: 123456 # 密码为空时,请将本行注释
+# timeout: 3000 # 超时时间(单位:秒)
+# lettuce: #Lettuce为Redis的Java驱动包
+# pool:
+# max-active: 8 # 连接池最大连接数
+# max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+# min-idle: 0 # 连接池中的最小空闲连接
+# max-idle: 8 # 连接池中的最大空闲连接
+
+# SpringDoc接口文档 访问地址:http://127.0.0.1:30000/doc.html
+springdoc:
+ default-flat-param-object: true
+ api-docs:
+ enabled: true
+#SpringDoc增强
+#knife4j:
+# basic: #接口文档访问鉴权
+# enable: true
+# username: yunzhupaas
+# password: 123456
+
+config:
+ # ===================== 是否开启测试环境 =====================
+ TestVersion: false
+ # ===================== ApacheShardingSphere 配置开关 =====================
+ sharding-sphere-enabled: false
+ # ===================== 文件存储配置 =====================
+ file-storage: #文件存储配置,不使用的情况下可以不写
+ default-platform: local-plus-1 #默认使用的存储平台
+ thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】
+ local-plus: # 本地存储升级版
+ - platform: local-plus-1 # 存储平台标识
+ enable-storage: true #启用存储
+ enable-access: true #启用访问(线上请使用 Nginx 配置,效率更高)
+ domain: "" # 访问域名,例如:“http://127.0.0.1:8030/”,注意后面要和 path-patterns 保持一致,“/”结尾,本地存储建议使用相对路径,方便后期更换域名
+ base-path: /data/wwwroot/yunzhupaas-resources/ # 基础路径
+ path-patterns: /** # 访问路径
+ storage-path: # 存储路径
+ aliyun-oss: # 阿里云 OSS ,不使用的情况下可以不写
+ - platform: aliyun-oss-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ end-point: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.oss-cn-shanghai.aliyuncs.com/
+ base-path: hy/ # 基础路径
+ qiniu-kodo: # 七牛云 kodo ,不使用的情况下可以不写
+ - platform: qiniu-kodo-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ access-key: ??
+ secret-key: ??
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:http://abc.hn-bkt.clouddn.com/
+ base-path: base/ # 基础路径
+ tencent-cos: # 腾讯云 COS
+ - platform: tencent-cos-1 # 存储平台标识
+ enable-storage: false # 启用存储
+ secret-id: ??
+ secret-key: ??
+ region: ?? #存仓库所在地域
+ bucket-name: ??
+ domain: ?? # 访问域名,注意“/”结尾,例如:https://abc.cos.ap-nanjing.myqcloud.com/
+ base-path: hy/ # 基础路径
+ minio: # MinIO,由于 MinIO SDK 支持 AWS S3,其它兼容 AWS S3 协议的存储平台也都可配置在这里
+ - platform: minio-1 # 存储平台标识
+ enable-storage: true # 启用存储
+ access-key: Q9jJs2b6Tv
+ secret-key: Thj2WkpLu9DhmJyJ
+ end-point: http://192.168.0.207:9000/
+ bucket-name: yunzhupaassoftoss
+ domain: # 访问域名,注意“/”结尾,例如:http://minio.abc.com/abc/
+ base-path: # 基础路径
diff --git a/yunzhupaas-datareport-univer-admin/src/main/resources/application.yml b/yunzhupaas-datareport-univer-admin/src/main/resources/application.yml
new file mode 100644
index 0000000..24f0c5d
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/resources/application.yml
@@ -0,0 +1,84 @@
+spring:
+ application:
+ name: yunzhupaas-datareport
+ profiles:
+ # 指定环境配置 dev(开发环境-默认)、test(测试环境)、preview(预生产环境)、prod(生产环境)
+ active: dev
+ servlet:
+ multipart: #文件传输配置
+ max-file-size: 100MB #单个数据大小限制
+ max-request-size: 100MB #请求总数据大小限制
+ enabled: true #是否启用分段上传支持
+ mvc:
+ hiddenmethod: #隐式方法过滤器
+ filter:
+ enabled: true #默认开启。开启以支持:PUT,DELETE表单提交方法
+ jackson: #序列化和反序列化json框架
+ serialization:
+ write-dates-as-timestamps: true #是否写入日期时间时间戳格式
+ time-zone: GMT+8 #指定日期格式化时区
+ main:
+ allow-bean-definition-overriding: true #允许同名bean后者覆盖,默认:true
+ allow-circular-references: true #允许Bean相互引用,默认:false
+
+config:
+ #===================== 访问域名 =====================
+ WebAnnexFilePath: WebAnnexFile
+ DataBackupFilePath: DataBackupFile
+ TemporaryFilePath: TemporaryFile
+ SystemFilePath: SystemFile
+ TemplateFilePath: TemplateFile
+ EmailFilePath: EmailFile
+ DocumentFilePath: DocumentFile
+ DocumentPreviewPath: DocumentPreview
+ UserAvatarFilePath: UserAvatar
+ IMContentFilePath: IMContentFile
+ MPMaterialFilePath: MPMaterial
+ TemplateCodePath: TemplateCode
+ BiVisualPath: BiVisualPath
+
+ ApiDomain: http://127.0.0.1:30000 #主项目后端域名(文档预览中使用)
+ FrontDomain: http://127.0.0.1:3100 #前端域名(文档预览中使用)
+ AppDomain: http://127.0.0.1:8080 #app/h5端域名配置(文档预览中使用)
+
+ #===================== 多租户 =====================
+ MultiTenancy: false #是否开启
+ MultiTenancyUrl: http://127.0.0.1:30006/api/tenant/DbName/ #多租户项目地址
+
+# 接口放行地址 与GatewayWhite中的默认URL合并
+gateway:
+ # 禁止访问接口
+ block-url:
+ ## 配置示例
+ #- /api/message/Notice
+ #- /api/permission/Users/*
+ # 不验证Token, 放行接口(默认记录日志)
+ white-url:
+ # # 配置示例
+ #- /api/message/Notice
+ #- /api/permission/Users/*
+ # 放行接口(不记录日志)
+ exclude-url:
+ # # 配置示例
+ #- /api/message/Notice
+ #- /api/permission/Users/*
+ # 入站IP(禁止配置以外的IP访问block-url配置的接口)
+ white-ip:
+ #- 192.168.0.10
+ #- 192.168.0.20
+
+# 日志配置
+logging:
+ config: classpath:logback-spring.xml
+ level:
+ #自定义第三方包名日志等级
+ # 解除注释后Druid连接池打印SQL语句
+ druid.sql.Statement: debug
+# druid.sql.DataSource: debug
+# druid.sql.Connection: debug
+# druid.sql.ResultSet: debug
+log:
+ level:
+ # 等级 TRACE,DEBUG,INFO,WARN,ERROR(不区分大小写)
+ root: info
+ path: log/${spring.application.name}
diff --git a/yunzhupaas-datareport-univer-admin/src/main/resources/logback-spring.xml b/yunzhupaas-datareport-univer-admin/src/main/resources/logback-spring.xml
new file mode 100644
index 0000000..fcebfb4
--- /dev/null
+++ b/yunzhupaas-datareport-univer-admin/src/main/resources/logback-spring.xml
@@ -0,0 +1,327 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${LOG_PATH}/log_error.log
+
+
+
+
+
+ ${LOG_PATH}/error/%d{yyyy-MM-dd,aux}/log-error-%d{yyyy-MM-dd}.%i.log
+
+ 7
+
+
+ 10MB
+
+
+
+ true
+
+
+
+ ${FILE_LOG_PATTERN}
+ utf-8
+
+
+
+
+ error
+ ACCEPT
+ DENY
+
+
+
+
+
+
+
+
+ ${LOG_PATH}/log_info.log
+
+
+
+
+
+ ${LOG_PATH}/info/%d{yyyy-MM-dd,aux}/log-info-%d{yyyy-MM-dd}.%i.log
+
+ 7
+
+
+ 10MB
+
+
+
+ true
+
+
+
+ ${FILE_LOG_PATTERN}
+ utf-8
+
+
+
+
+ info
+ ACCEPT
+ DENY
+
+
+
+
+
+
+
+
+ ${LOG_PATH}/log_warn.log
+
+
+
+
+
+ ${LOG_PATH}/warn/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log
+
+ 7
+
+
+ 10MB
+
+
+
+ true
+
+
+
+ ${FILE_LOG_PATTERN}
+ utf-8
+
+
+
+
+ warn
+ ACCEPT
+ DENY
+
+
+
+
+
+
+
+ ${LOG_PATH}/log_debug.log
+
+
+
+
+
+ ${LOG_PATH}/debug/%d{yyyy-MM-dd,aux}/log-debug-%d{yyyy-MM-dd}.%i.log
+
+ 7
+
+
+ 10MB
+
+
+
+ true
+
+
+
+ ${FILE_LOG_PATTERN}
+ utf-8
+
+
+
+
+ debug
+ ACCEPT
+ DENY
+
+
+
+
+
+
+
+
+ ${LOG_PATH}/log_total.log
+
+
+
+
+
+ ${LOG_PATH}/total/%d{yyyy-MM-dd,aux}/log-total-%d{yyyy-MM-dd}.%i.log
+
+ 7
+
+
+ 10MB
+
+
+
+ true
+
+
+
+ ${FILE_LOG_PATTERN}
+ utf-8
+
+
+
+
+
+
+
+
+ ${LOG_PATH}/log_release.log
+
+
+
+
+
+ ${LOG_PATH}/release/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log
+
+ 7
+
+
+ 10MB
+
+
+
+ true
+
+
+
+ ${FILE_LOG_PATTERN}
+ utf-8
+
+
+
+
+ ${LOG_LEVEL}
+ ACCEPT
+ DENY
+
+
+
+
+ 0
+ 256
+
+
+
+
+ 0
+ 256
+
+
+
+
+ 0
+ 256
+
+
+
+
+ 0
+ 256
+
+
+
+
+ 0
+ 256
+
+
+
+
+
+
+ ${CONSOLE_LOG_PATTERN}
+ utf-8
+
+
+
+
+
+
+ 0
+ 256
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yunzhupaas-datareport-univer-biz/pom.xml b/yunzhupaas-datareport-univer-biz/pom.xml
new file mode 100644
index 0000000..8300e6e
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/pom.xml
@@ -0,0 +1,21 @@
+
+
+ 4.0.0
+
+ com.yunzhupaas
+ yunzhupaas-datareport-univer
+ 5.2.0-RELEASE
+
+
+ yunzhupaas-datareport-univer-biz
+
+
+
+ com.yunzhupaas
+ yunzhupaas-datareport-univer-entity
+ ${project.version}
+
+
+
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/DictionaryDataMapper.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/DictionaryDataMapper.java
new file mode 100644
index 0000000..41e6c1a
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/DictionaryDataMapper.java
@@ -0,0 +1,16 @@
+package com.yunzhupaas.mapper;
+
+import com.yunzhupaas.base.mapper.SuperMapper;
+import com.yunzhupaas.entity.DictionaryDataEntity;
+
+/**
+ * 字典数据
+ *
+ * @author 云筑产品开发平台组
+ * @version V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date 2023/09/27
+ */
+public interface DictionaryDataMapper extends SuperMapper {
+
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/ReportMapper.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/ReportMapper.java
new file mode 100644
index 0000000..a5bc0cd
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/ReportMapper.java
@@ -0,0 +1,14 @@
+package com.yunzhupaas.mapper;
+
+import com.yunzhupaas.base.mapper.SuperMapper;
+import com.yunzhupaas.entity.ReportEntity;
+
+/**
+ * @author :云筑产品开发平台组
+ * @version: V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date :2024/5/11 下午4:35
+ */
+public interface ReportMapper extends SuperMapper {
+
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/ReportVersionMapper.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/ReportVersionMapper.java
new file mode 100644
index 0000000..359eca2
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/ReportVersionMapper.java
@@ -0,0 +1,14 @@
+package com.yunzhupaas.mapper;
+
+import com.yunzhupaas.base.mapper.SuperMapper;
+import com.yunzhupaas.entity.ReportVersionEntity;
+
+/**
+ * @author :云筑产品开发平台组
+ * @version: V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date :2024/5/11 下午4:35
+ */
+public interface ReportVersionMapper extends SuperMapper {
+
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/UserMapper.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/UserMapper.java
new file mode 100644
index 0000000..82e19bd
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/mapper/UserMapper.java
@@ -0,0 +1,14 @@
+package com.yunzhupaas.mapper;
+
+import com.yunzhupaas.base.mapper.SuperMapper;
+import com.yunzhupaas.entity.UserEntity;
+
+/**
+ * @author :云筑产品开发平台组
+ * @version: V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date :2024/5/11 下午4:35
+ */
+public interface UserMapper extends SuperMapper {
+
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/DictionaryDataService.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/DictionaryDataService.java
new file mode 100644
index 0000000..3b24861
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/DictionaryDataService.java
@@ -0,0 +1,19 @@
+package com.yunzhupaas.service;
+
+import com.yunzhupaas.base.service.SuperService;
+import com.yunzhupaas.entity.DictionaryDataEntity;
+
+import java.util.List;
+
+/**
+ * 字典数据
+ *
+ * @author 云筑产品开发平台组
+ * @version V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date 2023/09/27
+ */
+public interface DictionaryDataService extends SuperService {
+
+ List getDictionName(List id);
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/ReportService.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/ReportService.java
new file mode 100644
index 0000000..f77ee65
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/ReportService.java
@@ -0,0 +1,73 @@
+package com.yunzhupaas.service;
+
+import com.yunzhupaas.base.service.SuperService;
+import com.yunzhupaas.entity.ReportEntity;
+import com.yunzhupaas.model.report.ReportCrForm;
+import com.yunzhupaas.model.report.ReportInfoVO;
+import com.yunzhupaas.model.report.ReportPagination;
+import com.yunzhupaas.model.report.ReportUpForm;
+
+import java.util.List;
+
+/**
+ * @author :云筑产品开发平台组
+ * @version: V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date :2024/5/11 下午4:35
+ */
+public interface ReportService extends SuperService {
+
+ /**
+ * 列表
+ *
+ * @return 实体类
+ */
+ List getList(ReportPagination pagination);
+
+ /**
+ * 创建
+ */
+ void create(ReportCrForm form);
+
+ /**
+ * 更新
+ */
+ void update(String id, ReportEntity entity);
+
+ /**
+ * 获取详情
+ *
+ * @return ReportInfoVO
+ */
+ ReportInfoVO getVersionInfo(String versionId);
+
+ /**
+ * 保存或者发布 通过type:0-保存,1-发布
+ *
+ * @param form
+ */
+ void saveOrRelease(ReportUpForm form);
+
+ /**
+ * 下拉选择
+ *
+ */
+ List getTreeList();
+
+ /**
+ * 删除
+ *
+ * @param id
+ */
+ void delete(String id);
+
+ /**
+ * 导入模板
+ *
+ * @param infoVO
+ * @param type
+ * @return
+ */
+ String importData(ReportInfoVO infoVO, Integer type);
+
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/ReportVersionService.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/ReportVersionService.java
new file mode 100644
index 0000000..e4d4f3b
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/ReportVersionService.java
@@ -0,0 +1,88 @@
+package com.yunzhupaas.service;
+
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.yunzhupaas.base.Pagination;
+import com.yunzhupaas.base.service.SuperService;
+import com.yunzhupaas.entity.ReportVersionEntity;
+import com.yunzhupaas.model.report.ReportCrForm;
+import com.yunzhupaas.model.report.ReportPagination;
+import com.yunzhupaas.model.report.UploaderVO;
+import com.yunzhupaas.univer.model.UniverPreview;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author :云筑产品开发平台组
+ * @version: V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date :2024/5/11 下午4:35
+ */
+public interface ReportVersionService extends SuperService {
+
+ /**
+ * 创建版本
+ *
+ * @param form
+ */
+ void create(ReportCrForm form);
+
+ /**
+ * 获取版本列表
+ *
+ * @param templateId
+ * @return
+ */
+ List getList(String templateId, SFunction... columns);
+
+ /**
+ * 复制版本(点击新增版本)
+ *
+ * @param versionId
+ */
+ String copyVersion(String versionId);
+
+ /**
+ * 根据id删除版本
+ *
+ * @param templateId
+ * @return
+ */
+ void removeByTemplateId(String templateId);
+
+ /**
+ * 预览数据
+ *
+ * @return
+ */
+ UniverPreview preview(String id, ReportPagination pagination, Map params);
+
+ /**
+ * 预览数据
+ *
+ * @return
+ */
+ UniverPreview previewTemplate(String id, ReportPagination pagination, Map params);
+
+ /**
+ * 导入excel
+ *
+ * @param multipartFile
+ */
+ UniverPreview importExcel(MultipartFile multipartFile) throws IOException;
+
+ /**
+ * 导出excel
+ *
+ */
+ UploaderVO downExcel(ReportPagination pagination, Map params);
+
+ /**
+ * 导出excel
+ *
+ * @param pagination
+ */
+ UploaderVO downExcel(ReportPagination pagination);
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/UserService.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/UserService.java
new file mode 100644
index 0000000..c4fb4b4
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/UserService.java
@@ -0,0 +1,23 @@
+package com.yunzhupaas.service;
+
+import com.yunzhupaas.base.service.SuperService;
+import com.yunzhupaas.entity.UserEntity;
+
+import java.util.List;
+
+/**
+ * @author :云筑产品开发平台组
+ * @version: V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date :2024/5/11 下午4:35
+ */
+public interface UserService extends SuperService {
+
+ /**
+ *
+ * @param idList
+ * @return
+ */
+ List getUserName(List idList);
+
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/DictionaryDataServiceImpl.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/DictionaryDataServiceImpl.java
new file mode 100644
index 0000000..10c3a43
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/DictionaryDataServiceImpl.java
@@ -0,0 +1,36 @@
+package com.yunzhupaas.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.yunzhupaas.base.service.SuperServiceImpl;
+import com.yunzhupaas.entity.DictionaryDataEntity;
+import com.yunzhupaas.mapper.DictionaryDataMapper;
+import com.yunzhupaas.service.DictionaryDataService;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * 字典数据
+ *
+ * @author 云筑产品开发平台组
+ * @version V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date 2023/09/27
+ */
+@Service
+public class DictionaryDataServiceImpl extends SuperServiceImpl
+ implements DictionaryDataService {
+
+ @Override
+ public List getDictionName(List id) {
+ List dictionList = new ArrayList<>();
+ if (id.size() > 0) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().and(
+ t -> t.in(DictionaryDataEntity::getId, id));
+ dictionList = this.list(queryWrapper);
+ }
+ return dictionList;
+ }
+
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/ReportServiceImpl.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/ReportServiceImpl.java
new file mode 100644
index 0000000..5fd1e96
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/ReportServiceImpl.java
@@ -0,0 +1,271 @@
+package com.yunzhupaas.service.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.http.Method;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.yunzhupaas.base.ActionResult;
+import com.yunzhupaas.base.UserInfo;
+import com.yunzhupaas.base.service.SuperServiceImpl;
+import com.yunzhupaas.constant.MsgCode;
+import com.yunzhupaas.consts.ApiConst;
+import com.yunzhupaas.emnus.DataSetTypeEnum;
+import com.yunzhupaas.entity.ReportEntity;
+import com.yunzhupaas.entity.ReportVersionEntity;
+import com.yunzhupaas.exception.DataException;
+import com.yunzhupaas.mapper.ReportMapper;
+import com.yunzhupaas.model.data.DataForm;
+import com.yunzhupaas.model.data.DataSetInfo;
+import com.yunzhupaas.model.data.DataSetPagination;
+import com.yunzhupaas.model.report.ReportCrForm;
+import com.yunzhupaas.model.report.ReportInfoVO;
+import com.yunzhupaas.model.report.ReportPagination;
+import com.yunzhupaas.model.report.ReportUpForm;
+import com.yunzhupaas.service.ReportService;
+import com.yunzhupaas.service.ReportVersionService;
+import com.yunzhupaas.util.*;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * @author :云筑产品开发平台组
+ * @version: V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date :2024/5/11 下午4:35
+ */
+@Service
+public class ReportServiceImpl extends SuperServiceImpl implements ReportService {
+
+ @Autowired
+ private ReportVersionService versionService;
+
+ @Override
+ public List getList(ReportPagination pagination) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ String keyword = pagination.getKeyword();
+ if (ObjectUtil.isNotEmpty(keyword)) {
+ queryWrapper.lambda()
+ .and(t -> t.like(ReportEntity::getEnCode, keyword).or().like(ReportEntity::getFullName, keyword));
+ }
+ if (ObjectUtil.isNotEmpty(pagination.getCategory())) {
+ queryWrapper.lambda().eq(ReportEntity::getCategory, pagination.getCategory());
+ }
+ if (ObjectUtil.isNotEmpty(pagination.getState())) {
+ queryWrapper.lambda().eq(ReportEntity::getEnabledMark, pagination.getState());
+ }
+ queryWrapper.lambda().orderByAsc(ReportEntity::getSortCode).orderByDesc(ReportEntity::getCreatorTime);
+ Page page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize());
+ IPage userPage = this.page(page, queryWrapper);
+ return pagination.setData(userPage.getRecords(), page.getTotal());
+ }
+
+ @Override
+ public void create(ReportCrForm form) {
+ ReportEntity entity = JsonUtil.getJsonToBean(form, ReportEntity.class);
+ UserInfo userInfo = UserProvider.getUser();
+ this.creUpdateCheck(entity, true, true);
+ String id = StringUtil.isNotEmpty(entity.getId()) ? entity.getId() : RandomUtil.uuId();
+ entity.setId(id);
+ entity.setEnabledMark(0);
+ entity.setCreatorUserId(userInfo.getUserId());
+ entity.setCreatorTime(new Date());
+ entity.setLastModifyUserId(null);
+ entity.setLastModifyTime(null);
+ this.setIgnoreLogicDelete().removeById(entity.getId());
+ this.setIgnoreLogicDelete().saveOrUpdate(entity);
+ this.clearIgnoreLogicDelete();
+ form.setId(id);
+ List list = versionService.getList(id, ReportVersionEntity::getId);
+ if (CollectionUtils.isEmpty(list)) {
+ versionService.create(form);
+ }
+ }
+
+ @Override
+ public void update(String id, ReportEntity entity) {
+ ReportEntity report = getById(id);
+ this.creUpdateCheck(entity, !report.getFullName().equals(entity.getFullName()),
+ !report.getEnCode().equals(entity.getEnCode()));
+ entity.setId(id);
+ updateById(entity);
+ }
+
+ @Override
+ public ReportInfoVO getVersionInfo(String versionId) {
+ ReportVersionEntity versionEntity = versionService.getById(versionId);
+ ReportEntity entity = this.getById(versionEntity.getTemplateId());
+ ReportInfoVO vo = JsonUtil.getJsonToBean(versionEntity, ReportInfoVO.class);
+ vo.setVersionId(versionId);
+ vo.setId(entity.getId());
+ vo.setFullName(entity.getFullName());
+ vo.setAllowExport(entity.getAllowExport());
+ vo.setAllowPrint(entity.getAllowPrint());
+ vo.setCategory(entity.getCategory());
+ vo.setEnCode(entity.getEnCode());
+ vo.setSortCode(entity.getSortCode());
+ DataSetPagination pagination = new DataSetPagination();
+ pagination.setObjectId(versionId);
+ pagination.setObjectType(DataSetTypeEnum.REPORT_VER.getCode());
+ String json = ReportUtil.http(ApiConst.DATASET_LIST, Method.GET, JsonUtil.entityToMap(pagination));
+ ActionResult result = JsonUtil.getJsonToBean(json, ActionResult.class);
+ List dataSetList = new ArrayList<>();
+ if (ObjectUtil.isNotEmpty(result.getData())) {
+ dataSetList = JsonUtil.getJsonToList(result.getData(), DataSetInfo.class);
+ }
+ vo.setDataSetList(dataSetList);
+ return vo;
+ }
+
+ @Override
+ public void saveOrRelease(ReportUpForm form) {
+ ReportVersionEntity versionEntity = versionService.getById(form.getVersionId());
+ ReportVersionEntity versionNew = JsonUtil.getJsonToBean(form, ReportVersionEntity.class);
+ versionNew.setId(versionEntity.getId());
+ versionNew.setState(versionEntity.getState());
+ ReportEntity entity = this.getById(form.getId());
+ // 发布流程
+ if (Objects.equals(form.getType(), 1)) {
+ // 改流程版本
+ if (StringUtil.isNotEmpty(form.getVersionId())) {
+ boolean isRelease = Objects.equals(versionNew.getState(), 2);
+ ReportVersionEntity info = versionService
+ .getList(form.getId(), ReportVersionEntity::getId, ReportVersionEntity::getState).stream()
+ .filter(t -> Objects.equals(t.getState(), 1)).findFirst().orElse(null);
+ if (info != null) {
+ // 变更归档状态,排序码
+ info.setSortCode(0L);
+ info.setState(2);
+ versionService.updateById(info);
+ }
+ versionNew.setState(1);
+ versionNew.setSortCode(1L);
+ entity.setEnabledMark(1);
+ if (isRelease) {
+ versionService.updateById(versionNew);
+ return;
+ }
+ }
+ }
+ versionService.updateById(versionNew);
+ // 数据集创建
+ String versionId = versionNew.getId();
+ List dataSetList = form.getDataSetList() != null ? form.getDataSetList() : new ArrayList<>();
+ DataForm dataForm = new DataForm();
+ dataForm.setObjectId(versionId);
+ dataForm.setObjectType(DataSetTypeEnum.REPORT_VER.getCode());
+ dataForm.setList(dataSetList);
+ ReportUtil.http(ApiConst.DATASET_SAVE, Method.POST, JsonUtil.entityToMap(dataForm));
+ entity.setAllowExport(form.getAllowExport());
+ entity.setAllowPrint(form.getAllowPrint());
+ entity.setLastModifyTime(new Date());
+ entity.setLastModifyUserId(UserProvider.getLoginUserId());
+ this.updateById(entity);
+ }
+
+ @Override
+ public List getTreeList() {
+ QueryWrapper query = new QueryWrapper<>();
+ query.lambda().eq(ReportEntity::getEnabledMark, 1);
+ query.lambda().orderByAsc(ReportEntity::getSortCode).orderByDesc(ReportEntity::getCreatorTime);
+ List list = this.list(query);
+ return list;
+ }
+
+ @Override
+ public void delete(String id) {
+ removeById(id);
+ versionService.removeByTemplateId(id);
+ }
+
+ @Override
+ public String importData(ReportInfoVO infoVO, Integer type) {
+ ReportEntity entity = JsonUtil.getJsonToBean(infoVO, ReportEntity.class);
+ StringJoiner stringJoiner = new StringJoiner("、");
+ // id为空切名称不存在时
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().eq(ReportEntity::getId, entity.getId());
+ if (this.getById(infoVO.getId()) != null) {
+ if (Objects.equals(type, 0)) {
+ stringJoiner.add("ID");
+ } else {
+ entity.setId(RandomUtil.uuId());
+ }
+ }
+ queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().eq(ReportEntity::getEnCode, entity.getEnCode());
+ if (this.count(queryWrapper) > 0) {
+ stringJoiner.add(MsgCode.IMP009.get());
+ }
+ queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().eq(ReportEntity::getFullName, entity.getFullName());
+ if (this.count(queryWrapper) > 0) {
+ stringJoiner.add(MsgCode.IMP008.get());
+ }
+ if (stringJoiner.length() > 0 && ObjectUtil.equal(type, 1)) {
+ String copyNum = UUID.randomUUID().toString().substring(0, 5);
+ entity.setFullName(entity.getFullName() + ".副本" + copyNum);
+ entity.setEnCode(entity.getEnCode() + copyNum);
+ } else if (ObjectUtil.equal(type, 0) && stringJoiner.length() > 0) {
+ return stringJoiner + MsgCode.IMP007.get();
+ }
+ entity.setEnabledMark(0);
+ entity.setCreatorTime(new Date());
+ entity.setCreatorUserId(UserProvider.getLoginUserId());
+ entity.setLastModifyTime(null);
+ entity.setLastModifyUserId(null);
+ this.setIgnoreLogicDelete().removeById(entity);
+ this.setIgnoreLogicDelete().saveOrUpdate(entity);
+ this.clearIgnoreLogicDelete();
+ // 版本添加
+ ReportVersionEntity versionEntity = JsonUtil.getJsonToBean(infoVO, ReportVersionEntity.class);
+ String versionId = RandomUtil.uuId();
+ versionEntity.setId(versionId);
+ versionEntity.setTemplateId(entity.getId());
+ versionEntity.setCreatorUserId(UserProvider.getLoginUserId());
+ versionEntity.setCreatorTime(new Date());
+ versionEntity.setVersion(1);
+ versionEntity.setState(0);
+ versionEntity.setSortCode(0l);
+ versionService.save(versionEntity);
+ // 数据集创建
+ List dataSetList = infoVO.getDataSetList() != null ? infoVO.getDataSetList() : new ArrayList<>();
+ if (dataSetList.size() > 0) {
+ DataForm dataForm = new DataForm();
+ dataForm.setObjectId(versionId);
+ dataForm.setObjectType(DataSetTypeEnum.REPORT_VER.getCode());
+ dataForm.setList(dataSetList);
+ ReportUtil.http(ApiConst.DATASET_SAVE, Method.POST, JsonUtil.entityToMap(dataForm));
+ }
+ return "";
+ }
+
+ public void creUpdateCheck(ReportEntity entity, Boolean fullNameCheck, Boolean encodeCheck) {
+ String fullName = entity.getFullName();
+ String encode = entity.getEnCode();
+ // 名称长度验证
+ if (fullName.length() > 80) {
+ throw new DataException(MsgCode.EXIST005.get());
+ }
+ QueryWrapper query = new QueryWrapper<>();
+ // 重名验证
+ if (fullNameCheck) {
+ query.lambda().eq(ReportEntity::getFullName, fullName);
+ if (this.list(query).size() > 0) {
+ throw new DataException(MsgCode.EXIST003.get());
+ }
+ }
+ // 编码验证
+ if (encodeCheck) {
+ query.clear();
+ query.lambda().eq(ReportEntity::getEnCode, encode);
+ if (this.list(query).size() > 0) {
+ throw new DataException(MsgCode.EXIST002.get());
+ }
+ }
+ }
+
+}
diff --git a/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/ReportVersionServiceImpl.java b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/ReportVersionServiceImpl.java
new file mode 100644
index 0000000..cd7770e
--- /dev/null
+++ b/yunzhupaas-datareport-univer-biz/src/main/java/com/yunzhupaas/service/impl/ReportVersionServiceImpl.java
@@ -0,0 +1,303 @@
+package com.yunzhupaas.service.impl;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.http.Method;
+import cn.hutool.json.JSONUtil;
+import cn.xuyanwu.spring.file.storage.FileInfo;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import com.google.common.collect.ImmutableList;
+import com.yunzhupaas.base.ActionResult;
+import com.yunzhupaas.base.service.SuperServiceImpl;
+import com.yunzhupaas.constant.MsgCode;
+import com.yunzhupaas.consts.ApiConst;
+import com.yunzhupaas.emnus.DataSetTypeEnum;
+import com.yunzhupaas.entity.ReportEntity;
+import com.yunzhupaas.entity.ReportVersionEntity;
+import com.yunzhupaas.exception.DataException;
+import com.yunzhupaas.mapper.ReportVersionMapper;
+import com.yunzhupaas.model.DataQuery;
+import com.yunzhupaas.model.data.*;
+import com.yunzhupaas.model.report.ReportCrForm;
+import com.yunzhupaas.model.report.ReportPagination;
+import com.yunzhupaas.model.report.UploaderVO;
+import com.yunzhupaas.service.ReportService;
+import com.yunzhupaas.service.ReportVersionService;
+import com.yunzhupaas.univer.chart.UniverChartModel;
+import com.yunzhupaas.univer.data.custom.UniverCustom;
+import com.yunzhupaas.univer.model.UniverPreview;
+import com.yunzhupaas.univer.model.UniverWorkBook;
+import com.yunzhupaas.util.*;
+import lombok.Cleanup;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author :云筑产品开发平台组
+ * @version: V3.1.0
+ * @copyright 深圳市乐程软件有限公司
+ * @date :2024/5/11 下午4:35
+ */
+@Service
+public class ReportVersionServiceImpl extends SuperServiceImpl
+ implements ReportVersionService {
+
+ @Autowired
+ private RedisUtil redisUtil;
+ @Autowired
+ private ReportService reportService;
+
+ @Override
+ @DSTransactional
+ public void create(ReportCrForm form) {
+ String versionId = RandomUtil.uuId();
+ ReportVersionEntity entity = JsonUtil.getJsonToBean(form, ReportVersionEntity.class);
+ entity.setId(versionId);
+ entity.setTemplateId(form.getId());
+ entity.setCreatorUserId(UserProvider.getLoginUserId());
+ entity.setCreatorTime(new Date());
+ List verList = getList(entity.getId(), ReportVersionEntity::getVersion);
+ int version = verList.stream().map(ReportVersionEntity::getVersion).max(Comparator.naturalOrder()).orElse(0)
+ + 1;
+ entity.setVersion(version);
+ entity.setState(0);
+ entity.setSortCode(0l);
+ this.setIgnoreLogicDelete().removeById(entity.getId());
+ this.setIgnoreLogicDelete().saveOrUpdate(entity);
+ this.clearIgnoreLogicDelete();
+ List dataSetList = form.getDataSetList() != null ? form.getDataSetList() : new ArrayList<>();
+ if (dataSetList.size() > 0) {
+ // 数据集创建
+ DataForm dataForm = new DataForm();
+ dataForm.setObjectId(versionId);
+ dataForm.setObjectType(DataSetTypeEnum.REPORT_VER.getCode());
+ dataForm.setList(dataSetList);
+ ReportUtil.http(ApiConst.DATASET_SAVE, Method.POST, JsonUtil.entityToMap(dataForm));
+ }
+ }
+
+ @Override
+ public List getList(String templateId, SFunction... columns) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ if (columns != null && columns.length > 0) {
+ queryWrapper.lambda().select(columns);
+ }
+ queryWrapper.lambda().eq(ReportVersionEntity::getTemplateId, templateId);
+ queryWrapper.lambda().orderByDesc(ReportVersionEntity::getSortCode).orderByAsc(ReportVersionEntity::getState);
+ return this.list(queryWrapper);
+ }
+
+ @Override
+ public String copyVersion(String versionId) {
+ ReportVersionEntity entity = this.getById(versionId);
+ ReportVersionEntity versionEntity = JsonUtil.getJsonToBean(entity, ReportVersionEntity.class);
+ String newVersionId = RandomUtil.uuId();
+ versionEntity.setId(newVersionId);
+ List verList = getList(entity.getTemplateId(), ReportVersionEntity::getVersion);
+ int version = verList.stream().map(ReportVersionEntity::getVersion).max(Comparator.naturalOrder()).orElse(0)
+ + 1;
+ versionEntity.setVersion(version);
+ versionEntity.setState(0);
+ versionEntity.setSortCode(0l);
+ versionEntity.setCreatorTime(new Date());
+ versionEntity.setCreatorUserId(UserProvider.getLoginUserId());
+ versionEntity.setLastModifyTime(null);
+ versionEntity.setLastModifyUserId(null);
+ DataSetPagination pagination = new DataSetPagination();
+ pagination.setObjectId(versionId);
+ pagination.setObjectType(DataSetTypeEnum.REPORT_VER.getCode());
+ String json = ReportUtil.http(ApiConst.DATASET_LIST, Method.GET, JsonUtil.entityToMap(pagination));
+ ActionResult result = JsonUtil.getJsonToBean(json, ActionResult.class);
+ List dataSetList = new ArrayList<>();
+ if (ObjectUtil.isNotEmpty(result.getData())) {
+ dataSetList.addAll(JsonUtil.getJsonToList(result.getData(), DataSetInfo.class));
+ }
+ if (dataSetList.size() > 0) {
+ for (DataSetInfo item : dataSetList) {
+ item.setId(null);
+ item.setObjectType(DataSetTypeEnum.REPORT_VER.getCode());
+ item.setObjectId(newVersionId);
+ }
+ DataForm dataForm = new DataForm();
+ dataForm.setObjectId(newVersionId);
+ dataForm.setObjectType(DataSetTypeEnum.REPORT_VER.getCode());
+ dataForm.setList(dataSetList);
+ ReportUtil.http(ApiConst.DATASET_SAVE, Method.POST, JsonUtil.entityToMap(dataForm));
+ }
+ this.save(versionEntity);
+ return newVersionId;
+ }
+
+ @Override
+ public void removeByTemplateId(String templateId) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.lambda().eq(ReportVersionEntity::getTemplateId, templateId);
+ this.remove(queryWrapper);
+ }
+
+ @Override
+ public UniverPreview preview(String id, ReportPagination pagination, Map params) {
+ ReportVersionEntity entity = getById(id);
+ if (ObjectUtil.isEmpty(entity)) {
+ throw new DataException(MsgCode.FA015.get());
+ }
+ if (ObjectUtil.isEmpty(entity.getSnapshot())) {
+ throw new DataException(MsgCode.FA105.get());
+ }
+ Object univerData = redisUtil.getString(id);
+ if (ObjectUtil.isNotEmpty(univerData)) {
+ return JsonUtil.getJsonToBean(String.valueOf(univerData), UniverPreview.class);
+ }
+ // 获取当前
+ UniverWorkBook univerWorkBook = JsonUtil.getJsonToBean(entity.getSnapshot(), UniverWorkBook.class);
+ List sheetOrder = univerWorkBook.getSheetOrder();
+ ReportEntity report = reportService.getById(entity.getTemplateId());
+ Map>>> sheetData = new HashMap<>();
+ Map>> parameterData = new HashMap<>();
+ // 当前数据
+ String sheet = StringUtil.isNotEmpty(pagination.getSheetId()) ? pagination.getSheetId()
+ : !sheetOrder.isEmpty() ? sheetOrder.get(0) : null;
+ for (String sheetId : sheetOrder) {
+ DataSetQuery query = new DataSetQuery();
+ query.setModuleId(entity.getTemplateId());
+ query.setId(id);
+ Map dataMap = new HashMap<>(params);
+ Object object = params.get(sheetId);
+ if (object instanceof Map) {
+ Map data = (Map) object;
+ dataMap.putAll(data);
+ }
+ query.setMap(dataMap);
+ query.setType(DataSetTypeEnum.REPORT_VER.getCode());
+ query.setSnowFlakeId(RandomUtil.uuId());
+ query.setConvertConfig(entity.getConvertConfig());
+ List dataQueryList = StringUtil.isNotEmpty(entity.getQueryList())
+ ? JsonUtil.getJsonToList(entity.getQueryList(), DataQuery.class)
+ : new ArrayList<>();
+ Map> queryMap = dataQueryList.stream()
+ .collect(Collectors.groupingBy(DataQuery::getSheet));
+ List queryListAll = queryMap.get(sheetId) != null ? queryMap.get(sheetId) : new ArrayList<>();
+ List