OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-02-08 e2b9ee4f143ac97c63a5c19ae9424944322c70ad
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 :