forked from github/dataease
fix: 导入excel识别时间类型
This commit is contained in:
parent
a27fe350ee
commit
bb290704be
@ -1,6 +1,8 @@
|
||||
package io.dataease.commons.utils;
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.datasource.dto.TableFiled;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
@ -67,10 +69,10 @@ public class ExcelReaderUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/* public static void main(String[] args) throws Exception {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
|
||||
String file ="各省市GDP-表格_加内容.xlsx";
|
||||
String file ="修改日期为mm-dd-yyyy.xlsx";
|
||||
ExcelReaderUtil.readExcel(file, new FileInputStream("/Users/taojinlong/Desktop/" + file));
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
@ -319,6 +319,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
nextDataType = CellDataType.NUMBER; //cellType为空,则表示该单元格类型为数字
|
||||
formatIndex = -1;
|
||||
formatString = null;
|
||||
isDateFormat = false;
|
||||
String cellType = attributes.getValue("t"); //单元格类型
|
||||
if ("b".equals(cellType)) { //处理布尔值
|
||||
nextDataType = CellDataType.BOOL;
|
||||
|
Loading…
Reference in New Issue
Block a user