Changeset 8a18cf5 for src/main/java/com/example/moviezone/web
- Timestamp:
- 03/06/23 19:58:20 (22 months ago)
- Branches:
- master
- Children:
- 40935d3
- Parents:
- 7215773
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/web/HomeController.java
r7215773 r8a18cf5 199 199 response.sendRedirect("/login"); 200 200 } 201 201 202 202 } 203 203 @GetMapping("/registerWorker") … … 396 396 Customer customer=customerService.findByUsername(request.getRemoteUser()); 397 397 Projection projection1=projectionService.findById(projection.intValue()); 398 if(projection1.getDiscount() .equals(discount)){398 if(projection1.getDiscount()!=null && projection1.getDiscount().getCode().equals(discount)){ 399 399 t=ticketService.saveWithDiscount(LocalDate.now(),customer,projection1,projection1.getDiscount(),seatService.getSeatById(id_seat.intValue()).get()); 400 Integer price=ticketService.priceForTicket(t.getId_ticket()); 401 price+=seatService.getSeatById(id_seat.intValue()).get().getCategory().getExtra_amount(); 402 price-=(price*projection1.getDiscount().getPercent())/100; 403 t.setPrice(price); 400 404 }else{ 401 405 t=ticketService.saveWithout(LocalDate.now(),customer,projection1,seatService.getSeatById(id_seat.intValue()).get()); 402 } 403 Integer price=ticketService.priceForTicket(t.getId_ticket()); 404 t.setPrice(price); 406 Integer price=ticketService.priceForTicket(t.getId_ticket()); 407 price+=seatService.getSeatById(id_seat.intValue()).get().getCategory().getExtra_amount(); 408 t.setPrice(price); 409 } 410 405 411 return "redirect:/myTickets"; 406 412 }
Note:
See TracChangeset
for help on using the changeset viewer.