| | |
| | | private UserWorkspaceService userWorkspaceService; |
| | | |
| | | @Autowired |
| | | private WorkflowDepartmentService workflowDepartmentService; |
| | | |
| | | @Autowired |
| | | private IssueRelationService issueRelationService; |
| | | |
| | | @Autowired |
| | |
| | | if (issueType == null){ |
| | | throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_ISSUE_TYPE_ERROR)); |
| | | } |
| | | |
| | | Workflow workflow = issueType.getWorkflow(); |
| | | |
| | | // 이슈 상태가 지정되어 있지 않을 경우 초기값으로 지정 |
| | | if (issueApiForm.getIssueStatusId() == null) { |
| | | List<IssueStatusVo> issueStatusVos = issueStatusService.findByWorkflowId(workflow.getId()); |
| | | IssueStatusVo issueStatusVo = issueStatusVos.get(0); |
| | | issueApiForm.setIssueStatusId(issueStatusVo.getId()); |
| | | } |
| | | |
| | | // 워크플로우 상태에 따른 담당부서 가져오기 |
| | | if (issueApiForm.getIssueStatusId() != null) { |
| | | WorkflowDepartmentCondition workflowDepartmentCondition = new WorkflowDepartmentCondition(); |
| | | workflowDepartmentCondition.setIssueStatusId(issueApiForm.getIssueStatusId()); |
| | | workflowDepartmentCondition.setWorkflowId(workflow.getId()); |
| | | List<WorkflowDepartmentVo> workflowDepartmentVos = this.workflowDepartmentService.find(workflowDepartmentCondition); |
| | | |
| | | for (WorkflowDepartmentVo workflowDepartmentVo : workflowDepartmentVos) { |
| | | issueForm.addDepartmentId(workflowDepartmentVo.getDepartmentVo().getId()); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 프로젝트 입력 |
| | | Project project = issueType.getProject(); |
| | |
| | | // 담당자 지정 |
| | | //this.issueUserService.modifyIssueUser(issue, project.getWorkspace(), issueForm.getUserIds()); |
| | | // 담당부서 지정 |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | this.issueDepartmentService.modifyIssueDepartment(issue, user, project.getWorkspace(), issueForm.getDepartmentIds()); |
| | | // 업체 정보 저장 |
| | | this.issueCompanyService.modifyIssueCompanyField(issue, issueForm.getIssueCompanyFields()); |
| | | // ISP 정보 저장 |
| | |
| | | } |
| | | |
| | | private void setCountDownIssues(List<Map<String, Object>> results, List<IssueVo> issueVos) { |
| | | int downIssueCount = 0; |
| | | for (Map<String, Object> result : results){ |
| | | List<Issue> downIssues = this.issueRepository.findByParentIssueId((Long) result.get("id")); //하위이슈 가져오기 |
| | | if(downIssues != null && downIssues.size() > 0){ //상위이슈 가지고 있는 애들이 있으면 |
| | | for(Issue downIssue : downIssues){ |
| | | downIssueCount ++; |
| | | Long parentIssueId = downIssue.getParentIssue().getId(); |
| | | int downIssueCount = 1; |
| | | Issue parentIssue = this.getIssue(parentIssueId); |
| | | IssueVo parentIssueVo = ConvertUtil.copyProperties(parentIssue, IssueVo.class); |
| | | parentIssueVo.setDownIssueCount(downIssueCount); |
| | |
| | | if(downIssues != null && downIssueVos.size()>0){ |
| | | for(IssueVo downIssueVo : downIssueVos){ |
| | | for(Issue downIssue : downIssues){ |
| | | downIssueVo.setTitle(downIssue.getTitle()); |
| | | downIssueVo.setIssueTypeVo(ConvertUtil.copyProperties(downIssue.getIssueType(), IssueTypeVo.class)); |
| | | downIssueVo.setPriorityVo(ConvertUtil.copyProperties(downIssue.getPriority(), PriorityVo.class)); |
| | | downIssueVo.setSeverityVo(ConvertUtil.copyProperties(downIssue.getSeverity(), SeverityVo.class)); |