1、update pkg path to com.lxyer

2、update bug for cell only 'NUMERIC' can't read
3、give up use poi's old api
This commit is contained in:
lxyer 2018-09-15 09:28:28 +08:00
parent 9f92af761d
commit a10f7e3680
4 changed files with 16 additions and 14 deletions

View File

@ -1,4 +1,4 @@
package excel; package com.lxyer.excel;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;

View File

@ -1,16 +1,16 @@
package excel.poi; package com.lxyer.excel.poi;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.OfficeXmlFileException; import org.apache.poi.poifs.filesystem.OfficeXmlFileException;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -331,10 +331,12 @@ public class ExcelKit {
private static boolean isEmptyRow(Row row, int len){ private static boolean isEmptyRow(Row row, int len){
for (int i = 0; i< row.getLastCellNum() && i < len; i++) { for (int i = 0; i< row.getLastCellNum() && i < len; i++) {
Cell cell = row.getCell(i);// Cell cell = row.getCell(i);//
if (cell != null && cell.getCellType() != 0 if (cell != null){
&& cell.getStringCellValue() != null if (cell.getCellTypeEnum() != CellType.NUMERIC && cell.getStringCellValue() != null && !cell.getStringCellValue().isEmpty()){
&& !cell.getStringCellValue().isEmpty()){
return false; return false;
}else if (cell.getCellTypeEnum() == CellType.NUMERIC && cell.getNumericCellValue() != 0){
return false;
}
} }
} }
return true; return true;

View File

@ -1,4 +1,4 @@
package excel; package com.lxyer.excel;
import org.junit.Test; import org.junit.Test;
import org.redkale.net.http.HttpResponse; import org.redkale.net.http.HttpResponse;

View File

@ -1,4 +1,4 @@
package excel; package com.lxyer.excel;
import java.util.Date; import java.util.Date;