From 6806bad8f7e6132c9ba74d7e815ab7d64ecebe9c Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 화, 08 2월 2022 14:11:58 +0900
Subject: [PATCH] - 이슈 임포트 시 공백 오류 수정

---
 src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 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 7724e79..144a7d1 100644
--- a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
+++ b/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -49,9 +49,9 @@
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.regex.Pattern;
 
-import static kr.wisestone.owl.domain.enumType.CustomFieldType.DATETIME;
-import static kr.wisestone.owl.domain.enumType.CustomFieldType.INPUT;
+import static kr.wisestone.owl.domain.enumType.CustomFieldType.*;
 
 @Service
 public class IssueServiceImpl extends AbstractServiceImpl<Issue, Long, JpaRepository<Issue, Long>> implements IssueService {
@@ -3481,7 +3481,7 @@
             if (cellType < Cell.CELL_TYPE_BLANK) {
                 if (cellType == Cell.CELL_TYPE_STRING)
                 {
-                    if (cell.getStringCellValue() != null) {
+                    if (cell.getStringCellValue() != null && !cell.getStringCellValue().equals("")) {
                         return false;
                     }
                 } else {
@@ -3491,9 +3491,6 @@
         }
         return true;
     }
-
-
-
 
     //  �뿊�� �븘�뱶�뿉 �엳�뒗 �젙蹂대�� �씠�뒋 form �쑝濡� �삷湲대떎.
     private IssueForm setIssueFormToExcelField(Row row, int rowIndex, Map<String, Priority> priorityMaps,
@@ -3765,7 +3762,8 @@
                             this.messageAccessor.getMessage(MsgConstants.CUSTOM_FIELD_TEXT_TYPE_MAX_LENGTH_OUT));
                 }
 
-                if (customField.getCustomFieldType() == DATETIME) { //DATETIME�씪 寃쎌슦 format 蹂�寃�
+                //DATETIME�씪 寃쎌슦 format 蹂�寃�
+                if (customField.getCustomFieldType() == DATETIME) {
                     Date date = DateUtil.convertStrToDate(cellValue);
                     if (date == null) {
                         throw new OwlRuntimeException(
@@ -3773,6 +3771,19 @@
                     }
                 }
 
+                //IP_ADDRESS�씪 寃쎌슦 �젙洹쒗몴�쁽�떇 泥댄겕
+                if (customField.getCustomFieldType() == IP_ADDRESS) {
+                    String regExp = "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
+                            + "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
+                            + "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
+                            + "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$";
+
+                    if (!cellValue.matches(regExp)) {
+                        throw new OwlRuntimeException(
+                                this.messageAccessor.getMessage(MsgConstants.EXCEL_IMPORT_IP_ADDRESS_NOT_VALIDITY, rowIndex));
+                    }
+                }
+
                 issueCustomFieldMap.put("customFieldId", customField.getId());
                 issueCustomFieldMap.put("useValue", cellValue);
                 issueForm.addIssueCustomFields(issueCustomFieldMap);

--
Gitblit v1.8.0