OWL ITS + 탐지시스템(인터넷 진흥원)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
package kr.wisestone.owl.web.condition;
 
import com.google.common.collect.Lists;
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.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
 
/**
 * Created by wisestone on 2018-01-04.
 */
public class IssueCondition {
    private Long id;
    private String keyWord;
    private String title;
    private String description;
    private String combinationIssueNumber;
    private String projectKey;
    private String issueNumber;
    private String beginRegisterDate;
    private String endRegisterDate;
    private String beginStartDate;
    private String endStartDate;
    private String beginCompleteDate;
    private String endCompleteDate;
    private String beginDateRange;
    private String endDateRange;
    private Integer page;
    private Integer pageSize;
    private Long loginUserId;
    private Long workspaceId;
    private String projectType;
    private String deep;
    private String isApi;
    private Long parentIssueId;     // 상위 일감
    private String useValue;
    private List<Long> projectIds = Lists.newArrayList();
    private List<Long> issueStatusIds = Lists.newArrayList();
    private List<Long> issueTypeIds = Lists.newArrayList();
    private List<Long> priorityIds = Lists.newArrayList();
    private List<Long> severityIds = Lists.newArrayList();
    private List<Long> userIds = Lists.newArrayList();
    private List<Long> departmentIds = Lists.newArrayList();
    private List<Long> registerIds = Lists.newArrayList();
    private List<String> issueIds = Lists.newArrayList();   //  이슈 목록 검색에서 사용자 정의 필드로 1차 검색한 결과를 담을때 사용
    private List<Map<String, Object>> issueCustomFields = Lists.newArrayList();
    private List<Map<String, Object>> issueCompanyField = Lists.newArrayList();
    private List<Map<String, Object>> issueIspField = Lists.newArrayList();
    private List<Map<String, Object>> issueHostingField = Lists.newArrayList();
    private List<Long> statusIds = Lists.newArrayList();
    private List<Long> excludeIds = Lists.newArrayList();
    private List<Long> myDepartmentIds; // 내가 속해있는 부서 ID
    private Boolean hideDownIssue;
    private Boolean hideCompleteIssue;
    private Boolean isTree; // 트리구조 모드 일때
    private Pageable relPageable;
    private Pageable downPageable;
    private Boolean allIssue; // 완료된 이슈까지 보여줄지 여부
    private Long issueTypeId;
    private Boolean parentYN;   //상위이슈만 조회 여부
 
    public IssueCondition(){}
 
