...
 
Commits (9)
    https://gitcode.net/twelvet/twelvet/-/commit/6309b879775007709f4ea18bb932a48277c5ca6b Update pom.xml 2023-07-27T08:56:11+08:00 twelvet 2471835953@qq.com Spring Cloud Alibaba 2022.0.0 https://gitcode.net/twelvet/twelvet/-/commit/0c286854365a5e6f711f15a19d0a620b0a228bd2 优化代码生成 2023-07-28T10:01:20+08:00 twelvet 2471835953@qq.com https://gitcode.net/twelvet/twelvet/-/commit/8ed315aacc10b9a292eaf96e4ce67c0ba4e50049 优化代码生成第一版 2023-07-28T22:49:22+08:00 twelvet 2471835953@qq.com https://gitcode.net/twelvet/twelvet/-/commit/df264f0a863f649cb77ae5725b3a90cbb65ccd87 优化代码生成第二版 2023-07-29T11:48:58+08:00 twelvet 2471835953@qq.com https://gitcode.net/twelvet/twelvet/-/commit/798eea53d8fc9f0e1f3d97976ff85f5e40ce86f0 优化代码生成器第三版 2023-07-31T15:55:23+08:00 TwelveT 2471835953@qq.com https://gitcode.net/twelvet/twelvet/-/commit/9d737fccf6a37bbe94e53e5f57357c657eed64bf 取消sentinel懒加载 2023-07-31T16:59:27+08:00 TwelveT 2471835953@qq.com https://gitcode.net/twelvet/twelvet/-/commit/cc1a20896d22631085dc51e7352cefb7aed8e8b4 README 2023-07-31T17:12:23+08:00 TwelveT 2471835953@qq.com https://gitcode.net/twelvet/twelvet/-/commit/ab70f1027805941f190324b0396d8e8ff6ed022c Excel分离 2023-08-05T11:51:20+08:00 TwelveT 2471835953@qq.com https://gitcode.net/twelvet/twelvet/-/commit/903c086d3e1d966dedd7e6cf8d0ca2ab85660968 Excel分离 2023-08-06T20:18:01+08:00 twelvet 2471835953@qq.com
