|
|
@@ -56,6 +56,27 @@ public class ReadExcelUtils {
|
|
|
Sheet sheet = workbook.getSheetAt(0);
|
|
|
//读取总行数
|
|
|
int rows = sheet.getPhysicalNumberOfRows();
|
|
|
+ for(int i=0;i<rows-1;i++){
|
|
|
+ Row row =sheet.getRow(i);
|
|
|
+ Boolean ifAllNull=true;
|
|
|
+ if(row==null){
|
|
|
+ System.out.println(rows);
|
|
|
+ rows=i;
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ for (int t=0;t<row.getLastCellNum();t++){
|
|
|
+ Cell cell = row.getCell(t);
|
|
|
+ if(cell!=null&& cell.getCellType() != CellType.BLANK){
|
|
|
+ ifAllNull=false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ifAllNull){
|
|
|
+ rows=i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (rows <= 1) {
|
|
|
//删除临时文件tempFile
|
|
|
fis.close();
|
|
|
@@ -270,19 +291,24 @@ public class ReadExcelUtils {
|
|
|
if (ANOCellId != null) {
|
|
|
if (row.getCell(ANOCellId) != null) {
|
|
|
String appNo = row.getCell(ANOCellId).toString();
|
|
|
- appNos.add(appNo);
|
|
|
+ if(appNo!=null&&!appNo.trim().equals("")){
|
|
|
+ appNos.add(appNo);}
|
|
|
}
|
|
|
}
|
|
|
if (PNOCellId != null) {
|
|
|
if (row.getCell(PNOCellId) != null) {
|
|
|
String publicNo = row.getCell(PNOCellId).toString();
|
|
|
- publicNos.add(publicNo);
|
|
|
+ if(publicNo!=null&&!publicNo.trim().equals("")){
|
|
|
+ publicNos.add(publicNo);}
|
|
|
}
|
|
|
}
|
|
|
if (PANOCellId != null) {
|
|
|
if (row.getCell(PANOCellId) != null) {
|
|
|
- String patentNo = row.getCell(PANOCellId).toString();
|
|
|
- patentNos.add(patentNo);
|
|
|
+
|
|
|
+ String patentNo = row.getCell(PANOCellId).toString();
|
|
|
+ if(patentNo!=null&&!patentNo.trim().equals("")) {
|
|
|
+ patentNos.add(patentNo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|