OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-02-07 11e27ddf54f5b4e2310591f74e8dd446e65a18ac
src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java
@@ -3455,6 +3455,13 @@
     * @return boolean
     */
    private Boolean cellNullCheck (Cell cell) {
        if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK && cell.getCellType() != Cell.CELL_TYPE_STRING) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.EXCEL_IMPORT_NOT_STRING_TYPE));
        }
        if (cell != null && cell.getStringCellValue() != null) {
            cell.setCellValue(cell.getStringCellValue().trim());//셀 값 공백 제거
        }
        return cell != null && cell.getStringCellValue() != null && !cell.getStringCellValue().equals("") && cell.getCellType() != Cell.CELL_TYPE_BLANK;
    }
@@ -3502,13 +3509,13 @@
                    break;*/
                case 4:
                    //  시작일을 IssueForm 에 저장한다.
                    if (cellNullCheck(cell)) {
                    if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) {
                        this.setIssueFormPeriod(cell, issueForm, true, rowIndex);
                    }
                    break;
                case 5:
                    //  종료일을 IssueForm 에 저장한다.
                    if (cellNullCheck(cell)) {
                    if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) {
                        this.setIssueFormPeriod(cell, issueForm, false, rowIndex);
                    }
                    break;
@@ -3580,7 +3587,7 @@
    //  이슈 제목을 IssueForm 에 저장한다.
    private void setIssueFormTitle(Cell cell, IssueForm issueForm, int rowIndex) {
        if (cell == null) {
        if (!cellNullCheck(cell)) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.EXCEL_IMPORT_ISSUE_TITLE_IS_NULL, rowIndex));
        }
@@ -3628,7 +3635,7 @@
    //  우선순위를 IssueForm 에 저장한다.
    private void setIssueFormPriority(Cell cell, Map<String, Priority> priorityMaps, IssueForm issueForm, int rowIndex) {
        if (cell == null) {
        if (!cellNullCheck(cell)) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.EXCEL_IMPORT_PRIORITY_IS_NULL, rowIndex));
        }
@@ -3645,7 +3652,7 @@
    //  중요도를 IssueForm 에 저장한다.
    private void setIssueFormSeverity(Cell cell, Map<String, Severity> severityMaps, IssueForm issueForm, int rowIndex) {
        if (cell == null) {
        if (!cellNullCheck(cell)) {
            throw new OwlRuntimeException(
                    this.messageAccessor.getMessage(MsgConstants.EXCEL_IMPORT_SEVERITY_IS_NULL, rowIndex));
        }
@@ -3681,8 +3688,13 @@
            //  값이 공백이면 중지
            String cellValue = CommonUtil.convertExcelStringToCell(cell);
            if (StringUtils.isEmpty(cellValue) || !cell.toString().equals("null")) {
            if (StringUtils.isEmpty(cellValue) || cell.toString().equals("null")) {
                return;
            }
            if (cell.toString().length() < 10 && cell.toString().contains("-")) { //날짜 형식 체크
                throw new OwlRuntimeException(
                        this.messageAccessor.getMessage(MsgConstants.EXCEL_IMPORT_PERIOD_NOT_DASH, rowIndex));
            }
            Date startDate;
@@ -3742,6 +3754,10 @@
                    }
                    if (customField.getCustomFieldType() == DATETIME) { //DATETIME일 경우 format 변경
                        if (cell.toString().length() < 10 && cell.toString().contains("-")) { //날짜 형식 체크
                            throw new OwlRuntimeException(
                                    this.messageAccessor.getMessage(MsgConstants.EXCEL_IMPORT_DATETIME_NOT_DASH, rowIndex));
                        }
                        Date date = cell.getDateCellValue();
                        cellValue = new SimpleDateFormat("yyyy-MM-dd H:mm:ss").format(date);
                    }