diff --git a/src/main/java/com/xdap/self_development/controller/request/RolePerJoinRequest.java b/src/main/java/com/xdap/self_development/controller/request/RolePerJoinRequest.java index ad141b9..4129741 100644 --- a/src/main/java/com/xdap/self_development/controller/request/RolePerJoinRequest.java +++ b/src/main/java/com/xdap/self_development/controller/request/RolePerJoinRequest.java @@ -6,7 +6,7 @@ import lombok.Data; public class RolePerJoinRequest { //角色ID 菜单ID 参数ID private String roleId; - private String menuId; + private String menuName; private String parameterId; private Integer parameterPer; private String userId; diff --git a/src/main/java/com/xdap/self_development/pojo/ModelMenuDictionaryPojo.java b/src/main/java/com/xdap/self_development/pojo/ModelMenuDictionaryPojo.java index 2f4cd98..06609ef 100644 --- a/src/main/java/com/xdap/self_development/pojo/ModelMenuDictionaryPojo.java +++ b/src/main/java/com/xdap/self_development/pojo/ModelMenuDictionaryPojo.java @@ -15,8 +15,8 @@ public class ModelMenuDictionaryPojo { @RowID(sequence = "yfsjglpt_model_menu_dictionary_s", type = RowIDType.UUID) private String id ; - /** 上级ID,; */ - private String parentId ; + /** 上级名称,; */ + private String parentName ; /** 菜单名称,; */ private String menuName ; /** 菜单代码,; */ @@ -34,9 +34,9 @@ public class ModelMenuDictionaryPojo { /** 最后更新时间,; */ private Date lastUpdateDate ; - public ModelMenuDictionaryPojo(String id, String parentId, String menuName) { + public ModelMenuDictionaryPojo(String id, String parentName, String menuName) { this.id = id; - this.parentId = parentId; + this.parentName = parentName; this.menuName = menuName; } } diff --git a/src/main/java/com/xdap/self_development/pojo/view/MenuParamView.java b/src/main/java/com/xdap/self_development/pojo/view/MenuParamView.java index 6924c2d..e8d7d11 100644 --- a/src/main/java/com/xdap/self_development/pojo/view/MenuParamView.java +++ b/src/main/java/com/xdap/self_development/pojo/view/MenuParamView.java @@ -11,5 +11,6 @@ public class MenuParamView { private String menuPath; private String subsystem; private String parameterName; + private String parameterId; private String parameterPer; } diff --git a/src/main/java/com/xdap/self_development/service/ModelMenuPermissionService.java b/src/main/java/com/xdap/self_development/service/ModelMenuPermissionService.java index 4ccbbab..f22873e 100644 --- a/src/main/java/com/xdap/self_development/service/ModelMenuPermissionService.java +++ b/src/main/java/com/xdap/self_development/service/ModelMenuPermissionService.java @@ -12,5 +12,5 @@ public interface ModelMenuPermissionService { //菜单查询 List selectMenus(); //根据ID查询路径 - ModelMenuDictionaryPojo selectMenuById(String menuId); + ModelMenuDictionaryPojo selectMenuById(String menuName); } diff --git a/src/main/java/com/xdap/self_development/service/impl/ModelMenuPermissionServiceImpl.java b/src/main/java/com/xdap/self_development/service/impl/ModelMenuPermissionServiceImpl.java index 11a72e0..ce20ae7 100644 --- a/src/main/java/com/xdap/self_development/service/impl/ModelMenuPermissionServiceImpl.java +++ b/src/main/java/com/xdap/self_development/service/impl/ModelMenuPermissionServiceImpl.java @@ -44,15 +44,15 @@ public class ModelMenuPermissionServiceImpl implements ModelMenuPermissionServic } for (ModelMenuDictionaryPojo pojo : permissionPojos) { - String parentId = pojo.getParentId(); + String parentName = pojo.getParentName(); MenuListView currentNode = nodeMap.get(pojo.getId()); - if (ObjectUtils.isEmpty(parentId) || !nodeMap.containsKey(parentId)) { + if (ObjectUtils.isEmpty(parentName) || !nodeMap.containsKey(parentName)) { // 根节点 views.add(currentNode); } else { // 子节点,添加到父节点 - MenuListView parentNode = nodeMap.get(parentId); + MenuListView parentNode = nodeMap.get(parentName); if (parentNode.getListViews() == null) { parentNode.setListViews(new ArrayList<>()); } @@ -64,12 +64,12 @@ public class ModelMenuPermissionServiceImpl implements ModelMenuPermissionServic } @Override - public ModelMenuDictionaryPojo selectMenuById(String menuId) { - if (ObjectUtils.isEmpty(menuId)) { + public ModelMenuDictionaryPojo selectMenuById(String menuName) { + if (ObjectUtils.isEmpty(menuName)) { throw new RuntimeException("根据ID查询菜单时ID未传入"); } ModelMenuDictionaryPojo modelMenuDictionaryPojo = businessDatabase.getBusinessDatabase() - .eq("id", menuId) + .eq("menu_name", menuName) .doQuery(ModelMenuDictionaryPojo.class).get(0); return modelMenuDictionaryPojo; } diff --git a/src/main/java/com/xdap/self_development/service/impl/ModelRoleServiceImpl.java b/src/main/java/com/xdap/self_development/service/impl/ModelRoleServiceImpl.java index 46439df..e98a8b2 100644 --- a/src/main/java/com/xdap/self_development/service/impl/ModelRoleServiceImpl.java +++ b/src/main/java/com/xdap/self_development/service/impl/ModelRoleServiceImpl.java @@ -73,15 +73,15 @@ public class ModelRoleServiceImpl implements ModelRoleService { //增加新权限 for (RolePerJoinRequest request : requests) { String roleId = request.getRoleId(); - String menuId = request.getMenuId(); + String menuName = request.getMenuName(); String parameterId = request.getParameterId(); Integer parameterPer = request.getParameterPer(); - if (ObjectUtils.isEmpty(parameterId) || ObjectUtils.isEmpty(parameterPer) || ObjectUtils.isEmpty(roleId) || ObjectUtils.isEmpty(menuId)) { + if (ObjectUtils.isEmpty(parameterId) || ObjectUtils.isEmpty(parameterPer) || ObjectUtils.isEmpty(roleId) || ObjectUtils.isEmpty(menuName)) { log.warn("参数不完整无法写入"); continue; } List modelMenuParameterPojos = businessDatabase.getBusinessDatabase() - .eq("menu_id", menuId) + .eq("menu_id", menuName) .eq("parameter_id", parameterId) .eq("parameter_per", parameterPer) .doQuery(ModelMenuParameterPojo.class); @@ -94,7 +94,7 @@ public class ModelRoleServiceImpl implements ModelRoleService { .eq("id", parameterId) .doQuery(Parameter.class).get(0); ModelMenuParameterPojo modelMenuParameterPojo = new ModelMenuParameterPojo(); - modelMenuParameterPojo.setMenuId(menuId); + modelMenuParameterPojo.setMenuId(menuName); modelMenuParameterPojo.setSubsystem(parameter.getSubsystemName()); modelMenuParameterPojo.setParameterId(parameterId); modelMenuParameterPojo.setParameterPer(parameterPer); @@ -179,6 +179,7 @@ public class ModelRoleServiceImpl implements ModelRoleService { menuParamView.setMenuPath(modelMenuDictionaryPojo.getMenuDesc()); menuParamView.setSubsystem(menuParameter.getSubsystem()); menuParamView.setParameterName(parameter.getParameterName()); + menuParamView.setParameterId(parameterId); menuParamView.setParameterPer(byCode.getDesc()); menuParamViews.add(menuParamView); }