Commit 7c0a00a570d7161d7da2eed9ebfe0f0a1106585c

Authored by gaoming
1 parent d029ffde
Exists in master

优化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.102'
  62 + version '1.1.103'
63 63 artifactId ARTIFACT_Id
64 64 groupId GROUP_ID
65 65 packaging TYPE
... ...
src/main/java/com/taover/util/UtilExcel.java
... ... @@ -449,14 +449,12 @@ public class UtilExcel {
449 449 */
450 450 System.out.println(cell.getCellStyle().getDataFormat());
451 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 454 // 如果是date类型则 ,获取该cell的date值
457 455 //return new SimpleDateFormat("yyyy-MM-dd").format(DateUtil.getJavaDate(cell.getNumericCellValue()));
458 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 459 sdf = new SimpleDateFormat("yyyy-MM-dd");
462 460 }else if (format == 20 || format == 32) {
... ... @@ -515,7 +513,7 @@ public class UtilExcel {
515 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 517 List<List<Object>> data = null;
520 518  
521 519 try {
... ...