Commit e1a38a3b by 若依 Committed by Gitee

!127 自动生成代码 Tree型 add/edit 页面生成不正确

Merge pull request !127 from Dulk/fix-genTree
parents e4984b85 c920d3ec
...@@ -18,6 +18,9 @@ public class TreeEntity extends BaseEntity ...@@ -18,6 +18,9 @@ public class TreeEntity extends BaseEntity
/** 显示顺序 */ /** 显示顺序 */
private Integer orderNum; private Integer orderNum;
/** 祖级列表 */
private String ancestors;
public String getParentName() public String getParentName()
{ {
return parentName; return parentName;
...@@ -47,4 +50,14 @@ public class TreeEntity extends BaseEntity ...@@ -47,4 +50,14 @@ public class TreeEntity extends BaseEntity
{ {
this.orderNum = orderNum; this.orderNum = orderNum;
} }
public String getAncestors()
{
return ancestors;
}
public void setAncestors(String ancestors)
{
this.ancestors = ancestors;
}
} }
\ No newline at end of file
...@@ -325,7 +325,22 @@ public class GenTableColumn extends BaseEntity ...@@ -325,7 +325,22 @@ public class GenTableColumn extends BaseEntity
public static boolean isSuperColumn(String javaField) public static boolean isSuperColumn(String javaField)
{ {
return StringUtils.equalsAnyIgnoreCase(javaField, "createBy", "createTime", "updateBy", "updateTime", "remark"); return StringUtils.equalsAnyIgnoreCase(javaField,
//BaseEntity
"createBy", "createTime", "updateBy", "updateTime", "remark",
//TreeEntity
"parentName", "parentId", "orderNum", "ancestors");
}
public boolean isUsableColumn()
{
return isUsableColumn(javaField);
}
public static boolean isUsableColumn(String javaField)
{
//isSuperColumn()中的名单用于避免生成多余Domain属性,若某些属性在生成页面时需要用到不能忽略,则放在此处白名单
return StringUtils.equalsAnyIgnoreCase(javaField, "parentId" , "orderNum");
} }
public String readConverterExp() public String readConverterExp()
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
<form class="form-horizontal m" id="form-${businessName}-add"> <form class="form-horizontal m" id="form-${businessName}-add">
#foreach($column in $columns) #foreach($column in $columns)
#set($field=$column.javaField) #set($field=$column.javaField)
#if($column.insert && !$column.superColumn && !$column.pk) #if($column.insert && !$column.pk)
#if(($column.usableColumn) || (!$column.superColumn))
#set($parentheseIndex=$column.columnComment.indexOf("(")) #set($parentheseIndex=$column.columnComment.indexOf("("))
#if($parentheseIndex != -1) #if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) #set($comment=$column.columnComment.substring(0, $parentheseIndex))
...@@ -102,6 +103,7 @@ ...@@ -102,6 +103,7 @@
#end #end
#end #end
#end #end
#end
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
<form class="form-horizontal m" id="form-${businessName}-edit" th:object="${${className}}"> <form class="form-horizontal m" id="form-${businessName}-edit" th:object="${${className}}">
<input name="${pkColumn.javaField}" th:field="*{${pkColumn.javaField}}" type="hidden"> <input name="${pkColumn.javaField}" th:field="*{${pkColumn.javaField}}" type="hidden">
#foreach($column in $columns) #foreach($column in $columns)
#if($column.edit && !$column.superColumn && !$column.pk) #if($column.edit && !$column.pk)
#if(($column.usableColumn) || (!$column.superColumn))
#set($parentheseIndex=$column.columnComment.indexOf("(")) #set($parentheseIndex=$column.columnComment.indexOf("("))
#if($parentheseIndex != -1) #if($parentheseIndex != -1)
#set($comment=$column.columnComment.substring(0, $parentheseIndex)) #set($comment=$column.columnComment.substring(0, $parentheseIndex))
...@@ -102,6 +103,7 @@ ...@@ -102,6 +103,7 @@
#end #end
#end #end
#end #end
#end
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment