001 /* 002 * Copyright 2011 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.kfs.module.ec.businessobject; 017 018 import java.util.ArrayList; 019 import java.util.HashMap; 020 import java.util.LinkedHashMap; 021 import java.util.Map; 022 023 import org.kuali.kfs.module.ec.EffortPropertyConstants; 024 import org.kuali.kfs.sys.KFSPropertyConstants; 025 import org.kuali.kfs.sys.businessobject.SystemOptions; 026 import org.kuali.kfs.sys.context.SpringContext; 027 import org.kuali.rice.kns.bo.TransientBusinessObjectBase; 028 import org.kuali.rice.kim.bo.Person; 029 import org.kuali.rice.kim.service.PersonService; 030 031 public class DuplicateCertificationsReport extends TransientBusinessObjectBase { 032 033 private Integer universityFiscalYear; 034 private String effortCertificationReportNumber; 035 private String emplid; 036 037 private Person employee; 038 private SystemOptions options; 039 private EffortCertificationReportDefinition effortCertificationReportDefinition; 040 041 /** 042 * Gets effortCertificationReportNumber 043 * 044 * @return 045 */ 046 public String getEffortCertificationReportNumber() { 047 return effortCertificationReportNumber; 048 } 049 050 /** 051 * Sets effortCertificationReportNumber 052 * 053 * @param effortCertificationReportNumber 054 */ 055 public void setEffortCertificationReportNumber(String effortCertificationReportNumber) { 056 this.effortCertificationReportNumber = effortCertificationReportNumber; 057 } 058 059 /** 060 * Gets universityFiscalYear 061 * 062 * @return 063 */ 064 public Integer getUniversityFiscalYear() { 065 return universityFiscalYear; 066 } 067 068 /** 069 * Sets universityFiscalYear 070 * 071 * @param universityFiscalYear 072 */ 073 public void setUniversityFiscalYear(Integer universityFiscalYear) { 074 this.universityFiscalYear = universityFiscalYear; 075 } 076 077 /** 078 * Returns the employee's id 079 * 080 * @return 081 */ 082 public String getEmplid() { 083 return emplid; 084 } 085 086 /** 087 * sets emplid 088 * 089 * @param emplid 090 */ 091 public void setEmplid(String emplid) { 092 this.emplid = emplid; 093 } 094 095 @Override 096 protected LinkedHashMap toStringMapper() { 097 LinkedHashMap m = new LinkedHashMap(); 098 m.put(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, this.universityFiscalYear); 099 m.put(EffortPropertyConstants.EFFORT_CERTIFICATION_REPORT_NUMBER, this.effortCertificationReportNumber); 100 m.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, this.emplid); 101 102 return m; 103 } 104 105 /** 106 * Gets the employee attribute. 107 * 108 * @return Returns the employee. 109 */ 110 public Person getEmployee() { 111 Map<String, Object> searchCriteria = new HashMap<String, Object>(); 112 searchCriteria.put(KFSPropertyConstants.PERSON_PAYROLL_IDENTIFIER, getEmplid()); 113 114 return new ArrayList<Person>(SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).findPeople(searchCriteria)).get(0); 115 } 116 117 /** 118 * Sets the employee attribute value. 119 * 120 * @param employee The employee to set. 121 */ 122 public void setEmployee(Person employee) { 123 this.employee = employee; 124 } 125 126 /** 127 * Gets the options attribute. 128 * 129 * @return Returns the options. 130 */ 131 public SystemOptions getOptions() { 132 return options; 133 } 134 135 /** 136 * Sets the options attribute value. 137 * 138 * @param options The options to set. 139 */ 140 public void setOptions(SystemOptions options) { 141 this.options = options; 142 } 143 144 /** 145 * Gets the effort certification report definition 146 * 147 * @return 148 */ 149 public EffortCertificationReportDefinition getEffortCertificationReportDefinition() { 150 return effortCertificationReportDefinition; 151 } 152 153 /** 154 * Sets effort certification report definition 155 * 156 * @param effortCertificationReportDefinition 157 */ 158 public void setEffortCertificationReportDefinition(EffortCertificationReportDefinition effortCertificationReportDefinition) { 159 this.effortCertificationReportDefinition = effortCertificationReportDefinition; 160 } 161 } 162