RS - platform dependent record set typepublic class SrCart<RS> extends Object implements ISrCart
Service that retrieve/create buyer's shopping cart, make cart totals after any line action, etc. This is shared non-transactional service.
| Constructor and Description |
|---|
SrCart() |
| Modifier and Type | Method and Description |
|---|---|
Buyer |
createBuyer(Map<String,Object> pRvs,
org.beigesoft.mdl.IReqDt pRqDt)
Create Buyer.
|
void |
delLine(Map<String,Object> pRvs,
CartLn pCaLn,
TxDst pTxRls)
Deletes cart line.
|
void |
emptyCart(Map<String,Object> pRvs,
Buyer pBuyr)
Empties Cart.
|
void |
emptyCart(Map<String,Object> pRvs,
Cart pCart)
Empties Cart.
|
CartTxLn |
fndCreTxLn(Map<String,Object> pRvs,
Cart pCart,
Tax pTax,
SeSel pSeller,
boolean pNeedFind)
Finds (if need) enabled line with same tax and seller or any
disabled tax line or creates one.
|
IBuySr |
getBuySr()
Getter for buySr.
|
Cart |
getCart(Map<String,Object> pRvs,
org.beigesoft.mdl.IReqDt pRqDt,
boolean pIsNeedToCreate,
boolean pIsBuAuth)
Get/Create Cart.
|
org.beigesoft.log.ILog |
getLog()
Geter for log.
|
org.beigesoft.srv.INumStr |
getNumStr()
Getter for numStr.
|
org.beigesoft.rdb.IOrm |
getOrm()
Geter for orm.
|
Class<?> |
getPplCl()
Getter for pplCl.
|
org.beigesoft.rdb.IRdb<RS> |
getRdb()
Getter for rdb.
|
ISrTrStg |
getSrTrStg()
Getter for srTrStg.
|
void |
hndCartChg(Map<String,Object> pRvs,
Cart pCart,
TxDst pTxRls)
Handle event cart delivering or line changed
and redone forced service if need.
|
void |
hndCurrChg(Map<String,Object> pRvs,
Cart pCart,
AcStg pAs,
TrdStg pTs)
Handle event cart currency changed.
|
String |
lazQuItemPrice()
Lazy Getter for quItemPrice.
|
String |
lazQuItemPriceCat()
Lazy Getter for quItemPriceCat.
|
String |
lazQuItemSePrice()
Lazy Getter for quItemSePrice.
|
String |
lazQuItemSePriceCat()
Lazy Getter for quItemSePriceCat.
|
String |
lazQuTxInvBas()
Lazy Getter for quTxInvBas.
|
String |
lazQuTxInvBasAggr()
Lazy Getter for quTxInvBasAggr.
|
String |
lazQuTxItBas()
Lazy Getter for quTxItBas.
|
String |
lazQuTxItBasAggr()
Lazy Getter for quTxItBasAggr.
|
String |
loadString(String pFiNm)
Load string file (usually SQL query).
|
void |
mkCartTots(Map<String,Object> pRvs,
TrdStg pTs,
CartLn pCaLn,
AcStg pAs,
TxDst pTxRls)
Refresh cart totals by seller cause line inserted/changed/deleted.
|
void |
mkLine(Map<String,Object> pRvs,
CartLn pCaLn,
AcStg pAs,
TrdStg pTs,
TxDst pTxRls,
boolean pRedoPr,
boolean pRedoTxc)
Makes cart line.
|
CartLn |
mkTxdLn(List<CartLn> pTxdLns,
Long pTdlId,
Long pCatId,
Tax pTax,
Double pRate,
AcStg pAs)
Make cart line that stores taxes data in lines set
for invoice basis or item basis aggregate rate.
|
String |
prn(AcStg pAs,
org.beigesoft.mdl.CmnPrf pCpf,
org.beigesoft.mdlp.UsPrf pUpf,
BigDecimal pVal)
Simple delegator to print number.
|
Cart |
retrCart(Map<String,Object> pRvs,
Buyer pBuyr,
boolean pForEmpty)
Retrieves Cart from DB.
|
AItmPri<?,?> |
revItmPri(Map<String,Object> pRvs,
TrdStg pTs,
Buyer pBuyr,
EItmTy pItType,
Long pItId)
Reveals item's price descriptor.
|
TxDst |
revTxRules(Map<String,Object> pRvs,
Cart pCart,
AcStg pAs)
Reveal shared tax rules for cart.
|
void |
setBuySr(IBuySr pBuySr)
Setter for buySr.
|
void |
setLog(org.beigesoft.log.ILog pLog)
Setter for log.
|
void |
setNumStr(org.beigesoft.srv.INumStr pNumStr)
Setter for numStr.
|
void |
setOrm(org.beigesoft.rdb.IOrm pOrm)
Setter for orm.
|
void |
setPplCl(Class<?> pPplCl)
Setter for pplCl.
|
void |
setRdb(org.beigesoft.rdb.IRdb<RS> pRdb)
Setter for rdb.
|
void |
setSrTrStg(ISrTrStg pSrTrStg)
Setter for srTrStg.
|
public final Cart getCart(Map<String,Object> pRvs, org.beigesoft.mdl.IReqDt pRqDt, boolean pIsNeedToCreate, boolean pIsBuAuth) throws Exception
Get/Create Cart.
getCart in interface ISrCartpRvs - additional parampRqDt - Request DatapIsNeedToCreate - if need to create, e.g. "NO" for deleting item from
cart, "YES" for adding one.pIsBuAuth - buyer must be authorizedException - - an exceptionpublic final void mkCartTots(Map<String,Object> pRvs, TrdStg pTs, CartLn pCaLn, AcStg pAs, TxDst pTxRls) throws Exception
Refresh cart totals by seller cause line inserted/changed/deleted.
mkCartTots in interface ISrCartpRvs - request scoped varspTs - TrdStgpCaLn - affected cart linepAs - Accounting SettingspTxRls - NULL if not taxableException - - an exception.public final TxDst revTxRules(Map<String,Object> pRvs, Cart pCart, AcStg pAs) throws Exception
Reveal shared tax rules for cart. It also makes buyer-regCustomer.
revTxRules in interface ISrCartpRvs - request scoped varspCart - cartpAs - Accounting SettingsException - - an exception.public final void hndCurrChg(Map<String,Object> pRvs, Cart pCart, AcStg pAs, TrdStg pTs) throws Exception
Handle event cart currency changed.
hndCurrChg in interface ISrCartpRvs - request scoped varspCart - cartpAs - Accounting SettingspTs - TrdStgException - - an exception.public final void delLine(Map<String,Object> pRvs, CartLn pCaLn, TxDst pTxRls) throws Exception
Deletes cart line.
public final void hndCartChg(Map<String,Object> pRvs, Cart pCart, TxDst pTxRls) throws Exception
Handle event cart delivering or line changed and redone forced service if need.
hndCartChg in interface ISrCartpRvs - request scoped varspCart - cartpTxRls - Tax RulesException - - an exception.public final void mkLine(Map<String,Object> pRvs, CartLn pCaLn, AcStg pAs, TrdStg pTs, TxDst pTxRls, boolean pRedoPr, boolean pRedoTxc) throws Exception
Makes cart line.
public final AItmPri<?,?> revItmPri(Map<String,Object> pRvs, TrdStg pTs, Buyer pBuyr, EItmTy pItType, Long pItId) throws Exception
Reveals item's price descriptor.
public final void emptyCart(Map<String,Object> pRvs, Buyer pBuyr) throws Exception
Empties Cart.
public final void emptyCart(Map<String,Object> pRvs, Cart pCart) throws Exception
Empties Cart.
pRvs - request scoped varspCart - cartException - - an exceptionpublic final Cart retrCart(Map<String,Object> pRvs, Buyer pBuyr, boolean pForEmpty) throws Exception
Retrieves Cart from DB.
pRvs - additional parampBuyr - buyerpForEmpty - for emptyingException - - an exceptionpublic final CartLn mkTxdLn(List<CartLn> pTxdLns, Long pTdlId, Long pCatId, Tax pTax, Double pRate, AcStg pAs)
Make cart line that stores taxes data in lines set for invoice basis or item basis aggregate rate.
pTxdLns - TD linespTdlId - line IDpCatId - tax category IDpTax - taxpRate - tax ratepAs - ASpublic final CartTxLn fndCreTxLn(Map<String,Object> pRvs, Cart pCart, Tax pTax, SeSel pSeller, boolean pNeedFind) throws Exception
Finds (if need) enabled line with same tax and seller or any disabled tax line or creates one.
pRvs - additional parampCart - cartpTax - taxpSeller - sellerpNeedFind - if need to find enabledException - if no need to find but line is foundpublic final Buyer createBuyer(Map<String,Object> pRvs, org.beigesoft.mdl.IReqDt pRqDt) throws Exception
Create Buyer.
pRvs - additional parampRqDt - Request DataException - - an exceptionpublic final String lazQuTxInvBas() throws IOException
Lazy Getter for quTxInvBas.
IOException - - IO exceptionpublic final String lazQuTxInvBasAggr() throws IOException
Lazy Getter for quTxInvBasAggr.
IOException - - IO exceptionpublic final String lazQuTxItBas() throws IOException
Lazy Getter for quTxItBas.
IOException - - IO exceptionpublic final String lazQuTxItBasAggr() throws IOException
Lazy Getter for quTxItBasAggr.
IOException - - IO exceptionpublic final String lazQuItemPrice() throws IOException
Lazy Getter for quItemPrice.
IOException - - IO exceptionpublic final String lazQuItemSePrice() throws IOException
Lazy Getter for quItemSePrice.
IOException - - IO exceptionpublic final String lazQuItemPriceCat() throws IOException
Lazy Getter for quItemPriceCat.
IOException - - IO exceptionpublic final String lazQuItemSePriceCat() throws IOException
Lazy Getter for quItemSePriceCat.
IOException - - IO exceptionpublic final String loadString(String pFiNm) throws IOException
Load string file (usually SQL query).
pFiNm - file nameIOException - - IO exceptionpublic final String prn(AcStg pAs, org.beigesoft.mdl.CmnPrf pCpf, org.beigesoft.mdlp.UsPrf pUpf, BigDecimal pVal)
Simple delegator to print number.
pAs - ACC stgpCpf - common prefspUpf - user prefspVal - valuepublic final org.beigesoft.srv.INumStr getNumStr()
Getter for numStr.
public final void setNumStr(org.beigesoft.srv.INumStr pNumStr)
Setter for numStr.
pNumStr - referencepublic final org.beigesoft.log.ILog getLog()
Geter for log.
public final void setLog(org.beigesoft.log.ILog pLog)
Setter for log.
pLog - referencepublic final org.beigesoft.rdb.IRdb<RS> getRdb()
Getter for rdb.
public final void setRdb(org.beigesoft.rdb.IRdb<RS> pRdb)
Setter for rdb.
pRdb - referencepublic final org.beigesoft.rdb.IOrm getOrm()
Geter for orm.
public final void setOrm(org.beigesoft.rdb.IOrm pOrm)
Setter for orm.
pOrm - referencepublic final ISrTrStg getSrTrStg()
Getter for srTrStg.
public final void setSrTrStg(ISrTrStg pSrTrStg)
Setter for srTrStg.
pSrTrStg - referencepublic final Class<?> getPplCl()
Getter for pplCl.
public final void setPplCl(Class<?> pPplCl)
Setter for pplCl.
pPplCl - referencepublic final IBuySr getBuySr()
Getter for buySr.
public final void setBuySr(IBuySr pBuySr)
Setter for buySr.
pBuySr - referenceCopyright © 2019–2020. All rights reserved.