From 6211b73ad7750a62652bacf5bcf05002c62fb907 Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 목, 06 1월 2022 15:57:16 +0900
Subject: [PATCH] - 이슈 상세페이지 연관,하위 이슈 페이징 처리 완료

---
 src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java |   56 ++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 42 insertions(+), 14 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 b4b9710..1ec2a43 100644
--- a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
+++ b/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -289,7 +289,7 @@
                     issueApiForm.addUseIssueCustomFieldId(customFieldApiOverlap.getCustomField().getId());
                 }
 
-                // 以묐났�맂 �씠�뒋寃��깋
+                // 醫낅즺�긽�깭媛� �븘�땶 以묐났�맂 �긽�쐞 �씠�뒋寃��깋
                 List<Issue> issues = this.findIssue(issueApiForm, customFieldApiOverlaps, user.getId());
                 int size = issues.size();
                 if (size > 0) {
@@ -446,6 +446,7 @@
             issueCustomFieldValueCondition.setUseValue(concatUseValue);
             issueCustomFieldValueCondition.setUseValues(userValues);
             issueCustomFieldValueCondition.setIssueTypeId(issueApiform.getIssueTypeId());
+            issueCustomFieldValueCondition.setIssueStatusType("CLOSE");
             List<Map<String, Object>> results = this.issueMapper.findByCustomFieldValue(issueCustomFieldValueCondition);
             if (results != null && results.size() > 0) {
                 for (Map<String, Object> result : results) {
@@ -944,7 +945,7 @@
 //        if (!this.userWorkspaceService.checkWorkspaceManager(user)
 //                && !MngPermission.checkMngPermission(userLevel.getPermission(), MngPermission.USER_PERMISSION_MNG_ISSUE)) { //理쒓퀬愿�由ъ옄 & �봽濡쒖젥�듃,�씠�뒋 愿�由ъ옄 �씪 寃쎌슦 紐⑤뱺 �씠�뒋 蹂닿린
 //            this.SetMyDepartmentId(issueCondition);
-            //this.SetAllDepartmentId(issueCondition);
+        //this.SetAllDepartmentId(issueCondition);
 //        } /*else{
 //            results = this.issueMapper.findByDepartment(issueCondition);
 //            totalCount = this.issueMapper.countByDepartment(issueCondition);
@@ -1471,17 +1472,22 @@
     //  �씠�뒋 �긽�꽭 �젙蹂대�� 議고쉶�븳�떎.
     @Override
     @Transactional(readOnly = true)
-    public void detailIssue(Map<String, Object> resJsonData, IssueCondition issueCondition, Pageable relPageable, Pageable downPageable) {
+    public void detailIssue(Map<String, Object> resJsonData, IssueCondition issueCondition) {
         IssueVo issueVo = new IssueVo();
+        Pageable relPageable = issueCondition.getRelPageable();
+        Pageable downPageable = issueCondition.getDownPageable();
 
         if (issueCondition.getId() != null) {
             Issue issue = this.getIssue(issueCondition.getId());
             issueVo = ConvertUtil.copyProperties(issue, IssueVo.class);
             User user = this.webAppUtil.getLoginUserObject();
 
-            issueVo.setRelPage(relPageable.getPageNumber() * relPageable.getPageSize());
-            issueVo.setRelPageSize(relPageable.getPageSize());
 
+            issueVo.setRelPageNumber(relPageable.getPageNumber());
+            issueVo.setRelPageSize(relPageable.getPageSize());
+            issueVo.setRelPage(relPageable.getPageNumber() * relPageable.getPageSize());
+
+            issueVo.setDownPageNumber(downPageable.getPageNumber());
             issueVo.setDownPage(downPageable.getPageNumber() * downPageable.getPageSize());
             issueVo.setDownPageSize(downPageable.getPageSize());
 
@@ -1509,19 +1515,10 @@
                     break;
             }
         }
-        Long relTotalCount = issueVo.getRelTotalCount();
-        int relTotalPage = issueVo.getRelTotalPage();
-
-        Long downTotalCount = issueVo.getDownTotalCount();
-        int downTotalPage = issueVo.getDownTotalPage();
         //  �궗�슜�옄 �떆�뒪�뀥 湲곕뒫 �궗�슜 �젙蹂� �닔吏�
         log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(this.webAppUtil.getLoginUser(), ElasticSearchConstants.ISSUE_DETAIL));
 
         resJsonData.put(Constants.RES_KEY_CONTENTS, issueVo);
-        resJsonData.put(Constants.REQ_KEY_RELATION_ISSUE_PAGE_VO, new ResPage(relPageable.getPageNumber(), relPageable.getPageSize(),
-                relTotalPage, relTotalCount));
-        resJsonData.put(Constants.REQ_KEY_DOWN_ISSUE_PAGE_VO, new ResPage(downPageable.getPageNumber(), downPageable.getPageSize(),
-                downTotalPage, downTotalCount));
     }
 
     // �뀒�씠釉� �꽕�젙 �뀑�똿
@@ -3593,6 +3590,37 @@
         this.issueHistoryService.addIssueHistory(issue, IssueHistoryType.SEND, sb.toString());
     }
 
+    @Override
+    public void sendCommonEmail(EmailCommonForm emailCommonForm) {
+        if (emailCommonForm.getSendEmails().size() < 1) {
+            throw new OwlRuntimeException(
+                    this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_SEND_USER));
+        } else if (emailCommonForm.getIssueId() == null) {
+            throw new OwlRuntimeException(
+                    this.messageAccessor.getMessage(MsgConstants.ISSUE_NOT_EXIST));
+        }
+
+        Issue issue = this.getIssue(emailCommonForm.getIssueId());
+
+        //  諛쒖떊�옄 �몴�떆
+        User user = this.webAppUtil.getLoginUserObject();
+        UserVo toUser = this.webAppUtil.getLoginUser();
+
+        //  �궗�슜�옄 �떆�뒪�뀥 湲곕뒫 �궗�슜 �젙蹂� �닔吏�
+        log.info(ElasticSearchUtil.makeUserActiveHistoryMessage(this.webAppUtil.getLoginUser(), ElasticSearchConstants.ISSUE_ANOTHER_USER_SEND_EMAIL));
+        StringBuilder sb = new StringBuilder();
+
+        Locale locale = CommonUtil.getUserLanguage(user.getLanguage());
+        String[] sendMails = ConvertUtil.ToArray(emailCommonForm.getSendEmails());
+        for(int i=0; i < sendMails.length; i++) {
+            sendMails[i] = CommonUtil.decryptAES128(sendMails[i]);
+        }
+        this.systemEmailService.sendEmail(emailCommonForm.getTitle(), emailCommonForm.getDescription(), sendMails, null);
+
+        this.issueHistoryService.detectSendIssueMail(IssueHistoryType.SEND, emailCommonForm.getSendEmails(), sb);
+        this.issueHistoryService.addIssueHistory(issue, IssueHistoryType.SEND, sb.toString());
+    }
+
     //  �삁�빟 諛쒖깮 �씠�뒋瑜� �떎�뻾�븳�떎
     @Override
     @Transactional

--
Gitblit v1.8.0