|
@@ -182,17 +182,25 @@ public class TTargetreviewController extends BaseController
|
|
|
List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
|
|
|
//部门查询
|
|
|
List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
|
|
|
- int rowNum = sheet.getPhysicalNumberOfRows();
|
|
|
+ int rowNum = sheet.getLastRowNum();
|
|
|
int failNumber = 0;
|
|
|
- for (int i = 1; i < rowNum; i++) {
|
|
|
+ for (int i = 1; i <= rowNum; i++) {
|
|
|
try {
|
|
|
logger.info("读取行数:" + i);
|
|
|
Row row = sheet.getRow(i);
|
|
|
- int cellNum = row.getPhysicalNumberOfCells();
|
|
|
+ // int cellNum = row.getPhysicalNumberOfCells();
|
|
|
+ if(row==null){
|
|
|
+ sheet.removeRow(row);
|
|
|
+ rowNum++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ int cellNum = row.getLastCellNum();
|
|
|
TTargetreview entity = new TTargetreview();
|
|
|
for (int j = 0; j < cellNum; j++) {
|
|
|
Cell cell = row.getCell(j);
|
|
|
- cell.setCellType(CellType.STRING);
|
|
|
+ if (cell == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
String cellValue = ExcelUtils.getCellValue(cell);
|
|
|
logger.info("cellValue:" + cellValue);
|
|
|
if (j == 0) {
|