org.kuali.hr.time.approval.service
Class TimeApproveServiceImpl

java.lang.Object
  extended by org.kuali.hr.time.approval.service.TimeApproveServiceImpl
All Implemented Interfaces:
TimeApproveService

public class TimeApproveServiceImpl
extends Object
implements TimeApproveService


Field Summary
static int DAYS_WINDOW_DELTA
           
 
Constructor Summary
TimeApproveServiceImpl()
           
 
Method Summary
 boolean doesApproverHavePrincipalsForCalendarGroup(Date asOfDate, String calGroup)
           
 List<CalendarEntries> getAllPayCalendarEntriesForApprover(String principalId, Date currentDate)
           
 List<ApprovalTimeSummaryRow> getApprovalSummaryRows(Date payBeginDate, Date payEndDate, String calGroup, List<TKPerson> persons, List<String> payCalendarLabels, CalendarEntries payCalendarEntries)
          Obtains a Map of Lists of ApprovalTimeSummaryRows.
 SortedSet<String> getApproverPayCalendarGroups(Date payBeginDate, Date payEndDate)
          Method to obtain all of the active Pay Calendar Group names for the current user / approver.
 com.google.common.collect.Multimap<String,Long> getDeptWorkAreasByDepts(Set<String> userDepts)
          Method to create a map of the depts and their associated work areas based on the given depts.
 com.google.common.collect.Multimap<String,Long> getDeptWorkAreasByWorkAreas(Set<Long> approverWorkAreas)
          Method to create a map of the depts and their associated work areas based on the given approver work areas.
 List<TimesheetDocumentHeader> getDocumentHeadersByPrincipalIds(Date payBeginDate, Date payEndDate, List<String> principalIds)
           
 List<Map<String,Map<String,BigDecimal>>> getHoursByDayAssignmentBuckets(TkTimeBlockAggregate aggregate, List<Assignment> approverAssignments, List<String> payCalendarLabels)
           
 Map<String,BigDecimal> getHoursToFlsaWeekMap(String principalId, Date payEndDate, List<String> payCalendarLabels, List<TimeBlock> lstTimeBlocks, Long workArea, CalendarEntries payCalendarEntries, Calendar payCalendar, org.joda.time.DateTimeZone dateTimeZone, List<org.joda.time.Interval> dayIntervals)
          Aggregate TimeBlocks to hours per day and sum for flsa week (including previous/next weeks)
 Map<String,BigDecimal> getHoursToPayDayMap(String principalId, Date payEndDate, List<String> payCalendarLabels, List<TimeBlock> lstTimeBlocks, Long workArea, CalendarEntries payCalendarEntries, Calendar payCalendar, org.joda.time.DateTimeZone dateTimeZone, List<org.joda.time.Interval> dayIntervals)
          Aggregate TimeBlocks to hours per day and sum for week
 List getNotesForDocument(String documentNumber)
          Used to determine if there are notes on a document
 Map<String,CalendarEntries> getPayCalendarEntriesForApprover(String principalId, Date currentDate, String dept)
          Method to provide a mapping of PayCalendarGroupNames to PayCalendarEntries to allow for various starting points in Approval Tab Navigation.
 Map<String,CalendarEntries> getPayCalendarEntriesForDept(String dept, Date currentDate)
           
 List<String> getPayCalendarLabelsForApprovalTab(Date payBeginDate, Date payEndDate)
          Get pay calendar labels for approval tab
 Map<String,TimesheetDocumentHeader> getPrincipalDocumehtHeader(List<TKPerson> persons, Date payBeginDate, Date payEndDate)
          Method to create a map that contains the principal's id and corresponding timesheet document header.
 List<String> getPrincipalIdsByDeptWorkAreaRolename(String roleName, String department, String workArea, Date payBeginDate, Date payEndDate, String calGroup)
          Method to get a list of principal ids based on the department work areas.
