1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.earncode.group;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.joda.time.LocalDate;
20 import org.kuali.kpme.core.api.earncode.group.EarnCodeGroupDefinitionContract;
21 import org.kuali.kpme.core.earncode.EarnCode;
22 import org.kuali.kpme.core.service.HrServiceLocator;
23 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
24
25 public class EarnCodeGroupDefinition extends PersistableBusinessObjectBase implements EarnCodeGroupDefinitionContract {
26
27
28
29
30 private static final long serialVersionUID = -8463674251885306591L;
31
32 private String hrEarnCodeGroupDefId;
33
34 private String earnCode;
35
36 private String hrEarnCodeGroupId;
37
38 private EarnCode earnCodeObj;
39
40
41 private String earnCodeDesc;
42
43 public String getEarnCode() {
44 return earnCode;
45 }
46
47 public void setEarnCode(String earnCode) {
48 this.earnCode = earnCode;
49 }
50
51 public String getHrEarnCodeGroupDefId() {
52 return hrEarnCodeGroupDefId;
53 }
54
55 public void setHrEarnCodeGroupDefId(String hrEarnCodeGroupDefId) {
56 this.hrEarnCodeGroupDefId = hrEarnCodeGroupDefId;
57 }
58
59 public String getHrEarnCodeGroupId() {
60 return hrEarnCodeGroupId;
61 }
62
63 public void setHrEarnCodeGroupId(String hrEarnCodeGroupId) {
64 this.hrEarnCodeGroupId = hrEarnCodeGroupId;
65 }
66
67 public void setEarnCodeDesc(String earnCodeDesc) {
68 this.earnCodeDesc = earnCodeDesc;
69 }
70
71 public EarnCode getEarnCodeObj() {
72 return earnCodeObj;
73 }
74
75 public void setEarnCodeObj(EarnCode earnCodeObj) {
76 this.earnCodeObj = earnCodeObj;
77 }
78
79
80 public String getEarnCodeDesc() {
81 EarnCode earnCode = HrServiceLocator.getEarnCodeService().getEarnCode(this.earnCode, LocalDate.now());
82
83 if(earnCode != null && StringUtils.isNotBlank(earnCode.getDescription())) {
84 return earnCode.getDescription();
85 }
86 return "";
87 }
88 }