|
|
|
@ -238,6 +238,7 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
}
|
|
|
|
|
HashMap<String, Object> ctx = new HashMap<String, Object>();
|
|
|
|
|
ctx.put("basePackage", project.getProjectBasePackage());
|
|
|
|
|
ctx.put("projectName", project.getProjectName());
|
|
|
|
|
ctx.put("author", project.getProjectAuthor());
|
|
|
|
|
ctx.put("date", new Date());
|
|
|
|
|
|
|
|
|
@ -245,6 +246,7 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), "ActionConfig.java"), option + "/java/config/ActionConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), "FreeMarkerConfig.java"), option + "/java/config/FreeMarkerConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), "SecurityConfig.java"), option + "/java/config/SecurityConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), "SQLiteConfig.java"), option + "/java/config/SQLiteConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), "TaskConfig.java"), option + "/java/config/TaskConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), "ThreadPoolConfig.java"), option + "/java/config/ThreadPoolConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), "WebMvcConfig.java"), option + "/java/config/WebMvcConfig.java", ctx);
|
|
|
|
@ -616,7 +618,7 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(utils.getAbsolutePath(), "MapperUtil.java"), option + "/java/frame/utils/MapperUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(utils.getAbsolutePath(), "MD5Util.java"), option + "/java/frame/utils/MD5Util.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(utils.getAbsolutePath(), "ProcessUtil.java"), option + "/java/frame/utils/ProcessUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(utils.getAbsolutePath(), "ProcessUtil.java"), option + "/java/frame/utils/ProcessUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(utils.getAbsolutePath(), "ResourceUtil.java"), option + "/java/frame/utils/ResourceUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(utils.getAbsolutePath(), "ResponseUtil.java"), option + "/java/frame/utils/ResponseUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(utils.getAbsolutePath(), "RSAUtil.java"), option + "/java/frame/utils/RSAUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(utils.getAbsolutePath(), "StringUtil.java"), option + "/java/frame/utils/StringUtil.java", ctx);
|
|
|
|
@ -700,20 +702,19 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
try {
|
|
|
|
|
Class.forName("org.sqlite.JDBC");
|
|
|
|
|
connection = DriverManager.getConnection("jdbc:sqlite:" + dbFile.getAbsolutePath());
|
|
|
|
|
statement = connection.createStatement();
|
|
|
|
|
|
|
|
|
|
for (Module module : project.getModules()) {
|
|
|
|
|
File tableDir = Tool.createPath(dbtool.getAbsolutePath(), module.getModuleName() + "_table");
|
|
|
|
|
File file = Tool.createFile(tableDir.getAbsolutePath(), "ALL_TABLE.sql");
|
|
|
|
|
String string = FileUtil.readFileToString(file);
|
|
|
|
|
statement.execute(string);
|
|
|
|
|
for (File fileModule : dbtool.listFiles()) {
|
|
|
|
|
if (!fileModule.isDirectory()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (File file : fileModule.listFiles()) {
|
|
|
|
|
if (!file.getName().startsWith("ALL_") && file.getName().endsWith(".sql")) {
|
|
|
|
|
statement = connection.createStatement();
|
|
|
|
|
String sql = FileUtil.readFileToString(file);
|
|
|
|
|
statement.execute(sql);
|
|
|
|
|
statement.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
File tableDir = Tool.createPath(dbtool.getAbsolutePath(),"system");
|
|
|
|
|
File file = Tool.createFile(tableDir.getAbsolutePath(), "ALL_TABLE.sql");
|
|
|
|
|
String string = FileUtil.readFileToString(file);
|
|
|
|
|
statement.execute(string);
|
|
|
|
|
}
|
|
|
|
|
} catch (ClassNotFoundException | SQLException | IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
@ -722,13 +723,13 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
if (statement != null) statement.close();
|
|
|
|
|
if (connection != null) connection.close();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
File system = Tool.createPath(dbtool.getAbsolutePath(), "system");
|
|
|
|
|
File system = Tool.createPath(dbtool.getAbsolutePath(), "system_table");
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "ALL_TABLE.sql"), option + "/resources/dbtool/system/ALL_TABLE.sql", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DICT.sql"), option + "/resources/dbtool/system/DICT.sql", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DICT_ITEM.sql"), option + "/resources/dbtool/system/DICT_ITEM.sql", ctx);
|
|
|
|
@ -740,7 +741,7 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
HashMap<String, Object> ctx = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
ctx.put("basePackage", project.getProjectBasePackage());
|
|
|
|
|
ctx.put("moduleName", project.getProjectName());
|
|
|
|
|
ctx.put("projectName", project.getProjectName());
|
|
|
|
|
ctx.put("tool", Tool.class);
|
|
|
|
|
ctx.put("dataBase", dataBase.toString());
|
|
|
|
|
ctx.put("author", project.getProjectAuthor());
|
|
|
|
|