后面显示编号的,去掉括号前的空格

This commit is contained in:
thinkgem
2024-04-19 19:03:45 +08:00
parent db5778a833
commit c62f575d10

View File

@@ -403,13 +403,13 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
* false or null不显示编码name
* @param code 编码
* @param name 名称
* @return
* @return
*/
public static String getTreeNodeName(String isShowCode, String code, String name) {
if ("true".equals(isShowCode) || "1".equals(isShowCode)) {
return "(" + code + ") " + StringUtils.replace(name, SPACE, EMPTY);
} else if ("2".equals(isShowCode)) {
return name + " (" + code + ")";
return defaultIfBlank(name, EMPTY) + "(" + code + ")";
} else {
return name;
}