【fix】对方法和局部变量重新命名
This commit is contained in:
+3
-3
@@ -39,15 +39,15 @@ public class CodeGenerateOne extends BaseCodeGenerate implements IGenerate {
|
|||||||
var1.put("tableName", this.tableVo.getTableName());
|
var1.put("tableName", this.tableVo.getTableName());
|
||||||
var1.put("primaryKeyField", com.jero.codegenerate.properties.CodeConfigProperties.dbTableId);
|
var1.put("primaryKeyField", com.jero.codegenerate.properties.CodeConfigProperties.dbTableId);
|
||||||
if (this.tableVo.getFieldRequiredNum() == null) {
|
if (this.tableVo.getFieldRequiredNum() == null) {
|
||||||
this.tableVo.setFieldRequiredNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.m) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.m) : -1);
|
this.tableVo.setFieldRequiredNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.fieldRequiredNum) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.fieldRequiredNum) : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tableVo.getSearchFieldNum() == null) {
|
if (this.tableVo.getSearchFieldNum() == null) {
|
||||||
this.tableVo.setSearchFieldNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.n) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.n) : -1);
|
this.tableVo.setSearchFieldNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.pageSearchFieldNum) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.pageSearchFieldNum) : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tableVo.getFieldRowNum() == null) {
|
if (this.tableVo.getFieldRowNum() == null) {
|
||||||
this.tableVo.setFieldRowNum(Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.p));
|
this.tableVo.setFieldRowNum(Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.fieldRowNum));
|
||||||
}
|
}
|
||||||
|
|
||||||
var1.put("tableVo", this.tableVo);
|
var1.put("tableVo", this.tableVo);
|
||||||
|
|||||||
+18
-18
@@ -41,26 +41,26 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> a() throws Exception {
|
public Map<String, Object> a() throws Exception {
|
||||||
HashMap var1 = new HashMap();
|
HashMap hashMap = new HashMap();
|
||||||
var1.put("bussiPackage", com.jero.codegenerate.properties.CodeConfigProperties.packageName);
|
hashMap.put("bussiPackage", com.jero.codegenerate.properties.CodeConfigProperties.packageName);
|
||||||
var1.put("entityPackage", this.mainTableVo.getEntityPackage());
|
hashMap.put("entityPackage", this.mainTableVo.getEntityPackage());
|
||||||
var1.put("entityName", this.mainTableVo.getEntityName());
|
hashMap.put("entityName", this.mainTableVo.getEntityName());
|
||||||
var1.put("tableName", this.mainTableVo.getTableName());
|
hashMap.put("tableName", this.mainTableVo.getTableName());
|
||||||
var1.put("ftl_description", this.mainTableVo.getFtlDescription());
|
hashMap.put("ftl_description", this.mainTableVo.getFtlDescription());
|
||||||
var1.put("primaryKeyField", com.jero.codegenerate.properties.CodeConfigProperties.dbTableId);
|
hashMap.put("primaryKeyField", com.jero.codegenerate.properties.CodeConfigProperties.dbTableId);
|
||||||
if (this.mainTableVo.getFieldRequiredNum() == null) {
|
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);
|
this.mainTableVo.setFieldRequiredNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.fieldRequiredNum) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.fieldRequiredNum) : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mainTableVo.getSearchFieldNum() == null) {
|
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);
|
this.mainTableVo.setSearchFieldNum(StringUtils.isNotEmpty(com.jero.codegenerate.properties.CodeConfigProperties.pageSearchFieldNum) ? Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.pageSearchFieldNum) : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mainTableVo.getFieldRowNum() == null) {
|
if (this.mainTableVo.getFieldRowNum() == null) {
|
||||||
this.mainTableVo.setFieldRowNum(Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.p));
|
this.mainTableVo.setFieldRowNum(Integer.parseInt(com.jero.codegenerate.properties.CodeConfigProperties.fieldRowNum));
|
||||||
}
|
}
|
||||||
|
|
||||||
var1.put("tableVo", this.mainTableVo);
|
hashMap.put("tableVo", this.mainTableVo);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.mainColumns == null || this.mainColumns.size() == 0) {
|
if (this.mainColumns == null || this.mainColumns.size() == 0) {
|
||||||
@@ -71,14 +71,14 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
|||||||
this.originalMainColumns = DbReadTableUtil.listOriginalColumns(this.mainTableVo.getTableName());
|
this.originalMainColumns = DbReadTableUtil.listOriginalColumns(this.mainTableVo.getTableName());
|
||||||
}
|
}
|
||||||
|
|
||||||
var1.put("columns", this.mainColumns);
|
hashMap.put("columns", this.mainColumns);
|
||||||
var1.put("originalColumns", this.originalMainColumns);
|
hashMap.put("originalColumns", this.originalMainColumns);
|
||||||
Iterator iterator = this.originalMainColumns.iterator();
|
Iterator iterator = this.originalMainColumns.iterator();
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
while(iterator.hasNext()) {
|
||||||
ColumnVo var3 = (ColumnVo)iterator.next();
|
ColumnVo var3 = (ColumnVo)iterator.next();
|
||||||
if (var3.getFieldName().toLowerCase().equals(com.jero.codegenerate.properties.CodeConfigProperties.dbTableId.toLowerCase())) {
|
if (var3.getFieldName().toLowerCase().equals(com.jero.codegenerate.properties.CodeConfigProperties.dbTableId.toLowerCase())) {
|
||||||
var1.put("primaryKeyPolicy", var3.getFieldType());
|
hashMap.put("primaryKeyPolicy", var3.getFieldType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,15 +111,15 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
|||||||
subTableVo.setOriginalForeignKeys(var13);
|
subTableVo.setOriginalForeignKeys(var13);
|
||||||
}
|
}
|
||||||
|
|
||||||
var1.put("subTables", this.j);
|
hashMap.put("subTables", this.j);
|
||||||
} catch (Exception var10) {
|
} catch (Exception var10) {
|
||||||
throw var10;
|
throw var10;
|
||||||
}
|
}
|
||||||
|
|
||||||
long var11 = NonceUtils.c() + NonceUtils.g();
|
long var11 = NonceUtils.c() + NonceUtils.g();
|
||||||
var1.put("serialVersionUID", String.valueOf(var11));
|
hashMap.put("serialVersionUID", String.valueOf(var11));
|
||||||
log.info("code template data: " + var1.toString());
|
log.info("code template data: " + hashMap.toString());
|
||||||
return var1;
|
return hashMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> generateCodeFile(String stylePath) throws Exception {
|
public List<String> generateCodeFile(String stylePath) throws Exception {
|
||||||
|
|||||||
+8
-8
@@ -28,10 +28,10 @@ public class CodeConfigProperties {
|
|||||||
public static String templateUrl;
|
public static String templateUrl;
|
||||||
public static boolean dbFiledConvert;
|
public static boolean dbFiledConvert;
|
||||||
public static String dbTableId;
|
public static String dbTableId;
|
||||||
public static String m;
|
public static String fieldRequiredNum;
|
||||||
public static String n;
|
public static String pageSearchFieldNum;
|
||||||
public static String pageFilterFields;
|
public static String pageFilterFields;
|
||||||
public static String p;
|
public static String fieldRowNum;
|
||||||
|
|
||||||
private static ResourceBundle getDatasourcePropties(String var0) {
|
private static ResourceBundle getDatasourcePropties(String var0) {
|
||||||
PropertyResourceBundle var1 = null;
|
PropertyResourceBundle var1 = null;
|
||||||
@@ -109,7 +109,7 @@ public class CodeConfigProperties {
|
|||||||
return configDatasourcePropties.getString("page_filter_fields");
|
return configDatasourcePropties.getString("page_filter_fields");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String k() {
|
public static final String getPageSearchFieldNum() {
|
||||||
return configDatasourcePropties.getString("page_search_filed_num");
|
return configDatasourcePropties.getString("page_search_filed_num");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,9 +154,9 @@ public class CodeConfigProperties {
|
|||||||
i = "WebRoot";
|
i = "WebRoot";
|
||||||
templateUrl = "/jero/code-template/";
|
templateUrl = "/jero/code-template/";
|
||||||
dbFiledConvert = true;
|
dbFiledConvert = true;
|
||||||
m = "4";
|
fieldRequiredNum = "4";
|
||||||
n = "3";
|
pageSearchFieldNum = "3";
|
||||||
p = "1";
|
fieldRowNum = "1";
|
||||||
driverName = getDriverName();
|
driverName = getDriverName();
|
||||||
databaseUrl = getDatabaseUrl();
|
databaseUrl = getDatabaseUrl();
|
||||||
username = c();
|
username = c();
|
||||||
@@ -169,7 +169,7 @@ public class CodeConfigProperties {
|
|||||||
dbTableId = getDBTableId();
|
dbTableId = getDBTableId();
|
||||||
dbFiledConvert = getDbFiledConvert();
|
dbFiledConvert = getDbFiledConvert();
|
||||||
pageFilterFields = getPageFilterFields();
|
pageFilterFields = getPageFilterFields();
|
||||||
n = k();
|
pageSearchFieldNum = getPageSearchFieldNum();
|
||||||
if (databaseUrl.indexOf("mysql") < 0 && databaseUrl.indexOf("MYSQL") < 0) {
|
if (databaseUrl.indexOf("mysql") < 0 && databaseUrl.indexOf("MYSQL") < 0) {
|
||||||
if (databaseUrl.indexOf("oracle") < 0 && databaseUrl.indexOf("ORACLE") < 0) {
|
if (databaseUrl.indexOf("oracle") < 0 && databaseUrl.indexOf("ORACLE") < 0) {
|
||||||
if (databaseUrl.indexOf("postgresql") < 0 && databaseUrl.indexOf("POSTGRESQL") < 0) {
|
if (databaseUrl.indexOf("postgresql") < 0 && databaseUrl.indexOf("POSTGRESQL") < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user