org.kuali.kfs.module.endow.batch.service.impl
Class PooledFundControlTransactionsServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.endow.batch.service.impl.PooledFundControlTransactionsServiceImpl
All Implemented Interfaces:
PooledFundControlTransactionsService

@Transactional
public class PooledFundControlTransactionsServiceImpl
extends Object
implements PooledFundControlTransactionsService


Field Summary
protected  org.kuali.rice.kns.service.BusinessObjectService businessObjectService
           
protected  org.kuali.rice.kns.service.DocumentService documentService
           
protected  KEMService kemService
           
protected  org.kuali.rice.kns.service.KualiRuleService kualiRuleService
           
protected static org.apache.log4j.Logger LOG
           
protected  org.kuali.rice.kns.service.ParameterService parameterService
           
protected  PooledFundControlTransactionsDao pooledFundControlTransactionsDao
           
protected  ReportWriterService pooledFundControlTransactionsExceptionReportWriterService
           
protected  ReportWriterService pooledFundControlTransactionsTotalReportWriterService
           
 
Constructor Summary
PooledFundControlTransactionsServiceImpl()
           
 
Method Summary
protected  boolean createCashDocumentBasedOnHoldingCost(String documentName, String DocDescription, String securityLineType, String noRouteInd, String ipInd)
          Creates an ECI or an ECDD eDoc according to the total amount of holding cost
protected  boolean createCashDocumentForIncomeDistribution()
          Creates an ECI or an ECDD eDoc according to the total amount of income/principle cash for transaction type ECI and ECDD
protected  boolean createCashDocumentForPurchase()
          Creates an ECI or an ECDD eDoc according to the total amount of holding cost for EAI
protected  boolean createCashDocumentForSale()
          Creates an ECI or an ECDD eDoc according to the total amount of holding cost for EAD
protected  boolean createCashDocumentForSaleGainLoss()
          Creates an ECI or an ECDD eDoc according to the total amount of gain/loss for transaction type EAD
protected  boolean createECDD(PooledFundControl pooledFundControl, org.kuali.rice.kns.util.KualiDecimal totalAmount, String paramDescriptionName, String securityLineType, String paramNoRouteInd, String incomePrincipalIndicator)
          Creates ECDD
protected  boolean createECI(PooledFundControl pooledFundControl, org.kuali.rice.kns.util.KualiDecimal totalAmount, String paramDescriptionName, String securityLineTypeCode, String paramNoRouteInd, String incomePrincipalIndicator)
          Creates ECI
 boolean generatePooledFundControlTransactions()
           
 org.kuali.rice.kns.service.DocumentService getDocumentService()
          Gets the documentService attribute.
protected  String getEtranTypeCode(PooledFundControl pooledFundControl, String docComponentType)
          Gets the transaction type code based on the document component type
protected
<C extends EndowmentSecurityDetailsDocumentBase>
C
initializeCashDocument(String documentType, int counter)
          Initialize a cash document.
protected  void initializeReports()
          Initializes reports
 boolean isNoRoute(String paramNoRouteInd)
          check if it is no route
protected  void populateECDD(CashDecreaseDocument cashDecreaseDocument, PooledFundControl pooledFundControl, org.kuali.rice.kns.util.KualiDecimal totalAmount, String securityLineTypeCode, String transactionIPIndicatorCode, String etranTypeCode)
          Populates security and transaction lines
protected  void populateECI(CashIncreaseDocument cashIncreaseDocument, PooledFundControl pooledFundControl, org.kuali.rice.kns.util.KualiDecimal totalAmount, String securityLineTypeCode, String transactionIPIndicatorCode, String etranTypeCode)
          Populates security and transaction lines
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the businessObjectService attribute value.
 void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
          Sets the documentService attribute value.
 void setKemService(KEMService kemService)
          Sets the kemService attribute value.
 void setKualiRuleService(org.kuali.rice.kns.service.KualiRuleService kualiRuleService)
          Sets the kualiRuleService attribute value.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the parameterService attribute value.
 void setPooledFundControlTransactionsDao(PooledFundControlTransactionsDao pooledFundControlTransactionsDao)
          Sets the pooledFundControlTransactionsDaoOjb attribute value.
 void setPooledFundControlTransactionsExceptionReportWriterService(ReportWriterService pooledFundControlTransactionsExceptionReportWriterService)
          Sets the pooledFundControlTransactionsExceptionReportWriterService attribute value.
 void setPooledFundControlTransactionsTotalReportWriterService(ReportWriterService pooledFundControlTransactionsTotalReportWriterService)
          Sets the pooledFundControlTransactionsTotalReportWriterService attribute value.
protected
<T extends EndowmentSecurityDetailsDocumentBase>
boolean
submitCashDocument(T cashDocument, String documentType, String paramNoRouteInd)
          Submits the document
protected  boolean validateECDD(CashDecreaseDocument cashDecreaseDocument)
          validate the ECDD business rules
protected  boolean validateECI(CashIncreaseDocument cashIncreaseDocument)
          validate the ECI business rules
