Skip to content

Commit

Permalink
fix: 修复字典值使用文本分隔转换数组结果时,字典值无分隔符导致无数据问题 tag v1.4.6.1 修复版
Browse files Browse the repository at this point in the history
  • Loading branch information
houkunlin committed Dec 13, 2021
1 parent a7fb0e5 commit f789d33
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group = 'com.houkunlin'
version = '1.4.6'
version = '1.4.6.1'
sourceCompatibility = '1.8'
description = """
系统数据字典自动翻译成字典文本。可集合系统数据库中存储的用户数据字典,也可使用枚举做系统数据字典,主要用在返回数据给前端时自动把字典值翻译成字典文本信息;
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更改日志

## 1.4.6.1 版本

- fix: 修复字典值使用文本分隔转换数组结果时,字典值无分隔符导致无数据问题

## 1.4.6 版本

- feat: 增加树形结构数据的字典文本转换支持
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,15 @@ private Object processArrayField(final Object[] fieldValues) {
*/
private Object processStringField(final String fieldValueString) {
final String splitStr = array.split();
if (fieldValueString.contains(splitStr)) {
final List<String> texts = new ArrayList<>();
final String[] splitValue = fieldValueString.split(splitStr);
for (final Object o : splitValue) {
final String dictValueText = obtainDictValueText(String.valueOf(o));
if (!array.ignoreNull() || StringUtils.hasText(dictValueText)) {
texts.add(dictValueText);
}
final List<String> texts = new ArrayList<>();
final String[] splitValue = fieldValueString.split(splitStr);
for (final Object o : splitValue) {
final String dictValueText = obtainDictValueText(String.valueOf(o));
if (!array.ignoreNull() || StringUtils.hasText(dictValueText)) {
texts.add(dictValueText);
}
return obtainResult(texts);
}
return obtainResult(Collections.emptyList());
return obtainResult(texts);
}

/**
Expand Down

0 comments on commit f789d33

Please sign in to comment.