Search in sources :

Example 1 with CuFormatService

use of edu.cornell.kfs.pdp.service.CuFormatService in project cu-kfs by CU-CommunityApps.

the class CuFormatAction method prepare.

@Override
public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    CuFormatForm formatForm = (CuFormatForm) form;
    DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class);
    if (formatForm.getCampus() == null) {
        return mapping.findForward(PdpConstants.MAPPING_SELECTION);
    }
    // Figure out which ones they have selected
    List selectedCustomers = new ArrayList();
    for (CustomerProfile customer : formatForm.getCustomers()) {
        if (customer.isSelectedForFormat()) {
            selectedCustomers.add(customer);
        }
    }
    Date paymentDate = dateTimeService.convertToSqlDate(formatForm.getPaymentDate());
    Person kualiUser = GlobalVariables.getUserSession().getPerson();
    FormatProcessSummary formatProcessSummary = ((CuFormatService) formatService).startFormatProcess(kualiUser, formatForm.getCampus(), selectedCustomers, paymentDate, formatForm.getPaymentTypes(), formatForm.getPaymentDistribution());
    if (formatProcessSummary.getProcessSummaryList().size() == 0) {
        KNSGlobalVariables.getMessageList().add(PdpKeyConstants.Format.ERROR_PDP_NO_MATCHING_PAYMENT_FOR_FORMAT);
        return mapping.findForward(PdpConstants.MAPPING_SELECTION);
    }
    formatForm.setFormatProcessSummary(formatProcessSummary);
    return mapping.findForward(PdpConstants.MAPPING_CONTINUE);
}
Also used : FormatProcessSummary(org.kuali.kfs.pdp.businessobject.FormatProcessSummary) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) CustomerProfile(org.kuali.kfs.pdp.businessobject.CustomerProfile) DateTimeService(org.kuali.rice.core.api.datetime.DateTimeService) Person(org.kuali.rice.kim.api.identity.Person) Date(java.util.Date) CuFormatService(edu.cornell.kfs.pdp.service.CuFormatService)

Aggregations

CuFormatService (edu.cornell.kfs.pdp.service.CuFormatService)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 CustomerProfile (org.kuali.kfs.pdp.businessobject.CustomerProfile)1 FormatProcessSummary (org.kuali.kfs.pdp.businessobject.FormatProcessSummary)1 DateTimeService (org.kuali.rice.core.api.datetime.DateTimeService)1 Person (org.kuali.rice.kim.api.identity.Person)1