This commit is contained in:
parent
70bfd94b64
commit
d4767d5937
1 changed files with 8 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ import ru.spcex.clearing.dbf.importer.logic.data.enums.ETable;
|
|||
import ru.spcex.clearing.dbf.importer.logic.data.enums.StageResult;
|
||||
import ru.spcex.clearing.dbf.importer.logic.data.tables.AbstractTable;
|
||||
import ru.spcex.platform.imdg.iml.hazelcast.service.HazelcastService;
|
||||
import ru.spcex.platform.utils.log.ExceptionUtils;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
|
@ -51,12 +52,19 @@ public class ImportToDB extends Stage {
|
|||
table.setFileId(fileId);
|
||||
for (int i = 0; i < dbfReader.getRecordCount(); i++) {
|
||||
Object[] entity = dbfReader.nextRecord();
|
||||
if (entity == null) {
|
||||
log.warn("record index {} null", i);
|
||||
continue;
|
||||
}
|
||||
table.injectEntity(table.getEntity(entity));
|
||||
}
|
||||
kafkaMessenger.notifySystemIfNeeded(currTable, fileId);
|
||||
} catch (IOException exception) {
|
||||
log.warn(exception.getMessage());
|
||||
return StageResult.ERROR;
|
||||
} catch (Throwable e) {
|
||||
log.error(ExceptionUtils.getStackTrace(e));
|
||||
return StageResult.ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue