1.设置多设备登录配置为 false
2.修改主播分页查询为XML查询 3.添加查询当前用户部门下所有用户接口 4.新建国家信息实体类 5.添加批量更新主播接口
This commit is contained in:
@@ -27,9 +27,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@@ -169,4 +167,20 @@ public class UserController {
|
||||
return success(userService.importUserList(list, updateSupport));
|
||||
}
|
||||
|
||||
@GetMapping({"/list-all-simple-dept"})
|
||||
@Operation(summary = "获取部门下所有用户", description = "只包含被开启的用户,主要用于前端的下拉选项")
|
||||
public CommonResult<List<UserSimpleRespVO>> getSimpleUserListWithDept(@RequestParam Long deptId) {
|
||||
// List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
List<AdminUserDO> list = userService.getUserListByStatusAndDept(CommonStatusEnum.ENABLE.getStatus(),deptId);
|
||||
List<AdminUserDO> userDOList = new ArrayList<>();
|
||||
for (AdminUserDO adminUserDO : list) {
|
||||
if (Objects.equals(deptId, adminUserDO.getDeptId())) {
|
||||
userDOList.add(adminUserDO);
|
||||
}
|
||||
}
|
||||
// 拼接数据
|
||||
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
||||
convertList(userDOList, AdminUserDO::getDeptId));
|
||||
return success(UserConvert.INSTANCE.convertSimpleList(userDOList, deptMap));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,4 +48,9 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
return selectList(AdminUserDO::getDeptId, deptIds);
|
||||
}
|
||||
|
||||
default List<AdminUserDO> getUserListByStatusAndDept(Integer status, Long deptId){
|
||||
return selectList(new LambdaQueryWrapperX<AdminUserDO>()
|
||||
.eq(AdminUserDO::getStatus, status)
|
||||
.eq(AdminUserDO::getDeptId, deptId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public OAuth2AccessTokenDO createAccessToken(Long userId, Integer userType, String clientId, List<String> scopes) {
|
||||
// 在 yaml multiple-device-login = True 时 删除用户上次登录令牌,实现单设备登录
|
||||
if (multipleDeviceLoginConfig){
|
||||
if (!multipleDeviceLoginConfig){
|
||||
removeAccessTokenByUserId(userId);
|
||||
}
|
||||
OAuth2ClientDO clientDO = oauth2ClientService.validOAuthClientFromCache(clientId);
|
||||
|
||||
@@ -207,4 +207,5 @@ public interface AdminUserService {
|
||||
*/
|
||||
boolean isPasswordMatch(String rawPassword, String encodedPassword);
|
||||
|
||||
List<AdminUserDO> getUserListByStatusAndDept(Integer status, Long deptId);
|
||||
}
|
||||
|
||||
@@ -515,6 +515,11 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
// return passwordEncoder.matches(rawPassword, encodedPassword);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserDO> getUserListByStatusAndDept(Integer status, Long deptId) {
|
||||
return userMapper.getUserListByStatusAndDept(status,deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对密码进行加密
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user