use of edu.cornell.kfs.pmw.batch.businessobject.KfsVendorDataWrapper in project cu-kfs by CU-CommunityApps.
the class PaymentWorksVendorToKfsVendorDetailConversionServiceImpl method createVendorDetail.
protected KfsVendorDataWrapper createVendorDetail(PaymentWorksVendor pmwVendor, Map<String, List<PaymentWorksIsoFipsCountryItem>> paymentWorksIsoToFipsCountryMap, Map<String, SupplierDiversity> paymentWorksToKfsDiversityMap) {
if (paymentWorksVendorIsPurchaseOrderVendor(pmwVendor)) {
KfsVendorDataWrapper kfsVendorDataWrapper = new KfsVendorDataWrapper();
kfsVendorDataWrapper.getErrorMessages().add(getConfigurationService().getPropertyValueAsString(PaymentWorksKeyConstants.PO_VENDOR_PROCESSING_NOT_AUTOMATIC_YET));
kfsVendorDataWrapper.setVendorDetail(null);
return kfsVendorDataWrapper;
}
KfsVendorDataWrapper kfsVendorDataWrapper = populateTaxRuleDependentAttributes(pmwVendor, paymentWorksIsoToFipsCountryMap);
if (ObjectUtils.isNotNull(kfsVendorDataWrapper.getVendorDetail())) {
kfsVendorDataWrapper.getVendorDetail().getVendorHeader().setVendorTypeCode(determineKfsVendorTypeCodeBasedOnPmwVendorType(pmwVendor.getVendorType()));
kfsVendorDataWrapper.getVendorDetail().getVendorHeader().setVendorSupplierDiversities(buildVendorDiversities(pmwVendor, paymentWorksToKfsDiversityMap));
kfsVendorDataWrapper.getVendorDetail().setVendorDunsNumber(pmwVendor.getRequestingCompanyDuns());
kfsVendorDataWrapper.getVendorDetail().setVendorCreditCardIndicator(new Boolean(pmwVendor.isAcceptCreditCards()));
kfsVendorDataWrapper.getVendorDetail().setActiveIndicator(true);
kfsVendorDataWrapper.getVendorDetail().setVendorUrlAddress(pmwVendor.getRequestingCompanyUrl());
kfsVendorDataWrapper.getVendorDetail().setVendorAddresses(buildVendorAddresses(pmwVendor, paymentWorksIsoToFipsCountryMap));
kfsVendorDataWrapper.getVendorDetail().setVendorContacts(buildVendorContacts(pmwVendor));
kfsVendorDataWrapper.getVendorDetail().setExtension(buildVendorDetailExtension(pmwVendor));
kfsVendorDataWrapper.getVendorDetail().setVendorParentIndicator(true);
kfsVendorDataWrapper = buildRemainingVendorNotes(pmwVendor, kfsVendorDataWrapper);
kfsVendorDataWrapper.getVendorDetail().setBoNotes(kfsVendorDataWrapper.getVendorNotes());
}
return kfsVendorDataWrapper;
}
use of edu.cornell.kfs.pmw.batch.businessobject.KfsVendorDataWrapper in project cu-kfs by CU-CommunityApps.
the class PaymentWorksDataProcessingIntoKfsServiceImpl method createKfsVendorMaintenaceDocument.
private MaintenanceDocument createKfsVendorMaintenaceDocument(PaymentWorksVendor pmwVendor, Map<String, List<PaymentWorksIsoFipsCountryItem>> paymentWorksIsoToFipsCountryMap, Map<String, SupplierDiversity> paymentWorksToKfsDiversityMap, PaymentWorksNewVendorRequestsBatchReportData reportData) {
MaintenanceDocument vendorMaintenceDoc = null;
try {
KfsVendorDataWrapper kfsVendorDataWrapper = getPaymentWorksVendorToKfsVendorDetailConversionService().createKfsVendorDetailFromPmwVendor(pmwVendor, paymentWorksIsoToFipsCountryMap, paymentWorksToKfsDiversityMap);
if (kfsVendorDataWrapper.noProcessingErrorsGenerated()) {
vendorMaintenceDoc = buildVendorMaintenanceDocument(pmwVendor, kfsVendorDataWrapper);
LOG.info("createKfsVendorMaintenaceDocument: vendorMaintenceDoc created for pmwVendorId = " + pmwVendor.getPmwVendorRequestId());
} else {
reportData.getPendingPaymentWorksVendorsThatCouldNotBeProcessed().incrementRecordCount();
reportData.addPmwVendorsThatCouldNotBeProcessed(new PaymentWorksBatchReportRawDataItem(pmwVendor.toString(), kfsVendorDataWrapper.getErrorMessages()));
LOG.info("createKfsVendorMaintenaceDocument: vendorMaintenceDoc not created due to pmw-to-kfs data conversion error(s): " + kfsVendorDataWrapper.getErrorMessages().toString());
}
} catch (WorkflowException we) {
List<String> edocCreateErrors = convertReportDataValidationErrors(GlobalVariables.getMessageMap().getErrorMessages());
captureKfsProcessingErrorsForVendor(pmwVendor, reportData, edocCreateErrors);
LOG.error("createKfsVendorMaintenaceDocument: eDoc creation error(s): " + edocCreateErrors.toString());
LOG.error("createKfsVendorMaintenaceDocument: eDoc creation exception caught: " + we.getMessage());
vendorMaintenceDoc = null;
} finally {
GlobalVariables.getMessageMap().clearErrorMessages();
}
return vendorMaintenceDoc;
}
Aggregations