Browse Source

Displayed Booking Status on Hall Booking Details module on both vphreport and vphreportdashboard

master
AJITHKUMAR12 8 months ago
parent
commit
758708a129
  1. 5
      src/main/java/com/gcc/commissionerreview/controller/VphApiController.java
  2. 22
      src/main/java/com/gcc/commissionerreview/service/VphService.java
  3. 2
      src/main/resources/templates/modules/vphreport.html
  4. 4
      src/main/resources/templates/modules/vphreportdashboard.html

5
src/main/java/com/gcc/commissionerreview/controller/VphApiController.java

@ -54,6 +54,11 @@ public class VphApiController {
return vphservice.getHallBookings();
}
@GetMapping("/hall-bookings-dashboardreport")
public List<Map<String, Object>> hallBookingsDashboardwithstatus() {
return vphservice.getHallBookingswithstatus();
}
@GetMapping("/visitor-details-by-date")
public List<Map<String, Object>> getVisitorDetailsByDate(
@RequestParam String visitDate) {

22
src/main/java/com/gcc/commissionerreview/service/VphService.java

@ -92,7 +92,27 @@ public class VphService {
SELECT hd.hall_name,
us.name userName,
DATE_FORMAT(bd.booking_date,'%d-%m-%Y') bookingDate,
DATE_FORMAT(bd.end_date,'%d-%m-%Y') eventDate
DATE_FORMAT(bd.end_date,'%d-%m-%Y') eventDate,
bd.booking_status as bookingstatus
FROM booking_details bd
LEFT JOIN hall_details hd ON bd.hall_details_hall_id=hd.hall_id
LEFT JOIN users us ON bd.users_user_id=us.user_id
WHERE bd.booking_status IN ('WAITING_FOR_NOC','APPROVED')
AND DATE(bd.booking_date) BETWEEN '2026-01-01' AND CURDATE()
ORDER BY bd.booking_date
""";
return jdbcTemplate.queryForList(sql);
}
public List<Map<String, Object>> getHallBookingswithstatus() {
String sql = """
SELECT hd.hall_name,
us.name userName,
DATE_FORMAT(bd.booking_date,'%d-%m-%Y') bookingDate,
DATE_FORMAT(bd.end_date,'%d-%m-%Y') eventDate,
bd.booking_status as bookingstatus
FROM booking_details bd
LEFT JOIN hall_details hd ON bd.hall_details_hall_id=hd.hall_id
LEFT JOIN users us ON bd.users_user_id=us.user_id

2
src/main/resources/templates/modules/vphreport.html

@ -351,6 +351,7 @@
<th>Hall Name</th>
<th>User Name</th>
<th>Booking Date</th>
<th>Booking Status</th>
<th>Event Date</th>
</tr>
</thead>
@ -807,6 +808,7 @@
<td>${r.hall_name}</td>
<td>${r.userName}</td>
<td>${r.bookingDate}</td>
<td>${r.bookingstatus}</td>
<td>${r.eventDate}</td>
</tr>
`);

4
src/main/resources/templates/modules/vphreportdashboard.html

@ -305,6 +305,7 @@
<th>Hall Name</th>
<th>User Name</th>
<th>Booking Date</th>
<th>Booking Status</th>
<th>Event Date</th>
</tr>
</thead>
@ -1396,7 +1397,7 @@
$("#hallTable tbody").empty();
$.ajax({
url: "/commissionerreview/api/hall-bookings",
url: "/commissionerreview/api/hall-bookings-dashboardreport",
method: "GET",
success: function (data) {
$.each(data, function (i, r) {
@ -1405,6 +1406,7 @@
<td>${r.hall_name}</td>
<td>${r.userName}</td>
<td>${r.bookingDate}</td>
<td>${r.bookingstatus}</td>
<td>${r.eventDate}</td>
</tr>
`);

Loading…
Cancel
Save