Commit d8e32a0e authored by huyuchen's avatar huyuchen

hyc 用户菜单字典调整

parent c55c74da
......@@ -29,6 +29,11 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public enum MenuTypeEnum {
/**
* 字典类型-系统内置(不可修改)
*/
SYSTEM("0", "系统内置"),
/**
* 左侧菜单
*/
......
......@@ -63,6 +63,11 @@ public interface ErrorCodes {
*/
String SYS_ROLE_NAMEORCODE_EXISTING = "sys.role.nameOrCode.existing";
/**
* 系统内置菜单不允许删除
*/
String SYS_MENU_DELETE_SYSTEM = "sys.menu.delete.system";
/**
* 菜单存在下级节点 删除失败
*/
......@@ -88,4 +93,9 @@ public interface ErrorCodes {
*/
String SYS_APP_PHONE_UNREGISTERED = "sys.app.phone.unregistered";
/**
* 字典存在下级节点 删除失败
*/
String SYS_DICT_DELETE_EXISTING = "sys.dict.delete.existing";
}
sys.user.update.passwordError=\u539f\u5bc6\u7801\u9519\u8bef\uff0c\u4fee\u6539\u5931\u8d25
sys.user.query.error=\u83b7\u53d6\u5f53\u524d\u7528\u6237\u4fe1\u606f\u5931\u8d25
sys.user.update.passwordError=\u539F\u5BC6\u7801\u9519\u8BEF\uFF0C\u4FEE\u6539\u5931\u8D25
sys.user.query.error=\u83B7\u53D6\u5F53\u524D\u7528\u6237\u4FE1\u606F\u5931\u8D25
sys.user.username.existing={0} \u7528\u6237\u540D\u5DF2\u5B58\u5728
sys.user.userInfo.empty={0} \u7528\u6237\u4fe1\u606f\u4e3a\u7a7a
sys.user.userInfo.empty={0} \u7528\u6237\u4FE1\u606F\u4E3A\u7A7A
sys.dept.deptName.inexistence={0} \u90e8\u95e8\u540d\u79f0\u4e0d\u5b58\u5728
sys.dept.deptName.inexistence={0} \u90E8\u95E8\u540D\u79F0\u4E0D\u5B58\u5728
sys.post.postName.inexistence={0} \u5c97\u4f4d\u540d\u79f0\u4e0d\u5b58\u5728
sys.post.nameOrCode.existing={0} {1} \u5c97\u4f4d\u540d\u6216\u5c97\u4f4d\u7f16\u7801\u5df2\u7ecf\u5b58\u5728
sys.post.postName.inexistence={0} \u5C97\u4F4D\u540D\u79F0\u4E0D\u5B58\u5728
sys.post.nameOrCode.existing={0} {1} \u5C97\u4F4D\u540D\u6216\u5C97\u4F4D\u7F16\u7801\u5DF2\u7ECF\u5B58\u5728
sys.role.roleName.inexistence={0} \u89d2\u8272\u540d\u79f0\u4e0d\u5b58\u5728
sys.role.nameOrCode.existing={0} {1} \u89d2\u8272\u540d\u6216\u89d2\u8272\u7f16\u7801\u5df2\u7ecf\u5b58\u5728
sys.role.roleName.inexistence={0} \u89D2\u8272\u540D\u79F0\u4E0D\u5B58\u5728
sys.role.nameOrCode.existing={0} {1} \u89D2\u8272\u540D\u6216\u89D2\u8272\u7F16\u7801\u5DF2\u7ECF\u5B58\u5728
sys.param.delete.system=\u7cfb\u7edf\u5185\u7f6e\u53c2\u6570\u4e0d\u80fd\u5220\u9664
sys.param.delete.system=\u7CFB\u7EDF\u5185\u7F6E\u53C2\u6570\u4E0D\u80FD\u5220\u9664
sys.param.config.error={0} \u7CFB\u7EDF\u53C2\u6570\u914D\u7F6E\u9519\u8BEF
sys.menu.delete.existing=\u83dc\u5355\u542b\u6709\u4e0b\u7ea7\u4e0d\u80fd\u5220\u9664
sys.menu.delete.existing=\u83DC\u5355\u542B\u6709\u4E0B\u7EA7\u4E0D\u80FD\u5220\u9664
sys.menu.delete.system=\u7CFB\u7EDF\u5185\u7F6E\u83DC\u5355\u4E0D\u80FD\u5220\u9664
sys.app.sms.often=\u9a8c\u8bc1\u7801\u53d1\u9001\u8fc7\u9891\u7e41
sys.app.phone.unregistered={0} \u624b\u673a\u53f7\u672a\u6ce8\u518c
sys.app.sms.often=\u9A8C\u8BC1\u7801\u53D1\u9001\u8FC7\u9891\u7E41
sys.app.phone.unregistered={0} \u624B\u673A\u53F7\u672A\u6CE8\u518C
sys.dict.delete.system=\u7cfb\u7edf\u5185\u7f6e\u5b57\u5178\u9879\u76ee\u4e0d\u80fd\u5220\u9664
sys.dict.update.system=\u7cfb\u7edf\u5185\u7f6e\u5b57\u5178\u9879\u76ee\u4e0d\u80fd\u4fee\u6539
sys.dict.delete.system=\u7CFB\u7EDF\u5185\u7F6E\u5B57\u5178\u9879\u76EE\u4E0D\u80FD\u5220\u9664
sys.dict.update.system=\u7CFB\u7EDF\u5185\u7F6E\u5B57\u5178\u9879\u76EE\u4E0D\u80FD\u4FEE\u6539
sys.dict.delete.existing=\u5B57\u5178\u5B58\u5728\u4E0B\u7EA7\u8282\u70B9\u4E0D\u80FD\u5931\u8D25
......@@ -110,4 +110,9 @@ public class SysMenu extends BaseEntity {
@Schema(description = "是否支持数据权限标识")
private String flag;
/**
* 是否是系统内置
*/
@Schema(description = "是否系统内置")
private String systemFlag;
}
......@@ -15,6 +15,7 @@
*/
package com.yifu.cloud.plus.v1.yifu.admin.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeUtil;
......@@ -62,6 +63,9 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
@Override
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
public void removeDictItem(Long id) {
// 查询父节点为当前节点的节点
List<SysDictItem> dictList = this.list(Wrappers.<SysDictItem>query().lambda().eq(SysDictItem::getParentId, id));
Assert.isTrue(CollUtil.isEmpty(dictList), MsgUtils.getMessage(ErrorCodes.SYS_MENU_DELETE_EXISTING));
// 根据ID查询字典ID
SysDictItem dictItem = this.getById(id);
SysDict dict = dictService.getById(dictItem.getDictId());
......
......@@ -79,6 +79,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
Assert.isTrue(CollUtil.isEmpty(menuList), MsgUtils.getMessage(ErrorCodes.SYS_MENU_DELETE_EXISTING));
SysMenu sysMenu = this.getById(id);
// 系统内置
Assert.state(!MenuTypeEnum.SYSTEM.getType().equals(sysMenu.getSystemFlag()),
MsgUtils.getMessage(ErrorCodes.SYS_MENU_DELETE_SYSTEM));
sysRoleMenuMapper.delete(Wrappers.<SysRoleMenu>query().lambda().eq(SysRoleMenu::getMenuId, id));
// 删除当前菜单及其子菜单
return this.removeById(id);
......
......@@ -34,6 +34,7 @@
<result column="update_time" property="updateTime"/>
<result column="del_flag" property="delFlag"/>
<result column="flag" property="flag"/>
<result column="system_flag" property="systemFlag"/>
</resultMap>
<!--通过角色查询菜单信息-->
......@@ -49,6 +50,7 @@
sys_menu.type,
sys_menu.del_flag,
sys_menu.flag,
sys_menu.system_flag,
sys_menu.create_by,
sys_menu.create_time,
sys_menu.update_by,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment