firstLevelDeptId
This commit is contained in:
parent
ea8265da5e
commit
dd9f7bef7c
|
|
@ -50,6 +50,12 @@ public class SysUser extends BaseEntity {
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
private Long companyId;
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根公司下第一级分公司的deptId
|
||||||
|
*/
|
||||||
|
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||||
|
private Long firstLevelDeptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区域id(源自送变电公司下面的管辖区域,可以用来划分数据范围)
|
* 区域id(源自送变电公司下面的管辖区域,可以用来划分数据范围)
|
||||||
*/
|
*/
|
||||||
|
|
@ -220,6 +226,14 @@ public class SysUser extends BaseEntity {
|
||||||
this.companyId = companyId;
|
this.companyId = companyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getFirstLevelDeptId() {
|
||||||
|
return firstLevelDeptId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstLevelDeptId(Long firstLevelDeptId) {
|
||||||
|
this.firstLevelDeptId = firstLevelDeptId;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getAreaId() {
|
public Long getAreaId() {
|
||||||
return areaId;
|
return areaId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
dept.setDeptName(str);
|
dept.setDeptName(str);
|
||||||
}
|
}
|
||||||
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||||
//dept.setAreaId(SecurityUtils.getLoginUser().getSysUser().getAreaId());
|
//dept.setDeptId(SecurityUtils.getLoginUser().getSysUser().getFirstLevelDeptId());
|
||||||
return deptMapper.selectDeptList(dept);
|
return deptMapper.selectDeptList(dept);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
user.setPhonenumber(phone);
|
user.setPhonenumber(phone);
|
||||||
}
|
}
|
||||||
user.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
user.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||||
|
//user.setDeptId(SecurityUtils.getLoginUser().getSysUser().getFirstLevelDeptId());
|
||||||
List<SysUser> sysUsers = userMapper.selectUserList(user);
|
List<SysUser> sysUsers = userMapper.selectUserList(user);
|
||||||
//transferCanteenAdminAndCustInfo(sysUsers); //安徽送变电绿智食堂用户数据转换工具 (一次性工具)
|
//transferCanteenAdminAndCustInfo(sysUsers); //安徽送变电绿智食堂用户数据转换工具 (一次性工具)
|
||||||
for (SysUser sysUser : sysUsers) {
|
for (SysUser sysUser : sysUsers) {
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND (find_in_set(#{companyId}, ancestors) or dept_id = #{companyId})
|
AND (find_in_set(#{companyId}, ancestors) or dept_id = #{companyId})
|
||||||
</if>
|
</if>
|
||||||
<if test="deptId != null and deptId != 0">
|
<if test="deptId != null and deptId != 0">
|
||||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
AND (d.dept_id = #{deptId} OR d.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
||||||
ancestors) ))
|
ancestors) ))
|
||||||
</if>
|
</if>
|
||||||
<if test="parentId != null and parentId != 0">
|
<if test="parentId != null and parentId != 0">
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
<id property="userId" column="user_id"/>
|
<id property="userId" column="user_id"/>
|
||||||
<result property="deptId" column="dept_id"/>
|
<result property="deptId" column="dept_id"/>
|
||||||
<result property="companyId" column="company_id"/>
|
<result property="companyId" column="company_id"/>
|
||||||
|
<result property="firstLevelDeptId" column="first_level_dept_id"/>
|
||||||
<result property="areaId" column="area_id"/>
|
<result property="areaId" column="area_id"/>
|
||||||
<result property="userName" column="user_name"/>
|
<result property="userName" column="user_name"/>
|
||||||
<result property="nickName" column="nick_name"/>
|
<result property="nickName" column="nick_name"/>
|
||||||
|
|
@ -63,6 +64,12 @@
|
||||||
ELSE
|
ELSE
|
||||||
SUBSTRING_INDEX(SUBSTRING_INDEX(d.ancestors, ',', 2), ',', -1)
|
SUBSTRING_INDEX(SUBSTRING_INDEX(d.ancestors, ',', 2), ',', -1)
|
||||||
END as company_id,
|
END as company_id,
|
||||||
|
CASE
|
||||||
|
WHEN (LENGTH(d.ancestors) - LENGTH(REPLACE(d.ancestors, ',', ''))) = 1 THEN
|
||||||
|
d.dept_id
|
||||||
|
ELSE
|
||||||
|
SUBSTRING_INDEX(SUBSTRING_INDEX(d.ancestors, ',', 3), ',', -1)
|
||||||
|
END as first_level_dept_id,
|
||||||
u.area_id,
|
u.area_id,
|
||||||
u.user_name,
|
u.user_name,
|
||||||
u.nick_name,
|
u.nick_name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue