OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-01-13 ebfd37816a332308519b30af5bfb017c5052be69
src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -87,6 +87,9 @@
    private CompanyFieldService companyFieldService;
    @Autowired
    private CompanyFieldCategoryService companyFieldCategoryService;
    @Autowired
    private IspFieldService ispFieldService;
    @Autowired
@@ -209,6 +212,9 @@
    @Autowired
    private IssueRelationMapper issueRelationMapper;
    @Autowired
    private WorkflowTransitionService workflowTransitionService;
    @Override
    protected JpaRepository<Issue, Long> getRepository() {
        return this.issueRepository;
@@ -259,6 +265,9 @@
            }
        } else if (issueApiForm.getIssueStatusId() == null){
            throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_ISSUE_STATUS_NOT_EXIST));
        } else if (!this.workflowTransitionService.contains(issueApiForm.getIssueStatusId(), workflow.getId())) {
            //이슈 상태 유효성 확인
            throw new ApiParameterException(this.messageAccessor.getMessage(MsgConstants.API_ISSUE_STATUS_NOT_EXIST_IN_WORKFLOW));
        }
        // 프로젝트 입력
@@ -1518,7 +1527,7 @@
                case "02": //  프로젝트, 이슈 유형, 이슈 상태,  우선순위, 중요도, 담당자, 첨부파일, 사용자 정의 필드 정보, 댓글, 기록을 셋팅한다.
                    this.setIssueDetail(issueVo, issue, user);    //  이슈 상세 정보를 셋팅한다.
                    this.setIssueTableConfigs(issue, issueVo);
                    this.setIssueTableConfigs(issue, issueVo, issueCondition);
                    issueVo.setProjectVo(ConvertUtil.copyProperties(issue.getProject(), ProjectVo.class));
                    break;
            }
@@ -1530,8 +1539,9 @@
    }
    // 테이블 설정 셋팅
    private void setIssueTableConfigs(Issue issue, IssueVo issueVo) {
        Long IssueTypeId = issue.getIssueType().getId();
    private void setIssueTableConfigs(Issue issue, IssueVo issueVo, IssueCondition issueCondition) {
        //Long IssueTypeId = issue.getIssueType().getId();
        Long IssueTypeId = issueCondition.getIssueTypeId();
        for (int tableConfigType : IssueTableConfig.IssueTableTypes) {
            if (tableConfigType != IssueTableConfig.ISSUE_TABLE_TYPE_MAIN) {
@@ -1555,7 +1565,10 @@
        List<Issue> downIssueList = this.issueRepository.findByParentIssueId(issue.getId());
        if(downIssueList != null && downIssueList.size() > 0) {
            int startPage = (int) Math.floor(issueVo.getDownPage()/issueVo.getDownPageSize());
            int startPage = 0;
            if (issueVo.getDownPage() != 0) {
                startPage = (int) Math.floor(issueVo.getDownPage()/issueVo.getDownPageSize());
            }
            Pageable pageable = PageRequest.of(startPage, issueVo.getDownPageSize());
            downIssues = this.issueRepository.findByParentIssueId(issue.getId(), pageable);
        }
@@ -1673,7 +1686,7 @@
            issueVo.setRelTotalCount(totalCount);
            for (Map<String, Object> result : results) {
                IssueRelationVo issueRelationVo = ConvertUtil.convertMapToClass(result, IssueRelationVo.class);
                Issue relationIssue = this.findOne(issueRelationVo.getId());
                Issue relationIssue = this.findOne(MapUtil.getLong(result, "relationIssueId"));
                IssueVo relIssueVo = ConvertUtil.copyProperties(relationIssue, IssueVo.class);
                Project project = this.projectService.getProject(relationIssue.getProject().getId());
                relIssueVo.setProjectId(project.getId());
@@ -2792,6 +2805,26 @@
            CompanyField companyField = issueCompany.getCompanyField();
            if (companyField != null) {
                issueCompanyVo.setCompanyId(issueCompany.getCompanyField().getId());
                if (issueCompany.getCompanyTypeId() != null) {
                    CompanyFieldCategory companyType = this.companyFieldCategoryService.find(issueCompany.getCompanyTypeId());
                    issueCompanyVo.setCompanyTypeName(companyType.getUseValue());
                }
                if (issueCompany.getParentSectorId() != null) {
                    CompanyFieldCategory parentSector = this.companyFieldCategoryService.find(issueCompany.getParentSectorId());
                    issueCompanyVo.setParentSectorName(parentSector.getUseValue());
                }
                if (issueCompany.getChildSectorId() != null) {
                    CompanyFieldCategory childSector = this.companyFieldCategoryService.find(issueCompany.getChildSectorId());
                    issueCompanyVo.setChildSectorName(childSector.getUseValue());
                }
                if (issueCompany.getRegionId() != null) {
                    CompanyFieldCategory region = this.companyFieldCategoryService.find(issueCompany.getRegionId());
                    issueCompanyVo.setRegionName(region.getUseValue());
                }
                if (issueCompany.getStatusId() != null) {
                    CompanyFieldCategory status = this.companyFieldCategoryService.find(issueCompany.getStatusId());
                    issueCompanyVo.setStatusName(status.getUseValue());
                }
            }
            issueCompanyVos.add(issueCompanyVo);
        }