diff --git a/db-file/opsli-boot.sql b/db-file/opsli-boot.sql index 7f1cf43..eac8ff2 100644 --- a/db-file/opsli-boot.sql +++ b/db-file/opsli-boot.sql @@ -11,7 +11,7 @@ Target Server Version : 50733 File Encoding : 65001 - Date: 03/06/2021 20:54:51 + Date: 07/06/2021 11:01:05 */ SET NAMES utf8mb4; @@ -208,18 +208,18 @@ CREATE TABLE `gen_template_detail` ( -- ---------------------------- -- Records of gen_template_detail -- ---------------------------- -INSERT INTO `gen_template_detail` VALUES (1400314102462513153, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/entity', '${model.tableHumpName}Entity.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity;\n#else\npackage #(data.packageName+\".\"+data.moduleName).entity;\n#end\n\n#for(pkg : data.model.entityPkgList)\nimport #(pkg);\n#end\nimport com.baomidou.mybatisplus.annotation.FieldStrategy;\nimport com.baomidou.mybatisplus.annotation.TableField;\nimport com.baomidou.mybatisplus.annotation.TableLogic;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\nimport org.opsli.core.base.entity.BaseEntity;\n\n/**\n * #(data.codeTitle) Entity\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\n@Data\n@EqualsAndHashCode(callSuper = false)\npublic class #(data.model.tableHumpName) extends BaseEntity {\n\n\n #for(column : data.model.columnList)\n ### 不等于 删除字段 和 不等于 租户字段放入上边\n #if(column.fieldHumpName != \"deleted\" && column.fieldHumpName != \"tenantId\")\n /** #(column.fieldComments) */\n #if(!column.izNotNull)\n @TableField(updateStrategy = FieldStrategy.IGNORED)\n #end\n private #(column.javaType) #(column.fieldHumpName);\n\n #end\n #end\n\n // ========================================\n\n ### 专门处理 删除字段 和 租户字段\n #for(column : data.model.columnList)\n #if(column.fieldHumpName == \"deleted\")\n /** 逻辑删除字段 */\n @TableLogic\n private Integer deleted;\n #else if(column.fieldHumpName == \"tenantId\")\n /** 多租户字段 */\n private String tenantId;\n #end\n\n #end\n\n}', '1', 0, 1313694379541635074, '2021-06-03 12:51:13', 1313694379541635074, '2021-06-03 12:51:13'); -INSERT INTO `gen_template_detail` VALUES (1400314102672228354, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/mapper', '${model.tableHumpName}Mapper.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).mapper;\n#else\npackage #(data.packageName+\".\"+data.moduleName).mapper;\n#end\n\nimport com.baomidou.mybatisplus.core.mapper.BaseMapper;\nimport org.apache.ibatis.annotations.Mapper;\nimport org.apache.ibatis.annotations.Param;\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity.#(data.model.tableHumpName);\n#else\nimport #(data.packageName+\".\"+data.moduleName).entity.#(data.model.tableHumpName);\n#end\n\n/**\n * #(data.codeTitle) Mapper\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\n@Mapper\npublic interface #(data.model.tableHumpName)Mapper extends BaseMapper<#(data.model.tableHumpName)> {\n\n}', '0', 0, 1313694379541635074, '2021-06-03 12:51:13', 1313694379541635074, '2021-06-03 12:51:13'); -INSERT INTO `gen_template_detail` VALUES (1400314102735142914, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/mapper/xml', '${model.tableHumpName}Mapper.xml', '\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\n\n#else\n\n#end\n\n\n', '0', 0, 1313694379541635074, '2021-06-03 12:51:13', 1313694379541635074, '2021-06-03 12:51:13'); -INSERT INTO `gen_template_detail` VALUES (1400314102860972033, 1398253704724828162, '0', 'org/opsli/api/wrapper/${moduleName}/${subModuleName}', '${model.tableHumpName}Model.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName);\n#else\npackage #(apiPath).wrapper.#(data.moduleName);\n#end\n\n#for(pkg : data.model.entityPkgList)\nimport #(pkg);\n#end\nimport com.alibaba.excel.annotation.ExcelProperty;\nimport io.swagger.annotations.ApiModelProperty;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\nimport #(apiPath).base.warpper.ApiWrapper;\nimport org.opsli.common.annotation.validator.Validator;\nimport org.opsli.common.annotation.validator.ValidatorLenMax;\nimport org.opsli.common.annotation.validator.ValidatorLenMin;\nimport org.opsli.common.enums.ValidatorType;\nimport org.opsli.plugins.excel.annotation.ExcelInfo;\nimport com.fasterxml.jackson.annotation.JsonFormat;\nimport org.springframework.format.annotation.DateTimeFormat;\n\n/**\n* #(data.codeTitle) Model\n*\n* @author #(data.authorName)\n* @date #(currTime)\n*/\n@Data\n@EqualsAndHashCode(callSuper = false)\npublic class #(data.model.tableHumpName)Model extends ApiWrapper {\n\n #for(column : data.model.columnList)\n ### 不等于 删除字段 和 不等于 租户字段放入上边\n #if(column.fieldHumpName != \"deleted\" && column.fieldHumpName != \"tenantId\")\n /** #(column.fieldComments) */\n @ApiModelProperty(value = \"#(column.fieldComments)\")\n @ExcelProperty(value = \"#(column.fieldComments)\", order = #(column.sort))\n #if(column.dictTypeCode != null && column.dictTypeCode != \"\")\n @ExcelInfo( dictType = \"#(column.dictTypeCode)\" )\n #else\n @ExcelInfo\n #end\n #if(column.validateTypeAndCommaList != null && column.validateTypeAndCommaList.size() > 0)\n @Validator({\n #for(typeAndComma : column.validateTypeAndCommaList)\n ValidatorType.#(typeAndComma)\n #end\n })\n #end\n #if(column.fieldLength != null && column.fieldLength > 0)\n #if(column.fieldPrecision != null && column.fieldPrecision > 0)\n @ValidatorLenMax(#(column.fieldLength+column.fieldPrecision))\n #else\n @ValidatorLenMax(#(column.fieldLength))\n #end\n #end\n ### 日期处理\n #if(column.javaType == \"Date\")\n #if(column.showType == \"4\")\n @JsonFormat(timezone = \"GMT+8\", pattern = \"yyyy-MM-dd\")\n @DateTimeFormat(pattern = \"yyyy-MM-dd\")\n #else\n @JsonFormat(timezone = \"GMT+8\", pattern = \"yyyy-MM-dd HH:mm:ss\")\n @DateTimeFormat(pattern = \"yyyy-MM-dd HH:mm:ss\")\n #end\n #end\n private #(column.javaType) #(column.fieldHumpName);\n\n #end\n #end\n\n\n}', '0', 0, 1313694379541635074, '2021-06-03 12:51:13', 1313694379541635074, '2021-06-03 12:51:13'); -INSERT INTO `gen_template_detail` VALUES (1400314102995189761, 1398253704724828162, '0', 'org/opsli/api/web/${moduleName}/${subModuleName}', '${model.tableHumpName}RestApi.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(apiPath).web.#(data.moduleName+\".\"+data.subModuleName);\n#else\npackage #(apiPath).web.#(data.moduleName);\n#end\n\nimport #(apiPath).base.result.ResultVo;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.multipart.MultipartHttpServletRequest;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)Model;\n#else\nimport #(apiPath).wrapper.#(data.moduleName).#(data.model.tableHumpName)Model;\n#end\n\n\n/**\n * #(data.codeTitle) Api\n *\n * 对外 API 直接 暴露 @GetMapping 或者 @PostMapping\n * 对内也推荐 单机版 不需要设置 Mapping 但是调用方法得从Controller写起\n *\n * 这样写法虽然比较绕,但是当单体项目想要改造微服务架构时 时非常容易的\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\npublic interface #(data.model.tableHumpName)RestApi {\n\n /** 标题 */\n String TITLE = \"#(data.codeTitle)\";\n /** 子标题 */\n String SUB_TITLE = \"#(data.codeTitleBrief)\";\n\n /**\n * #(data.codeTitle) 查一条\n * @param model 模型\n * @return ResultVo\n */\n @GetMapping(\"/get\")\n ResultVo<#(data.model.tableHumpName)Model> get(#(data.model.tableHumpName)Model model);\n\n /**\n * #(data.codeTitle) 查询分页\n * @param pageNo 当前页\n * @param pageSize 每页条数\n * @param request request\n * @return ResultVo\n */\n @GetMapping(\"/findPage\")\n ResultVo findPage(\n @RequestParam(name = \"pageNo\", defaultValue = \"1\") Integer pageNo,\n @RequestParam(name = \"pageSize\", defaultValue = \"10\") Integer pageSize,\n HttpServletRequest request\n );\n\n /**\n * #(data.codeTitle) 新增\n * @param model 模型\n * @return ResultVo\n */\n @PostMapping(\"/insert\")\n ResultVo insert(@RequestBody #(data.model.tableHumpName)Model model);\n\n /**\n * #(data.codeTitle) 修改\n * @param model 模型\n * @return ResultVo\n */\n @PostMapping(\"/update\")\n ResultVo update(@RequestBody #(data.model.tableHumpName)Model model);\n\n /**\n * #(data.codeTitle) 删除\n * @param id ID\n * @return ResultVo\n */\n @PostMapping(\"/del\")\n ResultVo del(String id);\n\n /**\n * #(data.codeTitle) 批量删除\n * @param ids ID 数组\n * @return ResultVo\n */\n @PostMapping(\"/delAll\")\n ResultVo delAll(String ids);\n\n /**\n * #(data.codeTitle) Excel 导出\n *\n * 导出时,Token认证和方法权限认证 全部都由自定义完成\n * 因为在 导出不成功时,需要推送错误信息,\n * 前端直接走下载流,当失败时无法获得失败信息,即使前后端换一种方式后端推送二进制文件前端再次解析也是最少2倍的耗时\n * ,且如果数据量过大,前端进行渲染时直接会把浏览器卡死\n * 而直接开启socket接口推送显然是太过浪费资源了,所以目前采用Java最原始的手段\n * response 推送 javascript代码 alert 提示报错信息\n *\n * @param request request\n * @param response response\n */\n @GetMapping(\"/exportExcel\")\n void exportExcel(HttpServletRequest request, HttpServletResponse response);\n\n /**\n * #(data.codeTitle) Excel 导入\n * @param request 文件流 request\n * @return ResultVo\n */\n @PostMapping(\"/importExcel\")\n ResultVo importExcel(MultipartHttpServletRequest request);\n\n /**\n * #(data.codeTitle) Excel 下载导入模版\n * @param response response\n */\n @GetMapping(\"/importExcel/template\")\n void importTemplate(HttpServletResponse response);\n\n}', '0', 0, 1313694379541635074, '2021-06-03 12:51:13', 1313694379541635074, '2021-06-03 12:51:13'); -INSERT INTO `gen_template_detail` VALUES (1400314103062298626, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/web', '${model.tableHumpName}RestController.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).web;\n#else\npackage #(data.packageName+\".\"+data.moduleName).web;\n#end\n\nimport cn.hutool.core.util.ReflectUtil;\nimport cn.hutool.core.convert.Convert;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport org.opsli.common.annotation.RequiresPermissionsCus;\nimport org.apache.shiro.authz.annotation.RequiresPermissions;\nimport #(apiPath).base.result.ResultVo;\nimport org.opsli.common.annotation.ApiRestController;\nimport org.opsli.common.annotation.EnableLog;\nimport org.opsli.core.base.controller.BaseRestController;\nimport org.opsli.core.persistence.Page;\nimport org.opsli.core.persistence.querybuilder.QueryBuilder;\nimport org.opsli.core.persistence.querybuilder.WebQueryBuilder;\nimport org.springframework.web.multipart.MultipartHttpServletRequest;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.lang.reflect.Method;\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)Model;\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).service.I#(data.model.tableHumpName)Service;\nimport #(apiPath).web.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)RestApi;\n#else\nimport #(data.packageName+\".\"+data.moduleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName).#(data.model.tableHumpName)Model;\nimport #(data.packageName+\".\"+data.moduleName).service.I#(data.model.tableHumpName)Service;\nimport #(apiPath).web.#(data.moduleName).#(data.model.tableHumpName)RestApi;\n#end\n\n/**\n * #(data.codeTitle) Controller\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\n@Api(tags = #(data.model.tableHumpName)RestApi.TITLE)\n@Slf4j\n#if(data.subModuleName != null && data.subModuleName != \"\")\n@ApiRestController(\"/#(data.moduleName)/#(data.subModuleName)\")\n#else\n@ApiRestController(\"/#(data.moduleName)\")\n#end\npublic class #(data.model.tableHumpName)RestController extends BaseRestController<#(data.model.tableHumpName), #(data.model.tableHumpName)Model, I#(data.model.tableHumpName)Service>\n implements #(data.model.tableHumpName)RestApi {\n\n\n /**\n * #(data.codeTitleBrief) 查一条\n * @param model 模型\n * @return ResultVo\n */\n @ApiOperation(value = \"获得单条#(data.codeTitleBrief)\", notes = \"获得单条#(data.codeTitleBrief) - ID\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_select\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_select\")\n #end\n @Override\n public ResultVo<#(data.model.tableHumpName)Model> get(#(data.model.tableHumpName)Model model) {\n // 如果系统内部调用 则直接查数据库\n if(model != null && model.getIzApi() != null && model.getIzApi()){\n model = IService.get(model);\n }\n return ResultVo.success(model);\n }\n\n /**\n * #(data.codeTitleBrief) 查询分页\n * @param pageNo 当前页\n * @param pageSize 每页条数\n * @param request request\n * @return ResultVo\n */\n @ApiOperation(value = \"获得分页数据\", notes = \"获得分页数据 - 查询构造器\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_select\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_select\")\n #end\n @Override\n public ResultVo findPage(Integer pageNo, Integer pageSize, HttpServletRequest request) {\n\n QueryBuilder<#(data.model.tableHumpName)> queryBuilder = new WebQueryBuilder<>(entityClazz, request.getParameterMap());\n Page<#(data.model.tableHumpName), #(data.model.tableHumpName)Model> page = new Page<>(pageNo, pageSize);\n page.setQueryWrapper(queryBuilder.build());\n page = IService.findPage(page);\n\n return ResultVo.success(page.getPageData());\n }\n\n /**\n * #(data.codeTitleBrief) 新增\n * @param model 模型\n * @return ResultVo\n */\n @ApiOperation(value = \"新增#(data.codeTitleBrief)数据\", notes = \"新增#(data.codeTitleBrief)数据\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_insert\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_insert\")\n #end\n @EnableLog\n @Override\n public ResultVo insert(#(data.model.tableHumpName)Model model) {\n // 调用新增方法\n IService.insert(model);\n return ResultVo.success(\"新增#(data.codeTitleBrief)成功\");\n }\n\n /**\n * #(data.codeTitleBrief) 修改\n * @param model 模型\n * @return ResultVo\n */\n @ApiOperation(value = \"修改#(data.codeTitleBrief)数据\", notes = \"修改#(data.codeTitleBrief)数据\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_update\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_update\")\n #end\n @EnableLog\n @Override\n public ResultVo update(#(data.model.tableHumpName)Model model) {\n // 调用修改方法\n IService.update(model);\n return ResultVo.success(\"修改#(data.codeTitleBrief)成功\");\n }\n\n\n /**\n * #(data.codeTitleBrief) 删除\n * @param id ID\n * @return ResultVo\n */\n @ApiOperation(value = \"删除#(data.codeTitleBrief)数据\", notes = \"删除#(data.codeTitleBrief)数据\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_update\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_update\")\n #end\n @EnableLog\n @Override\n public ResultVo del(String id){\n IService.delete(id);\n return ResultVo.success(\"删除#(data.codeTitleBrief)成功\");\n }\n\n /**\n * #(data.codeTitleBrief) 批量删除\n * @param ids ID 数组\n * @return ResultVo\n */\n @ApiOperation(value = \"批量删除#(data.codeTitleBrief)数据\", notes = \"批量删除#(data.codeTitleBrief)数据\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_update\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_update\")\n #end\n @EnableLog\n @Override\n public ResultVo delAll(String ids){\n String[] idArray = Convert.toStrArray(ids);\n IService.deleteAll(idArray);\n return ResultVo.success(\"批量删除#(data.codeTitleBrief)成功\");\n }\n\n\n /**\n * #(data.codeTitleBrief) Excel 导出\n * 注:这里 RequiresPermissionsCus 引入的是 自定义鉴权注解\n *\n * 导出时,Token认证和方法权限认证 全部都由自定义完成\n * 因为在 导出不成功时,需要推送错误信息,\n * 前端直接走下载流,当失败时无法获得失败信息,即使前后端换一种方式后端推送二进制文件前端再次解析也是最少2倍的耗时\n * ,且如果数据量过大,前端进行渲染时直接会把浏览器卡死\n * 而直接开启socket接口推送显然是太过浪费资源了,所以目前采用Java最原始的手段\n * response 推送 javascript代码 alert 提示报错信息\n *\n * @param request request\n * @param response response\n */\n @ApiOperation(value = \"导出Excel\", notes = \"导出Excel\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissionsCus(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_export\")\n #else\n @RequiresPermissionsCus(\"#(data.moduleName.toLowerCase())_export\")\n #end\n @EnableLog\n @Override\n public void exportExcel(HttpServletRequest request, HttpServletResponse response) {\n // 当前方法\n Method method = ReflectUtil.getMethodByName(this.getClass(), \"exportExcel\");\n QueryBuilder<#(data.model.tableHumpName)> queryBuilder = new WebQueryBuilder<>(entityClazz, request.getParameterMap());\n super.excelExport(#(data.model.tableHumpName)RestApi.SUB_TITLE, queryBuilder.build(), response, method);\n }\n\n /**\n * #(data.codeTitleBrief) Excel 导入\n * 注:这里 RequiresPermissions 引入的是 Shiro原生鉴权注解\n * @param request 文件流 request\n * @return ResultVo\n */\n @ApiOperation(value = \"导入Excel\", notes = \"导入Excel\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_import\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_import\")\n #end\n @EnableLog\n @Override\n public ResultVo importExcel(MultipartHttpServletRequest request) {\n return super.importExcel(request);\n }\n\n /**\n * #(data.codeTitleBrief) Excel 下载导入模版\n * 注:这里 RequiresPermissionsCus 引入的是 自定义鉴权注解\n * @param response response\n */\n @ApiOperation(value = \"导出Excel模版\", notes = \"导出Excel模版\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissionsCus(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_import\")\n #else\n @RequiresPermissionsCus(\"#(data.moduleName.toLowerCase())_import\")\n #end\n @Override\n public void importTemplate(HttpServletResponse response) {\n // 当前方法\n Method method = ReflectUtil.getMethodByName(this.getClass(), \"importTemplate\");\n super.importTemplate(#(data.model.tableHumpName)RestApi.SUB_TITLE, response, method);\n }\n\n}', '0', 0, 1313694379541635074, '2021-06-03 12:51:13', 1313694379541635074, '2021-06-03 12:51:13'); -INSERT INTO `gen_template_detail` VALUES (1400314103196516353, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/service/impl', '${model.tableHumpName}ServiceImpl.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).service.impl;\n#else\npackage #(data.packageName+\".\"+data.moduleName).service.impl;\n#end\n\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\nimport org.opsli.core.base.service.impl.CrudServiceImpl;\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)Model;\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).service.I#(data.model.tableHumpName)Service;\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).mapper.#(data.model.tableHumpName)Mapper;\n#else\nimport #(data.packageName+\".\"+data.moduleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName).#(data.model.tableHumpName)Model;\nimport #(data.packageName+\".\"+data.moduleName).service.I#(data.model.tableHumpName)Service;\nimport #(data.packageName+\".\"+data.moduleName).mapper.#(data.model.tableHumpName)Mapper;\n#end\n\n\n/**\n * #(data.codeTitle) Service Impl\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\n@Service\npublic class #(data.model.tableHumpName)ServiceImpl extends CrudServiceImpl<#(data.model.tableHumpName)Mapper, #(data.model.tableHumpName), #(data.model.tableHumpName)Model>\n implements I#(data.model.tableHumpName)Service {\n\n @Autowired(required = false)\n private #(data.model.tableHumpName)Mapper mapper;\n\n}', '0', 0, 1313694379541635074, '2021-06-03 12:51:13', 1313694379541635074, '2021-06-03 12:51:13'); -INSERT INTO `gen_template_detail` VALUES (1400314103313956865, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/service', 'I${model.tableHumpName}Service.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).service;\n#else\npackage #(data.packageName+\".\"+data.moduleName).service;\n#end\n\nimport org.opsli.core.base.service.interfaces.CrudServiceInterface;\n\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)Model;\n#else\nimport #(data.packageName+\".\"+data.moduleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName).#(data.model.tableHumpName)Model;\n#end\n\n/**\n * #(data.codeTitle) Service\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\npublic interface I#(data.model.tableHumpName)Service extends CrudServiceInterface<#(data.model.tableHumpName), #(data.model.tableHumpName)Model> {\n\n}', '0', 0, 1313694379541635074, '2021-06-03 12:51:13', 1313694379541635074, '2021-06-03 12:51:13'); -INSERT INTO `gen_template_detail` VALUES (1400314103515283457, 1398253704724828162, '1', 'src/api/${moduleName}/${subModuleName}', '${model.tableHumpName}ManagementApi.js', 'import request from \"@/utils/request\";\nimport { downloadFileByData } from \"@/utils/download\";\n\nexport function getList(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/findPage\",\n #else\n url: \"/api/v1/#(data.moduleName)/findPage\",\n #end\n method: \"get\",\n params: data,\n });\n}\n\nexport function doInsert(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/insert\",\n #else\n url: \"/api/v1/#(data.moduleName)/insert\",\n #end\n method: \"post\",\n data,\n });\n}\n\nexport function doUpdate(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/update\",\n #else\n url: \"/api/v1/#(data.moduleName)/update\",\n #end\n method: \"post\",\n data,\n });\n}\n\nexport function doDelete(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/del\",\n #else\n url: \"/api/v1/#(data.moduleName)/del\",\n #end\n method: \"post\",\n params: data,\n });\n}\n\nexport function doDeleteAll(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/delAll\",\n #else\n url: \"/api/v1/#(data.moduleName)/delAll\",\n #end\n method: \"post\",\n params: data,\n });\n}\n\n/**\n * 导出Excel 目前只支持一层参数传递\n * @param data\n * @returns file\n */\nexport function doExportExcel(data) {\n #if(data.subModuleName != null && data.subModuleName != \"\")\n let requestURL = \"/api/v1/#(data.moduleName)/#(data.subModuleName)/exportExcel\";\n #else\n let requestURL = \"/api/v1/#(data.moduleName)/exportExcel\";\n #end\n // 下载文件\n downloadFileByData(requestURL, data);\n}\n\n/**\n * 下载模版\n * @returns file\n */\nexport function doDownloadTemplate() {\n let data = {};\n #if(data.subModuleName != null && data.subModuleName != \"\")\n let requestURL = \"/api/v1/#(data.moduleName)/#(data.subModuleName)/importExcel/template\";\n #else\n let requestURL = \"/api/v1/#(data.moduleName)/importExcel/template\";\n #end\n // 下载文件\n downloadFileByData(requestURL, data);\n}\n\n/**\n * 导入Excel\n * @returns file\n */\nexport function doImportExcel(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/importExcel\",\n #else\n url: \"/api/v1/#(data.moduleName)/importExcel\",\n #end\n method: \"post\",\n // 最长超时时间 3 分钟\n timeout: 180000,\n headers: {\n \"Content-Type\": \"multipart/form-data\"\n },\n data,\n });\n}', '0', 0, 1313694379541635074, '2021-06-03 12:51:14', 1313694379541635074, '2021-06-03 12:51:14'); -INSERT INTO `gen_template_detail` VALUES (1400314103641112578, 1398253704724828162, '1', 'src/views/modules/${moduleName}/${subModuleName}/components', '${model.tableHumpName}ManagementEdit.vue', '\n\n\n', '0', 0, 1313694379541635074, '2021-06-03 12:51:14', 1313694379541635074, '2021-06-03 12:51:14'); -INSERT INTO `gen_template_detail` VALUES (1400314103825661953, 1398253704724828162, '1', 'src/views/modules/${moduleName}/${subModuleName}/components', '${model.tableHumpName}ManagementImport.vue', '\n\n\n', '0', 0, 1313694379541635074, '2021-06-03 12:51:14', 1313694379541635074, '2021-06-03 12:51:14'); -INSERT INTO `gen_template_detail` VALUES (1400314103955685378, 1398253704724828162, '1', 'src/views/modules/${moduleName}/${subModuleName}', 'index.vue', '\n\n\n', '0', 0, 1313694379541635074, '2021-06-03 12:51:14', 1313694379541635074, '2021-06-03 12:51:14'); +INSERT INTO `gen_template_detail` VALUES (1401734394151141378, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/entity', '${model.tableHumpName}Entity.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity;\n#else\npackage #(data.packageName+\".\"+data.moduleName).entity;\n#end\n\n#for(pkg : data.model.entityPkgList)\nimport #(pkg);\n#end\nimport com.baomidou.mybatisplus.annotation.FieldStrategy;\nimport com.baomidou.mybatisplus.annotation.TableField;\nimport com.baomidou.mybatisplus.annotation.TableLogic;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\nimport org.opsli.core.base.entity.BaseEntity;\n\n/**\n * #(data.codeTitle) Entity\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\n@Data\n@EqualsAndHashCode(callSuper = false)\npublic class #(data.model.tableHumpName) extends BaseEntity {\n\n\n #for(column : data.model.columnList)\n ### 不等于 删除字段 和 不等于 租户字段放入上边\n #if(column.fieldHumpName != \"deleted\" && column.fieldHumpName != \"tenantId\")\n /** #(column.fieldComments) */\n #if(!column.izNotNull)\n @TableField(updateStrategy = FieldStrategy.IGNORED)\n #end\n private #(column.javaType) #(column.fieldHumpName);\n\n #end\n #end\n\n // ========================================\n\n ### 专门处理 删除字段 和 租户字段\n #for(column : data.model.columnList)\n #if(column.fieldHumpName == \"deleted\")\n /** 逻辑删除字段 */\n @TableLogic\n private Integer deleted;\n #else if(column.fieldHumpName == \"tenantId\")\n /** 多租户字段 */\n private String tenantId;\n #end\n\n #end\n\n}', '1', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394184695810, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/mapper', '${model.tableHumpName}Mapper.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).mapper;\n#else\npackage #(data.packageName+\".\"+data.moduleName).mapper;\n#end\n\nimport com.baomidou.mybatisplus.core.mapper.BaseMapper;\nimport org.apache.ibatis.annotations.Mapper;\nimport org.apache.ibatis.annotations.Param;\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity.#(data.model.tableHumpName);\n#else\nimport #(data.packageName+\".\"+data.moduleName).entity.#(data.model.tableHumpName);\n#end\n\n/**\n * #(data.codeTitle) Mapper\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\n@Mapper\npublic interface #(data.model.tableHumpName)Mapper extends BaseMapper<#(data.model.tableHumpName)> {\n\n}', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394222444546, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/mapper/xml', '${model.tableHumpName}Mapper.xml', '\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\n\n#else\n\n#end\n\n\n', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394318913537, 1398253704724828162, '0', 'org/opsli/api/wrapper/${moduleName}/${subModuleName}', '${model.tableHumpName}Model.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName);\n#else\npackage #(apiPath).wrapper.#(data.moduleName);\n#end\n\n#for(pkg : data.model.entityPkgList)\nimport #(pkg);\n#end\nimport com.alibaba.excel.annotation.ExcelProperty;\nimport io.swagger.annotations.ApiModelProperty;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\nimport #(apiPath).base.warpper.ApiWrapper;\nimport org.opsli.common.annotation.validator.Validator;\nimport org.opsli.common.annotation.validator.ValidatorLenMax;\nimport org.opsli.common.annotation.validator.ValidatorLenMin;\nimport org.opsli.common.enums.ValidatorType;\nimport org.opsli.plugins.excel.annotation.ExcelInfo;\nimport com.fasterxml.jackson.databind.ser.std.ToStringSerializer;\nimport com.fasterxml.jackson.databind.annotation.JsonSerialize;\nimport com.fasterxml.jackson.annotation.JsonFormat;\nimport org.springframework.format.annotation.DateTimeFormat;\n\n/**\n* #(data.codeTitle) Model\n*\n* @author #(data.authorName)\n* @date #(currTime)\n*/\n@Data\n@EqualsAndHashCode(callSuper = false)\npublic class #(data.model.tableHumpName)Model extends ApiWrapper {\n\n #for(column : data.model.columnList)\n ### 不等于 删除字段 和 不等于 租户字段放入上边\n #if(column.fieldHumpName != \"deleted\" && column.fieldHumpName != \"tenantId\")\n /** #(column.fieldComments) */\n @ApiModelProperty(value = \"#(column.fieldComments)\")\n @ExcelProperty(value = \"#(column.fieldComments)\", order = #(column.sort))\n #if(column.dictTypeCode != null && column.dictTypeCode != \"\")\n @ExcelInfo( dictType = \"#(column.dictTypeCode)\" )\n #else\n @ExcelInfo\n #end\n #if(column.validateTypeAndCommaList != null && column.validateTypeAndCommaList.size() > 0)\n @Validator({\n #for(typeAndComma : column.validateTypeAndCommaList)\n ValidatorType.#(typeAndComma)\n #end\n })\n #end\n #if(column.fieldLength != null && column.fieldLength > 0)\n #if(column.fieldPrecision != null && column.fieldPrecision > 0)\n @ValidatorLenMax(#(column.fieldLength+column.fieldPrecision))\n #else\n @ValidatorLenMax(#(column.fieldLength))\n #end\n #end\n ### 日期处理\n #if(column.javaType == \"Date\")\n #if(column.showType == \"4\")\n @JsonFormat(timezone = \"GMT+8\", pattern = \"yyyy-MM-dd\")\n @DateTimeFormat(pattern = \"yyyy-MM-dd\")\n #else\n @JsonFormat(timezone = \"GMT+8\", pattern = \"yyyy-MM-dd HH:mm:ss\")\n @DateTimeFormat(pattern = \"yyyy-MM-dd HH:mm:ss\")\n #end\n #else if(column.javaType == \"Long\" || column.javaType == \"long\")\n @JsonSerialize(using= ToStringSerializer.class)\n #end\n private #(column.javaType) #(column.fieldHumpName);\n\n #end\n #end\n\n\n}', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394348273665, 1398253704724828162, '0', 'org/opsli/api/web/${moduleName}/${subModuleName}', '${model.tableHumpName}RestApi.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(apiPath).web.#(data.moduleName+\".\"+data.subModuleName);\n#else\npackage #(apiPath).web.#(data.moduleName);\n#end\n\nimport #(apiPath).base.result.ResultVo;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.PostMapping;\nimport org.springframework.web.bind.annotation.RequestBody;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.multipart.MultipartHttpServletRequest;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)Model;\n#else\nimport #(apiPath).wrapper.#(data.moduleName).#(data.model.tableHumpName)Model;\n#end\n\n\n/**\n * #(data.codeTitle) Api\n *\n * 对外 API 直接 暴露 @GetMapping 或者 @PostMapping\n * 对内也推荐 单机版 不需要设置 Mapping 但是调用方法得从Controller写起\n *\n * 这样写法虽然比较绕,但是当单体项目想要改造微服务架构时 时非常容易的\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\npublic interface #(data.model.tableHumpName)RestApi {\n\n /** 标题 */\n String TITLE = \"#(data.codeTitle)\";\n /** 子标题 */\n String SUB_TITLE = \"#(data.codeTitleBrief)\";\n\n /**\n * #(data.codeTitle) 查一条\n * @param model 模型\n * @return ResultVo\n */\n @GetMapping(\"/get\")\n ResultVo<#(data.model.tableHumpName)Model> get(#(data.model.tableHumpName)Model model);\n\n /**\n * #(data.codeTitle) 查询分页\n * @param pageNo 当前页\n * @param pageSize 每页条数\n * @param request request\n * @return ResultVo\n */\n @GetMapping(\"/findPage\")\n ResultVo findPage(\n @RequestParam(name = \"pageNo\", defaultValue = \"1\") Integer pageNo,\n @RequestParam(name = \"pageSize\", defaultValue = \"10\") Integer pageSize,\n HttpServletRequest request\n );\n\n /**\n * #(data.codeTitle) 新增\n * @param model 模型\n * @return ResultVo\n */\n @PostMapping(\"/insert\")\n ResultVo insert(@RequestBody #(data.model.tableHumpName)Model model);\n\n /**\n * #(data.codeTitle) 修改\n * @param model 模型\n * @return ResultVo\n */\n @PostMapping(\"/update\")\n ResultVo update(@RequestBody #(data.model.tableHumpName)Model model);\n\n /**\n * #(data.codeTitle) 删除\n * @param id ID\n * @return ResultVo\n */\n @PostMapping(\"/del\")\n ResultVo del(String id);\n\n /**\n * #(data.codeTitle) 批量删除\n * @param ids ID 数组\n * @return ResultVo\n */\n @PostMapping(\"/delAll\")\n ResultVo delAll(String ids);\n\n /**\n * #(data.codeTitle) Excel 导出\n *\n * 导出时,Token认证和方法权限认证 全部都由自定义完成\n * 因为在 导出不成功时,需要推送错误信息,\n * 前端直接走下载流,当失败时无法获得失败信息,即使前后端换一种方式后端推送二进制文件前端再次解析也是最少2倍的耗时\n * ,且如果数据量过大,前端进行渲染时直接会把浏览器卡死\n * 而直接开启socket接口推送显然是太过浪费资源了,所以目前采用Java最原始的手段\n * response 推送 javascript代码 alert 提示报错信息\n *\n * @param request request\n * @param response response\n */\n @GetMapping(\"/exportExcel\")\n void exportExcel(HttpServletRequest request, HttpServletResponse response);\n\n /**\n * #(data.codeTitle) Excel 导入\n * @param request 文件流 request\n * @return ResultVo\n */\n @PostMapping(\"/importExcel\")\n ResultVo importExcel(MultipartHttpServletRequest request);\n\n /**\n * #(data.codeTitle) Excel 下载导入模版\n * @param response response\n */\n @GetMapping(\"/importExcel/template\")\n void importTemplate(HttpServletResponse response);\n\n}', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394390216705, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/web', '${model.tableHumpName}RestController.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).web;\n#else\npackage #(data.packageName+\".\"+data.moduleName).web;\n#end\n\nimport cn.hutool.core.util.ReflectUtil;\nimport cn.hutool.core.convert.Convert;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport lombok.extern.slf4j.Slf4j;\nimport org.opsli.common.annotation.RequiresPermissionsCus;\nimport org.apache.shiro.authz.annotation.RequiresPermissions;\nimport #(apiPath).base.result.ResultVo;\nimport org.opsli.common.annotation.ApiRestController;\nimport org.opsli.common.annotation.EnableLog;\nimport org.opsli.core.base.controller.BaseRestController;\nimport org.opsli.core.persistence.Page;\nimport org.opsli.core.persistence.querybuilder.QueryBuilder;\nimport org.opsli.core.persistence.querybuilder.WebQueryBuilder;\nimport org.springframework.web.multipart.MultipartHttpServletRequest;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.lang.reflect.Method;\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)Model;\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).service.I#(data.model.tableHumpName)Service;\nimport #(apiPath).web.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)RestApi;\n#else\nimport #(data.packageName+\".\"+data.moduleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName).#(data.model.tableHumpName)Model;\nimport #(data.packageName+\".\"+data.moduleName).service.I#(data.model.tableHumpName)Service;\nimport #(apiPath).web.#(data.moduleName).#(data.model.tableHumpName)RestApi;\n#end\n\n/**\n * #(data.codeTitle) Controller\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\n@Api(tags = #(data.model.tableHumpName)RestApi.TITLE)\n@Slf4j\n#if(data.subModuleName != null && data.subModuleName != \"\")\n@ApiRestController(\"/#(data.moduleName)/#(data.subModuleName)\")\n#else\n@ApiRestController(\"/#(data.moduleName)\")\n#end\npublic class #(data.model.tableHumpName)RestController extends BaseRestController<#(data.model.tableHumpName), #(data.model.tableHumpName)Model, I#(data.model.tableHumpName)Service>\n implements #(data.model.tableHumpName)RestApi {\n\n\n /**\n * #(data.codeTitleBrief) 查一条\n * @param model 模型\n * @return ResultVo\n */\n @ApiOperation(value = \"获得单条#(data.codeTitleBrief)\", notes = \"获得单条#(data.codeTitleBrief) - ID\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_select\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_select\")\n #end\n @Override\n public ResultVo<#(data.model.tableHumpName)Model> get(#(data.model.tableHumpName)Model model) {\n // 如果系统内部调用 则直接查数据库\n if(model != null && model.getIzApi() != null && model.getIzApi()){\n model = IService.get(model);\n }\n return ResultVo.success(model);\n }\n\n /**\n * #(data.codeTitleBrief) 查询分页\n * @param pageNo 当前页\n * @param pageSize 每页条数\n * @param request request\n * @return ResultVo\n */\n @ApiOperation(value = \"获得分页数据\", notes = \"获得分页数据 - 查询构造器\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_select\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_select\")\n #end\n @Override\n public ResultVo findPage(Integer pageNo, Integer pageSize, HttpServletRequest request) {\n\n QueryBuilder<#(data.model.tableHumpName)> queryBuilder = new WebQueryBuilder<>(entityClazz, request.getParameterMap());\n Page<#(data.model.tableHumpName), #(data.model.tableHumpName)Model> page = new Page<>(pageNo, pageSize);\n page.setQueryWrapper(queryBuilder.build());\n page = IService.findPage(page);\n\n return ResultVo.success(page.getPageData());\n }\n\n /**\n * #(data.codeTitleBrief) 新增\n * @param model 模型\n * @return ResultVo\n */\n @ApiOperation(value = \"新增#(data.codeTitleBrief)数据\", notes = \"新增#(data.codeTitleBrief)数据\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_insert\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_insert\")\n #end\n @EnableLog\n @Override\n public ResultVo insert(#(data.model.tableHumpName)Model model) {\n // 调用新增方法\n IService.insert(model);\n return ResultVo.success(\"新增#(data.codeTitleBrief)成功\");\n }\n\n /**\n * #(data.codeTitleBrief) 修改\n * @param model 模型\n * @return ResultVo\n */\n @ApiOperation(value = \"修改#(data.codeTitleBrief)数据\", notes = \"修改#(data.codeTitleBrief)数据\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_update\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_update\")\n #end\n @EnableLog\n @Override\n public ResultVo update(#(data.model.tableHumpName)Model model) {\n // 调用修改方法\n IService.update(model);\n return ResultVo.success(\"修改#(data.codeTitleBrief)成功\");\n }\n\n\n /**\n * #(data.codeTitleBrief) 删除\n * @param id ID\n * @return ResultVo\n */\n @ApiOperation(value = \"删除#(data.codeTitleBrief)数据\", notes = \"删除#(data.codeTitleBrief)数据\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_update\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_update\")\n #end\n @EnableLog\n @Override\n public ResultVo del(String id){\n IService.delete(id);\n return ResultVo.success(\"删除#(data.codeTitleBrief)成功\");\n }\n\n /**\n * #(data.codeTitleBrief) 批量删除\n * @param ids ID 数组\n * @return ResultVo\n */\n @ApiOperation(value = \"批量删除#(data.codeTitleBrief)数据\", notes = \"批量删除#(data.codeTitleBrief)数据\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_update\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_update\")\n #end\n @EnableLog\n @Override\n public ResultVo delAll(String ids){\n String[] idArray = Convert.toStrArray(ids);\n IService.deleteAll(idArray);\n return ResultVo.success(\"批量删除#(data.codeTitleBrief)成功\");\n }\n\n\n /**\n * #(data.codeTitleBrief) Excel 导出\n * 注:这里 RequiresPermissionsCus 引入的是 自定义鉴权注解\n *\n * 导出时,Token认证和方法权限认证 全部都由自定义完成\n * 因为在 导出不成功时,需要推送错误信息,\n * 前端直接走下载流,当失败时无法获得失败信息,即使前后端换一种方式后端推送二进制文件前端再次解析也是最少2倍的耗时\n * ,且如果数据量过大,前端进行渲染时直接会把浏览器卡死\n * 而直接开启socket接口推送显然是太过浪费资源了,所以目前采用Java最原始的手段\n * response 推送 javascript代码 alert 提示报错信息\n *\n * @param request request\n * @param response response\n */\n @ApiOperation(value = \"导出Excel\", notes = \"导出Excel\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissionsCus(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_export\")\n #else\n @RequiresPermissionsCus(\"#(data.moduleName.toLowerCase())_export\")\n #end\n @EnableLog\n @Override\n public void exportExcel(HttpServletRequest request, HttpServletResponse response) {\n // 当前方法\n Method method = ReflectUtil.getMethodByName(this.getClass(), \"exportExcel\");\n QueryBuilder<#(data.model.tableHumpName)> queryBuilder = new WebQueryBuilder<>(entityClazz, request.getParameterMap());\n super.excelExport(#(data.model.tableHumpName)RestApi.SUB_TITLE, queryBuilder.build(), response, method);\n }\n\n /**\n * #(data.codeTitleBrief) Excel 导入\n * 注:这里 RequiresPermissions 引入的是 Shiro原生鉴权注解\n * @param request 文件流 request\n * @return ResultVo\n */\n @ApiOperation(value = \"导入Excel\", notes = \"导入Excel\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_import\")\n #else\n @RequiresPermissions(\"#(data.moduleName.toLowerCase())_import\")\n #end\n @EnableLog\n @Override\n public ResultVo importExcel(MultipartHttpServletRequest request) {\n return super.importExcel(request);\n }\n\n /**\n * #(data.codeTitleBrief) Excel 下载导入模版\n * 注:这里 RequiresPermissionsCus 引入的是 自定义鉴权注解\n * @param response response\n */\n @ApiOperation(value = \"导出Excel模版\", notes = \"导出Excel模版\")\n #if(data.subModuleName != null && data.subModuleName != \"\")\n @RequiresPermissionsCus(\"#(data.moduleName.toLowerCase())_#(data.subModuleName.toLowerCase())_import\")\n #else\n @RequiresPermissionsCus(\"#(data.moduleName.toLowerCase())_import\")\n #end\n @Override\n public void importTemplate(HttpServletResponse response) {\n // 当前方法\n Method method = ReflectUtil.getMethodByName(this.getClass(), \"importTemplate\");\n super.importTemplate(#(data.model.tableHumpName)RestApi.SUB_TITLE, response, method);\n }\n\n}', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394432159745, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/service/impl', '${model.tableHumpName}ServiceImpl.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).service.impl;\n#else\npackage #(data.packageName+\".\"+data.moduleName).service.impl;\n#end\n\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\nimport org.opsli.core.base.service.impl.CrudServiceImpl;\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)Model;\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).service.I#(data.model.tableHumpName)Service;\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).mapper.#(data.model.tableHumpName)Mapper;\n#else\nimport #(data.packageName+\".\"+data.moduleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName).#(data.model.tableHumpName)Model;\nimport #(data.packageName+\".\"+data.moduleName).service.I#(data.model.tableHumpName)Service;\nimport #(data.packageName+\".\"+data.moduleName).mapper.#(data.model.tableHumpName)Mapper;\n#end\n\n\n/**\n * #(data.codeTitle) Service Impl\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\n@Service\npublic class #(data.model.tableHumpName)ServiceImpl extends CrudServiceImpl<#(data.model.tableHumpName)Mapper, #(data.model.tableHumpName), #(data.model.tableHumpName)Model>\n implements I#(data.model.tableHumpName)Service {\n\n @Autowired(required = false)\n private #(data.model.tableHumpName)Mapper mapper;\n\n}', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394478297089, 1398253704724828162, '0', '${packageName}/${moduleName}/${subModuleName}/service', 'I${model.tableHumpName}Service.java', '#if(data.subModuleName != null && data.subModuleName != \"\")\npackage #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).service;\n#else\npackage #(data.packageName+\".\"+data.moduleName).service;\n#end\n\nimport org.opsli.core.base.service.interfaces.CrudServiceInterface;\n\n\n#if(data.subModuleName != null && data.subModuleName != \"\")\nimport #(data.packageName+\".\"+data.moduleName+\".\"+data.subModuleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName+\".\"+data.subModuleName).#(data.model.tableHumpName)Model;\n#else\nimport #(data.packageName+\".\"+data.moduleName).entity.#(data.model.tableHumpName);\nimport #(apiPath).wrapper.#(data.moduleName).#(data.model.tableHumpName)Model;\n#end\n\n/**\n * #(data.codeTitle) Service\n *\n * @author #(data.authorName)\n * @date #(currTime)\n */\npublic interface I#(data.model.tableHumpName)Service extends CrudServiceInterface<#(data.model.tableHumpName), #(data.model.tableHumpName)Model> {\n\n}', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394520240129, 1398253704724828162, '1', 'src/api/${moduleName}/${subModuleName}', '${model.tableHumpName}ManagementApi.js', 'import request from \"@/utils/request\";\nimport { downloadFileByData } from \"@/utils/download\";\n\nexport function getList(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/findPage\",\n #else\n url: \"/api/v1/#(data.moduleName)/findPage\",\n #end\n method: \"get\",\n params: data,\n });\n}\n\nexport function doInsert(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/insert\",\n #else\n url: \"/api/v1/#(data.moduleName)/insert\",\n #end\n method: \"post\",\n data,\n });\n}\n\nexport function doUpdate(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/update\",\n #else\n url: \"/api/v1/#(data.moduleName)/update\",\n #end\n method: \"post\",\n data,\n });\n}\n\nexport function doDelete(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/del\",\n #else\n url: \"/api/v1/#(data.moduleName)/del\",\n #end\n method: \"post\",\n params: data,\n });\n}\n\nexport function doDeleteAll(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/delAll\",\n #else\n url: \"/api/v1/#(data.moduleName)/delAll\",\n #end\n method: \"post\",\n params: data,\n });\n}\n\n/**\n * 导出Excel 目前只支持一层参数传递\n * @param data\n * @returns file\n */\nexport function doExportExcel(data) {\n #if(data.subModuleName != null && data.subModuleName != \"\")\n let requestURL = \"/api/v1/#(data.moduleName)/#(data.subModuleName)/exportExcel\";\n #else\n let requestURL = \"/api/v1/#(data.moduleName)/exportExcel\";\n #end\n // 下载文件\n downloadFileByData(requestURL, data);\n}\n\n/**\n * 下载模版\n * @returns file\n */\nexport function doDownloadTemplate() {\n let data = {};\n #if(data.subModuleName != null && data.subModuleName != \"\")\n let requestURL = \"/api/v1/#(data.moduleName)/#(data.subModuleName)/importExcel/template\";\n #else\n let requestURL = \"/api/v1/#(data.moduleName)/importExcel/template\";\n #end\n // 下载文件\n downloadFileByData(requestURL, data);\n}\n\n/**\n * 导入Excel\n * @returns file\n */\nexport function doImportExcel(data) {\n return request({\n #if(data.subModuleName != null && data.subModuleName != \"\")\n url: \"/api/v1/#(data.moduleName)/#(data.subModuleName)/importExcel\",\n #else\n url: \"/api/v1/#(data.moduleName)/importExcel\",\n #end\n method: \"post\",\n // 最长超时时间 3 分钟\n timeout: 180000,\n headers: {\n \"Content-Type\": \"multipart/form-data\"\n },\n data,\n });\n}', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394595737601, 1398253704724828162, '1', 'src/views/modules/${moduleName}/${subModuleName}/components', '${model.tableHumpName}ManagementEdit.vue', '\n\n\n', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394671235073, 1398253704724828162, '1', 'src/views/modules/${moduleName}/${subModuleName}/components', '${model.tableHumpName}ManagementImport.vue', '\n\n\n', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); +INSERT INTO `gen_template_detail` VALUES (1401734394738343938, 1398253704724828162, '1', 'src/views/modules/${moduleName}/${subModuleName}', 'index.vue', '\n\n\n', '0', 0, 1, '2021-06-07 10:54:57', 1, '2021-06-07 10:54:57'); -- ---------------------------- -- Table structure for sys_area @@ -6426,7 +6426,7 @@ INSERT INTO `sys_options` VALUES (3, 'crypto_asymmetric_private_key', '非对称 INSERT INTO `sys_options` VALUES (4, 'def_pass', '系统默认密码', 'Aa123456', '1', NULL, 1, 1, '2021-02-10 23:19:35', 1, '2021-06-03 18:43:05', '2021-06-03 18:43:04'); INSERT INTO `sys_options` VALUES (5, 'def_role', '系统默认角色编号', '007', '1', NULL, 1, 1, '2021-02-10 23:19:35', 1, '2021-06-03 18:43:05', '2021-06-03 18:43:04'); INSERT INTO `sys_options` VALUES (1387687830355902465, 'email_account', '邮箱账号', 'meet.parker@foxmail.com', '1', NULL, 39, 1, '2021-04-29 16:38:55', 1313694379541635074, '2021-06-03 15:21:11', '2021-06-03 15:21:10'); -INSERT INTO `sys_options` VALUES (1387687830523674626, 'email_password', '邮箱密码', 'xxxxxxxxxxxxxxxxxxxx', '1', NULL, 39, 1, '2021-04-29 16:38:55', 1313694379541635074, '2021-06-03 15:21:11', '2021-06-03 15:21:10'); +INSERT INTO `sys_options` VALUES (1387687830523674626, 'email_password', '邮箱密码', 'fegwtupshtkwbeeb', '1', NULL, 39, 1, '2021-04-29 16:38:55', 1313694379541635074, '2021-06-03 15:21:11', '2021-06-03 15:21:10'); INSERT INTO `sys_options` VALUES (1387687830586589186, 'email_addresser', '发件人', '测试', '1', NULL, 39, 1, '2021-04-29 16:38:55', 1313694379541635074, '2021-06-03 15:21:11', '2021-06-03 15:21:10'); INSERT INTO `sys_options` VALUES (1387692123406348289, 'email_smtp', 'SMTP地址', 'smtp.qq.com', '1', NULL, 30, 1, '2021-04-29 16:55:59', 1313694379541635074, '2021-06-03 15:21:10', '2021-06-03 15:21:10'); INSERT INTO `sys_options` VALUES (1387695264482865154, 'email_port', 'SMTP端口', '465', '1', NULL, 22, 1, '2021-04-29 17:08:28', 1313694379541635074, '2021-06-03 15:21:11', '2021-06-03 15:21:10'); @@ -6442,7 +6442,7 @@ INSERT INTO `sys_options` VALUES (1400402255261159426, 'storage_upyun_domain', ' INSERT INTO `sys_options` VALUES (1400402255261159427, 'storage_upyun_path_prefix', 'storage_upyun_path_prefix', '', '1', NULL, 3, 1, '2021-06-03 18:41:31', 1, '2021-06-03 19:47:51', '2021-06-03 19:47:51'); INSERT INTO `sys_options` VALUES (1400402255328268290, 'storage_upyun_bucket_name', 'storage_upyun_bucket_name', 'opsli-storage', '1', NULL, 3, 1, '2021-06-03 18:41:31', 1, '2021-06-03 19:47:51', '2021-06-03 19:47:51'); INSERT INTO `sys_options` VALUES (1400402255328268291, 'storage_upyun_username', 'storage_upyun_username', 'opsli', '1', NULL, 3, 1, '2021-06-03 18:41:31', 1, '2021-06-03 19:47:51', '2021-06-03 19:47:51'); -INSERT INTO `sys_options` VALUES (1400402255328268292, 'storage_upyun_password', 'storage_upyun_password', 'xxxxxxxxxxx', '1', NULL, 3, 1, '2021-06-03 18:41:31', 1, '2021-06-03 19:47:51', '2021-06-03 19:47:51'); +INSERT INTO `sys_options` VALUES (1400402255328268292, 'storage_upyun_password', 'storage_upyun_password', 'DjWrspmr4UbfBdnkrgm4ssCOVK7rUTXF', '1', NULL, 3, 1, '2021-06-03 18:41:31', 1, '2021-06-03 19:47:51', '2021-06-03 19:47:51'); -- ---------------------------- -- Table structure for sys_org