| | |
| | | import kr.wisestone.owl.domain.enumType.EmailType; |
| | | import kr.wisestone.owl.domain.enumType.IssueHistoryType; |
| | | import kr.wisestone.owl.domain.enumType.IssueStatusType; |
| | | import kr.wisestone.owl.exception.ApiAuthException; |
| | | import kr.wisestone.owl.exception.ApiParameterException; |
| | | import kr.wisestone.owl.exception.OwlRuntimeException; |
| | | import kr.wisestone.owl.mapper.DepartmentMapper; |
| | | import kr.wisestone.owl.mapper.IssueMapper; |
| | |
| | | |
| | | private IssueForm convertToIssueForm(IssueApiForm issueApiForm, User user) { |
| | | if (issueApiForm.getIssueTypeId() == null) { |
| | | throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_ISSUE_TYPE_ERROR)); |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_ISSUE_TYPE_ERROR)); |
| | | } |
| | | |
| | | IssueForm issueForm = ConvertUtil.copyProperties(issueApiForm, IssueForm.class); |
| | | // issueForm.setFiles(issueApiForm.getFiles()); |
| | | IssueType issueType = this.issueTypeService.getIssueType(issueApiForm.getIssueTypeId()); |
| | | if (issueType == null){ |
| | | throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_ISSUE_TYPE_ERROR)); |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_ISSUE_TYPE_ERROR)); |
| | | } |
| | | |
| | | Workflow workflow = issueType.getWorkflow(); |
| | |
| | | } |
| | | } |
| | | } else if (issueApiForm.getIssueStatusId() == null){ |
| | | throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_ISSUE_STATUS_NOT_EXIST)); |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_ISSUE_STATUS_NOT_EXIST)); |
| | | } |
| | | |
| | | // 프로젝트 입력 |
| | | Project project = issueType.getProject(); |
| | | if (project == null){ |
| | | throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_PROJECT_ERROR)); |
| | | throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_PROJECT_ERROR)); |
| | | } |
| | | issueForm.setProjectId(project.getId()); |
| | | |
| | |
| | | return issueForm; |
| | | |
| | | } else { |
| | | throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_USER_ERROR)); |
| | | throw new ApiAuthException(this.messageAccessor.getMessage(MsgConstants.API_USER_ERROR)); |
| | | } |
| | | } |
| | | |
| | |
| | | issueForm.setIssueHostingFields(issueHostingFields); |
| | | } |
| | | } |
| | | |
| | | return issueForm; |
| | | } |
| | | |
| | |
| | | return Lists.newArrayList(); |
| | | } |
| | | |
| | | // 튜닝 전 - 1.3 / 1.2 / 1.1 |
| | | // 튜닝 후 (단일/다중 검색 조건 3개 기준) - 0.49 / 0.41 / 0.47 / 0.41 |
| | | |
| | | List<IssueVo> issueVos = Lists.newArrayList(); // 이슈 목록 데이터 저장 컬렉션 |
| | | // 사용자 정의 필드로 검색한 이슈 아이디 값 |
| | | List<String> issueKeys = Lists.newArrayList(issueIds); |
| | | issueCondition.setIssueIds(issueKeys); |
| | | |
| | | issueCondition.setLoginUserId(this.webAppUtil.getLoginId()); |
| | | issueCondition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId()); |
| | | User user = this.webAppUtil.getLoginUserObject(); |
| | | |
| | | issueCondition.setLoginUserId(user.getId()); |
| | | issueCondition.setWorkspaceId(user.getLastWorkspaceId()); |
| | | |
| | | |
| | | List<Map<String, Object>> results = Lists.newArrayList(); |
| | | Long totalCount = 0L; |
| | | UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId()); |
| | | // UserLevel userLevel = this.userLevelService.getUserLevel(user.getUserLevel().getId()); |
| | | |
| | | // if (!this.userWorkspaceService.checkWorkspaceManager(user) |
| | | // && !MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) { //최고관리자 & 프로젝트,이슈 관리자 일 경우 모든 이슈 보기 |
| | |
| | | // results = this.issueMapper.findByDepartment(issueCondition); |
| | | // totalCount = this.issueMapper.countByDepartment(issueCondition); |
| | | // }*/ |
| | | // StopWatch serviceStart = new StopWatch(); |
| | | // serviceStart.start(); |
| | | results = this.issueMapper.find(issueCondition); |
| | | // serviceStart.stop(); |
| | | // log.error("result : " + serviceStart.toString()); |
| | | |
| | | // serviceStart = new StopWatch(); |
| | | // serviceStart.start(); |
| | | totalCount = this.issueMapper.count(issueCondition); |
| | | |
| | | |
| | | // 튜닝 전 - 0.8, 0.9, 0.9, 0.9, 0.9 |
| | | /*StopWatch serviceStart = new StopWatch(); |
| | | serviceStart.start();*/ |
| | | // 튜닝 전 - 1.1, 1.1, 1.3, 1.2 |
| | | |
| | | /*serviceStart.stop(); |
| | | log.debug("serviceENd1 : " + serviceStart.getTime());*/ |
| | | // serviceStart.stop(); |
| | | // log.error("totalCount : " + serviceStart.toString()); |
| | | |
| | | int totalPage = (int) Math.ceil((totalCount - 1) / pageable.getPageSize()) + 1; |
| | | // 이슈 아이디 초기화 |
| | |
| | | this.setDownIssues(user, issueVos); |
| | | this.setRelationIssues(issueVos); |
| | | } |
| | | this.setCountDownIssues(issueVos); |
| | | |
| | | this.setCountDownIssues(issueVos); |
| | | this.SetWorkflowDepartment(issueVos); //워크플로우에 설정한 담당부서 가져오기 |
| | | |
| | | resJsonData.put(Constants.RES_KEY_CONTENTS, issueVos); |