This commit is contained in:
jiask 2025-10-16 14:38:20 +08:00
parent 9d44c6c311
commit 1bc8214fcf
4 changed files with 30 additions and 1 deletions

View File

@ -201,6 +201,8 @@ public class SysUser extends BaseEntity {
@ApiModelProperty("查询类型")
private boolean bingStatus = false;
private String isAdmin;
public void setBingStatus(boolean bingStatus) {
this.bingStatus = bingStatus;
}
@ -495,4 +497,12 @@ public class SysUser extends BaseEntity {
public void setEffectiveEndDay(Date effectiveEndDay) {
this.effectiveEndDay = effectiveEndDay;
}
public String getIsAdmin() {
return isAdmin;
}
public void setIsAdmin(String isAdmin) {
this.isAdmin = isAdmin;
}
}

View File

@ -87,6 +87,12 @@ public class SysUserController extends BaseController {
@SysLog(title = "用户管理", businessType = OperaType.QUERY, logType = 0, module = "系统管理->用户管理", details = "查询用户列表")
public TableDataInfo list(SysUser user) {
try {
LoginUser userd=SecurityUtils.getLoginUser();
String roles=userd.getRoles().toString();
if(roles.contains("system_admin")){
user.setIsAdmin("1");
user.setDeptId(userd.getSysUser().getDeptId());
}
startPage();
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);

View File

@ -601,7 +601,7 @@ public class SysUserServiceImpl implements ISysUserService {
user.setUserId(userIds[i]);
users.add(user);
}
smartCanteenClient.deleteAccInfoByUserIds(users);
// smartCanteenClient.deleteAccInfoByUserIds(users);
return userMapper.deleteUserByIds(userIds);
}

View File

@ -168,6 +168,19 @@
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
ancestors) ))
</if>
<if test='isAdmin != null and isAdmin == "1"'>
and u.dept_id in (
select dept_id from sys_dept where dept_id=#{deptId}
union
select dept_id from sys_dept where parent_id=#{deptId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id=#{deptId})
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id=#{deptId}))
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id=#{deptId})))
)
</if>
<if test="roleIds != null and roleIds.length > 0">
and ur.role_id in
<foreach collection="roleIds" item="item" index="index" separator="," open="(" close=")">