|
|
|
@ -1,9 +1,12 @@ |
|
|
|
package com.gcc.communityHall.controller; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.function.Predicate; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.gcc.communityHall.entity.GccBlockingDate; |
|
|
|
import com.gcc.communityHall.others.AppConfig; |
|
|
|
import com.gcc.communityHall.repository.GccBlockingDateRepository; |
|
|
|
@ -60,7 +63,7 @@ public class HeadquartersController { |
|
|
|
Model model, HttpSession session) { |
|
|
|
|
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
List<Map<String, Object>> getMonthCount = bookingDetailsRepository.getAllAdminmonthcount(zone); |
|
|
|
@ -87,86 +90,85 @@ public class HeadquartersController { |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/Reports") |
|
|
|
public String viewReports(Model model,HttpSession session) |
|
|
|
{ |
|
|
|
public String viewReports(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname",headquartersname); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
return "headquarters/reports"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/getReport") |
|
|
|
public String getReports(Model model,HttpSession session) |
|
|
|
{ |
|
|
|
public String getReports(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname",headquartersname); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
return "headquarters/reports"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/approval-history") |
|
|
|
public String viewApproval(Model model,HttpSession session) { |
|
|
|
public String viewApproval(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
model.addAttribute("title", "approvalcontrol"); |
|
|
|
List<Users> Pending=usersRepository.getPendingList(); |
|
|
|
List<Users> Pending = usersRepository.getPendingList(); |
|
|
|
String zone = (String) session.getAttribute("zone"); |
|
|
|
model.addAttribute("zone", zone); |
|
|
|
model.addAttribute("pendinglist",Pending); |
|
|
|
model.addAttribute("pendinglist", Pending); |
|
|
|
return "headquarters/approval-history"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/user-approved") |
|
|
|
public String viewUserApproved(Model model,HttpSession session){ |
|
|
|
public String viewUserApproved(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
model.addAttribute("title","reasondetails"); |
|
|
|
List<Users> approved= usersRepository.getUserApproved(); |
|
|
|
model.addAttribute("title", "reasondetails"); |
|
|
|
List<Users> approved = usersRepository.getUserApproved(); |
|
|
|
String zone = (String) session.getAttribute("zone"); |
|
|
|
model.addAttribute("zone", zone); |
|
|
|
model.addAttribute("approvedlist",approved); |
|
|
|
model.addAttribute("approvedlist", approved); |
|
|
|
return "headquarters/user-approved"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/user-reject") |
|
|
|
public String viewUserReject(Model model,HttpSession session){ |
|
|
|
public String viewUserReject(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
model.addAttribute("title","reasondetails"); |
|
|
|
List<Users> reject= usersRepository.getUserReject(); |
|
|
|
model.addAttribute("title", "reasondetails"); |
|
|
|
List<Users> reject = usersRepository.getUserReject(); |
|
|
|
String zone = (String) session.getAttribute("zone"); |
|
|
|
model.addAttribute("zone", zone); |
|
|
|
model.addAttribute("rejectedlist",reject); |
|
|
|
model.addAttribute("rejectedlist", reject); |
|
|
|
return "headquarters/user-reject"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
@ -183,33 +185,35 @@ public class HeadquartersController { |
|
|
|
@RequestParam(name = "refundStatus", required = false) String refundStatus, |
|
|
|
@RequestParam(name = "paymentStatus", required = false) String paymentStatus, |
|
|
|
@RequestParam(name = "filterby", required = false) String filterby, |
|
|
|
@RequestParam(name = "zone1",required = false, defaultValue = "ALL") String zone, |
|
|
|
@RequestParam(name = "division1",required = false, defaultValue = "ALL") String division, |
|
|
|
@RequestParam(name = "hall1",required = false, defaultValue = "1000") Integer hallid, |
|
|
|
@RequestParam(name = "zone1", required = false, defaultValue = "ALL") String zone, |
|
|
|
@RequestParam(name = "division1", required = false, defaultValue = "ALL") String division, |
|
|
|
@RequestParam(name = "hall1", required = false) Integer hallid, |
|
|
|
@RequestParam(name = "basedon", required = false) String basedon, |
|
|
|
@RequestParam(name = "bookingId", required = false) Long bookingId,HttpSession session) { |
|
|
|
@RequestParam(name = "bookingId", required = false) Long bookingId, |
|
|
|
@RequestParam(name = "reporttype", required = false) String reporttype, |
|
|
|
@RequestParam(name = "counterId", required = false) String counterId, HttpSession session) throws JsonProcessingException { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
List<Users> userList = handleUserRequest(request, fromDate, toDate, userstatus, usertype); |
|
|
|
List<Object[]> bookingList = handleBookingRequest(request, fromDate, toDate, bookingStatus, filterby,bookingId,zone,division,hallid); |
|
|
|
List<BookingDetails> bookingSettlementList = handleBookingSettlementRequest(request, fromDate, toDate, refundStatus,filterby); |
|
|
|
List<Object[]> bookingList = handleBookingRequest(request, fromDate, toDate, bookingStatus, filterby, bookingId, zone, division, hallid); |
|
|
|
List<BookingDetails> bookingSettlementList = handleBookingSettlementRequest(request, fromDate, toDate, refundStatus, filterby); |
|
|
|
//List<Object[]> paymentList = request.equals("3") ? bookingService.getAllPaymentsDetails(fromDate, toDate,zone,division,hallid) : new ArrayList<>(); |
|
|
|
List<Object[]> paymentList = new ArrayList<>(); |
|
|
|
List<Object[]> extrapaymentList = new ArrayList<>(); |
|
|
|
if (request.equals("3")) { |
|
|
|
if (paymentStatus == null || paymentStatus.isEmpty()) { |
|
|
|
paymentList = bookingService.getAllPaymentsDetails(fromDate, toDate, null,zone,division,hallid); |
|
|
|
paymentList = bookingService.getAllPaymentsDetails(fromDate, toDate, null, zone, division, hallid); |
|
|
|
} else { |
|
|
|
paymentList = bookingService.getAllPaymentsDetails(fromDate, toDate, paymentStatus,zone,division,hallid); |
|
|
|
paymentList = bookingService.getAllPaymentsDetails(fromDate, toDate, paymentStatus, zone, division, hallid); |
|
|
|
} |
|
|
|
} |
|
|
|
if (request.equals("8")) { |
|
|
|
if (paymentStatus == null || paymentStatus.isEmpty()) { |
|
|
|
extrapaymentList = bookingService.getAllExtraPaymentsDetails(fromDate, toDate, null,zone,division,hallid); |
|
|
|
extrapaymentList = bookingService.getAllExtraPaymentsDetails(fromDate, toDate, null, zone, division, hallid); |
|
|
|
} else { |
|
|
|
extrapaymentList = bookingService.getAllExtraPaymentsDetails(fromDate, toDate, paymentStatus,zone,division,hallid); |
|
|
|
extrapaymentList = bookingService.getAllExtraPaymentsDetails(fromDate, toDate, paymentStatus, zone, division, hallid); |
|
|
|
} |
|
|
|
} |
|
|
|
List<Object[]> userbookingList = request.equals("4") ? bookingService.getBookingUserDetailsReport(fromDate, toDate) : new ArrayList<>(); |
|
|
|
@ -223,13 +227,13 @@ public class HeadquartersController { |
|
|
|
totalcount = bookingDetailsRepository.countBookingsByZone(); |
|
|
|
// Format zone data |
|
|
|
totalcount = totalcount.stream() |
|
|
|
.map(data -> new Object[] { "Zone-" + data[0], data[1] }) |
|
|
|
.map(data -> new Object[]{"Zone-" + data[0], data[1]}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} else if ("division".equals(basedon)) { |
|
|
|
totalcount = bookingDetailsRepository.countBookingsByDivisions(); |
|
|
|
// Format division data |
|
|
|
totalcount = totalcount.stream() |
|
|
|
.map(data -> new Object[] { "Division-" + data[0], data[1] }) |
|
|
|
.map(data -> new Object[]{"Division-" + data[0], data[1]}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -240,8 +244,32 @@ public class HeadquartersController { |
|
|
|
model.addAttribute("basedon", basedon); |
|
|
|
model.addAttribute("totalcount", totalcount); |
|
|
|
model.addAttribute("totalBookings", totalBookings); |
|
|
|
List<Object[]> hallbookingList = handleBookingHallDetailsReportRequest(request, fromDate, toDate, filterby,zone,division,hallid); |
|
|
|
List<Object[]> hallbookingList = handleBookingHallDetailsReportRequest(request, fromDate, toDate, filterby, zone, division, hallid); |
|
|
|
|
|
|
|
if ("9".equals(request)) { |
|
|
|
if("abstract".equals(reporttype)){ |
|
|
|
List<Object[]> counterBookingList = new ArrayList<>(); |
|
|
|
counterBookingList = bookingService.getCounterWiseBookingCount(fromDate, toDate); |
|
|
|
model.addAttribute("counterBookingList", counterBookingList); |
|
|
|
System.out.println("counterBookingList.." + counterBookingList); |
|
|
|
|
|
|
|
List<Object[]> hallBookingByCounter = bookingService.getHallWiseBookingDetails(fromDate, toDate, counterId); |
|
|
|
// Convert to JSON for JS usage |
|
|
|
String hallBookingJson = new ObjectMapper().writeValueAsString(hallBookingByCounter); |
|
|
|
model.addAttribute("hallBookingJson", hallBookingJson); |
|
|
|
|
|
|
|
|
|
|
|
List<Object[]> hallBookingDetails = bookingService.getBookingDetailsForAllHalls(fromDate, toDate, counterId, hallid); |
|
|
|
String hallBookingDetailsJson = new ObjectMapper().writeValueAsString(hallBookingDetails); |
|
|
|
model.addAttribute("hallBookingDetailsJson", hallBookingDetailsJson); |
|
|
|
|
|
|
|
} else { |
|
|
|
List<Object[]> counterBookingList = new ArrayList<>(); |
|
|
|
counterBookingList = bookingService.getCounterWiseBookingDetails(fromDate, toDate); |
|
|
|
model.addAttribute("counterBookingList", counterBookingList); |
|
|
|
} |
|
|
|
model.addAttribute("reporttype", reporttype); |
|
|
|
} |
|
|
|
|
|
|
|
model.addAttribute("filterby", filterby); |
|
|
|
model.addAttribute("users", userList); |
|
|
|
@ -266,31 +294,27 @@ public class HeadquartersController { |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
|
|
|
|
return "headquarters/reports"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private List<Object[]> handleBookingHallDetailsReportRequest(String request, String fromDate, String toDate,String filterby,String zone,String division,Integer hallid) |
|
|
|
{ |
|
|
|
private List<Object[]> handleBookingHallDetailsReportRequest(String request, String fromDate, String toDate, String filterby, String zone, String division, Integer hallid) { |
|
|
|
if (!request.equals("5")) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
if(filterby.isEmpty()) |
|
|
|
{ |
|
|
|
return bookingService.getBookingHallDetailsReportByBookingDate(fromDate, toDate,zone,division,hallid); |
|
|
|
if (filterby.isEmpty()) { |
|
|
|
return bookingService.getBookingHallDetailsReportByBookingDate(fromDate, toDate, zone, division, hallid); |
|
|
|
} |
|
|
|
if ("1".equals(filterby)) |
|
|
|
{ |
|
|
|
if ("1".equals(filterby)) { |
|
|
|
|
|
|
|
return bookingService.getBookingHallDetailsReportByBookingDate(fromDate, toDate,zone,division,hallid); |
|
|
|
return bookingService.getBookingHallDetailsReportByBookingDate(fromDate, toDate, zone, division, hallid); |
|
|
|
|
|
|
|
} |
|
|
|
if ("2".equals(filterby)) |
|
|
|
{ |
|
|
|
if ("2".equals(filterby)) { |
|
|
|
|
|
|
|
return bookingService.getBookingHallDetailsReportByEventDate(fromDate, toDate,zone,division,hallid); |
|
|
|
return bookingService.getBookingHallDetailsReportByEventDate(fromDate, toDate, zone, division, hallid); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -314,50 +338,37 @@ public class HeadquartersController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<Object[]> handleBookingRequest(String request, String fromDate, String toDate, String bookingStatus, String filterby,Long bookingId,String zone,String division,Integer hallid) { |
|
|
|
private List<Object[]> handleBookingRequest(String request, String fromDate, String toDate, String bookingStatus, String filterby, Long bookingId, String zone, String division, Integer hallid) { |
|
|
|
if (!request.equals("2")) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
if(filterby.isEmpty() && bookingStatus.isEmpty() && bookingId == null) |
|
|
|
{ |
|
|
|
return bookingService.getBookingDetailsByBookingDate(fromDate, toDate,zone,division,hallid); |
|
|
|
if (filterby.isEmpty() && bookingStatus.isEmpty() && bookingId == null) { |
|
|
|
return bookingService.getBookingDetailsByBookingDate(fromDate, toDate, zone, division, hallid); |
|
|
|
} |
|
|
|
if(bookingId!=null && bookingStatus.isEmpty()) |
|
|
|
{ |
|
|
|
if (bookingId != null && bookingStatus.isEmpty()) { |
|
|
|
return bookingDetailsRepo.getAllBookingDetailsWithBookingId(fromDate, toDate, bookingId); |
|
|
|
} |
|
|
|
if(bookingId!=null && !bookingStatus.isEmpty()) |
|
|
|
{ |
|
|
|
return bookingDetailsRepo.getAllBookingDetailsWithBookingIdwithbookingStatus(fromDate, toDate, bookingId,bookingStatus); |
|
|
|
if (bookingId != null && !bookingStatus.isEmpty()) { |
|
|
|
return bookingDetailsRepo.getAllBookingDetailsWithBookingIdwithbookingStatus(fromDate, toDate, bookingId, bookingStatus); |
|
|
|
} |
|
|
|
if(bookingId==null && filterby.isEmpty() && !bookingStatus.isEmpty()) |
|
|
|
{ |
|
|
|
return bookingService.getBookingDetailsByBookingDateWithStatus(fromDate, toDate, bookingStatus,zone,division,hallid); |
|
|
|
if (bookingId == null && filterby.isEmpty() && !bookingStatus.isEmpty()) { |
|
|
|
return bookingService.getBookingDetailsByBookingDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid); |
|
|
|
} |
|
|
|
if(!filterby.isEmpty()) |
|
|
|
{ |
|
|
|
if (!filterby.isEmpty()) { |
|
|
|
|
|
|
|
if ("1".equals(filterby)) |
|
|
|
{ |
|
|
|
if(bookingStatus.isEmpty()) |
|
|
|
{ |
|
|
|
return bookingService.getBookingDetailsByBookingDate(fromDate, toDate,zone,division,hallid); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return bookingService.getBookingDetailsByBookingDateWithStatus(fromDate, toDate, bookingStatus,zone,division,hallid); |
|
|
|
if ("1".equals(filterby)) { |
|
|
|
if (bookingStatus.isEmpty()) { |
|
|
|
return bookingService.getBookingDetailsByBookingDate(fromDate, toDate, zone, division, hallid); |
|
|
|
} else { |
|
|
|
return bookingService.getBookingDetailsByBookingDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if ("2".equals(filterby)) |
|
|
|
{ |
|
|
|
if(bookingStatus.isEmpty()) |
|
|
|
{ |
|
|
|
return bookingService.getBookingDetailsByEventDate(fromDate, toDate,zone,division,hallid); |
|
|
|
} |
|
|
|
else { |
|
|
|
return bookingService.getBookingDetailsByEventDateWithStatus(fromDate, toDate, bookingStatus,zone,division,hallid); |
|
|
|
if ("2".equals(filterby)) { |
|
|
|
if (bookingStatus.isEmpty()) { |
|
|
|
return bookingService.getBookingDetailsByEventDate(fromDate, toDate, zone, division, hallid); |
|
|
|
} else { |
|
|
|
return bookingService.getBookingDetailsByEventDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@ -371,36 +382,26 @@ public class HeadquartersController { |
|
|
|
if (!request.equals("6")) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
if(filterby.isEmpty() && refundStatus.isEmpty()) |
|
|
|
{ |
|
|
|
if (filterby.isEmpty() && refundStatus.isEmpty()) { |
|
|
|
return bookingService.getAllBookingsettlementDetailsByBookingDate(fromDate, toDate); |
|
|
|
} |
|
|
|
if(filterby.isEmpty() && !refundStatus.isEmpty()) |
|
|
|
{ |
|
|
|
if (filterby.isEmpty() && !refundStatus.isEmpty()) { |
|
|
|
return bookingService.getAllBookingsettlementDetailsByBookingDateWithStatus(fromDate, toDate, refundStatus); |
|
|
|
} |
|
|
|
if(!filterby.isEmpty()) |
|
|
|
{ |
|
|
|
if (!filterby.isEmpty()) { |
|
|
|
|
|
|
|
if ("1".equals(filterby)) |
|
|
|
{ |
|
|
|
if(refundStatus.isEmpty()) |
|
|
|
{ |
|
|
|
if ("1".equals(filterby)) { |
|
|
|
if (refundStatus.isEmpty()) { |
|
|
|
return bookingService.getAllBookingsettlementDetailsByBookingDate(fromDate, toDate); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
} else { |
|
|
|
return bookingService.getAllBookingsettlementDetailsByBookingDateWithStatus(fromDate, toDate, refundStatus); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if ("2".equals(filterby)) |
|
|
|
{ |
|
|
|
if(refundStatus.isEmpty()) |
|
|
|
{ |
|
|
|
if ("2".equals(filterby)) { |
|
|
|
if (refundStatus.isEmpty()) { |
|
|
|
return bookingService.getAllBookingsettlementDetailsByEventDate(fromDate, toDate); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
return bookingService.getAllBookingsettlementDetailsByEventDateWithStatus(fromDate, toDate, refundStatus); |
|
|
|
} |
|
|
|
|
|
|
|
@ -410,47 +411,48 @@ public class HeadquartersController { |
|
|
|
// Handle default or error case |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/ongoingevents") |
|
|
|
public String viewRecentevents(Model model,HttpSession session) { |
|
|
|
public String viewRecentevents(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
List<BookingDetails> presenteventslist=bookingDetailsRepository.findPresentBookingList(); |
|
|
|
List<BookingDetails> pasteventslist=bookingDetailsRepository.findPastEventsList(); |
|
|
|
List<BookingDetails> futureeventslist=bookingDetailsRepository.findFutureEventsList(); |
|
|
|
model.addAttribute("title","settlement initiate"); |
|
|
|
List<BookingDetails> presenteventslist = bookingDetailsRepository.findPresentBookingList(); |
|
|
|
List<BookingDetails> pasteventslist = bookingDetailsRepository.findPastEventsList(); |
|
|
|
List<BookingDetails> futureeventslist = bookingDetailsRepository.findFutureEventsList(); |
|
|
|
model.addAttribute("title", "settlement initiate"); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
model.addAttribute("presenteventslist",presenteventslist); |
|
|
|
model.addAttribute("pasteventslist",pasteventslist); |
|
|
|
model.addAttribute("futureeventslist",futureeventslist); |
|
|
|
model.addAttribute("presenteventslist", presenteventslist); |
|
|
|
model.addAttribute("pasteventslist", pasteventslist); |
|
|
|
model.addAttribute("futureeventslist", futureeventslist); |
|
|
|
return "headquarters/ongoingevents"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/booking-list") |
|
|
|
public String viewBookingList(Model model,HttpSession session) { |
|
|
|
public String viewBookingList(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
List<BookingDetails> bookingList = bookingDetailsRepository.getAllApprovedList(); |
|
|
|
model.addAttribute("bookingList", bookingList); |
|
|
|
return "headquarters/booking-list"; // Assuming "officer/rejected-booking-list" is the name of your HTML template |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/rejected-list") |
|
|
|
public String viewRejectedBookings(Model model,HttpSession session) { |
|
|
|
public String viewRejectedBookings(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
@ -458,16 +460,16 @@ public class HeadquartersController { |
|
|
|
model.addAttribute("rejectedBookings", rejectedBookings); |
|
|
|
|
|
|
|
return "headquarters/rejected-list"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/bookingwaitinglist") |
|
|
|
public String viewWaitingBookings(Model model,HttpSession session) { |
|
|
|
public String viewWaitingBookings(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
@ -475,7 +477,7 @@ public class HeadquartersController { |
|
|
|
model.addAttribute("waitingBookings", waitingBookings); |
|
|
|
|
|
|
|
return "headquarters/bookingwaiting"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
@ -484,108 +486,108 @@ public class HeadquartersController { |
|
|
|
@GetMapping("/settlement-approved") |
|
|
|
public String viewSettlementMaster(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
List<BookingDetails> approvedSettlements = bookingDetailsRepository.findAllWithApprovedRefundStatus(); |
|
|
|
List<BookingDetails> settlements = new ArrayList<>(); |
|
|
|
settlements.addAll(approvedSettlements); |
|
|
|
List<BookingDetails> approvedcancelledbookings=bookingDetailsRepository.findCancelledList(); |
|
|
|
List<BookingDetails> approvedrejectedbookings=bookingDetailsRepository.findRejectedList(); |
|
|
|
List<BookingDetails> approvedcancelledbookings = bookingDetailsRepository.findCancelledList(); |
|
|
|
List<BookingDetails> approvedrejectedbookings = bookingDetailsRepository.findRejectedList(); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
model.addAttribute("settlementlist", settlements); |
|
|
|
model.addAttribute("approvedcancelledbookings",approvedcancelledbookings); |
|
|
|
model.addAttribute("approvedrejectedbookings",approvedrejectedbookings); |
|
|
|
model.addAttribute("approvedcancelledbookings", approvedcancelledbookings); |
|
|
|
model.addAttribute("approvedrejectedbookings", approvedrejectedbookings); |
|
|
|
return "headquarters/settlement-approved"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/settlement-initiatedlist") |
|
|
|
public String viewSettlementInitiatedMaster(Model model,HttpSession session) { |
|
|
|
public String viewSettlementInitiatedMaster(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
List<BookingDetails> settlement=bookingDetailsRepository.findByBookingDetailsRefundStatus(); |
|
|
|
List<BookingDetails> Initiatedcancelledbookings=bookingDetailsRepository.findInitiatedCancelledList(); |
|
|
|
List<BookingDetails> Initiatedrejectedbookings=bookingDetailsRepository.findInitiatedRejectedList(); |
|
|
|
model.addAttribute("title","settlement initiate"); |
|
|
|
List<BookingDetails> settlement = bookingDetailsRepository.findByBookingDetailsRefundStatus(); |
|
|
|
List<BookingDetails> Initiatedcancelledbookings = bookingDetailsRepository.findInitiatedCancelledList(); |
|
|
|
List<BookingDetails> Initiatedrejectedbookings = bookingDetailsRepository.findInitiatedRejectedList(); |
|
|
|
model.addAttribute("title", "settlement initiate"); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
model.addAttribute("settlementlist",settlement); |
|
|
|
model.addAttribute("Initiatedcancelledbookings",Initiatedcancelledbookings); |
|
|
|
model.addAttribute("Initiatedrejectedbookings",Initiatedrejectedbookings); |
|
|
|
model.addAttribute("settlementlist", settlement); |
|
|
|
model.addAttribute("Initiatedcancelledbookings", Initiatedcancelledbookings); |
|
|
|
model.addAttribute("Initiatedrejectedbookings", Initiatedrejectedbookings); |
|
|
|
return "headquarters/settlement-initiate"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/settlement-list") |
|
|
|
public String settlementPendingList(Model model,HttpSession session) { |
|
|
|
public String settlementPendingList(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname!=null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("title","settlement Pending"); |
|
|
|
model.addAttribute("title", "settlement Pending"); |
|
|
|
String zone = (String) session.getAttribute("zone"); |
|
|
|
model.addAttribute("zone", zone); |
|
|
|
List<BookingDetails> settlement=bookingDetailsRepository.findAllSettlementPending(); |
|
|
|
List<BookingDetails> cancelledbookings=bookingDetailsRepository.findAllSettlementCancelledList(); |
|
|
|
List<BookingDetails> rejectedbookings=bookingDetailsRepository.findAllSettlementRejectedList(); |
|
|
|
model.addAttribute("settlementlist",settlement); |
|
|
|
model.addAttribute("cancelledbookings",cancelledbookings); |
|
|
|
model.addAttribute("rejectedbookings",rejectedbookings); |
|
|
|
List<BookingDetails> settlement = bookingDetailsRepository.findAllSettlementPending(); |
|
|
|
List<BookingDetails> cancelledbookings = bookingDetailsRepository.findAllSettlementCancelledList(); |
|
|
|
List<BookingDetails> rejectedbookings = bookingDetailsRepository.findAllSettlementRejectedList(); |
|
|
|
model.addAttribute("settlementlist", settlement); |
|
|
|
model.addAttribute("cancelledbookings", cancelledbookings); |
|
|
|
model.addAttribute("rejectedbookings", rejectedbookings); |
|
|
|
return "headquarters/settlement-list"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/refundfailed-list") |
|
|
|
public String RefundFailedList(Model model,HttpSession session) { |
|
|
|
public String RefundFailedList(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname!=null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("title","settlementapproved"); |
|
|
|
model.addAttribute("title", "settlementapproved"); |
|
|
|
String zone = (String) session.getAttribute("zone"); |
|
|
|
model.addAttribute("zone", zone); |
|
|
|
List<BookingDetails> settlementrefundfailed=bookingDetailsRepository.findAllSettlementRefundFailed(); |
|
|
|
List<BookingDetails> refundfailedcancelledbookings=bookingDetailsRepository.findAllRefundFaileCancelledList(); |
|
|
|
List<BookingDetails> refundfailedrejectedbookings=bookingDetailsRepository.findAllRefundFaileRejectedList(); |
|
|
|
model.addAttribute("settlementrefundfailed",settlementrefundfailed); |
|
|
|
model.addAttribute("refundfailedcancelledbookings",refundfailedcancelledbookings); |
|
|
|
model.addAttribute("refundfailedrejectedbookings",refundfailedrejectedbookings); |
|
|
|
List<BookingDetails> settlementrefundfailed = bookingDetailsRepository.findAllSettlementRefundFailed(); |
|
|
|
List<BookingDetails> refundfailedcancelledbookings = bookingDetailsRepository.findAllRefundFaileCancelledList(); |
|
|
|
List<BookingDetails> refundfailedrejectedbookings = bookingDetailsRepository.findAllRefundFaileRejectedList(); |
|
|
|
model.addAttribute("settlementrefundfailed", settlementrefundfailed); |
|
|
|
model.addAttribute("refundfailedcancelledbookings", refundfailedcancelledbookings); |
|
|
|
model.addAttribute("refundfailedrejectedbookings", refundfailedrejectedbookings); |
|
|
|
return "headquarters/refund-failedlist"; |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
session.invalidate(); |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/settlement-completedlist") |
|
|
|
public String viewSettlementcompletedMaster(Model model,HttpSession session) { |
|
|
|
public String viewSettlementcompletedMaster(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
List<BookingDetails> completedlist=bookingDetailsRepository.findSettlementCompletedList(); |
|
|
|
List<BookingDetails> cancelledcompletedlist=bookingDetailsRepository.findCancelledCompletedList(); |
|
|
|
List<BookingDetails> rejectedcompletedlist=bookingDetailsRepository.findRejectedSettlementCompletedList(); |
|
|
|
model.addAttribute("title","settlement initiate"); |
|
|
|
List<BookingDetails> completedlist = bookingDetailsRepository.findSettlementCompletedList(); |
|
|
|
List<BookingDetails> cancelledcompletedlist = bookingDetailsRepository.findCancelledCompletedList(); |
|
|
|
List<BookingDetails> rejectedcompletedlist = bookingDetailsRepository.findRejectedSettlementCompletedList(); |
|
|
|
model.addAttribute("title", "settlement initiate"); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
model.addAttribute("completedlist",completedlist); |
|
|
|
model.addAttribute("cancelledcompletedlist",cancelledcompletedlist); |
|
|
|
model.addAttribute("rejectedcompletedlist",rejectedcompletedlist); |
|
|
|
model.addAttribute("completedlist", completedlist); |
|
|
|
model.addAttribute("cancelledcompletedlist", cancelledcompletedlist); |
|
|
|
model.addAttribute("rejectedcompletedlist", rejectedcompletedlist); |
|
|
|
return "headquarters/settlement-completed"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
@ -606,18 +608,18 @@ else { |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/headquarterspage") |
|
|
|
public String viewcaretaker(Model model,HttpSession session,@RequestParam("bookingId") int bookingId) { |
|
|
|
public String viewcaretaker(Model model, HttpSession session, @RequestParam("bookingId") int bookingId) { |
|
|
|
String caretakerName = (String) session.getAttribute("usertype"); |
|
|
|
if(caretakerName!=null) { |
|
|
|
if (caretakerName != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("caretakerName", caretakerName); |
|
|
|
model.addAttribute("title","caretaker"); |
|
|
|
model.addAttribute("title", "caretaker"); |
|
|
|
model.addAttribute("baseURL", appConfig.getBaseUrl()); |
|
|
|
BookingDetails booking = bookingService.getBookingsById(bookingId); |
|
|
|
model.addAttribute("booking",booking); |
|
|
|
model.addAttribute("booking", booking); |
|
|
|
return "headquarters/headquarterspage"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
@ -639,7 +641,7 @@ else { |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/logout") |
|
|
|
public String viewLogout(Model model,HttpSession session) { |
|
|
|
public String viewLogout(Model model, HttpSession session) { |
|
|
|
session.invalidate(); |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
@ -647,7 +649,7 @@ else { |
|
|
|
@GetMapping("/Gccblocking") |
|
|
|
public String viewGccBlocking(Model model, HttpSession session) { |
|
|
|
String headquartersname = (String) session.getAttribute("usertype"); |
|
|
|
if(headquartersname != null) { |
|
|
|
if (headquartersname != null) { |
|
|
|
long mobileno = (long) session.getAttribute("mobileno"); |
|
|
|
model.addAttribute("mobileno", mobileno); |
|
|
|
model.addAttribute("headquartersname", headquartersname); |
|
|
|
@ -682,7 +684,7 @@ else { |
|
|
|
model.addAttribute("hallCountMap", hallCountMap); |
|
|
|
|
|
|
|
return "headquarters/gccblocking"; |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
session.invalidate(); // Invalidate the session to clear all session attributes |
|
|
|
return "redirect:/communityhall/login"; |
|
|
|
} |
|
|
|
|