1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.paygrade.web;
17
18
19 import java.util.Map;
20
21 import org.apache.commons.lang.StringUtils;
22 import org.joda.time.LocalDate;
23 import org.kuali.kpme.core.paygrade.PayGrade;
24 import org.kuali.kpme.core.service.HrServiceLocator;
25 import org.kuali.kpme.core.util.TKUtils;
26 import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
27 import org.kuali.rice.krad.bo.BusinessObject;
28
29 public class PayGradeInquirableImpl extends KualiInquirableImpl {
30
31 private static final long serialVersionUID = -4002061046745019065L;
32
33 @Override
34 public BusinessObject getBusinessObject(Map fieldValues) {
35 PayGrade payGrade = null;
36 if (StringUtils.isNotBlank((String) fieldValues.get("hrPayGradeId"))) {
37 payGrade = HrServiceLocator.getPayGradeService().getPayGrade((String) fieldValues.get("hrPayGradeId"));
38 } else if (fieldValues.containsKey("payGrade")
39 && fieldValues.containsKey("salGroup")) {
40 String pg = (String)fieldValues.get("payGrade");
41 String sg = (String)fieldValues.get("salGroup");
42 String effDate = (String) fieldValues.get("effectiveDate");
43 LocalDate effectiveDate = StringUtils.isBlank(effDate) ? LocalDate.now() : TKUtils.formatDateString(effDate);
44
45 payGrade = HrServiceLocator.getPayGradeService().getPayGrade(pg, sg, effectiveDate);
46 } else {
47 payGrade = (PayGrade) super.getBusinessObject(fieldValues);
48 }
49
50
51 return payGrade;
52 }
53
54 }