|
|
@@ -248,6 +248,28 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|
|
LogRecordContext.putVariable("user", user);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void deleteUserList(List<Long> ids) {
|
|
|
+ if (CollUtil.isEmpty(ids)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 1. 校验用户存在
|
|
|
+ List<AdminUserDO> users = userMapper.selectByIds(ids);
|
|
|
+ if (CollUtil.isEmpty(users)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 批量删除用户
|
|
|
+ userMapper.deleteByIds(ids);
|
|
|
+
|
|
|
+ // 3. 批量删除用户关联数据
|
|
|
+ ids.forEach(id -> {
|
|
|
+ permissionService.processUserDeleted(id);
|
|
|
+ userPostMapper.deleteByUserId(id);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public AdminUserDO getUserByUsername(String username) {
|
|
|
return userMapper.selectByUsername(username);
|