From 07fded4da95b4993ce65efe7f3796d3b7ecaef86 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 2 Apr 2022 10:13:58 +0800 Subject: [PATCH 01/14] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1801b6d48..ba50d3efc 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@

logo

-

RuoYi v3.8.1

+

RuoYi v3.8.2

基于SpringBoot+Vue前后端分离的Java快速开发框架

- +

From bac3b3a0dc0c2e8fa464fd0c5247a8903af1ea21 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 2 Apr 2022 10:15:25 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E9=99=8D=E7=BA=A7jsencrypt=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=85=BC=E5=AE=B9IE=E6=B5=8F=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 6e1523c00..853a3b8c8 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -47,7 +47,7 @@ "highlight.js": "9.18.5", "js-beautify": "1.13.0", "js-cookie": "3.0.1", - "jsencrypt": "3.2.1", + "jsencrypt": "3.0.0-rc.1", "nprogress": "0.2.0", "quill": "1.3.7", "screenfull": "5.0.2", From 3bc5ef38d34ff31481f013be2cc2bf1feeb2c1fc Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 2 Apr 2022 10:16:09 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E5=8D=87=E7=BA=A7spring-boot=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC2.5.12=20=E9=98=B2=E6=AD=A2?= =?UTF-8?q?RCE=E6=BC=8F=E6=B4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 850b1be23..b693251fc 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ org.springframework.boot spring-boot-dependencies - 2.5.11 + 2.5.12 pom import From d311d56bbfb4c37899b426457ac6a46e33874f0f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 3 Apr 2022 18:28:30 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8DExcel=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?prompt/combo=E5=90=8C=E6=97=B6=E4=BD=BF=E7=94=A8=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 53 +++++-------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 9a837c430..e00883879 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -786,17 +786,10 @@ public class ExcelUtil // 设置列宽 sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256)); } - // 如果设置了提示信息则鼠标放上去提示. - if (StringUtils.isNotEmpty(attr.prompt())) + if (StringUtils.isNotEmpty(attr.prompt()) || attr.combo().length > 0) { - // 这里默认设了2-101列提示. - setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); - } - // 如果设置了combo属性则本列只能选择不能输入 - if (attr.combo().length > 0) - { - // 这里默认设了2-101列只能选择不能输入. - setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + // 提示信息或只能选择不能输入的列内容. + setPromptOrValidation(sheet, attr.combo(), attr.prompt(), 1, 100, column, column); } } @@ -860,48 +853,29 @@ public class ExcelUtil } /** - * 设置 POI XSSFSheet 单元格提示 + * 设置 POI XSSFSheet 单元格提示或选择框 * * @param sheet 表单 - * @param promptTitle 提示标题 + * @param textlist 下拉框显示的内容 * @param promptContent 提示内容 * @param firstRow 开始行 * @param endRow 结束行 * @param firstCol 开始列 * @param endCol 结束列 */ - public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + public void setPromptOrValidation(Sheet sheet, String[] textlist, String promptContent, int firstRow, int endRow, int firstCol, int endCol) { DataValidationHelper helper = sheet.getDataValidationHelper(); - DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + DataValidationConstraint constraint = textlist.length > 0 ? helper.createExplicitListConstraint(textlist) : helper.createCustomConstraint("DD1"); CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); DataValidation dataValidation = helper.createValidation(constraint, regions); - dataValidation.createPromptBox(promptTitle, promptContent); - dataValidation.setShowPromptBox(true); - sheet.addValidationData(dataValidation); - } - - /** - * 设置某些列的值只能输入预制的数据,显示下拉框. - * - * @param sheet 要设置的sheet. - * @param textlist 下拉框显示的内容 - * @param firstRow 开始行 - * @param endRow 结束行 - * @param firstCol 开始列 - * @param endCol 结束列 - * @return 设置好的sheet. - */ - public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) - { - DataValidationHelper helper = sheet.getDataValidationHelper(); - // 加载下拉列表内容 - DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); - // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 - CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); - // 数据有效性对象 - DataValidation dataValidation = helper.createValidation(constraint, regions); + if (StringUtils.isNotEmpty(promptContent)) + { + // 如果设置了提示信息则鼠标放上去提示 + dataValidation.createPromptBox("", promptContent); + dataValidation.setShowPromptBox(true); + } // 处理Excel兼容性问题 if (dataValidation instanceof XSSFDataValidation) { @@ -912,7 +886,6 @@ public class ExcelUtil { dataValidation.setSuppressDropDownArrow(false); } - sheet.addValidationData(dataValidation); } From db2dfee6ae22829e942ada5070d3ae1050fdde92 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 7 Apr 2022 09:50:42 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=B7=BB=E5=8A=A0=E9=83=A8=E9=97=A8ancestors?= =?UTF-8?q?=E7=A5=96=E7=BA=A7=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/system/SysUserMapper.xml | 79 ++++++++++--------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 4a095a6f3..16a64c2a3 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -4,50 +4,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, - d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status, + d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u left join sys_dept d on u.dept_id = d.dept_id From d910888181365139684deae21382526d21e84da1 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 7 Apr 2022 10:56:40 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=A0=91=E8=A1=A8=E6=96=B0=E5=A2=9E(=E5=B1=95=E5=BC=80/?= =?UTF-8?q?=E6=8A=98=E5=8F=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/vm/vue/index-tree.vue.vm | 24 ++++++++++++++++++- .../resources/vm/vue/v3/index-tree.vue.vm | 22 ++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm index a95916f43..9d29aceed 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -78,14 +78,24 @@ v-hasPermi="['${moduleName}:${businessName}:add']" >新增 + + 展开/折叠 + #foreach($column in $columns) @@ -293,6 +303,10 @@ export default { title: "", // 是否显示弹出层 open: false, + // 是否展开,默认全部展开 + isExpandAll: true, + // 重新渲染表格状态 + refreshTable: true, #foreach ($column in $columns) #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) @@ -423,6 +437,14 @@ export default { this.open = true; this.title = "添加${functionName}"; }, + /** 展开/折叠操作 */ + toggleExpandAll() { + this.refreshTable = false; + this.isExpandAll = !this.isExpandAll; + this.$nextTick(() => { + this.refreshTable = true; + }); + }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm index d57bbdf0c..11bbe52e3 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -76,14 +76,23 @@ v-hasPermi="['${moduleName}:${businessName}:add']" >新增 + + 展开/折叠 + #foreach($column in $columns) @@ -283,6 +292,8 @@ const open = ref(false); const loading = ref(true); const showSearch = ref(true); const title = ref(""); +const isExpandAll = ref(true); +const refreshTable = ref(true); #foreach ($column in $columns) #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) @@ -405,6 +416,15 @@ async function handleAdd(row) { title.value = "添加${functionName}"; } +/** 展开/折叠操作 */ +function toggleExpandAll() { + refreshTable.value = false; + isExpandAll.value = !isExpandAll.value; + nextTick(() => { + refreshTable.value = true; + }); +} + /** 修改按钮操作 */ async function handleUpdate(row) { reset(); From c0d430f4e5adf08129c2610d9d2b5446bb19c0d6 Mon Sep 17 00:00:00 2001 From: XCSDN Date: Thu, 7 Apr 2022 04:57:56 +0000 Subject: [PATCH 07/14] =?UTF-8?q?update=20ruoyi-common/src/main/java/com/r?= =?UTF-8?q?uoyi/common/core/domain/entity/SysDictType.java.=20=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E7=B1=BB=E5=9E=8B=E5=BF=85=E9=A1=BB=E4=BB=A5=E5=AD=97?= =?UTF-8?q?=E6=AF=8D=E5=BC=80=E5=A4=B4,=E4=B8=94=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=8F=AA=E8=83=BD=E7=94=B1=E5=B0=8F=E5=86=99?= =?UTF-8?q?=E5=AD=97=E6=AF=8D=E6=88=96=E5=8A=A0=E4=B8=8B=E5=88=92=E7=BA=BF?= =?UTF-8?q?=E8=BF=98=E6=9C=89=E6=95=B0=E5=AD=97=E7=BB=84=E6=88=90=20?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E7=94=B1=E4=BA=8E=E5=AD=97=E5=85=B8=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=B8=8D=E7=AC=A6=E5=90=88=E5=89=8D=E7=AB=AF=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E8=A7=84=E8=8C=83=E8=80=8C=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/domain/entity/SysDictType.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java index 6683c9194..027c6e956 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java @@ -1,5 +1,6 @@ package com.ruoyi.common.core.domain.entity; +import javax.validation.constraints.Pattern; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -26,6 +27,9 @@ public class SysDictType extends BaseEntity private String dictName; /** 字典类型 */ + @NotBlank(message = "字典类型不能为空") + @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且字典类型只能由小写字母或加下划线还有数字组成") + @Size(min = 2, max = 200, message = "字典类型长度必须在2-200个字符之间") @Excel(name = "字典类型") private String dictType; From de5ae4a05efc19bb5d476ddc51e6a5a3d6b782be Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 8 Apr 2022 15:42:10 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B5=E7=AD=BEopenP?= =?UTF-8?q?age=E6=94=AF=E6=8C=81=E4=BC=A0=E9=80=92=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/plugins/tab.js | 4 ++-- ruoyi-ui/src/views/tool/gen/index.vue | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/plugins/tab.js b/ruoyi-ui/src/plugins/tab.js index c8058a948..5e8b834af 100644 --- a/ruoyi-ui/src/plugins/tab.js +++ b/ruoyi-ui/src/plugins/tab.js @@ -55,10 +55,10 @@ export default { return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute); }, // 添加tab页签 - openPage(title, url) { + openPage(title, url, params) { var obj = { path: url, meta: { title: title } } store.dispatch('tagsView/addView', obj); - return router.push(url); + return router.push({ path: url, query: params }); }, // 修改tab页签 updatePage(obj) { diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index 4b44b86ee..381e30f6e 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/index.vue @@ -318,7 +318,9 @@ export default { /** 修改按钮操作 */ handleEditTable(row) { const tableId = row.tableId || this.ids[0]; - this.$router.push({ path: '/tool/gen-edit/index/' + tableId, query: { pageNum: this.queryParams.pageNum } }); + const tableName = row.tableName || this.tableNames[0]; + const params = { pageNum: this.queryParams.pageNum }; + this.$tab.openPage("修改[" + tableName + "]生成配置", '/tool/gen-edit/index/' + tableId, params); }, /** 删除按钮操作 */ handleDelete(row) { From a0447de0612b8895b6052f26c4ff46e9033fcffc Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 15 Apr 2022 09:31:51 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E5=AD=97=E5=85=B8=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E4=BB=A5=E5=AD=97=E6=AF=8D=E5=BC=80=E5=A4=B4?= =?UTF-8?q?=EF=BC=8C=E4=B8=94=E5=8F=AA=E8=83=BD=E4=B8=BA=EF=BC=88=E5=B0=8F?= =?UTF-8?q?=E5=86=99=E5=AD=97=E6=AF=8D=EF=BC=8C=E6=95=B0=E5=AD=97=EF=BC=8C?= =?UTF-8?q?=E4=B8=8B=E6=BB=91=E7=BA=BF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/core/domain/entity/SysDictType.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java index 027c6e956..0befbf434 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java @@ -1,7 +1,7 @@ package com.ruoyi.common.core.domain.entity; -import javax.validation.constraints.Pattern; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -27,9 +27,6 @@ public class SysDictType extends BaseEntity private String dictName; /** 字典类型 */ - @NotBlank(message = "字典类型不能为空") - @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且字典类型只能由小写字母或加下划线还有数字组成") - @Size(min = 2, max = 200, message = "字典类型长度必须在2-200个字符之间") @Excel(name = "字典类型") private String dictType; @@ -61,6 +58,7 @@ public class SysDictType extends BaseEntity @NotBlank(message = "字典类型不能为空") @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符") + @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)") public String getDictType() { return dictType; From 68a616d7c7f1522986462a37f0b23c7bffb69fbe Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 15 Apr 2022 09:32:21 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E5=8D=87=E7=BA=A7element-ui=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC2.15.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 853a3b8c8..50377539c 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -41,7 +41,7 @@ "clipboard": "2.0.8", "core-js": "3.19.1", "echarts": "4.9.0", - "element-ui": "2.15.6", + "element-ui": "2.15.8", "file-saver": "2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", From c3c49a05c2aa34748f7bfc0011a68ddf9239c4e4 Mon Sep 17 00:00:00 2001 From: XCSDN Date: Sat, 16 Apr 2022 06:02:07 +0000 Subject: [PATCH 11/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=8F=96=E6=96=87=E4=BB=B6=E5=90=8D=E8=80=8C=E4=B8=8D=E5=B8=A6?= =?UTF-8?q?=E5=90=8E=E7=BC=80=E7=9A=84=E6=95=B4=E5=90=88=E6=96=B9=E6=B3=95?= =?UTF-8?q?,=E5=B9=B2=E5=87=80=E5=8F=88=E5=8D=AB=E7=94=9F=E5=95=8A?= =?UTF-8?q?=E5=85=84=E5=BC=9F=E4=BB=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/file/FileUtils.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index 6915a53a5..bde198762 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -17,6 +17,7 @@ import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.IdUtils; +import org.apache.commons.io.FilenameUtils; /** * 文件处理工具类 @@ -257,7 +258,7 @@ public class FileUtils /** * 获取名称 - * + * 例如: /profile/upload/2022/04/16/ruoyi.png, 返回: ruoyi.png * @param fileName 路径名称 * @return 没有文件路径的名称 */ @@ -272,4 +273,19 @@ public class FileUtils int index = Math.max(lastUnixPos, lastWindowsPos); return fileName.substring(index + 1); } + + /** + * 获取名称 + * 例如: /profile/upload/2022/04/16/ruoyi.png, 返回: ruoyi + * @param fileName 路径名称 + * @return 没有文件路径的名称 + */ + public static String getNameNotSuffix(String fileName) { + if (fileName == null) { + return null; + } + String baseName = FilenameUtils.getBaseName(fileName); + return baseName; + } + } From 910fe6261b2818a93aa618a66565666b4f7d7b9e Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 16 Apr 2022 22:06:15 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8D=E5=B8=A6=E5=90=8E=E7=BC=80=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/file/FileUtils.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index bde198762..f8a39d3d5 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -257,8 +257,8 @@ public class FileUtils } /** - * 获取名称 - * 例如: /profile/upload/2022/04/16/ruoyi.png, 返回: ruoyi.png + * 获取文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi.png + * * @param fileName 路径名称 * @return 没有文件路径的名称 */ @@ -275,13 +275,15 @@ public class FileUtils } /** - * 获取名称 - * 例如: /profile/upload/2022/04/16/ruoyi.png, 返回: ruoyi + * 获取不带后缀文件名称 /profile/upload/2022/04/16/ruoyi.png -- ruoyi + * * @param fileName 路径名称 - * @return 没有文件路径的名称 + * @return 没有文件路径和后缀的名称 */ - public static String getNameNotSuffix(String fileName) { - if (fileName == null) { + public static String getNameNotSuffix(String fileName) + { + if (fileName == null) + { return null; } String baseName = FilenameUtils.getBaseName(fileName); From 2a9beec31dcc997d65f45641b9fa374a8cb42908 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 16 Apr 2022 22:06:25 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1bean=E6=89=80=E5=9C=A8=E5=8C=85=E5=90=8D?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E4=B8=BA=E7=99=BD=E5=90=8D=E5=8D=95=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java index 6712a721e..9833d20dd 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java @@ -15,6 +15,7 @@ import com.ruoyi.common.constant.ScheduleConstants; import com.ruoyi.common.exception.job.TaskException; import com.ruoyi.common.exception.job.TaskException.Code; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.quartz.domain.SysJob; /** @@ -127,6 +128,7 @@ public class ScheduleUtils { return StringUtils.containsAnyIgnoreCase(invokeTarget, Constants.JOB_WHITELIST_STR); } - return true; + Object obj = SpringUtils.getBean(StringUtils.split(invokeTarget, ".")[0]); + return StringUtils.containsAnyIgnoreCase(obj.getClass().getPackage().getName(), Constants.JOB_WHITELIST_STR); } } From b42a8176cab314e46c5c3d2593dd4826addd7cc0 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 17 Apr 2022 10:29:12 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/page/TableSupport.java | 5 +++-- .../src/main/java/com/ruoyi/common/utils/PageUtils.java | 9 +++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java index 03d0ce57b..62ac4f968 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java @@ -1,5 +1,6 @@ package com.ruoyi.common.core.page; +import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.utils.ServletUtils; /** @@ -40,8 +41,8 @@ public class TableSupport public static PageDomain getPageDomain() { PageDomain pageDomain = new PageDomain(); - pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM)); - pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE)); + pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1)); + pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10)); pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN)); pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC)); pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE)); diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java index 0585396c9..70e9b08f4 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java @@ -20,12 +20,9 @@ public class PageUtils extends PageHelper PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); - if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) - { - String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); - Boolean reasonable = pageDomain.getReasonable(); - PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); - } + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + Boolean reasonable = pageDomain.getReasonable(); + PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); } /**