Commit 14ff970982c56fcc836912c50d02fe9ce9530c84

Authored by wangbin
1 parent 274440d1
Exists in master

1.Excel读取允许最大行变更,不抛出异常

@@ -59,7 +59,7 @@ uploadArchives { @@ -59,7 +59,7 @@ uploadArchives {
59 authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD) 59 authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
60 } 60 }
61 pom.project { 61 pom.project {
62 - version '1.1.76' 62 + version '1.1.77'
63 artifactId ARTIFACT_Id 63 artifactId ARTIFACT_Id
64 groupId GROUP_ID 64 groupId GROUP_ID
65 packaging TYPE 65 packaging TYPE
src/main/java/com/taover/util/UtilExcel.java
@@ -382,10 +382,6 @@ public class UtilExcel { @@ -382,10 +382,6 @@ public class UtilExcel {
382 } 382 }
383 Workbook wb = UtilExcel.getWorkbook(filepath, true); 383 Workbook wb = UtilExcel.getWorkbook(filepath, true);
384 Sheet sheet = wb.getSheetAt(sheetIndex); 384 Sheet sheet = wb.getSheetAt(sheetIndex);
385 - int end = sheet.getLastRowNum();  
386 - if(end > UtilExcel.maxExcelRowNum){  
387 - throw new Exception("目前系统只支持读取10000行以内记录,您当前Excel行数过大");  
388 - }  
389 return readExcelBySheet(sheet, UtilExcel.maxExcelRowNum, false); 385 return readExcelBySheet(sheet, UtilExcel.maxExcelRowNum, false);
390 } 386 }
391 387
@@ -398,7 +394,7 @@ public class UtilExcel { @@ -398,7 +394,7 @@ public class UtilExcel {
398 int end = sheet.getLastRowNum(); 394 int end = sheet.getLastRowNum();
399 if(hasRowLimit){ 395 if(hasRowLimit){
400 if(end > UtilExcel.maxExcelRowNum) { 396 if(end > UtilExcel.maxExcelRowNum) {
401 - throw new Exception("目前系统只支持读取10000行以内记录,您当前Excel行数过大"); 397 + throw new Exception("目前系统只支持读取"+UtilExcel.maxExcelRowNum+"行以内记录,您当前Excel行数过大");
402 } 398 }
403 return readExcelBySheet(sheet, UtilExcel.maxExcelRowNum, false); 399 return readExcelBySheet(sheet, UtilExcel.maxExcelRowNum, false);
404 }else { 400 }else {
@@ -492,10 +488,6 @@ public class UtilExcel { @@ -492,10 +488,6 @@ public class UtilExcel {
492 } 488 }
493 Workbook wb = UtilExcel.getWorkbook(filepath, true); 489 Workbook wb = UtilExcel.getWorkbook(filepath, true);
494 Sheet sheet = wb.getSheetAt(sheetIndex); 490 Sheet sheet = wb.getSheetAt(sheetIndex);
495 - int end = sheet.getLastRowNum();  
496 - if(end > UtilExcel.maxExcelRowNum){  
497 - throw new Exception("目前系统只支持读取10000行以内记录,您当前Excel行数过大");  
498 - }  
499 return readExcelBySheet(sheet, UtilExcel.maxExcelRowNum, true); 491 return readExcelBySheet(sheet, UtilExcel.maxExcelRowNum, true);
500 } 492 }
501 493