From b548d49284bc36f5016cba913bb6ac55d8a5e340 Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 금, 28 1월 2022 17:40:12 +0900 Subject: [PATCH] 엑셀 임포트 시 코드 수정 --- src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 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 dd99a3d..62f8272 100644 --- a/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java +++ b/src/main/java/kr/wisestone/owl/service/impl/IssueServiceImpl.java @@ -356,7 +356,7 @@ if(companyFields != null && companyFields.size() > 0) { for (Map<String, Object> companyField : companyFields) { CompanyFieldVo companyFieldVo = ConvertUtil.convertMapToClass(companyField, CompanyFieldVo.class); - if(useValue.equals(companyFieldVo.getUrl())) { + if(companyFieldVo.getUrl() != null && useValue.equals(companyFieldVo.getUrl())) { companyField.put("companyId", companyField.get("id")); issueCompanyFields.add(companyField); if(companyFieldVo.getIspId() != null && companyFieldVo.getIspId() != -1) { @@ -3455,6 +3455,9 @@ * @return boolean */ private Boolean cellNullCheck (Cell cell) { + 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; } @@ -3580,7 +3583,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 +3631,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 +3648,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)); } @@ -3712,7 +3715,7 @@ // �궗�슜�옄 �젙�쓽 �븘�뱶 �젙蹂대�� IssueForm �뿉 ���옣�븳�떎.- private void setIssueFormCustomFieldValue(Cell cell, Map<String, CustomField> customFieldMaps, IssueForm issueForm, String customFieldName, int rowIndex) { - if (cell != null) { + if (!cellNullCheck(cell)) { String cellValue = CommonUtil.convertExcelStringToCell(cell); Map<String, Object> issueCustomFieldMap = new HashMap<>(); CustomField customField = customFieldMaps.get(customFieldName); -- Gitblit v1.8.0