From 77446728ea27d764dbb78c3f685ccd1f685eb8db Mon Sep 17 00:00:00 2001 From: wangxin Date: Thu, 25 Oct 2018 16:58:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/excel/ImportExcel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/nis/util/excel/ImportExcel.java b/src/main/java/com/nis/util/excel/ImportExcel.java index e9698f0b8..a1318e1bb 100644 --- a/src/main/java/com/nis/util/excel/ImportExcel.java +++ b/src/main/java/com/nis/util/excel/ImportExcel.java @@ -346,7 +346,7 @@ public class ImportExcel { //log.debug("Import column count:"+annotationList.size()); // Get excel data List dataList = Lists.newArrayList(); - Row header = this.getRow(headerNum); + /*Row header = this.getRow(headerNum); List annotationListCopy=Lists.newArrayList(); for(int i=header.getFirstCellNum();i<=header.getLastCellNum();i++) { Object value=this.getCellValue(header, i); @@ -398,21 +398,21 @@ public class ImportExcel { if(!has) { throw new ServiceException(props.getProperty("template_error")); } - } + }*/ // Field sorting - Collections.sort(annotationListCopy, new Comparator() { + Collections.sort(annotationList, new Comparator() { public int compare(Object[] o1, Object[] o2) { return new Integer(((ExcelField)o1[0]).sort()).compareTo( new Integer(((ExcelField)o2[0]).sort())); }; }); - annotationList.clear(); + //annotationList.clear(); for (int i = this.getDataRowNum(); i < this.getLastDataRowNum(); i++) { E e = (E)cls.newInstance(); int column = 0; Row row = this.getRow(i); StringBuilder sb = new StringBuilder(); - for (Object[] os : annotationListCopy){ + for (Object[] os : annotationList){ Object val = this.getCellValue(row, column++); if (val != null){ ExcelField ef = (ExcelField)os[0];