commit:同步2.3版本

This commit is contained in:
Jerry
2022-02-20 13:40:36 +08:00
parent c7cc3f5354
commit cbe0f7947d
668 changed files with 172592 additions and 821 deletions

View File

@@ -0,0 +1,26 @@
target/
!.mvn/wrapper/maven-wrapper.jar
/.mvn/*
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

View File

@@ -97,7 +97,7 @@
</if>
<if test="studentFilter.searchString != null and studentFilter.searchString != ''">
<bind name = "safeStudentSearchString" value = "'%' + studentFilter.searchString + '%'" />
AND CONCAT(COALESCE(zz_student.login_mobile,''), COALESCE(zz_student.student_name,'')) LIKE #{safeStudentSearchString}
AND CONCAT(IFNULL(zz_student.login_mobile,''), IFNULL(zz_student.student_name,'')) LIKE #{safeStudentSearchString}
</if>
</if>
</sql>

View File

@@ -28,10 +28,14 @@ public class FilterConfig {
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
CorsConfiguration corsConfiguration = new CorsConfiguration();
if (StringUtils.isNotBlank(applicationConfig.getCredentialIpList())) {
String[] credentialIpList = StringUtils.split(applicationConfig.getCredentialIpList(), ",");
if (credentialIpList.length > 0) {
for (String ip : credentialIpList) {
corsConfiguration.addAllowedOrigin(ip);
if ("*".equals(applicationConfig.getCredentialIpList())) {
corsConfiguration.addAllowedOriginPattern("*");
} else {
String[] credentialIpList = StringUtils.split(applicationConfig.getCredentialIpList(), ",");
if (credentialIpList.length > 0) {
for (String ip : credentialIpList) {
corsConfiguration.addAllowedOrigin(ip);
}
}
}
corsConfiguration.addAllowedHeader("*");

View File

@@ -26,7 +26,7 @@ public interface SysDeptRelationMapper extends BaseDaoMapper<SysDeptRelation> {
/**
* 批量插入部门关联数据。
* 由于目前版本(3.4.1)的Mybatis Plus没有提供真正的批量插入为了保证效率需要自己实现。
* 目前我们仅仅给出MySQL的insert list实现作为参考其他数据库需要自行修改。
* 目前我们仅仅给出MySQL和PostgresSQL的insert list实现作为参考其他数据库需要自行修改。
*
* @param deptRelationList 部门关联关系数据列表。
*/

View File

