| | |
| | | * @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());//셀 값 공백 제거 |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | // 값이 공백이면 중지 |
| | | 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; |
| | |
| | | |
| | | // 사용자 정의 필드 정보를 IssueForm 에 저장한다.- |
| | | private void setIssueFormCustomFieldValue(Cell cell, Map<String, CustomField> customFieldMaps, IssueForm issueForm, String customFieldName, int rowIndex) { |
| | | if (!cellNullCheck(cell)) { |
| | | if (cell != null) { |
| | | String cellValue = CommonUtil.convertExcelStringToCell(cell); |
| | | Map<String, Object> issueCustomFieldMap = new HashMap<>(); |
| | | CustomField customField = customFieldMaps.get(customFieldName); |
| | |
| | | } |
| | | |
| | | 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); |
| | | } |