Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/controller/PartController.java
re02787e r2a552fe 71 71 } 72 72 @PostMapping("/repairshopdelivery") 73 public void setRepairShopDelivery(@RequestParam Integer vin, HttpServletResponse response, HttpSession session , HttpServletRequest request){73 public void setRepairShopDelivery(@RequestParam Integer vin, HttpServletResponse response, HttpSession session){ 74 74 // insert into project.repair (vin, id_repair_shop, id_service_book) values (1111,3,1) 75 75 session.setAttribute("carVin",vin); … … 107 107 RepairShop repairShop = repairShopService.getById(rs); 108 108 repairRepository.save(new Repair(o,repairShop,sb)); 109 // o.setOrder_status("finished");110 // orderService.save(o);111 109 session.removeAttribute("order"); 112 110 try { … … 125 123 Deliveryman dm = deliverymanList.get(deliverer); 126 124 deliveryRepository.save(new Delivery("in progress",address,dm,o)); 127 // o.setOrder_status("finished");128 // orderService.save(o);129 125 session.removeAttribute("order"); 130 126 try { … … 138 134 if(session.getAttribute("order")==null){ 139 135 User u = userService.findByUsername(request.getRemoteUser()); 140 Order newOrder = orderService.create ((Client) u);136 Order newOrder = orderService.createOrderAndAddPartToOrder((Client) u, id, quantity); 141 137 session.setAttribute("order",newOrder); 138 } else { 139 Order order = (Order) session.getAttribute("order"); 140 orderContainsPartRepository.save(new OrderContainsPart(id, order.getOrderid(), quantity)); 142 141 } 143 Order order = (Order) session.getAttribute("order");144 orderContainsPartRepository.save(new OrderContainsPart(id,order.getOrderid(),quantity));145 142 try { 146 143 response.sendRedirect("/products");
Note:
See TracChangeset
for help on using the changeset viewer.