use of edu.cornell.kfs.vnd.businessobject.CuVendorHeaderExtension in project cu-kfs by CU-CommunityApps.
the class CuVendorMaintainableImpl method populateGeneratedHerderId.
private void populateGeneratedHerderId(VendorHeader vendorHeader) {
if (vendorHeader.getVendorHeaderGeneratedIdentifier() == null) {
Integer generatedHeaderId = SpringContext.getBean(SequenceAccessorService.class).getNextAvailableSequenceNumber(HEADER_ID_SEQ).intValue();
vendorHeader.setVendorHeaderGeneratedIdentifier(generatedHeaderId.intValue());
((CuVendorHeaderExtension) vendorHeader.getExtension()).setVendorHeaderGeneratedIdentifier(generatedHeaderId);
}
if (CollectionUtils.isNotEmpty(vendorHeader.getVendorSupplierDiversities())) {
for (VendorSupplierDiversity supplierDiversity : vendorHeader.getVendorSupplierDiversities()) {
supplierDiversity.setVendorHeaderGeneratedIdentifier(vendorHeader.getVendorHeaderGeneratedIdentifier());
((CuVendorSupplierDiversityExtension) supplierDiversity.getExtension()).setVendorHeaderGeneratedIdentifier(vendorHeader.getVendorHeaderGeneratedIdentifier());
((CuVendorSupplierDiversityExtension) supplierDiversity.getExtension()).setVendorSupplierDiversityCode(supplierDiversity.getVendorSupplierDiversityCode());
}
}
}
Aggregations