use of org.kuali.kfs.fp.businessobject.DisbursementPayee in project cu-kfs by CU-CommunityApps.
the class CuACHPayeeLookupableHelperServiceImpl method getSearchResults.
/**
* Overridden to only search for employee or entity payees when principal name is specified.
*
* @see org.kuali.kfs.pdp.businessobject.lookup.ACHPayeeLookupableHelperServiceImpl#getSearchResults(java.util.Map)
*/
@SuppressWarnings({ "deprecation", "rawtypes", "unchecked" })
@Override
public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues) {
/*
* This is mostly a copy of the superclass's method, but has been tweaked to account for principal name
* and to conform to our line formatting standards.
*/
List<DisbursementPayee> searchResults = new ArrayList<DisbursementPayee>();
String payeeTypeCode = fieldValues.get(KFSPropertyConstants.PAYEE_TYPE_CODE);
if (StringUtils.isBlank(payeeTypeCode)) {
GlobalVariables.getMessageMap().putInfo(KFSPropertyConstants.PAYEE_TYPE_CODE, PdpKeyConstants.MESSAGE_PDP_ACH_PAYEE_LOOKUP_NO_PAYEE_TYPE);
}
// CU Customization: Updated "else if" to restrict results to people if principal name is given.
if (StringUtils.isNotBlank(fieldValues.get(KFSPropertyConstants.VENDOR_NUMBER)) || StringUtils.isNotBlank(fieldValues.get(KFSPropertyConstants.VENDOR_NAME)) || (StringUtils.isNotBlank(payeeTypeCode) && PdpConstants.PayeeIdTypeCodes.VENDOR_ID.equals(payeeTypeCode))) {
searchResults.addAll(this.getVendorsAsPayees(fieldValues));
} else if (StringUtils.isNotBlank(fieldValues.get(KIMPropertyConstants.Person.EMPLOYEE_ID)) || StringUtils.isNotBlank(fieldValues.get(KIMPropertyConstants.Person.ENTITY_ID)) || StringUtils.isNotBlank(fieldValues.get(KIMPropertyConstants.Person.PRINCIPAL_NAME)) || (StringUtils.isNotBlank(payeeTypeCode) && (PdpConstants.PayeeIdTypeCodes.EMPLOYEE.equals(payeeTypeCode) || PdpConstants.PayeeIdTypeCodes.ENTITY.equals(payeeTypeCode)))) {
searchResults.addAll(this.getPersonAsPayees(fieldValues));
} else {
searchResults.addAll(this.getVendorsAsPayees(fieldValues));
searchResults.addAll(this.getPersonAsPayees(fieldValues));
}
CollectionIncomplete results = new CollectionIncomplete(searchResults, Long.valueOf(searchResults.size()));
// sort list if default sort column given
List<String> defaultSortColumns = getDefaultSortColumns();
if (defaultSortColumns.size() > 0) {
Collections.sort(results, new BeanPropertyComparator(getDefaultSortColumns(), true));
}
return results;
}
Aggregations