コード例 #1
0
 private Restaurant warmupRestaurant(Order order, Model uiModel) {
   Collection<Restaurant> restaurants = restaurantService.findAll();
   uiModel.addAttribute("restaurants", restaurants);
   Restaurant restaurant =
       restaurantService.fetchWarmedUp(order.getBill().getDiningTable().getRestaurant().getId());
   uiModel.addAttribute("restaurant", restaurant);
   return restaurant;
 }
コード例 #2
0
 private Bill warmupRestaurant(String billId, Model uiModel) {
   Bill bill = billService.findById(Long.valueOf(billId));
   Collection<Restaurant> restaurants = restaurantService.findAll();
   uiModel.addAttribute("restaurants", restaurants);
   Restaurant restaurant =
       restaurantService.fetchWarmedUp(bill.getDiningTable().getRestaurant().getId());
   uiModel.addAttribute("restaurant", restaurant);
   return bill;
 }
コード例 #3
0
 private Order warmupRestaurantByOrder(String orderId, Model uiModel) {
   Order order = orderService.findById(Long.valueOf(orderId));
   Collection<Restaurant> restaurants = restaurantService.findAll();
   uiModel.addAttribute("restaurants", restaurants);
   Restaurant restaurant =
       restaurantService.fetchWarmedUp(order.getBill().getDiningTable().getRestaurant().getId());
   uiModel.addAttribute("restaurant", restaurant);
   return order;
 }
コード例 #4
0
  @RequestMapping(value = "/restaurants/{restaurantName}/waiter", method = RequestMethod.GET)
  public String showWaiter(@PathVariable("restaurantName") String restaurantName, Model uiModel) {

    // warmup stuff
    Collection<Restaurant> restaurants = restaurantService.findAll();
    uiModel.addAttribute("restaurants", restaurants);
    Restaurant restaurant = restaurantService.fetchWarmedUp(restaurantName);
    uiModel.addAttribute("restaurant", restaurant);

    List<Order> allPreparedOrders = orderService.findPreparedOrdersForRestaurant(restaurant);
    uiModel.addAttribute("allPreparedOrders", allPreparedOrders);

    List<Bill> allSubmittedBills = billService.findSubmittedBillsForRestaurant(restaurant);
    uiModel.addAttribute("allSubmittedBills", allSubmittedBills);

    return "hartigehap/waiter";
  }