From 1b6ca940a67c208a31351c208186caf2b3a0dda5 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 8 Jun 2021 15:18:25 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=95=B0=E6=8D=AE=E8=8C=83=E5=9B=B4=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=BC=BA=E5=B0=91=E4=BB=85=E6=9C=AC=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/domain/entity/SysRole.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java index e8ea03a31..af2f46aad 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java @@ -32,8 +32,8 @@ public class SysRole extends BaseEntity @Excel(name = "角色排序", cellType = ColumnType.NUMERIC) private String roleSort; - /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) */ - @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限") + /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */ + @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") private String dataScope; /** 角色状态(0正常 1停用) */ From 2abe90a93c71575fbd6e2455891b6bb026031ad8 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 8 Jun 2021 15:24:56 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E5=8D=87=E7=BA=A7swagger=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=ACv3.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 41 +++++++------------ ruoyi-admin/pom.xml | 20 ++------- .../controller/tool/SwaggerController.java | 2 +- 3 files changed, 19 insertions(+), 44 deletions(-) diff --git a/pom.xml b/pom.xml index 39b46e9ec..52b9f9b05 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 1.2.6 1.21 2.3.2 - 2.9.2 + 3.0.0 2.1.4 1.3.0 1.2.76 @@ -47,21 +47,21 @@ import - + com.alibaba druid-spring-boot-starter ${druid.version} - + com.github.penggle kaptcha ${kaptcha.version} - + org.apache.shiro shiro-core @@ -129,38 +129,25 @@ ${jna.version} - + io.springfox - springfox-swagger2 - ${swagger.version} - - - io.swagger - swagger-annotations - - - io.swagger - swagger-models - - + springfox-boot-starter + 3.0.0 + + io.swagger + swagger-models + - - - io.springfox - springfox-swagger-ui - ${swagger.version} - - - + commons-io commons-io ${commons.io.version} - + commons-fileupload commons-fileupload @@ -174,7 +161,7 @@ ${poi.version} - + org.apache.velocity velocity diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 65d571144..e29eeaf3c 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -30,29 +30,17 @@ true - + io.springfox - springfox-swagger2 - - - - - io.swagger - swagger-annotations - 1.5.21 + springfox-boot-starter + io.swagger swagger-models - 1.5.21 - - - - - io.springfox - springfox-swagger-ui + 1.6.2 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java index cfa748f30..079d7d2a7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java @@ -19,6 +19,6 @@ public class SwaggerController extends BaseController @GetMapping() public String index() { - return redirect("/swagger-ui.html"); + return redirect("/swagger-ui/index.html"); } } From 5018a471b7b82d0844dcbd395d49fe54ef1695a1 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 9 Jun 2021 19:54:38 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E5=8D=87=E7=BA=A7swagger=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=ACv3.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 ++++-- .../main/java/com/ruoyi/web/core/config/SwaggerConfig.java | 4 +--- .../java/com/ruoyi/framework/config/ResourcesConfig.java | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 52b9f9b05..8210d8ae9 100644 --- a/pom.xml +++ b/pom.xml @@ -133,11 +133,13 @@ io.springfox springfox-boot-starter - 3.0.0 - + ${swagger.version} + + io.swagger swagger-models + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java index d4f020098..0cfbfbadb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java @@ -12,7 +12,6 @@ import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * Swagger2的接口配置 @@ -20,7 +19,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; * @author ruoyi */ @Configuration -@EnableSwagger2 public class SwaggerConfig { /** 是否开启swagger */ @@ -33,7 +31,7 @@ public class SwaggerConfig @Bean public Docket createRestApi() { - return new Docket(DocumentationType.SWAGGER_2) + return new Docket(DocumentationType.OAS_30) // 是否启用Swagger .enable(enabled) // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java index 4a1c63104..98c36c6a8 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java @@ -44,8 +44,7 @@ public class ResourcesConfig implements WebMvcConfigurer registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); /** swagger配置 */ - registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); - registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); + registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/"); } /** From f9ba364d9f41be91ea5a50d22e68cb8cabe41cb3 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 10 Jun 2021 10:26:11 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E9=99=90=E5=88=B6=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E4=B8=8D=E5=85=81=E8=AE=B8=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/system/role/role.html | 20 +++++++++++-------- .../resources/templates/system/user/user.html | 20 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/system/role/role.html b/ruoyi-admin/src/main/resources/templates/system/role/role.html index 18628819e..c16b7fd1c 100644 --- a/ruoyi-admin/src/main/resources/templates/system/role/role.html +++ b/ruoyi-admin/src/main/resources/templates/system/role/role.html @@ -112,14 +112,18 @@ title: '操作', align: 'center', formatter: function(value, row, index) { - var actions = []; - actions.push('编辑 '); - actions.push('删除 '); - var more = []; - more.push("数据权限 "); - more.push("分配用户"); - actions.push('更多操作'); - return actions.join(''); + if (row.roleId != 1) { + var actions = []; + actions.push('编辑 '); + actions.push('删除 '); + var more = []; + more.push("数据权限 "); + more.push("分配用户"); + actions.push('更多操作'); + return actions.join(''); + } else { + return ""; + } } }] }; diff --git a/ruoyi-admin/src/main/resources/templates/system/user/user.html b/ruoyi-admin/src/main/resources/templates/system/user/user.html index 21d506c37..94930329a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/user.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/user.html @@ -171,14 +171,18 @@ title: '操作', align: 'center', formatter: function(value, row, index) { - var actions = []; - actions.push('编辑 '); - actions.push('删除 '); - var more = []; - more.push("重置密码 "); - more.push("分配角色"); - actions.push('更多操作'); - return actions.join(''); + if (row.userId != 1) { + var actions = []; + actions.push('编辑 '); + actions.push('删除 '); + var more = []; + more.push("重置密码 "); + more.push("分配角色"); + actions.push('更多操作'); + return actions.join(''); + } else { + return ""; + } } }] }; From 3111b66bdb53fb1170639c68ab055a76ba82246f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 10 Jun 2021 10:49:07 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E5=8C=BA=E5=88=86Byte[]=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=98=B2=E6=AD=A2=E5=87=BA=E7=8E=B0=E6=AD=BB=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/core/text/Convert.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java index 9dd076d04..5f623c977 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java @@ -7,6 +7,7 @@ import java.nio.charset.Charset; import java.text.NumberFormat; import java.util.Set; import com.ruoyi.common.utils.StringUtils; +import org.apache.commons.lang3.ArrayUtils; /** * 类型转换器 @@ -795,9 +796,14 @@ public class Convert { return (String) obj; } - else if (obj instanceof byte[] || obj instanceof Byte[]) + else if (obj instanceof byte[]) { - return str((Byte[]) obj, charset); + return str((byte[]) obj, charset); + } + else if (obj instanceof Byte[]) + { + byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj); + return str(bytes, charset); } else if (obj instanceof ByteBuffer) { From dcf28440f7d60dfba231d0a097b04b168e64d36b Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 10 Jun 2021 11:11:54 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=88=E6=98=AF=E5=90=A6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E9=A1=B5=E9=9D=A2showPrint=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js | 2 ++ ruoyi-admin/src/main/resources/templates/demo/table/print.html | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index b7024ca83..6be6cbf8c 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -61,6 +61,7 @@ var table = { showColumns: true, showToggle: true, showExport: false, + showPrint: false, exportDataType: 'all', exportTypes: ['csv', 'txt', 'doc', 'excel'], clickToSelect: false, @@ -110,6 +111,7 @@ var table = { showColumns: options.showColumns, // 是否显示隐藏某列下拉框 showToggle: options.showToggle, // 是否显示详细视图和列表视图的切换按钮 showExport: options.showExport, // 是否支持导出文件 + showPrint: options.showPrint, // 是否支持打印页面 showHeader: options.showHeader, // 是否显示表头 showFullscreen: options.showFullscreen, // 是否显示全屏按钮 uniqueId: options.uniqueId, // 唯一的标识符 diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/print.html b/ruoyi-admin/src/main/resources/templates/demo/table/print.html index 85c0c4096..8695376ad 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/table/print.html +++ b/ruoyi-admin/src/main/resources/templates/demo/table/print.html @@ -15,7 +15,7 @@ data-print-filter 设置值以按此列过滤打印的数据。 data-print-formatter 函数(值,行,索引)-返回字符串。格式化打印表中此列的单元格值。函数行为类似于“ formatter”列选项 printIgnore 设置为true可以在打印页面中隐藏此列。 --> -
+
@@ -27,6 +27,7 @@ $(function() { var options = { url: prefix + "/list", + showPrint: true, showSearch: false, showRefresh: false, showToggle: false, From d431e50bdf0f5e5bc65591add059ff7075f7a0a2 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 10 Jun 2021 15:25:28 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/mapper/SysDeptMapper.java | 6 +++--- .../system/service/impl/SysDeptServiceImpl.java | 12 ++++++------ .../main/resources/mapper/system/SysDeptMapper.xml | 13 +++++-------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index b8706257e..b8158b359 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -93,11 +93,11 @@ public interface SysDeptMapper public List selectRoleDeptTree(Long roleId); /** - * 修改所在部门的父级部门状态 + * 修改所在部门正常状态 * - * @param dept 部门 + * @param deptIds 部门ID组 */ - public void updateDeptStatus(SysDept dept); + public void updateDeptStatusNormal(Long[] deptIds); /** * 根据ID查询所有子部门 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index dcf8a2778..e7035fc8d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -12,6 +12,7 @@ import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.Ztree; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.mapper.SysDeptMapper; @@ -229,7 +230,7 @@ public class SysDeptServiceImpl implements ISysDeptService if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) { // 如果该部门是启用状态,则启用该部门的所有上级部门 - updateParentDeptStatus(dept); + updateParentDeptStatusNormal(dept); } return result; } @@ -239,12 +240,11 @@ public class SysDeptServiceImpl implements ISysDeptService * * @param dept 当前部门 */ - private void updateParentDeptStatus(SysDept dept) + private void updateParentDeptStatusNormal(SysDept dept) { - String updateBy = dept.getUpdateBy(); - dept = deptMapper.selectDeptById(dept.getDeptId()); - dept.setUpdateBy(updateBy); - deptMapper.updateDeptStatus(dept); + String ancestors = dept.getAncestors(); + Long[] deptIds = Convert.toLongArray(ancestors); + deptMapper.updateDeptStatusNormal(deptIds); } /** diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 08aa3486a..0ea5f81b1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -145,14 +145,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_dept set del_flag = '2' where dept_id = #{deptId} - - update sys_dept - - status = #{status}, - update_by = #{updateBy}, - update_time = sysdate() - - where find_in_set(#{deptId}, ancestors) + + update sys_dept set status = '0' where dept_id in + + #{deptId} + \ No newline at end of file From 14c1512a947d89fe04f6f35b8c6deeeea6e14bdd Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 10 Jun 2021 15:25:39 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E5=8D=87=E7=BA=A7oshi=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=ACv5.7.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 8210d8ae9..c71c50466 100644 --- a/pom.xml +++ b/pom.xml @@ -26,8 +26,8 @@ 2.1.4 1.3.0 1.2.76 - 5.6.0 - 5.7.0 + 5.7.4 + 5.8.0 2.5 1.3.3 4.1.2 @@ -134,11 +134,11 @@ io.springfox springfox-boot-starter ${swagger.version} - + - io.swagger - swagger-models - + io.swagger + swagger-models + From 26dbf4f6a064b9c1e97b7349dc78890575af5ac5 Mon Sep 17 00:00:00 2001 From: zhangmrit Date: Thu, 10 Jun 2021 22:39:20 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E5=88=B7=E6=96=B0options=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 6be6cbf8c..16b9d4649 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -472,6 +472,11 @@ var table = { pageSize: pageSize }); }, + // 刷新options配置 + refreshOptions: function(options,tableId) { + var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; + $("#" + currentId).bootstrapTable('refreshOptions', options); + }, // 查询表格指定列值 selectColumns: function(column) { var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) { From 75b7f01723f9da6558f0d97efe549d59db024739 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 15 Jun 2021 09:22:55 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=B1=8F=E8=94=BDrmi=E8=BF=9C=E7=A8=8B=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/constant/Constants.java | 5 +++++ .../ruoyi/quartz/controller/SysJobController.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index 3c6554582..869997cda 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -96,4 +96,9 @@ public class Constants * 资源映射路径 前缀 */ public static final String RESOURCE_PREFIX = "/profile"; + + /** + * RMI 远程方法调用 + */ + public static final String LOOKUP_RMI = "rmi://"; } diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java index f9f0fab3c..6803c96fa 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java @@ -13,11 +13,13 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.exception.job.TaskException; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.quartz.domain.SysJob; import com.ruoyi.quartz.service.ISysJobService; @@ -131,7 +133,11 @@ public class SysJobController extends BaseController { if (!CronUtils.isValid(job.getCronExpression())) { - return AjaxResult.error("cron表达式不正确"); + return AjaxResult.error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确"); + } + else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) + { + return AjaxResult.error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi://'调用"); } return toAjax(jobService.insertJob(job)); } @@ -157,7 +163,11 @@ public class SysJobController extends BaseController { if (!CronUtils.isValid(job.getCronExpression())) { - return AjaxResult.error("cron表达式不正确"); + return AjaxResult.error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确"); + } + else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI)) + { + return AjaxResult.error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi://'调用"); } return toAjax(jobService.updateJob(job)); } From c11dcc4ee846d0dc7f1caef90845e239237e643a Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 15 Jun 2021 09:23:24 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=EF=BC=88=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E5=88=86=E9=A1=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/controller/DemoTableController.java | 9 ++ .../bootstrap-table-custom-view.js | 108 ++++++++++++++++ .../main/resources/static/ruoyi/js/ry-ui.js | 2 +- .../templates/demo/table/customView.html | 122 ++++++++++++++++++ .../src/main/resources/templates/include.html | 5 + .../resources/templates/index-topnav.html | 1 + .../src/main/resources/templates/index.html | 1 + 7 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js create mode 100644 ruoyi-admin/src/main/resources/templates/demo/table/customView.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java index 82c53ceb9..06fb5480c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java @@ -339,6 +339,15 @@ public class DemoTableController extends BaseController return prefix + "/dynamicColumns"; } + /** + * 自定义视图分页 + */ + @GetMapping("/customView") + public String customView() + { + return prefix + "/customView"; + } + /** * 表格其他操作 */ diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js new file mode 100644 index 000000000..a33bd170a --- /dev/null +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js @@ -0,0 +1,108 @@ +/** + * @author zhixin wen + */ + +const Utils = $.fn.bootstrapTable.utils + +$.extend($.fn.bootstrapTable.defaults, { + customView: false, + showCustomView: false, + showCustomViewButton: false +}) + +$.extend($.fn.bootstrapTable.defaults.icons, { + customView: { + bootstrap3: 'glyphicon glyphicon-eye-open', + bootstrap5: 'bi-eye', + bootstrap4: 'fa fa-eye', + semantic: 'fa fa-eye', + foundation: 'fa fa-eye', + bulma: 'fa fa-eye', + materialize: 'remove_red_eye' + }[$.fn.bootstrapTable.theme] || 'fa-eye' +}) + +$.extend($.fn.bootstrapTable.defaults, { + onCustomViewPostBody () { + return false + }, + onCustomViewPreBody () { + return false + } +}) + +$.extend($.fn.bootstrapTable.locales, { + formatToggleCustomView () { + return 'Toggle custom view' + } +}) +$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales) + +$.fn.bootstrapTable.methods.push('toggleCustomView') + +$.extend($.fn.bootstrapTable.Constructor.EVENTS, { + 'custom-view-post-body.bs.table': 'onCustomViewPostBody', + 'custom-view-pre-body.bs.table': 'onCustomViewPreBody' +}) + +$.BootstrapTable = class extends $.BootstrapTable { + + init () { + this.showCustomView = this.options.showCustomView + + super.init() + } + + initToolbar (...args) { + if (this.options.customView && this.options.showCustomViewButton) { + this.buttons = Object.assign(this.buttons, { + customView: { + text: this.options.formatToggleCustomView(), + icon: this.options.icons.customView, + event: this.toggleCustomView, + attributes: { + 'aria-label': this.options.formatToggleCustomView(), + title: this.options.formatToggleCustomView() + } + } + }) + } + + super.initToolbar(...args) + } + + initBody () { + super.initBody() + + if (!this.options.customView) { + return + } + + const $table = this.$el + const $customViewContainer = this.$container.find('.fixed-table-custom-view') + + $table.hide() + $customViewContainer.hide() + if (!this.options.customView || !this.showCustomView) { + $table.show() + return + } + + const data = this.getData().slice(this.pageFrom - 1, this.pageTo) + const value = Utils.calculateObjectValue(this, this.options.customView, [data], '') + + this.trigger('custom-view-pre-body', data, value) + if ($customViewContainer.length === 1) { + $customViewContainer.show().html(value) + } else { + this.$tableBody.after(`
${value}
`) + } + + this.trigger('custom-view-post-body', data, value) + } + + toggleCustomView () { + this.showCustomView = !this.showCustomView + this.initBody() + } +} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 16b9d4649..4cdcb28e8 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -473,7 +473,7 @@ var table = { }); }, // 刷新options配置 - refreshOptions: function(options,tableId) { + refreshOptions: function(options, tableId) { var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId; $("#" + currentId).bootstrapTable('refreshOptions', options); }, diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/customView.html b/ruoyi-admin/src/main/resources/templates/demo/table/customView.html new file mode 100644 index 000000000..a2f4d1ceb --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/demo/table/customView.html @@ -0,0 +1,122 @@ + + + + + + +
+
+
+ +
+
+
+
+ + + +
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/include.html b/ruoyi-admin/src/main/resources/templates/include.html index 157242c02..351d30ae0 100644 --- a/ruoyi-admin/src/main/resources/templates/include.html +++ b/ruoyi-admin/src/main/resources/templates/include.html @@ -217,3 +217,8 @@
+ + +
+ +
diff --git a/ruoyi-admin/src/main/resources/templates/index-topnav.html b/ruoyi-admin/src/main/resources/templates/index-topnav.html index 3b22b02b8..4ad1fefab 100644 --- a/ruoyi-admin/src/main/resources/templates/index-topnav.html +++ b/ruoyi-admin/src/main/resources/templates/index-topnav.html @@ -145,6 +145,7 @@
  • 表格自动刷新
  • 表格打印配置
  • 表格动态列
  • +
  • 自定义视图分页
  • 表格其他操作
  • diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index 4f41c96f0..e4ecc78e1 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -126,6 +126,7 @@
  • 表格自动刷新
  • 表格打印配置
  • 表格动态列
  • +
  • 自定义视图分页
  • 表格其他操作
  • From e235b00e5385fe0f3e3b2ac6cee2734d37cc69cc Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 16 Jun 2021 09:10:58 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E5=8D=87=E7=BA=A7commons.io=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=ACv2.10.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../src/main/java/com/ruoyi/common/utils/file/FileUtils.java | 2 +- .../com/ruoyi/generator/service/impl/GenTableServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c71c50466..59755d58a 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ 1.2.76 5.7.4 5.8.0 - 2.5 + 2.10.0 1.3.3 4.1.2 1.7 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 6bc2ce63c..dfdf9e933 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 @@ -18,7 +18,7 @@ import com.ruoyi.common.utils.StringUtils; * * @author ruoyi */ -public class FileUtils extends org.apache.commons.io.FileUtils +public class FileUtils { public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/impl/GenTableServiceImpl.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/impl/GenTableServiceImpl.java index de5cc50f3..b809d6a37 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/impl/GenTableServiceImpl.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/impl/GenTableServiceImpl.java @@ -10,6 +10,7 @@ import java.util.Map; import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; @@ -27,7 +28,6 @@ import com.ruoyi.common.core.text.CharsetKit; import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.generator.domain.GenTable; import com.ruoyi.generator.domain.GenTableColumn; import com.ruoyi.generator.mapper.GenTableColumnMapper; From 5fb9263ff5a977457f51269ab12e10339949687f Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 16 Jun 2021 09:11:29 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E5=8D=87=E7=BA=A7commons.fileupload?= =?UTF-8?q?=E5=88=B0=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=ACv1.4?= 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 59755d58a..145f1b757 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 5.7.4 5.8.0 2.10.0 - 1.3.3 + 1.4 4.1.2 1.7 From e71387b44c21928fdb983f1621ed62677e6b62f7 Mon Sep 17 00:00:00 2001 From: RhythmLian Date: Thu, 17 Jun 2021 05:15:13 +0000 Subject: [PATCH 14/16] update ry.sh. --- ry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ry.sh b/ry.sh index bec5de488..7c4f50385 100644 --- a/ry.sh +++ b/ry.sh @@ -3,7 +3,7 @@ # ./ry.sh start 启动 # ./ry.sh stop 停止 # ./ry.sh restart 重启 -# ./ry.sh start 状态 +# ./ry.sh status 状态 AppName=ruoyi-admin.jar # JVM参数 From 47075cb6f56e79db6f24af99b9497a67c8348bb8 Mon Sep 17 00:00:00 2001 From: Ricky Date: Fri, 18 Jun 2021 09:21:27 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E5=BC=B9=E5=B1=82js=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/templates/demo/modal/form.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ruoyi-admin/src/main/resources/templates/demo/modal/form.html b/ruoyi-admin/src/main/resources/templates/demo/modal/form.html index f9e201518..f9c749d65 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/modal/form.html +++ b/ruoyi-admin/src/main/resources/templates/demo/modal/form.html @@ -91,5 +91,12 @@ + From f63590c11645cb45e9dde8e5b41a469f02ed7b0e Mon Sep 17 00:00:00 2001 From: Ricky Date: Fri, 18 Jun 2021 11:37:41 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E8=A1=8C=E6=8B=96=E6=8B=BD=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extensions/reorder-rows/jquery.tablednd.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-rows/jquery.tablednd.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-rows/jquery.tablednd.js index 7f9f04c6d..08f9a1288 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-rows/jquery.tablednd.js +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-rows/jquery.tablednd.js @@ -152,11 +152,16 @@ jQuery.tableDnD = { config.dragHandle // We only need to add the event to the specified cells && $(config.dragHandle, table).each(function() { - // The cell is bound to "this" - $(this).bind(startEvent, function(e) { - $.tableDnD.initialiseDrag($(this).parents('tr')[0], table, this, e, config); - return false; - }); + if (! $(this).hasClass("nodrag")) { + // The cell is bound to "this" + $(this).bind(startEvent, function(e) { + if (e.target.tagName === "TD" && event.target.className !== "nodrag") { + $.tableDnD.initialiseDrag($(this).parents('tr')[0], table, this, e, config); + return false; + } + return true; + }); + } }) // For backwards compatibility, we add the event to the whole row // get all the rows as a wrapped set