diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/Ajax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/Ajax.java index 1a268f3e..10cff5cd 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/Ajax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/Ajax.java @@ -2,6 +2,7 @@ package ${domain}.action.ajax.${moduleName}; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; +import ${domain}.frame.base.Error; import ${domain}.frame.excel.WExcel; import ${domain}.frame.utils.LogUtil; import ${domain}.frame.auth.LocalData; @@ -131,7 +132,16 @@ public class ${table.getCName()}Ajax{ @Override public List exec(${table.getCName()} o, int index) { ${table.getCName()}CreateRequest request = MapperUtil.map(o, ${table.getCName()}CreateRequest.class); - return ValidationUtil.validate(request); + List validate = ValidationUtil.validate(request); + if (validate == null || validate.size() == 0) { + ${table.getCName()}CreateResponse ${table.getFName()}CreateResponse = ${table.getFName()}Manager.create(request, LocalData.getToken()); + if (${table.getFName()}CreateResponse.hasError()) { + for (Error error : ${table.getFName()}CreateResponse.getErrors()) { + validate.add(error.getMessage()); + } + } + } + return validate; } }); diff --git a/src/main/resources/modules/SpringBoot/java/module/ent/entity.ftl b/src/main/resources/modules/SpringBoot/java/module/ent/entity.ftl index d57f2564..51b707ba 100644 --- a/src/main/resources/modules/SpringBoot/java/module/ent/entity.ftl +++ b/src/main/resources/modules/SpringBoot/java/module/ent/entity.ftl @@ -3,7 +3,7 @@ package ${domain}.module.${moduleName}.ent; <#if table.has('Date')> import java.util.Date; -<#if table.getHtml()> +<#if table.isPage()> import ${domain}.frame.excel.annotation.ExcelNote; import ${domain}.frame.excel.annotation.ExcelSelect; import com.alibaba.excel.annotation.ExcelProperty; @@ -18,7 +18,7 @@ import ${domain}.frame.base.BaseEntity; * @version 0.0.1 * @since ${.now?string["yyyy-MM-dd"]} */ -<#if table.getHtml()> +<#if table.isPage()> @ExcelSheet("${table.tableComment?default("")}") public class ${table.getCName()} extends BaseEntity { @@ -28,7 +28,7 @@ public class ${table.getCName()} extends BaseEntity { /** * ${field.fieldName} - ${field.fieldComment?default("")} */ -<#if table.getHtml()> +<#if table.isPage()> @ExcelProperty("${field.fieldComment?default("")}") @ExcelNote("") <#if field.getFieldTypeJava()=="Boolean"> diff --git a/src/main/resources/modules/SpringBoot/java/module/wsys/mgr/LogtaskManager.java b/src/main/resources/modules/SpringBoot/java/module/wsys/mgr/LogtaskManager.java index 1f3c53f1..2b7ab8fd 100644 --- a/src/main/resources/modules/SpringBoot/java/module/wsys/mgr/LogtaskManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/wsys/mgr/LogtaskManager.java @@ -1,14 +1,12 @@ package ${domain}.module.wsys.mgr; +import ${domain}.frame.auth.Token; import ${domain}.module.wsys.req.LogtaskCreateRequest; import ${domain}.module.wsys.req.LogtaskDeleteRequest; import ${domain}.module.wsys.req.LogtaskFindRequest; -import ${domain}.module.wsys.req.LogtaskUpdateRequest; import ${domain}.module.wsys.rsp.LogtaskCreateResponse; import ${domain}.module.wsys.rsp.LogtaskDeleteResponse; import ${domain}.module.wsys.rsp.LogtaskFindResponse; -import ${domain}.module.wsys.rsp.LogtaskUpdateResponse; -import ${domain}.frame.auth.Token; /** * 任务日志 diff --git a/src/main/resources/modules/SpringBoot/java/module/wsys/mgr/LogtaskManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/wsys/mgr/LogtaskManagerImpl.java index d7404770..1fcf5bdd 100644 --- a/src/main/resources/modules/SpringBoot/java/module/wsys/mgr/LogtaskManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/wsys/mgr/LogtaskManagerImpl.java @@ -1,27 +1,25 @@ package ${domain}.module.wsys.mgr; -import ${domain}.frame.utils.IDgenerator; -import ${domain}.frame.utils.Message; -import ${domain}.frame.base.ErrorType; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.github.pagehelper.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import ${domain}.frame.auth.Token; +import ${domain}.frame.base.ErrorType; +import ${domain}.frame.utils.IDgenerator; import ${domain}.frame.utils.MapperUtil; +import ${domain}.frame.utils.Message; import ${domain}.frame.utils.ValidationUtil; import ${domain}.module.wsys.ent.Logtask; import ${domain}.module.wsys.mpr.LogtaskMapper; import ${domain}.module.wsys.req.LogtaskCreateRequest; import ${domain}.module.wsys.req.LogtaskDeleteRequest; import ${domain}.module.wsys.req.LogtaskFindRequest; -import ${domain}.module.wsys.req.LogtaskUpdateRequest; import ${domain}.module.wsys.rsp.LogtaskCreateResponse; import ${domain}.module.wsys.rsp.LogtaskDeleteResponse; import ${domain}.module.wsys.rsp.LogtaskFindResponse; -import ${domain}.module.wsys.rsp.LogtaskUpdateResponse; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.github.pagehelper.util.StringUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; /** * LOGTASK - 任务日志 diff --git a/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl b/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl index 92ea61de..eaf9bbf8 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/control/nav.ftl @@ -20,6 +20,9 @@ onUploadProgress: function (progressEvent) { var complete = (progressEvent.loaded / progressEvent.total * 100 | 0) + '%' nav.tipShow("上传中(" + complete + ")") + if (complete === '100%') { + nav.tipShow("处理中,请稍等..") + } }, }); var importService = axios.create({ @@ -31,6 +34,9 @@ onUploadProgress: function (progressEvent) { var complete = (progressEvent.loaded / progressEvent.total * 100 | 0) + '%' nav.tipShow("上传中(" + complete + ")") + if (complete === '100%') { + nav.tipShow("处理中,请稍等..") + } }, }); function handleError(status) { diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/home.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/home.ftl index b9c70508..59ab9cc9 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/home.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/home.ftl @@ -112,8 +112,8 @@ 日志框架
  • - poi-ooxml v3.8 - Excel处理框架,导入导出数据 + easyexcel 2.2.6 + EasyExcel是一个基于Java的简单、省内存的读写Excel的开源项目。在尽可能节约内存的情况下支持读写百M的Excel。
  • jQuery v3.2.1 diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl index 21b00142..6866d9a5 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl @@ -93,7 +93,7 @@ ${module.note} <#list module.tables as table> - <#if table.getHtml()> + <#if table.isPage()> ${print('<#if token.hasRes("${module.name?upper_case}_${table.tableName?upper_case}")>')} ${table.tableComment} ${print('')} diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl index 981e0c8f..744c7b8e 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl @@ -93,31 +93,32 @@ - - 新增 + <#if table.isPageAdd()> + 新增 + + 删除 - 导出 - + + <#if table.isPageImp()> + + + - - - - - + + + + + <#if table.isPageExp()> - - - + + + + - - - - - - - - - + + + + forMgr.add(createRes("${index}", "${module.note}菜单", "WEB", "${module.name?upper_case}")); <#list module.tables as table> - <#if table.html> + <#if table.isPage()> 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"));