From 1cabccc9a8486cef1d0965931ee5918770522895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 28 Jul 2023 20:00:58 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20excel=20=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=AD=97=E5=85=B8=E9=BB=98=E8=AE=A4=E8=BD=AC=E4=B8=BA?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/common/excel/core/ExcelDownHandler.java | 3 +++ .../main/java/org/dromara/common/excel/utils/ExcelUtil.java | 6 ++---- .../main/java/org/dromara/system/domain/vo/SysClientVo.java | 2 +- .../main/java/org/dromara/system/domain/vo/SysConfigVo.java | 2 +- .../main/java/org/dromara/system/domain/vo/SysDeptVo.java | 2 +- .../java/org/dromara/system/domain/vo/SysDictDataVo.java | 4 ++-- .../java/org/dromara/system/domain/vo/SysDictTypeVo.java | 2 +- .../java/org/dromara/system/domain/vo/SysLogininforVo.java | 2 +- .../java/org/dromara/system/domain/vo/SysOperLogVo.java | 6 +++--- .../main/java/org/dromara/system/domain/vo/SysPostVo.java | 2 +- .../main/java/org/dromara/system/domain/vo/SysRoleVo.java | 4 ++-- .../org/dromara/system/domain/vo/SysTenantPackageVo.java | 2 +- .../main/java/org/dromara/system/domain/vo/SysTenantVo.java | 2 +- .../java/org/dromara/system/domain/vo/SysUserExportVo.java | 4 ++-- 14 files changed, 22 insertions(+), 21 deletions(-) diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java index 52bfebcb..db4fecca 100644 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/core/ExcelDownHandler.java @@ -128,6 +128,9 @@ public class ExcelDownHandler implements SheetWriteHandler { } } } + if (CollUtil.isEmpty(dropDownOptions)) { + return; + } dropDownOptions.forEach(everyOptions -> { // 如果传递了下拉框选择器参数 if (!everyOptions.getNextOptions().isEmpty()) { diff --git a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/utils/ExcelUtil.java b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/utils/ExcelUtil.java index 00a78eae..329911d1 100644 --- a/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/utils/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-excel/src/main/java/org/dromara/common/excel/utils/ExcelUtil.java @@ -196,10 +196,8 @@ public class ExcelUtil { // 合并处理器 builder.registerWriteHandler(new CellMergeStrategy(list, true)); } - if (CollUtil.isNotEmpty(options)) { - // 添加下拉框操作 - builder.registerWriteHandler(new ExcelDownHandler(options)); - } + // 添加下拉框操作 + builder.registerWriteHandler(new ExcelDownHandler(options)); builder.doWrite(list); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysClientVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysClientVo.java index 34f24eb3..fa23cd1b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysClientVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysClientVo.java @@ -82,7 +82,7 @@ public class SysClientVo implements Serializable { /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", index = 7, converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=正常,1=停用") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysConfigVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysConfigVo.java index f896000a..db7d53a3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysConfigVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysConfigVo.java @@ -53,7 +53,7 @@ public class SysConfigVo implements Serializable { /** * 系统内置(Y是 N否) */ - @ExcelProperty(value = "系统内置", converter = ExcelDictConvert.class) + @ExcelProperty(value = "系统内置", index = 4, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_yes_no") private String configType; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java index e09d67e1..4611ae0f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDeptVo.java @@ -78,7 +78,7 @@ public class SysDeptVo implements Serializable { /** * 部门状态(0正常 1停用) */ - @ExcelProperty(value = "部门状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "部门状态", index = 5, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java index d058d5e9..1372f316 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictDataVo.java @@ -69,14 +69,14 @@ public class SysDictDataVo implements Serializable { /** * 是否默认(Y是 N否) */ - @ExcelProperty(value = "是否默认", converter = ExcelDictConvert.class) + @ExcelProperty(value = "是否默认", index = 5, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_yes_no") private String isDefault; /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", index = 6, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java index 2cac4a25..771f9563 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysDictTypeVo.java @@ -47,7 +47,7 @@ public class SysDictTypeVo implements Serializable { /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", index = 3, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java index cf9720e9..97bc79b3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysLogininforVo.java @@ -48,7 +48,7 @@ public class SysLogininforVo implements Serializable { /** * 登录状态(0成功 1失败) */ - @ExcelProperty(value = "登录状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "登录状态", index = 2, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_common_status") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java index d9eb71d4..306237e3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysOperLogVo.java @@ -47,7 +47,7 @@ public class SysOperLogVo implements Serializable { /** * 业务类型(0其它 1新增 2修改 3删除) */ - @ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class) + @ExcelProperty(value = "业务类型", index = 2, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_oper_type") private Integer businessType; @@ -71,7 +71,7 @@ public class SysOperLogVo implements Serializable { /** * 操作类别(0其它 1后台用户 2手机端用户) */ - @ExcelProperty(value = "操作类别", converter = ExcelDictConvert.class) + @ExcelProperty(value = "操作类别", index = 5, converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=其它,1=后台用户,2=手机端用户") private Integer operatorType; @@ -120,7 +120,7 @@ public class SysOperLogVo implements Serializable { /** * 操作状态(0正常 1异常) */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", index = 13, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_common_status") private Integer status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysPostVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysPostVo.java index 3e6c6a84..3185423a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysPostVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysPostVo.java @@ -54,7 +54,7 @@ public class SysPostVo implements Serializable { /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", index = 4, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysRoleVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysRoleVo.java index 1e5cd9ee..015a0436 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysRoleVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysRoleVo.java @@ -53,7 +53,7 @@ public class SysRoleVo implements Serializable { /** * 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限) */ - @ExcelProperty(value = "数据范围", converter = ExcelDictConvert.class) + @ExcelProperty(value = "数据范围", index = 4, converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限") private String dataScope; @@ -72,7 +72,7 @@ public class SysRoleVo implements Serializable { /** * 角色状态(0正常 1停用) */ - @ExcelProperty(value = "角色状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "角色状态", index = 7, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java index 070334b4..ae11a820 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantPackageVo.java @@ -58,7 +58,7 @@ public class SysTenantPackageVo implements Serializable { /** * 状态(0正常 1停用) */ - @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "状态", index = 5, converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=正常,1=停用") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java index 6a453150..49e03ea3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysTenantVo.java @@ -107,7 +107,7 @@ public class SysTenantVo implements Serializable { /** * 租户状态(0正常 1停用) */ - @ExcelProperty(value = "租户状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "租户状态", index = 13, converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=正常,1=停用") private String status; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java index 21b1efbe..b7fc4800 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/vo/SysUserExportVo.java @@ -59,14 +59,14 @@ public class SysUserExportVo implements Serializable { /** * 用户性别 */ - @ExcelProperty(value = "用户性别", converter = ExcelDictConvert.class) + @ExcelProperty(value = "用户性别", index = 6, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_user_sex") private String sex; /** * 帐号状态(0正常 1停用) */ - @ExcelProperty(value = "帐号状态", converter = ExcelDictConvert.class) + @ExcelProperty(value = "帐号状态", index = 7, converter = ExcelDictConvert.class) @ExcelDictFormat(dictType = "sys_normal_disable") private String status;