public class CustomerMaintenance extends ERPInterfaceBogus implements ICustomerMaintenance
Modifier and Type | Field and Description |
---|---|
private Customer |
ivCustomer
The current customer being maintained.
|
private java.lang.String |
ivMode
The type of maintenance (add, change, delete) to perform on the current
customer.
|
private int |
ivType
The type of customer (account, shipto) being maintained.
|
private static long |
serialVersionUID
The class' serialization version id.
|
ivConfig
ivHashCode, ivHashFlds, ivObjAttrs
ERROR_DUPLICATE, TYPE_ACCOUNT, TYPE_SHIPTO
ERROR_CONNECT, ERROR_NONE, ERROR_PROGRAM, WARN_DUPLICATE, WARN_NONE
Constructor and Description |
---|
CustomerMaintenance()
Constructs a new ERP customer maintenance interface.
|
Modifier and Type | Method and Description |
---|---|
boolean |
createCustomer(Customer customer,
int type,
java.lang.String initid)
Creates a new customer record in the ERP system.
|
boolean |
deleteCustomer(Customer customer,
java.lang.String initid)
Deletes a customer record in the ERP system.
|
private boolean |
doMaintenance(Customer customer,
int type,
java.lang.String mode)
Performs the requested maintenance on the specified customer.
|
private java.lang.String |
formatCustomerId(java.math.BigInteger custnum)
Returns a formatted customer id, dps9000 style (xxxxxxx-xxx).
|
Customer |
getCustomer(java.lang.String customerId)
Retrieves a customer record from the ERP system.
|
Customer |
getCustomer(java.lang.String customerId,
java.lang.String queueId)
Retrieves a customer record from the ERP system.
|
java.util.ArrayList<Customer> |
getShipForCustomers(java.lang.String customerId)
Returns a collection of customer records from the ERP system which have
shipfor id equal to customer id.
|
private void |
setCustomerId()
Sets the customer id(s) for a new customer being added.
|
boolean |
updateCustomer(Customer customer,
java.lang.String initid)
Updates a customer record in the ERP system.
|
equals, getContext, getErrorType, getQueueKey, getWarningType, 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
private Customer ivCustomer
private int ivType
private java.lang.String ivMode
public CustomerMaintenance()
public boolean createCustomer(Customer customer, int type, java.lang.String initid)
createCustomer
in ICustomerMaintenance
.createCustomer
in interface ICustomerMaintenance
customer
- (Customer) The customer object to create. A new
customer id will be assigned and set in this customer object.type
- (int) The type of customer that is to be created. Must
be one of the predefined types (TYPE_ACCOUNT, TYPE_SHIPTO).initid
- (String) The id of the user initiating the create.true
if the customer was successfully added,
otherwise false
.public boolean updateCustomer(Customer customer, java.lang.String initid)
updateCustomer
in ICustomerMaintenance
.updateCustomer
in interface ICustomerMaintenance
customer
- (Customer) The customer object containing the new
information.initid
- (String) The id of the user initiating the update.true
if the customer was successfully updated
otherwise false
.public boolean deleteCustomer(Customer customer, java.lang.String initid)
deleteCustomer
in ICustomerMaintenance
.deleteCustomer
in interface ICustomerMaintenance
customer
- (Customer) The customer object for the customer to
delete.initid
- (String) The id of the user initiating the delete.true
if the customer was successfully deleted
otherwise false
.public Customer getCustomer(java.lang.String customerId)
getCustomer
in ICustomerMaintenance
.getCustomer
in interface ICustomerMaintenance
customerId
- (String) The id for the customer to retrieve.public Customer getCustomer(java.lang.String customerId, java.lang.String queueId)
getCustomer
in ICustomerMaintenance
.getCustomer
in interface ICustomerMaintenance
customerId
- (String) The id for the customer to retrieve.queueId
- (String) The value to use when creating the queue key,
if a value other than the current session id is desired.public java.util.ArrayList<Customer> getShipForCustomers(java.lang.String customerId)
getShipForCustomers
in ICustomerMaintenance
.getShipForCustomers
in interface ICustomerMaintenance
customerId
- (String) The shipfor id for the customers to retrieve.private boolean doMaintenance(Customer customer, int type, java.lang.String mode)
customer
- (Customer) The customer object for the customer being
maintained.type
- (int) The type of customer that is being maintained. Must
be one of the predefined types (TYPE_ACCOUNT, TYPE_SHIPTO) or
zero.mode
- (String) The maintenance mode of processing. Must be "a"
(for add), "c" (for change) or "d" (for delete).true<
if processing completed successfully.private void setCustomerId()
doMaintenance
method.private java.lang.String formatCustomerId(java.math.BigInteger custnum)
setCustomerId
method.custnum
- (BigInteger) The customer number that is to be
formatted.