|
|
|
@ -85,10 +85,6 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
generateModule(Tool.createPath(domainDir, "module"), project);
|
|
|
|
|
System.out.println("生成模块:task");
|
|
|
|
|
generateTask(Tool.createPath(domainDir, "task"), project);
|
|
|
|
|
|
|
|
|
|
generateResources_template(resourcesDir, project);
|
|
|
|
|
|
|
|
|
|
generateModuleForSys(Tool.createPath(domainDir, "module"), project);
|
|
|
|
|
//生成resources文件
|
|
|
|
|
generateResources(resourcesDir, project);
|
|
|
|
|
|
|
|
|
@ -144,9 +140,11 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
ctxss.put("author", project.getAuthor());
|
|
|
|
|
|
|
|
|
|
for (Module module : project.getModules()) {
|
|
|
|
|
if (!module.getNeedGenerate()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
File m = Tool.createPath(ajax, module.getModuleName());
|
|
|
|
|
ctxss.put("moduleName", module.getModuleName());
|
|
|
|
|
|
|
|
|
|
for (Table table : module.getTables()) {
|
|
|
|
|
if (table.getAjax()) {
|
|
|
|
|
ctxss.put("table", table);
|
|
|
|
@ -167,8 +165,10 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
File api = Tool.createPath(root, "api");
|
|
|
|
|
|
|
|
|
|
for (Module module : project.getModules()) {
|
|
|
|
|
if (!module.getNeedGenerate()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
File m = Tool.createPath(api, module.getModuleName());
|
|
|
|
|
|
|
|
|
|
for (Table table : module.getTables()) {
|
|
|
|
|
if (table.getApi()) {
|
|
|
|
|
HashMap<String, Object> ctxss = new HashMap<String, Object>();
|
|
|
|
@ -231,8 +231,11 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
Tool.clear(root);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> ctx = new HashMap<String, Object>();
|
|
|
|
|
for (Module module : project.getModules()) {// 业务模块
|
|
|
|
|
if (!module.getNeedGenerate()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
HashMap<String, Object> ctx = new HashMap<String, Object>();
|
|
|
|
|
ctx.put("project", project);
|
|
|
|
|
ctx.put("module", module);
|
|
|
|
|
ctx.put("domain", project.getDomain());
|
|
|
|
@ -246,7 +249,6 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
File req = Tool.createPath(Tool.createPath(root, module.getModuleName()), "req");
|
|
|
|
|
File rsp = Tool.createPath(Tool.createPath(root, module.getModuleName()), "rsp");
|
|
|
|
|
|
|
|
|
|
if (module.getNeedGenerate()) {
|
|
|
|
|
module.setProjectAuthor(project.getAuthor());
|
|
|
|
|
module.setProjectBasePackage(project.getDomain());
|
|
|
|
|
module.setProjectName(project.getName());
|
|
|
|
@ -303,12 +305,8 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void generateModuleForSys(File root, Project project) {
|
|
|
|
|
Module wsysModule = tryGetModule(project, "wsys");
|
|
|
|
|
if (wsysModule == null || !wsysModule.getNeedGenerate()) {// 防止与系统冲突,一般不会重复,通常是架构重新设计时遇到
|
|
|
|
|
{// 生成系统模块
|
|
|
|
|
HashMap<String, Object> ctx = new HashMap<String, Object>();
|
|
|
|
|
ctx.put("project", project);
|
|
|
|
|
ctx.put("domain", project.getDomain());
|
|
|
|
@ -347,7 +345,6 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成frame类
|
|
|
|
|
*
|
|
|
|
@ -484,7 +481,6 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
ctx.put("author", project.getAuthor());
|
|
|
|
|
ctx.put("dBmapper", dBmapper);
|
|
|
|
|
ctx.put("author", project.getAuthor());
|
|
|
|
|
ctx.put("projectName", project.getName());
|
|
|
|
|
ctx.put("project", project);
|
|
|
|
|
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(root, "application.properties"), "SpringBoot/resources/application.ftl", ctx);
|
|
|
|
@ -612,6 +608,7 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(screen, "index.ftl"), "SpringBoot/resources/templates/screen/index.ftl", ctx);
|
|
|
|
|
|
|
|
|
|
for (Module mo : project.getModules()) {
|
|
|
|
|
if (mo.getNeedGenerate()) {
|
|
|
|
|
for (Table table : mo.getTables()) {
|
|
|
|
|
if (table.getHtml()) {
|
|
|
|
|
File module = Tool.createPath(screen, mo.getModuleName());
|
|
|
|
@ -623,6 +620,7 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//生成网页
|
|
|
|
|
if (project.getFrame().value() == Frame.管理框架.value()) {
|
|
|
|
@ -637,16 +635,6 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成Resources_template
|
|
|
|
|
*
|
|
|
|
|
* @param root
|
|
|
|
|
* @param project
|
|
|
|
|
*/
|
|
|
|
|
public void generateResources_template(File root, Project project) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void generateTestResources(File root, Project project) {
|
|
|
|
|
HashMap<String, Object> ctx = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|