Search in sources :

Example 1 with CuVendorHeaderExtension

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

Aggregations

CuVendorHeaderExtension (edu.cornell.kfs.vnd.businessobject.CuVendorHeaderExtension)1 CuVendorSupplierDiversityExtension (edu.cornell.kfs.vnd.businessobject.CuVendorSupplierDiversityExtension)1 VendorSupplierDiversity (org.kuali.kfs.vnd.businessobject.VendorSupplierDiversity)1