【修改】重命名变量
This commit is contained in:
+6
-6
@@ -1005,17 +1005,17 @@ public class OnlCgformApiController {
|
||||
*/
|
||||
@PostMapping({"/codeGenerate"})
|
||||
public Result<?> codeGenerate(@RequestBody JSONObject jsonObject) {
|
||||
OnlGenerateModel var2 = (OnlGenerateModel)JSONObject.parseObject(jsonObject.toJSONString(), OnlGenerateModel.class);
|
||||
List var3 = null;
|
||||
OnlGenerateModel onlGenerateModel = (OnlGenerateModel)JSONObject.parseObject(jsonObject.toJSONString(), OnlGenerateModel.class);
|
||||
List list = null;
|
||||
|
||||
try {
|
||||
if ("1".equals(var2.getJformType())) {
|
||||
var3 = this.onlCgformHeadService.generateCode(var2);
|
||||
if ("1".equals(onlGenerateModel.getJformType())) {
|
||||
list = this.onlCgformHeadService.generateCode(onlGenerateModel);
|
||||
} else {
|
||||
var3 = this.onlCgformHeadService.generateOneToMany(var2);
|
||||
list = this.onlCgformHeadService.generateOneToMany(onlGenerateModel);
|
||||
}
|
||||
|
||||
return Result.OK(var3);
|
||||
return Result.OK(list);
|
||||
} catch (Exception var5) {
|
||||
var5.printStackTrace();
|
||||
return Result.error(var5.getMessage());
|
||||
|
||||
+103
-103
@@ -1,103 +1,103 @@
|
||||
|
||||
package com.jero.generater.modules.online.cgform.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class OnlGenerateModel implements Serializable {
|
||||
private static final long b = 684098897071177558L;
|
||||
private String c;
|
||||
private String d;
|
||||
private String e;
|
||||
private String f;
|
||||
private String g;
|
||||
private String h;
|
||||
private String i;
|
||||
private String j;
|
||||
private String k;
|
||||
List<OnlGenerateModel> a = new ArrayList();
|
||||
|
||||
public OnlGenerateModel() {
|
||||
}
|
||||
|
||||
public String getProjectPath() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public void setProjectPath(String projectPath) {
|
||||
this.d = projectPath;
|
||||
}
|
||||
|
||||
public String getPackageStyle() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public void setPackageStyle(String packageStyle) {
|
||||
this.e = packageStyle;
|
||||
}
|
||||
|
||||
public String getFtlDescription() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
public void setFtlDescription(String ftlDescription) {
|
||||
this.f = ftlDescription;
|
||||
}
|
||||
|
||||
public String getJformType() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
public void setJformType(String jformType) {
|
||||
this.g = jformType;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.h = tableName;
|
||||
}
|
||||
|
||||
public String getEntityPackage() {
|
||||
return this.i;
|
||||
}
|
||||
|
||||
public void setEntityPackage(String entityPackage) {
|
||||
this.i = entityPackage;
|
||||
}
|
||||
|
||||
public String getEntityName() {
|
||||
return this.j;
|
||||
}
|
||||
|
||||
public void setEntityName(String entityName) {
|
||||
this.j = entityName;
|
||||
}
|
||||
|
||||
public String getJspMode() {
|
||||
return this.k;
|
||||
}
|
||||
|
||||
public void setJspMode(String jspMode) {
|
||||
this.k = jspMode;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.c = code;
|
||||
}
|
||||
|
||||
public List<OnlGenerateModel> getSubList() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void setSubList(List<OnlGenerateModel> subList) {
|
||||
this.a = subList;
|
||||
}
|
||||
}
|
||||
|
||||
package com.jero.generater.modules.online.cgform.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class OnlGenerateModel implements Serializable {
|
||||
private static final long b = 684098897071177558L;
|
||||
private String code;
|
||||
private String projectPath;
|
||||
private String packageStyle;
|
||||
private String ftlDescription;
|
||||
private String jfromType;
|
||||
private String tableName;
|
||||
private String entityPackage;
|
||||
private String entityName;
|
||||
private String jspMode;
|
||||
List<OnlGenerateModel> subList = new ArrayList();
|
||||
|
||||
public OnlGenerateModel() {
|
||||
}
|
||||
|
||||
public String getProjectPath() {
|
||||
return this.projectPath;
|
||||
}
|
||||
|
||||
public void setProjectPath(String projectPath) {
|
||||
this.projectPath = projectPath;
|
||||
}
|
||||
|
||||
public String getPackageStyle() {
|
||||
return this.packageStyle;
|
||||
}
|
||||
|
||||
public void setPackageStyle(String packageStyle) {
|
||||
this.packageStyle = packageStyle;
|
||||
}
|
||||
|
||||
public String getFtlDescription() {
|
||||
return this.ftlDescription;
|
||||
}
|
||||
|
||||
public void setFtlDescription(String ftlDescription) {
|
||||
this.ftlDescription = ftlDescription;
|
||||
}
|
||||
|
||||
public String getJformType() {
|
||||
return this.jfromType;
|
||||
}
|
||||
|
||||
public void setJformType(String jformType) {
|
||||
this.jfromType = jformType;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return this.tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getEntityPackage() {
|
||||
return this.entityPackage;
|
||||
}
|
||||
|
||||
public void setEntityPackage(String entityPackage) {
|
||||
this.entityPackage = entityPackage;
|
||||
}
|
||||
|
||||
public String getEntityName() {
|
||||
return this.entityName;
|
||||
}
|
||||
|
||||
public void setEntityName(String entityName) {
|
||||
this.entityName = entityName;
|
||||
}
|
||||
|
||||
public String getJspMode() {
|
||||
return this.jspMode;
|
||||
}
|
||||
|
||||
public void setJspMode(String jspMode) {
|
||||
this.jspMode = jspMode;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public List<OnlGenerateModel> getSubList() {
|
||||
return this.subList;
|
||||
}
|
||||
|
||||
public void setSubList(List<OnlGenerateModel> subList) {
|
||||
this.subList = subList;
|
||||
}
|
||||
}
|
||||
|
||||
+19
-18
@@ -1186,35 +1186,36 @@ public class OnlCgformHeadServiceImpl extends ServiceImpl<OnlCgformHeadMapper, O
|
||||
return var14;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> generateCode(OnlGenerateModel model) throws Exception {
|
||||
TableVo var2 = new TableVo();
|
||||
var2.setEntityName(model.getEntityName());
|
||||
var2.setEntityPackage(model.getEntityPackage());
|
||||
var2.setFtlDescription(model.getFtlDescription());
|
||||
var2.setTableName(model.getTableName());
|
||||
var2.setSearchFieldNum(-1);
|
||||
TableVo tableVo = new TableVo();
|
||||
tableVo.setEntityName(model.getEntityName());
|
||||
tableVo.setEntityPackage(model.getEntityPackage());
|
||||
tableVo.setFtlDescription(model.getFtlDescription());
|
||||
tableVo.setTableName(model.getTableName());
|
||||
tableVo.setSearchFieldNum(-1);
|
||||
ArrayList var3 = new ArrayList();
|
||||
ArrayList var4 = new ArrayList();
|
||||
this.a(model.getCode(), var3, var4);
|
||||
OnlCgformHead var5 = (OnlCgformHead)((OnlCgformHeadMapper)this.baseMapper).selectOne((Wrapper)(new LambdaQueryWrapper<OnlCgformHead>()).eq(OnlCgformHead::getId, model.getCode()));
|
||||
HashMap var6 = new HashMap();
|
||||
var6.put("scroll", var5.getScroll() == null ? "0" : var5.getScroll().toString());
|
||||
String var7 = var5.getFormTemplate();
|
||||
OnlCgformHead onlCgformHead = (OnlCgformHead)((OnlCgformHeadMapper)this.baseMapper).selectOne((Wrapper)(new LambdaQueryWrapper<OnlCgformHead>()).eq(OnlCgformHead::getId, model.getCode()));
|
||||
HashMap hashMap = new HashMap();
|
||||
hashMap.put("scroll", onlCgformHead.getScroll() == null ? "0" : onlCgformHead.getScroll().toString());
|
||||
String var7 = onlCgformHead.getFormTemplate();
|
||||
if (oConvertUtils.isEmpty(var7)) {
|
||||
var2.setFieldRowNum(1);
|
||||
tableVo.setFieldRowNum(1);
|
||||
} else {
|
||||
var2.setFieldRowNum(Integer.parseInt(var7));
|
||||
tableVo.setFieldRowNum(Integer.parseInt(var7));
|
||||
}
|
||||
|
||||
if ("Y".equals(var5.getIsTree())) {
|
||||
var6.put("pidField", var5.getTreeParentIdField());
|
||||
var6.put("hasChildren", var5.getTreeIdField());
|
||||
var6.put("textField", var5.getTreeFieldname());
|
||||
if ("Y".equals(onlCgformHead.getIsTree())) {
|
||||
hashMap.put("pidField", onlCgformHead.getTreeParentIdField());
|
||||
hashMap.put("hasChildren", onlCgformHead.getTreeIdField());
|
||||
hashMap.put("textField", onlCgformHead.getTreeFieldname());
|
||||
}
|
||||
|
||||
var2.setExtendParams(var6);
|
||||
tableVo.setExtendParams(hashMap);
|
||||
CgformEnum var8 = CgformEnum.getCgformEnumByConfig(model.getJspMode());
|
||||
List var9 = (new CodeGenerateOne(var2, var3, var4)).generateCodeFile(model.getProjectPath(), var8.getTemplatePath(), var8.getStylePath());
|
||||
List var9 = (new CodeGenerateOne(tableVo, var3, var4)).generateCodeFile(model.getProjectPath(), var8.getTemplatePath(), var8.getStylePath());
|
||||
return var9;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user