!863 fix(generator): 优化代码生成器模板和逻辑

* fix(generator): 优化代码生成器模板和逻辑
This commit is contained in:
专业坑队
2026-06-24 09:15:22 +00:00
committed by 疯狂的狮子Li
parent 612a965c26
commit c1e344be0e
2 changed files with 11 additions and 5 deletions
@@ -168,6 +168,7 @@ public class TemplateEngineUtils {
boolean needDigit = false;
boolean needDateField = false;
boolean needSwitchField = false;
boolean needParseTime = false;
String firstTreeListField = StringUtils.EMPTY;
for (GenTableColumn column : genTable.getColumns()) {
boolean writable = column.isInsert() || column.isEdit();
@@ -183,6 +184,7 @@ public class TemplateEngineUtils {
needDigit = needDigit || writable && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_INPUT_NUMBER);
needDateField = needDateField || writable && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_DATETIME);
needSwitchField = needSwitchField || (writable || column.isList()) && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_SWITCH);
needParseTime = needParseTime || column.isList() && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_DATETIME);
if (StringUtils.isBlank(firstTreeListField) && column.isList()) {
firstTreeListField = column.getJavaField();
}
@@ -202,6 +204,7 @@ public class TemplateEngineUtils {
context.put("needDigit", needDigit);
context.put("needDateField", needDateField);
context.put("needSwitchField", needSwitchField);
context.put("needParseTime", needParseTime);
context.put("firstTreeListField", firstTreeListField);
}