mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
发布 v3.0.0
This commit is contained in:
@ -4,7 +4,9 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
dynamic:
|
||||
#设置默认的数据源或者数据源组,默认值即为 master
|
||||
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||
p6spy: true
|
||||
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
datasource:
|
||||
# 主库数据源
|
||||
@ -122,62 +124,11 @@ spring:
|
||||
admin:
|
||||
# Spring Boot Admin Client 客户端的相关配置
|
||||
client:
|
||||
# 增加客户端开关
|
||||
enabled: true
|
||||
# 设置 Spring Boot Admin Server 地址
|
||||
url: http://localhost:9090/admin
|
||||
instance:
|
||||
prefer-ip: true # 注册实例时,优先使用 IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
# Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
# 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
# 生产环境不建议放开所有 根据项目需求放开即可
|
||||
include: '*'
|
||||
endpoint:
|
||||
logfile:
|
||||
external-file: ./logs/sys-console.log
|
||||
|
||||
--- # OSS 云存储(界面 <参数设置> 可切换)
|
||||
cloud-storage:
|
||||
# minio配置
|
||||
minio:
|
||||
endpoint: http://localhost:9000
|
||||
accessKey: ruoyi
|
||||
secretKey: ruoyi123
|
||||
bucketName: ruoyi
|
||||
# 七牛云配置
|
||||
qiniu:
|
||||
domain: http://XXX.XXXX.com
|
||||
prefix:
|
||||
accessKey: XXXXXXXXXXXXXXX
|
||||
secretKey: XXXXXXXXXXXXXXX
|
||||
bucketName: ruoyi
|
||||
isHttps: false
|
||||
# z0 华东 z1 华北 z2 华南 na0 北美 as0 东南亚
|
||||
# 不填为自动获取(性能低 易出问题)
|
||||
region: z0
|
||||
# 阿里云配置
|
||||
aliyun:
|
||||
endpoint: http://oss-cn-beijing.aliyuncs.com
|
||||
prefix:
|
||||
accessKeyId: XXXXXXXXXXXXXXX
|
||||
accessKeySecret: XXXXXXXXXXXXXXX
|
||||
bucketName: ruoyi
|
||||
# 腾讯云配置
|
||||
qcloud:
|
||||
endpoint: http://cos.ap-beijing.myqcloud.com
|
||||
prefix:
|
||||
secretId: XXXXXXXXXXXXXXX
|
||||
secretKey: XXXXXXXXXXXXXXX
|
||||
# 腾讯云bucket名规则 格式为 BucketName-APPID 此处填写的存储桶名称必须为此格式
|
||||
bucketName: ruoyi-1250000000
|
||||
isHttps: false
|
||||
# 地域名参考官方文档
|
||||
# https://cloud.tencent.com/document/product/436/6224
|
||||
region: ap-beijing
|
||||
|
108
ruoyi/src/main/resources/application-local.yml
Normal file
108
ruoyi/src/main/resources/application-local.yml
Normal file
@ -0,0 +1,108 @@
|
||||
---
|
||||
server:
|
||||
port: 8081
|
||||
---
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://39.101.143.184:3306/ruoyi-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||
username: ruoyi-vue
|
||||
password: lihongbo
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: ruoyi
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 39.101.143.184
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password: lihongbo
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启ssl
|
||||
ssl: false
|
||||
|
||||
--- # redisson 客户端配置
|
||||
redisson:
|
||||
# 线程池数量
|
||||
threads: 16
|
||||
# Netty线程池数量
|
||||
nettyThreads: 32
|
||||
# 传输模式
|
||||
transportMode: "NIO"
|
||||
# 单节点配置
|
||||
singleServerConfig:
|
||||
# 客户端名称
|
||||
clientName: ${ruoyi.name}
|
||||
# 最小空闲连接数
|
||||
connectionMinimumIdleSize: 32
|
||||
# 连接池大小
|
||||
connectionPoolSize: 64
|
||||
# 连接空闲超时,单位:毫秒
|
||||
idleConnectionTimeout: 10000
|
||||
# 命令等待超时,单位:毫秒
|
||||
timeout: 3000
|
||||
# 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
|
||||
retryAttempts: 3
|
||||
# 命令重试发送时间间隔,单位:毫秒
|
||||
retryInterval: 1500
|
||||
# 发布和订阅连接的最小空闲连接数
|
||||
subscriptionConnectionMinimumIdleSize: 1
|
||||
# 发布和订阅连接池大小
|
||||
subscriptionConnectionPoolSize: 50
|
||||
# 单个连接最大订阅数量
|
||||
subscriptionsPerConnection: 5
|
||||
# DNS监测时间间隔,单位:毫秒
|
||||
dnsMonitoringInterval: 5000
|
@ -4,7 +4,9 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
dynamic:
|
||||
#设置默认的数据源或者数据源组,默认值即为 master
|
||||
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||
p6spy: false
|
||||
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
datasource:
|
||||
# 主库数据源
|
||||
@ -122,62 +124,11 @@ spring:
|
||||
admin:
|
||||
# Spring Boot Admin Client 客户端的相关配置
|
||||
client:
|
||||
# 增加客户端开关
|
||||
enabled: true
|
||||
# 设置 Spring Boot Admin Server 地址
|
||||
url: http://172.30.0.90:9090/admin
|
||||
instance:
|
||||
prefer-ip: true # 注册实例时,优先使用 IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
# Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
# 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
# 生产环境不建议放开所有 根据项目需求放开即可
|
||||
include: health,info
|
||||
endpoint:
|
||||
logfile:
|
||||
external-file: ./logs/sys-console.log
|
||||
|
||||
--- # OSS 云存储(界面 <参数设置> 可切换)
|
||||
cloud-storage:
|
||||
# minio配置
|
||||
minio:
|
||||
endpoint: http://172.30.0.54:9000
|
||||
accessKey: ruoyi
|
||||
secretKey: ruoyi123
|
||||
bucketName: ruoyi
|
||||
# 七牛云配置
|
||||
qiniu:
|
||||
domain: http://XXX.XXXX.com
|
||||
prefix:
|
||||
accessKey: XXXXXXXXXXXXXXX
|
||||
secretKey: XXXXXXXXXXXXXXX
|
||||
bucketName: ruoyi
|
||||
isHttps: false
|
||||
# z0 华东 z1 华北 z2 华南 na0 北美 as0 东南亚
|
||||
# 不填为自动获取(性能低 易出问题)
|
||||
region: z0
|
||||
# 阿里云配置
|
||||
aliyun:
|
||||
endpoint: http://oss-cn-beijing.aliyuncs.com
|
||||
prefix:
|
||||
accessKeyId: XXXXXXXXXXXXXXX
|
||||
accessKeySecret: XXXXXXXXXXXXXXX
|
||||
bucketName: ruoyi
|
||||
# 腾讯云配置
|
||||
qcloud:
|
||||
endpoint: http://cos.ap-beijing.myqcloud.com
|
||||
prefix:
|
||||
secretId: XXXXXXXXXXXXXXX
|
||||
secretKey: XXXXXXXXXXXXXXX
|
||||
# 腾讯云bucket名规则 格式为 BucketName-APPID 此处填写的存储桶名称必须为此格式
|
||||
bucketName: ruoyi-1250000000
|
||||
isHttps: false
|
||||
# 地域名参考官方文档
|
||||
# https://cloud.tencent.com/document/product/436/6224
|
||||
region: ap-beijing
|
||||
|
@ -8,8 +8,6 @@ ruoyi:
|
||||
copyrightYear: 2021
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径
|
||||
profile: ./ruoyi/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: true
|
||||
|
||||
@ -107,6 +105,11 @@ token:
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
|
||||
# 重复提交
|
||||
repeat-submit:
|
||||
# 全局间隔时间(毫秒)
|
||||
intervalTime: 1000
|
||||
|
||||
# MyBatisPlus配置
|
||||
# https://baomidou.com/config/
|
||||
mybatis-plus:
|
||||
@ -159,8 +162,10 @@ mybatis-plus:
|
||||
localCacheScope: SESSION
|
||||
# 开启Mybatis二级缓存,默认为 true
|
||||
cacheEnabled: false
|
||||
# 更详细的日志输出 会有性能损耗
|
||||
# logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
# 默认日志输出 org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||
logImpl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
global-config:
|
||||
# 是否打印 Logo banner
|
||||
banner: true
|
||||
@ -223,7 +228,7 @@ xss:
|
||||
# 过滤开关
|
||||
enabled: true
|
||||
# 排除链接(多个用逗号分隔)
|
||||
excludes: /system/notice/*
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
@ -284,6 +289,20 @@ lock4j:
|
||||
# 分布式锁的超时时间,默认为 30 毫秒
|
||||
expire: 30000
|
||||
|
||||
--- # Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
# Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
# 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
# 生产环境不建议放开所有 根据项目需求放开即可
|
||||
include: @endpoints.include@
|
||||
endpoint:
|
||||
logfile:
|
||||
external-file: ./logs/sys-console.log
|
||||
|
||||
--- # 定时任务配置
|
||||
spring:
|
||||
quartz:
|
||||
|
@ -15,10 +15,11 @@ length.not.valid=长度必须在{min}到{max}个字符之间
|
||||
|
||||
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
|
||||
user.password.not.valid=* 5-50个字符
|
||||
|
||||
|
||||
user.email.not.valid=邮箱格式错误
|
||||
user.mobile.phone.number.not.valid=手机号格式错误
|
||||
user.login.success=登录成功
|
||||
user.register.success=注册成功
|
||||
user.notfound=请重新登录
|
||||
user.forcelogout=管理员强制退出,请重新登录
|
||||
user.unknown.error=未知错误,请重新登录
|
||||
|
@ -16,8 +16,8 @@ user.password.not.valid=
|
||||
user.email.not.valid=
|
||||
user.mobile.phone.number.not.valid=
|
||||
user.login.success=
|
||||
user.register.success=register success
|
||||
user.notfound=
|
||||
user.forcelogout=
|
||||
user.unknown.error=
|
||||
|
||||
##文件上传消息
|
||||
|
@ -15,10 +15,11 @@ length.not.valid=长度必须在{min}到{max}个字符之间
|
||||
|
||||
user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
|
||||
user.password.not.valid=* 5-50个字符
|
||||
|
||||
|
||||
user.email.not.valid=邮箱格式错误
|
||||
user.mobile.phone.number.not.valid=手机号格式错误
|
||||
user.login.success=登录成功
|
||||
user.register.success=注册成功
|
||||
user.notfound=请重新登录
|
||||
user.forcelogout=管理员强制退出,请重新登录
|
||||
user.unknown.error=未知错误,请重新登录
|
||||
|
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.SysOssConfigMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.system.domain.SysOssConfig" id="SysOssConfigResult">
|
||||
<result property="ossConfigId" column="oss_config_id"/>
|
||||
<result property="configKey" column="config_key"/>
|
||||
<result property="accessKey" column="access_key"/>
|
||||
<result property="secretKey" column="secret_key"/>
|
||||
<result property="bucketName" column="bucket_name"/>
|
||||
<result property="prefix" column="prefix"/>
|
||||
<result property="endpoint" column="endpoint"/>
|
||||
<result property="isHttps" column="is_https"/>
|
||||
<result property="region" column="region"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="ext1" column="ext1"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
26
ruoyi/src/main/resources/spy.properties
Normal file
26
ruoyi/src/main/resources/spy.properties
Normal file
@ -0,0 +1,26 @@
|
||||
# p6spy <20><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
|
||||
# <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE>ӡ
|
||||
logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
|
||||
#<23><>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨
|
||||
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
|
||||
# ʹ<><CAB9><EFBFBD><EFBFBD>־ϵͳ<CFB5><CDB3>¼ sql
|
||||
#appender=com.p6spy.engine.spy.appender.Slf4JLogger
|
||||
# <20><><EFBFBD><EFBFBD> p6spy driver <20><><EFBFBD><EFBFBD>
|
||||
#deregisterdrivers=true
|
||||
# ȡ<><C8A1>JDBC URLǰ
|
||||
useprefix=true
|
||||
# <20><><EFBFBD>ü<EFBFBD>¼ Log <20><><EFBFBD><EFBFBD>,<2C><>ȥ<EFBFBD><C8A5><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>error,info,batch,debug,statement,commit,rollback,result,resultset.
|
||||
excludecategories=info,debug,result,commit,resultset
|
||||
# <20><><EFBFBD>ڸ<EFBFBD>ʽ
|
||||
dateformat=yyyy-MM-dd HH:mm:ss
|
||||
# ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɶ<EFBFBD><C9B6><EFBFBD>
|
||||
#driverlist=org.h2.Driver
|
||||
# <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SQL<51><4C>¼
|
||||
outagedetection=true
|
||||
# <20><>SQL<51><4C>¼<EFBFBD><C2BC> 2 <20><>
|
||||
outagedetectioninterval=2
|
||||
# <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> Log
|
||||
filter=true
|
||||
# <20><><EFBFBD><EFBFBD> Log ʱ<><CAB1><EFBFBD>ų<EFBFBD><C5B3>ı<EFBFBD><C4B1><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6>ŷָ<C5B7>
|
||||
exclude=QRTZ_
|
@ -41,7 +41,6 @@ public class ${ClassName}Bo extends ${Entity} {
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
#if($column.isInsert && $column.isEdit)
|
||||
#set($Group="AddGroup.class, EditGroup.class")
|
||||
#elseif($column.isInsert)
|
||||
@ -50,11 +49,14 @@ public class ${ClassName}Bo extends ${Entity} {
|
||||
#set($Group="EditGroup.class")
|
||||
#end
|
||||
#if($column.isRequired == 1)
|
||||
@ApiModelProperty(value = "$column.columnComment", required = true)
|
||||
#if($column.javaType == 'String')
|
||||
@NotBlank(message = "$column.columnComment不能为空", groups = { $Group })
|
||||
#else
|
||||
@NotNull(message = "$column.columnComment不能为空", groups = { $Group })
|
||||
#end
|
||||
#else
|
||||
@ApiModelProperty(value = "$column.columnComment")
|
||||
#end
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
|
@ -2,8 +2,10 @@ package ${packageName}.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -16,10 +18,10 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import ${packageName}.domain.vo.${ClassName}Vo;
|
||||
import ${packageName}.domain.bo.${ClassName}Bo;
|
||||
import ${packageName}.service.I${ClassName}Service;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
#if($table.crud || $table.sub)
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
#elseif($table.tree)
|
||||
@ -66,10 +68,9 @@ public class ${ClassName}Controller extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult<${ClassName}Vo> export(@Validated ${ClassName}Bo bo) {
|
||||
public void export(@Validated ${ClassName}Bo bo, HttpServletResponse response) {
|
||||
List<${ClassName}Vo> list = i${ClassName}Service.queryList(bo);
|
||||
ExcelUtil<${ClassName}Vo> util = new ExcelUtil<${ClassName}Vo>(${ClassName}Vo.class);
|
||||
return util.exportExcel(list, "${functionName}");
|
||||
ExcelUtil.exportExcel(list, "${functionName}", ${ClassName}Vo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,7 +90,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
@ApiOperation("新增${functionName}")
|
||||
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody ${ClassName}Bo bo) {
|
||||
return toAjax(i${ClassName}Service.insertByBo(bo) ? 1 : 0);
|
||||
@ -101,7 +102,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
@ApiOperation("修改${functionName}")
|
||||
@PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')")
|
||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody ${ClassName}Bo bo) {
|
||||
return toAjax(i${ClassName}Service.updateByBo(bo) ? 1 : 0);
|
||||
|
@ -1,7 +1,7 @@
|
||||
package ${packageName}.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
#if($table.crud || $table.sub)
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.PagePlus;
|
||||
@ -61,7 +61,7 @@ public class ${ClassName}ServiceImpl extends ServicePlusImpl<${ClassName}Mapper,
|
||||
#set($mpMethod=$column.queryType.toLowerCase())
|
||||
#if($queryType != 'BETWEEN')
|
||||
#if($javaType == 'String')
|
||||
#set($condition='StrUtil.isNotBlank(bo.get'+$AttrName+'())')
|
||||
#set($condition='StringUtils.isNotBlank(bo.get'+$AttrName+'())')
|
||||
#else
|
||||
#set($condition='bo.get'+$AttrName+'() != null')
|
||||
#end
|
||||
|
@ -1,9 +1,12 @@
|
||||
package ${packageName}.domain.vo;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
#foreach ($import in $importList)
|
||||
import ${import};
|
||||
#end
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -19,6 +22,7 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("${functionName}视图对象")
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ${ClassName}Vo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -40,12 +44,14 @@ public class ${ClassName}Vo {
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($parentheseIndex != -1)
|
||||
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
|
||||
#elseif($column.javaType == 'Date')
|
||||
@Excel(name = "${comment}" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||
#if(${column.dictType} && ${column.dictType} != '')
|
||||
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "${column.dictType}")
|
||||
#elseif($parentheseIndex != -1)
|
||||
@ExcelProperty(value = "${comment}", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "$column.readConverterExp()")
|
||||
#else
|
||||
@Excel(name = "${comment}")
|
||||
@ExcelProperty(value = "${comment}")
|
||||
#end
|
||||
@ApiModelProperty("$column.columnComment")
|
||||
private $column.javaType $column.javaField;
|
||||
|
@ -42,12 +42,3 @@ export function del${BusinessName}(${pkColumn.javaField}) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出${functionName}
|
||||
export function export${BusinessName}(query) {
|
||||
return request({
|
||||
url: '/${moduleName}/${businessName}/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -253,7 +253,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
@ -505,7 +505,9 @@ export default {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -108,7 +108,7 @@
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
:loading="exportLoading"
|
||||
:loading="exportLoading"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
||||
>导出</el-button>
|
||||
@ -307,7 +307,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||
import { downLoadExcel } from "@/utils/download";
|
||||
|
||||
export default {
|
||||
name: "${BusinessName}",
|
||||
@ -561,7 +562,9 @@ export default {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
#if($table.sub)
|
||||
/** ${subTable.functionName}序号 */
|
||||
@ -582,35 +585,23 @@ export default {
|
||||
/** ${subTable.functionName}删除按钮操作 */
|
||||
handleDelete${subClassName}() {
|
||||
if (this.checked${subClassName}.length == 0) {
|
||||
this.$alert("请先选择要删除的${subTable.functionName}数据", "提示", { confirmButtonText: "确定", });
|
||||
this.msgError("请先选择要删除的${subTable.functionName}数据");
|
||||
} else {
|
||||
this.${subclassName}List.splice(this.checked${subClassName}[0].index - 1, 1);
|
||||
const ${subclassName}List = this.${subclassName}List;
|
||||
const checked${subClassName} = this.checked${subClassName};
|
||||
this.${subclassName}List = ${subclassName}List.filter(function(item) {
|
||||
return checked${subClassName}.indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 单选框选中数据 */
|
||||
/** 复选框选中数据 */
|
||||
handle${subClassName}SelectionChange(selection) {
|
||||
if (selection.length > 1) {
|
||||
this.$refs.${subclassName}.clearSelection();
|
||||
this.$refs.${subclassName}.toggleRowSelection(selection.pop());
|
||||
} else {
|
||||
this.checked${subClassName} = selection;
|
||||
}
|
||||
this.checked${subClassName} = selection.map(item => item.index)
|
||||
},
|
||||
#end
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有${functionName}数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.exportLoading = true;
|
||||
return export${BusinessName}(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
downLoadExcel('/${moduleName}/${businessName}/export', this.queryParams);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -11,4 +11,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user