protected  List<String> getPrincipalIdsWithActiveAssignmentsForCalendarGroupByDeptAndWorkArea(String roleName, String department, String workArea, String payCalendarGroup, Date effdt, Date beginDate, Date endDate)
           
 org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue getRouteHeader(String documentId)
           
 List<String> getUniquePayGroups()
          Get a list of unique pay groups
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAYS_WINDOW_DELTA

public static final int DAYS_WINDOW_DELTA
See Also:
Constant Field Values
Constructor Detail

TimeApproveServiceImpl

public TimeApproveServiceImpl()
Method Detail

getPayCalendarEntriesForDept

public Map<String,CalendarEntries> getPayCalendarEntriesForDept(String dept,
                                                                Date currentDate)
Specified by:
getPayCalendarEntriesForDept in interface TimeApproveService

getPayCalendarEntriesForApprover

public Map<String,CalendarEntries> getPayCalendarEntriesForApprover(String principalId,
                                                                    Date currentDate,
                                                                    String dept)
Description copied from interface: TimeApproveService
Method to provide a mapping of PayCalendarGroupNames to PayCalendarEntries to allow for various starting points in Approval Tab Navigation.

Specified by:
getPayCalendarEntriesForApprover in interface TimeApproveService
currentDate - The current date. This method will search for active assignments for this approver active as of this date, and 31 days prior to pull back PayCalendarEntries.
Returns:
A CalendarGroup Name to PayCalendarEntries mapping.

getApproverPayCalendarGroups

public SortedSet<String> getApproverPayCalendarGroups(Date payBeginDate,
                                                      Date payEndDate)
Description copied from interface: TimeApproveService
Method to obtain all of the active Pay Calendar Group names for the current user / approver. We used SortedSet here since we only want unique values while keeping the order. Besides, we also need to get the first value as the default pay calendar group in some cases. There is not get() method in the Set interface.

Specified by:
getApproverPayCalendarGroups in interface TimeApproveService
Returns:

getApprovalSummaryRows

public List<ApprovalTimeSummaryRow> getApprovalSummaryRows(Date payBeginDate,
                                                           Date payEndDate,
                                                           String calGroup,
                                                           List<TKPerson> persons,
                                                           List<String> payCalendarLabels,
                                                           CalendarEntries payCalendarEntries)
Description copied from interface: TimeApproveService
Obtains a Map of Lists of ApprovalTimeSummaryRows. The Key to the map is the PayCalendar Group name.

Specified by:
getApprovalSummaryRows in interface TimeApproveService
calGroup - Specify a calendar group to filter by.
Returns:
A Map> container.

getDocumentHeadersByPrincipalIds

public List<TimesheetDocumentHeader> getDocumentHeadersByPrincipalIds(Date payBeginDate,
                                                                      Date payEndDate,
                                                                      List<String> principalIds)

getPayCalendarLabelsForApprovalTab

public List<String> getPayCalendarLabelsForApprovalTab(Date payBeginDate,
                                                       Date payEndDate)
Get pay calendar labels for approval tab

Specified by:
getPayCalendarLabelsForApprovalTab in interface TimeApproveService

getHoursByDayAssignmentBuckets

public List<Map<String,Map<String,BigDecimal>>> getHoursByDayAssignmentBuckets(TkTimeBlockAggregate aggregate,
                                                                               List<Assignment> approverAssignments,
                                                                               List<String> payCalendarLabels)

getHoursToPayDayMap

public Map<String,BigDecimal> getHoursToPayDayMap(String principalId,
                                                  Date payEndDate,
                                                  List<String> payCalendarLabels,
                                                  List<TimeBlock> lstTimeBlocks,
                                                  Long workArea,
                                                  CalendarEntries payCalendarEntries,
                                                  Calendar payCalendar,
                                                  org.joda.time.DateTimeZone dateTimeZone,
                                                  List<org.joda.time.Interval> dayIntervals)
Aggregate TimeBlocks to hours per day and sum for week

Specified by:
getHoursToPayDayMap in interface TimeApproveService

getHoursToFlsaWeekMap

