mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 移除掉 StringUtils 语义不明确的api方法 使用特定工具替换
This commit is contained in:
@ -3,6 +3,7 @@ package com.ruoyi.generator.service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
@ -281,7 +282,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
Map<String, GenTableColumn> tableColumnMap = tableColumns.stream().collect(Collectors.toMap(GenTableColumn::getColumnName, Function.identity()));
|
||||
|
||||
List<GenTableColumn> dbTableColumns = genTableColumnMapper.selectDbTableColumnsByName(tableName);
|
||||
if (StringUtils.isEmpty(dbTableColumns)) {
|
||||
if (CollUtil.isEmpty(dbTableColumns)) {
|
||||
throw new ServiceException("同步数据失败,原表结构不存在");
|
||||
}
|
||||
List<String> dbTableColumnNames = dbTableColumns.stream().map(GenTableColumn::getColumnName).collect(Collectors.toList());
|
||||
@ -373,11 +374,11 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
public void validateEdit(GenTable genTable) {
|
||||
if (GenConstants.TPL_TREE.equals(genTable.getTplCategory())) {
|
||||
Map<String, Object> paramsObj = genTable.getParams();
|
||||
if (StringUtils.isEmpty(paramsObj.get(GenConstants.TREE_CODE))) {
|
||||
if (ObjectUtil.isEmpty(paramsObj.get(GenConstants.TREE_CODE))) {
|
||||
throw new ServiceException("树编码字段不能为空");
|
||||
} else if (StringUtils.isEmpty(paramsObj.get(GenConstants.TREE_PARENT_CODE))) {
|
||||
} else if (ObjectUtil.isEmpty(paramsObj.get(GenConstants.TREE_PARENT_CODE))) {
|
||||
throw new ServiceException("树父编码字段不能为空");
|
||||
} else if (StringUtils.isEmpty(paramsObj.get(GenConstants.TREE_NAME))) {
|
||||
} else if (ObjectUtil.isEmpty(paramsObj.get(GenConstants.TREE_NAME))) {
|
||||
throw new ServiceException("树名称字段不能为空");
|
||||
} else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory())) {
|
||||
if (StringUtils.isEmpty(genTable.getSubTableName())) {
|
||||
@ -401,7 +402,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNull(table.getPkColumn())) {
|
||||
if (ObjectUtil.isNull(table.getPkColumn())) {
|
||||
table.setPkColumn(table.getColumns().get(0));
|
||||
}
|
||||
if (GenConstants.TPL_SUB.equals(table.getTplCategory())) {
|
||||
@ -411,7 +412,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNull(table.getSubTable().getPkColumn())) {
|
||||
if (ObjectUtil.isNull(table.getSubTable().getPkColumn())) {
|
||||
table.getSubTable().setPkColumn(table.getSubTable().getColumns().get(0));
|
||||
}
|
||||
}
|
||||
@ -436,7 +437,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
*/
|
||||
public void setTableFromOptions(GenTable genTable) {
|
||||
Map<String, Object> paramsObj = JsonUtils.parseMap(genTable.getOptions());
|
||||
if (StringUtils.isNotNull(paramsObj)) {
|
||||
if (ObjectUtil.isNotNull(paramsObj)) {
|
||||
String treeCode = Convert.toStr(paramsObj.get(GenConstants.TREE_CODE));
|
||||
String treeParentCode = Convert.toStr(paramsObj.get(GenConstants.TREE_PARENT_CODE));
|
||||
String treeName = Convert.toStr(paramsObj.get(GenConstants.TREE_NAME));
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.generator.util;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.constant.GenConstants;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.JsonUtils;
|
||||
@ -219,7 +221,7 @@ public class VelocityUtils {
|
||||
List<GenTableColumn> columns = genTable.getColumns();
|
||||
GenTable subGenTable = genTable.getSubTable();
|
||||
HashSet<String> importList = new HashSet<String>();
|
||||
if (StringUtils.isNotNull(subGenTable)) {
|
||||
if (ObjectUtil.isNotNull(subGenTable)) {
|
||||
importList.add("java.util.List");
|
||||
}
|
||||
for (GenTableColumn column : columns) {
|
||||
@ -270,7 +272,7 @@ public class VelocityUtils {
|
||||
* @return 上级菜单ID字段
|
||||
*/
|
||||
public static String getParentMenuId(Map<String, Object> paramsObj) {
|
||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
|
||||
if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
|
||||
&& StringUtils.isNotEmpty(Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID)))) {
|
||||
return Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID));
|
||||
}
|
||||
@ -284,7 +286,7 @@ public class VelocityUtils {
|
||||
* @return 树编码
|
||||
*/
|
||||
public static String getTreecode(Map<String, Object> paramsObj) {
|
||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) {
|
||||
if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_CODE)) {
|
||||
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_CODE)));
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
@ -297,7 +299,7 @@ public class VelocityUtils {
|
||||
* @return 树父编码
|
||||
*/
|
||||
public static String getTreeParentCode(Map<String, Object> paramsObj) {
|
||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
|
||||
if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_PARENT_CODE)) {
|
||||
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_PARENT_CODE)));
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
@ -310,7 +312,7 @@ public class VelocityUtils {
|
||||
* @return 树名称
|
||||
*/
|
||||
public static String getTreeName(Map<String, Object> paramsObj) {
|
||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) {
|
||||
if (CollUtil.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.TREE_NAME)) {
|
||||
return StringUtils.toCamelCase(Convert.toStr(paramsObj.get(GenConstants.TREE_NAME)));
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
|
Reference in New Issue
Block a user