    public IssueCondition(Long issueId, Long parentIssueId){
        this.id = issueId;
        this.parentIssueId = parentIssueId;
    }
    //  대시보드 위기관리 위젯에서 사용
    public IssueCondition(List<String> issueIds){
        this.issueIds = issueIds;
    }
 
    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("-")) {
                String [] combinations = condition.getCombinationIssueNumber().split("-");
 
                if (combinations.length > 0) {
                    condition.setProjectKey(combinations[0].trim());
                    if (combinations.length > 1) {
                        condition.setIssueNumber(combinations[1].trim());
                    }
                }
            }
            else {
                if (CommonUtil.isNumeric(condition.getCombinationIssueNumber())) {
                    condition.setIssueNumber(condition.getCombinationIssueNumber());
                }
                else {
                    condition.setProjectKey(condition.getCombinationIssueNumber());
                }
            }
        }
 
        if (MapUtil.getString(conditions, "name") != null) {
            condition.setTitle(MapUtil.getString(conditions, "name"));
        }
 
        if (MapUtil.getObject(conditions, "issueCustomFields") != null) {
            condition.setIssueCustomFields((List)MapUtil.getObject(conditions, "issueCustomFields"));
        }
 
        if (MapUtil.getObject(conditions, "issueCompanyField") != null) {
            condition.setIssueCompanyField((List)MapUtil.getObject(conditions, "issueCompanyField"));
        }
 
        if (MapUtil.getObject(conditions, "issueIspField") != null) {
            condition.setIssueIspField((List)MapUtil.getObject(conditions, "issueIspField"));
        }
 
        if (MapUtil.getObject(conditions, "issueHostingField") != null) {
            condition.setIssueHostingField((List)MapUtil.getObject(conditions, "issueHostingField"));
        }
 
        if (StringUtils.hasText(MapUtil.getString(conditions, "beginRegisterDate"))) {
            Date beginRegisterDate = DateUtil.convertStrToDate(MapUtil.getString(conditions, "beginRegisterDate"), "yy-MM-dd");
            condition.setBeginRegisterDate(DateUtil.convertDateToStr(beginRegisterDate, "yyyy-MM-dd"));
        }
 
        if (StringUtils.hasText(MapUtil.getString(conditions, "endRegisterDate"))) {
            Date endRegisterDate = DateUtil.addDays(DateUtil.convertStrToDate(MapUtil.getString(conditions, "endRegisterDate"), "yy-MM-dd"), 1);
            condition.setEndRegisterDate(DateUtil.convertDateToStr(endRegisterDate, "yyyy-MM-dd"));
        }
 
        if (StringUtils.hasText(MapUtil.getString(conditions, "beginStartDate"))) {
            Date beginStartDate = DateUtil.convertStrToDate(MapUtil.getString(conditions, "beginStartDate"), "yy-MM-dd");
            condition.setBeginStartDate(DateUtil.convertDateToStr(beginStartDate, "yyyy-MM-dd"));
        }
 
        if (StringUtils.hasText(MapUtil.getString(conditions, "endStartDate"))) {
            Date endStartDate = DateUtil.convertStrToDate(MapUtil.getString(conditions, "endStartDate"), "yy-MM-dd");
            condition.setEndStartDate(DateUtil.convertDateToStr(endStartDate, "yyyy-MM-dd"));
        }
 
        if (StringUtils.hasText(MapUtil.getString(conditions, "beginCompleteDate"))) {
            Date beginCompleteDate = DateUtil.convertStrToDate(MapUtil.getString(conditions, "beginCompleteDate"), "yy-MM-dd");
            condition.setBeginCompleteDate(DateUtil.convertDateToStr(beginCompleteDate, "yyyy-MM-dd"));
        }
 
        if (StringUtils.hasText(MapUtil.getString(conditions, "endCompleteDate"))) {
            Date endCompleteDate = DateUtil.convertStrToDate(MapUtil.getString(conditions, "endCompleteDate"), "yy-MM-dd");
            condition.setEndCompleteDate(DateUtil.convertDateToStr(endCompleteDate, "yyyy-MM-dd"));
        }
 
        if (StringUtils.hasText(MapUtil.getString(conditions, "dateRange"))) {
            String dateRange = MapUtil.getString(conditions, "dateRange");
            if (!StringUtils.isEmpty(dateRange)) {
                List<String> date = Arrays.asList(dateRange.split("~"));
 
                Date beginDateRange = DateUtil.convertStrToDate(date.get(0).trim(), "yy-MM-dd");
                condition.setBeginDateRange(DateUtil.convertDateToStr(beginDateRange, "yyyy-MM-dd"));
                Date endDateRange = DateUtil.convertStrToDate(date.get(1).trim(), "yy-MM-dd");
                condition.setEndDateRange(DateUtil.convertDateToStr(endDateRange, "yyyy-MM-dd"));
            }
        }
 
        if (MapUtil.getLongs(conditions, "projectIds") != null) {
            condition.setProjectIds(MapUtil.getLongs(conditions, "projectIds"));
        }
 
        if (MapUtil.getLongs(conditions, "issueStatusIds") != null) {
            condition.setIssueStatusIds(MapUtil.getLongs(conditions, "issueStatusIds"));
        }
 
        if (MapUtil.getLongs(conditions, "issueTypeIds") != null) {
            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"));
        }
 
        if (MapUtil.getLongs(conditions, "severityIds") != null) {
            condition.setSeverityIds(MapUtil.getLongs(conditions, "severityIds"));
        }
 
        if (MapUtil.getLongs(conditions, "userIds") != null) {
            condition.setUserIds(MapUtil.getLongs(conditions, "userIds"));
        }
 
        if (MapUtil.getLongs(conditions, "departmentIds") != null) {
            condition.setDepartmentIds(MapUtil.getLongs(conditions, "departmentIds"));
        }
 
        if (MapUtil.getLongs(conditions, "registerIds") != null) {
            condition.setRegisterIds(MapUtil.getLongs(conditions, "registerIds"));
        }
 
        if (MapUtil.getLongs(conditions, "excludeIds") != null) {
            condition.setExcludeIds(MapUtil.getLongs(conditions, "excludeIds"));
        }
 
        if (MapUtil.getLong(conditions, "issueId") != null) {
            condition.setId(MapUtil.getLong(conditions, "issueId"));
        }
 
 
        if (MapUtil.getInteger(conditions, "hideDownIssue") != null) {
            int hideDownIssue = MapUtil.getInteger(conditions, "hideDownIssue");
            if(MapUtil.getBoolean(conditions, "isTree") != null && !MapUtil.getBoolean(conditions, "isTree")){
                switch (hideDownIssue){
                    case 0 : // 이슈 모두 보여주기
                        condition.setHideDownIssue(false);
                        condition.setParentYN(true);
                        break;
                    case 1 : // 상위이슈만 보여주기
                        condition.setHideDownIssue(true);
                        condition.setParentYN(true);
                        break;
                    case 2 : // 하위이슈만 보여주기
                        condition.setHideDownIssue(false);
                        condition.setParentYN(false);
                        break;
                }
            }else if(MapUtil.getBoolean(conditions, "isTree")) {
                condition.setHideDownIssue(false);
            }
        }
 
        if (MapUtil.getBoolean(conditions, "hideCompleteIssue") != null) {
            condition.setHideCompleteIssue(MapUtil.getBoolean(conditions, "hideCompleteIssue"));
        }
 
        if (MapUtil.getBoolean(conditions, "isTree") != null) {
            condition.setTree(MapUtil.getBoolean(conditions, "isTree"));
        } else {
            condition.setTree(false);
        }
 
        if (MapUtil.getBoolean(conditions, "parentYN") != null && MapUtil.getBoolean(conditions, "parentYN")) {
            condition.setParentYN(true);
        }
 
        return condition;
    }
 
    public String getKeyWord() {
        return keyWord;
    }
 
    public void setKeyWord(String keyWord) {
        this.keyWord = keyWord;
    }
 
    public Long getId() {
        return id;
    }
 
    public void setId(Long id) {
        this.id = id;
    }
 
    public String getTitle() {
        return title;
    }
 
    public void setTitle(String title) {
        this.title = title;
    }
 
    public String getDescription() {
        return description;
    }
 
    public void setDescription(String description) {
        this.description = description;
    }
 
    public String getCombinationIssueNumber() {
        return combinationIssueNumber;
    }
 
    public void setCombinationIssueNumber(String combinationIssueNumber) {
        this.combinationIssueNumber = combinationIssueNumber;
    }
 
    public String getProjectKey() {
        return projectKey;
    }
 
    public void setProjectKey(String projectKey) {
        this.projectKey = projectKey;
    }
 
    public String getIssueNumber() {
        return issueNumber;
    }
 
    public void setIssueNumber(String issueNumber) {
        this.issueNumber = issueNumber;
    }
 
    public String getBeginStartDate() {
        return beginStartDate;
    }
 
    public void setBeginStartDate(String beginStartDate) {
        this.beginStartDate = beginStartDate;
    }
 
    public String getEndStartDate() {
        return endStartDate;
    }
 
    public void setEndStartDate(String endStartDate) {
        this.endStartDate = endStartDate;
    }
 
    public String getBeginCompleteDate() {
        return beginCompleteDate;
    }
 
    public void setBeginCompleteDate(String beginCompleteDate) {
        this.beginCompleteDate = beginCompleteDate;
    }
 
    public String getEndCompleteDate() {
        return endCompleteDate;
    }
 
    public void setEndCompleteDate(String endCompleteDate) {
        this.endCompleteDate = endCompleteDate;
    }
 
    public String getBeginDateRange() {
        return beginDateRange;
    }
 
    public void setBeginDateRange(String beginDateRange) {
        this.beginDateRange = beginDateRange;
    }
 
    public String getEndDateRange() {
        return endDateRange;
    }
 
    public void setEndDateRange(String endDateRange) {
        this.endDateRange = endDateRange;
    }
 
    public Integer getPage() {
        return page;
    }
 
    public void setPage(Integer page) {
        this.page = page;
    }
 
    public Integer getPageSize() {
        return pageSize;
    }
 
    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
 
    public Long getLoginUserId() {
        return loginUserId;
    }
 
    public void setLoginUserId(Long loginUserId) {
        this.loginUserId = loginUserId;
    }
 
    public String getDeep() {
        return deep;
    }
 
    public void setDeep(String deep) {
        this.deep = deep;
    }
 
    public String getIsApi() {
        return isApi;
    }
 
    public void setIsApi(String isApi) {
        this.isApi = isApi;
    }
 
    public List<Long> getProjectIds() {
        return projectIds;
    }
 
    public void addProjectIds(Long projectId) {
        this.projectIds.add(projectId);
    }
 
    public void setProjectIds(List<Long> projectIds) {
        this.projectIds = projectIds;
    }
 
    public List<Long> getIssueStatusIds() {
        return issueStatusIds;
    }
 
    public void setIssueStatusIds(List<Long> issueStatusIds) {
        this.issueStatusIds = issueStatusIds;
    }
 
    public List<Long> getIssueTypeIds() {
        return issueTypeIds;
    }
 
    public void setIssueTypeIds(List<Long> issueTypeIds) {
        this.issueTypeIds = issueTypeIds;
    }
 
    public void addIssueTypeIds(Long issueTypeId) {
        this.issueTypeIds.add(issueTypeId);
    }
 
    public List<Long> getPriorityIds() {
        return priorityIds;
    }
 
    public void setPriorityIds(List<Long> priorityIds) {
        this.priorityIds = priorityIds;
    }
 
    public List<Long> getSeverityIds() {
        return severityIds;
    }
 
    public void setSeverityIds(List<Long> severityIds) {
        this.severityIds = severityIds;
    }
 
    public List<Long> getUserIds() {
        return userIds;
    }
 
    public void setUserIds(List<Long> userIds) {
        this.userIds = userIds;
    }
 
    public List<Long> getDepartmentIds() {
        return departmentIds;
    }
 
    public void setDepartmentIds(List<Long> departmentIds) {
        this.departmentIds = departmentIds;
    }
 
    public List<Long> getRegisterIds() {
        return registerIds;
    }
 
    public void setRegisterIds(List<Long> registerIds) {
        this.registerIds = registerIds;
    }
 
    public Long getWorkspaceId() {
        return workspaceId;
    }
 
    public void setWorkspaceId(Long workspaceId) {
        this.workspaceId = workspaceId;
    }
 
    public List<Map<String, Object>> getIssueCustomFields() {
        return issueCustomFields;
    }
 
    public void setIssueCustomFields(List<Map<String, Object>> issueCustomFields) {
        this.issueCustomFields = issueCustomFields;
    }
 
    public List<Map<String, Object>> getIssueCompanyField() {
        return issueCompanyField;
    }
 
    public void setIssueCompanyField(List<Map<String, Object>> issueCompanyField) {
        this.issueCompanyField = issueCompanyField;
    }
 
    public List<Map<String, Object>> getIssueIspField() {
        return issueIspField;
    }
 
    public void setIssueIspField(List<Map<String, Object>> issueIspField) {
        this.issueIspField = issueIspField;
    }
 
    public List<Map<String, Object>> getIssueHostingField() {
        return issueHostingField;
    }
 
    public void setIssueHostingField(List<Map<String, Object>> issueHostingField) {
        this.issueHostingField = issueHostingField;
    }
 
    public List<String> getIssueIds() {
        return issueIds;
    }
 
    public void setIssueIds(List<String> issueIds) {
        this.issueIds = issueIds;
    }
 
    public void addIssueIds(String issueId) {
        this.issueIds.add(issueId);
    }
 
    public String getBeginRegisterDate() {
        return beginRegisterDate;
    }
 
    public void setBeginRegisterDate(String beginRegisterDate) {
        this.beginRegisterDate = beginRegisterDate;
    }
 
    public String getEndRegisterDate() {
        return endRegisterDate;
    }
 
    public void setEndRegisterDate(String endRegisterDate) {
        this.endRegisterDate = endRegisterDate;
    }
 
    public String getProjectType() {
        return projectType;
    }
 
    public void setProjectType(String projectType) {
        this.projectType = projectType;
    }
 
    public void addStatusId(Long statusId) {
        this.statusIds.add(statusId);
    }
 
    public List<Long> getStatusIds() {
        return statusIds;
    }
 
    public List<Long> getExcludeIds() {
        return excludeIds;
    }
 
    public void setExcludeIds(List<Long> excludeIds) {
        this.excludeIds = excludeIds;
    }
 
    public Long getParentIssueId() {
        return parentIssueId;
    }
 
    public void setParentIssueId(Long parentIssueId) {
        this.parentIssueId = parentIssueId;
    }
 
    public String getUseValue() {
        return useValue;
    }
 
    public void setUseValue(String useValue) {
        this.useValue = useValue;
    }
 
    public List<Long> getMyDepartmentIds() {
        return myDepartmentIds;
    }
 
    public void setMyDepartmentIds(List<Long> myDepartmentIds) {
        this.myDepartmentIds = myDepartmentIds;
    }
 
    public Boolean getHideDownIssue() {
        return hideDownIssue;
    }
 
    public void setHideDownIssue(Boolean hideDownIssue) {
        this.hideDownIssue = hideDownIssue;
    }
 
    public Boolean getHideCompleteIssue() {
        return hideCompleteIssue;
    }
 
    public void setHideCompleteIssue(Boolean hideCompleteIssue) {
        this.hideCompleteIssue = hideCompleteIssue;
    }
 
    public Boolean getTree() {
        return isTree;
    }
 
    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;
    }
 
    public Boolean getParentYN() {
        return parentYN;
    }
 
    public void setParentYN(Boolean parentYN) {
        this.parentYN = parentYN;
    }
}