新增公司

This commit is contained in:
sxu 2025-01-04 22:31:36 +08:00
parent 8494438c24
commit 1566d127ec
5 changed files with 44 additions and 7 deletions

View File

@ -73,6 +73,10 @@ public class SysDept extends BaseEntity {
* 父部门名称 * 父部门名称
*/ */
private String parentName; private String parentName;
//权限模版ID
private Long templateId;
/** /**
* *
*/ */
@ -115,6 +119,14 @@ public class SysDept extends BaseEntity {
private String keyWord; private String keyWord;
public Long getTemplateId() {
return templateId;
}
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
public void setCity(String city) { public void setCity(String city) {
this.city = city; this.city = city;
} }

View File

@ -72,6 +72,8 @@ public class SysMenu extends BaseEntity
/** 系统类型 */ /** 系统类型 */
private String systemType; private String systemType;
private Long templateId;
public Long getMenuId() public Long getMenuId()
{ {
return menuId; return menuId;
@ -247,6 +249,14 @@ public class SysMenu extends BaseEntity
this.systemType = systemType; this.systemType = systemType;
} }
public Long getTemplateId() {
return templateId;
}
public void setTemplateId(Long templateId) {
this.templateId = templateId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -9,8 +9,10 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.bonus.system.api.domain.SysDept;
import com.bonus.system.api.domain.SysMenu; import com.bonus.system.api.domain.SysMenu;
import com.bonus.system.domain.UserMenuParams; import com.bonus.system.domain.UserMenuParams;
import com.bonus.system.mapper.SysDeptMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.bonus.common.core.constant.Constants; import com.bonus.common.core.constant.Constants;
@ -45,6 +47,9 @@ public class SysMenuServiceImpl implements ISysMenuService
@Autowired @Autowired
private SysRoleMenuMapper roleMenuMapper; private SysRoleMenuMapper roleMenuMapper;
@Autowired
private SysDeptMapper deptMapper;
/** /**
* 根据用户查询系统菜单列表 * 根据用户查询系统菜单列表
* *
@ -70,6 +75,8 @@ public class SysMenuServiceImpl implements ISysMenuService
String str = menu.getMenuName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_"); String str = menu.getMenuName().replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_");
menu.setMenuName(str); menu.setMenuName(str);
} }
SysDept sysDept = deptMapper.selectDeptById(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
menu.setTemplateId(sysDept.getTemplateId());
List<SysMenu> menuList = menuMapper.selectMenuList(menu); List<SysMenu> menuList = menuMapper.selectMenuList(menu);
return menuList; return menuList;
} }

View File

@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="templateId" column="template_id" />
<result property="province" column="province" /> <result property="province" column="province" />
<result property="city" column="city" /> <result property="city" column="city" />
<result property="district" column="district" /> <result property="district" column="district" />
@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.del_flag, d.del_flag,
d.create_by, d.create_by,
d.create_time, d.create_time,
d.template_id,
d.province, d.province,
d.city, d.city,
d.district, d.district,

View File

@ -29,21 +29,27 @@
</resultMap> </resultMap>
<sql id="selectMenuVo"> <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, system_type select sm.menu_id, sm.menu_name, sm.parent_id, sm.order_num, sm.path, sm.component, sm.`query`, sm.is_frame,
from sys_menu sm.is_cache, sm.menu_type, sm.visible, sm.status, ifnull(sm.perms,'') as perms, sm.icon, sm.create_time, sm.system_type
from sys_menu sm
</sql> </sql>
<select id="selectMenuList" parameterType="com.bonus.system.api.domain.SysMenu" resultMap="SysMenuResult"> <select id="selectMenuList" parameterType="com.bonus.system.api.domain.SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/> <include refid="selectMenuVo"/>
<where> <where>
<if test="menuName != null and menuName != ''"> <if test="menuName != null and menuName != ''">
AND menu_name like concat('%', #{menuName}, '%') AND sm.menu_name like concat('%', #{menuName}, '%')
</if> </if>
<if test="visible != null and visible != ''"> <if test="visible != null and visible != ''">
AND visible = #{visible} AND sm.visible = #{visible}
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND status = #{status} AND sm.status = #{status}
</if>
<if test="templateId != null">
and exists (
select 0 from sys_template_menu stm where stm.temp_id = #{templateId} and stm.menu_id = sm.menu_id
)
</if> </if>
</where> </where>
order by parent_id, order_num order by parent_id, order_num
@ -132,7 +138,7 @@
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult"> <select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
<include refid="selectMenuVo"/> <include refid="selectMenuVo"/>
where menu_id = #{menuId} where sm.menu_id = #{menuId}
</select> </select>
<select id="hasChildByMenuId" resultType="Integer"> <select id="hasChildByMenuId" resultType="Integer">
@ -141,7 +147,7 @@
<select id="checkMenuNameUnique" parameterType="com.bonus.system.api.domain.SysMenu" resultMap="SysMenuResult"> <select id="checkMenuNameUnique" parameterType="com.bonus.system.api.domain.SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/> <include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId} limit 1 where sm.menu_name=#{menuName} and sm.parent_id = #{parentId} limit 1
</select> </select>
<update id="updateMenu" parameterType="com.bonus.system.api.domain.SysMenu"> <update id="updateMenu" parameterType="com.bonus.system.api.domain.SysMenu">