org.kuali.kfs.module.cab.batch.service.impl
Class BatchExtractServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.cab.batch.service.impl.BatchExtractServiceImpl
All Implemented Interfaces:
BatchExtractService

@Transactional
public class BatchExtractServiceImpl
extends Object
implements BatchExtractService

This class provides default implementation of BatchExtractService


Field Summary
protected  org.kuali.rice.kns.service.BusinessObjectService businessObjectService
           
protected  org.kuali.rice.kns.service.DateTimeService dateTimeService
           
protected  ExtractDao extractDao
           
protected static org.apache.log4j.Logger LOG
           
protected  org.kuali.rice.kns.service.ParameterService parameterService
           
protected  PurApInfoService purApInfoService
           
protected  PurApLineService purApLineService
           
protected  PurchasingAccountsPayableItemAssetDao purchasingAccountsPayableItemAssetDao
           
 
Constructor Summary
BatchExtractServiceImpl()
           
 
Method Summary
protected  void addAssetLocks(HashMap<String,Object> assetLockMap, PurchasingAccountsPayableDocument cabPurapDoc, PurApItem purapItem, Integer accountsPaymentItemId, HashMap<Integer,PurchaseOrderDocument> poDocMap)
          Add asset lock to prohibit CAMS user modify the asset payment line.
 void allocateAdditionalCharges(HashSet<PurchasingAccountsPayableDocument> purApDocuments)
          Allocate additional charges during batch.
protected  BatchParameters createCabBatchParameters()
          Creates a batch parameters object reading values from configured system parameters for CAB Extract
protected  GeneralLedgerEntry createNegativeGlEntry(Entry entry)
          Force created entry with zero transaction amount
protected  GeneralLedgerEntry createPositiveGlEntry(Entry entry)
          Force created entry with zero transaction amount
protected  BatchParameters createPreTagBatchParameters()
          Creates a batch parameters object reading values from configured system parameters for Pre Tagging Extract
protected  PurchasingAccountsPayableDocument createPurchasingAccountsPayableDocument(Entry entry)
          This method creates PurchasingAccountsPayableDocument from a GL Entry and AP Document
protected  PurchasingAccountsPayableItemAsset createPurchasingAccountsPayableItemAsset(PurchasingAccountsPayableDocument cabPurapDoc, PurApItem apItem)
          Creates a new PurchasingAccountsPayableItemAsset using Purchasing Accounts payable item
protected  PurchasingAccountsPayableLineAssetAccount createPurchasingAccountsPayableLineAssetAccount(GeneralLedgerEntry generalLedgerEntry, PurchasingAccountsPayableDocument cabPurapDoc, PurApAccountingLineBase purApAccountingLine, PurchasingAccountsPayableItemAsset itemAsset)
          Creates a new instance of PurchasingAccountsPayableLineAssetAccount using values provided from dependent objects
protected  VendorCreditMemoDocument findCreditMemoDocument(Entry entry)
          Retrieves a credit memo document for a specific document number
 Collection<Entry> findElgibleGLEntries(ExtractProcessLog processLog)
          Returns the list of CAB eligible GL entries, filter parameters are pre-configured
protected  PurchasingAccountsPayableItemAsset findMatchingPurapAssetItem(PurchasingAccountsPayableDocument cabPurapDoc, PurApItem apItem)
          Finds out the active CAB Asset Item matching the line from PurAP.
protected  PaymentRequestDocument findPaymentRequestDocument(Entry entry)
          Retrieves a payment request document for a specific document number
 Collection<PurchaseOrderAccount> findPreTaggablePOAccounts()
          Implementation will retrieve all eligible Purchase Order account lines from a Purchase order that matches criteria required by pre-asset tagging, using these account lines, batch process can identify the eligible purchase order line items to be saved for pre-tagging screen
 Collection<PurApAccountingLineBase> findPurapAccountRevisions()
          Retrieves Payment Request Account History and Credit Memo account history, combines them into a single list