public Map<String,BigDecimal> getHoursToFlsaWeekMap(String principalId,
                                                    Date payEndDate,
                                                    List<String> payCalendarLabels,
                                                    List<TimeBlock> lstTimeBlocks,
                                                    Long workArea,
                                                    CalendarEntries payCalendarEntries,
                                                    Calendar payCalendar,
                                                    org.joda.time.DateTimeZone dateTimeZone,
                                                    List<org.joda.time.Interval> dayIntervals)
Aggregate TimeBlocks to hours per day and sum for flsa week (including previous/next weeks)

Specified by:
getHoursToFlsaWeekMap in interface TimeApproveService

doesApproverHavePrincipalsForCalendarGroup

public boolean doesApproverHavePrincipalsForCalendarGroup(Date asOfDate,
                                                          String calGroup)
Specified by:
doesApproverHavePrincipalsForCalendarGroup in interface TimeApproveService

getNotesForDocument

public List getNotesForDocument(String documentNumber)
Description copied from interface: TimeApproveService
Used to determine if there are notes on a document

Specified by:
getNotesForDocument in interface TimeApproveService
Returns:
list of note objects

getUniquePayGroups

public List<String> getUniquePayGroups()
Description copied from interface: TimeApproveService
Get a list of unique pay groups

Specified by:
getUniquePayGroups in interface TimeApproveService
Returns:

getPrincipalIdsByDeptWorkAreaRolename

public List<String> getPrincipalIdsByDeptWorkAreaRolename(String roleName,
                                                          String department,
                                                          String workArea,
                                                          Date payBeginDate,
                                                          Date payEndDate,
                                                          String calGroup)
Description copied from interface: TimeApproveService
Method to get a list of principal ids based on the department work areas.

Specified by:
getPrincipalIdsByDeptWorkAreaRolename in interface TimeApproveService
Returns:
A list of the PrincipalIds

getPrincipalIdsWithActiveAssignmentsForCalendarGroupByDeptAndWorkArea

protected List<String> getPrincipalIdsWithActiveAssignmentsForCalendarGroupByDeptAndWorkArea(String roleName,
                                                                                             String department,
                                                                                             String workArea,
                                                                                             String payCalendarGroup,
                                                                                             Date effdt,
                                                                                             Date beginDate,
                                                                                             Date endDate)

getPrincipalDocumehtHeader

public Map<String,TimesheetDocumentHeader> getPrincipalDocumehtHeader(List<TKPerson> persons,
                                                                      Date payBeginDate,
                                                                      Date payEndDate)
Description copied from interface: TimeApproveService
Method to create a map that contains the principal's id and corresponding timesheet document header.

Specified by:
getPrincipalDocumehtHeader in interface TimeApproveService
Returns:
A PrincipalId to TimesheetDocumentHeader mapping.

getDeptWorkAreasByWorkAreas

public com.google.common.collect.Multimap<String,Long> getDeptWorkAreasByWorkAreas(Set<Long> approverWorkAreas)
Description copied from interface: TimeApproveService
Method to create a map of the depts and their associated work areas based on the given approver work areas.

Specified by:
getDeptWorkAreasByWorkAreas in interface TimeApproveService
Returns:
A Dept and Work Areas mapping.

getDeptWorkAreasByDepts

public com.google.common.collect.Multimap<String,Long> getDeptWorkAreasByDepts(Set<String> userDepts)
Description copied from interface: TimeApproveService
Method to create a map of the depts and their associated work areas based on the given depts.

Specified by:
getDeptWorkAreasByDepts in interface TimeApproveService
Returns:
A Dept and Work Areas mapping.

getRouteHeader

public org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue getRouteHeader(String documentId)
Specified by:
getRouteHeader in interface TimeApproveService

getAllPayCalendarEntriesForApprover

public List<CalendarEntries> getAllPayCalendarEntriesForApprover(String principalId,
                                                                 Date currentDate)
Specified by:
getAllPayCalendarEntriesForApprover in interface TimeApproveService


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.