@@ -0,0 +1,96 @@
spring:
# aj-captcha 对redis缓存的依赖。
redis:
database: 2
host: localhost
port: 6379
password: ''
timeout: 60000
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://localhost:3306/zzdemo-single?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
name: application-webadmin
initialSize: 10
minIdle: 10
maxActive: 50
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
maxOpenPreparedStatements: 20
validationQuery: SELECT 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
filters: stat,wall
useGlobalDataSourceStat: true
web-stat-filter:
enabled: true
url-pattern: /*
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*,/actuator/*"
stat-view-servlet:
enabled: true
urlPattern: /druid/*
resetEnable: true
application:
# Jwt令牌加密的签名值。该值的长度要超过10个字符(过短会报错)。
tokenSigningKey: OrangeSingleDemo-signing-key
# Jwt令牌在Http Header中的键名称。
tokenHeaderKey: Authorization
# Jwt令牌刷新后在Http Header中的键名称。
refreshedTokenHeaderKey: RefreshedToken
# Jwt令牌过期时间(毫秒)。
expiration: 72000000
# 初始化密码。
defaultUserPassword: 123456
# 缺省的文件上传根目录。
uploadFileBaseDir: ./zz-resource/upload-files/app
# 跨域的IP(http://192.168.10.10:8086)白名单列表多个IP之间逗号分隔(* 表示全部信任,空白表示禁用跨域信任)。
credentialIpList: "*"
# Session的用户和数据权限在Redis中的过期时间(秒)。
sessionExpiredSeconds: 86400
sequence:
# Snowflake 分布式Id生成算法所需的WorkNode参数值。
snowflakeWorkNode: 1
# 存储session数据的Redis所有服务均需要因此放到公共配置中。
# 根据实际情况该Redis也可以用于存储其他数据。
redis:
# redisson的配置。每个服务可以自己的配置文件中覆盖此选项。
redisson:
# 如果该值为false系统将不会创建RedissionClient的bean。
enabled: true
# mode的可用值为single/cluster/sentinel/master-slave
mode: single
# single: 单机模式
# address: redis://localhost:6379
# cluster: 集群模式
# 每个节点逗号分隔同时每个节点前必须以redis://开头。
# address: redis://localhost:6379,redis://localhost:6378,...
# sentinel:
# 每个节点逗号分隔同时每个节点前必须以redis://开头。
# address: redis://localhost:6379,redis://localhost:6378,...
# master-slave:
# 每个节点逗号分隔第一个为主节点其余为从节点。同时每个节点前必须以redis://开头。
# address: redis://localhost:6379,redis://localhost:6378,...
address: redis://localhost:6379
# 链接超时,单位毫秒。
timeout: 6000
# 单位毫秒。分布式锁的超时检测时长。
# 如果一次锁内操作超该毫秒数或在释放锁之前异常退出Redis会在该时长之后主动删除该锁使用的key。
lockWatchdogTimeout: 60000
# redis 密码,空可以不填。
password:
pool:
# 连接池数量。
poolSize: 20
# 连接池中最小空闲数量。
minIdle: 5

View File

@@ -56,39 +56,9 @@ pagehelper:
supportMethodsArguments: false
params: count=countSql
# 存储session数据的Redis所有服务均需要因此放到公共配置中。
# 根据实际情况该Redis也可以用于存储其他数据。
redis:
# redisson的配置。每个服务可以自己的配置文件中覆盖此选项。
redisson:
# 如果该值为false系统将不会创建RedissionClient的bean。
enabled: true
# mode的可用值为single/cluster/sentinel/master-slave
mode: single
# single: 单机模式
# address: redis://localhost:6379
# cluster: 集群模式
# 每个节点逗号分隔同时每个节点前必须以redis://开头。
# address: redis://localhost:6379,redis://localhost:6378,...
# sentinel:
# 每个节点逗号分隔同时每个节点前必须以redis://开头。
# address: redis://localhost:6379,redis://localhost:6378,...
# master-slave:
# 每个节点逗号分隔第一个为主节点其余为从节点。同时每个节点前必须以redis://开头。
# address: redis://localhost:6379,redis://localhost:6378,...
address: redis://localhost:6379
# 链接超时,单位毫秒。
timeout: 6000
# 单位毫秒。分布式锁的超时检测时长。
# 如果一次锁内操作超该毫秒数或在释放锁之前异常退出Redis会在该时长之后主动删除该锁使用的key。
lockWatchdogTimeout: 60000
# redis 密码,空可以不填。
password:
pool:
# 连接池数量。
poolSize: 20
# 连接池中最小空闲数量。
minIdle: 5
common-core:
# 可选值为 mysql / postgresql
databaseType: mysql
swagger:
# 当enabled为false的时候则可禁用swagger。
@@ -130,8 +100,7 @@ management:
# keys-to-sanitize:
keys-to-sanitize: password
server:
servlet:
context-path: "/"
base-path: "/"
common-log:
# 操作日志配置对应配置文件common-log/OperationLogProperties.java
@@ -173,135 +142,3 @@ aj:
aes-status: true
# 滑动干扰项(0/1/2)
interference-options: 2
# 开发数据库相关配置
---
spring:
profiles: dev
# aj-captcha 对redis缓存的依赖。
redis:
database: 2
host: localhost
port: 6379
password: ''
timeout: 60000
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://localhost:3306/zzdemo-single?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
name: application-webadmin
initialSize: 10
minIdle: 10
maxActive: 50
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
maxOpenPreparedStatements: 20
validationQuery: SELECT 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
filters: stat,wall
useGlobalDataSourceStat: true
web-stat-filter:
enabled: true
url-pattern: /*
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*,/actuator/*"
stat-view-servlet:
enabled: true
urlPattern: /druid/*
resetEnable: true
application:
# Jwt令牌加密的签名值。该值的长度要超过10个字符(过短会报错)。
tokenSigningKey: OrangeSingleDemo-signing-key
# Jwt令牌在Http Header中的键名称。
tokenHeaderKey: Authorization
# Jwt令牌刷新后在Http Header中的键名称。
refreshedTokenHeaderKey: RefreshedToken
# Jwt令牌过期时间(毫秒)。
expiration: 72000000
# 初始化密码。
defaultUserPassword: 123456
# 缺省的文件上传根目录。
uploadFileBaseDir: ./zz-resource/upload-files/app
# 跨域的IP(http://192.168.10.10:8086)白名单列表多个IP之间逗号分隔(* 表示全部信任,空白表示禁用跨域信任)。
credentialIpList: "*"
# Session的用户和数据权限在Redis中的过期时间(秒)。
sessionExpiredSeconds: 86400
sequence:
# Snowflake 分布式Id生成算法所需的WorkNode参数值。
snowflakeWorkNode: 1
# 发布数据库相关配置
---
spring:
profiles: product
# aj-captcha 对redis缓存的依赖。
redis:
database: 2
host: localhost
port: 6379
password: ''
timeout: 60000
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
url: jdbc:mysql://localhost:3306/zzdemo-single?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
name: application-webadmin
initialSize: 10
minIdle: 10
maxActive: 50
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
maxOpenPreparedStatements: 20
validationQuery: SELECT 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
filters: stat,wall
useGlobalDataSourceStat: true
web-stat-filter:
enabled: true
url-pattern: /*
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*,/actuator/*"
stat-view-servlet:
enabled: true
urlPattern: /druid/*
resetEnable: true
application:
# Jwt令牌加密的签名值。该值的长度要超过10个字符(过短会报错)。
tokenSigningKey: OrangeSingleDemo-signing-key
# Jwt令牌在Http Header中的键名称。
tokenHeaderKey: Authorization
# Jwt令牌刷新后在Http Header中的键名称。
refreshedTokenHeaderKey: RefreshedToken
# Jwt令牌过期时间(毫秒)。
expiration: 72000000
# 初始化密码。
defaultUserPassword: 123456
# 缺省的文件上传根目录。
uploadFileBaseDir: ./zz-resource/upload-files/app
# 跨域的IP(http://192.168.10.10:8086)白名单列表多个IP之间逗号分隔(* 表示全部信任,空白表示禁用跨域信任)。
credentialIpList: "*"
# Session的用户和数据权限在Redis中的过期时间(秒)。
sessionExpiredSeconds: 86400
sequence:
# Snowflake 分布式Id生成算法所需的WorkNode参数值。
snowflakeWorkNode: 1

View File

@@ -156,8 +156,8 @@ public abstract class BaseService<M, K extends Serializable> extends ServiceImpl
*/
private final TableModelInfo tableModelInfo = new TableModelInfo();
private static final String GROUPED_KEY = "groupedKey";
private static final String AGGREGATED_VALUE = "aggregatedValue";
private static final String GROUPED_KEY = "grouped_key";
private static final String AGGREGATED_VALUE = "aggregated_value";
private static final String AND_OP = " AND ";
@Override

