use of edu.cornell.kfs.vnd.businessobject.VendorBatchContact in project cu-kfs by CU-CommunityApps.
the class VendorBatchServiceImpl method getVendorContacts.
/*
* convert list of vendor batch contacts to vendor contacts
*/
private List<VendorContact> getVendorContacts(List<VendorBatchContact> contacts) {
ArrayList<VendorContact> vendorContacts = new ArrayList<VendorContact>();
if (CollectionUtils.isNotEmpty(contacts)) {
for (VendorBatchContact contact : contacts) {
LOG.info("addVendor contact " + contact);
VendorContact vContact = new VendorContact();
setVendorContact(contact, vContact, new VendorContact());
vendorContacts.add(vContact);
}
}
return vendorContacts;
}
use of edu.cornell.kfs.vnd.businessobject.VendorBatchContact in project cu-kfs by CU-CommunityApps.
the class VendorBatchServiceImpl method updateVendorContacts.
/*
* update existing vendor contact or create a new one if it does not exist.
*/
private void updateVendorContacts(List<VendorBatchContact> contacts, VendorDetail oldVendorDetail, VendorDetail vDetail) {
if (CollectionUtils.isNotEmpty(contacts)) {
for (VendorBatchContact contact : contacts) {
LOG.info("updateVendor contact " + contact + TILDA_DELIMITER + contact.getVendorContactGeneratedIdentifier() + TILDA_DELIMITER + contact.getVendorContactName());
VendorContact vContact = new VendorContact();
VendorContact vOldContact = new VendorContact();
if (StringUtils.isNotBlank(contact.getVendorContactGeneratedIdentifier()) && StringUtils.isNumeric(contact.getVendorContactGeneratedIdentifier())) {
vContact = getVendorContact(vDetail, Integer.valueOf(contact.getVendorContactGeneratedIdentifier()));
vOldContact = getVendorContact(oldVendorDetail, Integer.valueOf(contact.getVendorContactGeneratedIdentifier()));
}
setVendorContact(contact, vContact, vOldContact);
if (vContact.getVendorContactGeneratedIdentifier() == null) {
vDetail.getVendorContacts().add(vContact);
oldVendorDetail.getVendorContacts().add(new VendorContact());
}
}
}
}
Aggregations