Merge branch 'bo_bug_fixes' into 'dev'

[BO] 임가 등록 엑셀 업로드 오류 수정 : getCellNumberValue -> String이나 FORMULA 타입으로 으로 들어올 경우 반환되도록 추가

See merge request korea-research/korea-research!135
This commit is contained in:
이강선 매니저/ST
2025-07-21 02:09:59 +00:00
2 changed files with 17 additions and 1 deletions

View File

@@ -131,7 +131,7 @@ class ExcelUploadCreateHouseholdDao implements ExcelUploadCreateHouseholdPortOut
}
}
workbook.close();
return new ExcelUploadResultVO(sheet.getLastRowNum()-1 , success, errorList);
return new ExcelUploadResultVO(sheet.getLastRowNum() , success, errorList);
}
// 셀 값을 문자열로 변환
@@ -147,8 +147,23 @@ class ExcelUploadCreateHouseholdDao implements ExcelUploadCreateHouseholdPortOut
// 셀 값을 문자열로 변환
private Integer getCellNumberValue(Cell cell) {
if (cell == null) return null;
return switch (cell.getCellType()) {
case NUMERIC -> (int) cell.getNumericCellValue();
case STRING -> {
try {
yield Integer.parseInt(cell.getStringCellValue().trim());
} catch (NumberFormatException e) {
yield null;
}
}
case FORMULA -> {
try {
yield (int) cell.getNumericCellValue();
} catch (Exception e) {
yield null;
}
}
default -> null;
};
}

View File

@@ -74,6 +74,7 @@
ajaxUtil._hideWaiting(); // 로딩바 hide
alert("총 "+res.total+"건 중에 "+res.success+"건 등록되었습니다.");
document.querySelector(".modal-excel-household").ui.close();
},
statusCode: {
422: (res) => {