protected  PurchasingAccountsPayableDocument findPurchasingAccountsPayableDocument(Entry entry)
          Finds PurchasingAccountsPayableDocument using document number
protected  List getAssetNumbersForLocking(PurchaseOrderDocument purApdocument, PurApItem purapItem)
           
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
          Gets the businessObjectService attribute.
protected  Timestamp getCabLastRunTimestamp()
          Computes the last run time stamp, if null then it gives yesterday
protected  CapitalAssetManagementModuleService getCapitalAssetManagementModuleService()
           
 org.kuali.rice.kns.service.DateTimeService getDateTimeService()
          Gets the dateTimeService attribute.
 ExtractDao getExtractDao()
          Gets the extractDao attribute.
 org.kuali.rice.kns.service.ParameterService getParameterService()
          Gets the parameterService attribute.
protected  Date getPreTagLastRunDate()
          Gets the last pre tag extract run date from system parameter
 PurApInfoService getPurApInfoService()
          Gets the purApInfoService attribute.
 PurApLineService getPurApLineService()
          Gets the purApLineService attribute.
 PurchasingAccountsPayableItemAssetDao getPurchasingAccountsPayableItemAssetDao()
          Gets the purchasingAccountsPayableItemAssetDao attribute.
 void saveFPLines(List<Entry> fpLines, ExtractProcessLog processLog)
          Saves financial transaction lines which dont have Purchase Order number associated with it
 HashSet<PurchasingAccountsPayableDocument> savePOLines(List<Entry> poLines, ExtractProcessLog processLog)
          Saved purchasing line transactions, this method implementation internally uses ReconciliationService to QA the data before saving
 void savePreTagLines(Collection<PurchaseOrderAccount> preTaggablePOAccounts)
          Implementation will identify eligible purchase oder line items eligible for pre-tagging screen
 void separatePOLines(List<Entry> fpLines, List<Entry> purapLines, Collection<Entry> elgibleGLEntries)
          Separates out transaction lines associated with purchase order from the rest
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the businessObjectService attribute value.
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
          Sets the dateTimeService attribute value.
 void setExtractDao(ExtractDao extractDao)
          Sets the extractDao attribute value.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the parameterService attribute value.
 void setPurApInfoService(PurApInfoService purApInfoService)
          Sets the purApInfoService attribute value.
 void setPurApLineService(PurApLineService purApLineService)
          Sets the purApLineService attribute value.
 void setPurchasingAccountsPayableItemAssetDao(PurchasingAccountsPayableItemAssetDao purchasingAccountsPayableItemAssetDao)
          Sets the purchasingAccountsPayableItemAssetDao attribute value.
protected  void setupObjectRelationship(List<PurchasingAccountsPayableDocument> purApDocs)
          Setup relationship from account to item and item to doc.
 void updateLastExtractDate(Date dt)
          Updates the last extract date parameter for Pre Asset Tagging Step
 void updateLastExtractTime(Timestamp time)
          Updates the last extract time stamp system parameter, usually done when a batch process is finished successfully.
protected  void updateProcessLog(ExtractProcessLog processLog, ReconciliationService reconciliationService)
          Updates the entries into process log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG

businessObjectService

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

extractDao

protected ExtractDao extractDao

dateTimeService

protected org.kuali.rice.kns.service.DateTimeService dateTimeService

parameterService

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

purApLineService

protected PurApLineService purApLineService

purApInfoService

protected PurApInfoService purApInfoService

purchasingAccountsPayableItemAssetDao

protected PurchasingAccountsPayableItemAssetDao purchasingAccountsPayableItemAssetDao
Constructor Detail

BatchExtractServiceImpl

public BatchExtractServiceImpl()
Method Detail

allocateAdditionalCharges

public void allocateAdditionalCharges(HashSet<PurchasingAccountsPayableDocument> purApDocuments)
Description copied from interface: BatchExtractService
Allocate additional charges during batch.

