|
|
|
@ -232,7 +232,7 @@ public class BookingService { |
|
|
|
System.out.println("count======================: " + count1); |
|
|
|
System.out.println("count: " + count); |
|
|
|
|
|
|
|
if (cid == 2 || cid== 6 || cid ==16 && LocalDate.now().equals(Bdate)) // Allow only Disc Work Space and today date |
|
|
|
if ((cid == 2 || cid== 6 || cid ==16 && LocalDate.now().equals(Bdate))) // Allow only Disc Work Space and today date |
|
|
|
{ |
|
|
|
int acount = getacountfromtable(bid); |
|
|
|
System.out.println("acount: " + acount); |
|
|
|
@ -268,6 +268,8 @@ public class BookingService { |
|
|
|
Map<String, Object> calendar = getCalendarBySlotId(bid, cid, bDate, slotId); |
|
|
|
Map<String, Object> capacity = getCapacity(scid, cid); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int capacityint = Integer.parseInt(capacity.get("capacity").toString()); |
|
|
|
|
|
|
|
int bookedSeats = 0; |
|
|
|
@ -276,7 +278,19 @@ public class BookingService { |
|
|
|
bookedSeats = Integer.parseInt(calendar.get("filed").toString()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int availableSeats = capacityint - bookedSeats; |
|
|
|
if ((cid == 2 || cid == 6 || cid == 16 )&& LocalDate.now().equals(bDate)) { |
|
|
|
int acount = getacountfromtable(bid); |
|
|
|
System.out.println("acount: " + acount); |
|
|
|
if (acount >= 0) { |
|
|
|
int extra_seat = acount / 2; |
|
|
|
availableSeats += extra_seat; |
|
|
|
System.out.println("Extra seats added: " + extra_seat); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (availableSeats < 0) { |
|
|
|
availableSeats = 0; |
|
|
|
|