放弃管理员自己的areaId,而使用角色的areaId
This commit is contained in:
parent
dad16cb36a
commit
96eb0bb2bd
|
|
@ -56,12 +56,6 @@ public class SysUser extends BaseEntity {
|
|||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long firstLevelDeptId;
|
||||
|
||||
/**
|
||||
* 区域id(源自送变电公司下面的管辖区域,可以用来划分数据范围)
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 是否客户,判断是否能够登录后台管理页面
|
||||
*/
|
||||
|
|
@ -239,14 +233,6 @@ public class SysUser extends BaseEntity {
|
|||
this.firstLevelDeptId = firstLevelDeptId;
|
||||
}
|
||||
|
||||
public Long getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(Long areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getIsCustomer() {
|
||||
return isCustomer;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
role.setRoleKey(str);
|
||||
}
|
||||
role.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
role.setAreaId(SecurityUtils.getLoginUser().getSysUser().getAreaId());
|
||||
return roleMapper.selectRoleList(role);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isBuiltIn" column="is_built_in"/>
|
||||
<result property="areaId" column="area_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRoleVo">
|
||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
||||
r.company_id, r.status, r.del_flag, r.create_time, r.remark, r.is_built_in
|
||||
r.company_id, r.status, r.del_flag, r.create_time, r.remark, r.is_built_in, r.area_id
|
||||
from sys_role r
|
||||
left join sys_user_role ur on ur.role_id = r.role_id
|
||||
left join sys_user u on u.user_id = ur.user_id
|
||||
|
|
@ -44,9 +45,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="companyId != null">
|
||||
AND r.company_id = #{companyId}
|
||||
</if>
|
||||
<if test="areaId != null">
|
||||
AND r.area_id = #{areaId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND r.status = #{status}
|
||||
</if>
|
||||
|
|
@ -123,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="isBuiltIn != null and isBuiltIn!=''">is_built_in,</if>
|
||||
<if test="areaId != null and areaId!=0">area_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
||||
|
|
@ -137,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="isBuiltIn != null and isBuiltIn!=''">#{isBuiltIn},</if>
|
||||
<if test="areaId != null and areaId!=0">#{areaId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
|
@ -155,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="isBuiltIn != null and isBuiltIn!=''">is_built_in = #{isBuiltIn},</if>
|
||||
<if test="areaId != null and areaId!=0">area_id = #{areaId},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where role_id = #{roleId}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
<result property="deptId" column="dept_id"/>
|
||||
<result property="companyId" column="company_id"/>
|
||||
<result property="firstLevelDeptId" column="first_level_dept_id"/>
|
||||
<result property="areaId" column="area_id"/>
|
||||
<result property="userName" column="user_name"/>
|
||||
<result property="nickName" column="nick_name"/>
|
||||
<result property="email" column="email"/>
|
||||
|
|
@ -71,7 +70,6 @@
|
|||
ELSE
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(d.ancestors, ',', 3), ',', -1)
|
||||
END as first_level_dept_id,
|
||||
u.area_id,
|
||||
u.user_name,
|
||||
u.nick_name,
|
||||
u.email,
|
||||
|
|
|
|||
Loading…
Reference in New Issue