(1)app domain导入提交
(2)asn no字段扩展为long类型,数据库对应字段扩展为bigint
This commit is contained in:
@@ -17,11 +17,14 @@ import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hadoop.hbase.protobuf.generated.CellProtos.CellType;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDataFormatter;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.DateUtil;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
@@ -219,6 +222,35 @@ public class ImportExcel {
|
||||
}
|
||||
return val;
|
||||
}
|
||||
/**
|
||||
* 获取单元格值
|
||||
* @param row 获取的行
|
||||
* @param column 获取单元格列号
|
||||
* @return 单元格值
|
||||
*/
|
||||
public Object getStringCellValue(Row row, int column){
|
||||
Object val = "";
|
||||
try{
|
||||
Cell cell = row.getCell(column);
|
||||
if (cell != null){
|
||||
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC){
|
||||
HSSFDataFormatter dataFormatter = new HSSFDataFormatter();
|
||||
val = dataFormatter.formatCellValue(cell);
|
||||
}else if (cell.getCellType() == Cell.CELL_TYPE_STRING){
|
||||
val = cell.getStringCellValue();
|
||||
}else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA){
|
||||
val = cell.getCellFormula();
|
||||
}else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN){
|
||||
val = cell.getBooleanCellValue();
|
||||
}else if (cell.getCellType() == Cell.CELL_TYPE_ERROR){
|
||||
val = cell.getErrorCellValue();
|
||||
}
|
||||
}
|
||||
}catch (Exception e) {
|
||||
return val;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
/**
|
||||
* //递归获取cls实体对象及父级对象的属性
|
||||
* wx:修改,子类覆盖父类的同名方法
|
||||
@@ -786,7 +818,8 @@ public class ImportExcel {
|
||||
Row row = this.getRow(i);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Object[] os : annotationList){
|
||||
Object val = this.getCellValue(row, column++);
|
||||
// Object val = this.getCellValue(row, column++);
|
||||
Object val = this.getStringCellValue(row, column++);
|
||||
if (val != null){
|
||||
ExcelField ef = (ExcelField)os[0];
|
||||
// If is dict type, get dict value
|
||||
|
||||
Reference in New Issue
Block a user