From c57019ab9093591acd755f9a9484fd946745f6d9 Mon Sep 17 00:00:00 2001 From: judy <278197488@qq.com> Date: Thu, 15 Aug 2024 11:30:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=8A=E5=8D=97=E8=AF=AD=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/shkj/common/utils/MessageUtils.java | 2 +- .../shkj/system/service/impl/SysDictTypeServiceImpl.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/shkj-common/src/main/java/com/shkj/common/utils/MessageUtils.java b/shkj-common/src/main/java/com/shkj/common/utils/MessageUtils.java index ac66701..168bb5d 100644 --- a/shkj-common/src/main/java/com/shkj/common/utils/MessageUtils.java +++ b/shkj-common/src/main/java/com/shkj/common/utils/MessageUtils.java @@ -31,7 +31,7 @@ public class MessageUtils { return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); } catch (Exception e) { // e.printStackTrace(); - log.error("国际化出错了 = {}", e.getMessage()); + // log.error("国际化出错了 = {}", e.getMessage()); } return code; } diff --git a/shkj-system/src/main/java/com/shkj/system/service/impl/SysDictTypeServiceImpl.java b/shkj-system/src/main/java/com/shkj/system/service/impl/SysDictTypeServiceImpl.java index fd3fd14..67058b0 100644 --- a/shkj-system/src/main/java/com/shkj/system/service/impl/SysDictTypeServiceImpl.java +++ b/shkj-system/src/main/java/com/shkj/system/service/impl/SysDictTypeServiceImpl.java @@ -78,10 +78,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService { public List selectDictDataByType(String dictType) { List dictDatas = DictUtils.getDictCache(dictType); - for (SysDictData dictData : dictDatas) { - dictData.setDictLabel(MessageUtils.message(dictData.getDictLabel())); - } + if (StringUtils.isNotEmpty(dictDatas)) { + for (SysDictData dictData : dictDatas) { + dictData.setDictLabel(MessageUtils.message(dictData.getDictLabel())); + } return dictDatas; } dictDatas = dictDataMapper.selectDictDataByType(dictType, SecurityUtils.getCurrentBranchId());