菜单修改接口调整

This commit is contained in:
张松 2025-07-03 15:19:35 +08:00
parent 8678797663
commit 29e3f9ebc5
1 changed files with 3 additions and 1 deletions

View File

@ -254,7 +254,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> imp
BeanUtil.copyProperties(roleEditDTO, role);
boolean b = updateById(role);
if (b) {
sysRolesMenusService.updateChain().eq(SysRolesMenus::getRoleId, role.getId()).remove();
if (roleEditDTO.getAdminMenuIdList() != null && !roleEditDTO.getAdminMenuIdList().isEmpty() || roleEditDTO.getCashMenuIdList() != null && !roleEditDTO.getCashMenuIdList().isEmpty()) {
sysRolesMenusService.updateChain().eq(SysRolesMenus::getRoleId, role.getId()).remove();
}
if (roleEditDTO.getAdminMenuIdList() != null && !roleEditDTO.getAdminMenuIdList().isEmpty()) {
addMenu(role.getId(), roleEditDTO.getAdminMenuIdList(), true);