Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
twelvet
twelvet
比较版本
d7eef2ed6591e1d8432a22c875c88c75cfbd063b...6a6320cafacfd017d7bae1498c3b37c84f80a942
twelvet
项目概览
twelvet
/
twelvet
9 个月 前同步成功
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
twelvet
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
源分支
6a6320cafacfd017d7bae1498c3b37c84f80a942
选择Git版本
...
目标分支
d7eef2ed6591e1d8432a22c875c88c75cfbd063b
选择Git版本
比较
Commits (10)
https://gitcode.net/twelvet/twelvet/-/commit/a576599c27394443bda67919d1a4ae070a2d2523
优化代码生成
2023-07-28T09:46:44+08:00
twelvet
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/df960f69fe1e2f0cf8f6137791b2de664aed0403
Update pom.xml
2023-07-28T11:27:42+08:00
twelvet
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/1dce74f72731348b5b701692eab63ab0e8bca8fb
Update pom.xml
2023-07-28T11:30:20+08:00
twelvet
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/ba355e90ef3c241a6ec55f1bf8f6c4f3a74a2e6d
优化代码生成第一版
2023-07-28T22:47:15+08:00
twelvet
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/d0fd9fb4c1ae77b2be869c8fa23fa2e3444630cb
Merge remote-tracking branch 'origin/spring-cloud-tencent' into spring-cloud-...
2023-07-28T22:47:26+08:00
twelvet
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/f8b5aec58f39264d3ee4bf84c8fefe8d271c11fb
优化代码生成第二版
2023-07-29T11:49:36+08:00
twelvet
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/bcee51c396c5b9131e96fbc992b72afc063505f9
优化代码生成器第三版
2023-07-31T15:56:04+08:00
TwelveT
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/420f84953bce395d8ef90e2375aa26a0bb6b2b60
用户数据导入
2023-08-05T11:37:26+08:00
TwelveT
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/c2324d412e3c5d0d111c5dd0a8821aeaea303f22
Excel分离
2023-08-05T11:52:58+08:00
TwelveT
2471835953@qq.com
https://gitcode.net/twelvet/twelvet/-/commit/6a6320cafacfd017d7bae1498c3b37c84f80a942
Excel分离
2023-08-06T20:18:00+08:00
twelvet
2471835953@qq.com
展开全部
隐藏空白更改
内联
并排
Showing
48 changed file
with
919 addition
and
2049 deletion
+919
-2049
pom.xml
pom.xml
+11
-3
twelvet-api/pom.xml
twelvet-api/pom.xml
+6
-0
twelvet-api/twelvet-api-job/src/main/java/com/twelvet/api/job/domain/SysJob.java
...-job/src/main/java/com/twelvet/api/job/domain/SysJob.java
+11
-13
twelvet-api/twelvet-api-job/src/main/java/com/twelvet/api/job/domain/SysJobLog.java
...b/src/main/java/com/twelvet/api/job/domain/SysJobLog.java
+8
-9
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysClientDetails.java
.../java/com/twelvet/api/system/domain/SysClientDetails.java
+0
-1
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysConfig.java
...rc/main/java/com/twelvet/api/system/domain/SysConfig.java
+8
-10
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysDept.java
.../src/main/java/com/twelvet/api/system/domain/SysDept.java
+3
-4
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysDictData.java
.../main/java/com/twelvet/api/system/domain/SysDictData.java
+10
-11
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysDictType.java
.../main/java/com/twelvet/api/system/domain/SysDictType.java
+7
-9
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysLoginInfo.java
...main/java/com/twelvet/api/system/domain/SysLoginInfo.java
+8
-9
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysOperationLog.java
...n/java/com/twelvet/api/system/domain/SysOperationLog.java
+21
-22
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysPost.java
.../src/main/java/com/twelvet/api/system/domain/SysPost.java
+8
-10
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysRoleDept.java
.../main/java/com/twelvet/api/system/domain/SysRoleDept.java
+0
-1
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysRoleMenu.java
.../main/java/com/twelvet/api/system/domain/SysRoleMenu.java
+0
-1
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysUser.java
.../src/main/java/com/twelvet/api/system/domain/SysUser.java
+19
-24
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysUserPost.java
.../main/java/com/twelvet/api/system/domain/SysUserPost.java
+0
-1
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysUserRole.java
.../main/java/com/twelvet/api/system/domain/SysUserRole.java
+0
-1
twelvet-framework/twelvet-framework-core/pom.xml
twelvet-framework/twelvet-framework-core/pom.xml
+6
-0
twelvet-framework/twelvet-framework-security/src/main/java/com/twelvet/framework/security/domain/LoginUser.java
...java/com/twelvet/framework/security/domain/LoginUser.java
+0
-1
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/annotation/excel/Excel.java
...a/com/twelvet/framework/utils/annotation/excel/Excel.java
+0
-164
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/annotation/excel/Excels.java
.../com/twelvet/framework/utils/annotation/excel/Excels.java
+0
-19
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/poi/ExcelHandlerAdapter.java
.../com/twelvet/framework/utils/poi/ExcelHandlerAdapter.java
+0
-18
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/poi/ExcelUtils.java
...main/java/com/twelvet/framework/utils/poi/ExcelUtils.java
+0
-1022
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/reflect/ReflectUtils.java
...ava/com/twelvet/framework/utils/reflect/ReflectUtils.java
+0
-4
twelvet-gateway/pom.xml
twelvet-gateway/pom.xml
+6
-0
twelvet-server/pom.xml
twelvet-server/pom.xml
+6
-0
twelvet-server/twelvet-server-gen/src/main/java/com/twelvet/server/gen/controller/GenController.java
...java/com/twelvet/server/gen/controller/GenController.java
+1
-2
twelvet-server/twelvet-server-gen/src/main/java/com/twelvet/server/gen/service/impl/GenTableServiceImpl.java
.../twelvet/server/gen/service/impl/GenTableServiceImpl.java
+1
-1
twelvet-server/twelvet-server-gen/src/main/java/com/twelvet/server/gen/utils/VelocityUtils.java
...main/java/com/twelvet/server/gen/utils/VelocityUtils.java
+2
-2
twelvet-server/twelvet-server-gen/src/main/resources/vm/java/controller.java.vm
...-server-gen/src/main/resources/vm/java/controller.java.vm
+18
-19
twelvet-server/twelvet-server-gen/src/main/resources/vm/java/domain.java.vm
...lvet-server-gen/src/main/resources/vm/java/domain.java.vm
+4
-4
twelvet-server/twelvet-server-gen/src/main/resources/vm/java/sub-domain.java.vm
...-server-gen/src/main/resources/vm/java/sub-domain.java.vm
+3
-3
twelvet-server/twelvet-server-gen/src/main/resources/vm/react/index-tree.tsx.vm
...-server-gen/src/main/resources/vm/react/index-tree.tsx.vm
+337
-282
twelvet-server/twelvet-server-gen/src/main/resources/vm/react/index.tsx.vm
...elvet-server-gen/src/main/resources/vm/react/index.tsx.vm
+318
-262
twelvet-server/twelvet-server-gen/src/main/resources/vm/react/service.ts.vm
...lvet-server-gen/src/main/resources/vm/react/service.ts.vm
+13
-9
twelvet-server/twelvet-server-gen/src/main/resources/vm/sql/sql.vm
...erver/twelvet-server-gen/src/main/resources/vm/sql/sql.vm
+12
-12
twelvet-server/twelvet-server-job/src/main/java/com/twelvet/server/job/controller/SysJobController.java
...a/com/twelvet/server/job/controller/SysJobController.java
+7
-9
twelvet-server/twelvet-server-job/src/main/java/com/twelvet/server/job/controller/SysJobLogController.java
...om/twelvet/server/job/controller/SysJobLogController.java
+6
-8
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/Oauth2ClientDetailsController.java
...rver/system/controller/Oauth2ClientDetailsController.java
+2
-3
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/RedisController.java
...com/twelvet/server/system/controller/RedisController.java
+1
-1
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysDeptController.java
...m/twelvet/server/system/controller/SysDeptController.java
+1
-1
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysDictDataController.java
...elvet/server/system/controller/SysDictDataController.java
+6
-8
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysDictTypeController.java
...elvet/server/system/controller/SysDictTypeController.java
+7
-9
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysLoginInfoController.java
...lvet/server/system/controller/SysLoginInfoController.java
+6
-8
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysOperationLogController.java
...t/server/system/controller/SysOperationLogController.java
+6
-8
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysPostController.java
...m/twelvet/server/system/controller/SysPostController.java
+8
-10
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysRoleController.java
...m/twelvet/server/system/controller/SysRoleController.java
+7
-9
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysUserController.java
...m/twelvet/server/system/controller/SysUserController.java
+15
-22
未找到文件。
pom.xml
浏览文件 @
6a6320ca
...
...
@@ -43,8 +43,8 @@
<maven.compiler.target>
17
</maven.compiler.target>
<spring-boot-dependencies.version>
3.1.2
</spring-boot-dependencies.version>
<spring-cloud.version>
2022.0.
3
</spring-cloud.version>
<spring-cloud-tencent.version>
1.
8.5-2020.0.5
</spring-cloud-tencent.version>
<spring-cloud.version>
2022.0.
4
</spring-cloud.version>
<spring-cloud-tencent.version>
1.
11.8-2022.0.1
</spring-cloud-tencent.version>
<spring-boot-admin.version>
3.1.0
</spring-boot-admin.version>
<spring-boot.mybatis>
3.0.1
</spring-boot.mybatis>
...
...
@@ -59,11 +59,12 @@
<pagehelper.boot.version>
1.4.6
</pagehelper.boot.version>
<poi.version>
5.2.3
</poi.version>
<commons.io.version>
2.1
1
.0
</commons.io.version>
<commons.io.version>
2.1
3
.0
</commons.io.version>
<velocity.version>
2.3
</velocity.version>
<hutool.version>
5.8.19
</hutool.version>
<redisson.version>
3.20.0
</redisson.version>
<qiniu.version>
7.12.1
</qiniu.version>
<excel-spring-boot-starter.version>
3.0.1
</excel-spring-boot-starter.version>
<docker.plugin.version>
0.32.0
</docker.plugin.version>
<spring.checkstyle.plugin>
0.0.39
</spring.checkstyle.plugin>
...
...
@@ -220,6 +221,13 @@
<version>
${twelvet.version}
</version>
</dependency>
<!--Excel-->
<dependency>
<groupId>
cn.twelvet.excel
</groupId>
<artifactId>
excel-spring-boot-starter
</artifactId>
<version>
${excel-spring-boot-starter.version}
</version>
</dependency>
<!--Redis缓存模块-->
<dependency>
<groupId>
com.twelvet
</groupId>
...
...
twelvet-api/pom.xml
浏览文件 @
6a6320ca
...
...
@@ -43,6 +43,12 @@
<artifactId>
twelvet-framework-swagger
</artifactId>
</dependency>
<!--Excel-->
<dependency>
<groupId>
cn.twelvet.excel
</groupId>
<artifactId>
excel-spring-boot-starter
</artifactId>
</dependency>
</dependencies>
</project>
twelvet-api/twelvet-api-job/src/main/java/com/twelvet/api/job/domain/SysJob.java
浏览文件 @
6a6320ca
package
com.twelvet.api.job.domain
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.core.constants.ScheduleConstants
;
import
com.twelvet.framework.utils.CronUtils
;
import
com.twelvet.framework.utils.StringUtils
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
com.twelvet.framework.utils.annotation.excel.Excel.ColumnType
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
java.io.Serial
;
import
java.util.Date
;
...
...
@@ -32,56 +30,56 @@ public class SysJob extends BaseEntity {
* 任务ID
*/
@Schema
(
description
=
"任务序号"
)
@Excel
(
name
=
"任务序号"
,
cellType
=
ColumnType
.
NUMERIC
)
@Excel
Property
(
value
=
"任务序号"
)
private
Long
jobId
;
/**
* 任务名称
*/
@Schema
(
description
=
"任务名称"
)
@Excel
(
nam
e
=
"任务名称"
)
@Excel
Property
(
valu
e
=
"任务名称"
)
private
String
jobName
;
/**
* 任务组名
*/
@Schema
(
description
=
"任务组名"
)
@Excel
(
nam
e
=
"任务组名"
)
@Excel
Property
(
valu
e
=
"任务组名"
)
private
String
jobGroup
;
/**
* 调用目标字符串
*/
@Schema
(
description
=
"调用目标字符串"
)
@Excel
(
nam
e
=
"调用目标字符串"
)
@Excel
Property
(
valu
e
=
"调用目标字符串"
)
private
String
invokeTarget
;
/**
* cron执行表达式
*/
@Schema
(
description
=
"执行表达式"
)
@Excel
(
nam
e
=
"执行表达式 "
)
@Excel
Property
(
valu
e
=
"执行表达式 "
)
private
String
cronExpression
;
/**
* cron计划策略
*/
@Schema
(
description
=
"计划策略"
)
@Excel
(
name
=
"计划策略 "
,
readConverterExp
=
"0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行
"
)
@Excel
Property
(
value
=
"计划策略(0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行)
"
)
private
String
misfirePolicy
=
ScheduleConstants
.
MISFIRE_DEFAULT
;
/**
* 是否并发执行(0允许 1禁止)
*/
@Schema
(
description
=
"是否并发执行"
)
@Excel
(
name
=
"并发执行"
,
readConverterExp
=
"0=允许,1=禁止
"
)
@Excel
Property
(
value
=
"并发执行(0=允许,1=禁止)
"
)
private
String
concurrent
;
/**
* 任务状态(0正常 1暂停)
*/
@Schema
(
description
=
"任务状态"
)
@Excel
(
name
=
"任务状态"
,
readConverterExp
=
"0=正常,1=暂停
"
)
@Excel
Property
(
value
=
"任务状态(0=正常,1=暂停)
"
)
private
String
status
;
public
Long
getJobId
()
{
...
...
twelvet-api/twelvet-api-job/src/main/java/com/twelvet/api/job/domain/SysJobLog.java
浏览文件 @
6a6320ca
package
com.twelvet.api.job.domain
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
@@ -23,37 +22,37 @@ public class SysJobLog extends BaseEntity {
/** ID */
@Schema
(
description
=
"日志序号"
)
@Excel
(
nam
e
=
"日志序号"
)
@Excel
Property
(
valu
e
=
"日志序号"
)
private
Long
jobLogId
;
/** 任务名称 */
@Schema
(
description
=
"任务名称"
)
@Excel
(
nam
e
=
"任务名称"
)
@Excel
Property
(
valu
e
=
"任务名称"
)
private
String
jobName
;
/** 任务组名 */
@Schema
(
description
=
"任务组名"
)
@Excel
(
nam
e
=
"任务组名"
)
@Excel
Property
(
valu
e
=
"任务组名"
)
private
String
jobGroup
;
/** 调用目标字符串 */
@Schema
(
description
=
"调用目标字符串"
)
@Excel
(
nam
e
=
"调用目标字符串"
)
@Excel
Property
(
valu
e
=
"调用目标字符串"
)
private
String
invokeTarget
;
/** 日志信息 */
@Schema
(
description
=
"日志信息"
)
@Excel
(
nam
e
=
"日志信息"
)
@Excel
Property
(
valu
e
=
"日志信息"
)
private
String
jobMessage
;
/** 执行状态(0正常 1失败) */
@Schema
(
description
=
"执行状态"
)
@Excel
(
name
=
"执行状态"
,
readConverterExp
=
"0=正常,1=失败
"
)
@Excel
Property
(
value
=
"执行状态(0=正常,1=失败)
"
)
private
String
status
;
/** 异常信息 */
@Schema
(
description
=
"异常信息"
)
@Excel
(
nam
e
=
"异常信息"
)
@Excel
Property
(
valu
e
=
"异常信息"
)
private
String
exceptionInfo
;
/** 开始时间 */
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysClientDetails.java
浏览文件 @
6a6320ca
...
...
@@ -2,7 +2,6 @@ package com.twelvet.api.system.domain;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysConfig.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
com.twelvet.framework.utils.annotation.excel.Excel.ColumnType
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
java.io.Serial
;
/**
...
...
@@ -27,35 +25,35 @@ public class SysConfig extends BaseEntity {
* 参数主键
*/
@Schema
(
description
=
"参数主键"
)
@Excel
(
name
=
"参数主键"
,
cellType
=
ColumnType
.
NUMERIC
)
@Excel
Property
(
value
=
"参数主键"
)
private
Long
configId
;
/**
* 参数名称
*/
@Schema
(
description
=
"参数名称"
)
@Excel
(
nam
e
=
"参数名称"
)
@Excel
Property
(
valu
e
=
"参数名称"
)
private
String
configName
;
/**
* 参数键名
*/
@Schema
(
description
=
"参数键名"
)
@Excel
(
nam
e
=
"参数键名"
)
@Excel
Property
(
valu
e
=
"参数键名"
)
private
String
configKey
;
/**
* 参数键值
*/
@Schema
(
description
=
"参数键值"
)
@Excel
(
nam
e
=
"参数键值"
)
@Excel
Property
(
valu
e
=
"参数键值"
)
private
String
configValue
;
/**
* 系统内置(Y是 N否)
*/
@Schema
(
description
=
"系统内置"
)
@Excel
(
name
=
"系统内置"
,
readConverterExp
=
"Y=是,N=否
"
)
@Excel
Property
(
value
=
"系统内置(Y=是,N=否)
"
)
private
String
configType
;
public
Long
getConfigId
()
{
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysDept.java
浏览文件 @
6a6320ca
...
...
@@ -2,13 +2,12 @@ package com.twelvet.api.system.domain;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
jakarta.validation.constraints.Email
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.io.Serial
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysDictData.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.core.constants.UserConstants
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
com.twelvet.framework.utils.annotation.excel.Excel.ColumnType
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
java.io.Serial
;
/**
...
...
@@ -27,35 +26,35 @@ public class SysDictData extends BaseEntity {
* 字典编码
*/
@Schema
(
description
=
"字典编码"
)
@Excel
(
name
=
"字典编码"
,
cellType
=
ColumnType
.
NUMERIC
)
@Excel
Property
(
value
=
"字典编码"
)
private
Long
dictCode
;
/**
* 字典排序
*/
@Schema
(
description
=
"字典排序"
)
@Excel
(
name
=
"字典排序"
,
cellType
=
ColumnType
.
NUMERIC
)
@Excel
Property
(
value
=
"字典排序"
)
private
Long
dictSort
;
/**
* 字典标签
*/
@Schema
(
description
=
"字典标签"
)
@Excel
(
nam
e
=
"字典标签"
)
@Excel
Property
(
valu
e
=
"字典标签"
)
private
String
dictLabel
;
/**
* 字典键值
*/
@Schema
(
description
=
"字典键值"
)
@Excel
(
nam
e
=
"字典键值"
)
@Excel
Property
(
valu
e
=
"字典键值"
)
private
String
dictValue
;
/**
* 字典类型
*/
@Schema
(
description
=
"字典类型"
)
@Excel
(
nam
e
=
"字典类型"
)
@Excel
Property
(
valu
e
=
"字典类型"
)
private
String
dictType
;
/**
...
...
@@ -74,14 +73,14 @@ public class SysDictData extends BaseEntity {
* 是否默认(Y是 N否)
*/
@Schema
(
description
=
"是否默认"
)
@Excel
(
name
=
"是否默认"
,
readConverterExp
=
"Y=是,N=否
"
)
@Excel
Property
(
value
=
"是否默认(Y=是,N=否)
"
)
private
String
isDefault
;
/**
* 状态(0正常 1停用)
*/
@Schema
(
description
=
"状态"
)
@Excel
(
name
=
"状态"
,
readConverterExp
=
"0=正常,1=停用
"
)
@Excel
Property
(
value
=
"状态(0=正常,1=停用)
"
)
private
String
status
;
public
Long
getDictCode
()
{
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysDictType.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.twelvet.framework.utils.annotation.excel.Excel.ColumnType
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
java.io.Serial
;
@Schema
(
description
=
"字典表"
)
...
...
@@ -22,28 +20,28 @@ public class SysDictType extends BaseEntity {
* 字典主键
*/
@Schema
(
description
=
"字典主键"
)
@Excel
(
name
=
"字典主键"
,
cellType
=
ColumnType
.
NUMERIC
)
@Excel
Property
(
value
=
"字典主键"
)
private
Long
dictId
;
/**
* 字典名称
*/
@Schema
(
description
=
"字典名称"
)
@Excel
(
nam
e
=
"字典名称"
)
@Excel
Property
(
valu
e
=
"字典名称"
)
private
String
dictName
;
/**
* 字典类型
*/
@Schema
(
description
=
"字典类型"
)
@Excel
(
nam
e
=
"字典类型"
)
@Excel
Property
(
valu
e
=
"字典类型"
)
private
String
dictType
;
/**
* 状态(0正常 1停用)
*/
@Schema
(
description
=
"状态"
)
@Excel
(
name
=
"状态"
,
readConverterExp
=
"0=正常,1=停用
"
)
@Excel
Property
(
value
=
"状态(0=正常,1=停用)
"
)
private
String
status
;
public
Long
getDictId
()
{
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysLoginInfo.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
com.twelvet.framework.utils.annotation.excel.Excel.ColumnType
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
java.io.Serial
;
...
...
@@ -24,35 +23,35 @@ public class SysLoginInfo extends BaseEntity {
* ID
*/
@Schema
(
description
=
"序号"
)
@Excel
(
name
=
"序号"
,
cellType
=
ColumnType
.
NUMERIC
)
@Excel
Property
(
value
=
"序号"
)
private
Long
infoId
;
/**
* 用户账号
*/
@Schema
(
description
=
"用户账号"
)
@Excel
(
nam
e
=
"用户账号"
)
@Excel
Property
(
valu
e
=
"用户账号"
)
private
String
userName
;
/**
* 状态 0成功 1失败
*/
@Schema
(
description
=
"状态"
)
@Excel
(
name
=
"状态"
,
readConverterExp
=
"1=登录成功,2=退出成功,0=登录失败
"
)
@Excel
Property
(
value
=
"状态(1=登录成功,2=退出成功,0=登录失败)
"
)
private
String
status
;
/**
* 地址
*/
@Schema
(
description
=
"地址"
)
@Excel
(
nam
e
=
"地址"
)
@Excel
Property
(
valu
e
=
"地址"
)
private
String
ipaddr
;
/**
* 描述
*/
@Schema
(
description
=
"描述"
)
@Excel
(
nam
e
=
"描述"
)
@Excel
Property
(
valu
e
=
"描述"
)
private
String
msg
;
/**
...
...
@@ -60,14 +59,14 @@ public class SysLoginInfo extends BaseEntity {
*/
@Schema
(
description
=
"访问时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"访问时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss
"
)
@Excel
Property
(
value
=
"访问时间
"
)
private
Date
accessTime
;
/**
* 部门ID
*/
@Schema
(
description
=
"部门ID"
)
@Excel
(
nam
e
=
"部门ID"
)
@Excel
Property
(
valu
e
=
"部门ID"
)
private
Long
deptId
;
public
Long
getDeptId
()
{
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysOperationLog.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
java.io.Serial
;
import
java.util.Arrays
;
import
java.util.Date
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
com.twelvet.framework.utils.annotation.excel.Excel.ColumnType
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
java.io.Serial
;
import
java.util.Arrays
;
import
java.util.Date
;
/**
* @author twelvet
* @WebSite twelvet.cn
...
...
@@ -25,21 +24,21 @@ public class SysOperationLog extends BaseEntity {
* 日志主键
*/
@Schema
(
description
=
"日志主键"
)
@Excel
(
name
=
"操作序号"
,
cellType
=
ColumnType
.
NUMERIC
)
@Excel
Property
(
value
=
"操作序号"
)
private
Long
operId
;
/**
* 操作模块
*/
@Schema
(
description
=
"操作模块"
)
@Excel
(
nam
e
=
"操作模块"
)
@Excel
Property
(
valu
e
=
"操作模块"
)
private
String
service
;
/**
* 业务类型(0其它 1新增 2修改 3删除)
*/
@Schema
(
description
=
"业务类型"
)
@Excel
(
name
=
"业务类型"
,
readConverterExp
=
"0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据
"
)
@Excel
Property
(
value
=
"业务类型(0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据)
"
)
private
Integer
businessType
;
/**
...
...
@@ -52,77 +51,77 @@ public class SysOperationLog extends BaseEntity {
* 请求方法
*/
@Schema
(
description
=
"请求方法"
)
@Excel
(
nam
e
=
"请求方法"
)
@Excel
Property
(
valu
e
=
"请求方法"
)
private
String
method
;
/**
* 请求方式
*/
@Schema
(
description
=
"请求方式"
)
@Excel
(
nam
e
=
"请求方式"
)
@Excel
Property
(
valu
e
=
"请求方式"
)
private
String
requestMethod
;
/**
* 操作类别(0其它 1后台用户 2手机端用户)
*/
@Schema
(
description
=
"操作类别"
)
@Excel
(
name
=
"操作类别"
,
readConverterExp
=
"0=其它,1=后台用户,2=手机端用户
"
)
@Excel
Property
(
value
=
"操作类别(0=其它,1=后台用户,2=手机端用户)
"
)
private
Integer
operatorType
;
/**
* 操作人员
*/
@Schema
(
description
=
"操作人员"
)
@Excel
(
nam
e
=
"操作人员"
)
@Excel
Property
(
valu
e
=
"操作人员"
)
private
String
operName
;
/**
* 部门名称
*/
@Schema
(
description
=
"部门名称"
)
@Excel
(
nam
e
=
"部门名称"
)
@Excel
Property
(
valu
e
=
"部门名称"
)
private
String
deptName
;
/**
* 请求url
*/
@Schema
(
description
=
"请求url"
)
@Excel
(
nam
e
=
"请求地址"
)
@Excel
Property
(
valu
e
=
"请求地址"
)
private
String
operUrl
;
/**
* 操作地址
*/
@Schema
(
description
=
"操作地址"
)
@Excel
(
nam
e
=
"操作地址"
)
@Excel
Property
(
valu
e
=
"操作地址"
)
private
String
operIp
;
/**
* 请求参数
*/
@Schema
(
description
=
"请求参数"
)
@Excel
(
nam
e
=
"请求参数"
)
@Excel
Property
(
valu
e
=
"请求参数"
)
private
String
operParam
;
/**
* 返回参数
*/
@Schema
(
description
=
"返回参数"
)
@Excel
(
nam
e
=
"返回参数"
)
@Excel
Property
(
valu
e
=
"返回参数"
)
private
String
jsonResult
;
/**
* 操作状态(0正常 1异常)
*/
@Schema
(
description
=
"操作状态"
)
@Excel
(
name
=
"状态"
,
readConverterExp
=
"0=正常,1=异常
"
)
@Excel
Property
(
value
=
"状态(0=正常,1=异常)
"
)
private
Integer
status
;
/**
* 错误消息
*/
@Schema
(
description
=
"错误消息"
)
@Excel
(
nam
e
=
"错误消息"
)
@Excel
Property
(
valu
e
=
"错误消息"
)
private
String
errorMsg
;
/**
...
...
@@ -130,14 +129,14 @@ public class SysOperationLog extends BaseEntity {
*/
@Schema
(
description
=
"操作时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"操作时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss
"
)
@Excel
Property
(
value
=
"操作时间
"
)
private
Date
operTime
;
/**
* 部门ID
*/
@Schema
(
description
=
"部门ID"
)
@Excel
(
nam
e
=
"部门ID"
)
@Excel
Property
(
valu
e
=
"部门ID"
)
private
Long
deptId
;
public
Long
getDeptId
()
{
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysPost.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
com.twelvet.framework.utils.annotation.excel.Excel.ColumnType
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
java.io.Serial
;
/**
...
...
@@ -27,35 +25,35 @@ public class SysPost extends BaseEntity {
* 岗位序号
*/
@Schema
(
description
=
"岗位序号"
)
@Excel
(
name
=
"岗位序号"
,
cellType
=
ColumnType
.
NUMERIC
)
@Excel
Property
(
value
=
"岗位序号"
)
private
Long
postId
;
/**
* 岗位编码
*/
@Schema
(
description
=
"岗位编码"
)
@Excel
(
nam
e
=
"岗位编码"
)
@Excel
Property
(
valu
e
=
"岗位编码"
)
private
String
postCode
;
/**
* 岗位名称
*/
@Schema
(
description
=
"岗位名称"
)
@Excel
(
nam
e
=
"岗位名称"
)
@Excel
Property
(
valu
e
=
"岗位名称"
)
private
String
postName
;
/**
* 岗位排序
*/
@Schema
(
description
=
"岗位排序"
)
@Excel
(
nam
e
=
"岗位排序"
)
@Excel
Property
(
valu
e
=
"岗位排序"
)
private
String
postSort
;
/**
* 状态(0正常 1停用)
*/
@Schema
(
description
=
"状态"
)
@Excel
(
name
=
"状态"
,
readConverterExp
=
"0=正常,1=停用
"
)
@Excel
Property
(
value
=
"状态(0=正常,1=停用)
"
)
private
String
status
;
/**
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysRoleDept.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysRoleMenu.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysUser.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.twelvet.framework.core.application.domain.BaseEntity
;
import
com.twelvet.framework.core.xss.Xss
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
com.twelvet.framework.utils.annotation.excel.Excel.ColumnType
;
import
com.twelvet.framework.utils.annotation.excel.Excel.Type
;
import
com.twelvet.framework.utils.annotation.excel.Excels
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
jakarta.validation.constraints.Email
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.Size
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.io.Serial
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -34,49 +29,49 @@ public class SysUser extends BaseEntity {
* 用户ID
*/
@Schema
(
description
=
"用户ID"
)
@Excel
(
name
=
"用户序号"
,
cellType
=
ColumnType
.
NUMERIC
,
prompt
=
"用户编
号"
)
@Excel
Property
(
value
=
"用户序
号"
)
private
Long
userId
;
/**
* 部门ID
*/
@Schema
(
description
=
"部门ID"
)
@Excel
(
name
=
"部门编号"
,
type
=
Type
.
IMPORT
)
@Excel
Property
(
value
=
"部门编号"
)
private
Long
deptId
;
/**
* 用户账号
*/
@Schema
(
description
=
"用户账号"
)
@Excel
(
nam
e
=
"登录名称"
)
@Excel
Property
(
valu
e
=
"登录名称"
)
private
String
username
;
/**
* 用户昵称
*/
@Schema
(
description
=
"用户昵称"
)
@Excel
(
nam
e
=
"用户名称"
)
@Excel
Property
(
valu
e
=
"用户名称"
)
private
String
nickName
;
/**
* 用户邮箱
*/
@Schema
(
description
=
"用户邮箱"
)
@Excel
(
nam
e
=
"用户邮箱"
)
@Excel
Property
(
valu
e
=
"用户邮箱"
)
private
String
email
;
/**
* 手机号码
*/
@Schema
(
description
=
"手机号码"
)
@Excel
(
nam
e
=
"手机号码"
)
@Excel
Property
(
valu
e
=
"手机号码"
)
private
String
phonenumber
;
/**
* 用户性别
*/
@Schema
(
description
=
"用户性别"
)
@Excel
(
name
=
"用户性别"
,
readConverterExp
=
"0=男,1=女,2=未知
"
)
@Excel
Property
(
value
=
"用户性别(0=男,1=女,2=未知)
"
)
private
String
sex
;
/**
...
...
@@ -95,7 +90,7 @@ public class SysUser extends BaseEntity {
* 帐号状态(0正常 1停用)
*/
@Schema
(
description
=
"帐号状态"
)
@Excel
(
name
=
"帐号状态"
,
readConverterExp
=
"0=正常,1=停用
"
)
@Excel
Property
(
value
=
"帐号状态(0=正常,1=停用)
"
)
private
String
status
;
/**
...
...
@@ -108,39 +103,41 @@ public class SysUser extends BaseEntity {
* 最后登录IP
*/
@Schema
(
description
=
"最后登录IP"
)
@Excel
(
name
=
"最后登录IP"
,
type
=
Type
.
EXPORT
)
@Excel
Property
(
value
=
"最后登录IP"
)
private
String
loginIp
;
/**
* 最后登录时间
*/
@Schema
(
description
=
"最后登录时间"
)
@Excel
(
name
=
"最后登录时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
,
type
=
Type
.
EXPORT
)
@Excel
Property
(
value
=
"最后登录时间"
)
private
Date
loginDate
;
/**
* 部门对象
*/
@ExcelIgnore
@Schema
(
description
=
"部门对象"
)
@Excels
({
@Excel
(
name
=
"部门名称"
,
targetAttr
=
"deptName"
,
type
=
Type
.
EXPORT
),
@Excel
(
name
=
"部门负责人"
,
targetAttr
=
"leader"
,
type
=
Type
.
EXPORT
)
})
private
SysDept
dept
;
/**
* 角色对象
*/
@ExcelIgnore
@Schema
(
description
=
"角色对象"
)
private
List
<
SysRole
>
roles
;
/**
* 角色组
*/
@ExcelIgnore
@Schema
(
description
=
"角色组"
)
private
Long
[]
roleIds
;
/**
* 岗位组
*/
@ExcelIgnore
@Schema
(
description
=
"岗位组"
)
private
Long
[]
postIds
;
...
...
@@ -182,7 +179,6 @@ public class SysUser extends BaseEntity {
this
.
deptId
=
deptId
;
}
@Xss
(
message
=
"用户昵称不能包含脚本字符"
)
@Size
(
min
=
0
,
max
=
30
,
message
=
"用户昵称长度不能超过30个字符"
)
public
String
getNickName
()
{
return
nickName
;
...
...
@@ -192,7 +188,6 @@ public class SysUser extends BaseEntity {
this
.
nickName
=
nickName
;
}
@Xss
(
message
=
"用户账号不能包含脚本字符"
)
@NotBlank
(
message
=
"用户账号不能为空"
)
@Size
(
min
=
0
,
max
=
30
,
message
=
"用户账号长度不能超过30个字符"
)
public
String
getUsername
()
{
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysUserPost.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
twelvet-api/twelvet-api-system/src/main/java/com/twelvet/api/system/domain/SysUserRole.java
浏览文件 @
6a6320ca
package
com.twelvet.api.system.domain
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
twelvet-framework/twelvet-framework-core/pom.xml
浏览文件 @
6a6320ca
...
...
@@ -40,6 +40,12 @@
<artifactId>
spring-boot-starter-validation
</artifactId>
</dependency>
<!--Excel-->
<dependency>
<groupId>
cn.twelvet.excel
</groupId>
<artifactId>
excel-spring-boot-starter
</artifactId>
</dependency>
</dependencies>
</project>
twelvet-framework/twelvet-framework-security/src/main/java/com/twelvet/framework/security/domain/LoginUser.java
浏览文件 @
6a6320ca
package
com.twelvet.framework.security.domain
;
import
com.twelvet.api.system.domain.SysRole
;
import
com.twelvet.framework.utils.annotation.excel.Excel
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.springframework.security.core.GrantedAuthority
;
...
...
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/annotation/excel/Excel.java
已删除
100644 → 0
浏览文件 @
d7eef2ed
package
com.twelvet.framework.utils.annotation.excel
;
import
com.twelvet.framework.utils.poi.ExcelHandlerAdapter
;
import
org.apache.poi.ss.usermodel.HorizontalAlignment
;
import
org.apache.poi.ss.usermodel.IndexedColors
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
java.math.BigDecimal
;
/**
* @author twelvet
* @WebSite twelvet.cn
* @Description: 自定义导出Excel数据注解
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
ElementType
.
FIELD
)
public
@interface
Excel
{
/**
* 导出时在excel中排序
*/
public
int
sort
()
default
Integer
.
MAX_VALUE
;
/**
* 导出到Excel中的名字.
*/
public
String
name
()
default
""
;
/**
* 日期格式, 如: yyyy-MM-dd
*/
public
String
dateFormat
()
default
""
;
/**
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
*/
public
String
readConverterExp
()
default
""
;
/**
* 分隔符,读取字符串组内容
*/
public
String
separator
()
default
","
;
/**
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
*/
public
int
scale
()
default
-
1
;
/**
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
*/
public
int
roundingMode
()
default
BigDecimal
.
ROUND_HALF_EVEN
;
/**
* 导出时在excel中每个列的高度 单位为字符
*/
public
double
height
()
default
14
;
/**
* 导出时在excel中每个列的宽 单位为字符
*/
public
double
width
()
default
16
;
/**
* 文字后缀,如% 90 变成90%
*/
public
String
suffix
()
default
""
;
/**
* 当值为空时,字段的默认值
*/
public
String
defaultValue
()
default
""
;
/**
* 提示信息
*/
public
String
prompt
()
default
""
;
/**
* 设置只能选择不能输入的列内容.
*/
public
String
[]
combo
()
default
{};
/**
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
*/
public
boolean
isExport
()
default
true
;
/**
* 另一个类中的属性名称,支持多级获取,以小数点隔开
*/
public
String
targetAttr
()
default
""
;
/**
* 是否自动统计数据,在最后追加一行统计数据总和
*/
public
boolean
isStatistics
()
default
false
;
/**
* 导出类型(0数字 1字符串)
*/
public
ColumnType
cellType
()
default
ColumnType
.
STRING
;
/**
* 导出字体颜色
*/
public
IndexedColors
color
()
default
IndexedColors
.
BLACK
;
/**
* 导出字段对齐方式
*/
public
HorizontalAlignment
align
()
default
HorizontalAlignment
.
CENTER
;
/**
* 自定义数据处理器
*/
public
Class
<?>
handler
()
default
ExcelHandlerAdapter
.
class
;
/**
* 自定义数据处理器参数
*/
public
String
[]
args
()
default
{};
/**
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
*/
Type
type
()
default
Type
.
ALL
;
public
enum
Type
{
ALL
(
0
),
EXPORT
(
1
),
IMPORT
(
2
);
private
final
int
value
;
Type
(
int
value
)
{
this
.
value
=
value
;
}
public
int
value
()
{
return
this
.
value
;
}
}
public
enum
ColumnType
{
NUMERIC
(
0
),
STRING
(
1
),
IMAGE
(
2
);
private
final
int
value
;
ColumnType
(
int
value
)
{
this
.
value
=
value
;
}
public
int
value
()
{
return
this
.
value
;
}
}
}
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/annotation/excel/Excels.java
已删除
100644 → 0
浏览文件 @
d7eef2ed
package
com.twelvet.framework.utils.annotation.excel
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author twelvet
* @WebSite twelvet.cn
* @Description: Excel注解集
*/
@Target
(
ElementType
.
FIELD
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
Excels
{
Excel
[]
value
();
}
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/poi/ExcelHandlerAdapter.java
已删除
100644 → 0
浏览文件 @
d7eef2ed
package
com.twelvet.framework.utils.poi
;
/**
* @author twelvet
* @WebSite twelvet.cn
* @Description: Excel数据格式处理适配器
*/
public
interface
ExcelHandlerAdapter
{
/**
* 格式化
* @param value 单元格数据值
* @param args excel注解args参数组
* @return 处理后的值
*/
Object
format
(
Object
value
,
String
[]
args
);
}
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/poi/ExcelUtils.java
已删除
100644 → 0
浏览文件 @
d7eef2ed
此差异已折叠。
点击以展开。
twelvet-framework/twelvet-framework-utils/src/main/java/com/twelvet/framework/utils/reflect/ReflectUtils.java
浏览文件 @
6a6320ca
...
...
@@ -5,7 +5,6 @@ import com.twelvet.framework.utils.DateUtils;
import
com.twelvet.framework.utils.exception.TWTUtilsException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.Validate
;
import
org.apache.poi.ss.usermodel.DateUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -165,9 +164,6 @@ public class ReflectUtils {
if
(
args
[
i
]
instanceof
String
)
{
args
[
i
]
=
DateUtils
.
parseDate
(
args
[
i
]);
}
else
{
args
[
i
]
=
DateUtil
.
getJavaDate
((
Double
)
args
[
i
]);
}
}
}
}
...
...
twelvet-gateway/pom.xml
浏览文件 @
6a6320ca
...
...
@@ -44,6 +44,12 @@
<dependency>
<groupId>
com.twelvet
</groupId>
<artifactId>
twelvet-framework-core
</artifactId>
<exclusions>
<exclusion>
<groupId>
cn.twelvet.excel
</groupId>
<artifactId>
excel-spring-boot-starter
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
...
...
twelvet-server/pom.xml
浏览文件 @
6a6320ca
...
...
@@ -59,6 +59,12 @@
<artifactId>
spring-cloud-starter-tencent-polaris-config
</artifactId>
</dependency>
<!--Excel-->
<dependency>
<groupId>
cn.twelvet.excel
</groupId>
<artifactId>
excel-spring-boot-starter
</artifactId>
</dependency>
</dependencies>
<build>
...
...
twelvet-server/twelvet-server-gen/src/main/java/com/twelvet/server/gen/controller/GenController.java
浏览文件 @
6a6320ca
...
...
@@ -227,11 +227,10 @@ public class GenController extends TWTController {
* @param data 数据
* @throws IOException IOException
*/
@Operation
(
summary
=
"生成zip文件"
)
private
void
genCode
(
HttpServletResponse
response
,
byte
[]
data
)
throws
IOException
{
response
.
reset
();
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename=\"twelvet.zip\""
);
response
.
addHeader
(
"Content-Length"
,
""
+
data
.
length
);
response
.
setHeader
(
"Content-Length"
,
String
.
valueOf
(
data
.
length
)
);
response
.
setContentType
(
"application/octet-stream; charset=UTF-8"
);
IOUtils
.
write
(
data
,
response
.
getOutputStream
());
}
...
...
twelvet-server/twelvet-server-gen/src/main/java/com/twelvet/server/gen/service/impl/GenTableServiceImpl.java
浏览文件 @
6a6320ca
...
...
@@ -225,7 +225,7 @@ public class GenTableServiceImpl implements IGenTableService {
// 获取模板列表
List
<
String
>
templates
=
VelocityUtils
.
getTemplateList
(
table
.
getTplCategory
());
for
(
String
template
:
templates
)
{
if
(!
StringUtils
.
containsAny
(
template
,
"sql.vm"
,
"
api
.ts.vm"
,
"index.tsx.vm"
,
"index-tree.tsx.vm"
))
{
if
(!
StringUtils
.
containsAny
(
template
,
"sql.vm"
,
"
service
.ts.vm"
,
"index.tsx.vm"
,
"index-tree.tsx.vm"
))
{
// 渲染模板
StringWriter
sw
=
new
StringWriter
();
Template
tpl
=
Velocity
.
getTemplate
(
template
,
Constants
.
UTF8
);
...
...
twelvet-server/twelvet-server-gen/src/main/java/com/twelvet/server/gen/utils/VelocityUtils.java
浏览文件 @
6a6320ca
...
...
@@ -130,7 +130,7 @@ public class VelocityUtils {
templates
.
add
(
"vm/java/controller.java.vm"
);
templates
.
add
(
"vm/xml/mapper.xml.vm"
);
templates
.
add
(
"vm/sql/sql.vm"
);
templates
.
add
(
"vm/
js/api
.ts.vm"
);
templates
.
add
(
"vm/
react/service
.ts.vm"
);
if
(
GenConstants
.
TPL_CRUD
.
equals
(
tplCategory
))
{
templates
.
add
(
"vm/react/index.tsx.vm"
);
}
...
...
@@ -188,7 +188,7 @@ public class VelocityUtils {
else
if
(
template
.
contains
(
"sql.vm"
))
{
fileName
=
businessName
+
"Menu.sql"
;
}
else
if
(
template
.
contains
(
"
api
.ts.vm"
))
{
else
if
(
template
.
contains
(
"
service
.ts.vm"
))
{
fileName
=
StringUtils
.
format
(
"{}/pages/{}/{}/service.ts"
,
reactPath
,
moduleName
,
businessName
);
}
else
if
(
template
.
contains
(
"index.tsx.vm"
))
{
...
...
twelvet-server/twelvet-server-gen/src/main/resources/vm/java/controller.java.vm
浏览文件 @
6a6320ca
...
...
@@ -16,13 +16,13 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import com.twelvet.framework.log.annotation.Log;
import com.twelvet.framework.log.enums.BusinessType;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
cn.dev33.satoken.annotation.SaCheckPermission
;
import
${
packageName
}
.domain.
${
ClassName
}
;
import
${
packageName
}
.service.I
${
ClassName
}
Service;
import com.twelvet.framework.core.application.controller.TWTController;
import com.twelvet.framework.core.application.domain.AjaxResult;
import com.twelvet.framework.core.application.domain.JsonResult;
import c
om.twelvet.framework.utils.poi.ExcelUtils
;
import c
n.twelvet.excel.annotation.ResponseExcel
;
#
if
($
table
.
crud
||
$
table
.
sub
)
import com.twelvet.framework.jdbc.web.utils.PageUtils;
#
elseif
($
table
.
tree
)
...
...
@@ -37,20 +37,20 @@ import com.twelvet.framework.jdbc.web.utils.PageUtils;
*/
@Tag(description = "
${
ClassName
}
Controller", name = "
${
functionName
}
")
@RestController
@RequestMapping("/
${
businessName
}
")
@RequestMapping("/
${
moduleName
}
/
${
businessName
}
")
public class
${
ClassName
}
Controller extends TWTController
{
@Autowired
private I
${
ClassName
}
Service
${
className
}
Service;
/**
* 查询
${
functionName
}
列表
*/
@Operation(summary = "查询
${
functionName
}
列表")
@PreAuthorize("@role.hasPermi('
${
permissionPrefix
}
:list')
")
@GetMapping("/list
")
/**
* 查询
${
functionName
}
列表
*/
@Operation(summary = "查询
${
functionName
}
列表")
@SaCheckPermission("
${
permissionPrefix
}
:list
")
@GetMapping("/pageQuery
")
#
if
($
table
.
crud
||
$
table
.
sub
)
public JsonResult
<TableDataInfo>
list
(
${
ClassName
}
${
className
}
)
public JsonResult
<TableDataInfo>
pageQuery
(
${
ClassName
}
${
className
}
)
{
PageUtils.startPage();
List
<
${
ClassName
}
>
list =
${
className
}
Service.select
${
ClassName
}
List(
${
className
}
);
...
...
@@ -67,22 +67,21 @@ public class ${ClassName}Controller extends TWTController
/**
* 导出
${
functionName
}
列表
*/
@ResponseExcel(name = "
${
functionName
}
")
@Operation(summary = "导出
${
functionName
}
列表")
@
PreAuthorize("@role.hasPermi('
${
permissionPrefix
}
:export')
")
@
SaCheckPermission("
${
permissionPrefix
}
:export
")
@Log(service = "
${
functionName
}
", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public
void export(HttpServletResponse response,
${
ClassName
}
${
className
}
)
public
List
<
${
ClassName
}
>
export(
${
ClassName
}
${
className
}
)
{
List
<
${
ClassName
}
>
list =
${
className
}
Service.select
${
ClassName
}
List(
${
className
}
);
ExcelUtils
<
${
ClassName
}
>
util = new ExcelUtils
<
${
ClassName
}
>
(
${
ClassName
}
.class);
util.exportExcel(response, list, "
${
functionName
}
数据");
return
${
className
}
Service.select
${
ClassName
}
List(
${
className
}
);
}
/**
* 获取
${
functionName
}
详细信息
*/
@Operation(summary = "获取
${
functionName
}
详细信息")
@
PreAuthorize("@role.hasPermi('
${
permissionPrefix
}
:query')
")
@
SaCheckPermission("
${
permissionPrefix
}
:query
")
@GetMapping(value = "/
{
${
pkColumn
.
javaField
}
}")
public JsonResult
<
${
ClassName
}
>
getInfo(@PathVariable("
${
pkColumn
.
javaField
}
")
${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
}
)
{
...
...
@@ -93,7 +92,7 @@ public class ${ClassName}Controller extends TWTController
* 新增
${
functionName
}
*/
@Operation(summary = "新增
${
functionName
}
")
@
PreAuthorize("@role.hasPermi('
${
permissionPrefix
}
:add')
")
@
SaCheckPermission("
${
permissionPrefix
}
:add
")
@Log(service = "
${
functionName
}
", businessType = BusinessType.INSERT)
@PostMapping
public JsonResult
<String>
add(@RequestBody
${
ClassName
}
${
className
}
)
...
...
@@ -105,7 +104,7 @@ public class ${ClassName}Controller extends TWTController
* 修改
${
functionName
}
*/
@Operation(summary = "修改
${
functionName
}
")
@
PreAuthorize("@role.hasPermi('
${
permissionPrefix
}
:edit')
")
@
SaCheckPermission("
${
permissionPrefix
}
:edit
")
@Log(service = "
${
functionName
}
", businessType = BusinessType.UPDATE)
@PutMapping
public JsonResult
<String>
edit(@RequestBody
${
ClassName
}
${
className
}
)
...
...
@@ -117,7 +116,7 @@ public class ${ClassName}Controller extends TWTController
* 删除
${
functionName
}
*/
@Operation(summary = "删除
${
functionName
}
")
@
PreAuthorize("@role.hasPermi('
${
permissionPrefix
}
:remove')
")
@
SaCheckPermission("
${
permissionPrefix
}
:remove
")
@Log(service = "
${
functionName
}
", businessType = BusinessType.DELETE)
@DeleteMapping("/
{
${
pkColumn
.
javaField
}
s}")
public JsonResult
<String>
remove(@PathVariable
${
pkColumn
.
javaType
}
[]
${
pkColumn
.
javaField
}
s)
...
...
twelvet-server/twelvet-server-gen/src/main/resources/vm/java/domain.java.vm
浏览文件 @
6a6320ca
...
...
@@ -3,7 +3,7 @@ package ${packageName}.domain;
#
foreach
($
import
in
$
importList
)
import
${
import
}
;
#
end
import com.
twelvet.framework.utils.annotation.excel.Excel
;
import com.
alibaba.excel.annotation.ExcelProperty
;
import com.twelvet.framework.core.application.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
...
...
@@ -43,12 +43,12 @@ public class ${ClassName} extends ${Entity} {
#
set
($
comment
=
$
column
.
columnComment
)
#
end
#
if
($
parentheseIndex
!=
-
1
)
@Excel
(name = "
${
comment
}
", readConverterExp = "
$
column
.
readConverterExp
(
)
")
@Excel
Property(value ="
${
comment
}
(
$
column
.
readConverterExp
()
)")
#
elseif
($
column
.
javaType
==
'Date'
)
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel
(name =
"
${
comment
}
", width = 30, dateFormat = "yyyy-MM-dd")
@Excel
Property(value =
"
${
comment
}
", width = 30, dateFormat = "yyyy-MM-dd")
#
else
@Excel
(name =
"
${
comment
}
")
@Excel
Property(value =
"
${
comment
}
")
#
end
#
end
private
$
column
.
javaType
$
column
.
javaField
;
...
...
twelvet-server/twelvet-server-gen/src/main/resources/vm/java/sub-domain.java.vm
浏览文件 @
6a6320ca
...
...
@@ -28,12 +28,12 @@ public class ${subClassName} extends BaseEntity
#
set
($
comment
=
$
column
.
columnComment
)
#
end
#
if
($
parentheseIndex
!=
-
1
)
@Excel
(name = "
${
comment
}
", readConverterExp = "
$
column
.
readConverterExp
(
)
")
@Excel
Property(value ="
${
comment
}
(
$
column
.
readConverterExp
()
)")
#
elseif
($
column
.
javaType
==
'Date'
)
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel
(name =
"
${
comment
}
", width = 30, dateFormat = "yyyy-MM-dd")
@Excel
Property(value =
"
${
comment
}
", width = 30, dateFormat = "yyyy-MM-dd")
#
else
@Excel
(name =
"
${
comment
}
")
@Excel
Property(value =
"
${
comment
}
")
#
end
#
end
private
$
column
.
javaType
$
column
.
javaField
;
...
...
twelvet-server/twelvet-server-gen/src/main/resources/vm/react/index-tree.tsx.vm
浏览文件 @
6a6320ca
此差异已折叠。
点击以展开。
twelvet-server/twelvet-server-gen/src/main/resources/vm/react/index.tsx.vm
浏览文件 @
6a6320ca
此差异已折叠。
点击以展开。
twelvet-server/twelvet-server-gen/src/main/resources/vm/
js/api
.ts.vm
→
twelvet-server/twelvet-server-gen/src/main/resources/vm/
react/service
.ts.vm
浏览文件 @
6a6320ca
import request,
{
download } from '@/utils/request'
import
{
request} from '@umijs/max'
import
{
download} from '@/utils/twelvet'
// 请求的控制器名称
const controller = "/
${
moduleName
}
/
${
businessName
}
";
/**
* 查询
${
functionName
}
列表
* @param query 查询参数
*/
export function
list
${
BusinessName
}
(query:
{
[key: string]: any })
{
return request(`
/
${
moduleName
}
/
${
businessName
}
/list
`,
{
export function
pageQuery
${
BusinessName
}
(query:
{
[key: string]: any })
{
return request(`
${
controller
}
/pageQuery
`,
{
method: `get`,
params: query
})
...
...
@@ -16,7 +20,7 @@ export function list${BusinessName}(query: { [key: string]: any }) {
* @param 主键
*/
export function get
${
BusinessName
}
(
${
pkColumn
.
javaField
}
: string | number)
{
return request(`
/
${
moduleName
}
/
${
businessName
}
/
${${
pkColumn
.
javaField
}
}`,
{
return request(`
${
controller
}
/
${${
pkColumn
.
javaField
}
}`,
{
method: `get`
})
}
...
...
@@ -26,7 +30,7 @@ export function get${BusinessName}(${pkColumn.javaField}: string | number) {
* @param data 数据参数
*/
export function add
${
BusinessName
}
(data:
{
[key: string]: any })
{
return request(`
/
${
moduleName
}
/
${
businessName
}
`,
{
return request(`
${
controller
}
`,
{
method: `post`,
data: data
})
...
...
@@ -37,7 +41,7 @@ export function add${BusinessName}(data: { [key: string]: any }) {
* @param data 数据参数
*/
export function update
${
BusinessName
}
(data:
{
[key: string]: any })
{
return request(`
/
${
moduleName
}
/
${
businessName
}
`,
{
return request(`
${
controller
}
`,
{
method: `put`,
data: data
})
...
...
@@ -48,7 +52,7 @@ export function update${BusinessName}(data: { [key: string]: any }) {
* @param 主键
*/
export function del
${
BusinessName
}
(
${
pkColumn
.
javaField
}
: string | number)
{
return request(`
/
${
moduleName
}
/
${
businessName
}
/
${${
pkColumn
.
javaField
}
}`,
{
return request(`
${
controller
}
/
${${
pkColumn
.
javaField
}
}`,
{
method: `delete`
})
}
...
...
@@ -57,6 +61,6 @@ export function del${BusinessName}(${pkColumn.javaField}: string | number) {
* 导出数据
* @param params
*/
export async function export
Dfs
(params?:
{
[key: string]: any })
{
return download(`
/
${
moduleName
}
/
${
businessName
}
/export`, params);
export async function export
${
BusinessName
}
(params?:
{
[key: string]: any })
{
return download(`
${
controller
}
/export`, params);
}
twelvet-server/twelvet-server-gen/src/main/resources/vm/sql/sql.vm
浏览文件 @
6a6320ca
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame,
is_cache,
menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
', '
${
parentMenuId
}
', '1', '
${
businessName
}
', '
${
moduleName
}
/
${
businessName
}
/index', 1,
0,
'C', '0', '0', '
${
permissionPrefix
}
:list', '
#
', 'admin', '2018-03-01', 'twelvet', '2018-03-01', '
${
functionName
}
菜单');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
', '
${
parentMenuId
}
', '1', '
${
businessName
}
', '
${
moduleName
}
/
${
businessName
}
/index', 1, 'C', '0', '0', '
${
permissionPrefix
}
:list', '
#
', 'admin', '2018-03-01', 'twelvet', '2018-03-01', '
${
functionName
}
菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame,
is_cache,
menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
查询', @parentId, '1', '
#
', '', 1,
0,
'F', '0', '0', '
${
permissionPrefix
}
:query', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
查询', @parentId, '1', '
#
', '', 1, 'F', '0', '0', '
${
permissionPrefix
}
:query', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame,
is_cache,
menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
新增', @parentId, '2', '
#
', '', 1,
0,
'F', '0', '0', '
${
permissionPrefix
}
:add', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
新增', @parentId, '2', '
#
', '', 1, 'F', '0', '0', '
${
permissionPrefix
}
:add', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame,
is_cache,
menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
修改', @parentId, '3', '
#
', '', 1,
0,
'F', '0', '0', '
${
permissionPrefix
}
:edit', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
修改', @parentId, '3', '
#
', '', 1, 'F', '0', '0', '
${
permissionPrefix
}
:edit', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame,
is_cache,
menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
删除', @parentId, '4', '
#
', '', 1,
0,
'F', '0', '0', '
${
permissionPrefix
}
:remove', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
删除', @parentId, '4', '
#
', '', 1, 'F', '0', '0', '
${
permissionPrefix
}
:remove', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame,
is_cache,
menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
导出', @parentId, '5', '
#
', '', 1,
0,
'F', '0', '0', '
${
permissionPrefix
}
:export', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('
${
functionName
}
导出', @parentId, '5', '
#
', '', 1, 'F', '0', '0', '
${
permissionPrefix
}
:export', '
#
', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
twelvet-server/twelvet-server-job/src/main/java/com/twelvet/server/job/controller/SysJobController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.job.controller
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.job.domain.SysJob
;
import
com.twelvet.framework.core.application.controller.TWTController
;
import
com.twelvet.framework.core.application.domain.JsonResult
;
import
com.twelvet.framework.core.constants.Constants
;
import
com.twelvet.framework.core.application.page.TableDataInfo
;
import
com.twelvet.framework.core.constants.Constants
;
import
com.twelvet.framework.jdbc.web.utils.PageUtils
;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.security.utils.SecurityUtils
;
import
com.twelvet.framework.utils.StringUtils
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.job.exception.TaskException
;
import
com.twelvet.server.job.service.ISysJobService
;
import
com.twelvet.server.job.util.CronUtils
;
import
com.twelvet.server.job.util.ScheduleUtils
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.quartz.SchedulerException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -54,17 +53,16 @@ public class SysJobController extends TWTController {
/**
* 导出定时任务列表
* @param response HttpServletResponse
* @param sysJob SysJob
* @return List<SysJob>
*/
@ResponseExcel
(
name
=
"定时任务"
)
@Operation
(
summary
=
"导出定时任务列表"
)
@Log
(
service
=
"定时任务"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@role.hasPermi('monitor:job:export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysJob
sysJob
)
{
List
<
SysJob
>
list
=
jobService
.
selectJobList
(
sysJob
);
ExcelUtils
<
SysJob
>
excelUtils
=
new
ExcelUtils
<>(
SysJob
.
class
);
excelUtils
.
exportExcel
(
response
,
list
,
"定时任务"
);
public
List
<
SysJob
>
export
(
@RequestBody
SysJob
sysJob
)
{
return
jobService
.
selectJobList
(
sysJob
);
}
/**
...
...
twelvet-server/twelvet-server-job/src/main/java/com/twelvet/server/job/controller/SysJobLogController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.job.controller
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.job.domain.SysJobLog
;
import
com.twelvet.framework.core.application.controller.TWTController
;
import
com.twelvet.framework.core.application.domain.JsonResult
;
...
...
@@ -7,15 +8,13 @@ import com.twelvet.framework.core.application.page.TableDataInfo;
import
com.twelvet.framework.jdbc.web.utils.PageUtils
;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.job.service.ISysJobLogService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -47,17 +46,16 @@ public class SysJobLogController extends TWTController {
/**
* 导出定时任务调度日志列表
* @param response HttpServletResponse
* @param sysJobLog SysJobLog
* @return List<SysJobLog>
*/
@ResponseExcel
(
name
=
"任务调度日志"
)
@Operation
(
summary
=
"导出定时任务调度日志列表"
)
@Log
(
service
=
"任务调度日志"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@role.hasPermi('system:job:export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysJobLog
sysJobLog
)
{
List
<
SysJobLog
>
list
=
jobLogService
.
selectJobLogList
(
sysJobLog
);
ExcelUtils
<
SysJobLog
>
excelUtils
=
new
ExcelUtils
<>(
SysJobLog
.
class
);
excelUtils
.
exportExcel
(
response
,
list
,
"调度日志"
);
public
List
<
SysJobLog
>
export
(
@RequestBody
SysJobLog
sysJobLog
)
{
return
jobLogService
.
selectJobLogList
(
sysJobLog
);
}
/**
...
...
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/Oauth2ClientDetailsController.java
浏览文件 @
6a6320ca
...
...
@@ -8,12 +8,11 @@ import com.twelvet.framework.core.application.page.TableDataInfo;
import
com.twelvet.framework.jdbc.web.utils.PageUtils
;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.security.utils.SecurityUtils
;
import
com.twelvet.framework.utils.TUtils
;
import
com.twelvet.framework.utils.StringUtils
;
import
com.twelvet.framework.utils.TUtils
;
import
com.twelvet.server.system.service.ISysClientDetailsService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
...
...
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/RedisController.java
浏览文件 @
6a6320ca
...
...
@@ -3,8 +3,8 @@ package com.twelvet.server.system.controller;
import
com.twelvet.framework.core.application.domain.AjaxResult
;
import
com.twelvet.framework.utils.DateUtils
;
import
com.twelvet.framework.utils.StringUtils
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.connection.RedisServerCommands
;
import
org.springframework.data.redis.core.RedisCallback
;
...
...
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysDeptController.java
浏览文件 @
6a6320ca
...
...
@@ -11,8 +11,8 @@ import com.twelvet.framework.log.enums.BusinessType;
import
com.twelvet.framework.security.utils.SecurityUtils
;
import
com.twelvet.framework.utils.StringUtils
;
import
com.twelvet.server.system.service.ISysDeptService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
...
...
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysDictDataController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.system.controller
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.system.domain.SysDictData
;
import
com.twelvet.framework.core.application.controller.TWTController
;
import
com.twelvet.framework.core.application.domain.JsonResult
;
...
...
@@ -8,17 +9,15 @@ import com.twelvet.framework.jdbc.web.utils.PageUtils;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.security.utils.SecurityUtils
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.system.service.ISysDictDataService
;
import
com.twelvet.server.system.service.ISysDictTypeService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -53,17 +52,16 @@ public class SysDictDataController extends TWTController {
/**
* 导出数据字典excel
* @param response HttpServletResponse
* @param sysDictData SysDictData
* @return List<SysDictData>
*/
@ResponseExcel
(
name
=
"字典数据"
)
@Operation
(
summary
=
"导出数据字典excel"
)
@Log
(
service
=
"字典数据"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@role.hasPermi('system:dict:export')"
)
public
void
exportExcel
(
HttpServletResponse
response
,
@RequestBody
SysDictData
sysDictData
)
{
List
<
SysDictData
>
list
=
dictDataService
.
selectDictDataList
(
sysDictData
);
ExcelUtils
<
SysDictData
>
excelUtils
=
new
ExcelUtils
<>(
SysDictData
.
class
);
excelUtils
.
exportExcel
(
response
,
list
,
"字典数据"
);
public
List
<
SysDictData
>
exportExcel
(
@RequestBody
SysDictData
sysDictData
)
{
return
dictDataService
.
selectDictDataList
(
sysDictData
);
}
/**
...
...
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysDictTypeController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.system.controller
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.system.domain.SysDictType
;
import
com.twelvet.framework.core.application.controller.TWTController
;
import
com.twelvet.framework.core.application.domain.JsonResult
;
import
com.twelvet.framework.core.constants.UserConstants
;
import
com.twelvet.framework.core.application.page.TableDataInfo
;
import
com.twelvet.framework.core.constants.UserConstants
;
import
com.twelvet.framework.jdbc.web.utils.PageUtils
;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.security.utils.SecurityUtils
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.system.service.ISysDictTypeService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -50,17 +49,16 @@ public class SysDictTypeController extends TWTController {
/**
* 数据字典导出
* @param response HttpServletResponse
* @param dictType SysDictType
* @return List<SysDictType>
*/
@ResponseExcel
(
name
=
"字典类型"
)
@Operation
(
summary
=
"数据字典导出"
)
@Log
(
service
=
"字典类型"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@role.hasPermi('system:dict:export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysDictType
dictType
)
{
List
<
SysDictType
>
list
=
dictTypeService
.
selectDictTypeList
(
dictType
);
ExcelUtils
<
SysDictType
>
excelUtils
=
new
ExcelUtils
<>(
SysDictType
.
class
);
excelUtils
.
exportExcel
(
response
,
list
,
"字典类型"
);
public
List
<
SysDictType
>
export
(
@RequestBody
SysDictType
dictType
)
{
return
dictTypeService
.
selectDictTypeList
(
dictType
);
}
/**
...
...
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysLoginInfoController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.system.controller
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.system.domain.SysLoginInfo
;
import
com.twelvet.framework.core.application.controller.TWTController
;
import
com.twelvet.framework.core.application.domain.JsonResult
;
...
...
@@ -7,15 +8,13 @@ import com.twelvet.framework.core.application.page.TableDataInfo;
import
com.twelvet.framework.jdbc.web.utils.PageUtils
;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.system.service.ISysLoginInfoService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -72,17 +71,16 @@ public class SysLoginInfoController extends TWTController {
/**
* 导出Excel
* @param response HttpServletResponse
* @param loginInfo SysLoginInfo
* @return List<SysLoginInfo>
*/
@ResponseExcel
(
name
=
"登陆日志"
)
@Operation
(
summary
=
"导出Excel"
)
@Log
(
service
=
"登陆日志"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@role.hasPermi('system:logininfor:export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysLoginInfo
loginInfo
)
{
List
<
SysLoginInfo
>
list
=
iSysLoginInfoService
.
selectLoginInfoList
(
loginInfo
);
ExcelUtils
<
SysLoginInfo
>
excelUtils
=
new
ExcelUtils
<>(
SysLoginInfo
.
class
);
excelUtils
.
exportExcel
(
response
,
list
,
"登陆日志"
);
public
List
<
SysLoginInfo
>
export
(
@RequestBody
SysLoginInfo
loginInfo
)
{
return
iSysLoginInfoService
.
selectLoginInfoList
(
loginInfo
);
}
}
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysOperationLogController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.system.controller
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.system.domain.SysOperationLog
;
import
com.twelvet.framework.core.application.controller.TWTController
;
import
com.twelvet.framework.core.application.domain.JsonResult
;
...
...
@@ -7,15 +8,13 @@ import com.twelvet.framework.core.application.page.TableDataInfo;
import
com.twelvet.framework.jdbc.web.utils.PageUtils
;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.system.service.ISysOperationLogService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -73,17 +72,16 @@ public class SysOperationLogController extends TWTController {
/**
* Excel导出
* @param response HttpServletResponse
* @param operationLog SysOperationLog
* @return List<SysOperationLog>
*/
@ResponseExcel
(
name
=
"操作日志"
)
@Operation
(
summary
=
"Excel导出"
)
@Log
(
service
=
"操作日志"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@role.hasPermi('system:operlog:export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysOperationLog
operationLog
)
{
List
<
SysOperationLog
>
list
=
iSysOperationLogService
.
selectOperationLogList
(
operationLog
);
ExcelUtils
<
SysOperationLog
>
exportExcel
=
new
ExcelUtils
<>(
SysOperationLog
.
class
);
exportExcel
.
exportExcel
(
response
,
list
,
"操作日志"
);
public
List
<
SysOperationLog
>
export
(
@RequestBody
SysOperationLog
operationLog
)
{
return
iSysOperationLogService
.
selectOperationLogList
(
operationLog
);
}
}
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysPostController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.system.controller
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.system.domain.SysPost
;
import
com.twelvet.framework.core.application.controller.TWTController
;
import
com.twelvet.framework.core.application.domain.JsonResult
;
import
com.twelvet.framework.core.constants.UserConstants
;
import
com.twelvet.framework.core.application.page.TableDataInfo
;
import
com.twelvet.framework.core.constants.UserConstants
;
import
com.twelvet.framework.jdbc.web.utils.PageUtils
;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.security.utils.SecurityUtils
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.system.service.ISysPostService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -125,18 +124,17 @@ public class SysPostController extends TWTController {
}
/**
* 数据导出
* @param response HttpServletResponse
* 岗位管理数据导出
* @param sysPost SysPost
* @return List<SysPost>
*/
@ResponseExcel
(
name
=
"岗位管理"
)
@Operation
(
summary
=
"数据导出"
)
@Log
(
service
=
"岗位管理"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@role.hasPermi('system:post:export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysPost
sysPost
)
{
List
<
SysPost
>
list
=
iSysPostService
.
selectPostList
(
sysPost
);
ExcelUtils
<
SysPost
>
excelUtils
=
new
ExcelUtils
<>(
SysPost
.
class
);
excelUtils
.
exportExcel
(
response
,
list
,
"岗位数据"
);
public
List
<
SysPost
>
export
(
@RequestBody
SysPost
sysPost
)
{
return
iSysPostService
.
selectPostList
(
sysPost
);
}
}
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysRoleController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.system.controller
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.system.domain.SysRole
;
import
com.twelvet.framework.core.application.controller.TWTController
;
import
com.twelvet.framework.core.application.domain.JsonResult
;
import
com.twelvet.framework.core.constants.UserConstants
;
import
com.twelvet.framework.core.application.page.TableDataInfo
;
import
com.twelvet.framework.core.constants.UserConstants
;
import
com.twelvet.framework.jdbc.web.utils.PageUtils
;
import
com.twelvet.framework.log.annotation.Log
;
import
com.twelvet.framework.log.enums.BusinessType
;
import
com.twelvet.framework.security.utils.SecurityUtils
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.system.service.ISysRoleService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
...
...
@@ -50,17 +49,16 @@ public class SysRoleController extends TWTController {
/**
* 数据导出
* @param response HttpServletResponse
* @param role SysRole
* @return List<SysRole>
*/
@ResponseExcel
(
name
=
"角色管理"
)
@Operation
(
summary
=
"数据导出"
)
@Log
(
service
=
"角色管理"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@role.hasPermi('system:role:export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysRole
role
)
{
List
<
SysRole
>
list
=
iSysRoleService
.
selectRoleList
(
role
);
ExcelUtils
<
SysRole
>
excelUtils
=
new
ExcelUtils
<>(
SysRole
.
class
);
excelUtils
.
exportExcel
(
response
,
list
,
"角色数据"
);
public
List
<
SysRole
>
export
(
@RequestBody
SysRole
role
)
{
return
iSysRoleService
.
selectRoleList
(
role
);
}
/**
...
...
twelvet-server/twelvet-server-system/src/main/java/com/twelvet/server/system/controller/SysUserController.java
浏览文件 @
6a6320ca
package
com.twelvet.server.system.controller
;
import
cn.twelvet.excel.annotation.RequestExcel
;
import
cn.twelvet.excel.annotation.ResponseExcel
;
import
com.twelvet.api.system.domain.SysRole
;
import
com.twelvet.api.system.domain.SysUser
;
import
com.twelvet.framework.core.application.controller.TWTController
;
...
...
@@ -13,19 +15,17 @@ import com.twelvet.framework.log.enums.BusinessType;
import
com.twelvet.framework.security.utils.SecurityUtils
;
import
com.twelvet.framework.utils.StringUtils
;
import
com.twelvet.framework.utils.TUtils
;
import
com.twelvet.framework.utils.poi.ExcelUtils
;
import
com.twelvet.server.system.service.ISysPermissionService
;
import
com.twelvet.server.system.service.ISysPostService
;
import
com.twelvet.server.system.service.ISysRoleService
;
import
com.twelvet.server.system.service.ISysUserService
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -71,22 +71,21 @@ public class SysUserController extends TWTController {
/**
* 用户用户导出
* @param response HttpServletResponse
* @param user SysUser
* @return List<SysUser>
*/
@ResponseExcel
(
name
=
"用户管理"
)
@Operation
(
summary
=
"用户用户导出"
)
@PostMapping
(
"/export"
)
@Log
(
service
=
"用户管理"
,
businessType
=
BusinessType
.
EXPORT
)
@PreAuthorize
(
"@role.hasPermi('system:user:export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysUser
user
)
{
List
<
SysUser
>
list
=
iSysUserService
.
selectUserList
(
user
);
ExcelUtils
<
SysUser
>
excelUtils
=
new
ExcelUtils
<>(
SysUser
.
class
);
excelUtils
.
exportExcel
(
response
,
list
,
"用户数据"
);
public
List
<
SysUser
>
export
(
@RequestBody
SysUser
user
)
{
return
iSysUserService
.
selectUserList
(
user
);
}
/**
* 用户数据导入
* @param
files MultipartFile[]
* @param
userList List<SysUser>
* @param cover 是否允许覆盖
* @return JsonResult<String>
* @throws Exception Exception
...
...
@@ -95,26 +94,20 @@ public class SysUserController extends TWTController {
@PostMapping
(
"/importData"
)
@Log
(
service
=
"用户管理"
,
businessType
=
BusinessType
.
IMPORT
)
@PreAuthorize
(
"@role.hasPermi('system:user:import')"
)
public
JsonResult
<
String
>
importData
(
MultipartFile
[]
files
,
boolean
cover
)
throws
Exception
{
ExcelUtils
<
SysUser
>
excelUtils
=
new
ExcelUtils
<>(
SysUser
.
class
);
// 支持多数据源导入
for
(
MultipartFile
file
:
files
)
{
List
<
SysUser
>
userList
=
excelUtils
.
importExcel
(
file
.
getInputStream
());
String
operName
=
SecurityUtils
.
getUsername
();
iSysUserService
.
importUser
(
userList
,
cover
,
operName
);
}
public
JsonResult
<
String
>
importData
(
@RequestExcel
List
<
SysUser
>
userList
,
boolean
cover
,
BindingResult
bindingResult
)
throws
Exception
{
String
operName
=
SecurityUtils
.
getUsername
();
iSysUserService
.
importUser
(
userList
,
cover
,
operName
);
return
JsonResult
.
success
();
}
/**
* 导出模板
* @param response HttpServletResponse
*/
@
Operation
(
summary
=
"导出
模板"
)
@
ResponseExcel
(
name
=
"用户数据导入
模板"
)
@PostMapping
(
"/exportTemplate"
)
public
void
exportTemplate
(
HttpServletResponse
response
)
{
ExcelUtils
<
SysUser
>
excelUtils
=
new
ExcelUtils
<>(
SysUser
.
class
);
excelUtils
.
exportExcel
(
response
,
"用户数据"
);
public
List
<
SysUser
>
exportTemplate
()
{
return
List
.
of
(
new
SysUser
());
}
/**
...
...