dbf-exporter Sdf08 fix
This commit is contained in:
parent
19702fb5e0
commit
5aa360cb13
1 changed files with 8 additions and 4 deletions
|
|
@ -13,17 +13,21 @@ public class S_DF08_Converter extends DFConverter<SDf08> {
|
|||
@Override
|
||||
public Object[] toObjectArray(SDf08 entity) {
|
||||
List<Object> values = new LinkedList<>();
|
||||
values.add(typeMatch(entity.getNumber()));
|
||||
values.add(typeMatch(entity.getDatetime()));
|
||||
values.add(convertStrToLong(entity.getNumber()));
|
||||
values.add(convertStrToLong(entity.getDatetime()));
|
||||
return values.toArray(Object[]::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DBFField[] getDBFHeaders() {
|
||||
List<DBFField> dbfFields = new LinkedList<>();
|
||||
dbfFields.add(new DBFField("NUMBER", DBFDataType.NUMERIC, 32, 18));
|
||||
dbfFields.add(new DBFField("DATETIME", DBFDataType.DATE));
|
||||
dbfFields.add(new DBFField("NUMBER", DBFDataType.NUMERIC, 10));
|
||||
dbfFields.add(new DBFField("DATETIME", DBFDataType.NUMERIC, 13));
|
||||
return dbfFields.toArray(DBFField[]::new);
|
||||
}
|
||||
|
||||
private Long convertStrToLong(String s) {
|
||||
if (s == null) return null;
|
||||
return Long.valueOf(s);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue