Search in sources :

Example 1 with VendorBatchPhoneNumber

use of edu.cornell.kfs.vnd.businessobject.VendorBatchPhoneNumber in project cu-kfs by CU-CommunityApps.

the class VendorBatchServiceImpl method updateVendorPhoneNumbers.

/*
     * update existing vendor phone number or create a new one if it does not exist.
     */
private void updateVendorPhoneNumbers(List<VendorBatchPhoneNumber> phoneNumbers, VendorDetail vendor, VendorDetail vDetail) {
    if (CollectionUtils.isNotEmpty(phoneNumbers)) {
        for (VendorBatchPhoneNumber phoneNumber : phoneNumbers) {
            LOG.info("updateVendor phoneNumber " + phoneNumber + TILDA_DELIMITER + phoneNumber.getVendorPhoneGeneratedIdentifier() + TILDA_DELIMITER + phoneNumber.getVendorPhoneTypeCode());
            VendorPhoneNumber vPhoneNumber = new VendorPhoneNumber();
            if (StringUtils.isNotBlank(phoneNumber.getVendorPhoneGeneratedIdentifier())) {
                vPhoneNumber = getVendorPhoneNumber(vDetail, Integer.valueOf(phoneNumber.getVendorPhoneGeneratedIdentifier()));
            }
            setVendorPhoneNumber(phoneNumber, vPhoneNumber);
            if (vPhoneNumber.getVendorPhoneGeneratedIdentifier() == null) {
                vDetail.getVendorPhoneNumbers().add(vPhoneNumber);
                vendor.getVendorPhoneNumbers().add(new VendorPhoneNumber());
            }
        // TODO : what to do with those existing contacts, but not passed from request
        }
    }
}
Also used : VendorBatchPhoneNumber(edu.cornell.kfs.vnd.businessobject.VendorBatchPhoneNumber) VendorPhoneNumber(org.kuali.kfs.vnd.businessobject.VendorPhoneNumber)

Example 2 with VendorBatchPhoneNumber

use of edu.cornell.kfs.vnd.businessobject.VendorBatchPhoneNumber in project cu-kfs by CU-CommunityApps.

the class VendorBatchServiceImpl method getVendorPhoneNumbers.

/*
	 * populate list of vendor batch phone numbers to vendor phone numbers
	 */
private List<VendorPhoneNumber> getVendorPhoneNumbers(List<VendorBatchPhoneNumber> phoneNumbers) {
    List<VendorPhoneNumber> vendorPhoneNumbers = new ArrayList<VendorPhoneNumber>();
    if (CollectionUtils.isNotEmpty(phoneNumbers)) {
        for (VendorBatchPhoneNumber phoneNumber : phoneNumbers) {
            LOG.info("addVendor phoneNumber " + phoneNumber);
            VendorPhoneNumber vPhoneNumber = new VendorPhoneNumber();
            setVendorPhoneNumber(phoneNumber, vPhoneNumber);
            vendorPhoneNumbers.add(vPhoneNumber);
        }
    }
    return vendorPhoneNumbers;
}
Also used : VendorBatchPhoneNumber(edu.cornell.kfs.vnd.businessobject.VendorBatchPhoneNumber) ArrayList(java.util.ArrayList) VendorPhoneNumber(org.kuali.kfs.vnd.businessobject.VendorPhoneNumber)

Aggregations

VendorBatchPhoneNumber (edu.cornell.kfs.vnd.businessobject.VendorBatchPhoneNumber)2 VendorPhoneNumber (org.kuali.kfs.vnd.businessobject.VendorPhoneNumber)2 ArrayList (java.util.ArrayList)1