From e2b9ee4f143ac97c63a5c19ae9424944322c70ad Mon Sep 17 00:00:00 2001 From: 이민희 <mhlee@maprex.co.kr> Date: 화, 08 2월 2022 10:36:08 +0900 Subject: [PATCH] 이슈 임포트 코드 수정 --- src/main/java/kr/wisestone/owl/util/CommonUtil.java | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/main/java/kr/wisestone/owl/util/CommonUtil.java b/src/main/java/kr/wisestone/owl/util/CommonUtil.java index 079f3a4..22f87bb 100644 --- a/src/main/java/kr/wisestone/owl/util/CommonUtil.java +++ b/src/main/java/kr/wisestone/owl/util/CommonUtil.java @@ -12,6 +12,7 @@ import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.ss.usermodel.Cell; import org.jsoup.Jsoup; import org.slf4j.Logger; @@ -40,6 +41,7 @@ import java.security.MessageDigest; import java.security.spec.KeySpec; import java.text.DecimalFormat; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.regex.Matcher; @@ -959,17 +961,24 @@ switch (cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC : - double doubleValue = cell.getNumericCellValue(); - int intValue; + + // �궇吏� �삎�떇�씤 寃쎌슦 �궇吏쒕줈 蹂��솚 + if (HSSFDateUtil.isCellDateFormatted(cell)) { + Date date = cell.getDateCellValue(); + cellValue = DateUtil.convertDateToStr(date, "yyyy-MM-dd hh:mm:ss"); - if (doubleValue%1 == 0) { - intValue = (int)doubleValue; - cellValue = intValue + ""; - } - else { - cellValue = doubleValue + ""; - } + } else { + double doubleValue = cell.getNumericCellValue(); + int intValue; + if (doubleValue % 1 == 0) { + intValue = (int)doubleValue; + cellValue = intValue + ""; + } + else { + cellValue = doubleValue + ""; + } + } break; case Cell.CELL_TYPE_STRING : -- Gitblit v1.8.0