最新代码

This commit is contained in:
admin
2024-04-19 17:20:40 +08:00
parent e4032a0183
commit 993f975edd
82 changed files with 2618 additions and 248 deletions

View File

@@ -2,6 +2,7 @@ package com.starry.generator.utils;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.starry.common.utils.StringUtils;
@@ -48,7 +49,7 @@ public class VelocityUtils {
VelocityContext velocityContext = new VelocityContext();
velocityContext.put("tplCategory", genTableEntity.getTplCategory());
velocityContext.put("tableName", genTableEntity.getTableName());
velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】");
velocityContext.put("functionName", StrUtil.isNotBlank(functionName) ? functionName : "【请填写功能名称】");
velocityContext.put("ClassName", genTableEntity.getClassName());
// 首字母小写
velocityContext.put("className", StringUtils.uncapitalize(genTableEntity.getClassName()));
@@ -148,7 +149,7 @@ public class VelocityUtils {
*/
public static void addDicts(Set<String> dicts, List<GenTableColumnEntity> columns) {
for (GenTableColumnEntity column : columns) {
if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny(column.getHtmlType(), new String[]{GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX})) {
if (!column.isSuperColumn() && StrUtil.isNotBlank(column.getDictType()) && StringUtils.equalsAny(column.getHtmlType(), new String[]{GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX})) {
dicts.add("'" + column.getDictType() + "'");
}
}
@@ -204,7 +205,7 @@ public class VelocityUtils {
* @return 上级菜单ID字段
*/
public static String getParentMenuId(JSONObject paramsObj) {
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) && StringUtils.isNotEmpty(paramsObj.getString(GenConstants.PARENT_MENU_ID))) {
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID) && StrUtil.isNotBlank(paramsObj.getString(GenConstants.PARENT_MENU_ID))) {
return paramsObj.getString(GenConstants.PARENT_MENU_ID);
}
return DEFAULT_PARENT_MENU_ID;