| | |
| | | import kr.wisestone.owl.repository.IssueTypeRepository; |
| | | import kr.wisestone.owl.service.*; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | import kr.wisestone.owl.vo.*; |
| | | import kr.wisestone.owl.web.condition.IssueTypeCondition; |
| | | import kr.wisestone.owl.web.form.IssueTypeForm; |
| | |
| | | condition.setPage(pageable.getPageNumber() * pageable.getPageSize()); |
| | | condition.setPageSize(pageable.getPageSize()); |
| | | condition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId()); |
| | | |
| | | List<Map<String, Object>> results = this.issueTypeMapper.find(condition); |
| | | for (Map<String, Object> result : results) { |
| | | Long projectId = MapUtil.getLong(result, "projectId"); |
| | | if (projectId != null) { |
| | | Project project = this.projectService.getProject(projectId); |
| | | ProjectVo projectVo = ConvertUtil.copyProperties(project, ProjectVo.class); |
| | | result.put("projectVo", projectVo); |
| | | } |
| | | } |
| | | |
| | | Long totalCount = this.issueTypeMapper.count(condition); |
| | | int totalPage = (int) Math.ceil((totalCount - 1) / pageable.getPageSize()) + 1; |
| | | List<IssueTypeVo> issueTypeVos = ConvertUtil.convertListToListClass(results, IssueTypeVo.class); |
| | |
| | | return issueTypeVos; |
| | | } |
| | | |
| | | // 이슈 유형 목록을 조회한다. |
| | | @Override |
| | | @Transactional(readOnly = true) |
| | | public List<IssueTypeVo> findIssueType(IssueTypeCondition condition) { |
| | | condition.setWorkspaceId(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId()); |
| | | List<Map<String, Object>> results = this.issueTypeMapper.find(condition); |
| | | return ConvertUtil.convertListToListClass(results, IssueTypeVo.class); |
| | | } |
| | | |
| | | // 이슈 유형에 연결된 워크플로우 정보를 셋팅한다. |
| | | private void setUseIssueTypeByWorkflow(List<IssueTypeVo> issueTypeVos) { |
| | | for (IssueTypeVo issueTypeVo : issueTypeVos) { |