代码生成选择主子表关联元素必填

pull/256/head
RuoYi 2021-01-11 11:36:29 +08:00
parent 033017c0ab
commit bf6ec64f15
4 changed files with 6 additions and 20 deletions

View File

@ -59,7 +59,7 @@ public class GenUtils
{
column.setHtmlType(GenConstants.HTML_INPUT);
// 如果是浮点型
// 如果是浮点型 统一用BigDecimal
String[] str = StringUtils.split(StringUtils.substringBetween(column.getColumnType(), "(", ")"), ",");
if (str != null && str.length == 2 && Integer.parseInt(str[1]) > 0)
{
@ -250,20 +250,4 @@ public class GenUtils
return 0;
}
}
/**
*
*
* @param length
* @return
*/
public static String[] emptyList(int length)
{
String[] values = new String[length];
for (int i = 0; i < length; i++)
{
values[i] = StringUtils.EMPTY;
}
return values;
}
}

View File

@ -7,7 +7,7 @@ import com.ruoyi.common.constant.Constants;
/**
* VelocityEngine
*
* @author RuoYi
* @author ruoyi
*/
public class VelocityInitializer
{

View File

@ -160,8 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<set>
<if test="tableName != null">table_name = #{tableName},</if>
<if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
<if test="subTableName != null and subTableName != ''">sub_table_name = #{subTableName},</if>
<if test="subTableFkName != null and subTableFkName != ''">sub_table_fk_name = #{subTableFkName},</if>
<if test="subTableName != null">sub_table_name = #{subTableName},</if>
<if test="subTableFkName != null">sub_table_fk_name = #{subTableFkName},</if>
<if test="className != null and className != ''">class_name = #{className},</if>
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
<if test="genType != null and genType != ''">gen_type = #{genType},</if>

View File

@ -494,6 +494,8 @@
$("#treeCode").select2("val", [""]);
$("#treeParentCode").select2("val", [""]);
$("#treeName").select2("val", [""]);
$("#subTableName").attr("required", "true");
$("#subTableFkName").attr("required", "true");
$("#otherInfo").addClass("hidden");
}
}