org.kuali.kfs.module.ld.batch.service.impl
Class LaborBalancingServiceImpl

java.lang.Object
  extended by org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl<LaborEntryHistory,LaborBalanceHistory>
      extended by org.kuali.kfs.module.ld.batch.service.impl.LaborBalancingServiceImpl
All Implemented Interfaces:
BalancingService

@Transactional
public class LaborBalancingServiceImpl
extends BalancingServiceBaseImpl<LaborEntryHistory,LaborBalanceHistory>
implements BalancingService

Service implementation of BalancingService for Labor balancing


Field Summary
protected  File laborPosterErrorOutputFile
           
protected  File laborPosterInputFile
           
 
Fields inherited from class org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl
balanceHistoryPersistentClass, batchFileDirectoryName, businessObjectService, dateTimeService, entryHistoryPersistentClass, kualiConfigurationService, ledgerBalanceBalancingDao, ledgerBalanceHistoryBalancingDao, ledgerBalancingDao, ledgerEntryBalanceCachingDao, ledgerEntryBalancingDao, ledgerEntryHistoryBalancingDao, parameterService, reportWriterService, universityDateService
 
Constructor Summary
LaborBalancingServiceImpl()
           
 
Method Summary
 void clearHistories()
          Removes the data from the History tables.
 void clearPosterFileCache()
          In order to avoid file system scans this class caches poster input and poster error filenames.
protected  Integer compareBalanceHistory()
          Compares entries in the Balance and BalanceHistory tables to ensure the amounts match.
protected  Integer compareEntryHistory()
          Compares entries in the Entry and EntryHistory tables to ensure the amounts match.
protected  org.kuali.rice.kns.util.KualiDecimal convertBigDecimalToKualiDecimal(BigDecimal biggy)
           
protected  LaborBalanceHistory createBalanceFromMap(Map<String,Object> map)
           
protected  LaborEntryHistory createEntryHistoryFromMap(Map<String,Object> map)
           
 Balance getBalance(LedgerBalanceHistory ledgerBalanceHistory)
          Returns a Balance object for the parameters of the passed in LedgerBalanceHistory.
 int getComparisonFailuresToPrintPerReport()
           
 File getICRErrorOutputFile()
           
 File getICRInputFile()
           
 OriginEntryInformation getOriginEntry(String inputLine, int lineNumber)
          Gets an OriginEntryInformation for the parsed line.
 int getPastFiscalYearsToConsider()
           
 File getPosterErrorOutputFile()
           
 File getPosterInputFile()
           
 File getReversalErrorOutputFile()
           
 File getReversalInputFile()
           
 String getShortTableLabel(String businessObjectName)
           
 void updateBalanceHistory(Integer postMode, OriginEntryInformation originEntry)
          Updates the balance history table
 void updateEntryHistory(Integer postMode, OriginEntryInformation originEntry)
          Update the entry history table
protected  int updateHistoriesHelper(Integer postMode, Integer startUniversityFiscalYear, File inputFile, File errorFile)
          This is a helper method that wraps parsing poster entries for updateEntryHistory and updateBalanceHistory.
 
Methods inherited from class org.kuali.kfs.gl.batch.service.impl.BalancingServiceBaseImpl
customCompareHistory, customPopulateHistoryTables, customPrintRowCountHistory, deleteCustomHistory, deleteHistory, doesCustomHistoryExist, getHistoryCount, isFilesReady, runBalancing, setBatchFileDirectoryName, setBusinessObjectService, setDateTimeService, setKualiConfigurationService, setLedgerBalanceBalancingDao, setLedgerBalanceHistoryBalancingDao, setLedgerBalancingDao, setLedgerEntryBalanceCachingDao, setLedgerEntryBalancingDao, setLedgerEntryHistoryBalancingDao, setParameterService, setReportWriterService, setUniversityDateService, updateCustomHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.kfs.gl.batch.service.BalancingService
runBalancing
 

Field Detail

laborPosterInputFile

protected File laborPosterInputFile

laborPosterErrorOutputFile

protected File laborPosterErrorOutputFile
Constructor Detail

LaborBalancingServiceImpl

public LaborBalancingServiceImpl()
Method Detail

getPosterInputFile

public File getPosterInputFile()
Specified by:
getPosterInputFile in interface BalancingService
Returns:
input poster file. Returns null if no file found.
See Also:
BalancingService.getPosterInputFile()

getPosterErrorOutputFile

public File getPosterErrorOutputFile()
Specified by:
getPosterErrorOutputFile in interface BalancingService
Returns:
output poster error file. Returns null if no file found.
See Also:
BalancingService.getPosterErrorOutputFile()

getPastFiscalYearsToConsider

public int getPastFiscalYearsToConsider()
Specified by:
getPastFiscalYearsToConsider in interface BalancingService
Returns:
system parameter for NUMBER_OF_PAST_FISCAL_YEARS_TO_CONSIDER
See Also:
BalancingService.getPastFiscalYearsToConsider()

getComparisonFailuresToPrintPerReport

public int getComparisonFailuresToPrintPerReport()
Specified by:
getComparisonFailuresToPrintPerReport in interface BalancingService
Returns:
system parameter for NUMBER_OF_COMPARISON_FAILURES_TO_PRINT_PER_REPORT
See Also:
BalancingService.getComparisonFailuresToPrintPerReport()

getShortTableLabel

public String getShortTableLabel(String businessObjectName)
Specified by:
getShortTableLabel in interface BalancingService
Parameters:
businessObjectName - name of the BO for which to return the label
Returns:
functional short labels for tables affected in this process
See Also:
BalancingService.getShortTableLabel(java.lang.String)

getOriginEntry

public OriginEntryInformation getOriginEntry(String inputLine,
                                             int lineNumber)
