【fix】修复循环引用的bug
【fix】修改stylePath属性的get、set类名
This commit is contained in:
+4
-4
@@ -20,18 +20,18 @@ public class CreateFileConfig {
|
||||
}
|
||||
|
||||
private void a(File var1) {
|
||||
this.a(var1);
|
||||
this.convertArrToList(var1);
|
||||
}
|
||||
|
||||
private void a(File... var1) {
|
||||
private void convertArrToList(File... var1) {
|
||||
this.c = Arrays.asList(var1);
|
||||
}
|
||||
|
||||
public String a() {
|
||||
public String getStylePath() {
|
||||
return this.stylePath;
|
||||
}
|
||||
|
||||
public void a(String var1) {
|
||||
public void setStylePath(String var1) {
|
||||
this.stylePath = var1;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ public class CodeGenerateOne extends BaseCodeGenerate implements IGenerate {
|
||||
}
|
||||
|
||||
CreateFileConfig var5 = new CreateFileConfig(var4);
|
||||
var5.a(stylePath);
|
||||
var5.setStylePath(stylePath);
|
||||
this.a(var5, var2, var3);
|
||||
log.info(" ----- jero-boot ---- generate code success =======> 表名:" + this.b.getTableName() + " ");
|
||||
return this.d;
|
||||
|
||||
+18
-18
@@ -22,7 +22,7 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
||||
private static String f;
|
||||
public static String a = "A";
|
||||
public static String b = "B";
|
||||
private MainTableVo g;
|
||||
private MainTableVo mainTableVo;
|
||||
private List<ColumnVo> h;
|
||||
private List<ColumnVo> i;
|
||||
private List<SubTableVo> j;
|
||||
@@ -30,11 +30,11 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
||||
|
||||
public CodeGenerateOneToMany(MainTableVo mainTableVo, List<SubTableVo> subTables) {
|
||||
this.j = subTables;
|
||||
this.g = mainTableVo;
|
||||
this.mainTableVo = mainTableVo;
|
||||
}
|
||||
|
||||
public CodeGenerateOneToMany(MainTableVo mainTableVo, List<ColumnVo> mainColums, List<ColumnVo> originalMainColumns, List<SubTableVo> subTables) {
|
||||
this.g = mainTableVo;
|
||||
this.mainTableVo = mainTableVo;
|
||||
this.h = mainColums;
|
||||
this.i = originalMainColumns;
|
||||
this.j = subTables;
|
||||
@@ -43,32 +43,32 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
||||
public Map<String, Object> a() throws Exception {
|
||||
HashMap var1 = new HashMap();
|
||||
var1.put("bussiPackage", com.jero.codegenerate.properties.CodeConfigProperties.packageName);
|
||||
var1.put("entityPackage", this.g.getEntityPackage());
|
||||
var1.put("entityName", this.g.getEntityName());
|
||||
var1.put("tableName", this.g.getTableName());
|
||||
var1.put("ftl_description", this.g.getFtlDescription());
|
||||
var1.put("entityPackage", this.mainTableVo.getEntityPackage());
|
||||
var1.put("entityName", this.mainTableVo.getEntityName());
|
||||
var1.put("tableName", this.mainTableVo.getTableName());
|
||||
var1.put("ftl_description", this.mainTableVo.getFtlDescription());
|
||||
var1.put("primaryKeyField", com.jero.codegenerate.properties.CodeConfigProperties.l);
|
||||
if (this.g.getFieldRequiredNum() == null) {
|
||||
this.g.setFieldRequiredNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.m) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.m) : -1);
|
||||
if (this.mainTableVo.getFieldRequiredNum() == null) {
|
||||
this.mainTableVo.setFieldRequiredNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.m) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.m) : -1);
|
||||
}
|
||||
|
||||
if (this.g.getSearchFieldNum() == null) {
|
||||
this.g.setSearchFieldNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.n) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.n) : -1);
|
||||
if (this.mainTableVo.getSearchFieldNum() == null) {
|
||||
this.mainTableVo.setSearchFieldNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.n) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.n) : -1);
|
||||
}
|
||||
|
||||
if (this.g.getFieldRowNum() == null) {
|
||||
this.g.setFieldRowNum(Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.p));
|
||||
if (this.mainTableVo.getFieldRowNum() == null) {
|
||||
this.mainTableVo.setFieldRowNum(Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.p));
|
||||
}
|
||||
|
||||
var1.put("tableVo", this.g);
|
||||
var1.put("tableVo", this.mainTableVo);
|
||||
|
||||
try {
|
||||
if (this.h == null || this.h.size() == 0) {
|
||||
this.h = DbReadTableUtil.a(this.g.getTableName());
|
||||
this.h = DbReadTableUtil.a(this.mainTableVo.getTableName());
|
||||
}
|
||||
|
||||
if (this.i == null || this.i.size() == 0) {
|
||||
this.i = DbReadTableUtil.b(this.g.getTableName());
|
||||
this.i = DbReadTableUtil.b(this.mainTableVo.getTableName());
|
||||
}
|
||||
|
||||
var1.put("columns", this.h);
|
||||
@@ -132,9 +132,9 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
||||
}
|
||||
|
||||
CreateFileConfig var5 = new CreateFileConfig(var4);
|
||||
var5.a(stylePath);
|
||||
var5.setStylePath(stylePath);
|
||||
this.a(var5, var2, var3);
|
||||
log.info("----- jero-boot ---- generate code success =======> 主表名:" + this.g.getTableName());
|
||||
log.info("----- jero-boot ---- generate code success =======> 主表名:" + this.mainTableVo.getTableName());
|
||||
return this.d;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -43,7 +43,7 @@ public class BaseCodeGenerate {
|
||||
if (var2 == null) {
|
||||
throw new IllegalStateException("'templateRootDir' must be not null");
|
||||
} else {
|
||||
log.info(" load template from templateRootDir = '" + var2.getAbsolutePath() + "',stylePath ='" + var4.a() + "', out GenerateRootDir:" + com.jero.codegenerate.properties.CodeConfigProperties.f);
|
||||
log.info(" load template from templateRootDir = '" + var2.getAbsolutePath() + "',stylePath ='" + var4.getStylePath() + "', out GenerateRootDir:" + com.jero.codegenerate.properties.CodeConfigProperties.f);
|
||||
List var5 = FileHelper.a(var2);
|
||||
log.debug("----srcFiles----size-----------" + var5.size());
|
||||
log.debug("----srcFiles----list------------" + var5.toString());
|
||||
@@ -63,7 +63,7 @@ public class BaseCodeGenerate {
|
||||
|
||||
try {
|
||||
log.debug("-------templateFile--" + var6);
|
||||
if (var5.a() != null && !"".equals(var5.a()) && !var6.replace(File.separator, ".").startsWith(var5.a())) {
|
||||
if (var5.getStylePath() != null && !"".equals(var5.getStylePath()) && !var6.replace(File.separator, ".").startsWith(var5.getStylePath())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ public class BaseCodeGenerate {
|
||||
|
||||
Configuration var10 = FreemarkerHelper.a(var2.b(), c, "/");
|
||||
var3 = FreemarkerHelper.a(var3, var0, var10);
|
||||
String var11 = var2.a();
|
||||
String var11 = var2.getStylePath();
|
||||
if (var11 != null && var11 != "") {
|
||||
var3 = var3.substring(var11.length() + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user