Specified by:
allocateAdditionalCharges in interface BatchExtractService

setupObjectRelationship

protected void setupObjectRelationship(List<PurchasingAccountsPayableDocument> purApDocs)
Setup relationship from account to item and item to doc. In this way, we keep all working objects in the same view as form.

Parameters:
purApDocs -

createCabBatchParameters

protected BatchParameters createCabBatchParameters()
Creates a batch parameters object reading values from configured system parameters for CAB Extract

Returns:
BatchParameters

createPreTagBatchParameters

protected BatchParameters createPreTagBatchParameters()
Creates a batch parameters object reading values from configured system parameters for Pre Tagging Extract

Returns:
BatchParameters

findCreditMemoDocument

protected VendorCreditMemoDocument findCreditMemoDocument(Entry entry)
Retrieves a credit memo document for a specific document number

Parameters:
entry - GL Line
Returns:
CreditMemoDocument

findElgibleGLEntries

public Collection<Entry> findElgibleGLEntries(ExtractProcessLog processLog)
Description copied from interface: BatchExtractService
Returns the list of CAB eligible GL entries, filter parameters are pre-configured

Specified by:
findElgibleGLEntries in interface BatchExtractService
Returns:
Eligible GL Entries meeting batch parameters configured under parameter group KFS-CAB:Batch
See Also:
org.kuali.kfs.module.cab.batch.service.BatchExtractService#findElgibleGLEntries()

findPreTaggablePOAccounts

public Collection<PurchaseOrderAccount> findPreTaggablePOAccounts()
Description copied from interface: BatchExtractService
Implementation will retrieve all eligible Purchase Order account lines from a Purchase order that matches criteria required by pre-asset tagging, using these account lines, batch process can identify the eligible purchase order line items to be saved for pre-tagging screen

Specified by:
findPreTaggablePOAccounts in interface BatchExtractService
Returns:
Pre-taggable PO Account lines
See Also:
BatchExtractService.findPreTaggablePOAccounts()

findPaymentRequestDocument

protected PaymentRequestDocument findPaymentRequestDocument(Entry entry)
Retrieves a payment request document for a specific document number

Parameters:
entry - GL Line
Returns:
PaymentRequestDocument

getCabLastRunTimestamp

protected Timestamp getCabLastRunTimestamp()
Computes the last run time stamp, if null then it gives yesterday

Returns:
Last run time stamp

getPreTagLastRunDate

protected Date getPreTagLastRunDate()
Gets the last pre tag extract run date from system parameter

Returns:

saveFPLines

public void saveFPLines(List<Entry> fpLines,
                        ExtractProcessLog processLog)
Description copied from interface: BatchExtractService
Saves financial transaction lines which dont have Purchase Order number associated with it

Specified by:
saveFPLines in interface BatchExtractService
Parameters:
fpLines - Financial transaction lines
processLog - Process Log
See Also:
org.kuali.kfs.module.cab.batch.service.BatchExtractService#saveFPLines(java.util.List)

savePOLines

public HashSet<PurchasingAccountsPayableDocument> savePOLines(List<Entry> poLines,
                                                              ExtractProcessLog processLog)
Description copied from interface: BatchExtractService
Saved purchasing line transactions, this method implementation internally uses ReconciliationService to QA the data before saving

Specified by:
savePOLines in interface BatchExtractService
Parameters:
poLines - Eligible GL Lines
processLog - Process Log
See Also:
org.kuali.kfs.module.cab.batch.service.BatchExtractService#savePOLines(java.util.List)

addAssetLocks

protected void addAssetLocks(HashMap<String,Object> assetLockMap,
                             PurchasingAccountsPayableDocument cabPurapDoc,
                             PurApItem purapItem,
                             Integer accountsPaymentItemId,
                             HashMap<Integer,PurchaseOrderDocument> poDocMap)
Add asset lock to prohibit CAMS user modify the asset payment line.

