| | |
| | | private UserWorkspaceService userWorkspaceService; |
| | | |
| | | @Autowired |
| | | private IssueTypeService issueTypeService; |
| | | |
| | | @Autowired |
| | | private UserLevelService userLevelService; |
| | | |
| | | @Autowired |
| | |
| | | User user = this.webAppUtil.getLoginUserObject(); |
| | | |
| | | // 워크스페이스에서 기본으로 제공되는 프로젝트에 대한 체크 |
| | | this.checkDefaultProject(project, projectForm); |
| | | //this.checkDefaultProject(project, projectForm); |
| | | // 수정 권한 체크 |
| | | this.checkModifyPermission(project.getId(), user); |
| | | // 관리자 변경 |
| | |
| | | this.messageAccessor.getMessage(MsgConstants.DEFAULT_PROJECT_MANAGER_NOT_CHANGE)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void checkUsingIssueType(Long projectId) { |
| | | Boolean del = Boolean.FALSE; |
| | | |
| | | List<IssueType> usingIssueTypes = this.issueTypeService.findByProjectId(projectId); |
| | | if (usingIssueTypes == null || usingIssueTypes.isEmpty()) { |
| | | del = true; |
| | | } |
| | | |
| | | if (!del) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.PROJECT_NOT_DELETE)); |
| | | } |
| | | } |
| | | |
| | |
| | | private void removeProjects(Long projectId) { |
| | | Project project = this.getProject(projectId); |
| | | // 기본 프로젝트는 삭제 금지 |
| | | if (project.getDefaultYn()) { |
| | | /*if (project.getDefaultYn()) { |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.DEFAULT_PROJECT_NOT_REMOVE)); |
| | | } |
| | | }*/ |
| | | this.checkUsingIssueType(project.getId()); |
| | | |
| | | // 로그인한 사용자가 관리자 역할에 소속되어 있는지 확인한다. |
| | | this.checkModifyPermission(project.getId(), this.webAppUtil.getLoginUserObject()); |
| | |
| | | public List<Map<String, Object>> findByWorkspaceIdAndIncludeProjectAll(ProjectCondition projectCondition) { |
| | | projectCondition.setLoginUserId(this.webAppUtil.getLoginId()); |
| | | projectCondition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId()); |
| | | return this.projectMapper.findByWorkspaceIdAndIncludeProjectAll(projectCondition); |
| | | |
| | | UserWorkspace userWorkspace = this.userWorkspaceService.findWorkspaceManager(this.webAppUtil.getLoginId()); |
| | | List<Map<String, Object>> results = Lists.newArrayList(); |
| | | if(userWorkspace != null) {// 워크스페이스 관리자일경우 |
| | | results = this.projectMapper.findByWorkspaceIdAndProjectAll(projectCondition); |
| | | } else { |
| | | results = this.projectMapper.findByWorkspaceIdAndIncludeProjectAll(projectCondition); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | // 현재 접근한 업무공간에서 참여하고 있는 프로젝트를 조회한다. - 상단 프로젝트 목록에서 사용 |