| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import static kr.wisestone.owl.domain.enumType.CustomFieldType.DATETIME; |
| | | import static kr.wisestone.owl.domain.enumType.CustomFieldType.INPUT; |
| | | |
| | | @Service |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * cell NULL 체크 함수 |
| | | * @param cell Cell |
| | | * @return boolean |
| | | */ |
| | | private Boolean cellNullCheck (Cell cell) { |
| | | return cell != null && cell.getStringCellValue() != null && cell.getCellType() != Cell.CELL_TYPE_BLANK; |
| | | } |
| | | |
| | | // 엑셀 필드에 있는 정보를 이슈 form 으로 옮긴다. |
| | | private IssueForm setIssueFormToExcelField(Row row, int rowIndex, Map<String, Priority> priorityMaps, |
| | | Map<String, Severity> severityMaps, Map<String, DepartmentVo> departmentMaps, |
| | |
| | | break; |
| | | |
| | | case 1: // 내용 |
| | | if (cell != null) { |
| | | if (cellNullCheck(cell)) { |
| | | issueForm.setDescription(CommonUtil.convertExcelStringToCell(cell)); |
| | | } else { |
| | | // null 입력 방지 |
| | |
| | | break;*/ |
| | | case 4: |
| | | // 시작일을 IssueForm 에 저장한다. |
| | | if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) { |
| | | if (cellNullCheck(cell)) { |
| | | this.setIssueFormPeriod(cell, issueForm, true, rowIndex); |
| | | } |
| | | break; |
| | | case 5: |
| | | // 종료일을 IssueForm 에 저장한다. |
| | | if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK) { |
| | | if (cellNullCheck(cell)) { |
| | | this.setIssueFormPeriod(cell, issueForm, false, rowIndex); |
| | | } |
| | | break; |
| | |
| | | case EMAIL: |
| | | case SITE: |
| | | case TEL: |
| | | if (customField.getCustomFieldType() != INPUT && cellValue.length() > 100) { |
| | | if (customField.getCustomFieldType() != INPUT && cellValue.length() > 100) { //INPUT 타입은 100자 제한 없음 |
| | | throw new OwlRuntimeException( |
| | | this.messageAccessor.getMessage(MsgConstants.CUSTOM_FIELD_TEXT_TYPE_MAX_LENGTH_OUT)); |
| | | } |
| | | |
| | | if (customField.getCustomFieldType() == DATETIME) { //DATETIME일 경우 format 변경 |
| | | Date date = cell.getDateCellValue(); |
| | | cellValue = new SimpleDateFormat("yyyy-MM-dd H:mm:ss").format(date); |
| | | } |
| | | |
| | | issueCustomFieldMap.put("customFieldId", customField.getId()); |
| | | issueCustomFieldMap.put("useValue", cellValue); |
| | | issueForm.addIssueCustomFields(issueCustomFieldMap); |