| | |
| | | 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; |
| | | } |
| | | |