Search in sources :

Example 1 with VendorBatchContact

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;
}
Also used : VendorBatchContact(edu.cornell.kfs.vnd.businessobject.VendorBatchContact) ArrayList(java.util.ArrayList) VendorContact(org.kuali.kfs.vnd.businessobject.VendorContact)

Example 2 with VendorBatchContact

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());
            }
        }
    }
}
Also used : VendorBatchContact(edu.cornell.kfs.vnd.businessobject.VendorBatchContact) VendorContact(org.kuali.kfs.vnd.businessobject.VendorContact)

Aggregations

VendorBatchContact (edu.cornell.kfs.vnd.businessobject.VendorBatchContact)2 VendorContact (org.kuali.kfs.vnd.businessobject.VendorContact)2 ArrayList (java.util.ArrayList)1