From a227dd7df7f84a5cfb7218042a6f844991dcfb96 Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 수, 09 2월 2022 14:53:41 +0900 Subject: [PATCH] - isp, 호스팅 엑셀 import 기능 추가 --- src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java | 53 +++++++++++++++++++++++++++++++---------------------- 1 files changed, 31 insertions(+), 22 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 144a7d1..ba2f863 100644 --- a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java +++ b/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java @@ -3126,7 +3126,7 @@ // 1踰� �뿤�뜑遺��꽣 �뜲�씠�꽣 �쁺�뿭 if (rowIndex > 1) { // �씠�뒋濡� �벑濡앺븯湲� �쐞�빐 IssueForm �뿉 �뜲�씠�꽣瑜� �뀑�똿�븳�떎. - IssueForm newIssueForm = this.setIssueFormToExcelField(row, (rowIndex + 1), priorityMaps, severityMaps, departmentMaps, customFieldMaps, + IssueForm newIssueForm = this.setIssueFormToExcelField(row, (rowIndex + 1), priorityMaps, severityMaps, customFieldMaps, companyFieldMaps, ispFieldMaps, hostingFieldMaps, headers); ConvertUtil.copyProperties(issueForm, newIssueForm); @@ -3470,23 +3470,38 @@ } /** + * cell String�쑝濡� 蹂��솚 �븿�닔 + * @param cell Cell + * @param isNull boolean + * @return String + */ + private String stringToCell (Cell cell, boolean isNull) { + String cellStr = ""; + if (!isNull) { + cellStr = CommonUtil.convertExcelStringToCell(cell); + // 怨듬갚 �젣嫄� + cell.setCellValue(cellStr.trim()); + } else { + cell.setCellValue(cellStr); + } + return cellStr; + } + + /** * cell NULL 泥댄겕 �븿�닔 * 鍮� 媛믪씠 �븘�땶 cell 泥댄겕 * @param cell Cell * @return boolean */ private Boolean cellNullCheck (Cell cell) { - if (cell != null ) { - int cellType = cell.getCellType(); - if (cellType < Cell.CELL_TYPE_BLANK) { - if (cellType == Cell.CELL_TYPE_STRING) - { - if (cell.getStringCellValue() != null && !cell.getStringCellValue().equals("")) { - return false; - } - } else { + int cellType = cell.getCellType(); + if (cellType < Cell.CELL_TYPE_BLANK) { + if (cellType == Cell.CELL_TYPE_STRING) { + if (cell.getStringCellValue() != null && !cell.getStringCellValue().equals("")) { return false; } + } else { + return false; } } return true; @@ -3494,28 +3509,22 @@ // �뿊�� �븘�뱶�뿉 �엳�뒗 �젙蹂대�� �씠�뒋 form �쑝濡� �삷湲대떎. private IssueForm setIssueFormToExcelField(Row row, int rowIndex, Map<String, Priority> priorityMaps, - Map<String, Severity> severityMaps, Map<String, DepartmentVo> departmentMaps, - Map<String, CustomField> customFieldMaps, Map<String, CompanyField> companyFieldMaps, - Map<String, IspField> ispFieldMaps, Map<String, HostingField> hostingFieldMaps, + Map<String, Severity> severityMaps, Map<String, CustomField> customFieldMaps, + Map<String, CompanyField> companyFieldMaps, Map<String, IspField> ispFieldMaps, Map<String, HostingField> hostingFieldMaps, List<String> headers) throws ParseException { IssueForm issueForm = new IssueForm(); issueForm.setRegisterId(this.webAppUtil.getLoginId()); - Project project = null; // �젣紐�, �궡�슜, �봽濡쒖젥�듃 �궎, �씠�뒋 ���엯, �슦�꽑�닚�쐞, 以묒슂�룄, �떞�떦�옄, �떆�옉�씪, 醫낅즺�씪, �궗�슜�옄 �젙�쓽 �븘�뱶 for (int cellIndex = 0; cellIndex < headers.size(); cellIndex++) { Cell cell = row.getCell(cellIndex); - boolean isNull = cellNullCheck(cell); String cellStr = ""; + boolean isNull = true; - if (!isNull) { - cellStr = CommonUtil.convertExcelStringToCell(cell); - - // 怨듬갚 �젣嫄� - cell.setCellValue(cellStr.trim()); - } else { - cell.setCellValue(cellStr); + if (cell != null) { + isNull = cellNullCheck(cell); + cellStr = stringToCell(cell, isNull); //cell�쓣 String�쑝濡� 蹂��솚 } switch (cellIndex) { -- Gitblit v1.8.0