From 4d72fb4289aef2a1b34677ac598e88f4f98e930e Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 10 Oct 2022 09:22:37 +0800 Subject: [PATCH] R isError and isSuccess static --- .../java/com/ruoyi/common/core/domain/R.java | 8 ++++---- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 20 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java index d877460..ef15802 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java @@ -103,13 +103,13 @@ public class R implements Serializable this.data = data; } - public Boolean isError() + public static Boolean isError(R ret) { - return !isSuccess(); + return !isSuccess(ret); } - public Boolean isSuccess() + public static Boolean isSuccess(R ret) { - return R.SUCCESS == getCode(); + return R.SUCCESS == ret.getCode(); } } 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 d687641..6137c86 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 @@ -694,17 +694,19 @@ public class ExcelUtil // 得到导出对象. T vo = (T) list.get(i); Collection subList = null; - if (isSubListValue(vo)) - { - subList = getListCellValue(vo); - subMergedLastRowNum = subMergedLastRowNum + subList.size(); - } - else + if (isSubList()) { - subMergedFirstRowNum++; - subMergedLastRowNum++; + if (isSubListValue(vo)) + { + subList = getListCellValue(vo); + subMergedLastRowNum = subMergedLastRowNum + subList.size(); + } + else + { + subMergedFirstRowNum++; + subMergedLastRowNum++; + } } - int column = 0; for (Object[] os : fields) {