fix 修复 删除用户与岗位关联 id使用错误

feature/model
疯狂的狮子li 2 years ago
parent 82345cbf47
commit 700b441bbb

@ -416,10 +416,9 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
public void insertUserPost(SysUserBo user, boolean clear) {
Long[] posts = user.getPostIds();
if (ArrayUtil.isNotEmpty(posts)) {
Long userId = LoginHelper.getUserId();
if (clear) {
// 删除用户与岗位关联
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getUserId, userId));
userPostMapper.delete(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getUserId, user.getUserId()));
}
// 新增用户与岗位管理
List<SysUserPost> list = StreamUtils.toList(List.of(posts), postId -> {

Loading…
Cancel
Save