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
}
}
}
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;
}
Aggregations