|
|
@@ -12,6 +12,7 @@ import com.jzg.commons.entity.po.SysUserRole;
|
|
|
import com.jzg.commons.entity.vo.SystemMenuVo;
|
|
|
import com.jzg.commons.util.idgen.IdGenerate;
|
|
|
import com.jzg.mapper.SysMenuMapper;
|
|
|
+import com.jzg.mapper.SysRolePermsMapper;
|
|
|
import com.jzg.mapper.SysSystemMenuMapper;
|
|
|
import com.jzg.mapper.SysUserRoleMapper;
|
|
|
import com.jzg.service.SysMenuService;
|
|
|
@@ -44,6 +45,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
|
|
|
|
|
|
private final BaseController baseController;
|
|
|
|
|
|
+ private final SysRolePermsMapper sysRolePermsMapper;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询菜单的树形结构(基于租户的)
|
|
|
@@ -188,6 +191,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
|
|
|
}
|
|
|
List<SysMenu> menuByRoleId = sysMenuMapper.getMenuByRoleId(roleIds);
|
|
|
List<SysMenu> distinctMenuList = menuByRoleId.stream()
|
|
|
+ // modify by lipf, 2026年5月11日16:32:31 提高代码健壮性
|
|
|
+ .filter(action-> action.getId() != null)
|
|
|
.collect(Collectors.toMap(
|
|
|
SysMenu::getId,
|
|
|
Function.identity(),
|
|
|
@@ -254,6 +259,21 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
|
|
|
public List<SysCommonFunctionDto> getCommonFunction(String systemCode, String userId) {
|
|
|
return this.baseMapper.getCommonFunction(systemCode, userId);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除菜单
|
|
|
+ * 删除菜单的时候,将菜单和角色的对应关系也删除
|
|
|
+ *
|
|
|
+ * @param menuId 菜单序号
|
|
|
+ * @author lipf
|
|
|
+ * @date 2026/5/11 16:34
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean deleteMenuById(String menuId) {
|
|
|
+ log.info("根据序号删除对应的菜单信息:menuId=[{}]", menuId);
|
|
|
+ sysRolePermsMapper.deleteByMenuId(menuId);
|
|
|
+ return this.removeById(menuId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|