Commit 7c0a00a570d7161d7da2eed9ebfe0f0a1106585c
1 parent
d029ffde
Exists in
master
优化excel读取时间
Showing
2 changed files
with
4 additions
and
6 deletions
Show diff stats
build.gradle
@@ -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.102' | 62 | + version '1.1.103' |
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
@@ -449,14 +449,12 @@ public class UtilExcel { | @@ -449,14 +449,12 @@ public class UtilExcel { | ||
449 | */ | 449 | */ |
450 | System.out.println(cell.getCellStyle().getDataFormat()); | 450 | System.out.println(cell.getCellStyle().getDataFormat()); |
451 | short format = cell.getCellStyle().getDataFormat(); | 451 | short format = cell.getCellStyle().getDataFormat(); |
452 | - if (cell.getCellStyle().getDataFormat()==28 || cell.getCellStyle().getDataFormat()==22||cell.getCellStyle().getDataFormat()==31 | ||
453 | - || cell.getCellStyle().getDataFormat() == 58 || cell.getCellStyle().getDataFormat()==14 | ||
454 | - || cell.getCellStyle().getDataFormat()==57 || cell.getCellStyle().getDataFormat()==32 || cell.getCellStyle().getDataFormat()==20 || cell.getCellStyle().getDataFormat()==176) { | 452 | + if (format==28 || format==22||format==31 || format == 58 || format==14 || format==57 || format==32 || format==20 || format==176 || format==177 ) { |
455 | 453 | ||
456 | // 如果是date类型则 ,获取该cell的date值 | 454 | // 如果是date类型则 ,获取该cell的date值 |
457 | //return new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getJavaDate(cell.getNumericCellValue())); | 455 | //return new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getJavaDate(cell.getNumericCellValue())); |
458 | SimpleDateFormat sdf = null; | 456 | SimpleDateFormat sdf = null; |
459 | - if(format == 14 || format == 31 || format == 57 || format == 58){ | 457 | + if(format == 14 || format == 31 || format == 57 || format == 58 || format == 177){ |
460 | //日期 | 458 | //日期 |
461 | sdf = new SimpleDateFormat("yyyy-MM-dd"); | 459 | sdf = new SimpleDateFormat("yyyy-MM-dd"); |
462 | }else if (format == 20 || format == 32) { | 460 | }else if (format == 20 || format == 32) { |
@@ -515,7 +513,7 @@ public class UtilExcel { | @@ -515,7 +513,7 @@ public class UtilExcel { | ||
515 | System.out.println(df.format(3.3300)); | 513 | System.out.println(df.format(3.3300)); |
516 | 514 | ||
517 | 515 | ||
518 | - String filepath = "C:\\Users\\EDZ\\Desktop\\ttt.xlsx"; | 516 | + String filepath = "C:\\Users\\EDZ\\Desktop\\date.xlsx"; |
519 | List<List<Object>> data = null; | 517 | List<List<Object>> data = null; |
520 | 518 | ||
521 | try { | 519 | try { |