From 941bf5179e659f5038e1d4f4c430e1d730ad6752 Mon Sep 17 00:00:00 2001 From: caihaohan Date: Tue, 6 Aug 2024 20:19:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=2087541=20=E5=A4=96=E6=9D=A5=E6=A0=87?= =?UTF-8?q?=E5=87=86=E6=B3=95=E8=A7=84=E6=96=87=E6=9C=AC=E5=BA=93--?= =?UTF-8?q?=E5=AF=BC=E5=85=A5--=E5=A4=9A=E5=B1=82=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9/=E5=A4=9A=E4=B8=AAexcel=E6=96=87=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=AD=E5=BB=BA=E8=AE=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jero/common/api/vo/ResultCommon.java | 5 +++++ .../laws/common/service/impl/LawsCommonServiceImpl.java | 6 +++--- .../src/main/resources/i18n/messages.properties | 2 ++ .../src/main/resources/i18n/messages_en.properties | 2 ++ .../src/main/resources/i18n/messages_zh.properties | 2 ++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java b/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java index ea5c2e5d..2d07c3a4 100644 --- a/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java +++ b/laws-base/laws-base-core/src/main/java/com/jero/common/api/vo/ResultCommon.java @@ -207,4 +207,9 @@ public class ResultCommon { public static final String FILE_EMPTY_IMPORT_ERROR = "file.empty.import.error"; // 行大小太大 public static final String ROW_SIZE_TOO_LARGE = "row.size.too.large"; + + public static final String CAN_NOT_FIND_TEMPLATE_FILE = "can_not_find_template_file"; + + public static final String CAN_NOT_FIND_FIELD = "can_not_find_field"; + } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java index 772de652..78129148 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java @@ -1743,7 +1743,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { // 检查Excel的文件名 if (!excelName.contains("企业标准法规导入模板.xls") && !excelName.contains("xlsm")) { FileUnZip.deleteDir(saveDirectory); - throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR)); + throw new JeroBootException(MessageUtils.getMessage(ResultCommon.CAN_NOT_FIND_TEMPLATE_FILE, "企业标准法规导入模板")); } moduleCode = TableNameEnum.ENTERPRISE_STANDARDS.getValue(); } @@ -1751,7 +1751,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { // 检查Excel的文件名 if (!excelName.contains("外来标准法规导入模板.xls") && !excelName.contains("xlsm")) { FileUnZip.deleteDir(saveDirectory); - throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR)); + throw new JeroBootException(MessageUtils.getMessage(ResultCommon.CAN_NOT_FIND_TEMPLATE_FILE, "外来标准法规导入模板")); } moduleCode = TableNameEnum.DOMESTIC_REGULATIONS.getValue(); } @@ -1801,7 +1801,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { if (tag == null && !cell.toString().equals("监察内容")) { FileUnZip.deleteDir(saveDirectory); log.error("找不到" + cell + "对应的字段"); - throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR)); + throw new JeroBootException(MessageUtils.getMessage(ResultCommon.CAN_NOT_FIND_FIELD, cell.toString())); } else { headerList.add(tag); } diff --git a/laws-single-startup/src/main/resources/i18n/messages.properties b/laws-single-startup/src/main/resources/i18n/messages.properties index d0f767bf..6d0324de 100644 --- a/laws-single-startup/src/main/resources/i18n/messages.properties +++ b/laws-single-startup/src/main/resources/i18n/messages.properties @@ -84,3 +84,5 @@ split.import.template.error=\u5206\u89E3\u5355\u4E0A\u4F20\u6A21\u677F\u9519\u8B model.import.template.error=\u8F66\u578B\u9879\u76EE\u6587\u4EF6\u4E0A\u4F20\u6A21\u677F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5 model.import.data.error=\u8F66\u578B\u9879\u76EE\u6587\u4EF6\u4E0A\u4F20\u6570\u636E\u9519\u8BEF\u3002{0} file.empty.import.error=\u6587\u4EF6\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5 +can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u6587\u4EF6 +can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5 \ No newline at end of file diff --git a/laws-single-startup/src/main/resources/i18n/messages_en.properties b/laws-single-startup/src/main/resources/i18n/messages_en.properties index acbd0250..9e348ece 100644 --- a/laws-single-startup/src/main/resources/i18n/messages_en.properties +++ b/laws-single-startup/src/main/resources/i18n/messages_en.properties @@ -101,3 +101,5 @@ model.import.template.error=Model import template error model.import.data.error=Model import data error.{0} file.empty.import.error=The file is empty, please upload again row.size.too.large=Row size too large +can_not_find_template_file=Can not find template file name {0} +can_not_find_field=Can not find field {0} \ No newline at end of file diff --git a/laws-single-startup/src/main/resources/i18n/messages_zh.properties b/laws-single-startup/src/main/resources/i18n/messages_zh.properties index fd89485e..a4f8bcee 100644 --- a/laws-single-startup/src/main/resources/i18n/messages_zh.properties +++ b/laws-single-startup/src/main/resources/i18n/messages_zh.properties @@ -100,3 +100,5 @@ model.import.template.error=\u8F66\u578B\u9879\u76EE\u6587\u4EF6\u4E0A\u4F20\u6A model.import.data.error=\u8F66\u578B\u9879\u76EE\u6587\u4EF6\u4E0A\u4F20\u6570\u636E\u9519\u8BEF\u3002{0} file.empty.import.error=\u6587\u4EF6\u4E3A\u7A7A\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5 row.size.too.large=\u884C\u5927\u5C0F\u592A\u5927 +can_not_find_template_file=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u6A21\u677F\u6587\u4EF6 +can_not_find_field=\u627E\u4E0D\u5230\u540D\u4E3A{0}\u7684\u5B57\u6BB5 \ No newline at end of file