1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.salarygroup.web;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.kpme.core.api.salarygroup.SalaryGroup;
20 import org.kuali.kpme.core.lookup.KPMELookupableHelperServiceImpl;
21 import org.kuali.kpme.core.salarygroup.SalaryGroupBo;
22 import org.kuali.kpme.core.service.HrServiceLocator;
23 import org.kuali.kpme.core.util.TKUtils;
24 import org.kuali.rice.core.api.mo.ModelObjectUtils;
25 import org.kuali.rice.krad.bo.BusinessObject;
26
27 import java.util.List;
28 import java.util.Map;
29
30 public class SalaryGroupLookupableHelper extends KPMELookupableHelperServiceImpl {
31 private static final ModelObjectUtils.Transformer<SalaryGroup, SalaryGroupBo> toSalaryGroupBo =
32 new ModelObjectUtils.Transformer<SalaryGroup, SalaryGroupBo>() {
33 public SalaryGroupBo transform(SalaryGroup input) {
34 return SalaryGroupBo.from(input);
35 };
36 };
37
38 @Override
39 public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues) {
40 String hrSalGroup = fieldValues.get("hrSalGroup");
41 String fromEffdt = TKUtils.getFromDateString(fieldValues.get("effectiveDate"));
42 String toEffdt = TKUtils.getToDateString(fieldValues.get("effectiveDate"));
43 String active = fieldValues.get("active");
44 String showHist = fieldValues.get("history");
45 String institution = fieldValues.get("institution");
46 String location = fieldValues.get("location");
47 String leavePlan = fieldValues.get("leavePlan");
48 String benefitsEligible = fieldValues.get("benefitsEligible");
49 String leaveEligible = fieldValues.get("leaveEligible");
50 String percentTime = fieldValues.get("percentTime");
51
52 if (StringUtils.equals(hrSalGroup, "%")) {
53 hrSalGroup = "";
54 }
55
56 return ModelObjectUtils.transform(HrServiceLocator.getSalaryGroupService().getSalaryGroups(hrSalGroup, institution, location, leavePlan, TKUtils.formatDateString(fromEffdt),
57 TKUtils.formatDateString(toEffdt), active, showHist, benefitsEligible, leaveEligible, percentTime), toSalaryGroupBo);
58 }
59 }