public class ProductInformation extends ERPInterfaceAS400 implements IProductInformation
ERPInterfaceAS400.Pcml, ERPInterfaceAS400.Received
Modifier and Type | Field and Description |
---|---|
protected int |
ivBegIndex
A supplied beginning index for
ivProductsObj or
ivProductsArr . |
protected int |
ivEndIndex
A supplied ending index for
ivProductsObj or ivProductsArr . |
protected ImportBatch |
ivImportBatch
A supplied pending product import batch.
|
protected java.util.ArrayList<ImportMetaCriteria> |
ivImportMeta
A WIP collection of import metadata criteria.
|
protected char |
ivMode
The current mode being processed.
|
protected java.util.TreeMap<java.util.Date,QuantityOnOrder> |
ivOnOrder
A WIP collection of on-order data.
|
protected PendingProduct |
ivPending
A WIP pending product object.
|
protected Product |
ivProduct
A supplied product object.
|
protected java.util.ArrayList<java.lang.Object[]> |
ivProductsArr
A supplied collection of product information arrays.
|
protected java.util.ArrayList<Product> |
ivProductsObj
A supplied collection of product objects.
|
protected java.util.ArrayList<QuantityPriceBreak> |
ivQtyBreaks
A WIP collection of quantity price breaks.
|
protected boolean |
ivUpdateAvail
A supplied flag for updating product availibilities.
|
protected boolean |
ivUpdatePrice
A supplied flag for updating product prices.
|
protected java.lang.String |
ivWhseDtlDesc
A supplied and WIP warehouse description for warehouse details.
|
protected java.lang.String |
ivWhseDtlId
A supplied warehouse id for warehouse details.
|
protected java.lang.String |
ivWhseDtlQty
A WIP warehouse quantity for warehouse details.
|
protected java.util.ArrayList<WarehouseDetail> |
ivWhseDtls
A WIP collection of warehouse details.
|
protected java.util.ArrayList<WarehouseQuantity> |
ivWhseQtys
A WIP collection of warehouse quantities.
|
protected java.text.SimpleDateFormat |
ivYMDDateFormat
The date formatter for dates in the form YYYYMMDD.
|
private static long |
serialVersionUID
The class' serialization version id.
|
AS400TEXT3, ivAS400, ivConfig
ivHashCode, ivHashFlds, ivObjAttrs
ERROR_CONNECT, ERROR_NONE, ERROR_PROGRAM, WARN_DUPLICATE, WARN_NONE
Constructor and Description |
---|
ProductInformation()
Constructs a new ERP product information interface.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
callImportMeta()
Calls the import metadata criteria ERP program.
|
protected boolean |
callOnOrder()
Calls the supplier on-order ERP program.
|
protected boolean |
callPending()
Calls the pending product ERP program.
|
protected boolean |
callPriceAndAvail()
Calls the price and availability ERP program.
|
protected boolean |
callProgram()
Calls the ERP program for execution.
|
protected boolean |
callQtyBreaks()
Calls the quantity price breaks ERP program.
|
protected boolean |
callWhseDetail()
Calls the warehouse details ERP program.
|
protected boolean |
callWhseQtys()
Calls the warehouse quantities ERP program.
|
protected java.util.Date |
convertToDate(java.lang.String valueS)
Returns a java date when passed a string date formated as CYYMMDD.
|
java.util.ArrayList<ImportMetaCriteria> |
getImportMeta()
Retrieves a collection of import metadata criteria for importing from
the ERP product database.
|
boolean |
getPending(ImportBatch batch)
Retrieves products from the ERP system that conform to the import criteria
given in the import batch object.
|
java.util.ArrayList<QuantityPriceBreak> |
getQtyBreaks(Product product)
Retrieves a collection of quantity price breaks for a product.
|
java.util.ArrayList<QuantityOnOrder> |
getQtyOnOrder(Product product)
Retrieves a collection of product on-order expected receipt dates and
quantities.
|
java.util.ArrayList<WarehouseDetail> |
getWhseDetail(java.lang.String whseId,
java.lang.String whseDesc,
Product product)
Retrieves a collection of detailed product quantities for a warehouse.
|
java.lang.String |
getWhseDetailDesc()
Returns the warehouse description that was retrieved from the ERP system
when a request was made to retrieve warehouse detail quantities.
|
java.lang.String |
getWhseDetailQty()
Returns the warehouse item on hand quantity that was retrieved from the
ERP system when a request was made for warehouse detail quantities.
|
java.util.ArrayList<WarehouseQuantity> |
getWhseQtys(Product product)
Retrieves a collection of product availability quantities by warehouse.
|
protected ImportMetaCriteria |
parseImportMeta(ERPInterfaceAS400.Received rec)
Parses import metadata criteria data from the receive data queue and
returns an import metadata criteria object.
|
protected void |
parseOnOrder(ERPInterfaceAS400.Received rec)
Parses on-order data from the receive data queue and places the result
in the WIP collection.
|
protected PendingProduct |
parsePending(ERPInterfaceAS400.Received rec)
Parses pending product data from the receive data queue and returns a
pending product object.
|
protected Xref |
parsePendingXref(ERPInterfaceAS400.Received rec)
Parses pending product xref data from the receive data queue and returns
an xref object.
|
protected void |
parsePriceAndAvail(ERPInterfaceAS400.Received rec)
Parses price and availability data from the receive data queue and updates
the originally supplied list of products.
|
protected QuantityPriceBreak |
parseQtyBreaks(ERPInterfaceAS400.Received rec)
Parses quantity price break data from the receive data queue and returns
a quantity price break object.
|
protected boolean |
parseQueueEntry(java.lang.String fmtid,
byte[] qbytes)
Parses a data queue entry that was received on the inbound receiving
data queue.
|
protected WarehouseDetail |
parseWhseDetail(ERPInterfaceAS400.Received rec)
Parses warehouse detail data from the receive data queue and returns
a warehouse detail object.
|
protected WarehouseQuantity |
parseWhseQtys(ERPInterfaceAS400.Received rec)
Parses warehouse quantity data from the receive data queue and returns
a warehouse quantity object.
|
protected void |
readDataQueue()
Reads information placed on the inbound receiving data queue by the
called ERP program.
|
protected void |
sendDataQueue()
Places information on the outbound sending data queue.
|
protected void |
sendPending()
Places pending product import information on the outbound sending data
queue.
|
protected void |
sendPriceAndAvail()
Places price and availability information on the outbound sending data
queue.
|
boolean |
setPriceAndAvail(java.util.ArrayList<Product> products,
int begIndex,
int endIndex,
boolean updatePrice,
boolean updateAvail)
Sets the price and availablility for a set of products using data from
the ERP system.
|
boolean |
validate(java.util.ArrayList<java.lang.Object[]> products)
Validates the given collection of products on the ERP system.
|
protected void |
writePending()
Adds the current WIP pending product object to the pending product table.
|
equals, getContext, getEncryptAESLength, getErrorType, getMixedCase, getQueueKey, getRecordFormat, getRecordFormatFieldDecimals, getRecvQueue, getSendQueue, getStoreCompany, getStoreWarehouse, getWarningType, isEncryptAES, isYes, process, setContext, setErrorType, setQueueKey, setWarningType
cloneMapAttributes, formatValue, formatValue, getHashFields, getMapArrayList, getMapAttributes, getMapBigDecimal, getMapBoolean, getMapDate, getMapDouble, getMapInteger, getMapLong, getMapMapped, getMapObject, getMapShort, getMapString, getMapString, getMapStringBuffer, getMapStringBuilder, getMapTime, getMapTimestamp, getMapVector, hashCode, setHashFields, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMap, setMapAttributes, setMapObject, setMapTime, setMapTimestamp, toStringArray
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getContext, getErrorType, getWarningType, setContext, setErrorType, setWarningType
private static final long serialVersionUID
protected ImportBatch ivImportBatch
protected java.util.ArrayList<ImportMetaCriteria> ivImportMeta
protected PendingProduct ivPending
protected Product ivProduct
protected java.util.ArrayList<Product> ivProductsObj
protected java.util.ArrayList<java.lang.Object[]> ivProductsArr
protected int ivBegIndex
ivProductsObj
or
ivProductsArr
.protected int ivEndIndex
ivProductsObj
or ivProductsArr
.protected boolean ivUpdatePrice
protected boolean ivUpdateAvail
protected java.util.TreeMap<java.util.Date,QuantityOnOrder> ivOnOrder
protected java.util.ArrayList<QuantityPriceBreak> ivQtyBreaks
protected java.util.ArrayList<WarehouseQuantity> ivWhseQtys
protected java.util.ArrayList<WarehouseDetail> ivWhseDtls
protected java.lang.String ivWhseDtlId
protected java.lang.String ivWhseDtlDesc
protected java.lang.String ivWhseDtlQty
protected char ivMode
protected java.text.SimpleDateFormat ivYMDDateFormat
public ProductInformation()
public java.util.ArrayList<ImportMetaCriteria> getImportMeta()
getImportMeta
in IProductInformation
.getImportMeta
in interface IProductInformation
public boolean getPending(ImportBatch batch)
PendingProduct
information is
added to the batch.
Implements getPending
in IProductInformation
.getPending
in interface IProductInformation
batch
- (ImportBatch) The batch to retrieve.true
if successful, otherwise false
.public java.util.ArrayList<QuantityPriceBreak> getQtyBreaks(Product product)
getQtyBreaks
in IProductInformation
.getQtyBreaks
in interface IProductInformation
product
- (Product) The product to retrieve.public java.util.ArrayList<QuantityOnOrder> getQtyOnOrder(Product product)
getQtyOnOrder
in interface IProductInformation
product
- (Product) The product to retrieve.public java.util.ArrayList<WarehouseDetail> getWhseDetail(java.lang.String whseId, java.lang.String whseDesc, Product product)
getWhseDetail
in IProductInformation
.getWhseDetail
in interface IProductInformation
whseId
- (String) The id of the warehouse to retrieve.whseDesc
- (String) The description of the warehouse to retrieve.product
- (Product) The product to retrieve.public java.lang.String getWhseDetailDesc()
getWhseDetailDesc
in IProductInformation
.getWhseDetailDesc
in interface IProductInformation
public java.lang.String getWhseDetailQty()
getWhseDetailQty
in IProductInformation
.getWhseDetailQty
in interface IProductInformation
public java.util.ArrayList<WarehouseQuantity> getWhseQtys(Product product)
getWhseQtys
in IProductInformation
.getWhseQtys
in interface IProductInformation
product
- (Product) The product to retrieve.public boolean setPriceAndAvail(java.util.ArrayList<Product> products, int begIndex, int endIndex, boolean updatePrice, boolean updateAvail)
setPriceAndAvail
in IProductInformation
.setPriceAndAvail
in interface IProductInformation
products
- (ArrayList) A list of product objects to process.begIndex
- (int) The beginning index, inclusive. Only products
in the collection between begin and end indecises will be
updated.endIndex
- (int) The ending index, inclusive.updatePrice
- (boolean) If true, the price will be updated from
the ERP system.updateAvail
- (boolean) If true, the available quantity will be
updated from the ERP system.true
if successful, otherwise false
.public boolean validate(java.util.ArrayList<java.lang.Object[]> products)
Object[]
having 9 or more elements.
The Object[]
array elements are defined as:
[0] input - (String) product id [1] input - (String) unit of measure code. [2] output - (Integer) new qty available [3] output - (Integer) new qty2 available [4] output - (BigDecimal) new price [5] output - (String) error codes (if validation errors or warnings) [9] output - (Boolean) qty breaks are possibleImplements
validate
in IProductInformation
.validate
in interface IProductInformation
products
- (ArrayList) The products to validate.true
if successful, otherwise false
.protected boolean callProgram() throws java.lang.Exception
process
after
any data to be placed on the send queue has been successfully placed and
sent.
Implements callProgram
in ERPInterfaceAS400
.callProgram
in class ERPInterfaceAS400
true
if the call was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected void readDataQueue() throws java.lang.Exception
process
after a successful
call to the ERP program. Iterates through the received queue entries for
the current queue key, determines each queue entry's record format id,
and then invokes the parseQueueEntry
method.
Implements readDataQueue
in ERPInterfaceAS400
.readDataQueue
in class ERPInterfaceAS400
java.lang.Exception
- - if an error occurs with reading data on
the queue.protected boolean parseQueueEntry(java.lang.String fmtid, byte[] qbytes) throws java.lang.Exception
readDataQueue
for each queue entry that
is read for the current queue key.
Implements parseQueueEntry
in ERPInterfaceAS400
.parseQueueEntry
in class ERPInterfaceAS400
fmtid
- (String) The record format id of the queue entry.qbytes
- (byte[]) The data queue entry's raw data.true
to read the next entry from the receive
data queue or false
to stop reading.java.lang.Exception
- - if an error occurs with reading data on
the queue.protected void sendDataQueue() throws java.lang.Exception
process
as the first step after a connection to the ERP system
has been successfully established.
Implements sendDataQueue
in ERPInterfaceAS400
.sendDataQueue
in class ERPInterfaceAS400
java.lang.Exception
- - if an error occurs with placing data on
the queue and sending the queue.protected boolean callImportMeta() throws java.lang.Exception
true
if the run was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected boolean callOnOrder() throws java.lang.Exception
true
if the run was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected boolean callPending() throws java.lang.Exception
true
if the run was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected boolean callPriceAndAvail() throws java.lang.Exception
true
if the run was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected boolean callQtyBreaks() throws java.lang.Exception
true
if the run was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected boolean callWhseDetail() throws java.lang.Exception
true
if the run was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected boolean callWhseQtys() throws java.lang.Exception
true
if the run was successful, otherwise
false
.java.lang.Exception
- - if an error occurs with the running of
the ERP program.protected ImportMetaCriteria parseImportMeta(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected void parseOnOrder(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected PendingProduct parsePending(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected Xref parsePendingXref(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected void parsePriceAndAvail(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected QuantityPriceBreak parseQtyBreaks(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected WarehouseDetail parseWhseDetail(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected WarehouseQuantity parseWhseQtys(ERPInterfaceAS400.Received rec) throws java.lang.Exception
rec
- (Received) The receive data queue data.java.lang.Exception
- - if an error occurs during the parsing of
the queue's data.protected void sendPending() throws java.lang.Exception
java.lang.Exception
- - if an error occurs with placing data on
the queue and sending the queue.protected void sendPriceAndAvail() throws java.lang.Exception
java.lang.Exception
- - if an error occurs with placing data on
the queue and sending the queue.protected void writePending()
protected java.util.Date convertToDate(java.lang.String valueS)
valueS
- (String) The date value formated as CYYMMDD.Date
object or
null if an error ocurred.