OWL ITS + 탐지시스템(인터넷 진흥원)
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 {
@@ -3765,7 +3765,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 +3774,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);