Commit 6cc681b4 authored by 盖献康's avatar 盖献康

sys_menu表添加字段(二级菜单)、车企信息条件排序

parent 294f298e
......@@ -64,7 +64,6 @@
</if>
<if test="contactNumber != null and contactNumber != ''">and ae.contact_number like concat('%', #{contactNumber}, '%')</if>
</where>
order by ae.create_time desc
</select>
<select id="selectAutomobileEnterpriseById" parameterType="Long" resultMap="AutomobileEnterpriseResult">
......
......@@ -11,7 +11,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
/**
* 菜单权限表 sys_menu
*
*
* @author ruoyi
*/
public class SysMenu extends BaseEntity
......@@ -53,7 +53,7 @@ public class SysMenu extends BaseEntity
/** 显示状态(0显示 1隐藏) */
private String visible;
/** 菜单状态(0正常 1停用) */
private String status;
......@@ -63,6 +63,19 @@ public class SysMenu extends BaseEntity
/** 菜单图标 */
private String icon;
/**
* 二级菜单名称
*/
private String secondaryMenuName;
public String getSecondaryMenuName() {
return secondaryMenuName;
}
public void setSecondaryMenuName(String secondaryMenuName) {
this.secondaryMenuName = secondaryMenuName;
}
/** 子菜单 */
private List<SysMenu> children = new ArrayList<SysMenu>();
......@@ -232,7 +245,7 @@ public class SysMenu extends BaseEntity
{
this.children = children;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......@@ -254,6 +267,7 @@ public class SysMenu extends BaseEntity
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("secondaryMenuName", getSecondaryMenuName())
.toString();
}
}
......@@ -5,7 +5,7 @@ import java.util.List;
/**
* 路由配置信息
*
*
* @author ruoyi
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
......@@ -21,6 +21,11 @@ public class RouterVo
*/
private String path;
/**
* 二级菜单名称
*/
private String secondaryMenuName;
/**
* 是否隐藏路由,当设置 true 的时候该路由不会再侧边栏出现
*/
......@@ -56,6 +61,14 @@ public class RouterVo
*/
private List<RouterVo> children;
public String getSecondaryMenuName() {
return secondaryMenuName;
}
public void setSecondaryMenuName(String secondaryMenuName) {
this.secondaryMenuName = secondaryMenuName;
}
public String getName()
{
return name;
......
......@@ -27,7 +27,7 @@ import com.ruoyi.system.service.ISysMenuService;
/**
* 菜单 业务层处理
*
*
* @author ruoyi
*/
@Service
......@@ -46,7 +46,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 根据用户查询系统菜单列表
*
*
* @param userId 用户ID
* @return 菜单列表
*/
......@@ -58,7 +58,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 查询系统菜单列表
*
*
* @param menu 菜单信息
* @return 菜单列表
*/
......@@ -81,7 +81,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 根据用户ID查询权限
*
*
* @param userId 用户ID
* @return 权限列表
*/
......@@ -102,7 +102,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 根据角色ID查询权限
*
*
* @param roleId 角色ID
* @return 权限列表
*/
......@@ -123,7 +123,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 根据用户ID查询菜单
*
*
* @param userId 用户名称
* @return 菜单列表
*/
......@@ -144,7 +144,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 根据角色ID查询菜单树信息
*
*
* @param roleId 角色ID
* @return 选中菜单列表
*/
......@@ -157,7 +157,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 构建前端路由所需要的菜单
*
*
* @param menus 菜单列表
* @return 路由列表
*/
......@@ -169,6 +169,7 @@ public class SysMenuServiceImpl implements ISysMenuService
{
RouterVo router = new RouterVo();
router.setHidden("1".equals(menu.getVisible()));
router.setSecondaryMenuName(menu.getSecondaryMenuName());
router.setName(getRouteName(menu));
router.setPath(getRouterPath(menu));
router.setComponent(getComponent(menu));
......@@ -215,7 +216,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 构建前端所需要树结构
*
*
* @param menus 菜单列表
* @return 树结构列表
*/
......@@ -243,7 +244,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 构建前端所需要下拉树结构
*
*
* @param menus 菜单列表
* @return 下拉树结构列表
*/
......@@ -256,7 +257,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 根据菜单ID查询信息
*
*
* @param menuId 菜单ID
* @return 菜单信息
*/
......@@ -268,7 +269,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 是否存在菜单子节点
*
*
* @param menuId 菜单ID
* @return 结果
*/
......@@ -281,7 +282,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 查询菜单使用数量
*
*
* @param menuId 菜单ID
* @return 结果
*/
......@@ -294,7 +295,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 新增保存菜单信息
*
*
* @param menu 菜单信息
* @return 结果
*/
......@@ -306,7 +307,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 修改保存菜单信息
*
*
* @param menu 菜单信息
* @return 结果
*/
......@@ -318,7 +319,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 删除菜单管理信息
*
*
* @param menuId 菜单ID
* @return 结果
*/
......@@ -330,7 +331,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 校验菜单名称是否唯一
*
*
* @param menu 菜单信息
* @return 结果
*/
......@@ -348,7 +349,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 获取路由名称
*
*
* @param menu 菜单信息
* @return 路由名称
*/
......@@ -365,7 +366,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 获取路由地址
*
*
* @param menu 菜单信息
* @return 路由地址
*/
......@@ -393,7 +394,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 获取组件信息
*
*
* @param menu 菜单信息
* @return 组件信息
*/
......@@ -417,7 +418,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 是否为菜单内部跳转
*
*
* @param menu 菜单信息
* @return 结果
*/
......@@ -429,7 +430,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 是否为内链组件
*
*
* @param menu 菜单信息
* @return 结果
*/
......@@ -440,7 +441,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 是否为parent_view组件
*
*
* @param menu 菜单信息
* @return 结果
*/
......@@ -451,7 +452,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 根据父节点的ID获取所有子节点
*
*
* @param list 分类表
* @param parentId 传入的父节点ID
* @return String
......@@ -474,7 +475,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 递归列表
*
*
* @param list 分类表
* @param t 子节点
*/
......@@ -520,7 +521,7 @@ public class SysMenuServiceImpl implements ISysMenuService
/**
* 内链域名特殊字符替换
*
*
* @return 替换后的内链域名
*/
public String innerLinkReplaceEach(String path)
......
......@@ -25,13 +25,14 @@
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
<result property="secondaryMenuName" column="secondary_menu_name" />
</resultMap>
<sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time, secondary_menu_name
from sys_menu
</sql>
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
<where>
......@@ -47,13 +48,13 @@
</where>
order by parent_id, order_num
</select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time, m.secondary_menu_name
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
......@@ -72,7 +73,7 @@
</if>
order by m.parent_id, m.order_num
</select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
......@@ -83,7 +84,7 @@
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByRoleId" resultType="Long">
select m.menu_id
from sys_menu m
......@@ -94,7 +95,7 @@
</if>
order by m.parent_id, m.order_num
</select>
<select id="selectMenuPerms" resultType="String">
select distinct m.perms
from sys_menu m
......@@ -110,28 +111,28 @@
left join sys_role r on r.role_id = ur.role_id
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
</select>
<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
select distinct m.perms
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
where m.status = '0' and rm.role_id = #{roleId}
</select>
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_id = #{menuId}
</select>
<select id="hasChildByMenuId" resultType="Integer">
select count(1) from sys_menu where parent_id = #{menuId}
select count(1) from sys_menu where parent_id = #{menuId}
</select>
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
</select>
<update id="updateMenu" parameterType="SysMenu">
update sys_menu
<set>
......@@ -194,9 +195,9 @@
sysdate()
)
</insert>
<delete id="deleteMenuById" parameterType="Long">
delete from sys_menu where menu_id = #{menuId}
</delete>
</mapper>
\ No newline at end of file
</mapper>
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