コード例 #1
0
  @RequestMapping(method = {RequestMethod.GET})
  public String find(Model model, RedirectAttributes redirectAttributes) {
    List<TicketsInvoice> ticketsInvoices = ticketsInvoiceService.findAll();

    handleFlashMessages(redirectAttributes, model);

    model.addAttribute("ticketsInvoices", ticketsInvoices);
    return "ticketsInvoice/find";
  }
コード例 #2
0
  @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  public String findOne(@PathVariable("id") int id, Model model) {
    TicketsInvoice ticketsInvoice = ticketsInvoiceService.find(id);
    if (ticketsInvoice == null) throw new ResourceNotFoundException();

    List<Employee> employees =
        employeeService.findAll(Employee.EmployeePosition.MAIN_CASIER.getId());

    model.addAttribute("employees", employees);
    model.addAttribute("ticketsInvoice", ticketsInvoice);
    return "ticketsInvoice/edit";
  }
コード例 #3
0
  @RequestMapping(value = "/{id}/control-letters", method = RequestMethod.GET)
  public String showControlLetters(
      @PathVariable("id") int id, Model model, final RedirectAttributes redirectAttributes) {
    if (!ticketsInvoiceService.invoiceExists(id)) throw new ResourceNotFoundException();

    List<ControlLetter> controlLetters = controlLetterService.findAll(id);
    handleFlashMessages(redirectAttributes, model);

    model.addAttribute("ticketsInvoiceId", id);
    model.addAttribute("controlLetters", controlLetters);

    return "controlLetter/find";
  }
コード例 #4
0
  @RequestMapping(
      value = "/{invoiceId}/control-letters/{controlLetterId}/rows",
      method = RequestMethod.GET)
  public String findControlLettersRows(
      @PathVariable("invoiceId") int invoiceId,
      @PathVariable("controlLetterId") int controlLetterId,
      Model model,
      RedirectAttributes redirectAttributes) {
    if (!ticketsInvoiceService.invoiceExists(invoiceId)) throw new ResourceNotFoundException();

    handleFlashMessages(redirectAttributes, model);
    List<ControlLetterRow> controlLetterRows = controlLetterRowService.findAll(controlLetterId);
    model.addAttribute("controlLetterRows", controlLetterRows);
    model.addAttribute("controlLetterId", controlLetterId);
    model.addAttribute("invoiceId", invoiceId);

    return "controlLetterRow/find";
  }