Class Api1cClient
java.lang.Object
org.bgerp.plugin.inventory.sync1c.service.Api1cClient
HTTP client for 1C ERP REST API.
One instance per 1C instance (holds auth credentials).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSingle item in the write-off request. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalls POST /hs/gtd_numbers/stocks and returns the list of stock records.sendWriteoff(int processId, String warehouseId, List<Api1cClient.WriteoffItem> items) Calls POST /hs/gtd_numbers/writeoff and sends write-off items to 1C.Tests the connection by calling getStocks with empty params and checking for HTTP response.
-
Constructor Details
-
Api1cClient
-
-
Method Details
-
getStocks
Calls POST /hs/gtd_numbers/stocks and returns the list of stock records.- Parameters:
warehouseName- 1C warehouse name (engineer full name or warehouse title)locationName- 1C location (construction site / object)- Returns:
- list of stock items; empty list on error
-
testConnection
Tests the connection by calling getStocks with empty params and checking for HTTP response. -
sendWriteoff
Calls POST /hs/gtd_numbers/writeoff and sends write-off items to 1C.- Parameters:
processId- BGERP process ID (used as external reference in 1C)warehouseId- 1C UUID of the warehouseitems- list of items to write off- Returns:
- null on success, error message on failure
-