fix: 翻译判断数据字段不为空的时候查表

This commit is contained in:
2024-07-31 10:12:42 +08:00
parent 3dfd9c8bf3
commit 0a17c26e84
@@ -258,10 +258,13 @@ public class TranslationAspect {
if (k.trim().length() == 0) { if (k.trim().length() == 0) {
continue; //跳过循环 continue; //跳过循环
} }
if (!StringUtils.isEmpty(table)) { if (!StringUtils.isEmpty(table) && StrUtil.isNotBlank(text)) {
tmpValue = commonAPI.queryTableDictTextByKey(table, text, code, k.trim()); tmpValue = commonAPI.queryTableDictTextByKey(table, text, code, k.trim());
} else { } else {
List<SysDictItemCore> listNew = listDict.stream().filter(o -> Objects.equals(o.getDictCode(), code) && Objects.equals(o.getItemValue(), k.trim())).collect(Collectors.toList()); List<SysDictItemCore> listNew = listDict.stream()
.filter(o -> Objects.equals(o.getDictCode(), code) &&
Objects.equals(o.getItemValue(), k.trim()))
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(listNew)) { if (!CollectionUtils.isEmpty(listNew)) {
tmpValue = listNew.get(0).getItemText(); tmpValue = listNew.get(0).getItemText();
} }