| | |
| | | public List<UserWorkspaceVo> findUserWorkspace(Map<String, Object> resJsonData, |
| | | UserWorkspaceCondition condition, Pageable pageable) { |
| | | |
| | | UserWorkspace userWorkspace = this.findMyWorkspace(this.webAppUtil.getLoginId()); |
| | | UserWorkspace userWorkspace = this.findWorkspaceManager(this.webAppUtil.getLoginId()); |
| | | Workspace myWorkspace = userWorkspace.getWorkspace(); |
| | | condition.setPage(pageable.getPageNumber() * pageable.getPageSize()); |
| | | condition.setPageSize(pageable.getPageSize()); |
| | |
| | | UserLevel userLevel = this.userLevelService.getUserLevel(userWorkspaceForm.getLevelId()); |
| | | user.setUserLevel(userLevel); |
| | | userWorkspace.setUser(user); |
| | | |
| | | // 등급 변경 된 유저 로그아웃 시키기 |
| | | this.simpMessagingTemplate.convertAndSendToUser(user.getAccount(), "/notification/changeUserLevel", this.messageAccessor.getMessage(MsgConstants.USER_LEVEL_CHANGE)); |
| | | |
| | | // 세션 업데이트 |
| | | //SecurityUtils.setUserToSession(user); |
| | | } |
| | | |
| | | // 부서 변경 |
| | |
| | | public void disabledUserWorkspace(User user, Workspace workspace) { |
| | | UserWorkspace userWorkspace = this.userWorkspaceRepository.findByUserIdAndWorkspaceId(user.getId(), workspace.getId()); |
| | | |
| | | if (userWorkspace.getManagerYn()) { |
| | | /*if (userWorkspace.getManagerYn()) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.WORKSPACE_MANAGER_NOT_CHANGE_USE_YN)); |
| | | } |
| | | }*/ |
| | | |
| | | userWorkspace.setUseYn(false); |
| | | this.userWorkspaceRepository.saveAndFlush(userWorkspace); |
| | |
| | | return this.userWorkspaceRepository.findByUserIdAndManagerYn(userId, true); |
| | | } |
| | | |
| | | // 워크스페이스 관리자 조회 |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | | public UserWorkspace findWorkspaceManager(Long userId) { |
| | | return this.userWorkspaceRepository.findByUserId(userId); |
| | | } |
| | | |
| | | // 업무 공간 사용자 연결 아이디로 업무 공간 사용자 연결 정보를 조회한다. |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | |
| | | // 업무 공간 담당자 여부를 확인한다. |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | | public boolean checkWorkspaceManager() { |
| | | public boolean checkWorkspaceManager(User user) { |
| | | boolean bIsManager = false; |
| | | User loginUser = this.userService.getUser(this.webAppUtil.getLoginId()); |
| | | |
| | | try |
| | | { |
| | | Workspace workspace = this.workspaceService.getWorkspace(loginUser.getLastWorkspaceId()); // 현재 접속한 업무 공간 |
| | | Workspace workspace = this.workspaceService.getWorkspace(user.getLastWorkspaceId()); // 현재 접속한 업무 공간 |
| | | // 로그인한 사용자가 관리하는 업무 공간을 찾는다. |
| | | UserWorkspace userWorkspace = this.findMyWorkspace(this.webAppUtil.getLoginId()); |
| | | UserWorkspace userWorkspace = this.findMyWorkspace(user.getId()); |
| | | |
| | | bIsManager = workspace.getId().equals(userWorkspace.getWorkspace().getId()); |
| | | } |