OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2021-12-27 b2b9e785e10c8fd59c3fcee8c8fda2aeb86be8c3
src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -187,6 +187,9 @@
    private UserDepartmentService userDepartmentService;
    @Autowired
    private WorkflowTransitionService workflowTransitionService;
    @Autowired
    private UserDepartmentRepository userDepartmentRepository;
    @Autowired
@@ -194,6 +197,9 @@
    @Autowired
    private WorkflowDepartmentRepository workflowDepartmentRepository;
    @Autowired
    WorkflowService workflowService;
    @Override
    protected JpaRepository<Issue, Long> getRepository() {
@@ -234,7 +240,6 @@
        }
        Workflow workflow = issueType.getWorkflow();
        if (issueApiForm.getApiType().equals(IssueApiForm.ApiType.add)) {
            // 이슈 상태가 지정되어 있지 않을 경우 워크플로우 대기 상태 값으로 지정
            List<Long> departmentIds = this.workflowDepartmentService.findFirstDepartmentIds(workflow);
@@ -243,8 +248,15 @@
                    issueForm.addDepartmentId(departmentId);
                }
            }
        } else if (issueApiForm.getIssueStatusId() == null){
            throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_ISSUE_STATUS_NOT_EXIST));
        } else {
            if (issueApiForm.getIssueStatusId() == null){
                throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_ISSUE_STATUS_IS_NULL));
            }
            // 워크플로우에서 사용 중인 이슈 상태인지 체크
            else if (!this.workflowTransitionService.contains(issueApiForm.getIssueStatusId(), workflow.getId())) {
                throw new OwlRuntimeException(
                        this.messageAccessor.getMessage(MsgConstants.API_ISSUE_STATUS_NOT_IN_WORKFLOW));
            }
        }
        // 프로젝트 입력