Browse Source

编辑用户如果禁用的话,则踢用户下线

tags/24080901
WendyYang 1 year ago
parent
commit
bd83d9af85
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java

+ 10
- 5
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -1,7 +1,6 @@
package com.ningdatech.pmapi.user.manage;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -208,7 +207,7 @@ public class UserInfoManage {
return new ArrayList<>();
}
return iUserInfoService.list(Wrappers.lambdaQuery(UserInfo.class)
.in(UserInfo::getId, compliantUserIdList))
.in(UserInfo::getId, compliantUserIdList))
.stream().map(UserInfo::getId).collect(Collectors.toList());

}
@@ -315,8 +314,8 @@ public class UserInfoManage {
}
userId = generateUserId(employeeCode);
}

UserInfo userInfo = iUserInfoService.getById(userId);
String oldUserStatus = userInfo.getAvailable();
// 绑定用户手机号
bandUserMobile(userInfo, reqUserDetailEditPO);

@@ -337,8 +336,14 @@ public class UserInfoManage {
}).collect(Collectors.toList());
iUserRoleService.saveBatch(userRoleList);
}
// 刷新用户权限
userAuthManage.refreshSession(userId);
// 刷新用户权限 仅原状态为正常才需要刷新session
if ("ENABLE".equals(oldUserStatus)) {
if (oldUserStatus.equals(userInfo.getAvailable())) {
userAuthManage.refreshSession(userId);
} else {
userAuthManage.kickOff(userId);
}
}
}

/**


Loading…
Cancel
Save