protected
<C extends EndowmentSecurityDetailsDocumentBase,T extends EndowmentTransactionLineBase>
boolean
validateTransactionLine(C cashDocument, T endowmentTransactionLine, String trnsactionPropertyName)
          Validate Cash Transaction line
protected
<T extends EndowmentSecurityDetailsDocumentBase>
void
writeDocumentValdiationErrorReport(T cashDocument, String documentType)
          Writes document validation errors
protected
<T extends EndowmentSecurityDetailsDocumentBase>
void
writeSubmissionErrorReport(T cashDocument, String documentType, String errorMessage)
          Writes the submission errors
protected
<C extends EndowmentSecurityDetailsDocumentBase>
void
writeTotalReport(C cashDocument, String documentType, String incomePrincipalIndicator)
          Writes the total report
protected  void writeTransactionLineValidationErrorReport(String documentType, String documentId, String securityId, String kemid, org.kuali.rice.kns.util.KualiDecimal transactionAmount)
          Writes transaction line validation errors per each
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG

businessObjectService

protected org.kuali.rice.kns.service.BusinessObjectService businessObjectService

documentService

protected org.kuali.rice.kns.service.DocumentService documentService

parameterService

protected org.kuali.rice.kns.service.ParameterService parameterService

kualiRuleService

protected org.kuali.rice.kns.service.KualiRuleService kualiRuleService

kemService

protected KEMService kemService

pooledFundControlTransactionsDao

protected PooledFundControlTransactionsDao pooledFundControlTransactionsDao

pooledFundControlTransactionsExceptionReportWriterService

protected ReportWriterService pooledFundControlTransactionsExceptionReportWriterService

pooledFundControlTransactionsTotalReportWriterService

protected ReportWriterService pooledFundControlTransactionsTotalReportWriterService
Constructor Detail

PooledFundControlTransactionsServiceImpl

public PooledFundControlTransactionsServiceImpl()
Method Detail

generatePooledFundControlTransactions

public boolean generatePooledFundControlTransactions()
Specified by:
generatePooledFundControlTransactions in interface PooledFundControlTransactionsService

createCashDocumentForPurchase

protected boolean createCashDocumentForPurchase()
Creates an ECI or an ECDD eDoc according to the total amount of holding cost for EAI


createCashDocumentForSale

protected boolean createCashDocumentForSale()
Creates an ECI or an ECDD eDoc according to the total amount of holding cost for EAD


createCashDocumentBasedOnHoldingCost

protected boolean createCashDocumentBasedOnHoldingCost(String documentName,
                                                       String DocDescription,
                                                       String securityLineType,
                                                       String noRouteInd,
                                                       String ipInd)
Creates an ECI or an ECDD eDoc according to the total amount of holding cost

Parameters:
documentName -
DocDescription -
noRouteInd -
ipInd -

createCashDocumentForSaleGainLoss

protected boolean createCashDocumentForSaleGainLoss()
Creates an ECI or an ECDD eDoc according to the total amount of gain/loss for transaction type EAD


createCashDocumentForIncomeDistribution

protected boolean createCashDocumentForIncomeDistribution()
Creates an ECI or an ECDD eDoc according to the total amount of income/principle cash for transaction type ECI and ECDD


createECI

protected boolean createECI(PooledFundControl pooledFundControl,
                            org.kuali.rice.kns.util.KualiDecimal totalAmount,
                            String paramDescriptionName,
                            String securityLineTypeCode,
                            String paramNoRouteInd,
                            String incomePrincipalIndicator)
Creates ECI

Parameters:
pooledFundControl -
totalAmount -
paramDescriptionName -
securityLineType -
paramNoRouteInd -
incomePrincipalIndicator -
Returns:

createECDD

protected boolean createECDD(PooledFundControl pooledFundControl,
                             org.kuali.rice.kns.util.KualiDecimal totalAmount,
                             String paramDescriptionName,
                             String securityLineType,
                             String paramNoRouteInd,
                             String incomePrincipalIndicator)
Creates ECDD

Parameters:
pooledFundControl -
totalAmount -
paramDescriptionName -
securityLineType -
paramNoRouteInd -
incomePrincipalIndicator -
Returns:

populateECI

protected void populateECI(CashIncreaseDocument cashIncreaseDocument,
                           PooledFundControl pooledFundControl,
                           org.kuali.rice.kns.util.KualiDecimal totalAmount,
                           String securityLineTypeCode,
                           String transactionIPIndicatorCode,
                           String etranTypeCode)
Populates security and transaction lines

Parameters:
cashIncreaseDocument -
pooledFundControl -
totalAmount -
securityLineTypeCode -
transactionIPIndicatorCode -

populateECDD

protected void populateECDD(CashDecreaseDocument cashDecreaseDocument,
                            PooledFundControl pooledFundControl,
                            org.kuali.rice.kns.util.KualiDecimal totalAmount,
                            String securityLineTypeCode,
                            String transactionIPIndicatorCode,
                            String etranTypeCode)
Populates security and transaction lines

Parameters:
cashDecreaseDocument -
pooledFundControl -
totalAmount -
securityLineTypeCode -
transactionIPIndicatorCode -

initializeCashDocument

