Commit 14ff970982c56fcc836912c50d02fe9ce9530c84

Authored by wangbin
1 parent 274440d1
Exists in master

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

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