View Javadoc
1   /**
2    * Copyright 2004-2014 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.kpme.core.salarygroup.service;
17  
18  import org.joda.time.LocalDate;
19  import org.kuali.kpme.core.api.salarygroup.SalaryGroup;
20  import org.kuali.kpme.core.api.salarygroup.service.SalaryGroupService;
21  import org.kuali.kpme.core.salarygroup.SalaryGroupBo;
22  import org.kuali.kpme.core.salarygroup.dao.SalaryGroupDao;
23  import org.kuali.rice.core.api.mo.ModelObjectUtils;
24  
25  import java.util.List;
26  
27  public class SalaryGroupServiceImpl implements SalaryGroupService {
28  	
29  	private SalaryGroupDao salaryGroupDao;
30      private static final ModelObjectUtils.Transformer<SalaryGroupBo, SalaryGroup> toSalaryGroup =
31              new ModelObjectUtils.Transformer<SalaryGroupBo, SalaryGroup>() {
32                  public SalaryGroup transform(SalaryGroupBo input) {
33                      return SalaryGroupBo.to(input);
34                  };
35              };
36  	@Override
37  	public SalaryGroup getSalaryGroup(String salGroup, LocalDate asOfDate) {
38  		return SalaryGroupBo.to(salaryGroupDao.getSalaryGroup(salGroup, asOfDate));
39  	}
40  
41  	public void setSalaryGroupDao(SalaryGroupDao salaryGroupDao) {
42  		this.salaryGroupDao = salaryGroupDao;
43  	}
44  
45  	@Override
46  	public SalaryGroup getSalaryGroup(String hrSalGroupId) {
47  		return SalaryGroupBo.to(salaryGroupDao.getSalaryGroup(hrSalGroupId));
48  	}
49  	
50  	@Override
51  	public int getSalGroupCount(String salGroup) {
52  		return salaryGroupDao.getSalGroupCount(salGroup);
53  	}
54  
55      @Override
56      public List<SalaryGroup> getSalaryGroups(String salGroup, String institution, String location, String leavePlan, LocalDate fromEffdt, LocalDate toEffdt, String active, String showHist, String benefitEligible, String leaveEligible, String percentTime) {
57          return ModelObjectUtils.transform(salaryGroupDao.getSalaryGroups(salGroup, institution, location, leavePlan, fromEffdt, toEffdt, active, showHist, benefitEligible, leaveEligible, percentTime), toSalaryGroup);
58      }
59  }