|
|
|
@ -503,17 +503,24 @@ public class CollectModel {
|
|
|
|
|
}
|
|
|
|
|
writeRecord.set(colName, value);
|
|
|
|
|
} else {
|
|
|
|
|
if (colType.equals("Integer"))
|
|
|
|
|
writeRecord.set(colName, (int) Double.parseDouble(PoiUtil.getValue(cell).toString()));
|
|
|
|
|
else if (colType.equals("String"))
|
|
|
|
|
writeRecord.set(colName, PoiUtil.getValue(cell).toString());
|
|
|
|
|
else if (colType.equals("Double"))
|
|
|
|
|
writeRecord.set(colName, Double.parseDouble(PoiUtil.getValue(cell).toString()));
|
|
|
|
|
else if (colType.equals("Date")) {
|
|
|
|
|
String dateString = PoiUtil.getValue(cell).toString();
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
Date date = dateFormat.parse(dateString);
|
|
|
|
|
writeRecord.set(colName, date);
|
|
|
|
|
if (colType.equals("Integer")) {
|
|
|
|
|
if (StrKit.isBlank(PoiUtil.getValue(cell))) writeRecord.set(colName, null);
|
|
|
|
|
else
|
|
|
|
|
writeRecord.set(colName, (int) Double.parseDouble(PoiUtil.getValue(cell).toString()));
|
|
|
|
|
} else if (colType.equals("String")) {
|
|
|
|
|
if (StrKit.isBlank(PoiUtil.getValue(cell))) writeRecord.set(colName, null);
|
|
|
|
|
else writeRecord.set(colName, PoiUtil.getValue(cell).toString());
|
|
|
|
|
} else if (colType.equals("Double")) {
|
|
|
|
|
if (StrKit.isBlank(PoiUtil.getValue(cell))) writeRecord.set(colName, null);
|
|
|
|
|
else writeRecord.set(colName, Double.parseDouble(PoiUtil.getValue(cell).toString()));
|
|
|
|
|
} else if (colType.equals("Date")) {
|
|
|
|
|
if (StrKit.isBlank(PoiUtil.getValue(cell))) writeRecord.set(colName, null);
|
|
|
|
|
else {
|
|
|
|
|
String dateString = PoiUtil.getValue(cell).toString();
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
Date date = dateFormat.parse(dateString);
|
|
|
|
|
writeRecord.set(colName, date);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|