注释掉模板类型校验

This commit is contained in:
wangxin
2018-10-25 16:58:52 +08:00
parent 92e3ea93dc
commit 77446728ea

View File

@@ -346,7 +346,7 @@ public class ImportExcel {
//log.debug("Import column count:"+annotationList.size());
// Get excel data
List<E> dataList = Lists.newArrayList();
Row header = this.getRow(headerNum);
/*Row header = this.getRow(headerNum);
List<Object[]> 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<Object[]>() {
Collections.sort(annotationList, new Comparator<Object[]>() {
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];