protected <C extends EndowmentSecurityDetailsDocumentBase> C initializeCashDocument(String documentType,
                                                                                    int counter)
Initialize a cash document. If fails, try as many times as EndowConstants.MAXMUM_NUMBER_OF_EDOC_INITILIZATION_TRY.

Type Parameters:
C -
Parameters:
documentType -
counter -
Returns:

submitCashDocument

protected <T extends EndowmentSecurityDetailsDocumentBase> boolean submitCashDocument(T cashDocument,
                                                                                      String documentType,
                                                                                      String paramNoRouteInd)
Submits the document

Type Parameters:
T -
Parameters:
cashDocument -
documentType -
paramNoRouteInd -
Returns:

validateTransactionLine

protected <C extends EndowmentSecurityDetailsDocumentBase,T extends EndowmentTransactionLineBase> boolean validateTransactionLine(C cashDocument,
                                                                                                                                  T endowmentTransactionLine,
                                                                                                                                  String trnsactionPropertyName)
Validate Cash Transaction line

Type Parameters:
C -
T -
Parameters:
cashDocument -
endowmentTransactionLine -
trnsactionPropertyName -
Returns:

validateECI

protected boolean validateECI(CashIncreaseDocument cashIncreaseDocument)
validate the ECI business rules

Parameters:
cashIncreaseDocument -
Returns:
boolean

validateECDD

protected boolean validateECDD(CashDecreaseDocument cashDecreaseDocument)
validate the ECDD business rules

Parameters:
cashDecreaseDocument -
Returns:
boolean

getEtranTypeCode

protected String getEtranTypeCode(PooledFundControl pooledFundControl,
                                  String docComponentType)
Gets the transaction type code based on the document component type

Parameters:
pooledFundControl -
docComponentType -
Returns:

isNoRoute

public boolean isNoRoute(String paramNoRouteInd)
check if it is no route

Returns:
boolean

writeTotalReport

protected <C extends EndowmentSecurityDetailsDocumentBase> void writeTotalReport(C cashDocument,
                                                                                 String documentType,
                                                                                 String incomePrincipalIndicator)
Writes the total report

Type Parameters:
C -
Parameters:
cashDocument -
documentType -

writeTransactionLineValidationErrorReport

protected void writeTransactionLineValidationErrorReport(String documentType,
                                                         String documentId,
                                                         String securityId,
                                                         String kemid,
                                                         org.kuali.rice.kns.util.KualiDecimal transactionAmount)
Writes transaction line validation errors per each

Parameters:
documentType -
kemid -
transactionAmount -

writeDocumentValdiationErrorReport

protected <T extends EndowmentSecurityDetailsDocumentBase> void writeDocumentValdiationErrorReport(T cashDocument,
                                                                                                   String documentType)
Writes document validation errors

Type Parameters:
T -
Parameters:
cashDocument -
documentType -

writeSubmissionErrorReport

protected <T extends EndowmentSecurityDetailsDocumentBase> void writeSubmissionErrorReport(T cashDocument,
                                                                                           String documentType,
                                                                                           String errorMessage)
Writes the submission errors

Type Parameters:
T -
Parameters:
cashDocument -
documentType -

initializeReports

protected void initializeReports()
Initializes reports


setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value.

Parameters:
businessObjectService - The businessObjectService to set.

setPooledFundControlTransactionsDao

public void setPooledFundControlTransactionsDao(PooledFundControlTransactionsDao pooledFundControlTransactionsDao)
Sets the pooledFundControlTransactionsDaoOjb attribute value.

Parameters:
pooledFundControlTransactionsDaoOjb - The pooledFundControlTransactionsDaoOjb to set.

getDocumentService

public org.kuali.rice.kns.service.DocumentService getDocumentService()
Gets the documentService attribute.

Returns:
Returns the documentService.

setDocumentService

public void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
Sets the documentService attribute value.

Parameters:
documentService - The documentService to set.

setKualiRuleService

public void setKualiRuleService(org.kuali.rice.kns.service.KualiRuleService kualiRuleService)
Sets the kualiRuleService attribute value.

Parameters:
kualiRuleService - The kualiRuleService to set.

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
Sets the parameterService attribute value.

Parameters:
parameterService - The parameterService to set.

setPooledFundControlTransactionsExceptionReportWriterService

public void setPooledFundControlTransactionsExceptionReportWriterService(ReportWriterService pooledFundControlTransactionsExceptionReportWriterService)
Sets the pooledFundControlTransactionsExceptionReportWriterService attribute value.

Parameters:
pooledFundControlTransactionsExceptionReportWriterService - The pooledFundControlTransactionsExceptionReportWriterService to set.

setPooledFundControlTransactionsTotalReportWriterService

public void setPooledFundControlTransactionsTotalReportWriterService(ReportWriterService pooledFundControlTransactionsTotalReportWriterService)
Sets the pooledFundControlTransactionsTotalReportWriterService attribute value.

Parameters:
pooledFundControlTransactionsTotalReportWriterService - The pooledFundControlTransactionsTotalReportWriterService to set.

setKemService

public void setKemService(KEMService kemService)
Sets the kemService attribute value.

Parameters:
kemService - The kemService to set.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.