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.timecollection.rule.service;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.kuali.hr.time.collection.rule.TimeCollectionRule;
20  import org.kuali.hr.time.timecollection.rule.dao.TimeCollectionRuleDaoService;
21  
22  import java.sql.Date;
23  import java.util.List;
24  
25  public class TimeCollectionRuleServiceImpl implements TimeCollectionRuleService{
26  	private TimeCollectionRuleDaoService timeCollectRuleDao;
27  
28      @Override
29  	public TimeCollectionRule getTimeCollectionRule(String dept, Long workArea, String payType, Date asOfDate){
30  		return timeCollectRuleDao.getTimeCollectionRule(dept, workArea, payType, asOfDate);
31  	}
32  
33      @Override
34  	public TimeCollectionRule getTimeCollectionRule(String dept, Long workArea,Date asOfDate){
35  		return timeCollectRuleDao.getTimeCollectionRule(dept, workArea, asOfDate);
36  	}
37  
38  	public TimeCollectionRuleDaoService getTimeCollectRuleDao() {
39  		return timeCollectRuleDao;
40  	}
41  
42  	public void setTimeCollectRuleDao(
43  			TimeCollectionRuleDaoService timeCollectRuleDao) {
44  		this.timeCollectRuleDao = timeCollectRuleDao;
45  	}
46  
47  	@Override
48  	public TimeCollectionRule getTimeCollectionRule(String tkTimeCollectionRuleId) {
49  		return timeCollectRuleDao.getTimeCollectionRule(tkTimeCollectionRuleId);
50  	}
51  
52      @Override
53      public List<TimeCollectionRule> getTimeCollectionRules(String dept, String workArea, String payType, String active) {
54          Long workAreaToSearch = StringUtils.isEmpty(workArea) ? null : Long.parseLong(workArea);
55          return timeCollectRuleDao.getTimeCollectionRules(dept, workAreaToSearch , payType, active, null);
56      }
57  }