mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-19 13:35:07 +08:00
@ -15,6 +15,7 @@ import cn.iocoder.dashboard.modules.system.mq.producer.permission.SysMenuProduce
|
||||
import cn.iocoder.dashboard.modules.system.service.permission.SysMenuService;
|
||||
import cn.iocoder.dashboard.modules.system.service.permission.SysPermissionService;
|
||||
import cn.iocoder.dashboard.util.collection.CollectionUtils;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
@ -168,10 +169,6 @@ public class SysMenuServiceImpl implements SysMenuService {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteMenu(Long menuId) {
|
||||
// 校验更新的菜单是否存在
|
||||
if (menuMapper.selectById(menuId) == null) {
|
||||
throw ServiceExceptionUtil.exception(MENU_NOT_EXISTS);
|
||||
}
|
||||
// 校验是否还有子菜单
|
||||
if (menuMapper.selectCountByParentId(menuId) > 0) {
|
||||
throw ServiceExceptionUtil.exception(MENU_EXISTS_CHILDREN);
|
||||
@ -250,7 +247,8 @@ public class SysMenuServiceImpl implements SysMenuService {
|
||||
* @param parentId 父菜单编号
|
||||
* @param childId 当前菜单编号
|
||||
*/
|
||||
private void checkParentResource(Long parentId, Long childId) {
|
||||
@VisibleForTesting
|
||||
public void checkParentResource(Long parentId, Long childId) {
|
||||
if (parentId == null || MenuIdEnum.ROOT.getId().equals(parentId)) {
|
||||
return;
|
||||
}
|
||||
@ -279,7 +277,8 @@ public class SysMenuServiceImpl implements SysMenuService {
|
||||
* @param parentId 父菜单编号
|
||||
* @param id 菜单编号
|
||||
*/
|
||||
private void checkResource(Long parentId, String name, Long id) {
|
||||
@VisibleForTesting
|
||||
public void checkResource(Long parentId, String name, Long id) {
|
||||
SysMenuDO menu = menuMapper.selectByParentIdAndName(parentId, name);
|
||||
if (menu == null) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user