任务相关优化

master
wangbing 4 years ago
parent c2450963b7
commit 27fa822408

@ -350,10 +350,10 @@ public class JavaFxApplication extends Application {
int i1 = 0, i2 = 0;
for (int i = 0; i < mds.size(); i++) {
if (mds.get(i).getModuleName().equals(m1)) {
if (mds.get(i).getName().equals(m1)) {
i1 = i;
}
if (mds.get(i).getModuleName().equals(m2)) {
if (mds.get(i).getName().equals(m2)) {
i2 = i;
}
}
@ -416,7 +416,7 @@ public class JavaFxApplication extends Application {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
if (currentModule != null) {
currentModule.setModuleComment(newValue);
currentModule.setNote(newValue);
}
}
});
@ -434,7 +434,7 @@ public class JavaFxApplication extends Application {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
if (currentModule != null) {
currentModule.setModuleName(newValue);
currentModule.setName(newValue);
}
}
});
@ -761,16 +761,16 @@ public class JavaFxApplication extends Application {
TreeItem moduleTreeItem = new TreeItem(module);
moduleTreeItem.setExpanded(true);
getTreeItem().getChildren().add(moduleTreeItem);
System.out.println("新增模块" + module.getModuleName());
System.out.println("新增模块" + module.getName());
}
}).build());
} else if (item instanceof Module) {
Module mo = (Module) item;
setText(mo.getModuleName());
mo.moduleNameProperty().addListener(new ChangeListener<String>() {
setText(mo.getName());
mo.nameProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
setText(mo.getModuleName());
setText(mo.getName());
}
});
//region 模块右击菜单
@ -799,7 +799,7 @@ public class JavaFxApplication extends Application {
if (currentModule.hashCode() == module.hashCode()) {
loadProject();
}
System.out.println("删除模块" + mo.getModuleName());
System.out.println("删除模块" + mo.getName());
}
})
.add("向上调整", new EventHandler<ActionEvent>() {
@ -812,7 +812,7 @@ public class JavaFxApplication extends Application {
if (indexOf > 0) {
Tool.exchange(projectTreeItem.getChildren(), indexOf - 1, indexOf);
Tool.exchange(project.getModules(), indexOf - 1, indexOf);
System.out.println("向上调整" + mo.getModuleName());
System.out.println("向上调整" + mo.getName());
}
}
})
@ -826,7 +826,7 @@ public class JavaFxApplication extends Application {
if (indexOf < project.getModules().size() - 1) {
Tool.exchange(projectTreeItem.getChildren(), indexOf, indexOf + 1);
Tool.exchange(project.getModules(), indexOf, indexOf + 1);
System.out.println("向下调整" + mo.getModuleName());
System.out.println("向下调整" + mo.getName());
}
}
}).build());
@ -898,9 +898,9 @@ public class JavaFxApplication extends Application {
}
GridPane gridPane = mModuleLoader.getRoot();
detailModuleController.getModuleComment().setText(currentModule.getModuleComment());
detailModuleController.getModuleComment().setText(currentModule.getNote());
detailModuleController.getModulePrefix().setText(currentModule.getModulePrefix());
detailModuleController.getModuleName().setText(currentModule.getModuleName());
detailModuleController.getModuleName().setText(currentModule.getName());
detailModuleController.getIsGenerate().setSelected(currentModule.getNeedGenerate());
if (gridPane != null) {
@ -1417,6 +1417,9 @@ public class JavaFxApplication extends Application {
int param1 = checkBoxTableCell.getParam();
Field field = currentTable.getFields().get(param1);
field.setIsQuery(newValue);
if (!newValue){
field.setIsUnique(false);
}
}
});
return checkBoxTableCell;

