Search in sources :

Example 1 with ConcurReport

use of edu.cornell.kfs.concur.businessobjects.ConcurReport in project cu-kfs by CU-CommunityApps.

the class ConcurEventNotificationProcessingServiceImpl method processConcurEventNotification.

protected void processConcurEventNotification(ConcurEventNotification concurEventNotification) {
    LOG.info("processConcurEventNotification() start");
    try {
        ValidationResult validationResult = new ValidationResult();
        ConcurReport concurReport = concurReportsService.extractConcurReport(concurEventNotification.getObjectURI());
        if (concurReport != null) {
            LOG.info("Concur report status code from Concur: report ID: " + concurReport.getReportID() + ", status code: " + concurReport.getConcurStatusCode() + ", workflow URI: " + concurReport.getWorkflowURI());
            if (ConcurUtils.isConcurReportStatusAwaitingExternalValidation(concurReport.getConcurStatusCode())) {
                validationResult = validateReportAccountInfo(concurReport);
                concurReportsService.updateExpenseReportStatusInConcur(concurReport.getWorkflowURI(), validationResult);
            } else {
                LOG.info("Concur Report not in Awaiting External Validation status");
                validationResult.addMessage(configurationService.getPropertyValueAsString(ConcurKeyConstants.INCORRECT_CONCUR_STATUS_CODE));
            }
            concurEventNotificationService.updateConcurEventNotificationFlagsAndValidationMessage(concurEventNotification, ConcurConstants.EVENT_NOTIFICATION_NOT_IN_PROCESS, ConcurConstants.EVENT_NOTIFICATION_PROCESSED, validationResult.isValid(), validationResult.getErrorMessagesAsOneFormattedString());
        }
    } catch (Exception e) {
        LOG.error("An exception occured while processing this request: id " + concurEventNotification.getConcurEventNotificationId() + ", object URI" + concurEventNotification.getObjectURI() + ", error: " + e.getMessage(), e);
    }
}
Also used : ValidationResult(edu.cornell.kfs.concur.businessobjects.ValidationResult) ConcurReport(edu.cornell.kfs.concur.businessobjects.ConcurReport)

Example 2 with ConcurReport

use of edu.cornell.kfs.concur.businessobjects.ConcurReport in project cu-kfs by CU-CommunityApps.

the class ConcurReportsServiceImpl method extractConcurReportFromTravelRequestDetails.

protected ConcurReport extractConcurReportFromTravelRequestDetails(String reportURI) {
    TravelRequestDetailsDTO travelRequestDetailsDTO = retrieveTravelRequestDetails(reportURI);
    List<ConcurAccountInfo> concurAccountInfos = extractAccountInfoFromTravelRequestDetails(travelRequestDetailsDTO);
    return new ConcurReport(travelRequestDetailsDTO.getRequestID(), travelRequestDetailsDTO.getConcurStatucCode(), travelRequestDetailsDTO.getWorkflowActionURL(), concurAccountInfos);
}
Also used : ConcurReport(edu.cornell.kfs.concur.businessobjects.ConcurReport) TravelRequestDetailsDTO(edu.cornell.kfs.concur.rest.xmlObjects.TravelRequestDetailsDTO) ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Example 3 with ConcurReport

use of edu.cornell.kfs.concur.businessobjects.ConcurReport in project cu-kfs by CU-CommunityApps.

the class ConcurReportsServiceImpl method extractConcurReportFromExpenseDetails.

protected ConcurReport extractConcurReportFromExpenseDetails(String reportURI) {
    ExpenseReportDetailsDTO expenseReportDetailsDTO = retrieveExpenseReportDetails(reportURI);
    List<ConcurAccountInfo> concurAccountInfos = extractAccountInfoFromExpenseReportDetails(expenseReportDetailsDTO);
    return new ConcurReport(expenseReportDetailsDTO.getReportId(), expenseReportDetailsDTO.getConcurStatusCode(), expenseReportDetailsDTO.getWorkflowActionURL(), concurAccountInfos);
}
Also used : ExpenseReportDetailsDTO(edu.cornell.kfs.concur.rest.xmlObjects.ExpenseReportDetailsDTO) ConcurReport(edu.cornell.kfs.concur.businessobjects.ConcurReport) ConcurAccountInfo(edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)

Aggregations

ConcurReport (edu.cornell.kfs.concur.businessobjects.ConcurReport)3 ConcurAccountInfo (edu.cornell.kfs.concur.businessobjects.ConcurAccountInfo)2 ValidationResult (edu.cornell.kfs.concur.businessobjects.ValidationResult)1 ExpenseReportDetailsDTO (edu.cornell.kfs.concur.rest.xmlObjects.ExpenseReportDetailsDTO)1 TravelRequestDetailsDTO (edu.cornell.kfs.concur.rest.xmlObjects.TravelRequestDetailsDTO)1