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