Package com.sgapi.services
Class IntegrationExport
- java.lang.Object
-
- com.sgapi.services.IntegrationExport
-
public class IntegrationExport extends java.lang.Object
With a path of /integrate/export this module handles the exporting of data from the SG V5 System. Parameters can be used to pull all the data or just updated data in some cases. Once data is exported, it is marked as such and excluded from the next get request.- Author:
- SG Systems
- Target Uri:
- /integrate/export
-
-
Constructor Summary
Constructors Constructor Description IntegrationExport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
createContainer()
Provides a new container SeeContainer
javax.ws.rs.core.Response
getAddress(java.lang.String clientCode)
Provides Addresses stored in the system against a particular clientjavax.ws.rs.core.Response
getAddresses()
Provides Addresses stored in the system with relevant clientsjavax.ws.rs.core.Response
getAdjustmentLogs()
Provides adjustment transactions SeeSystemLog
javax.ws.rs.core.Response
getBatch(int batchNumber)
Provides a batch record SeeBatch
javax.ws.rs.core.Response
getBatchConsumption()
Provides a list of batch consumption events.javax.ws.rs.core.Response
getBatchConsumption(int id)
Provides batch consumption event by ID SeeBatchConsumption
javax.ws.rs.core.Response
getBatches()
Provides a list of any batches which haven't been previously exported.javax.ws.rs.core.Response
getClient(java.lang.String code)
Provides a Client record SeeClient
javax.ws.rs.core.Response
getClients()
Provides a list of clients.javax.ws.rs.core.Response
getCommodities(boolean all)
Provides a list of commodities/ingredients stored in the system.javax.ws.rs.core.Response
getCommodity(java.lang.String code)
Provides a specific commodity.javax.ws.rs.core.Response
getCommodityGroupLink(java.lang.Integer commodityGroupId)
Provides Commodity Group Links SeeCommodityGroupLink
javax.ws.rs.core.Response
getCommodityUsedIn(java.lang.String commodityCode)
Provides a list ofFormulaStep
s that a commodity is used injavax.ws.rs.core.Response
getContainerLinks()
Provides a list of containers and their contents.javax.ws.rs.core.Response
getCustomFields(java.lang.String name, java.lang.String parameter)
Provides a list of custom fields with matching name and parameterjavax.ws.rs.core.Response
getFormula(java.lang.String code)
Returns a formula matched by its code SeeFormula
javax.ws.rs.core.Response
getFormulas()
Provides a list of formulas contained within the system.javax.ws.rs.core.Response
getFormulaStep(java.lang.String code, int sequence)
Provides a formula step based on a sequence and formula code SeeFormulaStep
javax.ws.rs.core.Response
getFormulaSteps(boolean all)
Provides a list of formula steps in the system.javax.ws.rs.core.Response
getJob(java.lang.String jobNumber)
Provides a job entry SeeJob
javax.ws.rs.core.Response
getJobLogs()
Returns a list of System Logs which are related to jobs.javax.ws.rs.core.Response
getJobs()
Provides a list of active jobs in the system.javax.ws.rs.core.Response
getJobsCompleted()
Provides a list of completed jobs in the system.javax.ws.rs.core.Response
getProductionLocations()
Provides production type locationsjavax.ws.rs.core.Response
getPurchaseOrder(java.lang.String orderNumber)
Provides a purchase order record SeePurchaseOrder
javax.ws.rs.core.Response
getPurchaseOrderLines()
Provides a list of unexported purchase orer lines with their respective orders and related lines.javax.ws.rs.core.Response
getPurchaseOrderLogs()
Provides a list of purchase order logs pertaining to events arising during purchase order receipt.javax.ws.rs.core.Response
getPurchaseOrders()
Provides a list of Purchase Order headers which haven't been exported previously or have changed.javax.ws.rs.core.Response
getPurchaseOrderTransactions()
Provides a list of purchase order logs pertaining to events arising during purchase order receipt.javax.ws.rs.core.Response
getSalesLogs()
Provides sales event log information.javax.ws.rs.core.Response
getSalesLogs(boolean partials)
Provides sales event log information.javax.ws.rs.core.Response
getSalesLogs(int id)
Provides sales event log by ID SeeSalesLog
javax.ws.rs.core.Response
getSalesLogsOrderShipped()
Provides sales event log information.javax.ws.rs.core.Response
getSalesLogsPicked()
Provides sales event log information.javax.ws.rs.core.Response
getSalesOrder(java.lang.String orderNumber)
Provides a sales order record SeeSalesOrder
javax.ws.rs.core.Response
getSalesOrders()
Provides a list of Sales Order headers which haven't been exported previously or have changed.javax.ws.rs.core.Response
getSites()
Provides a list of sitesjavax.ws.rs.core.Response
getStock(boolean all)
Provides a list of inventory in the system.javax.ws.rs.core.Response
getStock(java.lang.String commodityCode, java.lang.String lotNumber)
Provides a stock item in the system SeeStockLocation
javax.ws.rs.core.Response
getStockAssignments(java.lang.String jobNo)
Returns the StockAssignments based on a job number SeeStockAssignment
javax.ws.rs.core.Response
getStockLocations()
Provides stock type locationsjavax.ws.rs.core.Response
getSystemLog(int id)
Provides system log event by ID SeeSystemLog
javax.ws.rs.core.Response
getSystemLogs()
Retrieves System Logs depending on configuration.javax.ws.rs.core.Response
getSystemLogsCP()
Provides transactions marked as either CONSUMED or PRODUCED by the SystemLog Descriptor SeeSystemLog
javax.ws.rs.core.Response
getSystemLogsNonCP()
Provides transactions marked as anything but CONSUMED or PRODUCED by the SystemLog Descriptor SeeSystemLog
javax.ws.rs.core.Response
getTransfers()
Provides a list of Transfer headers which haven't been exported previously or have changed.javax.ws.rs.core.Response
getTransfers(java.lang.String referenceNumber)
Provides a transfer record SeeTransfer
javax.ws.rs.core.Response
getUsageLogs()
Provides a list of system logs which only pertain to batches.javax.ws.rs.core.Response
getUsageLogs(java.lang.Long filterDate)
Provides a list of system logs which only pertain to batches.java.util.List<SystemLog>
getUsageLogs(java.lang.String jobNumber)
javax.ws.rs.core.Response
getUsers()
Returns a list of users registered in the system.javax.ws.rs.core.Response
setExportMarkers(java.util.List<ExportMarker> exportMarkers)
Marks a record exported by providing the name of the table and the ID.java.util.List<Client>
user()
Returns the user who booted the API wrapped in a small client object.javax.ws.rs.core.Response
user(java.lang.String username, java.lang.String pin)
Returns the user represented by the username SeeUser
-
-
-
Method Detail
-
getCommodities
public javax.ws.rs.core.Response getCommodities(boolean all)
Provides a list of commodities/ingredients stored in the system. SeeCommodity
- Parameters:
all
- boolean value to specify whether to pull all commodities (true) or just new ones (false)- Returns:
- A list of commodities from the system
Commodity
- Target Uri:
- /commodities/{all}
- Request Type:
- GET
-
getCommodity
public javax.ws.rs.core.Response getCommodity(java.lang.String code)
Provides a specific commodity. SeeCommodity
- Parameters:
code
- The unique commodity code associated with this item- Returns:
- The commodity if found
Commodity
- Target Uri:
- /commodity/{code}
- Request Type:
- GET
-
getContainerLinks
public javax.ws.rs.core.Response getContainerLinks()
Provides a list of containers and their contents. This could be a list of pallets with inventory on them, forming a stock master list or a list of tubs/buckets containing stock lots. SeeContainerLink
- Returns:
- A list of all container links
ContainerLink
- Target Uri:
- /container_links
- Request Type:
- GET
-
user
public java.util.List<Client> user()
Returns the user who booted the API wrapped in a small client object. SeeUser
- Returns:
- A list of users
User
- Target Uri:
- /systemuser
- Request Type:
- GET
-
user
public javax.ws.rs.core.Response user(java.lang.String username, java.lang.String pin)
Returns the user represented by the username SeeUser
- Parameters:
username
- The unique username associated with this operatorpin
- The unique pin associated with this operator- Returns:
- The requested user object
User
- Target Uri:
- /user/{username}/{pin}
- Request Type:
- GET
-
getUsers
public javax.ws.rs.core.Response getUsers()
Returns a list of users registered in the system.- Returns:
- List of users registered in the system
User
-
getFormulaSteps
public javax.ws.rs.core.Response getFormulaSteps(boolean all)
Provides a list of formula steps in the system. SeeFormulaStep
- Parameters:
all
- boolean value specifies whether to pull all formula steps or only updated ones- Returns:
- a list of formula steps in the system
FormulaStep
- Target Uri:
- /formula_steps/{all}
- Request Type:
- GET
-
getFormulaStep
public javax.ws.rs.core.Response getFormulaStep(java.lang.String code, int sequence)
Provides a formula step based on a sequence and formula code SeeFormulaStep
- Parameters:
code
- The unique formula code that the step belongs tosequence
- The sequence number for the formula step- Returns:
- the formula step matching the parameters
FormulaStep
- Target Uri:
- /formula_step/{code}/{sequence}
- Request Type:
- GET
-
getFormulas
public javax.ws.rs.core.Response getFormulas()
Provides a list of formulas contained within the system. This will only export the formula header data. SeeFormula
- Returns:
- A list of formulas
Formula
- Target Uri:
- /formulas
- Request Type:
- GET
-
getFormula
public javax.ws.rs.core.Response getFormula(java.lang.String code)
Returns a formula matched by its code SeeFormula
- Parameters:
code
- The unique formula code- Returns:
- The formula matching the code parameter
Formula
- Target Uri:
- /formula/{code}
- Request Type:
- GET
-
getSalesLogs
public javax.ws.rs.core.Response getSalesLogs()
Provides sales event log information. Sales logs are created when sales order activity is performed. This will fetch any new sales events such as stock picking. SeeSalesLog
- Returns:
- A list of sales logs
SalesLog
- Target Uri:
- /sales_logs
- Request Type:
- GET
-
getSalesLogs
public javax.ws.rs.core.Response getSalesLogs(boolean partials)
Provides sales event log information. Sales logs are created when sales order activity is performed. This will fetch any new sales events such as stock picking. This method allows for the specification of whether partially shipped items should be included in the response SeeSalesLog
- Parameters:
partials
- Boolean to indicate whether to also receive partially shipped transactions- Returns:
- A list of sales logs
SalesLog
- Target Uri:
- /sales_logs
- Request Type:
- GET
-
getSalesLogs
public javax.ws.rs.core.Response getSalesLogs(int id)
Provides sales event log by ID SeeSalesLog
- Parameters:
id
- The sales log ID- Returns:
- The sales log at the provided ID
SalesLog
- Target Uri:
- /sales_log/{id}
- Request Type:
- GET
-
getSalesLogsPicked
public javax.ws.rs.core.Response getSalesLogsPicked()
Provides sales event log information. Sales logs are created when sales order activity is performed. This will fetch any new sales events such as stock picking. This methods exports logs as soon as they have been picked (does not wait until they have shipped) SeeSalesLog
- Returns:
- A list of sales logs
SalesLog
- Target Uri:
- /sales_logs_picked
- Request Type:
- GET
-
getSalesLogsOrderShipped
public javax.ws.rs.core.Response getSalesLogsOrderShipped()
Provides sales event log information. Sales logs are created when sales order activity is performed. This will fetch 'Order Shipped' records specifically SeeSalesLog
- Returns:
- A list of sales logs
SalesLog
- Target Uri:
- /sales_logs_order_shipped
- Request Type:
- GET
-
getStock
public javax.ws.rs.core.Response getStock(boolean all)
Provides a list of inventory in the system. The data provided is at the lot level. SeeStockLocation
- Parameters:
all
- boolean value indicates whether all stock should be pulled or just updated/new stock.- Returns:
- A list of inventory in the system
StockLocation
- Target Uri:
- /stock/{all}
- Request Type:
- GET
-
getStock
public javax.ws.rs.core.Response getStock(java.lang.String commodityCode, java.lang.String lotNumber)
Provides a stock item in the system SeeStockLocation
- Parameters:
commodityCode
- The commodity to which the stock referslotNumber
- The lotNumber of the stock item- Returns:
- The stock details for items matching this lot and commodity code
StockLocation
- Target Uri:
- /stock/{commodityCode}/{lotNumber}
- Request Type:
- GET
-
getJobLogs
public javax.ws.rs.core.Response getJobLogs()
Returns a list of System Logs which are related to jobs. Events which have occurred during batch production will be produced here. For example, the addition of an ingredient. SeeSystemLog
- Returns:
- A list of SystemLogs
SystemLog
- Target Uri:
- /job_logs
- Request Type:
- GET
-
getJobs
public javax.ws.rs.core.Response getJobs()
Provides a list of active jobs in the system. Active jobs are defined as jobs which are not deleted or complete. SeeJob
- Returns:
- A list of active jobs
Job
- Target Uri:
- /jobs
- Request Type:
- GET
-
getJob
public javax.ws.rs.core.Response getJob(java.lang.String jobNumber)
Provides a job entry SeeJob
- Parameters:
jobNumber
- The unique job number to lookup- Returns:
- The job in question
Job
- Target Uri:
- /job/{jobNumber}
- Request Type:
- GET
-
getSystemLogs
public javax.ws.rs.core.Response getSystemLogs()
Retrieves System Logs depending on configuration. Purchase, Production and Batch logs can be excluded. SeeSystemLog
- Returns:
- An updated list of System Logs
SystemLog
- Target Uri:
- /system_logs
- Request Type:
- GET
-
getSystemLog
public javax.ws.rs.core.Response getSystemLog(int id)
Provides system log event by ID SeeSystemLog
- Parameters:
id
- The system log ID- Returns:
- The system log at the provided ID
SystemLog
- Target Uri:
- /system_log/{id}
- Request Type:
- GET
-
getBatchConsumption
public javax.ws.rs.core.Response getBatchConsumption()
Provides a list of batch consumption events. Batch consumption occurs when any stock item is weighed into a batch. SeeBatchConsumption
- Returns:
- A updated list of Batch Consumption logs
BatchConsumption
- Target Uri:
- /batch_consumption
- Request Type:
- GET
-
getBatchConsumption
public javax.ws.rs.core.Response getBatchConsumption(int id)
Provides batch consumption event by ID SeeBatchConsumption
- Parameters:
id
- The system log ID- Returns:
- The batch consumption log at the provided ID
BatchConsumption
- Target Uri:
- /batch_consumption/{id}
- Request Type:
- GET
-
getUsageLogs
public javax.ws.rs.core.Response getUsageLogs()
Provides a list of system logs which only pertain to batches. SeeSystemLog
- Returns:
- An updated list of SystemLogs pertaining to batches
SystemLog
- Target Uri:
- /batch_system_logs
- Request Type:
- GET
-
getUsageLogs
public javax.ws.rs.core.Response getUsageLogs(java.lang.Long filterDate)
Provides a list of system logs which only pertain to batches. SeeSystemLog
- Parameters:
filterDate
- A long value representing the epoch date- Returns:
- An updated list of SystemLogs pertaining to batches
SystemLog
- Target Uri:
- /batch_system_logs/filterFrom/{date}
- Request Type:
- GET
-
getBatches
public javax.ws.rs.core.Response getBatches()
Provides a list of any batches which haven't been previously exported. SeeBatch
- Returns:
- A list of new batches
Batch
- Target Uri:
- /batches
- Request Type:
- GET
-
getBatch
public javax.ws.rs.core.Response getBatch(int batchNumber)
Provides a batch record SeeBatch
- Parameters:
batchNumber
- The batch ID- Returns:
- The batch recorded with the provided batch number
Batch
- Target Uri:
- /batch/{batchNumber}
- Request Type:
- GET
-
getPurchaseOrderLogs
public javax.ws.rs.core.Response getPurchaseOrderLogs()
Provides a list of purchase order logs pertaining to events arising during purchase order receipt. SeeSystemLog
- Returns:
- A list of unexported purchase order logs
SystemLog
- Target Uri:
- /po_logs
- Request Type:
- GET
-
getPurchaseOrderTransactions
public javax.ws.rs.core.Response getPurchaseOrderTransactions()
Provides a list of purchase order logs pertaining to events arising during purchase order receipt. Difference to above is that this will retrieve logs for PO that have NOT been completed yet SeeSystemLog
- Returns:
- A list of unexported purchase order logs
SystemLog
- Target Uri:
- /po_transactions
- Request Type:
- GET
-
getPurchaseOrders
public javax.ws.rs.core.Response getPurchaseOrders()
Provides a list of Purchase Order headers which haven't been exported previously or have changed. This will also include the purchase order lines for each updated purchase order. SeePurchaseOrder
- Returns:
- A list of purchase orders
PurchaseOrder
- Target Uri:
- /purchase_orders
- Request Type:
- GET
-
getPurchaseOrder
public javax.ws.rs.core.Response getPurchaseOrder(java.lang.String orderNumber)
Provides a purchase order record SeePurchaseOrder
- Parameters:
orderNumber
- The purchase order number- Returns:
- The purchase order object with lines and logs
PurchaseOrder
- Target Uri:
- /purchase_order/{orderNumber}
- Request Type:
- GET
-
getPurchaseOrderLines
public javax.ws.rs.core.Response getPurchaseOrderLines()
Provides a list of unexported purchase orer lines with their respective orders and related lines. Effectively This will export a PO if a line is added or removed SeePurchaseOrderLine
- Returns:
- The purchase order objects with lines and logs
PurchaseOrder
- Target Uri:
- /purchase_order_lines/
- Request Type:
- GET
-
getSalesOrders
public javax.ws.rs.core.Response getSalesOrders()
Provides a list of Sales Order headers which haven't been exported previously or have changed. This will also include the sales order lines for each updated sales order. SeeSalesOrder
- Returns:
- A list of sales orders
SalesOrder
- Target Uri:
- /sales_orders
- Request Type:
- GET
-
getSalesOrder
public javax.ws.rs.core.Response getSalesOrder(java.lang.String orderNumber)
Provides a sales order record SeeSalesOrder
- Parameters:
orderNumber
- The sales order number- Returns:
- The sales order object with lines and logs
SalesOrder
- Target Uri:
- /sales_order/{orderNumber}
- Request Type:
- GET
-
getClients
public javax.ws.rs.core.Response getClients()
Provides a list of clients. Suppliers and Customers. SeeClient
- Returns:
- A list of the clients held in the system
Client
- Target Uri:
- /clients
- Request Type:
- GET
-
getClient
public javax.ws.rs.core.Response getClient(java.lang.String code)
Provides a Client record SeeClient
- Parameters:
code
- The unique code for the client- Returns:
- The client matching the provided code should one exist
Client
- Target Uri:
- /client/{code}
- Request Type:
- GET
-
setExportMarkers
public javax.ws.rs.core.Response setExportMarkers(java.util.List<ExportMarker> exportMarkers)
Marks a record exported by providing the name of the table and the ID.
Marking a record as exported prevents it from being pulled by the next get when not fetching all records.
Bear in mind this is the table name, not the object name. The difference is usually underscoring and camel-casing respectively.- Parameters:
exportMarkers
- The list of table/ID pairs for marking as exported. SeeExportMarker
- Returns:
- The exportMarkers sent will be returned on success
ExportMarker
- Target Uri:
- /mark-exported/
- Request Type:
- POST
-
getTransfers
public javax.ws.rs.core.Response getTransfers()
Provides a list of Transfer headers which haven't been exported previously or have changed. This will also include the transfer order lines for each updated transfer order. SeeTransfer
- Returns:
- A list of transfers
Transfer
- Target Uri:
- /transfers
- Request Type:
- GET
-
getTransfers
public javax.ws.rs.core.Response getTransfers(java.lang.String referenceNumber)
Provides a transfer record SeeTransfer
- Parameters:
referenceNumber
- The transfer order reference number- Returns:
- The transfer order object with lines and logs
Transfer
- Target Uri:
- /transfer/{referenceNumber}
- Request Type:
- GET
-
getAdjustmentLogs
public javax.ws.rs.core.Response getAdjustmentLogs()
Provides adjustment transactions SeeSystemLog
- Returns:
- A list of system logs related to adjustment transactions
SystemLog
- Target Uri:
- /adjustment_logs
- Request Type:
- GET
-
getSystemLogsCP
public javax.ws.rs.core.Response getSystemLogsCP()
Provides transactions marked as either CONSUMED or PRODUCED by the SystemLog Descriptor SeeSystemLog
- Returns:
- A list of system logs related to production and consumption transactions
SystemLog
- Target Uri:
- /system_logs_cp
- Request Type:
- GET
-
getStockLocations
public javax.ws.rs.core.Response getStockLocations()
Provides stock type locations- Returns:
- All stock type locations
Location
- Target Uri:
- /locations/stock
- Request Type:
- GET
-
getProductionLocations
public javax.ws.rs.core.Response getProductionLocations()
Provides production type locations- Returns:
- All stock type locations
Location
- Target Uri:
- /locations/production
- Request Type:
- GET
-
getUsageLogs
public java.util.List<SystemLog> getUsageLogs(java.lang.String jobNumber)
- Parameters:
jobNumber
- The jobnumber to query- Returns:
- A list of
SystemLog
s pertaining to the job
-
getCommodityUsedIn
public javax.ws.rs.core.Response getCommodityUsedIn(java.lang.String commodityCode)
Provides a list ofFormulaStep
s that a commodity is used in- Parameters:
commodityCode
- Represents theCommodity
code to be searched for- Returns:
- A list of
FormulaStep
s where the commodity is used - Target Uri:
- /formulaStep/usedIn/{commodityCode}
- Request Type:
- GET
-
getAddresses
public javax.ws.rs.core.Response getAddresses()
Provides Addresses stored in the system with relevant clients- Returns:
- A list of Addresses stored in the system
Address
- Target Uri:
- /addresses
- Request Type:
- GET
-
getAddress
public javax.ws.rs.core.Response getAddress(java.lang.String clientCode)
Provides Addresses stored in the system against a particular client
-
getSystemLogsNonCP
public javax.ws.rs.core.Response getSystemLogsNonCP()
Provides transactions marked as anything but CONSUMED or PRODUCED by the SystemLog Descriptor SeeSystemLog
- Returns:
- A list of system logs related to anything but production and consumption transactions
SystemLog
- Target Uri:
- /system_logs_non_cp
- Request Type:
- GET
-
getJobsCompleted
public javax.ws.rs.core.Response getJobsCompleted()
Provides a list of completed jobs in the system. Completed jobs are defined as jobs which are in status 3 and exported is null SeeJob
- Returns:
- A list of completed jobs
Job
- Target Uri:
- /jobs
- Request Type:
- GET
-
createContainer
public javax.ws.rs.core.Response createContainer()
Provides a new container SeeContainer
- Returns:
- The a brand new container with SSCC setup
- Target Uri:
- /create_container
- Request Type:
- GET
-
getSites
public javax.ws.rs.core.Response getSites()
Provides a list of sites- Returns:
- A list of sites
Site
- Target Uri:
- /sites
- Request Type:
- GET
-
getCustomFields
public javax.ws.rs.core.Response getCustomFields(java.lang.String name, java.lang.String parameter)
Provides a list of custom fields with matching name and parameter- Parameters:
name
- The name of the custom fieldparameter
- The label parameter to use- Returns:
- A list of sites
Site
- Target Uri:
- /sites
- Request Type:
- GET
-
getStockAssignments
public javax.ws.rs.core.Response getStockAssignments(java.lang.String jobNo)
Returns the StockAssignments based on a job number SeeStockAssignment
- Parameters:
jobNo
- The jobnumber to which stock has been assigned- Returns:
- The StockAssignments relevant to the provided job
StockAssignment
- Target Uri:
- /StockAssignments/{jobNumber}
- Request Type:
- GET
-
getCommodityGroupLink
public javax.ws.rs.core.Response getCommodityGroupLink(java.lang.Integer commodityGroupId)
Provides Commodity Group Links SeeCommodityGroupLink
- Parameters:
commodityGroupId
- The Commodity Group ID- Returns:
- The Commodity Group Links with the provided Commodity Group
CommodityGroupLink
- Target Uri:
- /commodityGroupLink/{id}
- Request Type:
- GET
-
-