[中文](https://github.com/twelvet-s/twelvet/blob/master/README.md) | [English](https://github.com/twelvet-s/twelvet/blob/master/README_EN.md)
# 🚀twelvet
# JDK >= 17
[![AUR](https://img.shields.io/github/license/twelvet-s/twelvet)](https://github.com/twelvet-s/twelvet/blob/master/LICENSE)
......@@ -35,11 +36,11 @@
## 🍎 分支说明
| 分支 | 说明 |
|----------------------|--------------------------------------------------------------------|
| master | java8 + springboot 2.7.x + springcloud 2021 + spring cloud alibaba |
| master-boot-3 | java17 + springboot 3.x + springcloud 2022 + spring cloud alibaba |
| spring-cloud-tencent | java17 + springboot 3.x + springcloud 2022 + spring cloud tencent |
| 分支 | 说明 | 额外说明 |
|----------------------|--------------------------------------------------------------------|-------------------------|
| master | java8 + springboot 2.7.x + springcloud 2021 + spring cloud alibaba | 将于2023年11月18号停止维护,进入修复期 |
| master-boot-3 | java17 + springboot 3.x + springcloud 2022 + spring cloud alibaba | 主要版本 |
| spring-cloud-tencent | java17 + springboot 3.x + springcloud 2022 + spring cloud tencent | 示范分支,不支持兼容过多新特性 |
## 项目结构
......@@ -147,4 +148,5 @@ chmod 751 deploy.sh
QQ群: [![加入QQ群](https://img.shields.io/badge/985830229-blue.svg)](https://jq.qq.com/?_wv=1027&k=cznM6Q00) 点击按钮入群。
## 🤝鸣谢
感谢jetbrains提供的许可证[![jetbrains](https://cloud.twelvet.cn/jetbrains.png)](https://www.jetbrains.com?from=https://github.com/twelvet-s/twelvet)
[中文](https://github.com/twelvet-s/twelvet/blob/master/README.md) | [English](https://github.com/twelvet-s/twelvet/blob/master/README_EN.md)
# 🚀twelvet
# JDK >= 17
[![AUR](https://img.shields.io/github/license/twelvet-s/twelvet)](https://github.com/twelvet-s/twelvet/blob/master/LICENSE)
......@@ -42,11 +43,11 @@ Official blog: https://twelvet.cn
## 🍎 Branch Description
| Branch | Description |
|----------------------|--------------------------------------------------------------------|
| master | java8 + springboot 2.7.x + springcloud 2021 + spring cloud alibaba |
| master-boot-3 | java17 + springboot 3.x + springcloud 2022 + spring cloud alibaba |
| spring-cloud-tencent | java17 + springboot 3.x + springcloud 2022 + spring cloud tencent |
| Branch | Description | Additional Description |
|----------------------|--------------------------------------------------------------------|---------------------------------------------------------------------------------|
| master | java8 + springboot 2.7.x + springcloud 2021 + spring cloud alibaba | Maintenance will stop on November 18, 2023 and enter the repair period |
| master-boot-3 | java17 + springboot 3.x + springcloud 2022 + spring cloud alibaba | master |
| spring-cloud-tencent | java17 + springboot 3.x + springcloud 2022 + spring cloud tencent | Demonstration branch, does not support compatibility with too many new features |
## System Module
......@@ -152,5 +153,8 @@ chmod 751 deploy.sh
# Start UI
./deploy.sh nginx
```
## 🤝Thank You
Thanks to jetbrains for the license[![jetbrains](https://cloud.twelvet.cn/jetbrains.png)](https://www.jetbrains.com?from=https://github.com/twelvet-s/twelvet)
Thanks to jetbrains for the
license[![jetbrains](https://cloud.twelvet.cn/jetbrains.png)](https://www.jetbrains.com?from=https://github.com/twelvet-s/twelvet)
此差异已折叠。
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)
@ExcelProperty(value = "任务序号")
private Long jobId;
/**
* 任务名称
*/
@Schema(description = "任务名称")
@Excel(name = "任务名称")
@ExcelProperty(value = "任务名称")
private String jobName;
/**
* 任务组名
*/
@Schema(description = "任务组名")
@Excel(name = "任务组名")
@ExcelProperty(value = "任务组名")
private String jobGroup;
/**
* 调用目标字符串
*/
@Schema(description = "调用目标字符串")
@Excel(name = "调用目标字符串")
@ExcelProperty(value = "调用目标字符串")
private String invokeTarget;
/**
* cron执行表达式
*/
@Schema(description = "执行表达式")
@Excel(name = "执行表达式 ")
@ExcelProperty(value = "执行表达式 ")
private String cronExpression;
/**
* cron计划策略
*/
@Schema(description = "计划策略")
@Excel(name = "计划策略 ", readConverterExp = "0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行")
@ExcelProperty(value = "计划策略(0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行)")
private String misfirePolicy = ScheduleConstants.MISFIRE_DEFAULT;
/**
* 是否并发执行(0允许 1禁止)
*/
@Schema(description = "是否并发执行")
@Excel(name = "并发执行", readConverterExp = "0=允许,1=禁止")
@ExcelProperty(value = "并发执行(0=允许,1=禁止)")
private String concurrent;
/**
* 任务状态(0正常 1暂停)
*/
@Schema(description = "任务状态")
@Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停")
@ExcelProperty(value = "任务状态(0=正常,1=暂停)")
private String status;
public Long getJobId() {
......
package com.twelvet.api.job.domain;
import com.twelvet.framework.core.application.domain.BaseEntity;
import com.twelvet.framework.utils.annotation.excel.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import org.apache.commons.lang3.builder.ToStringBuilder;
......@@ -23,37 +23,37 @@ public class SysJobLog extends BaseEntity {
/** ID */
@Schema(description = "日志序号")
@Excel(name = "日志序号")
@ExcelProperty(value = "日志序号")
private Long jobLogId;
/** 任务名称 */
@Schema(description = "任务名称")
@Excel(name = "任务名称")
@ExcelProperty(value = "任务名称")
private String jobName;
/** 任务组名 */
@Schema(description = "任务组名")
@Excel(name = "任务组名")
@ExcelProperty(value = "任务组名")
private String jobGroup;
/** 调用目标字符串 */
@Schema(description = "调用目标字符串")
@Excel(name = "调用目标字符串")
@ExcelProperty(value = "调用目标字符串")
private String invokeTarget;
/** 日志信息 */
@Schema(description = "日志信息")
@Excel(name = "日志信息")
@ExcelProperty(value = "日志信息")
private String jobMessage;
/** 执行状态(0正常 1失败) */
@Schema(description = "执行状态")
@Excel(name = "执行状态", readConverterExp = "0=正常,1=失败")
@ExcelProperty(value = "执行状态(0=正常,1=失败)")
private String status;
/** 异常信息 */
@Schema(description = "异常信息")
@Excel(name = "异常信息")
@ExcelProperty(value = "异常信息")
private String exceptionInfo;
/** 开始时间 */
......
......@@ -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;
......
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)
@ExcelProperty(value = "参数主键")
private Long configId;
/**
* 参数名称
*/
@Schema(description = "参数名称")
@Excel(name = "参数名称")
@ExcelProperty(value = "参数名称")
private String configName;
/**
* 参数键名
*/
@Schema(description = "参数键名")
@Excel(name = "参数键名")
@ExcelProperty(value = "参数键名")
private String configKey;
/**
* 参数键值
*/
@Schema(description = "参数键值")
@Excel(name = "参数键值")
@ExcelProperty(value = "参数键值")
private String configValue;
/**
* 系统内置(Y是 N否)
*/
@Schema(description = "系统内置")
@Excel(name = "系统内置", readConverterExp = "Y=是,N=否")
@ExcelProperty(value = "系统内置(Y=是,N=否)")
private String configType;
public Long getConfigId() {
......
......@@ -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;
......
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)
@ExcelProperty(value = "字典编码")
private Long dictCode;
/**
* 字典排序
*/
@Schema(description = "字典排序")
@Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
@ExcelProperty(value = "字典排序")
private Long dictSort;
/**
* 字典标签
*/
@Schema(description = "字典标签")
@Excel(name = "字典标签")
@ExcelProperty(value = "字典标签")
private String dictLabel;
/**
* 字典键值
*/
@Schema(description = "字典键值")
@Excel(name = "字典键值")
@ExcelProperty(value = "字典键值")
private String dictValue;
/**
* 字典类型
*/
@Schema(description = "字典类型")
@Excel(name = "字典类型")
@ExcelProperty(value = "字典类型")
private String dictType;
/**
......@@ -74,14 +73,14 @@ public class SysDictData extends BaseEntity {
* 是否默认(Y是 N否)
*/
@Schema(description = "是否默认")
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
@ExcelProperty(value = "是否默认(Y=是,N=否)")
private String isDefault;
/**
* 状态(0正常 1停用)
*/
@Schema(description = "状态")
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
@ExcelProperty(value = "状态(0=正常,1=停用)")
private String status;
public Long getDictCode() {
......
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)
@ExcelProperty(value = "字典主键")
private Long dictId;
/**
* 字典名称
*/
@Schema(description = "字典名称")
@Excel(name = "字典名称")
@ExcelProperty(value = "字典名称")
private String dictName;
/**
* 字典类型
*/
@Schema(description = "字典类型")
@Excel(name = "字典类型")
@ExcelProperty(value = "字典类型")
private String dictType;
/**
* 状态(0正常 1停用)
*/
@Schema(description = "状态")
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
@ExcelProperty(value = "状态(0=正常,1=停用)")
private String status;
public Long getDictId() {
......
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)
@ExcelProperty(value = "序号")
private Long infoId;
/**
* 用户账号
*/
@Schema(description = "用户账号")
@Excel(name = "用户账号")
@ExcelProperty(value = "用户账号")
private String userName;
/**
* 状态 0成功 1失败
*/
@Schema(description = "状态")
@Excel(name = "状态", readConverterExp = "1=登录成功,2=退出成功,0=登录失败")
@ExcelProperty(value = "状态(1=登录成功,2=退出成功,0=登录失败)")
private String status;
/**
* 地址
*/
@Schema(description = "地址")
@Excel(name = "地址")
@ExcelProperty(value = "地址")
private String ipaddr;
/**
* 描述
*/
@Schema(description = "描述")
@Excel(name = "描述")
@ExcelProperty(value = "描述")
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")
@ExcelProperty(value = "访问时间")
private Date accessTime;
/**
* 部门ID
*/
@Schema(description = "部门ID")
@Excel(name = "部门ID")
@ExcelProperty(value = "部门ID")
private Long deptId;
public Long getDeptId() {
......
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)
@ExcelProperty(value = "操作序号")
private Long operId;
/**
* 操作模块
*/
@Schema(description = "操作模块")
@Excel(name = "操作模块")
@ExcelProperty(value = "操作模块")
private String service;
/**
* 业务类型(0其它 1新增 2修改 3删除)
*/
@Schema(description = "业务类型")
@Excel(name = "业务类型", readConverterExp = "0=其它,1=新增,2=修改,3=删除,4=授权,5=导出,6=导入,7=强退,8=生成代码,9=清空数据")
@ExcelProperty(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(name = "请求方法")
@ExcelProperty(value = "请求方法")
private String method;
/**
* 请求方式
*/
@Schema(description = "请求方式")
@Excel(name = "请求方式")
@ExcelProperty(value = "请求方式")
private String requestMethod;
/**
* 操作类别(0其它 1后台用户 2手机端用户)
*/
@Schema(description = "操作类别")
@Excel(name = "操作类别", readConverterExp = "0=其它,1=后台用户,2=手机端用户")
@ExcelProperty(value = "操作类别(0=其它,1=后台用户,2=手机端用户)")
private Integer operatorType;
/**
* 操作人员
*/
@Schema(description = "操作人员")
@Excel(name = "操作人员")
@ExcelProperty(value = "操作人员")
private String operName;
/**
* 部门名称
*/
@Schema(description = "部门名称")
@Excel(name = "部门名称")
@ExcelProperty(value = "部门名称")
private String deptName;
/**
* 请求url
*/
@Schema(description = "请求url")
@Excel(name = "请求地址")
@ExcelProperty(value = "请求地址")
private String operUrl;
/**
* 操作地址
*/
@Schema(description = "操作地址")
@Excel(name = "操作地址")
@ExcelProperty(value = "操作地址")
private String operIp;
/**
* 请求参数
*/
@Schema(description = "请求参数")
@Excel(name = "请求参数")
@ExcelProperty(value = "请求参数")
private String operParam;
/**
* 返回参数
*/
@Schema(description = "返回参数")
@Excel(name = "返回参数")
@ExcelProperty(value = "返回参数")
private String jsonResult;
/**
* 操作状态(0正常 1异常)
*/
@Schema(description = "操作状态")
@Excel(name = "状态", readConverterExp = "0=正常,1=异常")
@ExcelProperty(value = "状态(0=正常,1=异常)")
private Integer status;
/**
* 错误消息
*/
@Schema(description = "错误消息")
@Excel(name = "错误消息")
@ExcelProperty(value = "错误消息")
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")
@ExcelProperty(value = "操作时间")
private Date operTime;
/**
* 部门ID
*/
@Schema(description = "部门ID")
@Excel(name = "部门ID")
@ExcelProperty(value = "部门ID")
private Long deptId;
public Long getDeptId() {
......
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)
@ExcelProperty(value = "岗位序号")
private Long postId;
/**
* 岗位编码
*/
@Schema(description = "岗位编码")
@Excel(name = "岗位编码")
@ExcelProperty(value = "岗位编码")
private String postCode;
/**
* 岗位名称
*/
@Schema(description = "岗位名称")
@Excel(name = "岗位名称")
@ExcelProperty(value = "岗位名称")
private String postName;
/**
* 岗位排序
*/
@Schema(description = "岗位排序")
@Excel(name = "岗位排序")
@ExcelProperty(value = "岗位排序")
private String postSort;
/**
* 状态(0正常 1停用)
*/
@Schema(description = "状态")
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
@ExcelProperty(value = "状态(0=正常,1=停用)")
private String status;
/**
......
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;
......
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;
......
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 = "用户编号")
@ExcelProperty(value = "用户序号")
private Long userId;
/**
* 部门ID
*/
@Schema(description = "部门ID")
@Excel(name = "部门编号", type = Type.IMPORT)
@ExcelProperty(value = "部门编号")
private Long deptId;
/**
* 用户账号
*/
@Schema(description = "用户账号")
@Excel(name = "登录名称")
@ExcelProperty(value = "登录名称")
private String username;
/**
* 用户昵称
*/
@Schema(description = "用户昵称")
@Excel(name = "用户名称")
@ExcelProperty(value = "用户名称")
private String nickName;
/**
* 用户邮箱
*/
@Schema(description = "用户邮箱")
@Excel(name = "用户邮箱")
@ExcelProperty(value = "用户邮箱")
private String email;
/**
* 手机号码
*/
@Schema(description = "手机号码")
@Excel(name = "手机号码")
@ExcelProperty(value = "手机号码")
private String phonenumber;
/**
* 用户性别
*/
@Schema(description = "用户性别")
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
@ExcelProperty(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=停用")
@ExcelProperty(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)
@ExcelProperty(value = "最后登录IP")
private String loginIp;
/**
* 最后登录时间
*/
@Schema(description = "最后登录时间")
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
@ExcelProperty(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() {
......
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;
......
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;
......
......@@ -30,8 +30,8 @@ spring:
# shared-configs:
# - data-id: twelvet-app-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
# 暂时修复因sentinel导致的无法启动
openfeign:
lazy-attributes-resolution: true
# openfeign:
# lazy-attributes-resolution: true
config:
import:
- optional:nacos:twelvet-app-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
......@@ -64,4 +64,4 @@ spring:
# 取得的user详情中的属性id的值作为Client的已认证的用户的用户名
user-name-attribute: id
# 获取用户信息
user-info-uri: https://gitee.com/api/v5/user
\ No newline at end of file
user-info-uri: https://gitee.com/api/v5/user
......@@ -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>
package com.twelvet.framework.core.application.domain;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serial;
......@@ -21,48 +23,57 @@ public class BaseEntity implements Serializable {
/**
* 搜索值
*/
@ExcelIgnore
private String searchValue;
/**
* 创建者
*/
@ExcelProperty("创建者")
private String createBy;
/**
* 创建时间
*/
@ExcelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新者
*/
@ExcelProperty("更新者")
private String updateBy;
/**
* 更新时间
*/
@ExcelProperty("更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 备注
*/
@ExcelProperty("备注")
private String remark;
/**
* 开始时间
*/
@ExcelProperty("开始时间")
private String beginTime;
/**
* 结束时间
*/
@ExcelProperty("结束时间")
private String endTime;
/**
* 请求参数
*/
@ExcelIgnore
private Map<String, Object> params;
public String getSearchValue() {
......
package com.twelvet.framework.security.domain;
import com.twelvet.api.system.domain.SysRole;
import com.twelvet.framework.utils.annotation.excel.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.security.core.GrantedAuthority;
......
......@@ -21,12 +21,6 @@
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</dependency>
<!--Spring WEB-->
<dependency>
<groupId>org.springframework</groupId>
......@@ -81,6 +75,12 @@
<artifactId>okhttp</artifactId>
</dependency>
<!--Excel-->
<dependency>
<groupId>cn.twelvet.excel</groupId>
<artifactId>excel-spring-boot-starter</artifactId>
</dependency>
</dependencies>
</project>
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;
}
}
}
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();
}
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);
}
......@@ -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]);
}
}
}
}
......
......@@ -62,6 +62,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>
......
......@@ -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());
}
......
......@@ -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);
......
......@@ -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")) {
......
......@@ -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 com.twelvet.framework.utils.poi.ExcelUtils;
import cn.twelvet.excel.annotation.ResponseExcel;
#if($table.crud || $table.sub)
import com.twelvet.framework.jdbc.web.utils.PageUtils;
#elseif($table.tree)
......@@ -37,7 +37,7 @@ 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
......@@ -47,10 +47,10 @@ public class ${ClassName}Controller extends TWTController
* 查询${functionName}列表
*/
@Operation(summary = "查询${functionName}列表")
@PreAuthorize("@role.hasPermi('${permissionPrefix}:list')")
@GetMapping("/list")
@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)
......
......@@ -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()")
@ExcelProperty(value ="${comment}($column.readConverterExp())")
#elseif($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
@ExcelProperty(value ="${comment}", width = 30, dateFormat = "yyyy-MM-dd")
#else
@Excel(name = "${comment}")
@ExcelProperty(value ="${comment}")
#end
#end
private $column.javaType $column.javaField;
......
......@@ -28,12 +28,12 @@ public class ${subClassName} extends BaseEntity
#set($comment=$column.columnComment)
#end
#if($parentheseIndex != -1)
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
@ExcelProperty(value ="${comment}($column.readConverterExp())")
#elseif($column.javaType == 'Date')
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
@ExcelProperty(value ="${comment}", width = 30, dateFormat = "yyyy-MM-dd")
#else
@Excel(name = "${comment}")
@ExcelProperty(value ="${comment}")
#end
#end
private $column.javaType $column.javaField;
......
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 exportDfs(params?: { [key: string]: any }) {
return download(`/${moduleName}/${businessName}/export`, params);
export async function export${BusinessName}(params?: { [key: string]: any }) {
return download(`${controller}/export`, params);
}
-- 菜单 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', '');
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);
}
/**
......
......@@ -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;
......