Commit 83de5382 authored by renjie's avatar renjie

批量添加bug

parent 72bac31d
......@@ -77,17 +77,21 @@ public class FileUtil {
inputStream.close();
//工作表对象
Sheet sheet = workbook.getSheetAt(0);
//总行数
int rowLength = sheet.getLastRowNum() -1;
log.error(rowLength + "");
log.error(sheet.getLastRowNum() + "");
//工作表的列
Row row = sheet.getRow(0);
//总列数
int colLength = row.getLastCellNum();
log.error(colLength + "!");
//得到指定的单元格
Cell cell = row.getCell(0);;
int size = 1;
for (int i = 2; i < rowLength; i++) {
for (int i = 1; i < rowLength + 2; i++) {
row = sheet.getRow(i);
List<Object> rowvalue = new ArrayList<>();
size = 0;
......@@ -96,6 +100,7 @@ public class FileUtil {
// System.out.println(cell);
if (cell!=null) {
Object cellValue = getCellFormatValue(cell);
log.error(cellValue.toString());
rowvalue.add(cellValue);
if (StringUtils.isNotBlank(cellValue.toString())) {
size++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment