From b6be6b9f2d2bfaa73e5ead9f1e6c198a6811399a Mon Sep 17 00:00:00 2001
From: wyu <kknd09321@nate.com>
Date: 화, 23 11월 2021 10:28:40 +0900
Subject: [PATCH] 이슈 상세 연관,하위 테이블 표시 설정 - [프론트]

---
 src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 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 823729e..1bb3151 100644
--- a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
+++ b/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -54,6 +54,9 @@
     private IssueRepository issueRepository;
 
     @Autowired
+    private IssueTableConfigService issueTableConfigService;
+
+    @Autowired
     private ProjectService projectService;
 
     @Autowired
@@ -112,6 +115,9 @@
 
     @Autowired
     private UserService userService;
+
+    @Autowired
+    private DepartmentService departmentService;
 
     @Autowired
     private IssueCommentService issueCommentService;
@@ -194,6 +200,8 @@
         this.verifyTitle(issueForm.getTitle());
         //  �궇吏� �쑀�슚�꽦 泥댄겕
         this.checkStartCompleteDate(issueForm.getStartDate(), issueForm.getCompleteDate());
+        //  �떞�떦 遺��꽌 �쑀�슚�꽦 泥댄겕
+        this.verifyIssueDepartment(project, issueForm);
 
         //  �씠�뒋 �긽�깭 �쑀�삎�씠 '��湲�' �씤 �씠�뒋 �긽�깭 媛��졇�삤湲�
         IssueStatus issueStatus = this.issueStatusService.findByIssueStatusTypeIsReady(issueType.getWorkflow());
@@ -428,13 +436,13 @@
         List<Map<String, Object>> results = this.issueMapper.find(issueCondition);
 
         //  �뒠�떇 �쟾 - 0.8, 0.9, 0.9, 0.9, 0.9
-        StopWatch serviceStart = new StopWatch();
-        serviceStart.start();
+        /*StopWatch serviceStart = new StopWatch();
+        serviceStart.start();*/
         Long totalCount = this.issueMapper.count(issueCondition);
         //  �뒠�떇 �쟾 - 1.1, 1.1, 1.3, 1.2
 
-        serviceStart.stop();
-        log.debug("serviceENd1 : " + serviceStart.getTime());
+        /*serviceStart.stop();
+        log.debug("serviceENd1 : " + serviceStart.getTime());*/
 
         int totalPage = (int) Math.ceil((totalCount - 1) / pageable.getPageSize()) + 1;
         //  �씠�뒋 �븘�씠�뵒 珥덇린�솕
@@ -853,6 +861,16 @@
         this.setIssueCompanyField(issue, issueVo);  //�뾽泥� �젙蹂� �꽭�똿
         this.setIssueIspField(issue, issueVo);  //ISP �젙蹂� �꽭�똿
         this.setIssueHostingField(issue, issueVo);  //HOSTING �젙蹂� �꽭�똿
+        this.setParentIssue(issue,issueVo); //�긽�쐞 �씠�뒋 �젙蹂� �꽭�똿
+
+    }
+
+
+    //  �긽�쐞�씪媛� �젙蹂� 異붽�
+    private void setParentIssue(Issue issue, IssueVo issueVo) {
+        if(issue.getParentIssue() != null){
+            issueVo.setParentIssueVo(ConvertUtil.copyProperties(issue.getParentIssue(), IssueVo.class));
+        }
     }
 
     //  �벑濡앹옄 �젙蹂� 異붽�
@@ -1804,13 +1822,14 @@
             Map<String, Priority> priorityMaps = new HashMap<>();   //  �슦�꽑 �닚�쐞 紐⑥쓬
             Map<String, Severity> severityMaps = new HashMap<>();   //  以묒슂�룄 紐⑥쓬
             Map<String, Object> userMaps = new HashMap<>(); //  �궗�슜�옄 紐⑥쓬
