org.kuali.kfs.module.ec.batch.service.impl
Class EffortCertificationExtractServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.ec.batch.service.impl.EffortCertificationExtractServiceImpl
All Implemented Interfaces:
EffortCertificationExtractService

@Transactional
public class EffortCertificationExtractServiceImpl
extends Object
implements EffortCertificationExtractService

This is an implemeation of Effort Certification Extract process, which extracts Labor Ledger records of the employees who were paid on a grant or cost shared during the selected reporting period, and generates effort certification build/temporary document. Its major tasks include:

  • Identify employees who were paid on a grant or cost shared;
  • Select qualified Labor Ledger records for each identified employee;
  • Generate effort certification build document from the selected Labor Ledger records for each employee.

  • Constructor Summary
    EffortCertificationExtractServiceImpl()
               
     
    Method Summary
    protected  boolean checkEmployeeBasedOnLedgerBalances(String emplid, List<LaborLedgerBalance> ledgerBalances, EffortCertificationReportDefinition reportDefinition, ExtractProcessReportDataHolder reportDataHolder, Map<String,List<String>> parameters)
              check all ledger balances of the given employee and see if they can meet certain requiremnets.
    protected  List<LaborLedgerBalance> cosolidateLedgerBalances(List<LaborLedgerBalance> ledgerBalances, EffortCertificationReportDefinition reportDefinition)
              consolidate the given labor ledger balances and determine whether they are qualified for effort reporting
    protected  String existEffortCertificationDocument(Map<String,String> fieldValues)
              check if the docuemnts for the given report definition have not been generated.
     void extract()
              extract Labor Ledger records of the employees who were paid on a grant or cost shared during a reporting period.
     void extract(Integer fiscalYear, String reportNumber)
              extract Labor Ledger records of the employees who were paid on a grant or cost shared during a reporting period.
     EffortCertificationDocumentBuild extract(String emplid, EffortCertificationReportDefinition reportDefinition)
              extract Labor Ledger records of the given employee for the given report definition, and create effort certification document build.
     List<String> findEmployeesEligibleForEffortCertification(EffortCertificationReportDefinition reportDefinition)
              find the employees who were paid based on a set of specified pay type within the given report periods.
    protected  void generateDocumentBuild(EffortCertificationReportDefinition reportDefinition, List<String> employees, ExtractProcessReportDataHolder reportDataHolder, Map<String,List<String>> parameters)
              generate a document (build) as well as their detail lines for the given employees
    protected  EffortCertificationDocumentBuild generateDocumentBuildByEmployee(Integer postingYear, String emplid, List<String> positionGroupCodes, EffortCertificationReportDefinition reportDefinition, ExtractProcessReportDataHolder reportDataHolder, Map<String,List<String>> parameters)
               
    protected  List<String> getConsolidationKeys()
               
    protected  int getCountOfDetailLines(List<EffortCertificationDocumentBuild> documents)
               
    protected  List<String> getExpenseObjectTypeCodes(Integer fiscalYear)
               
    protected  List<LaborLedgerBalance> getQualifiedLedgerBalances(String emplid, List<String> positionGroupCodes, EffortCertificationReportDefinition reportDefinition, ExtractProcessReportDataHolder reportDataHolder, Map<String,List<String>> parameters)
              extract the qualified labor ledger balance records of the given employee with the given report periods.
    protected  Map<String,List<String>> getSystemParameters()
               
    protected  ExtractProcessReportDataHolder initializeReportData(EffortCertificationReportDefinition reportDefinition)
               
     boolean isEmployeeEligibleForEffortCertification(String emplid, EffortCertificationReportDefinition reportDefinition)
              determine whether the given employee is eligible for effort certification within the given report periods.
    protected  List<LaborLedgerBalance> removeUnqualifiedLedgerBalances(Collection<LaborLedgerBalance> ledgerBalances, EffortCertificationReportDefinition reportDefinition, ExtractProcessReportDataHolder reportDataHolder)
              remove the ledger balances without valid account, and nonzero total amount
    protected  void reportEmployeeWithoutValidBalances(List<LedgerBalanceWithMessage> ledgerBalancesWithMessage, Message message, String emplid)
               
    protected  void reportInvalidLedgerBalance(List<LedgerBalanceWithMessage> ledgerBalancesWithMessage, LaborLedgerBalance ledgerBalance, Message message)
               
    protected  Collection<LaborLedgerBalance> selectLedgerBalanceForEmployee(String emplid, List<String> positionObjectGroupCodes, EffortCertificationReportDefinition reportDefinition, Map<String,List<String>> parameters)
              select the labor ledger balances for the specifed employee
     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 setEffortCertificationDocumentBuildService(EffortCertificationDocumentBuildService effortCertificationDocumentBuildService)
              Sets the effortCertificationDocumentBuildService attribute value.
     void setEffortCertificationReportDefinitionService(EffortCertificationReportDefinitionService effortCertificationReportDefinitionService)
              Sets the effortCertificationReportDefinitionService attribute value.
     void setEffortCertificationReportService(EffortCertificationReportService effortCertificationReportService)
              Sets the effortCertificationReportService attribute value.
     void setKualiModuleService(org.kuali.rice.kns.service.KualiModuleService kualiModuleService)
              Sets the kualiModuleService attribute value.
     void setLaborModuleService(LaborModuleService laborModuleService)
              Sets the laborModuleService attribute value.
     void setOptionsService(OptionsService optionsService)
              Sets the optionsService attribute value.
     void setUniversityDateService(UniversityDateService universityDateService)
              Sets the universityDateService attribute value.
    protected  String validateReportDefintion(Integer fiscalYear, String reportNumber)
              check if a report has been defined.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    EffortCertificationExtractServiceImpl

    public EffortCertificationExtractServiceImpl()
    Method Detail

    extract

    public void extract()
    Description copied from interface: EffortCertificationExtractService
    extract Labor Ledger records of the employees who were paid on a grant or cost shared during a reporting period. The reporting period can be determined by both of fiscal year and report number declared as system parameters.

    Specified by:
    extract in interface EffortCertificationExtractService
    See Also:
    EffortCertificationExtractService.extract()

    extract

    public void extract(Integer fiscalYear,
                        String reportNumber)
    Description copied from interface: EffortCertificationExtractService
    extract Labor Ledger records of the employees who were paid on a grant or cost shared during a reporting period. The reporting period can be determined by both of fiscal year and report number.

    Specified by:
    extract in interface EffortCertificationExtractService
    Parameters:
    fiscalYear - the given fiscal year with which Labor ledgers can be extracted.
    reportNumber - the given report number to run.
    See Also:
    EffortCertificationExtractService.extract(java.lang.Integer, java.lang.String)

    extract

    public EffortCertificationDocumentBuild extract(String emplid,
                                                    EffortCertificationReportDefinition reportDefinition)
    Description copied from interface: EffortCertificationExtractService
    extract Labor Ledger records of the given employee for the given report definition, and create effort certification document build.

    Specified by:
    extract in interface EffortCertificationExtractService
    Parameters:
    emplid - the given employee id
    reportDefinition - the given report definition
    Returns:
    an effort certification document build generated for the given employee
    See Also:
    EffortCertificationExtractService.extract(java.lang.String, org.kuali.kfs.module.ec.businessobject.EffortCertificationReportDefinition)

    isEmployeeEligibleForEffortCertification

    public boolean isEmployeeEligibleForEffortCertification(String emplid,
                                                            EffortCertificationReportDefinition reportDefinition)
    Description copied from interface: EffortCertificationExtractService
    determine whether the given employee is eligible for effort certification within the given report periods. Here, a pay type can be determined by earn code and pay group.

    Specified by:
    isEmployeeEligibleForEffortCertification in interface EffortCertificationExtractService
    Parameters:
    emplid - the given employee id
    reportDefinition - the specified report definition
    Returns:
    true if the given employee is eligible for effort certification within the given report periods; otherwise, false
    See Also:
    org.kuali.kfs.module.ec.batch.service.EffortCertificationExtractService#isEmployeesEligibleForEffortCertification(java.lang.String, org.kuali.kfs.module.ec.businessobject.EffortCertificationReportDefinition)

    findEmployeesEligibleForEffortCertification

    public List<String> findEmployeesEligibleForEffortCertification(EffortCertificationReportDefinition reportDefinition)
    Description copied from interface: EffortCertificationExtractService
    find the employees who were paid based on a set of specified pay type within the given report periods. Here, a pay type can be determined by earn code and pay group. The employees are eligible for effort certification.

    Specified by:
    findEmployeesEligibleForEffortCertification in interface EffortCertificationExtractService
    Parameters:
    reportDefinition - the specified report definition
    Returns:
    the employees who were paid based on a set of specified pay type within the given report periods
    See Also:
    EffortCertificationExtractService.findEmployeesEligibleForEffortCertification(org.kuali.kfs.module.ec.businessobject.EffortCertificationReportDefinition)

    validateReportDefintion

    protected String validateReportDefintion(Integer fiscalYear,
                                             String reportNumber)
    check if a report has been defined. The combination of fiscal year and report number can determine a report definition.

    Parameters:
    fiscalYear - the the given fiscalYear
    reportNumber - the the given report number
    Returns:
    a message if a report has not been defined or its documents have been gerenated; otherwise, return null

    existEffortCertificationDocument

    protected String existEffortCertificationDocument(Map<String,String> fieldValues)
    check if the docuemnts for the given report definition have not been generated. The combination of fiscal year and report number can determine a report definition.

    Parameters:
    fieldValues - the map containing fiscalYear and report number
    Returns:
    a message if the documents have been gerenated; otherwise, return null

    generateDocumentBuild

    protected void generateDocumentBuild(EffortCertificationReportDefinition reportDefinition,
                                         List<String> employees,
                                         ExtractProcessReportDataHolder reportDataHolder,
                                         Map<String,List<String>> parameters)
    generate a document (build) as well as their detail lines for the given employees

    Parameters:
    reportDefinition - the given report definition
    employees - the given employees
    reportDataHolder - the holder of report data
    parameters - the given system parameters

    getQualifiedLedgerBalances

    protected List<LaborLedgerBalance> getQualifiedLedgerBalances(String emplid,
                                                                  List<String> positionGroupCodes,
                                                                  EffortCertificationReportDefinition reportDefinition,
                                                                  ExtractProcessReportDataHolder reportDataHolder,
                                                                  Map<String,List<String>> parameters)
    extract the qualified labor ledger balance records of the given employee with the given report periods.

    Parameters:
    emplid - the given employee id
    positionGroupCodes - the specified position group codes
    reportDefinition - the specified report definition
    parameters - the system paramters setup in front
    reportDataHolder - the given holder that contains any information to be written into the working report
    Returns:
    the qualified labor ledger balance records of the given employee

    removeUnqualifiedLedgerBalances

    protected List<LaborLedgerBalance> removeUnqualifiedLedgerBalances(Collection<LaborLedgerBalance> ledgerBalances,
                                                                       EffortCertificationReportDefinition reportDefinition,
                                                                       ExtractProcessReportDataHolder reportDataHolder)
    remove the ledger balances without valid account, and nonzero total amount

    Parameters:
    ledgerBalances - the given ledger balances
    reportDefinition - the given report definition
    reportDataHolder - the given holder that contains any information to be written into the working report

    checkEmployeeBasedOnLedgerBalances

    protected boolean checkEmployeeBasedOnLedgerBalances(String emplid,
                                                         List<LaborLedgerBalance> ledgerBalances,
                                                         EffortCertificationReportDefinition reportDefinition,
                                                         ExtractProcessReportDataHolder reportDataHolder,
                                                         Map<String,List<String>> parameters)
    check all ledger balances of the given employee and see if they can meet certain requiremnets. If not, the employee would be unqualified for effort reporting

    Parameters:
    emplid - the given employee id
    ledgerBalances - the all pre-qualified ledger balances of the employee
    reportDefinition - the specified report definition
    reportDataHolder - the given holder that contains any information to be written into the working report
    parameters - the system paramters setup in front
    Returns:
    true if all ledger balances as whole meet requirements; otherwise, return false

    selectLedgerBalanceForEmployee

    protected Collection<LaborLedgerBalance> selectLedgerBalanceForEmployee(String emplid,
                                                                            List<String> positionObjectGroupCodes,
                                                                            EffortCertificationReportDefinition reportDefinition,
                                                                            Map<String,List<String>> parameters)
    select the labor ledger balances for the specifed employee

    Parameters:
    emplid - the given empolyee id
    positionObjectGroupCodes - the specified position object group codes
    reportDefinition - the specified report definition
    Returns:
    the labor ledger balances for the specifed employee

    cosolidateLedgerBalances

    protected List<LaborLedgerBalance> cosolidateLedgerBalances(List<LaborLedgerBalance> ledgerBalances,
                                                                EffortCertificationReportDefinition reportDefinition)
    consolidate the given labor ledger balances and determine whether they are qualified for effort reporting

    Parameters:
    ledgerBalances - the given labor ledger balances
    reportDefinition - the specified report definition
    Returns:
    a collection of ledger balances if they are qualified; otherwise, return null

    generateDocumentBuildByEmployee

    protected EffortCertificationDocumentBuild generateDocumentBuildByEmployee(Integer postingYear,
                                                                               String emplid,
                                                                               List<String> positionGroupCodes,
                                                                               EffortCertificationReportDefinition reportDefinition,
                                                                               ExtractProcessReportDataHolder reportDataHolder,
                                                                               Map<String,List<String>> parameters)

    reportInvalidLedgerBalance

    protected void reportInvalidLedgerBalance(List<LedgerBalanceWithMessage> ledgerBalancesWithMessage,
                                              LaborLedgerBalance ledgerBalance,
                                              Message message)

    reportEmployeeWithoutValidBalances

    protected void reportEmployeeWithoutValidBalances(List<LedgerBalanceWithMessage> ledgerBalancesWithMessage,
                                                      Message message,
                                                      String emplid)

    getSystemParameters

    protected Map<String,List<String>> getSystemParameters()

    getExpenseObjectTypeCodes

    protected List<String> getExpenseObjectTypeCodes(Integer fiscalYear)

    getCountOfDetailLines

    protected int getCountOfDetailLines(List<EffortCertificationDocumentBuild> documents)

    getConsolidationKeys

    protected List<String> getConsolidationKeys()

    initializeReportData

    protected ExtractProcessReportDataHolder initializeReportData(EffortCertificationReportDefinition reportDefinition)

    setBusinessObjectService

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

    Parameters:
    businessObjectService - The businessObjectService to set.

    setOptionsService

    public void setOptionsService(OptionsService optionsService)
    Sets the optionsService attribute value.

    Parameters:
    optionsService - The optionsService to set.

    setDateTimeService

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

    Parameters:
    dateTimeService - The dateTimeService to set.

    setLaborModuleService

    public void setLaborModuleService(LaborModuleService laborModuleService)
    Sets the laborModuleService attribute value.

    Parameters:
    laborModuleService - The laborModuleService to set.

    setEffortCertificationDocumentBuildService

    public void setEffortCertificationDocumentBuildService(EffortCertificationDocumentBuildService effortCertificationDocumentBuildService)
    Sets the effortCertificationDocumentBuildService attribute value.

    Parameters:
    effortCertificationDocumentBuildService - The effortCertificationDocumentBuildService to set.

    setEffortCertificationReportService

    public void setEffortCertificationReportService(EffortCertificationReportService effortCertificationReportService)
    Sets the effortCertificationReportService attribute value.

    Parameters:
    effortCertificationReportService - The effortCertificationReportService to set.

    setUniversityDateService

    public void setUniversityDateService(UniversityDateService universityDateService)
    Sets the universityDateService attribute value.

    Parameters:
    universityDateService - The universityDateService to set.

    setEffortCertificationReportDefinitionService

    public void setEffortCertificationReportDefinitionService(EffortCertificationReportDefinitionService effortCertificationReportDefinitionService)
    Sets the effortCertificationReportDefinitionService attribute value.

    Parameters:
    effortCertificationReportDefinitionService - The effortCertificationReportDefinitionService to set.

    setKualiModuleService

    public void setKualiModuleService(org.kuali.rice.kns.service.KualiModuleService kualiModuleService)
    Sets the kualiModuleService attribute value.

    Parameters:
    kualiModuleService - The kualiModuleService to set.


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