View File

@@ -43,6 +43,12 @@ public class MyDateUtil {
private static final DateTimeFormatter DATETIME_PARSE_FORMATTER =
DateTimeFormat.forPattern(MyDateUtil.COMMON_DATETIME_FORMAT);
/**
* 缺省短日期时间格式化器,提前获取提升运行时效率。
*/
private static final DateTimeFormatter DATETIME_SHORT_PARSE_FORMATTER =
DateTimeFormat.forPattern(MyDateUtil.COMMON_SHORT_DATETIME_FORMAT);
/**
* 获取一天的开始时间的字符串格式如2019-08-03 00:00:00.000。
*
@@ -144,6 +150,16 @@ public class MyDateUtil {
return DATETIME_PARSE_FORMATTER.parseDateTime(dateTimeString);
}
/**
* 将缺省格式的(不包含毫秒的)日期时间字符串解析为日期对象。
*
* @param dateTimeString 待解析的字符串。
* @return 解析后的日期对象。
*/
public static DateTime toDateTimeWithoutMs(String dateTimeString) {
return DATETIME_SHORT_PARSE_FORMATTER.parseDateTime(dateTimeString);
}
/**
* 截取时间到天。如2019-10-03 01:20:30 转换为 2019-10-03 00:00:00。
* 由于没有字符串的中间转换,因此效率更高。

View File

@@ -16,7 +16,7 @@
<result column="request_arguments" jdbcType="VARCHAR" property="requestArguments"/>
<result column="response_result" jdbcType="VARCHAR" property="responseResult"/>
<result column="request_ip" jdbcType="VARCHAR" property="requestIp"/>
<result column="success" jdbcType="BIT" property="success"/>
<result column="success" jdbcType="BOOLEAN" property="success"/>
<result column="error_msg" jdbcType="VARCHAR" property="errorMsg"/>
<result column="tenant_id" jdbcType="BIGINT" property="tenantId"/>
<result column="operator_id" jdbcType="BIGINT" property="operatorId"/>

View File

@@ -10,8 +10,8 @@
<packaging>pom</packaging>
<properties>
<spring-boot.version>2.3.10.RELEASE</spring-boot.version>
<spring-boot-admin.version>2.3.1</spring-boot-admin.version>
<spring-boot.version>2.5.8</spring-boot.version>
<spring-boot-admin.version>2.5.5</spring-boot-admin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

View File

@@ -7,15 +7,6 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- 管理员账号数据
-- ----------------------------
BEGIN;
INSERT INTO `zz_sys_dept` VALUES(1309065501174927363,NULL,'公司总部',1,1309065501170733056,CURDATE(),1309065501170733056,CURDATE(),1);
INSERT INTO `zz_sys_user` VALUES(1309065501170733056,'admin','$2a$10$XnwBKjb3jIBoUAUo2nFf/eSegue8KoVhU87.Z2ufCYluIJNlaMiWi','管理员',1309065501174927363,0,NULL,0,1309065501170733056,CURDATE(),1309065501170733056,CURDATE(),1);
INSERT INTO `zz_sys_dept_relation` VALUES(1309065501174927363,1309065501174927363);
COMMIT;
-- ----------------------------
-- 全部菜单数据
-- ----------------------------

View File

@@ -289,4 +289,13 @@ CREATE TABLE `zz_sys_operation_log` (
KEY `idx_success` (`success`) USING BTREE,
KEY `idx_elapse` (`elapse`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='系统操作日志表';
-- ----------------------------
-- 管理员账号数据
-- ----------------------------
BEGIN;
INSERT INTO `zz_sys_dept` VALUES(1309065501174927363,NULL,'公司总部',1,1309065501170733056,CURDATE(),1309065501170733056,CURDATE(),1);
INSERT INTO `zz_sys_user` VALUES(1309065501170733056,'admin','$2a$10$D2/xK3J5qfci.EEWpfINt.u/ykq7uJzNxZBeOhFuAldVSqt1OZaGK','管理员',1309065501174927363,0,NULL,0,1309065501170733056,CURDATE(),1309065501170733056,CURDATE(),1);
INSERT INTO `zz_sys_dept_relation` VALUES(1309065501174927363,1309065501174927363);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -4,7 +4,7 @@
<el-col :span="12">
<el-form-item label="上级菜单">
<el-cascader :options="menuTree" v-model="parentMenuPath" :props="menuProps" placeholder="选择父菜单"
:disabled="!canEditParent || isEdit" :clearable="true" :change-on-select="true" :size="defaultFormItemSize"
:clearable="true" :change-on-select="true" :size="defaultFormItemSize"
@change="onParentMenuChange" />
</el-form-item>
</el-col>
@@ -143,12 +143,13 @@ export default {
}
},
onParentMenuChange (value, isInit) {
if (!isInit) this.formData.menuType = undefined;
this.parentMenuType = undefined;
if (Array.isArray(value) && value.length > 0) {
let node = findTreeNode(this.menuTree, value[value.length - 1], 'menuId');
if (node) this.parentMenuType = node.menuType;
}
// 父菜单切换后判断可用菜单类型是否改变,如果改变则清空
if (!isInit && this.getValidMenuType.map(item => item.id).indexOf(this.formData.menuType) === -1) this.formData.menuType = undefined;
},
onCancel (isSuccess) {
if (this.observer != null) {