+            Map<String, Object> departmentMaps = new HashMap<>(); //  遺��꽌 紐⑥쓬
             Map<String, CustomField> customFieldMaps = new HashMap<>();
             Map<String, IssueStatus> issueStatusReadyMaps = new HashMap<>();   //  �긽�깭 �냽�꽦 '��湲�'�씤 �씠�뒋 �긽�깭
             Map<Long, Long> issueNumberMaps = new HashMap<>();  //  �씠�뒋 踰덊샇 紐⑥쓬
             Map<String, Long> issueTypeCustomFieldMaps = new HashMap<>(); //  �씠�뒋 ���엯 + �궗�슜�옄 �젙�쓽 �븘�뱶 �뿰寃� �젙蹂�
             Workspace workspace = this.workspaceService.getWorkspace(this.userService.getUser(this.webAppUtil.getLoginId()).getLastWorkspaceId());  //  �씠�뒋瑜� �꽔�쑝�젮�뒗 �뾽臾� 怨듦컙
             //  �씠�뒋�쓽 二쇱슂 �냽�꽦�쓣 map �뿉 ���옣�븯�뿬 �뿊�� import �뿉�꽌 吏��젙�븳 ���긽(�씠�뒋 �냽�꽦)�쓣 鍮좊Ⅴ寃� 李얠쓣 �닔 �엳寃� �븳�떎.
-            this.IssueAttributeMapToList(projectMaps, issueTypeMaps, priorityMaps, severityMaps, userMaps, customFieldMaps, issueNumberMaps, issueTypeCustomFieldMaps, issueStatusReadyMaps);
+            this.IssueAttributeMapToList(projectMaps, issueTypeMaps, priorityMaps, severityMaps, userMaps, departmentMaps, customFieldMaps, issueNumberMaps, issueTypeCustomFieldMaps, issueStatusReadyMaps);
             //  0.237 - 0.230
 
             List<IssueForm> issueForms = Lists.newArrayList();
@@ -2003,7 +2022,7 @@
 
     //  �씠�뒋�쓽 二쇱슂 �냽�꽦�쓣 map �뿉 ���옣�븯�뿬 �뿊�� import �뿉�꽌 吏��젙�븳 ���긽(�씠�뒋 �냽�꽦)�쓣 鍮좊Ⅴ寃� 李얠쓣 �닔 �엳寃� �븳�떎.
     private void IssueAttributeMapToList(Map<String, Project> projectMaps, Map<String, IssueType> issueTypeMaps, Map<String, Priority> priorityMaps, Map<String, Severity> severityMaps,
-                                         Map<String, Object> userMaps, Map<String, CustomField> customFieldMaps, Map<Long, Long> issueNumberMaps, Map<String, Long> issueTypeCustomFieldMaps, Map<String, IssueStatus> issueStatusReadyMaps) {
+                                         Map<String, Object> userMaps, Map<String, Object> departmentMaps, Map<String, CustomField> customFieldMaps, Map<Long, Long> issueNumberMaps, Map<String, Long> issueTypeCustomFieldMaps, Map<String, IssueStatus> issueStatusReadyMaps) {
         //  �봽濡쒖젥�듃 �궎濡� 諛붾줈 李얠쓣 �닔 �엳寃� 以�鍮�
         List<Project> projects = this.projectService.findByWorkspaceId();
         List<Long> projectIds = Lists.newArrayList();
@@ -2029,6 +2048,14 @@
             }
 
             userMaps.put(project.getProjectKey(), userMap);
+
+            //  �봽濡쒖젥�듃�뿉 李몄뿬�븯�뒗 遺��꽌 �젙蹂�
+            List<Map<String, Object>> departments = this.departmentService.findProjectDepartment(project);
+            List<Long> departmentList = Lists.newArrayList();
+            //  遺��꽌 �젙蹂대�� ���옣
+            for (Map<String, Object> department : departments) {
+                departmentList.add(MapUtil.getLong(department, "departmentId"));
+            }
         }
 
         //  �씠�뒋 �쑀�삎�쓣 諛붾줈 李얠쓣 �닔 �엳寃� 以�鍮�

--
Gitblit v1.8.0