|
|
@ -626,6 +626,7 @@ public class BookingServiceImpl implements BookingService { |
|
|
@Override |
|
|
@Override |
|
|
public Map<String, Object> saveBookingDetails(Map<String, Object> formData) { |
|
|
public Map<String, Object> saveBookingDetails(Map<String, Object> formData) { |
|
|
Map<String, Object> hs = new HashMap<>(); |
|
|
Map<String, Object> hs = new HashMap<>(); |
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|
|
BookingDetails bookingDetails = null; |
|
|
BookingDetails bookingDetails = null; |
|
|
|
|
|
|
|
|
Integer userId = userSession.getUserId(); |
|
|
Integer userId = userSession.getUserId(); |
|
|
@ -659,6 +660,16 @@ public class BookingServiceImpl implements BookingService { |
|
|
bookingDetails.setHallDetails(hallDetails); |
|
|
bookingDetails.setHallDetails(hallDetails); |
|
|
|
|
|
|
|
|
String startDate = formData.get("startDate").toString(); |
|
|
String startDate = formData.get("startDate").toString(); |
|
|
|
|
|
|
|
|
|
|
|
LocalDate startD = LocalDate.parse(startDate, formatter); |
|
|
|
|
|
LocalDate today = LocalDate.now(); |
|
|
|
|
|
LocalDate sixMonthsLater = today.plusMonths(6); |
|
|
|
|
|
|
|
|
|
|
|
if (startD.isBefore(today)) { |
|
|
|
|
|
return Collections.singletonMap("status", "pastdate"); |
|
|
|
|
|
} else if (startD.isAfter(sixMonthsLater)) { |
|
|
|
|
|
return Collections.singletonMap("status", "futuredate"); |
|
|
|
|
|
} |
|
|
String endDate = formData.get("endDate").toString(); |
|
|
String endDate = formData.get("endDate").toString(); |
|
|
String relation = formData.get("relation").toString(); |
|
|
String relation = formData.get("relation").toString(); |
|
|
double days = Double.parseDouble(formData.get("days").toString()); |
|
|
double days = Double.parseDouble(formData.get("days").toString()); |
|
|
@ -852,7 +863,6 @@ public class BookingServiceImpl implements BookingService { |
|
|
int i = 0; |
|
|
int i = 0; |
|
|
String startDateStr = bookingDetails.getStartDate(); |
|
|
String startDateStr = bookingDetails.getStartDate(); |
|
|
String endDateStr = bookingDetails.getEndDate(); |
|
|
String endDateStr = bookingDetails.getEndDate(); |
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
|
|
|
|
|
LocalDate start = LocalDate.parse(startDateStr, formatter); |
|
|
LocalDate start = LocalDate.parse(startDateStr, formatter); |
|
|
LocalDate end = LocalDate.parse(endDateStr, formatter); |
|
|
LocalDate end = LocalDate.parse(endDateStr, formatter); |
|
|
int hallId = bookingDetails.getHallDetails().getHallId(); |
|
|
int hallId = bookingDetails.getHallDetails().getHallId(); |
|
|
|