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);
}
Aggregations