diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/sql/menu_insert.ftl b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/sql/menu_insert.ftl index 0fff8d6c93..8475dd3a57 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/sql/menu_insert.ftl +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/common/sql/menu_insert.ftl @@ -4,24 +4,24 @@ <#assign id = '${.now?string["yyyyMMddhhmmSSsss"]}0'> INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) -VALUES ('${id}', NULL, '${tableVo.ftlDescription}', '/${entityPackage}/${entityName?uncap_first}List', '${entityPackage}/${entityName}List', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0); +VALUES ('${id}', NULL, '${tableVo.ftlDescription}', '/${entityPackage}/${entityName?uncap_first}List', '${entityPackage}/${entityName}List', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0); -- 权限控制sql -- 新增 INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}1', '${id}', '添加${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${bussiPackage}:${tableName}:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); +VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}1', '${id}', '添加${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${entityPackage}:${tableName}:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); -- 编辑 INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}2', '${id}', '编辑${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${bussiPackage}:${tableName}:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); +VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}2', '${id}', '编辑${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${entityPackage}:${tableName}:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); -- 删除 INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}3', '${id}', '删除${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${bussiPackage}:${tableName}:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); +VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}3', '${id}', '删除${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${entityPackage}:${tableName}:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); -- 批量删除 INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}4', '${id}', '批量删除${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${bussiPackage}:${tableName}:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); +VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}4', '${id}', '批量删除${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${entityPackage}:${tableName}:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); -- 导出excel INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}5', '${id}', '导出excel_${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${bussiPackage}:${tableName}:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); +VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}5', '${id}', '导出excel_${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${entityPackage}:${tableName}:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); -- 导入excel INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}6', '${id}', '导入excel_${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${bussiPackage}:${tableName}:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file +VALUES ('${.now?string["yyyyMMddhhmmSSsss"]}6', '${id}', '导入excel_${tableVo.ftlDescription}', NULL, NULL, 0, NULL, NULL, 2, '${entityPackage}:${tableName}:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '${.now?string["yyyy-MM-dd HH:mm:ss"]}', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai index d12e75ced7..41ff104bf0 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai @@ -35,6 +35,7 @@ import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; <#assign bpm_flag=false> <#list originalColumns as po> <#if po.fieldDbName=='bpm_status'> @@ -86,7 +87,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-添加") @ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加") - //@RequiresPermissions("${bussiPackage}:${tableName}:add") + @RequiresPermissions("${entityPackage}:${tableName}:add") @PostMapping(value = "/add") public Result add(@RequestBody ${entityName} ${entityName?uncap_first}) { <#if bpm_flag> @@ -104,7 +105,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-编辑") @ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑") - //@RequiresPermissions("${bussiPackage}:${tableName}:edit") + @RequiresPermissions("${entityPackage}:${tableName}:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody ${entityName} ${entityName?uncap_first}) { ${entityName?uncap_first}Service.updateById(${entityName?uncap_first}); @@ -119,7 +120,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除") @ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:delete") + @RequiresPermissions("${entityPackage}:${tableName}:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { ${entityName?uncap_first}Service.removeById(id); @@ -134,7 +135,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-批量删除") @ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:deleteBatch") + @RequiresPermissions("${entityPackage}:${tableName}:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.${entityName?uncap_first}Service.removeByIds(Arrays.asList(ids.split(","))); @@ -164,7 +165,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @param request * @param ${entityName?uncap_first} */ - //@RequiresPermissions("${bussiPackage}:${tableName}:exportXls") + @RequiresPermissions("${entityPackage}:${tableName}:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) { return super.exportXls(request, ${entityName?uncap_first}, ${entityName}.class, "${tableVo.ftlDescription}"); @@ -177,7 +178,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @param response * @return */ - //@RequiresPermissions("${tableName}:importExcel") + @RequiresPermissions("${entityPackage}:${tableName}:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, ${entityName}.class); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai index 18a8a09947..d6ea9333bc 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai @@ -45,6 +45,7 @@ import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; <#assign bpm_flag=false> <#list originalColumns as po> <#if po.fieldDbName=='bpm_status'> @@ -100,7 +101,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-添加") @ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加") - //@RequiresPermissions("${bussiPackage}:${tableName}:add") + @RequiresPermissions("${entityPackage}:${tableName}:add") @PostMapping(value = "/add") public Result add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) { ${entityName} ${entityName?uncap_first} = new ${entityName}(); @@ -120,7 +121,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-编辑") @ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑") - //@RequiresPermissions("${bussiPackage}:${tableName}:edit") + @RequiresPermissions("${entityPackage}:${tableName}:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) { ${entityName} ${entityName?uncap_first} = new ${entityName}(); @@ -141,7 +142,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除") @ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:delete") + @RequiresPermissions("${entityPackage}:${tableName}:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { ${entityName?uncap_first}Service.delMain(id); @@ -156,7 +157,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-批量删除") @ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:deleteBatch") + @RequiresPermissions("${entityPackage}:${tableName}:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(","))); @@ -203,7 +204,7 @@ public class ${entityName}Controller { * @param request * @param ${entityName?uncap_first} */ - //@RequiresPermissions("${bussiPackage}:${tableName}:exportXls") + @RequiresPermissions("${entityPackage}:${tableName}:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) { // Step.1 组装查询条件查询数据 @@ -247,7 +248,7 @@ public class ${entityName}Controller { * @param response * @return */ - //@RequiresPermissions("${bussiPackage}:${tableName}:importExcel") + @RequiresPermissions("${entityPackage}:${tableName}:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai index 47a9aae59a..c44af815da 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai @@ -36,6 +36,7 @@ import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; /** * @Description: ${tableVo.ftlDescription} @@ -206,7 +207,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-添加") @ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加") - //@RequiresPermissions("${bussiPackage}:${tableName}:add") + @RequiresPermissions("${entityPackage}:${tableName}:add") @PostMapping(value = "/add") public Result add(@RequestBody ${entityName} ${entityName?uncap_first}) { ${entityName?uncap_first}Service.add${entityName}(${entityName?uncap_first}); @@ -221,7 +222,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-编辑") @ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑") - //@RequiresPermissions("${bussiPackage}:${tableName}:edit") + @RequiresPermissions("${entityPackage}:${tableName}:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody ${entityName} ${entityName?uncap_first}) { ${entityName?uncap_first}Service.update${entityName}(${entityName?uncap_first}); @@ -236,7 +237,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除") @ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:delete") + @RequiresPermissions("${entityPackage}:${tableName}:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { ${entityName?uncap_first}Service.delete${entityName}(id); @@ -251,7 +252,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-批量删除") @ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:deleteBatch") + @RequiresPermissions("${entityPackage}:${tableName}:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.${entityName?uncap_first}Service.removeByIds(Arrays.asList(ids.split(","))); @@ -281,7 +282,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @param request * @param ${entityName?uncap_first} */ - //@RequiresPermissions("${bussiPackage}:${tableName}:exportXls") + @RequiresPermissions("${entityPackage}:${tableName}:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) { return super.exportXls(request, ${entityName?uncap_first}, ${entityName}.class, "${tableVo.ftlDescription}"); @@ -294,7 +295,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * @param response * @return */ - //@RequiresPermissions("${bussiPackage}:${tableName}:importExcel") + @RequiresPermissions("${entityPackage}:${tableName}:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, ${entityName}.class); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai index 0434cc0e24..ba2fa8dbff 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai @@ -38,6 +38,7 @@ import java.io.IOException; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.apache.shiro.authz.annotation.RequiresPermissions; /** * @Description: ${tableVo.ftlDescription} @@ -90,7 +91,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-添加") @ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加") - //@RequiresPermissions("${bussiPackage}:${tableName}:add") + @RequiresPermissions("${entityPackage}:${tableName}:add") @PostMapping(value = "/add") public Result add(@RequestBody ${entityName} ${entityName?uncap_first}) { ${entityName?uncap_first}Service.save(${entityName?uncap_first}); @@ -104,7 +105,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-编辑") @ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑") - //@RequiresPermissions("${bussiPackage}:${tableName}:edit") + @RequiresPermissions("${entityPackage}:${tableName}:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody ${entityName} ${entityName?uncap_first}) { ${entityName?uncap_first}Service.updateById(${entityName?uncap_first}); @@ -118,7 +119,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除") @ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:delete") + @RequiresPermissions("${entityPackage}:${tableName}:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { ${entityName?uncap_first}Service.delMain(id); @@ -132,7 +133,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e */ @AutoLog(value = "${tableVo.ftlDescription}-批量删除") @ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:deleteBatch") + @RequiresPermissions("${entityPackage}:${tableName}:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(","))); @@ -143,7 +144,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * 导出 * @return */ - //@RequiresPermissions("${bussiPackage}:${tableName}:exportXls") + @RequiresPermissions("${entityPackage}:${tableName}:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) { return super.exportXls(request, ${entityName?uncap_first}, ${entityName}.class, "${tableVo.ftlDescription}"); @@ -153,7 +154,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e * 导入 * @return */ - //@RequiresPermissions("${bussiPackage}:${tableName}:importExcel") + @RequiresPermissions("${entityPackage}:${tableName}:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, ${entityName}.class); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai index 6a92cd9347..3a4deae18e 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai @@ -45,6 +45,7 @@ import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; /** * @Description: ${tableVo.ftlDescription} @@ -94,7 +95,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-添加") @ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加") - //@RequiresPermissions("${bussiPackage}:${tableName}:add") + @RequiresPermissions("${entityPackage}:${tableName}:add") @PostMapping(value = "/add") public Result add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) { ${entityName} ${entityName?uncap_first} = new ${entityName}(); @@ -111,7 +112,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-编辑") @ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑") - //@RequiresPermissions("${bussiPackage}:${tableName}:edit") + @RequiresPermissions("${entityPackage}:${tableName}:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) { ${entityName} ${entityName?uncap_first} = new ${entityName}(); @@ -132,7 +133,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除") @ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:delete") + @RequiresPermissions("${entityPackage}:${tableName}:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { ${entityName?uncap_first}Service.delMain(id); @@ -147,7 +148,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-批量删除") @ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:deleteBatch") + @RequiresPermissions("${entityPackage}:${tableName}:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(","))); @@ -198,7 +199,7 @@ public class ${entityName}Controller { * @param request * @param ${entityName?uncap_first} */ - //@RequiresPermissions("${bussiPackage}:${tableName}:exportXls") + @RequiresPermissions("${entityPackage}:${tableName}:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) { // Step.1 组装查询条件查询数据 @@ -242,7 +243,7 @@ public class ${entityName}Controller { * @param response * @return */ - //@RequiresPermissions("${bussiPackage}:${tableName}:importExcel") + @RequiresPermissions("${entityPackage}:${tableName}:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai index ff7cf50109..f448a160ed 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai @@ -45,6 +45,8 @@ import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + <#assign bpm_flag=false> <#list originalColumns as po> <#if po.fieldDbName=='bpm_status'> @@ -100,7 +102,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-添加") @ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加") - //@RequiresPermissions("${bussiPackage}:${tableName}:add") + @RequiresPermissions("${entityPackage}:${tableName}:add") @PostMapping(value = "/add") public Result add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) { ${entityName} ${entityName?uncap_first} = new ${entityName}(); @@ -120,7 +122,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-编辑") @ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑") - //@RequiresPermissions("${bussiPackage}:${tableName}:edit") + @RequiresPermissions("${entityPackage}:${tableName}:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) { ${entityName} ${entityName?uncap_first} = new ${entityName}(); @@ -141,7 +143,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除") @ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:delete") + @RequiresPermissions("${entityPackage}:${tableName}:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { ${entityName?uncap_first}Service.delMain(id); @@ -156,7 +158,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-批量删除") @ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:deleteBatch") + @RequiresPermissions("${entityPackage}:${tableName}:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(","))); @@ -203,7 +205,7 @@ public class ${entityName}Controller { * @param request * @param ${entityName?uncap_first} */ - //@RequiresPermissions("${bussiPackage}:${tableName}:exportXls") + @RequiresPermissions("${entityPackage}:${tableName}:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) { // Step.1 组装查询条件查询数据 @@ -247,7 +249,7 @@ public class ${entityName}Controller { * @param response * @return */ - //@RequiresPermissions("${bussiPackage}:${tableName}:importExcel") + @RequiresPermissions("${entityPackage}:${tableName}:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei index b82ccd80de..2d489cda9f 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue3Native/components/${entityName}Form.vuei @@ -54,8 +54,8 @@ <#else> >({ loading: false, columns: ${sub.entityName?uncap_first}Columns, - dataSource: [], - show: false + dataSource: [] }); @@ -203,7 +202,6 @@ <#else> const ${sub.entityName?uncap_first}DataList = await query${sub.entityName}ListByMainId(row['${subMainFieldMap[sub.entityName]}']); ${sub.entityName?uncap_first}Table.dataSource = [...${sub.entityName?uncap_first}DataList]; - ${sub.entityName?uncap_first}Table.show = true; } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai index 77fbc8426e..004e1cf221 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai @@ -45,6 +45,7 @@ import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; /** * @Description: ${tableVo.ftlDescription} @@ -94,7 +95,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-添加") @ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加") - //@RequiresPermissions("${bussiPackage}:${tableName}:add") + @RequiresPermissions("${entityPackage}:${tableName}:add") @PostMapping(value = "/add") public Result add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) { ${entityName} ${entityName?uncap_first} = new ${entityName}(); @@ -111,7 +112,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-编辑") @ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑") - //@RequiresPermissions("${bussiPackage}:${tableName}:edit") + @RequiresPermissions("${entityPackage}:${tableName}:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) { ${entityName} ${entityName?uncap_first} = new ${entityName}(); @@ -132,7 +133,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-通过id删除") @ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:delete") + @RequiresPermissions("${entityPackage}:${tableName}:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { ${entityName?uncap_first}Service.delMain(id); @@ -147,7 +148,7 @@ public class ${entityName}Controller { */ @AutoLog(value = "${tableVo.ftlDescription}-批量删除") @ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除") - //@RequiresPermissions("${bussiPackage}:${tableName}:deleteBatch") + @RequiresPermissions("${entityPackage}:${tableName}:deleteBatch") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(","))); @@ -194,7 +195,7 @@ public class ${entityName}Controller { * @param request * @param ${entityName?uncap_first} */ - //@RequiresPermissions("${bussiPackage}:${tableName}:exportXls") + @RequiresPermissions("${entityPackage}:${tableName}:exportXls") @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) { // Step.1 组装查询条件查询数据 @@ -238,7 +239,7 @@ public class ${entityName}Controller { * @param response * @return */ - //@RequiresPermissions("${bussiPackage}:${tableName}:importExcel") + @RequiresPermissions("${entityPackage}:${tableName}:importExcel") @RequestMapping(value = "/importExcel", method = RequestMethod.POST) public Result importExcel(HttpServletRequest request, HttpServletResponse response) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei index 4c64baf2b6..12de1f6b9f 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/vue3/components/${entityName}Form.vuei @@ -149,12 +149,10 @@ const tabsStyle = computed(() => { let height: Nullable = null let minHeight = '100px' - let maxHeight: Nullable = '500px' // 弹窗wrapper - <#-- update-begin-author:taoyan date:2022-11-14 for:VUEN-2674 【代码生成】对接流程表单 附加单据显示问题 5.多tab生成代码后,新增 没有滚动条,只能填写部分字段 --> let overflow = 'auto'; - return {height, minHeight, maxHeight, overflow}; + return {height, minHeight, overflow}; <#-- update-end-author:taoyan date:2022-11-14 for:VUEN-2674 【代码生成】对接流程表单 附加单据显示问题 5.多tab生成代码后,新增 没有滚动条,只能填写部分字段 --> })