View Javadoc

1   /**
2    * Copyright 2004-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.hr.time.principal.service;
17  
18  import org.kuali.hr.time.principal.PrincipalHRAttributes;
19  import org.kuali.hr.time.principal.dao.PrincipalHRAttributesDao;
20  import org.kuali.hr.time.service.base.TkServiceLocator;
21  
22  import java.util.Date;
23  import java.util.List;
24  
25  public class PrincipalHRAttributesServiceImpl implements PrincipalHRAttributesService {
26  	private PrincipalHRAttributesDao principalHRAttributesDao;
27  
28  	public void setPrincipalHRAttributesDao(PrincipalHRAttributesDao principalHRAttributesDao) {
29  		this.principalHRAttributesDao = principalHRAttributesDao;
30  	}
31  	
32  	public PrincipalHRAttributes getPrincipalCalendar(String principalId, Date asOfDate){
33  		PrincipalHRAttributes pc =  this.principalHRAttributesDao.getPrincipalCalendar(principalId, asOfDate);
34  		if(pc != null) {
35  			pc.setCalendar(TkServiceLocator.getCalendarService().getCalendarByGroup(pc.getPayCalendar()));
36  			pc.setLeaveCalObj(TkServiceLocator.getCalendarService().getCalendarByGroup(pc.getLeaveCalendar()));
37  		}
38  		return pc;
39  	}
40  	
41      public List<PrincipalHRAttributes> getActiveEmployeesForPayCalendar(String payCalendarName, Date asOfDate) {
42      	return principalHRAttributesDao.getActiveEmployeesForPayCalendar(payCalendarName, asOfDate);
43      }
44      
45      public List<PrincipalHRAttributes> getActiveEmployeesForLeaveCalendar(String leaveCalendarName, Date asOfDate) {
46      	return principalHRAttributesDao.getActiveEmployeesForLeaveCalendar(leaveCalendarName, asOfDate);
47      }
48  	
49      public List<String> getActiveEmployeesIdForLeaveCalendarAndIdList(String leaveCalendarName, List<String> pidList, Date asOfDate) {
50      	return principalHRAttributesDao.getActiveEmployeesIdForLeaveCalendarAndIdList(leaveCalendarName, pidList, asOfDate);
51      }
52      
53      public List<String> getActiveEmployeesIdForTimeCalendarAndIdList(String timeCalendarName, List<String> pidList, Date asOfDate) {
54      	return principalHRAttributesDao.getActiveEmployeesIdForTimeCalendarAndIdList(timeCalendarName, pidList, asOfDate);
55      }
56      
57  	/**
58       * KPME-1250 Kagata
59       * Get a list of active employees based on leave plan and as of a particular date
60       */
61      @Override
62      public List<PrincipalHRAttributes> getActiveEmployeesForLeavePlan(String leavePlan, Date asOfDate) {
63          List<PrincipalHRAttributes> principals = principalHRAttributesDao.getActiveEmployeesForLeavePlan(leavePlan, asOfDate);
64  
65          return principals;
66      }
67      
68  //    @Override
69  //	public PrincipalHRAttributes getPrincipalHRAttributes(String principalId) {
70  //		return this.principalHRAttributesDao.getPrincipalHRAttributes(principalId);
71  //	}
72      
73      @Override
74      public PrincipalHRAttributes getInactivePrincipalHRAttributes(String principalId, Date asOfDate) {
75      	return this.principalHRAttributesDao.getInactivePrincipalHRAttributes(principalId, asOfDate);
76      }
77      
78      @Override
79      public PrincipalHRAttributes getPrincipalHRAttributes(String hrPrincipalAttributeId) {
80      	return this.principalHRAttributesDao.getPrincipalHRAttributes(hrPrincipalAttributeId);
81      }
82      
83      @Override
84      public List<PrincipalHRAttributes> getAllActivePrincipalHrAttributesForPrincipalId(String principalId, Date asOfDate) {
85      	return this.principalHRAttributesDao.getAllActivePrincipalHrAttributesForPrincipalId(principalId, asOfDate);
86      }
87      @Override
88      public PrincipalHRAttributes getMaxTimeStampPrincipalHRAttributes(String principalId) {
89      	return principalHRAttributesDao.getMaxTimeStampPrincipalHRAttributes(principalId);
90      }
91      
92      @Override
93      public List<PrincipalHRAttributes> getAllInActivePrincipalHrAttributesForPrincipalId(String principalId, Date asOfDate) {
94      	return this.principalHRAttributesDao.getAllInActivePrincipalHrAttributesForPrincipalId(principalId, asOfDate);
95      }
96      @Override
97      public List<PrincipalHRAttributes> getActivePrincipalHrAttributesForRange(String principalId, Date startDate, Date endDate) {
98      	return this.principalHRAttributesDao.getActivePrincipalHrAttributesForRange(principalId, startDate, endDate);
99      }
100     @Override
101     public List<PrincipalHRAttributes> getInactivePrincipalHRAttributesForRange(String principalId, Date startDate, Date endDate) {
102     	return this.principalHRAttributesDao.getInactivePrincipalHRAttributesForRange(principalId, startDate, endDate);
103     }
104     @Override
105     public List<PrincipalHRAttributes> getPrincipalHrAtributes(String principalId,
106                                                                String leavePlan, java.sql.Date fromEffdt, java.sql.Date toEffdt, String active, String showHistory) {
107     	return this.principalHRAttributesDao.getPrincipalHrAtributes(principalId, leavePlan, fromEffdt, toEffdt, active, showHistory);
108     }
109     @Override
110     public List<String> getUniqueTimePayGroups() {
111     	return this.principalHRAttributesDao.getUniqueTimePayGroups();
112     }
113 }