feat: CRM 客户限制

This commit is contained in:
Wanwan
2023-11-11 20:49:52 +08:00
parent 2915b46fa5
commit 5b295d56b6
21 changed files with 754 additions and 3 deletions

View File

@ -109,6 +109,28 @@ public class UserController {
return success(new PageResult<>(userList, pageResult.getTotal()));
}
@GetMapping("/all")
@Operation(summary = "查询所有用户列表")
public CommonResult<List<UserPageItemRespVO>> getAllUser() {
// 获得用户分页列表
List<AdminUserDO> pageResult = userService.getUserList();
if (CollUtil.isEmpty(pageResult)) {
return success(Collections.emptyList()); // 返回空
}
// 获得拼接需要的数据
Collection<Long> deptIds = convertList(pageResult, AdminUserDO::getDeptId);
Map<Long, DeptDO> deptMap = deptService.getDeptMap(deptIds);
// 拼接结果返回
List<UserPageItemRespVO> userList = new ArrayList<>(pageResult.size());
pageResult.forEach(user -> {
UserPageItemRespVO respVO = UserConvert.INSTANCE.convert(user);
respVO.setDept(UserConvert.INSTANCE.convert(deptMap.get(user.getDeptId())));
userList.add(respVO);
});
return success(userList);
}
@GetMapping("/list-all-simple")
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList() {

View File

@ -209,4 +209,10 @@ public interface AdminUserService {
*/
boolean isPasswordMatch(String rawPassword, String encodedPassword);
/**
* 获取所有用户列表
*
* @return 用户列表
*/
List<AdminUserDO> getUserList();
}

View File

@ -443,6 +443,16 @@ public class AdminUserServiceImpl implements AdminUserService {
return passwordEncoder.matches(rawPassword, encodedPassword);
}
/**
* 获取所有用户列表
*
* @return 用户列表
*/
@Override
public List<AdminUserDO> getUserList() {
return userMapper.selectList();
}
/**
* 对密码进行加密
*