use of edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem in project cu-kfs by CU-CommunityApps.
the class PaymentWorksNewVendorRequestsReportServiceImpl method writeUnprocessedSubReport.
public void writeUnprocessedSubReport(List<PaymentWorksBatchReportRawDataItem> manualEntryDataForReport, String manualSubReportTitle, String noDataToOutputMessage) {
LOG.debug("writeUnprocessedSubReport: entered");
String rowFormat = "%74s";
if (CollectionUtils.isEmpty(manualEntryDataForReport)) {
getReportWriterService().setNewPage(false);
getReportWriterService().writeSubTitle(manualSubReportTitle);
getReportWriterService().writeNewLines(1);
getReportWriterService().writeFormattedMessageLine(noDataToOutputMessage);
getReportWriterService().writeNewLines(4);
} else {
getReportWriterService().writeSubTitle(manualSubReportTitle);
getReportWriterService().writeNewLines(1);
for (PaymentWorksBatchReportRawDataItem reportItem : manualEntryDataForReport) {
getReportWriterService().writeFormattedMessageLine(rowFormat, reportItem.getpmwFlatDdto());
getReportWriterService().writeNewLines(1);
writeErrorItemMessages(reportItem.getErrorMessages());
getReportWriterService().writeNewLines(4);
}
}
}
use of edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem in project cu-kfs by CU-CommunityApps.
the class PaymentWorksNewVendorRequestsServiceImpl method pmwNewVendorSaveToStagingTableWasSuccessful.
private boolean pmwNewVendorSaveToStagingTableWasSuccessful(PaymentWorksVendor pmwNewVendorRequestModifiedByOjbSave, PaymentWorksNewVendorRequestsBatchReportData reportData) {
if (ObjectUtils.isNotNull(pmwNewVendorRequestModifiedByOjbSave)) {
return true;
} else {
reportData.getPendingPaymentWorksVendorsThatCouldNotBeProcessed().incrementRecordCount();
reportData.addPmwVendorsThatCouldNotBeProcessed(new PaymentWorksBatchReportRawDataItem(pmwNewVendorRequestModifiedByOjbSave.toString(), getConfigurationService().getPropertyValueAsString(PaymentWorksKeyConstants.INITIAL_SAVE_TO_PMW_STAGING_TABLE_FAILED_ERROR_MESSAGE)));
return false;
}
}
use of edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem in project cu-kfs by CU-CommunityApps.
the class PaymentWorksDtoToPaymentWorksVendorConversionServiceImpl method createPaymentWorksVendorFromPaymentWorksNewVendorRequestDetailDTO.
@Override
public PaymentWorksVendor createPaymentWorksVendorFromPaymentWorksNewVendorRequestDetailDTO(PaymentWorksNewVendorRequestDetailDTO pmwNewVendorRequestDetailDTO, PaymentWorksNewVendorRequestsBatchReportData reportData) {
PaymentWorksVendor stgVendor = new PaymentWorksVendor();
if (newVendorDetailExists(pmwNewVendorRequestDetailDTO)) {
stgVendor.setPmwVendorRequestId(pmwNewVendorRequestDetailDTO.getId());
populateNewVendorRequestingCompanyAttributes(stgVendor, pmwNewVendorRequestDetailDTO);
extractCustomFields(stgVendor, pmwNewVendorRequestDetailDTO, reportData);
} else {
reportData.getPendingPaymentWorksVendorsThatCouldNotBeProcessed().incrementRecordCount();
reportData.addPmwVendorsThatCouldNotBeProcessed(new PaymentWorksBatchReportRawDataItem(pmwNewVendorRequestDetailDTO.toString(), MessageFormat.format(getConfigurationService().getPropertyValueAsString(PaymentWorksKeyConstants.NEW_VENDOR_DETAIL_WAS_NOT_FOUND_ERROR_MESSAGE), pmwNewVendorRequestDetailDTO.getId())));
}
return stgVendor;
}
use of edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem in project cu-kfs by CU-CommunityApps.
the class PaymentWorksNewVendorRequestsServiceImpl method canPaymentWorksNewVendorRequestProcessingContinueForVendor.
private boolean canPaymentWorksNewVendorRequestProcessingContinueForVendor(PaymentWorksVendor stgNewVendorRequestDetailToProcess, PaymentWorksNewVendorRequestsBatchReportData reportData) {
List<String> errorMessages = new ArrayList<String>();
if (pmwDtosCouldConvertCustomAttributesToPmwJavaClassAttributes(stgNewVendorRequestDetailToProcess) && pmwNewVendorAttributesConformToKfsLengthsOrFormats(stgNewVendorRequestDetailToProcess, errorMessages) && allPmwNewVendorIsoCountriesMapToSingleFipsCountry(stgNewVendorRequestDetailToProcess, errorMessages) && pmwNewVendorIdentifierDoesNotExistInKfsStagingTable(stgNewVendorRequestDetailToProcess, errorMessages)) {
return true;
} else {
if (!errorMessages.isEmpty()) {
reportData.getPendingPaymentWorksVendorsThatCouldNotBeProcessed().incrementRecordCount();
reportData.addPmwVendorsThatCouldNotBeProcessed(new PaymentWorksBatchReportRawDataItem(stgNewVendorRequestDetailToProcess.toString(), errorMessages));
}
return false;
}
}
use of edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem 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