mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-03-13 20:53:42 +08:00
解决冲突
This commit is contained in:
@@ -95,6 +95,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
log.warn("Schema不存在,表名: {}", tableName);
|
||||
return;
|
||||
}
|
||||
|
||||
// 查询Schema字段信息
|
||||
List<SchemaFieldVo> fields = schemaFieldService.queryListByTableName(tableName);
|
||||
if (CollUtil.isEmpty(fields)) {
|
||||
@@ -220,16 +221,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
table.put("sub", false);
|
||||
table.put("tree", false);
|
||||
|
||||
// 添加isSuperColumn方法
|
||||
table.put("isSuperColumn", new Object() {
|
||||
public boolean isSuperColumn(String javaField) {
|
||||
// 定义超类字段(BaseEntity中的字段)
|
||||
return "createBy".equals(javaField) || "createTime".equals(javaField)
|
||||
|| "updateBy".equals(javaField) || "updateTime".equals(javaField)
|
||||
|| "remark".equals(javaField) || "tenantId".equals(javaField);
|
||||
}
|
||||
});
|
||||
|
||||
context.put("table", table);
|
||||
|
||||
// 处理字段信息
|
||||
@@ -439,16 +430,17 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
return "String";
|
||||
}
|
||||
String type = dbType.toLowerCase();
|
||||
if (type.contains("int") || type.contains("tinyint") || type.contains("smallint")) {
|
||||
if (StrUtil.equalsAny(type, "int", "tinyint")) {
|
||||
return "Integer";
|
||||
} else if (type.contains("bigint")) {
|
||||
} else if (StrUtil.equalsAny(type, "bigint")) {
|
||||
return "Long";
|
||||
} else if (type.contains("decimal") || type.contains("numeric") || type.contains("float") || type.contains(
|
||||
"double")) {
|
||||
} else if (StrUtil.equalsAny(type, "decimal", "numeric", "float", "double")) {
|
||||
return "BigDecimal";
|
||||
} else if (type.contains("date") || type.contains("time")) {
|
||||
return "Date";
|
||||
} else if (type.contains("bit") || type.contains("boolean")) {
|
||||
} else if (StrUtil.equalsAny(type, "date")) {
|
||||
return "LocalDate";
|
||||
} else if (StrUtil.equalsAny(type, "datetime", "timestamp")) {
|
||||
return "LocalDateTime";
|
||||
} else if (StrUtil.equalsAny(type, "bit", "boolean")) {
|
||||
return "Boolean";
|
||||
} else {
|
||||
return "String";
|
||||
|
||||
@@ -211,7 +211,6 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
|
||||
result.put("tableName", schema.getTableName());
|
||||
result.put("tableComment", schema.getComment());
|
||||
result.put("className", toCamelCase(schema.getTableName(), true));
|
||||
// result.put("className", StrUtil.toCamelCase(schema.getTableName()));
|
||||
result.put("tableCamelName", StrUtil.toCamelCase(schema.getTableName()));
|
||||
result.put("functionName", schema.getName());
|
||||
result.put("schemaName", schema.getName());
|
||||
@@ -363,16 +362,15 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
|
||||
}
|
||||
|
||||
String type = dbType.toLowerCase();
|
||||
if (type.contains("int") || type.contains("tinyint") || type.contains("smallint")) {
|
||||
if (StrUtil.equalsAny(type, "int", "tinyint", "smallint")) {
|
||||
return "Integer";
|
||||
} else if (type.contains("bigint")) {
|
||||
} else if (StrUtil.equalsAny(type, "bigint")) {
|
||||
return "Long";
|
||||
} else if (type.contains("decimal") || type.contains("numeric") || type.contains("float") || type.contains(
|
||||
"double")) {
|
||||
} else if (StrUtil.equalsAny(type, "decimal", "numeric", "float", "double")) {
|
||||
return "BigDecimal";
|
||||
} else if (type.contains("date") || type.contains("time")) {
|
||||
} else if (StrUtil.equalsAny(type, "date", "datetime","timestamp")) {
|
||||
return "Date";
|
||||
} else if (type.contains("bit") || type.contains("boolean")) {
|
||||
} else if (StrUtil.equalsAny(type, "bit", "boolean")) {
|
||||
return "Boolean";
|
||||
} else {
|
||||
return "String";
|
||||
|
||||
@@ -25,11 +25,11 @@ import org.ruoyi.common.core.validate.EditGroup;
|
||||
public class ${ClassName}Bo implements Serializable {
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if(!$table.isSuperColumn($column.javaField) && ($column.isPk || $column.query || $column.insert || $column.edit))
|
||||
#if($column.isPk || $column.query || $column.insert || $column.edit|| $column.required)
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
#if($column.insert && $column.edit)
|
||||
#if(($column.insert && $column.edit) || $column.required)
|
||||
#set($Group="AddGroup.class, EditGroup.class")
|
||||
#elseif($column.insert)
|
||||
#set($Group="AddGroup.class")
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
package ${packageName}.domain;
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if($column.javaField=='tenantId')
|
||||
#set($IsTenant=1)
|
||||
#end
|
||||
#end
|
||||
#if($IsTenant==1)
|
||||
import core.tenant.common.org.ruoyi.TenantEntity;
|
||||
#else
|
||||
#end
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
#foreach ($import in $importList)
|
||||
import ${import};
|
||||
#end
|
||||
|
||||
import org.ruoyi.core.domain.BaseEntity;
|
||||
#foreach ($import in $importList)
|
||||
import ${import};
|
||||
#end
|
||||
|
||||
/**
|
||||
* ${functionName}对象 ${tableName}
|
||||
@@ -24,15 +12,9 @@ import org.ruoyi.core.domain.BaseEntity;
|
||||
* @author ${author}
|
||||
* @date ${datetime}
|
||||
*/
|
||||
#if($IsTenant==1)
|
||||
#set($Entity="TenantEntity")
|
||||
#else
|
||||
#set($Entity="BaseEntity")
|
||||
#end
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("${tableName}")
|
||||
public class ${ClassName} extends ${Entity} {
|
||||
public class ${ClassName} implements Serializable {
|
||||
|
||||
|
||||
#foreach ($column in $columns)
|
||||
|
||||
Reference in New Issue
Block a user