Search in sources :

Example 1 with VendorBatchAddress

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

the class VendorBatchServiceImpl method updateVendorAddresses.

/*
     * update existing vendor address or create a new one if it does not exist.
     */
private void updateVendorAddresses(List<VendorBatchAddress> addresses, VendorDetail vendor, VendorDetail vDetail) {
    if (CollectionUtils.isNotEmpty(addresses)) {
        for (VendorBatchAddress address : addresses) {
            VendorAddress vendorAddr = new VendorAddress();
            LOG.info("updateVendor ADDRESS " + address + TILDA_DELIMITER + address.getVendorAddressTypeCode() + TILDA_DELIMITER + address.getVendorAddressGeneratedIdentifier());
            if (StringUtils.isNotBlank(address.getVendorAddressGeneratedIdentifier())) {
                vendorAddr = getVendorAddress(vDetail, Integer.valueOf(address.getVendorAddressGeneratedIdentifier()));
            }
            setVendorAddress(address, vendorAddr, vDetail);
            if (vendorAddr.getVendorAddressGeneratedIdentifier() == null) {
                vDetail.getVendorAddresses().add(vendorAddr);
                vendor.getVendorAddresses().add(new VendorAddress());
            }
        // TODO : how about those existing addr, but not passed from request, should they be 'inactivated' ?
        }
    }
}
Also used : VendorBatchAddress(edu.cornell.kfs.vnd.businessobject.VendorBatchAddress) VendorAddress(org.kuali.kfs.vnd.businessobject.VendorAddress)

Example 2 with VendorBatchAddress

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

the class VendorBatchServiceImpl method getVendorAddresses.

/*
	 * convert list of vendor address batch data to list of vendor address
	 */
private List<VendorAddress> getVendorAddresses(List<VendorBatchAddress> addresses, VendorDetail vDetail) {
    List<VendorAddress> vAddrs = new ArrayList<VendorAddress>();
    if (CollectionUtils.isNotEmpty(addresses)) {
        for (VendorBatchAddress address : addresses) {
            LOG.info("addVendor address " + address);
            VendorAddress vendorAddr = new VendorAddress();
            setVendorAddress(address, vendorAddr, vDetail);
            vAddrs.add(vendorAddr);
        }
    }
    return vAddrs;
}
Also used : ArrayList(java.util.ArrayList) VendorBatchAddress(edu.cornell.kfs.vnd.businessobject.VendorBatchAddress) VendorAddress(org.kuali.kfs.vnd.businessobject.VendorAddress)

Aggregations

VendorBatchAddress (edu.cornell.kfs.vnd.businessobject.VendorBatchAddress)2 VendorAddress (org.kuali.kfs.vnd.businessobject.VendorAddress)2 ArrayList (java.util.ArrayList)1