Parameters:
assetLockMap -
cabPurapDoc -
purapItem -
itemAsset -
poDocMap -

getAssetNumbersForLocking

protected List getAssetNumbersForLocking(PurchaseOrderDocument purApdocument,
                                         PurApItem purapItem)

getCapitalAssetManagementModuleService

protected CapitalAssetManagementModuleService getCapitalAssetManagementModuleService()

createPositiveGlEntry

protected GeneralLedgerEntry createPositiveGlEntry(Entry entry)
Force created entry with zero transaction amount

Parameters:
entry -
Returns:

createNegativeGlEntry

protected GeneralLedgerEntry createNegativeGlEntry(Entry entry)
Force created entry with zero transaction amount

Parameters:
entry -
Returns:

findPurapAccountRevisions

public Collection<PurApAccountingLineBase> findPurapAccountRevisions()
Retrieves Payment Request Account History and Credit Memo account history, combines them into a single list

Specified by:
findPurapAccountRevisions in interface BatchExtractService
Returns:
Collection Purchasing Accounts Payable Account Line History
See Also:
org.kuali.kfs.module.cab.batch.service.BatchExtractService#findPurapAccountHistory()

createPurchasingAccountsPayableLineAssetAccount

protected PurchasingAccountsPayableLineAssetAccount createPurchasingAccountsPayableLineAssetAccount(GeneralLedgerEntry generalLedgerEntry,
                                                                                                    PurchasingAccountsPayableDocument cabPurapDoc,
                                                                                                    PurApAccountingLineBase purApAccountingLine,
                                                                                                    PurchasingAccountsPayableItemAsset itemAsset)
Creates a new instance of PurchasingAccountsPayableLineAssetAccount using values provided from dependent objects

Parameters:
generalLedgerEntry - General Ledger Entry record
cabPurapDoc - CAB PurAp Document
purApAccountingLine - PurAp accounting line
itemAsset - CAB PurAp Item Asset
Returns:
New PurchasingAccountsPayableLineAssetAccount

updateProcessLog

protected void updateProcessLog(ExtractProcessLog processLog,
                                ReconciliationService reconciliationService)
Updates the entries into process log

Parameters:
processLog - Extract Process Log
reconciliationService - Reconciliation Service data

findPurchasingAccountsPayableDocument

protected PurchasingAccountsPayableDocument findPurchasingAccountsPayableDocument(Entry entry)
Finds PurchasingAccountsPayableDocument using document number

Parameters:
entry - GL Entry
Returns:
PurchasingAccountsPayableDocument

createPurchasingAccountsPayableItemAsset

protected PurchasingAccountsPayableItemAsset createPurchasingAccountsPayableItemAsset(PurchasingAccountsPayableDocument cabPurapDoc,
                                                                                      PurApItem apItem)
Creates a new PurchasingAccountsPayableItemAsset using Purchasing Accounts payable item

Parameters:
cabPurapDoc - Cab Purap Document
apItem - Accounts Payable Item
Returns:
PurchasingAccountsPayableItemAsset

createPurchasingAccountsPayableDocument

protected PurchasingAccountsPayableDocument createPurchasingAccountsPayableDocument(Entry entry)
This method creates PurchasingAccountsPayableDocument from a GL Entry and AP Document

Parameters:
entry - GL Entry
apDoc - AP Document
Returns:
PurchasingAccountsPayableDocument

findMatchingPurapAssetItem

protected PurchasingAccountsPayableItemAsset findMatchingPurapAssetItem(PurchasingAccountsPayableDocument cabPurapDoc,
                                                                        PurApItem apItem)
Finds out the active CAB Asset Item matching the line from PurAP.

Parameters:
cabPurapDoc - CAB PurAp document
apItem - AP Item
Returns:
PurchasingAccountsPayableItemAsset

separatePOLines

public void separatePOLines(List<Entry> fpLines,
                            List<Entry> purapLines,
                            Collection<Entry> elgibleGLEntries)
