Search in sources :

Example 1 with PaymentWorksBatchReportRawDataItem

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);
        }
    }
}
Also used : PaymentWorksBatchReportRawDataItem(edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem)

Example 2 with PaymentWorksBatchReportRawDataItem

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;
    }
}
Also used : PaymentWorksBatchReportRawDataItem(edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem)

Example 3 with PaymentWorksBatchReportRawDataItem

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;
}
Also used : PaymentWorksVendor(edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor) PaymentWorksBatchReportRawDataItem(edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem)

Example 4 with PaymentWorksBatchReportRawDataItem

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;
    }
}
Also used : ArrayList(java.util.ArrayList) PaymentWorksBatchReportRawDataItem(edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem)

Example 5 with PaymentWorksBatchReportRawDataItem

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;
}
Also used : MaintenanceDocument(org.kuali.kfs.kns.document.MaintenanceDocument) WorkflowException(org.kuali.rice.kew.api.exception.WorkflowException) PaymentWorksBatchReportRawDataItem(edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem) ArrayList(java.util.ArrayList) AutoPopulatingList(org.springframework.util.AutoPopulatingList) List(java.util.List) KfsVendorDataWrapper(edu.cornell.kfs.pmw.batch.businessobject.KfsVendorDataWrapper)

Aggregations

PaymentWorksBatchReportRawDataItem (edu.cornell.kfs.pmw.batch.report.PaymentWorksBatchReportRawDataItem)6 ArrayList (java.util.ArrayList)3 KfsVendorDataWrapper (edu.cornell.kfs.pmw.batch.businessobject.KfsVendorDataWrapper)1 PaymentWorksVendor (edu.cornell.kfs.pmw.batch.businessobject.PaymentWorksVendor)1 List (java.util.List)1 MaintenanceDocument (org.kuali.kfs.kns.document.MaintenanceDocument)1 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)1 AutoPopulatingList (org.springframework.util.AutoPopulatingList)1