Search in sources :

Example 1 with FormatSelection

use of org.kuali.kfs.pdp.businessobject.FormatSelection in project cu-kfs by CU-CommunityApps.

the class FormatAction method start.

/**
 * This method prepares the data for the format process
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return
 * @throws Exception
 */
public ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    FormatForm formatForm = (FormatForm) form;
    Person kualiUser = GlobalVariables.getUserSession().getPerson();
    FormatSelection formatSelection = formatService.getDataForFormat(kualiUser);
    DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class);
    formatForm.setCampus(kualiUser.getCampusCode());
    // no data for format because another format process is already running
    if (formatSelection.getStartDate() != null) {
        GlobalVariables.getMessageMap().putError(KFSConstants.GLOBAL_ERRORS, PdpKeyConstants.Format.ERROR_PDP_FORMAT_PROCESS_ALREADY_RUNNING, dateTimeService.toDateTimeString(formatSelection.getStartDate()));
    } else {
        List<CustomerProfile> customers = formatSelection.getCustomerList();
        for (CustomerProfile element : customers) {
            if (formatSelection.getCampus().equals(element.getDefaultPhysicalCampusProcessingCode())) {
                element.setSelectedForFormat(Boolean.TRUE);
            } else {
                element.setSelectedForFormat(Boolean.FALSE);
            }
        }
        formatForm.setPaymentDate(dateTimeService.toDateString(dateTimeService.getCurrentTimestamp()));
        formatForm.setPaymentTypes(PdpConstants.PaymentTypes.ALL);
        formatForm.setCustomers(customers);
        formatForm.setRanges(formatSelection.getRangeList());
    }
    return mapping.findForward(PdpConstants.MAPPING_SELECTION);
}
Also used : FormatSelection(org.kuali.kfs.pdp.businessobject.FormatSelection) CustomerProfile(org.kuali.kfs.pdp.businessobject.CustomerProfile) Person(org.kuali.rice.kim.api.identity.Person) DateTimeService(org.kuali.rice.core.api.datetime.DateTimeService)

Example 2 with FormatSelection

use of org.kuali.kfs.pdp.businessobject.FormatSelection in project cu-kfs by CU-CommunityApps.

the class CuFormatAction method start.

@Override
public ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    CuFormatForm formatForm = (CuFormatForm) form;
    Person kualiUser = GlobalVariables.getUserSession().getPerson();
    FormatSelection formatSelection = formatService.getDataForFormat(kualiUser);
    DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class);
    formatForm.setCampus(kualiUser.getCampusCode());
    // no data for format because another format process is already running
    if (formatSelection.getStartDate() != null) {
        GlobalVariables.getMessageMap().putError(KFSConstants.GLOBAL_ERRORS, PdpKeyConstants.Format.ERROR_PDP_FORMAT_PROCESS_ALREADY_RUNNING, dateTimeService.toDateTimeString(formatSelection.getStartDate()));
    } else {
        List<CustomerProfile> customers = formatSelection.getCustomerList();
        for (CustomerProfile element : customers) {
            if (formatSelection.getCampus().equals(element.getDefaultPhysicalCampusProcessingCode())) {
                element.setSelectedForFormat(Boolean.TRUE);
            } else {
                element.setSelectedForFormat(Boolean.FALSE);
            }
        }
        formatForm.setPaymentDate(dateTimeService.toDateString(dateTimeService.getCurrentTimestamp()));
        formatForm.setPaymentTypes(PdpConstants.PaymentTypes.ALL);
        formatForm.setPaymentDistribution(CUPdpConstants.PaymentDistributions.PROCESS_ALL);
        formatForm.setCustomers(customers);
        formatForm.setRanges(formatSelection.getRangeList());
    }
    return mapping.findForward(PdpConstants.MAPPING_SELECTION);
}
Also used : FormatSelection(org.kuali.kfs.pdp.businessobject.FormatSelection) CustomerProfile(org.kuali.kfs.pdp.businessobject.CustomerProfile) Person(org.kuali.rice.kim.api.identity.Person) DateTimeService(org.kuali.rice.core.api.datetime.DateTimeService)

Aggregations

CustomerProfile (org.kuali.kfs.pdp.businessobject.CustomerProfile)2 FormatSelection (org.kuali.kfs.pdp.businessobject.FormatSelection)2 DateTimeService (org.kuali.rice.core.api.datetime.DateTimeService)2 Person (org.kuali.rice.kim.api.identity.Person)2