|
@@ -37,8 +37,6 @@ public class GenUtils {
|
|
|
public static void initColumnField(GenTableColumn column, GenTable table) {
|
|
|
String dataType = getDbType(column.getColumnType());
|
|
|
String columnName = column.getColumnName();
|
|
|
- column.setTableId(table.getTableId());
|
|
|
- column.setCreateBy(table.getCreateBy());
|
|
|
// 设置java字段名
|
|
|
column.setJavaField(StringUtils.toCamelCase(columnName));
|
|
|
// 设置默认类型
|
|
@@ -55,20 +53,9 @@ public class GenUtils {
|
|
|
column.setHtmlType(GenConstants.HTML_DATETIME);
|
|
|
} else if (arraysContains(GenConstants.COLUMNTYPE_NUMBER, dataType)) {
|
|
|
column.setHtmlType(GenConstants.HTML_INPUT);
|
|
|
-
|
|
|
- // 如果是浮点型 统一用BigDecimal
|
|
|
- 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);
|
|
|
- }
|
|
|
- // 如果是整形
|
|
|
- else if (str != null && str.length == 1 && Integer.parseInt(str[0]) <= 10) {
|
|
|
- column.setJavaType(GenConstants.TYPE_INTEGER);
|
|
|
- }
|
|
|
- // 长整形
|
|
|
- else {
|
|
|
- column.setJavaType(GenConstants.TYPE_LONG);
|
|
|
- }
|
|
|
+ // 数据库的数字字段与java不匹配 且很多数据库的数字字段很模糊 例如oracle只有number没有细分
|
|
|
+ // 所以默认数字类型全为Long可在界面上自行编辑想要的类型 有什么特殊需求也可以在这里特殊处理
|
|
|
+ column.setJavaType(GenConstants.TYPE_LONG);
|
|
|
}
|
|
|
|
|
|
// BO对象 默认插入勾选
|
|
@@ -79,10 +66,6 @@ public class GenUtils {
|
|
|
if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) {
|
|
|
column.setIsEdit(GenConstants.REQUIRE);
|
|
|
}
|
|
|
- // BO对象 默认是否必填勾选
|
|
|
- if (!arraysContains(GenConstants.COLUMNNAME_NOT_EDIT, columnName)) {
|
|
|
- column.setIsRequired(GenConstants.REQUIRE);
|
|
|
- }
|
|
|
// VO对象 默认返回勾选
|
|
|
if (!arraysContains(GenConstants.COLUMNNAME_NOT_LIST, columnName)) {
|
|
|
column.setIsList(GenConstants.REQUIRE);
|