mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 04:08:43 +08:00 
			
		
		
		
	feat: CRM 客户限制
This commit is contained in:
		@@ -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() {
 | 
			
		||||
 
 | 
			
		||||
@@ -209,4 +209,10 @@ public interface AdminUserService {
 | 
			
		||||
     */
 | 
			
		||||
    boolean isPasswordMatch(String rawPassword, String encodedPassword);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取所有用户列表
 | 
			
		||||
     *
 | 
			
		||||
     * @return 用户列表
 | 
			
		||||
     */
 | 
			
		||||
    List<AdminUserDO> getUserList();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -443,6 +443,16 @@ public class AdminUserServiceImpl implements AdminUserService {
 | 
			
		||||
        return passwordEncoder.matches(rawPassword, encodedPassword);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取所有用户列表
 | 
			
		||||
     *
 | 
			
		||||
     * @return 用户列表
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<AdminUserDO> getUserList() {
 | 
			
		||||
        return userMapper.selectList();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 对密码进行加密
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user