menuId交互全部改为menuName

This commit is contained in:
ys.git 2025-12-08 17:20:33 +08:00
parent 018560cf1e
commit a8e7dd6b78
5 changed files with 16 additions and 16 deletions

View File

@ -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;

View File

@ -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;
}
}

View File

@ -12,5 +12,5 @@ public interface ModelMenuPermissionService {
//菜单查询
List<MenuListView> selectMenus();
//根据ID查询路径
ModelMenuDictionaryPojo selectMenuById(String menuId);
ModelMenuDictionaryPojo selectMenuById(String menuName);
}

View File

@ -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;
}

View File

@ -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<ModelMenuParameterPojo> 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);