mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
add 新增 StringUtils splitTo 与 splitList 方法 优化业务代码
This commit is contained in:
@ -212,7 +212,7 @@ public class GenTableColumn extends BaseEntity {
|
||||
if (StringUtils.isNotEmpty(value)) {
|
||||
Object startStr = value.subSequence(0, 1);
|
||||
String endStr = value.substring(1);
|
||||
sb.append("").append(startStr).append("=").append(endStr).append(",");
|
||||
sb.append(StringUtils.EMPTY).append(startStr).append("=").append(endStr).append(StringUtils.SEPARATOR);
|
||||
}
|
||||
}
|
||||
return sb.deleteCharAt(sb.length() - 1).toString();
|
||||
|
@ -58,7 +58,7 @@ public class GenUtils {
|
||||
column.setHtmlType(GenConstants.HTML_INPUT);
|
||||
|
||||
// 如果是浮点型 统一用BigDecimal
|
||||
String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ",");
|
||||
String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), StringUtils.SEPARATOR);
|
||||
if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0) {
|
||||
column.setJavaType(GenConstants.TYPE_BIGDECIMAL);
|
||||
}
|
||||
@ -167,7 +167,7 @@ public class GenUtils {
|
||||
boolean autoRemovePre = GenConfig.getAutoRemovePre();
|
||||
String tablePrefix = GenConfig.getTablePrefix();
|
||||
if (autoRemovePre && StringUtils.isNotEmpty(tablePrefix)) {
|
||||
String[] searchList = StringUtils.split(tablePrefix, ",");
|
||||
String[] searchList = StringUtils.split(tablePrefix, StringUtils.SEPARATOR);
|
||||
tableName = replaceFirst(tableName, searchList);
|
||||
}
|
||||
return StringUtils.convertToCamelCase(tableName);
|
||||
@ -184,7 +184,7 @@ public class GenUtils {
|
||||
String text = replacementm;
|
||||
for (String searchString : searchList) {
|
||||
if (replacementm.startsWith(searchString)) {
|
||||
text = replacementm.replaceFirst(searchString, "");
|
||||
text = replacementm.replaceFirst(searchString, StringUtils.EMPTY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ public class VelocityUtils {
|
||||
public static HashSet<String> getImportList(GenTable genTable) {
|
||||
List<GenTableColumn> columns = genTable.getColumns();
|
||||
GenTable subGenTable = genTable.getSubTable();
|
||||
HashSet<String> importList = new HashSet<String>();
|
||||
HashSet<String> importList = new HashSet<>();
|
||||
if (ObjectUtil.isNotNull(subGenTable)) {
|
||||
importList.add("java.util.List");
|
||||
}
|
||||
|
Reference in New Issue
Block a user