Description copied from interface: BalancingService
Gets an OriginEntryInformation for the parsed line. This needs to be handled separately for GL and Labor because Labor is a special case of GL (positionNumber + emplid). Could be done with an OriginEntryHistory interface but in the interest of not mucking with OriginEntries the is done with delegation.

Specified by:
getOriginEntry in interface BalancingService
Parameters:
inputLine - line that was read from getPosterInputFilename
lineNumber - line number we are currently reading from getPosterInputFilename
Returns:
parsed line into an object as per inputLine parameter
See Also:
BalancingService.getOriginEntry(java.lang.String, int)

updateHistoriesHelper

protected int updateHistoriesHelper(Integer postMode,
                                    Integer startUniversityFiscalYear,
                                    File inputFile,
                                    File errorFile)
Description copied from class: BalancingServiceBaseImpl
This is a helper method that wraps parsing poster entries for updateEntryHistory and updateBalanceHistory.

Overrides:
updateHistoriesHelper in class BalancingServiceBaseImpl<LaborEntryHistory,LaborBalanceHistory>
startUniversityFiscalYear - fiscal year for which to accept the earlier parsed lines from the input file
Returns:
indicated whether records where ignored due to being older then startUniversityFiscalYear
See Also:
BalancingServiceBaseImpl.updateHistoriesHelper(java.lang.Integer, java.lang.Integer, java.io.File, java.io.File)

updateEntryHistory

public void updateEntryHistory(Integer postMode,
                               OriginEntryInformation originEntry)
Description copied from interface: BalancingService
Update the entry history table

Specified by:
updateEntryHistory in interface BalancingService
originEntry - representing the update details
See Also:
org.kuali.kfs.gl.batch.service.BalancingService#updateEntryHistory(org.kuali.kfs.gl.businessobject.OriginEntryInformation), org.kuali.kfs.module.ld.batch.service.impl.LaborPosterServiceImpl#postAsLedgerEntry(org.kuali.kfs.gl.businessobject.Transaction, int, java.util.Date)

updateBalanceHistory

public void updateBalanceHistory(Integer postMode,
                                 OriginEntryInformation originEntry)
Description copied from interface: BalancingService
Updates the balance history table

Specified by:
updateBalanceHistory in interface BalancingService
originEntry - representing the update details
See Also:
org.kuali.kfs.gl.batch.service.BalancingService#updateBalanceHistory(org.kuali.kfs.gl.businessobject.OriginEntryInformation), org.kuali.kfs.module.ld.batch.service.impl.LaborPosterServiceImpl#updateLedgerBalance(org.kuali.kfs.gl.businessobject.Transaction, int, java.util.Date)

compareBalanceHistory

protected Integer compareBalanceHistory()
Compares entries in the Balance and BalanceHistory tables to ensure the amounts match.

Specified by:
compareBalanceHistory in class BalancingServiceBaseImpl<LaborEntryHistory,LaborBalanceHistory>
Returns:
count is compare failures

compareEntryHistory

protected Integer compareEntryHistory()
Compares entries in the Entry and EntryHistory tables to ensure the amounts match.

Specified by:
compareEntryHistory in class BalancingServiceBaseImpl<LaborEntryHistory,LaborBalanceHistory>
Returns:
count is compare failures

clearHistories

public void clearHistories()
Description copied from interface: BalancingService
Removes the data from the History tables.

Specified by:
clearHistories in interface BalancingService
See Also:
org.kuali.kfs.gl.batch.service.BalancingService#clearBalanceHistory()

getBalance

public Balance getBalance(LedgerBalanceHistory ledgerBalanceHistory)
Description copied from interface: BalancingService
Returns a Balance object for the parameters of the passed in LedgerBalanceHistory. Necessary for generic amount comparision since it may be either labor or gl.

Specified by:
getBalance in interface BalancingService
Parameters:
ledgerBalanceHistory - to retrieve the Balance object for
Returns:
balance object adhereing to the Balance interface
See Also:
BalancingService.getBalance(org.kuali.kfs.gl.businessobject.LedgerBalanceHistory)

clearPosterFileCache

public void clearPosterFileCache()
Description copied from interface: BalancingService
In order to avoid file system scans this class caches poster input and poster error filenames. In rare cases they may want to be reset.

Specified by:
clearPosterFileCache in interface BalancingService
See Also:
BalancingService.clearPosterFileCache()

createBalanceFromMap

protected LaborBalanceHistory createBalanceFromMap(Map<String,Object> map)

createEntryHistoryFromMap

protected LaborEntryHistory createEntryHistoryFromMap(Map<String,Object> map)

convertBigDecimalToKualiDecimal

protected org.kuali.rice.kns.util.KualiDecimal convertBigDecimalToKualiDecimal(BigDecimal biggy)

getReversalInputFile

public File getReversalInputFile()
Specified by:
getReversalInputFile in interface BalancingService
Returns:
input reversal file. Returns null if no file found.
See Also:
BalancingService.getReversalInputFile()

getReversalErrorOutputFile

public File getReversalErrorOutputFile()
Specified by:
getReversalErrorOutputFile in interface BalancingService
Returns:
output reversal error file. Returns null if no file found.
See Also:
BalancingService.getReversalErrorOutputFile()

getICRInputFile

public File getICRInputFile()
Specified by:
getICRInputFile in interface BalancingService
Returns:
input ICR file. Returns null if no file found.
See Also:
BalancingService.getICRInputFile()

getICRErrorOutputFile

public File getICRErrorOutputFile()
Specified by:
getICRErrorOutputFile in interface BalancingService
Returns:
output ICR error file. Returns null if no file found.
See Also:
BalancingService.getICRErrorOutputFile()


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