OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-02-08 6806bad8f7e6132c9ba74d7e815ab7d64ecebe9c
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);