@ -77,7 +77,7 @@ public class ProjectManager {
public Module findDBByDBName(String name) {
for (Module md : project.getModules()) {
if (md.getModuleName().equals(name)) {
if (md.getName().equals(name)) {
return md;
}
}
@ -86,7 +86,7 @@ public class ProjectManager {
public boolean removeDBByDBName(String name) {
for (Module md : project.getModules()) {
if (md.getModuleName().equals(name)) {
if (md.getName().equals(name)) {
project.getModules().remove(md);
return true;
}
@ -190,7 +190,7 @@ public class ProjectManager {
do {
int i;
for (i = 0; i < project.getModules().size(); i++) {
if (name.equals(project.getModules().get(i).getModuleName())) {
if (name.equals(project.getModules().get(i).getName())) {
break;
}
}
@ -199,8 +199,8 @@ public class ProjectManager {
name = base + k;
} else {
Module md = new Module(name);
md.setModuleName(name);
md.setModuleComment("注释");
md.setName(name);
md.setNote("注释");
md.setNeedGenerate(true);
project.putModule(md);
return md;
@ -294,10 +294,10 @@ public class ProjectManager {
return false;
}
for (Module md : project.getModules()) {
if (md.getModuleName() == null || "".equals(md.getModuleName())) {
if (md.getName() == null || "".equals(md.getName())) {
Dialog.showYesNo("项目" + project.getName() + "没有填写模块名!");
return false;
} else if (md.getModuleComment() == null || "".equals(md.getModuleComment())) {
} else if (md.getNote() == null || "".equals(md.getNote())) {
Dialog.showYesNo("项目" + project.getName() + "没有模块注释!");
return false;
}

@ -146,8 +146,8 @@ public class SpringBootCallable implements Callable {
if (!module.getNeedGenerate()) {
continue;
}
File m = Tool.createPath(ajax, module.getModuleName());
ctxss.put("moduleName", module.getModuleName());
File m = Tool.createPath(ajax, module.getName());
ctxss.put("moduleName", module.getName());
for (Table table : module.getTables()) {
if (table.getAjax()) {
ctxss.put("table", table);
@ -175,8 +175,8 @@ public class SpringBootCallable implements Callable {
ctxss.put("project",project);
ctxss.put("domain",project.getDomain());
ctxss.put("author", project.getAuthor());
ctxss.put("module", module.getModuleName());
File m = Tool.createPath(api, module.getModuleName());
ctxss.put("module", module.getName());
File m = Tool.createPath(api, module.getName());
for (Table table : module.getTables()) {
if (table.getApi()) {
ctxss.put("table", table);
@ -245,14 +245,14 @@ public class SpringBootCallable implements Callable {
ctx.put("module", module);
ctx.put("domain", project.getDomain());
ctx.put("author", project.getAuthor());
ctx.put("moduleName", module.getModuleName());
ctx.put("moduleName", module.getName());
ctx.put("dataBase", project.getDatabase().toString());
File ent = Tool.createPath(Tool.createPath(root, module.getModuleName()), "ent");
File mpr = Tool.createPath(Tool.createPath(root, module.getModuleName()), "mpr");
File mgr = Tool.createPath(Tool.createPath(root, module.getModuleName()), "mgr");
File req = Tool.createPath(Tool.createPath(root, module.getModuleName()), "req");
File rsp = Tool.createPath(Tool.createPath(root, module.getModuleName()), "rsp");
File ent = Tool.createPath(Tool.createPath(root, module.getName()), "ent");
File mpr = Tool.createPath(Tool.createPath(root, module.getName()), "mpr");
File mgr = Tool.createPath(Tool.createPath(root, module.getName()), "mgr");
File req = Tool.createPath(Tool.createPath(root, module.getName()), "req");
File rsp = Tool.createPath(Tool.createPath(root, module.getName()), "rsp");
module.setProjectAuthor(project.getAuthor());
module.setProjectBasePackage(project.getDomain());
@ -533,9 +533,9 @@ public class SpringBootCallable implements Callable {
for (Module module : project.getModules()) {
if (module.getNeedGenerate()) {
ctx.put("moduleName", module.getModuleName());
ctx.put("moduleName", module.getName());
ctx.put("module", module);
File tableDir = Tool.createPath(dbtool, module.getModuleName() + "_table");
File tableDir = Tool.createPath(dbtool, module.getName() + "_table");
for (Table table : module.getTables()) {
ctx.put("table", table);
freeMarkerManager.outputTemp(Tool.createFile(tableDir, project.getDatabase().name() + "_" + table.getTableName() + ".sql"), "SpringBoot/resources/dbtool/table.ftl", ctx);
@ -639,15 +639,15 @@ 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()) {
for (Module module : project.getModules()) {
if (module.getNeedGenerate()) {
File modulePath = Tool.createPath(screen, module.getName());
for (Table table : module.getTables()) {
if (table.getHtml()) {
File module = Tool.createPath(screen, mo.getModuleName());
ctx.put("table", table);
ctx.put("module", module);
ctx.put("fields", table.getFields());
File file = Tool.createFile(module, table.getFName() + ".ftl");
File file = Tool.createFile(modulePath, table.getFName() + ".ftl");
freeMarkerManager.outputTemp(file, "SpringBoot/resources/templates/screen/module/mgr.ftl", ctx);
}
}
@ -707,14 +707,14 @@ public class SpringBootCallable implements Callable {
for (Module md : project.getModules()) {
if (md.getNeedGenerate()) {
File module = Tool.createPath(root, md.getModuleName());
File module = Tool.createPath(root, md.getName());
for (Table table : md.getTables()) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getDomain());
ctx.put("module", md);
ctx.put("moduleName", md.getModuleName());
ctx.put("moduleName", md.getName());
ctx.put("table", table);
ctx.put("author", md.getProjectAuthor());
@ -742,7 +742,7 @@ public class SpringBootCallable implements Callable {
private Module tryGetModule(Project project, String moduleName) {
for (Module module : project.getModules()) {
if (module.getModuleName().equals(moduleName)) {
if (module.getName().equals(moduleName)) {
return module;
}
}

@ -115,7 +115,7 @@ public class SpringMVCCallable implements Callable {
generateController(new File(src.getParentFile().getAbsolutePath() + File.separator + "controller"), project, dataBase, option);
for (Module module : project.getModules()) {
File moduleFile = new File(src, module.getModuleName());
File moduleFile = new File(src, module.getName());
//module
System.out.println("生成模块:Entity");
@ -196,7 +196,7 @@ public class SpringMVCCallable implements Callable {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("tool", Tool.class);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getModuleName());
ctx.put("moduleName", project.getName());
ctx.put("table", table);
ctx.put("author", project.getProjectAuthor());
@ -225,7 +225,7 @@ public class SpringMVCCallable implements Callable {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("tool", Tool.class);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getModuleName());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getProjectAuthor());
freeMarkerManager.outputTemp(new File(root.getAbsolutePath() + File.separator + "Type.java"), option + "/java/enums/Type.ftl", ctx);
@ -254,7 +254,7 @@ public class SpringMVCCallable implements Callable {
ctx.put("tool", Tool.class);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getModuleName());
ctx.put("moduleName", project.getName());
freeMarkerManager.outputTemp(new File(root.getAbsolutePath() + File.separator + "Authorizations" + ".java"), option + "/java/filter/Authorizations.ftl", ctx);
} catch (Exception e) {
@ -281,7 +281,7 @@ public class SpringMVCCallable implements Callable {
ctx.put("project", project);
ctx.put("dataBase", dataBase.toString());
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getModuleName());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getProjectAuthor());
for (Table table : project.getTables()) {
@ -308,7 +308,7 @@ public class SpringMVCCallable implements Callable {
ctx.put("tool", Tool.class);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getModuleName());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getProjectAuthor());
for (Table table : project.getTables()) {
@ -341,7 +341,7 @@ public class SpringMVCCallable implements Callable {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("tool", Tool.class);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getModuleName());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getProjectAuthor());
for (Table table : project.getTables()) {
@ -376,7 +376,7 @@ public class SpringMVCCallable implements Callable {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("tool", Tool.class);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getModuleName());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getProjectAuthor());
for (Table table : project.getTables()) {
@ -536,7 +536,7 @@ public class SpringMVCCallable implements Callable {
for (Module table : project.getModules()) {
ctx.put("table", table);
freeMarkerManager.outputTemp(new File(tableDir.getAbsolutePath() + File.separator + table.getModuleName() + ".sql"), option + "/resources/table.ftl", ctx);
freeMarkerManager.outputTemp(new File(tableDir.getAbsolutePath() + File.separator + table.getName() + ".sql"), option + "/resources/table.ftl", ctx);
}
} catch (Exception e) {
@ -563,7 +563,7 @@ public class SpringMVCCallable implements Callable {
ctx.put("moduleName", project.getName());
for (Module table : project.getModules()) {
ctx.put("table", table);
freeMarkerManager.outputTemp(new File(module.getAbsolutePath() + File.separator + Tool.ABB2Abb(table.getModuleName()) + "Test" + ".java"), option + "/test/test.ftl", ctx);
freeMarkerManager.outputTemp(new File(module.getAbsolutePath() + File.separator + Tool.ABB2Abb(table.getName()) + "Test" + ".java"), option + "/test/test.ftl", ctx);
}
}

@ -11,14 +11,14 @@ public class Module {
}
public Module(String moduleName) {
setModuleName(moduleName);
public Module(String name) {
setName(name);
}
@Property("name")
private SimpleStringProperty moduleName = new SimpleStringProperty();
private SimpleStringProperty name = new SimpleStringProperty();
@Property("note")
private String moduleComment;
private String note;
@Property("prefix")
private String modulePrefix;
@Property("needGenerate")
@ -30,16 +30,16 @@ public class Module {
private List<Table> tables = new ArrayList();
public String getModuleName() {
return moduleName.get();
public String getName() {
return name.get();
}
public SimpleStringProperty moduleNameProperty() {
return moduleName;
public SimpleStringProperty nameProperty() {
return name;
}
public void setModuleName(String moduleName) {
this.moduleName.set(moduleName);
public void setName(String name) {
this.name.set(name);
}
public boolean putTable(Table table) {
@ -65,12 +65,12 @@ public class Module {
this.tables = tables;
}
public String getModuleComment() {
return moduleComment;
public String getNote() {
return note;
}
public void setModuleComment(String moduleComment) {
this.moduleComment = moduleComment;
public void setNote(String note) {
this.note = note;
}
public String getModulePrefix() {

@ -311,7 +311,7 @@ public class Dialog {
}
for (Module db : ManagerFactory.getProjectManager().getMds()) {
if (db.getModuleName().equals(userName)) {
if (db.getName().equals(userName)) {
Dialog.showYesNo("已经存的模块!");
return;
}

@ -1,9 +1,7 @@
package ${domain}.frame.schedule;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import java.util.Date;
import java.util.concurrent.ScheduledFuture;
/**
@ -17,20 +15,51 @@ public abstract class RunTask implements Runnable {
public abstract String taskId();
public String taskName(){
return "";
protected abstract void task();
public String taskName() {
return "";
}
public String taskNote(){
return "";
public String taskNote() {
return "";
}
public abstract ScheduledFuture<?> schedule(ThreadPoolTaskScheduler poolTaskScheduler);
@Override
public void run() {
try {
boolean before = before();
if (before) {
task();
}
after();
} catch (Exception e) {
exception(e);
}
}
/**
*
*
* @return
*/
protected boolean before() {
return true;
}
public void configChange(ThreadPoolTaskScheduler scheduler) {
ScheduledFuture<?> schedule = scheduler.schedule(this, new Date());
if (!schedule.cancel(true)) {
/**
*
*/
protected void after() {
}
}
/**
*
*/
protected void exception(Exception e) {
e.printStackTrace();
}
public abstract ScheduledFuture<?> schedule(ThreadPoolTaskScheduler poolTaskScheduler);
}

@ -85,20 +85,12 @@ public class Scheduler extends ThreadPoolTaskScheduler implements ErrorHandler {
@Override
public void handleError(Throwable throwable) {
LogUtil.dumpException(throwable);
<#if project.frameValue() = 1>
String message = throwable.getMessage();
Pattern compile = Pattern.compile("(\\[.*])执行异常任务ID(\\(.*\\))");
Matcher matcher = compile.matcher(message);
if (matcher.find()) {
String taskName = matcher.group(1);
String taskId = matcher.group(2);
LogerrManager logerrManager = LocalData.getBean(LogerrManager.class);
if (logerrManager != null)
logerrManager.addErr("任务错误", "任务" + taskName + "执行错误", "任务" + taskName + "执行错误" + "任务ID" + taskId);
}
</#if>
String title = throwable.getMessage();
String message = LogUtil.getTrace(throwable);
LogUtil.e(message);
LogerrManager logerrManager = LocalData.getBean(LogerrManager.class);
if (logerrManager != null)
logerrManager.addErr("任务错误", title, message);
}
class TaskWrapper {

@ -282,12 +282,12 @@ public class ${table.getCName()}ManagerImpl implements ${table.getCName()}Manage
<#if item.selected>
/**
* ${item.note?default("")}
*
* @param request 请求对象
* @param token 令牌
* @return
*/
* ${item.note?default("")}
*
* @param request 请求对象
* @param token 令牌
* @return
*/
public ${table.getCName()}${item.getAbbName()?default("")}Response ${item.name}(${table.getCName()}${item.getAbbName()?default("")}Request request, Token token) {
${table.getCName()}${item.getAbbName()?default("")}Response response = new ${table.getCName()}${item.getAbbName()?default("")}Response();

@ -285,12 +285,12 @@ public class ${table.getCName()}ManagerImpl implements ${table.getCName()}Manage
<#if item.selected>
/**
* ${item.note?default("")}
*
* @param request 请求对象
* @param token 令牌
* @return
*/
* ${item.note?default("")}
*
* @param request 请求对象
* @param token 令牌
* @return
*/
public ${table.getCName()}${item.getAbbName()?default("")}Response ${item.name}(${table.getCName()}${item.getAbbName()?default("")}Request request, Token token) {
${table.getCName()}${item.getAbbName()?default("")}Response response = new ${table.getCName()}${item.getAbbName()?default("")}Response();

@ -110,9 +110,9 @@ public interface ${table.getCName()}Mapper {
/**
*
*
* @param list
* @param ids
* @param token
* @return
*/
List<${table.getCName()}> getByIds(@Param("list") List<Long> list, @Param("token") Token token);
List<${table.getCName()}> getByIds(@Param("ids") Long[] ids, @Param("token") Token token);
}

@ -272,7 +272,7 @@
<include refid="table"/>
WHERE `IS_DELETED` = 0
AND `ID` IN
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
${r"#{"}item}
</foreach>
</select>

@ -274,7 +274,7 @@
<include refid="table"/>
WHERE "IS_DELETED" = 0
AND "ID" IN
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
${r"#{"}item}
</foreach>
</select>

@ -272,7 +272,7 @@
<include refid="table"/>
WHERE "IS_DELETED" = 0
AND "ID" IN
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
${r"#{"}item}
</foreach>
</select>

@ -233,7 +233,7 @@ public class TaskSqlManagerImpl implements TaskSqlManager {
}
@Override
public void run() {
protected void task() {
try {
SqlUtil.exec(taskSql.getTaskSql());
} catch (Exception e) {
@ -262,7 +262,7 @@ public class TaskSqlManagerImpl implements TaskSqlManager {
}
@Override
public void run() {
protected void task() {
try {
SqlUtil.exec(taskSql.getTaskSql());
} catch (Exception e) {
@ -291,7 +291,7 @@ public class TaskSqlManagerImpl implements TaskSqlManager {
}
@Override
public void run() {
protected void task() {
try {
SqlUtil.exec(taskSql.getTaskSql());
} catch (Exception e) {

@ -2,16 +2,15 @@ package ${domain}.task;
import ${domain}.frame.auth.LocalData;
import ${domain}.frame.schedule.RunDelayRepeatTask;
import ${domain}.frame.utils.IDgenerator;
import ${domain}.module.wsys.ent.Tokens;
import ${domain}.frame.utils.SqlUtil;
import ${domain}.module.wsys.mgr.LogerrManager;
import ${domain}.module.wsys.mgr.TokensManager;
import ${domain}.module.wsys.req.TokensFindRequest;
import ${domain}.module.wsys.req.TokensLogoutRequest;
import ${domain}.module.wsys.rsp.TokensFindResponse;
import ${domain}.module.wsys.rsp.TokensLogoutResponse;
import java.time.Duration;
import java.util.Date;
import java.util.List;
public class TokenTask extends RunDelayRepeatTask {
@ -26,7 +25,7 @@ public class TokenTask extends RunDelayRepeatTask {
}
@Override
public String taskNote () {
public String taskNote() {
return "处理过期登录凭证状态,及时注销。";
}
@ -36,23 +35,17 @@ public class TokenTask extends RunDelayRepeatTask {
}
@Override
public void run() {
protected void task() {
TokensManager tokensManager = LocalData.getBean(TokensManager.class);
LogerrManager logerrManager = LocalData.getBean(LogerrManager.class);
if (tokensManager == null) {
return;
}
TokensFindRequest tokensFindRequest = new TokensFindRequest();
tokensFindRequest.setPageSize(0);
tokensFindRequest.setValid(true);
TokensFindResponse tokensFindResponse = tokensManager.find(tokensFindRequest, LocalData.getSysToken());
Date current = new Date();
for (Tokens tokens : tokensFindResponse.getResult()) {
if (tokens.getValidTime().before(current)) {
TokensLogoutRequest tokensLogoutRequest = new TokensLogoutRequest();
tokensLogoutRequest.setToken(tokens.getToken());
TokensLogoutResponse tokensLogoutResponse = tokensManager.logout(tokensLogoutRequest, LocalData.getSysToken());
List<TokensLogoutRequest> select = SqlUtil.select("SELECT TOKEN FROM SYS_TOKENS WHERE VALID = '1' AND IS_DELETED = '0' AND VALID_TIME < " + new Date().getTime(), TokensLogoutRequest.class);
for (TokensLogoutRequest request : select) {
TokensLogoutResponse tokensLogoutResponse = tokensManager.logout(request, LocalData.getSysToken());
if (tokensLogoutResponse.hasError()) {
logerrManager.addErr("任务错误", "登录凭证注销错误", tokensLogoutResponse.getErrors().get(0).getMessage());
}
}
}

@ -73,16 +73,16 @@
${print('</#if>')}
<#list project.modules as module>
<#if module.hasHtml() && module.needGenerate>
${print('<#if token.hasRes("${module.moduleName?upper_case}")>')}
${print('<#if token.hasRes("${module.name?upper_case}")>')}
<el-submenu index="${uuid()}">
<template slot="title">
<i class="el-icon-document-copy"></i>
<span slot="title">${module.moduleComment}</span>
<span slot="title">${module.note}</span>
</template>
<#list module.tables as table>
<#if table.getHtml()>
${print('<#if token.hasRes("${module.moduleName?upper_case}_${table.tableName?upper_case}")>')}
<el-menu-item index="${uuid()}" @click="addTab({title: '${table.tableComment}', name: '${table.tableName}', url: '${r"${context}"}/${module.moduleName}/${table.getFName()}.htm'})">${table.tableComment}</el-menu-item>
${print('<#if token.hasRes("${module.name?upper_case}_${table.tableName?upper_case}")>')}
<el-menu-item index="${uuid()}" @click="addTab({title: '${table.tableComment}', name: '${table.tableName}', url: '${r"${context}"}/${module.name}/${table.getFName()}.htm'})">${table.tableComment}</el-menu-item>
${print('</#if>')}
</#if>
</#list>

@ -513,7 +513,7 @@
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
new Ajax("${module}", "${table.getFName()}").delete({id: item.id}, function (response) {
new Ajax("${module.name}", "${table.getFName()}").delete({id: item.id}, function (response) {
if (response.errors.length > 0) {
nav.e(response.errors[0].message);
} else {

@ -71,7 +71,7 @@ public class DataInit {
<#list project.modules as module>
<#list module.tables as table>
<#list table.fields as field>
<#if field.fieldType == 'Dict' && module.moduleName != 'wsys'>
<#if field.fieldType == 'Dict' && module.name != 'wsys'>
{// ${field.fieldComment?default('')}
createDict("${field.fieldName?default('')}", "${field.fieldComment?default('')}", new String[][]{
<#list field.selectItems as item>
@ -230,32 +230,32 @@ public class DataInit {
<#assign index = "0"+index/>
</#if>
<#if module.getNeedGenerate()>
forMgr.add(createRes("${index}", "${module.moduleComment}菜单", "WEB", "${module.moduleName?upper_case}"));
forMgr.add(createRes("${index}", "${module.note}菜单", "WEB", "${module.name?upper_case}"));
<#list module.tables as table>
<#if table.html>
forMgr.add(createRes("${index}01", "${table.tableComment}管理菜单", "WEB", "${module.moduleName?upper_case}_${table.tableName?upper_case}"));
forMgr.add(createRes("${index}0101", "${table.tableComment}管理页", "WEB", "/${module.moduleName}/${table.getFName()}.htm"));
forMgr.add(createRes("${index}010101", "${table.tableComment}模板", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/template"));
forMgr.add(createRes("${index}010102", "${table.tableComment}导入", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/imports"));
forMgr.add(createRes("${index}010103", "${table.tableComment}导出", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/exports"));
forMgr.add(createRes("${index}01", "${table.tableComment}管理菜单", "WEB", "${module.name?upper_case}_${table.tableName?upper_case}"));
forMgr.add(createRes("${index}0101", "${table.tableComment}管理页", "WEB", "/${module.name}/${table.getFName()}.htm"));
forMgr.add(createRes("${index}010101", "${table.tableComment}模板", "WEB", "/ajax/${module.name}/${table.getFName()}/template"));
forMgr.add(createRes("${index}010102", "${table.tableComment}导入", "WEB", "/ajax/${module.name}/${table.getFName()}/imports"));
forMgr.add(createRes("${index}010103", "${table.tableComment}导出", "WEB", "/ajax/${module.name}/${table.getFName()}/exports"));
</#if>
<#if table.create>
forMgr.add(createRes("${index}010104", "${table.tableComment}新增", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/create"));
forMgr.add(createRes("${index}010104", "${table.tableComment}新增", "WEB", "/ajax/${module.name}/${table.getFName()}/create"));
</#if>
<#if table.delete>
forMgr.add(createRes("${index}010105", "${table.tableComment}删除", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/delete"));
forMgr.add(createRes("${index}010105", "${table.tableComment}删除", "WEB", "/ajax/${module.name}/${table.getFName()}/delete"));
</#if>
<#if table.update>
forMgr.add(createRes("${index}010106", "${table.tableComment}更新", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/update"));
forMgr.add(createRes("${index}010106", "${table.tableComment}更新", "WEB", "/ajax/${module.name}/${table.getFName()}/update"));
</#if>
<#if table.find>
forMgr.add(createRes("${index}010107", "${table.tableComment}查询", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/find"));
forMgr.add(createRes("${index}010107", "${table.tableComment}查询", "WEB", "/ajax/${module.name}/${table.getFName()}/find"));
</#if>
<#if table.get>
forMgr.add(createRes("${index}010108", "${table.tableComment}获取", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/get"));
forMgr.add(createRes("${index}010108", "${table.tableComment}获取", "WEB", "/ajax/${module.name}/${table.getFName()}/get"));
</#if>
<#if table.search>
forMgr.add(createRes("${index}010109", "${table.tableComment}搜索", "WEB", "/ajax/${module.moduleName}/${table.getFName()}/search"));
forMgr.add(createRes("${index}010109", "${table.tableComment}搜索", "WEB", "/ajax/${module.name}/${table.getFName()}/search"));
</#if>
</#list>
</#if>
@ -276,26 +276,26 @@ public class DataInit {
<#if index<10>
<#assign index = "0"+index/>
</#if>
forMgr.add(createRes("A${index}", "${module.moduleComment}", "API", "A${module.moduleName?upper_case}"));
forMgr.add(createRes("A${index}", "${module.note}", "API", "A${module.name?upper_case}"));
<#list module.tables as table>
forMgr.add(createRes("A${index}01", "${table.tableComment}", "API", "A${module.moduleName?upper_case}_${table.tableName?upper_case}"));
forMgr.add(createRes("A${index}01", "${table.tableComment}", "API", "A${module.name?upper_case}_${table.tableName?upper_case}"));
<#if table.create>
forMgr.add(createRes("A${index}0101", "${table.tableComment}新增", "API", "/api/${module.moduleName}/${table.getFName()}/create"));
forMgr.add(createRes("A${index}0101", "${table.tableComment}新增", "API", "/api/${module.name}/${table.getFName()}/create"));
</#if>
<#if table.delete>
forMgr.add(createRes("A${index}0102", "${table.tableComment}删除", "API", "/api/${module.moduleName}/${table.getFName()}/delete"));
forMgr.add(createRes("A${index}0102", "${table.tableComment}删除", "API", "/api/${module.name}/${table.getFName()}/delete"));
</#if>
<#if table.update>
forMgr.add(createRes("A${index}0103", "${table.tableComment}更新", "API", "/api/${module.moduleName}/${table.getFName()}/update"));
forMgr.add(createRes("A${index}0103", "${table.tableComment}更新", "API", "/api/${module.name}/${table.getFName()}/update"));
</#if>
<#if table.find>
forMgr.add(createRes("A${index}0104", "${table.tableComment}查询", "API", "/api/${module.moduleName}/${table.getFName()}/find"));
forMgr.add(createRes("A${index}0104", "${table.tableComment}查询", "API", "/api/${module.name}/${table.getFName()}/find"));
</#if>
<#if table.get>
forMgr.add(createRes("A${index}0105", "${table.tableComment}获取", "API", "/api/${module.moduleName}/${table.getFName()}/get"));
forMgr.add(createRes("A${index}0105", "${table.tableComment}获取", "API", "/api/${module.name}/${table.getFName()}/get"));
</#if>
<#if table.search>
forMgr.add(createRes("A${index}0107", "${table.tableComment}搜索", "API", "/api/${module.moduleName}/${table.getFName()}/search"));
forMgr.add(createRes("A${index}0107", "${table.tableComment}搜索", "API", "/api/${module.name}/${table.getFName()}/search"));
</#if>
</#list>
</#list>

Loading…
Cancel
Save

Powered by TurnKey Linux.