OWL ITS + 탐지시스템(인터넷 진흥원)
src/main/java/kr/wisestone/owl/service/impl/CompanyFieldServiceImpl.java
@@ -142,6 +142,39 @@
        return this.companyFieldMapper.find(condition);
    }
    /**
     * companyFieldCategory Name 설정
     * @param companyFieldVo CompanyFieldVo
     * @param companyField CompanyField
     */
    private CompanyFieldVo CreateCompanyFieldCategory(CompanyFieldVo companyFieldVo, CompanyField companyField) {
        if (companyField.getCompanyTypeId() != null && companyField.getCompanyTypeId() != -1) {
            CompanyFieldCategory companyType = this.companyFieldCategoryService.find(companyField.getCompanyTypeId());
            if (companyType != null) {
                companyFieldVo.setCompanyTypeName(companyType.getUseValue());
            }
        }
        if (companyField.getParentSectorId() != null && companyField.getParentSectorId() != -1) {
            CompanyFieldCategory parentSector = this.companyFieldCategoryService.find(companyField.getParentSectorId());
            if (parentSector != null) {
                companyFieldVo.setParentSectorName(parentSector.getUseValue());
            }
        }
        if (companyField.getChildSectorId() != null && companyField.getChildSectorId() != -1) {
            CompanyFieldCategory childSector = this.companyFieldCategoryService.find(companyField.getChildSectorId());
            if (childSector != null) {
                companyFieldVo.setChildSectorName(childSector.getUseValue());
            }
        }
        if (companyField.getRegionId() != null && companyField.getRegionId() != -1) {
            CompanyFieldCategory region = this.companyFieldCategoryService.find(companyField.getRegionId());
            if (region != null) {
                companyFieldVo.setRegionName(region.getUseValue());
            }
        }
        return companyFieldVo;
    }
    // 업체 상세 조회한다.
    @Override
    @Transactional
@@ -166,36 +199,7 @@
            ispFieldVo = ConvertUtil.copyProperties(ispField, IspFieldVo.class);
            hostingFieldVo = ConvertUtil.copyProperties(hostingField, HostingFieldVo.class);
            if (companyField.getCompanyTypeId() != null && companyField.getCompanyTypeId() != -1) {
                CompanyFieldCategory companyType = this.companyFieldCategoryService.find(companyField.getCompanyTypeId());
                if (companyType != null) {
                    companyFieldVo.setCompanyTypeName(companyType.getUseValue());
                }
            }
            if (companyField.getParentSectorId() != null && companyField.getParentSectorId() != -1) {
                CompanyFieldCategory parentSector = this.companyFieldCategoryService.find(companyField.getParentSectorId());
                if (parentSector != null) {
                    companyFieldVo.setParentSectorName(parentSector.getUseValue());
                }
            }
            if (companyField.getChildSectorId() != null && companyField.getChildSectorId() != -1) {
                CompanyFieldCategory childSector = this.companyFieldCategoryService.find(companyField.getChildSectorId());
                if (childSector != null) {
                    companyFieldVo.setChildSectorName(childSector.getUseValue());
                }
            }
            if (companyField.getRegionId() != null && companyField.getRegionId() != -1) {
                CompanyFieldCategory region = this.companyFieldCategoryService.find(companyField.getRegionId());
                if (region != null) {
                    companyFieldVo.setRegionName(region.getUseValue());
                }
            }
            /*if (companyField.getStatusId() != null && companyField.getStatusId() != -1) {
                CompanyFieldCategory status = this.companyFieldCategoryService.find(companyField.getStatusId());
                if (status != null) {
                    companyFieldVo.setStatusName(status.getUseValue());
                }
            }*/
            CreateCompanyFieldCategory(companyFieldVo, companyField);
            companyFieldVo.setIspFieldVo(ispFieldVo);
            companyFieldVo.setHostingFieldVo(hostingFieldVo);
@@ -673,6 +677,19 @@
        CompanyFieldCondition companyFieldCondition = CompanyFieldCondition.make(conditions);
        List<Map<String, Object>> results = this.companyFieldMapper.find(companyFieldCondition);
        CompanyFieldVo companyFieldVo = new CompanyFieldVo();
        if (results != null && results.size() > 0) {
            for (Map<String, Object> result : results) {
                CompanyField companyField = ConvertUtil.convertMapToClass(result, CompanyField.class);
                CompanyFieldVo companyFieldVo2 = CreateCompanyFieldCategory(companyFieldVo, companyField);
                result.put("companyTypeName", companyFieldVo2.getCompanyTypeName());
                result.put("parentSectorName", companyFieldVo2.getParentSectorName());
                result.put("childSectorName", companyFieldVo2.getChildSectorName());
                result.put("regionName", companyFieldVo2.getRegionName());
            }
        }
        List<CompanyFieldVo> companyFieldVos = ConvertUtil.convertListToListClass(results, CompanyFieldVo.class);
        // code_ko_KR 에 code명 설정