From 303d80b28240177fdb813872d00fad757cd650d4 Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 목, 13 1월 2022 17:34:24 +0900
Subject: [PATCH] 이슈 테이블 설정 오류 해결

---
 src/main/java/kr/wisestone/owl/web/condition/IssueCondition.java |   67 +++++++++++++++++++++++++++++++--
 1 files changed, 62 insertions(+), 5 deletions(-)

diff --git a/src/main/java/kr/wisestone/owl/web/condition/IssueCondition.java b/src/main/java/kr/wisestone/owl/web/condition/IssueCondition.java
index 0113fcd..befe420 100644
--- a/src/main/java/kr/wisestone/owl/web/condition/IssueCondition.java
+++ b/src/main/java/kr/wisestone/owl/web/condition/IssueCondition.java
@@ -1,10 +1,9 @@
 package kr.wisestone.owl.web.condition;
 
 import com.google.common.collect.Lists;
-import kr.wisestone.owl.util.CommonUtil;
-import kr.wisestone.owl.util.ConvertUtil;
-import kr.wisestone.owl.util.DateUtil;
-import kr.wisestone.owl.util.MapUtil;
+import kr.wisestone.owl.util.*;
+import kr.wisestone.owl.vo.PageVo;
+import org.springframework.data.domain.Pageable;
 import org.springframework.util.StringUtils;
 
 import java.util.Date;
@@ -56,6 +55,10 @@
     private Boolean hideDownIssue;
     private Boolean hideCompleteIssue;
     private Boolean isTree; // �듃由ш뎄議� 紐⑤뱶 �씪�븣
+    private Pageable relPageable;
+    private Pageable downPageable;
+    private Boolean allIssue; // �쟾泥댁씠�뒋 蹂댁뿬二쇨린
+    private Long issueTypeId;
 
     public IssueCondition(){}
 
@@ -70,6 +73,20 @@
 
     public static IssueCondition make(Map<String, Object> conditions) {
         IssueCondition condition = ConvertUtil.convertMapToClass(conditions, IssueCondition.class);
+        Map<String, Object> pageContents = (Map<String, Object>) conditions.get("pageContent");
+        if (pageContents != null) {
+            PageVo downPageVo = new PageVo();
+            downPageVo.setPage(MapUtil.getInteger(pageContents, "downPage"));
+            downPageVo.setPageSize(MapUtil.getInteger(pageContents, "downPageSize"));
+
+            PageVo relPageVo = new PageVo();
+            relPageVo.setPage(MapUtil.getInteger(pageContents, "relPage"));
+            relPageVo.setPageSize(MapUtil.getInteger(pageContents, "relPageSize"));
+
+            PageUtil pageUtil = new PageUtil();
+            condition.setRelPageable(pageUtil.convertPageable(relPageVo));
+            condition.setDownPageable(pageUtil.convertPageable(downPageVo));
+        }
 
         if (!StringUtils.isEmpty(condition.getCombinationIssueNumber())) {
             if (condition.getCombinationIssueNumber().contains("-")) {
@@ -154,6 +171,10 @@
             condition.setIssueTypeIds(MapUtil.getLongs(conditions, "issueTypeIds"));
         }
 
+        if (MapUtil.getLong(conditions, "issueTypeId") != null) {
+            condition.setIssueTypeId(MapUtil.getLong(conditions, "issueTypeId"));
+        }
+
         if (MapUtil.getLongs(conditions, "priorityIds") != null) {
             condition.setPriorityIds(MapUtil.getLongs(conditions, "priorityIds"));
         }
@@ -183,7 +204,11 @@
         }
 
         if (MapUtil.getBoolean(conditions, "hideDownIssue") != null) {
-            condition.setHideDownIssue(MapUtil.getBoolean(conditions, "hideDownIssue"));
+            if(MapUtil.getBoolean(conditions, "isTree") != null && !MapUtil.getBoolean(conditions, "isTree")){
+                condition.setHideDownIssue(MapUtil.getBoolean(conditions, "hideDownIssue"));
+            }else if(MapUtil.getBoolean(conditions, "isTree")) {
+                condition.setHideDownIssue(false);
+            }
         }
 
         if (MapUtil.getBoolean(conditions, "hideCompleteIssue") != null) {
@@ -538,4 +563,36 @@
     public void setTree(Boolean tree) {
         isTree = tree;
     }
+
+    public Pageable getRelPageable() {
+        return relPageable;
+    }
+
+    public void setRelPageable(Pageable relPageable) {
+        this.relPageable = relPageable;
+    }
+
+    public Pageable getDownPageable() {
+        return downPageable;
+    }
+
+    public void setDownPageable(Pageable downPageable) {
+        this.downPageable = downPageable;
+    }
+
+    public Boolean getAllIssue() {
+        return allIssue;
+    }
+
+    public void setAllIssue(Boolean allIssue) {
+        this.allIssue = allIssue;
+    }
+
+    public Long getIssueTypeId() {
+        return issueTypeId;
+    }
+
+    public void setIssueTypeId(Long issueTypeId) {
+        this.issueTypeId = issueTypeId;
+    }
 }

--
Gitblit v1.8.0