From 9f955be440cad5e6b868800ff0a0acd17c0a3004 Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 목, 13 1월 2022 15:30:35 +0900
Subject: [PATCH] - issue_company 테이블에 컬럼 추가 및 'tel' 컬럼 사이즈 변경 - 이슈 추가,수정 시 업체 추가된 항목들 추가 - 하위이슈 페이징 오류 수정

---
 src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java b/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
index 4cf7a5d..fe45e8d 100644
--- a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
+++ b/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
@@ -1555,7 +1558,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 +1679,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 +2798,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);
         }

--
Gitblit v1.8.0