Description copied from interface: BatchExtractService
Separates out transaction lines associated with purchase order from the rest

Specified by:
separatePOLines in interface BatchExtractService
Parameters:
fpLines - Non-purchasing lines
purapLines - Purchasing lines
elgibleGLEntries - Full list of eligible GL entries
See Also:
BatchExtractService.separatePOLines(java.util.List, java.util.List, java.util.Collection)

updateLastExtractTime

public void updateLastExtractTime(Timestamp time)
Description copied from interface: BatchExtractService
Updates the last extract time stamp system parameter, usually done when a batch process is finished successfully.

Specified by:
updateLastExtractTime in interface BatchExtractService
Parameters:
time - Last extract start time
See Also:
BatchExtractService.updateLastExtractTime(java.sql.Timestamp)

savePreTagLines

public void savePreTagLines(Collection<PurchaseOrderAccount> preTaggablePOAccounts)
Description copied from interface: BatchExtractService
Implementation will identify eligible purchase oder line items eligible for pre-tagging screen

Specified by:
savePreTagLines in interface BatchExtractService
Parameters:
preTaggablePOAccounts - List of pre-taggable account lines
See Also:
BatchExtractService.savePreTagLines(java.util.Collection)

updateLastExtractDate

public void updateLastExtractDate(Date dt)
Description copied from interface: BatchExtractService
Updates the last extract date parameter for Pre Asset Tagging Step

Specified by:
updateLastExtractDate in interface BatchExtractService
Parameters:
dt - Date value
See Also:
BatchExtractService.updateLastExtractDate(java.sql.Date)

getBusinessObjectService

public org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
Gets the businessObjectService attribute.

Returns:
Returns the businessObjectService.

setBusinessObjectService

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

Parameters:
businessObjectService - The businessObjectService to set.

getExtractDao

public ExtractDao getExtractDao()
Gets the extractDao attribute.

Returns:
Returns the extractDao.

setExtractDao

public void setExtractDao(ExtractDao extractDao)
Sets the extractDao attribute value.

Parameters:
extractDao - The extractDao to set.

getDateTimeService

public org.kuali.rice.kns.service.DateTimeService getDateTimeService()
Gets the dateTimeService attribute.

Returns:
Returns the dateTimeService.

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
Sets the dateTimeService attribute value.

Parameters:
dateTimeService - The dateTimeService to set.

getParameterService

public org.kuali.rice.kns.service.ParameterService getParameterService()
Gets the parameterService attribute.

Returns:
Returns the parameterService.

setParameterService

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

Parameters:
parameterService - The parameterService to set.

getPurchasingAccountsPayableItemAssetDao

public PurchasingAccountsPayableItemAssetDao getPurchasingAccountsPayableItemAssetDao()
Gets the purchasingAccountsPayableItemAssetDao attribute.

Returns:
Returns the purchasingAccountsPayableItemAssetDao.

setPurchasingAccountsPayableItemAssetDao

public void setPurchasingAccountsPayableItemAssetDao(PurchasingAccountsPayableItemAssetDao purchasingAccountsPayableItemAssetDao)
Sets the purchasingAccountsPayableItemAssetDao attribute value.

Parameters:
purchasingAccountsPayableItemAssetDao - The purchasingAccountsPayableItemAssetDao to set.

getPurApLineService

public PurApLineService getPurApLineService()
Gets the purApLineService attribute.

Returns:
Returns the purApLineService.

setPurApLineService

public void setPurApLineService(PurApLineService purApLineService)
Sets the purApLineService attribute value.

Parameters:
purApLineService - The purApLineService to set.

getPurApInfoService

public PurApInfoService getPurApInfoService()
Gets the purApInfoService attribute.

Returns:
Returns the purApInfoService.

setPurApInfoService

public void setPurApInfoService(PurApInfoService purApInfoService)
Sets the purApInfoService attribute value.

Parameters:
purApInfoService - The purApInfoService to set.


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