Class DeviceImportService
java.lang.Object
org.bgerp.plugin.inventoru.sync1c.service.DeviceImportService
Bulk import of individually identified units from a CSV — the counterpart of the stock import,
which only carries nomenclature and quantities and therefore drops serial numbers entirely.
The serial number is the business key: a row whose serial is already known updates that device,
an unknown one creates it. That makes re-importing the same file a no-op rather than a way to
duplicate the warehouse.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOne parsed line together with everything resolution found or could not find. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]apply(List<DeviceImportService.Row> rows, int userId) Writes the rows that carry no error.Parses and resolves the file without writing anything — the caller shows the result for review beforeapply(List, int).
-
Constructor Details
-
DeviceImportService
-
-
Method Details
-
preview
public List<DeviceImportService.Row> preview(byte[] data, Character delimiter, Charset charset) throws IOException, SQLException Parses and resolves the file without writing anything — the caller shows the result for review beforeapply(List, int).- Throws:
IOExceptionSQLException
-
apply
Writes the rows that carry no error. The manufacturer and the model are created when missing: a catalogue is exactly what an import is expected to fill, and requiring the admin to pre-create hundreds of models by hand would defeat the purpose.- Returns:
- number of devices created and updated
- Throws:
SQLException
-