Browse Source

Following changes are implemented

1. Admin login --> In Transaction response report temp transactions will be visible
2. Settlement Pending List --> If any error/issue occurs during settlement it will be moved to Refund Failed List
3. Admin Reports --> i) Users -> User Id added in ascending order
                                      ii) Users Booking List --> User Id added in ascending order
                                      iii) Hall Booking List --> Hall Id added in total bookings in descending order
4. Cancel Booking Enabled for booking status Waiting for NOC and Waiting for NOC Approval.
5. Booking Id added for Waiting for NOC and Waiting for NOC Approval
master
kanimozhi 1 year ago
parent
commit
4ce39f1251
  1. 430
      src/main/java/com/gcc/communityHall/controller/Admincontroller.java
  2. 8
      src/main/java/com/gcc/communityHall/controller/UserAPIController.java
  3. 10
      src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java
  4. 36
      src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java
  5. 140
      src/main/java/com/gcc/communityHall/service/BookingService.java
  6. 64
      src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
  7. 3
      src/main/resources/application-dev.properties
  8. 1
      src/main/resources/application-prod.properties
  9. 2
      src/main/resources/templates/admin/bookingwaiting.html
  10. 7
      src/main/resources/templates/admin/reports.html
  11. 2
      src/main/resources/templates/admin/viewUploadNoc.html
  12. 2
      src/main/resources/templates/headquarters/bookingwaiting.html
  13. 6
      src/main/resources/templates/headquarters/reports.html
  14. 2
      src/main/resources/templates/headquarters/viewUploadNoc.html
  15. 27
      src/main/resources/templates/officiallogin.html
  16. 26
      src/main/resources/templates/user/calculatehallamount.html
  17. 18
      src/main/resources/templates/user/viewhistory.html

430
src/main/java/com/gcc/communityHall/controller/Admincontroller.java

@ -1,4 +1,5 @@
package com.gcc.communityHall.controller;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
@ -146,28 +147,26 @@ public class Admincontroller {
@GetMapping("/Reports")
public String viewReports(Model model,HttpSession session)
{
public String viewReports(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
return "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
return "admin/reports";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
@ -175,30 +174,30 @@ public class Admincontroller {
@GetMapping("/HallDetails")
public String viewHallDetails(Model model,HttpSession session)
{
public String viewHallDetails(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
return "admin/halldetailslist";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
}
@GetMapping("/halldetailslist")
public String viewhalldetailsList(Model model,HttpSession session) {
List<HallDetails> list=hallDetailsRepo.findAll();
public String viewhalldetailsList(Model model, HttpSession session) {
List<HallDetails> list = hallDetailsRepo.findAll();
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
model.addAttribute("halllist", list);
return "admin/halldetailslist";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
@ -208,142 +207,145 @@ public class Admincontroller {
@GetMapping("/settlement-approved")
public String viewSettlementMaster(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != 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("adminname", adminname);
model.addAttribute("settlementlist", settlements);
model.addAttribute("approvedcancelledbookings",approvedcancelledbookings);
model.addAttribute("approvedrejectedbookings",approvedrejectedbookings);
model.addAttribute("approvedcancelledbookings", approvedcancelledbookings);
model.addAttribute("approvedrejectedbookings", approvedrejectedbookings);
return "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != 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("adminname", adminname);
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 "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname!=null) {
if (adminname != null) {
model.addAttribute("adminname", adminname);
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 "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname!=null) {
if (adminname != null) {
model.addAttribute("adminname", adminname);
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 "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != 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("adminname", adminname);
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 "admin/settlement-completed";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
@GetMapping("/ReasonMaster")
public String viewreasonMaster(Model model,HttpSession session) {
public String viewreasonMaster(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
return "admin/reasonmaster";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
}
@GetMapping("/userdeactive")
public String viewuserDetails(Model model,HttpSession session) {
public String viewuserDetails(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
return "admin/userdetails";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
@GetMapping("/Gccblocking")
public String viewGccBlocking(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
@ -378,15 +380,13 @@ else {
model.addAttribute("hallCountMap", hallCountMap);
return "admin/gccblocking";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
// Utility method to ensure distinct by a key
private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Set<Object> seen = new HashSet<>();
@ -417,16 +417,16 @@ else {
@RequestParam(required = false) String longitude,
@RequestParam String hallInchargeName,
@RequestParam long hallInchargeNo,
@RequestParam("hallImages") MultipartFile[] hallImages,HttpSession session) {
@RequestParam("hallImages") MultipartFile[] hallImages, HttpSession session) {
String updatedId = (String) session.getAttribute("employeeId");
hallDetailService.saveHall(hallName, depositAmount, halfDayAmt, fullDayAmt, gst, hallArea, ebNumber, ebCostPerUnit, parkingCapacity, seatingCapacity, doorNo,
street, area, zone, division, landMark, city, pinCode, latitude, longitude, hallInchargeName, hallInchargeNo, updatedId, hallImages);
String adminname = (String) session.getAttribute("usertype");
Integer loginid = (Integer) session.getAttribute("id");
ApplicationLogs logs=new ApplicationLogs();
ApplicationLogs logs = new ApplicationLogs();
logs.setComments("Action by " + adminname);
logs.setLoginId(loginid);
logs.setLogType("Adding New Hall:-"+hallName);
logs.setLogType("Adding New Hall:-" + hallName);
InetAddress inetAddress;
try {
inetAddress = InetAddress.getLocalHost();
@ -440,83 +440,85 @@ else {
// Redirect to a success page or return a ModelAndView as per your application flow
return "redirect:/communityhall/admin/halldetailslist";
}
@GetMapping("/approval-history")
public String viewApproval(Model model,HttpSession session) {
public String viewApproval(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
model.addAttribute("adminname", adminname);
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 "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
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 "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
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 "admin/user-reject";
}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 adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
List<BookingDetails> bookingList = bookingDetailsRepository.getAllApprovedList();
model.addAttribute("bookingList", bookingList);
return "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
@ -524,16 +526,16 @@ else {
model.addAttribute("rejectedBookings", rejectedBookings);
return "admin/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 adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
@ -541,7 +543,7 @@ else {
model.addAttribute("waitingBookings", waitingBookings);
return "admin/bookingwaiting";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
@ -558,33 +560,33 @@ else {
@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, defaultValue = "1000") 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, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != 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<>();
@ -598,13 +600,13 @@ else {
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());
}
@ -615,7 +617,7 @@ else {
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);
model.addAttribute("filterby", filterby);
@ -641,31 +643,27 @@ else {
model.addAttribute("adminname", adminname);
return "admin/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);
}
@ -689,50 +687,37 @@ else {
}
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);
}
}
@ -746,36 +731,26 @@ else {
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);
}
@ -787,9 +762,9 @@ else {
}
@GetMapping("/DiscountRange")
public String viewDiscountRange(Model model,HttpSession session) {
public String viewDiscountRange(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
List<DiscountRange> discountRanges = discountRangeRepo.findAll();
@ -797,61 +772,62 @@ else {
model.addAttribute("discountRanges", discountRanges);
model.addAttribute("adminname", adminname);
return "admin/discountrange";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
@GetMapping("/ongoingevents")
public String viewRecentevents(Model model,HttpSession session) {
public String viewRecentevents(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != 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("adminname", adminname);
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 "admin/ongoingevents";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
@GetMapping("/manualrefund")
public String viewManualRefund(Model model,HttpSession session) {
public String viewManualRefund(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
return "admin/manualrefund";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
@GetMapping("/developer")
public String viewDeveloper(Model model,HttpSession session) {
public String viewDeveloper(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
return "admin/developer";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
// @GetMapping("/getDeveloperdetails")
// @GetMapping("/getDeveloperdetails")
// public String getDetails(Model model,HttpSession session)
// {
// String adminname = (String) session.getAttribute("usertype");
@ -864,18 +840,18 @@ else {
// return "redirect:/communityhall/login";
// }
// }
@PostMapping("/getDeveloperdetails")
public String generatedetails(Model model,
@PostMapping("/getDeveloperdetails")
public String generatedetails(Model model,
@RequestParam(name = "FromDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) String fromDate,
@RequestParam(name = "ToDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) String toDate,
@RequestParam(name = "request") String request,
@RequestParam(name = "bookingId", required = false) Long bookingId,
@RequestParam(name = "hallId", required = false) Long hallId,
@RequestParam(name = "hallName",required = false)String hallName,HttpSession session) {
@RequestParam(name = "hallName", required = false) String hallName, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
List<Object[]> TransactionResponse = new ArrayList<>();
@ -893,9 +869,9 @@ public String generatedetails(Model model,
List<Object[]> RefundResponse = new ArrayList<>();
if (request.equals("2")) {
if (bookingId == null) {
RefundResponse = bookingService.getRefundResponse(fromDate,toDate,null);
RefundResponse = bookingService.getRefundResponse(fromDate, toDate, null);
} else {
RefundResponse = bookingService.getRefundResponse(fromDate, toDate,bookingId);
RefundResponse = bookingService.getRefundResponse(fromDate, toDate, bookingId);
}
}
List<Object[]> BookingCalendar = new ArrayList<>();
@ -910,7 +886,7 @@ public String generatedetails(Model model,
// // Fetch filtered details based on hallName
// BookingCalendar = bookingService.getBookingCalendarDetails(fromDate, toDate, hallName);
// }
BookingCalendar = bookingService.getBookingCalendarDetails(fromDate, toDate,bookingId,hallName);
BookingCalendar = bookingService.getBookingCalendarDetails(fromDate, toDate, bookingId, hallName);
}
model.addAttribute("fromdate", fromDate);
@ -925,39 +901,39 @@ public String generatedetails(Model model,
model.addAttribute("adminname", adminname);
return "admin/developer";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
}
@GetMapping("/notification")
public String viewNotificationPage(Model model,HttpSession session) {
public String viewNotificationPage(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype");
if(adminname != null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
List<Notification> newnotifications=notificationRepository.findActivenotifications();
List<Notification> newnotifications = notificationRepository.findActivenotifications();
model.addAttribute("newnotifications", newnotifications);
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
return "admin/notification";
}else {
} else {
session.invalidate(); // Invalidate the session to clear all session attributes
return "redirect:/communityhall/login";
}
}
@GetMapping("/raisesettlement")
public String viewcaretakerpage(Model model,HttpSession session,@RequestParam("bookingId") int bookingId) {
public String viewcaretakerpage(Model model, HttpSession session, @RequestParam("bookingId") int bookingId) {
String adminname = (String) session.getAttribute("usertype");
if(adminname!=null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
BookingDetails booking = bookingService.getBookingsById(bookingId);
model.addAttribute("booking",booking);
model.addAttribute("booking", booking);
return "admin/caretakerpage";
}else {
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
@ -977,18 +953,18 @@ public String generatedetails(Model model,
}
@GetMapping("/adminpage")
public String viewcaretaker(Model model,HttpSession session,@RequestParam("bookingId") int bookingId) {
public String viewcaretaker(Model model, HttpSession session, @RequestParam("bookingId") int bookingId) {
String adminname = (String) session.getAttribute("usertype");
if(adminname!=null) {
if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno");
model.addAttribute("mobileno", mobileno);
model.addAttribute("adminname", adminname);
model.addAttribute("title","Admin");
model.addAttribute("title", "Admin");
model.addAttribute("baseURL", appConfig.getBaseUrl());
BookingDetails booking = bookingService.getBookingsById(bookingId);
model.addAttribute("booking",booking);
model.addAttribute("booking", booking);
return "admin/adminpage";
}else {
} else {
session.invalidate();
return "redirect:/communityhall/login";
}
@ -1010,7 +986,7 @@ public String generatedetails(Model model,
@GetMapping("/logout")
public String viewLogout(Model model,HttpSession session) {
public String viewLogout(Model model, HttpSession session) {
session.invalidate();
return "redirect:/communityhall/login";
}

8
src/main/java/com/gcc/communityHall/controller/UserAPIController.java

@ -238,8 +238,8 @@ public class UserAPIController {
//System.out.println(purpose);
//System.out.print("\n MobileNo---:"+mobileNo);
Random rand = new Random();
int otp = rand.nextInt(90000) + 10000;
// int otp = 11111;
// int otp = rand.nextInt(90000) + 10000;
int otp = 11111;
System.out.print("\n otp---:"+otp);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd-MMM-yyyy%20HH:mm");
LocalDateTime now = LocalDateTime.now();
@ -250,7 +250,7 @@ public class UserAPIController {
System.out.println(urlString);
System.out.println("\n urlString---: "+urlString);
String bodyMessage = ""+otp;
try {
/*try {
RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage=Response;
@ -267,7 +267,7 @@ public class UserAPIController {
} catch (Exception e) {
// System.out.print("ERROR in Sending---: "+e);
bodyMessage = "Error";
}
}*/
HttpSession session = request.getSession();
session.setAttribute("otp", otp);

10
src/main/java/com/gcc/communityHall/paymentService/repository/TransactionResponseRepository.java

@ -27,13 +27,15 @@ public interface TransactionResponseRepository extends JpaRepository<Transaction
Optional<TransactionResponse> findByBookingIdAndTxansactionIdAndStatusCode(int bookingId,String txansactionId, String statusCode);
@Query(value = "SELECT tr.booking_id, tr.hall_id, tr.amount, tr.status_code, tr.txansaction_id, tr.user_id, p.payment_status " +
@Query(value = "SELECT tr.booking_id, tr.hall_id, tr.amount, tr.status_code, tr.txansaction_id, tr.user_id " +
// ", p.payment_status " +
"FROM transaction_response tr " +
"JOIN hall_details hd ON tr.hall_id = hd.hall_id " +
"LEFT JOIN payments p ON tr.booking_id = p.booking_details_booking_id " +
// "LEFT JOIN payments p ON tr.booking_id = p.booking_details_booking_id " +
"LEFT JOIN booking_details bd ON tr.booking_id = bd.booking_id " +
"WHERE DATE(STR_TO_DATE(tr.date, '%d-%m-%Y %H:%i:%s')) >= STR_TO_DATE(:fromDate, '%Y-%m-%d') " +
"AND DATE(STR_TO_DATE(tr.date, '%d-%m-%Y %H:%i:%s')) <= STR_TO_DATE(:toDate, '%Y-%m-%d') " +
"WHERE DATE(STR_TO_DATE(tr.cdate, '%Y-%m-%d')) >= STR_TO_DATE(:fromDate, '%Y-%m-%d') " +
// "WHERE DATE(STR_TO_DATE(tr.cdate, '%d-%m-%Y %H:%i:%s')) >= STR_TO_DATE(:fromDate, '%Y-%m-%d') " +
"AND DATE(STR_TO_DATE(tr.cdate, '%Y-%m-%d')) <= STR_TO_DATE(:toDate, '%Y-%m-%d') " +
"AND (:bookingId IS NULL OR tr.booking_id = :bookingId) " +
"AND (:hallId IS NULL OR tr.hall_id = :hallId)", nativeQuery = true)
List<Object[]> getTransactionResponseByBookingId(@Param("fromDate") String fromDate,

36
src/main/java/com/gcc/communityHall/repository/BookingDetailsRepository.java

@ -115,7 +115,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND DATE(bd.booking_date) <= :toDate " +
"AND bd.booking_status NOT IN ('PENDING')" +
"GROUP BY " +
"bd.users_user_id", nativeQuery = true)
"bd.users_user_id order by u.user_id asc", nativeQuery = true)
List<Object[]> getBookingUserDetailsReport(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
@ -179,7 +179,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingStatus IS NULL OR bd.booking_status = :bookingStatus) ",
"AND (:bookingStatus IS NULL OR bd.booking_status = :bookingStatus) order by bd.booking_id asc ",
nativeQuery = true)
List<Object[]> getAllBookingDetailsWithStatus(@Param("fromDate") String fromDate,
@Param("toDate") String toDate,
@ -194,7 +194,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId)",
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId) order by bd.booking_id asc",
nativeQuery = true)
List<Object[]> getAllBookingDetailsWithBookingId(@Param("fromDate") String fromDate,
@Param("toDate") String toDate,
@ -210,7 +210,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId)" +
"AND (:bookingStatus IS NULL OR bd.booking_status = :bookingStatus)",
"AND (:bookingStatus IS NULL OR bd.booking_status = :bookingStatus) order by bd.booking_id asc",
nativeQuery = true)
List<Object[]> getAllBookingDetailsWithBookingIdwithbookingStatus(@Param("fromDate") String fromDate,
@Param("toDate") String toDate,
@ -225,7 +225,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate ",
"AND DATE(bd.booking_date) <= :toDate order by bd.booking_id asc",
nativeQuery = true)
List<Object[]> getAllBookingDetails(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
@ -322,6 +322,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
+ " WHEN bd.start_date < CURDATE() THEN 'Past'\r\n"
+ " WHEN bd.start_date = CURDATE() THEN 'Current'\r\n"
+ " WHEN bd.booking_status = 'WAITING_FOR_NOC' THEN 'waitingfornoc'\r\n"
+ " WHEN bd.booking_status = 'WAITING_FOR_NOC_APPROVAL' THEN 'waitingfornocapproval'\r\n"
+ " WHEN bd.schedule_count = 0 AND bd.start_date > CURDATE() THEN 'Reschedule'\r\n"
+ " WHEN bd.reason IN ('State Govt Event','Central Govt Event','Commericial & Others') AND bd.booking_status='APPROVED' THEN 'noaction'"
+ " ELSE 'Future' \r\n"
@ -1161,7 +1162,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND bd.booking_status!='PENDING' ", nativeQuery = true)
"AND bd.booking_status!='PENDING' order by bd.booking_id asc", nativeQuery = true)
List<Object[]> getBookingDetailsByBookingDate(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid);
@ -1177,7 +1178,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND bd.booking_status = :bookingStatus ", nativeQuery = true)
"AND bd.booking_status = :bookingStatus order by bd.booking_id asc", nativeQuery = true)
List<Object[]> getBookingDetailsByBookingDateWithStatus(@Param("fromDate") String fromDate,
@Param("toDate") String toDate,
@Param("bookingStatus") String bookingStatus, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid);
@ -1195,7 +1196,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND bd.booking_status!='PENDING' ", nativeQuery = true)
"AND bd.booking_status!='PENDING' order by bd.booking_id asc", nativeQuery = true)
List<Object[]> getBookingDetailsByEventDate(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid);
@ -1211,7 +1212,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND bd.booking_status = :bookingStatus", nativeQuery = true)
"AND bd.booking_status = :bookingStatus order by bd.booking_id asc", nativeQuery = true)
List<Object[]> getBookingDetailsByEventDateWithStatus(@Param("fromDate") String fromDate,
@Param("toDate") String toDate,
@Param("bookingStatus") String bookingStatus, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid);
@ -1226,7 +1227,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:paymentStatus IS NULL OR p.payment_status = :paymentStatus)" +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) ",
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) order by bd.booking_id asc",
nativeQuery = true)
List<Object[]> getAllPaymentsDetails(@Param("fromDate") String fromDate, @Param("toDate") String toDate, @Param("paymentStatus") String paymentStatus, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid);
@ -1240,7 +1241,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:paymentStatus IS NULL OR p.payment_status = :paymentStatus)" +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) ",
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) order by bd.booking_id asc ",
nativeQuery = true)
List<Object[]> getAllExtraPaymentsDetails(@Param("fromDate") String fromDate, @Param("toDate") String toDate, @Param("paymentStatus") String paymentStatus, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid);
@ -1256,7 +1257,8 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"SUM(bd.gst) AS gst, " +
"SUM(p.amount_received) AS AmountReceived, " +
"COALESCE(SUM(r.amount - r.balace_amount), 0) AS AmountRefund, " +
"COALESCE(SUM(CASE WHEN bd.booking_status IN ('COMPLETED', 'CANCELED') THEN r.balace_amount - bd.gst ELSE 0 END), 0) AS NetRevenue " +
"COALESCE(SUM(CASE WHEN bd.booking_status IN ('COMPLETED', 'CANCELED') THEN r.balace_amount - bd.gst ELSE 0 END), 0) AS NetRevenue ," +
"h.hall_id "+
"FROM " +
"booking_details bd " +
"JOIN " +
@ -1270,7 +1272,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:division IS NULL OR :division = 'ALL' OR h.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR h.hall_id = :hallid) " +
"GROUP BY " +
"bd.hall_details_hall_id", nativeQuery = true)
"bd.hall_details_hall_id order by COUNT(*) desc", nativeQuery = true)
List<Object[]> getBookingHallDetailsReportByBookingDate(@Param("fromDate") String fromDate, @Param("toDate") String toDate, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid);
@ -1309,7 +1311,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN users us ON bd.users_user_id = us.user_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate ", nativeQuery = true)
"AND DATE(bd.booking_date) <= :toDate order by bd.booking_id asc ", nativeQuery = true)
List<BookingDetails> getAllBookingsettlementDetailsByBookingDate(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
@Query(value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@ -1319,7 +1321,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND (:refundStatus IS NULL OR bd.refund_status = :refundStatus) ", nativeQuery = true)
"AND (:refundStatus IS NULL OR bd.refund_status = :refundStatus) order by bd.booking_id asc", nativeQuery = true)
List<BookingDetails> getAllBookingsettlementDetailsByBookingDateWithStatus(@Param("fromDate") String fromDate, @Param("toDate") String toDate, @Param("refundStatus") String refundStatus);
@Query(value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@ -1328,7 +1330,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN users us ON bd.users_user_id = us.user_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.start_date) >= :fromDate " +
"AND DATE(bd.end_date) <= :toDate ", nativeQuery = true)
"AND DATE(bd.end_date) <= :toDate order by bd.booking_id asc", nativeQuery = true)
List<BookingDetails> getAllBookingsettlementDetailsByEventDate(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
@Query(value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@ -1338,7 +1340,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.start_date) >= :fromDate " +
"AND DATE(bd.end_date) <= :toDate " +
"AND (:refundStatus IS NULL OR bd.refund_status = :refundStatus) ", nativeQuery = true)
"AND (:refundStatus IS NULL OR bd.refund_status = :refundStatus) order by bd.booking_id asc", nativeQuery = true)
List<BookingDetails> getAllBookingsettlementDetailsByEventDateWithStatus(@Param("fromDate") String fromDate, @Param("toDate") String toDate, @Param("refundStatus") String refundStatus);
// In BookingDetailsRepository.java

140
src/main/java/com/gcc/communityHall/service/BookingService.java

@ -19,44 +19,53 @@ import com.gcc.communityHall.entity.GccBlockingDate;
public interface BookingService {
BookingDetails getBookingsById(int BookingId);
BookingDetails updateBookingDetails(BookingDetails bd);
public String confirmTheDateAndSlot(String fromDate, String toDate, int days, int fromStartingSlot, int fromEndingSlot, int toStartingSlot, int toEndingSlot, int bookingId,int userId);
public Map<String,Object> saveBookingDetails(Map<String,Object> formData);
public String confirmTheDateAndSlot(String fromDate, String toDate, int days, int fromStartingSlot, int fromEndingSlot, int toStartingSlot, int toEndingSlot, int bookingId, int userId);
public Map<String, Object> saveBookingDetails(Map<String, Object> formData);
public BookingDetails updateBookingStatustoGCCBlocked(BookingDetails bookingDetails);
public BookingDetails updateBookingStatus(int bookingId, BookingDetails.BookingStatus status, String comments);
public BookingDetails updateBookingStatusById( int bookingId, BookingDetails.BookingStatus status,String comments);
public EbDetails updateEbDetails(int bookingId,double startUnit,double endUnit,char status);
public BookingDetails updateBookingStatusById(int bookingId, BookingDetails.BookingStatus status, String comments);
public EbDetails updateEbDetails(int bookingId, double startUnit, double endUnit, char status);
//typeOfCancel depends { }
String cancelBooking(int bookingId,BookingDetails.BookingStatus currentStatus,String comments);
String cancelBooking(int bookingId, BookingDetails.BookingStatus currentStatus, String comments);
public String confirmBooking(int bookingId);
public BookingDetails getBookingDetailsWithSettlement(int settlementId);
//sreeja
List<BookingDetails> getPresentsEventsByUserId(Integer hallId);
List<BookingDetails> getPastsEventsByUserId(Integer hallId);
List<BookingDetails> getFuturesEventsByUserId(Integer hallId);
List<BookingDetails> getSettlementList(Integer hallId);
public List<BookingDetails> getFilteredBookings(LocalDate fromDate, LocalDate toDate, List<Long> hallIds);
public List<BookingCalendar> getPastData(int hall_id) ;
public List<BookingCalendar> getPastData(int hall_id);
public String processEbDetailsAndDamage(
int bookingId, int ebId,
double startingReading, double endingReading,
float usedUnit,double ebAmount,
String assetNames[], String comments[], int quantities[],Double assetAmounts[],MultipartFile assetImages[]);
float usedUnit, double ebAmount,
String assetNames[], String comments[], int quantities[], Double assetAmounts[], MultipartFile assetImages[]);
public int checkUserBookinglimitation(int userId);
List<BookingDetails> getAllBookingsByUserId(Integer userId);
List<Map<String, Object>> getAllBookingEventsByUserId(Integer userId);
List<BookingDetails> getAllBookingsByUserId(Integer userId);
List<Map<String, Object>> getAllBookingEventsByUserId(Integer userId);
//List<BookingDetails> getAllBookingDetailsWithStatus(String fromDate, String toDate, String bookingStatus);
@ -66,67 +75,102 @@ public interface BookingService {
List<Object[]> getBookingUserDetailsReport(String fromDate, String toDate);
List<Object[]> getBookingHallDetailsReport(String fromDate, String toDate);
List<GccBlockingDate> getBlockedEvents(LocalDate fromDate, LocalDate toDate, List<Long> hallIds);
List<Map<String, Object>> getOfflineBookings();
List<BookingCalendar> getBookedslots(LocalDate fromDate,LocalDate endDate, List<Long> hallIdList);
List<BookingCalendar> getBookedslots(LocalDate fromDate, LocalDate endDate, List<Long> hallIdList);
BookingDetails updateCancelledBookingStatus(int bookingId, BookingStatus status, String comments);
BookingDetails updateRefundStatus(int bookingId, RefundStatus status);
//officer service
List<BookingDetails> getAllBookingDetailsByZone(String fromDate, String toDate,String zone);
List<BookingDetails> getAllBookingDetailsByZone(String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingDetailsByZoneWithStatus(String fromDate, String toDate, String zone, String bookingStatus);
List<BookingDetails> getAllBookingDetailsByZoneWithStatus(String fromDate, String toDate, String zone,String bookingStatus);
List<Object[]> getAllPaymentsDetailsByZone(String fromDate, String toDate, String zone);
List<Object[]> getAllPaymentsDetailsByZone (String fromDate, String toDate,String zone);
List<Object[]> getBookingHallDetailsReportByZone(String fromDate, String toDate, String zone);
List<Object[]> getBookingHallDetailsReportByZone(String fromDate, String toDate,String zone);
Optional<String> updateBookingDatesAndCalendar(int bookingId, String startDate, String endDate);
List<Object[]> getBookingHallDetailsReportByZone1(String fromDate, String toDate,String zone, Integer hallId);
List<Object[]> getBookingHallDetailsReportByZone1(String fromDate, String toDate, String zone, Integer hallId);
List<Object> getGccBlockingEvents(String hallId);
int getBlockedHallCount(String blockingReason, Date startDate, Date endDate);
@Transactional
void cancelAllBookings(String fromDate, String toDate, List<Long> hallIdsList,
String reasonforblocking, List<String> selectedBookings, String updatedBy,String[] descriptions,MultipartFile[] documents);
String reasonforblocking, List<String> selectedBookings, String updatedBy, String[] descriptions, MultipartFile[] documents);
List<BookingDetails> findBookingDetailsByBookingId(Long bookingId);
//admin dashboard
Map<String, Map<String, Integer>> getBookingStatistics(LocalDate fromDate, LocalDate toDate, String zone, String division,Integer hallid, String userType);
Map<String, Map<String, Integer>> getBookingStatistics(LocalDate fromDate, LocalDate toDate, String zone, String division, Integer hallid, String userType);
public List<Map<String, Object>> getBookingDetailsByHallId(int hallId);
//officer dashboard
Map<String, Map<String, Integer>> getOfficerDashboard(LocalDate fromDate, LocalDate toDate, String zone, String division,Integer hallid, String userType);
Map<String, Map<String, Integer>> getOfficerDashboard(LocalDate fromDate, LocalDate toDate, String zone, String division, Integer hallid, String userType);
List<Map<String, Object>> getHallDetailsForOfficer(Integer hallIid);
//List<Object[]> getAllPaymentsDetails(String fromDate, String toDate, String paymentStatus);
//admin reports
List<Object[]> getBookingDetailsByBookingDate(String fromDate,String toDate,String zone,String division,Integer hallid);
List<Object[]> getBookingDetailsByEventDate(String fromDate,String toDate,String zone,String division,Integer hallid);
List<Object[]> getBookingDetailsByBookingDateWithStatus(String fromDate,String toDate,String bookingStatus,String zone,String division,Integer hallid);
List<Object[]> getBookingDetailsByEventDateWithStatus(String fromDate,String toDate,String bookingStatus,String zone,String division,Integer hallid);
List<Object[]> getAllPaymentsDetails( String fromDate, String toDate,String paymentStatus,String zone, String division, Integer hallid);
List<Object[]> getBookingHallDetailsReportByBookingDate( String fromDate, String toDate,String zone,String division,Integer hallid);
List<Object[]> getBookingHallDetailsReportByEventDate(String fromDate, String toDate,String zone,String division,Integer hallid);
List<Object[]> getBookingDetailsByBookingDate(String fromDate, String toDate, String zone, String division, Integer hallid);
List<Object[]> getBookingDetailsByEventDate(String fromDate, String toDate, String zone, String division, Integer hallid);
List<Object[]> getBookingDetailsByBookingDateWithStatus(String fromDate, String toDate, String bookingStatus, String zone, String division, Integer hallid);
List<Object[]> getBookingDetailsByEventDateWithStatus(String fromDate, String toDate, String bookingStatus, String zone, String division, Integer hallid);
List<Object[]> getAllPaymentsDetails(String fromDate, String toDate, String paymentStatus, String zone, String division, Integer hallid);
List<Object[]> getBookingHallDetailsReportByBookingDate(String fromDate, String toDate, String zone, String division, Integer hallid);
List<Object[]> getBookingHallDetailsReportByEventDate(String fromDate, String toDate, String zone, String division, Integer hallid);
List<BookingDetails> getAllBookingsettlementDetailsByBookingDate(String fromDate, String toDate);
List<BookingDetails> getAllBookingsettlementDetailsByBookingDateWithStatus( String fromDate, String toDate, String refundStatus);
List<BookingDetails> getAllBookingsettlementDetailsByEventDate( String fromDate, String toDate);
List<BookingDetails> getAllBookingsettlementDetailsByEventDateWithStatus( String fromDate, String toDate, String refundStatus);
List<BookingDetails> getAllBookingDetailsBookingDateByZone( String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingDetailsEventDateByZone( String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingDetailsBookingDateByZoneWithStatus( String fromDate, String toDate, String zone, String bookingStatus);
List<BookingDetails> getAllBookingDetailsEventDateByZoneWithStatus( String fromDate, String toDate, String zone, String bookingStatus);
List<BookingDetails> getAllBookingsettlementDetailsByZoneByBookingDate(String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingsettlementDetailsByBookingDateWithStatus(String fromDate, String toDate, String refundStatus);
List<BookingDetails> getAllBookingsettlementDetailsByEventDate(String fromDate, String toDate);
List<BookingDetails> getAllBookingsettlementDetailsByEventDateWithStatus(String fromDate, String toDate, String refundStatus);
List<BookingDetails> getAllBookingDetailsBookingDateByZone(String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingDetailsEventDateByZone(String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingDetailsBookingDateByZoneWithStatus(String fromDate, String toDate, String zone, String bookingStatus);
List<BookingDetails> getAllBookingDetailsEventDateByZoneWithStatus(String fromDate, String toDate, String zone, String bookingStatus);
List<BookingDetails> getAllBookingsettlementDetailsByZoneByBookingDate(String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingsettlementDetailsByZoneByEventDate(String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingsettlementDetailsByZoneByBookingDateWithStatus(String fromDate, String toDate, String zone, String refundStatus);
List<BookingDetails> getAllBookingsettlementDetailsByZoneByEventDateWithStatus(String fromDate, String toDate, String zone, String refundStatus);
List<Object[]> getBookingHallDetailsReportByZoneByBookingDate(String fromDate, String toDate, String zone);
List<Object[]> getBookingHallDetailsReportByZoneByBookingDate(String fromDate, String toDate, String zone);
List<Object[]> getBookingHallDetailsReportByZoneByEventDate(String fromDate, String toDate, String zone);
List<Object[]> getBookingHallDetailsReportByZoneByBookingDateHallname(String fromDate, String toDate, String zone, Integer hallId);
List<Object[]> getBookingHallDetailsReportByZoneByEventDateHallname(String fromDate, String toDate, String zone, Integer hallId);
BookingDetails saveebdetails(int bookingId, double startingReading, MultipartFile startingReadingimage);
String confirmStateBooking(int bookingId);
String uploadNOCFile(MultipartFile file, int bookingId);
//gccapps
@ -134,22 +178,28 @@ List<Object[]> getBookingHallDetailsReportByZoneByBookingDate(String fromDate, S
List<BookingDetails> getRejectedBookingDetails();
List<Object[]> getAllPaymentsDetails( String fromDate, String toDate);
List<Object[]> getAllPaymentsDetails(String fromDate, String toDate);
List<BookingDetails> getPastsEvents();
List<BookingDetails> getPresentsEvents();
List<BookingDetails> getFuturesEvents();
List<BookingDetails> getSettlementApprovedList();
List<BookingDetails> getSettlementApprovedList();
List<Map<String, Object>> getHallDetails(Integer hall_id);
List<BookingDetails> getWaitingforNOCapproval();
List<Object[]> getAllExtraPaymentsDetails(String fromDate, String toDate, String paymentStatus, String zone, String division, Integer hallid);
//developer
List<Object[]> getTransactionresponse(String fromDate, String toDate, Long bookingId, Long hallId);
List<Object[]> getRefundResponse(String fromDate, String toDate, Long bookingId);
List<Map<String, Object>> getHallDetails( Integer hall_id);
List<BookingDetails> getWaitingforNOCapproval();
List<Object[]> getAllExtraPaymentsDetails( String fromDate, String toDate,String paymentStatus,String zone, String division, Integer hallid);
//developer
List<Object[]> getTransactionresponse(String fromDate, String toDate, Long bookingId,Long hallId);
List<Object[]> getRefundResponse(String fromDate, String toDate, Long bookingId);
List<Object[]> getBookingCalendarDetails(String fromDate, String toDate, Long bookingId,String hallName);
List<Object[]> getBookingCalendarDetails(String fromDate, String toDate, Long bookingId, String hallName);
List<BookingDetails> getBookingsByDateAndHall(String bookingDate, Long hallId);
}

64
src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java

@ -326,7 +326,12 @@ public class BookingServiceImpl implements BookingService {
bookingCalendarRepository.save(bookingCalendar);
i++;
}
String reason = bookingDetails.getReason();
String statusMessage = processBookingStatusAndSendMessages(bookingDetails);
return statusMessage;
/*String reason = bookingDetails.getReason();
ReasonMaster reasondetails = reasonMasterRepository.findByReason(reason);
String reasoncode = reasondetails.getReasoncode();
if (reasoncode == null) {
@ -348,8 +353,9 @@ public class BookingServiceImpl implements BookingService {
whatsappMsgServiceImpl.sendMsg(whatsupmsg);
whatsappMsgServiceImpl.sendSMS(urlString);
return "Booking confirmed successfully";
}
}*/
} catch (Exception e) {
e.printStackTrace();
bookingFailure(bookingDetails, 2);
// System.out.println(bookingDetails.getBookingStatus()+","+bookingDetails.getRefundStatus()+","+bookingDetails.getComments());
return "redirect:/communityhall/user/acknowledgement?bookingId=" + bookingDetails.getBookingId();
@ -357,6 +363,58 @@ public class BookingServiceImpl implements BookingService {
}
@Transactional
public String processBookingStatusAndSendMessages(BookingDetails bookingDetails) {
try{
String reason = bookingDetails.getReason();
ReasonMaster reasonDetails = reasonMasterRepository.findByReason(reason);
String reasonCode = (reasonDetails != null && reasonDetails.getReasoncode() != null) ? reasonDetails.getReasoncode() : "";
String bookingconfirmationmsg, urlString, whatsupmsg;
if (reasonCode.equals("CGE") || reasonCode.equals("CAO") || reasonCode.equals("SGE")) {
updateBookingStatusById(bookingDetails.getBookingId(), BookingDetails.BookingStatus.WAITING_FOR_NOC, "Waiting For NOC Documents");
bookingconfirmationmsg = "Your booking ID " + bookingDetails.getBookingId() + " on " + bookingDetails.getBookingDate() + " has been confirmed successfully. Thanks for using GCC Community Hall Booking System.";
urlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" + bookingDetails.getUsers().getMobileNo() +
"&from=GCCCRP&body=" + bookingconfirmationmsg + "&entityid=1401572690000011081&templateid=1407172346459428987";
whatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to=" +
bookingDetails.getUsers().getMobileNo() +
"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+" +
bookingDetails.getBookingId() + "+on+" + bookingDetails.getBookingDate() +
"+has+been+successfully+confirmed.+%0AThanks+for+using+GCC+Community+Hall+Booking+System.";
whatsappMsgServiceImpl.sendMsg(whatsupmsg);
whatsappMsgServiceImpl.sendSMS(urlString);
return "Waiting For NOC Documents";
} else {
updateBookingStatusById(bookingDetails.getBookingId(), BookingDetails.BookingStatus.APPROVED, "Booking Confirmed Successfully");
bookingconfirmationmsg = "Your booking ID " + bookingDetails.getBookingId() + " on " + bookingDetails.getStartDate() + " has been confirmed successfully. Thanks for using GCC Community Hall Booking System.";
urlString = "https://tmegov.onex-aura.com/api/sms?key=pfTEYN6H&to=" + bookingDetails.getUsers().getMobileNo() +
"&from=GCCCRP&body=" + bookingconfirmationmsg + "&entityid=1401572690000011081&templateid=1407172346459428987";
whatsupmsg = "https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to=" +
bookingDetails.getUsers().getMobileNo() +
"&v=1.1&format=json&msg_type=TEXT&method=SENDMESSAGE&msg=Your+booking+with+ID+" +
bookingDetails.getBookingId() + "+on+" + bookingDetails.getStartDate() +
"+has+been+successfully+confirmed.+%0AThanks+for+using+GCC+Community+Hall+Booking+System.";
whatsappMsgServiceImpl.sendMsg(whatsupmsg);
whatsappMsgServiceImpl.sendSMS(urlString);
return "Booking confirmed successfully";
}
}catch (Exception e){
e.printStackTrace();
return "error";
}
}
@Override
@Transactional
public String confirmStateBooking(int bookingId) {
@ -590,7 +648,7 @@ public class BookingServiceImpl implements BookingService {
if (user != null) {
bookingDetails.setUsers(user);
if(counterId!=null){
if (counterId != null) {
bookingDetails.setCounterId(counterId);
}
if (hallDetails != null) {

3
src/main/resources/application-dev.properties

@ -1,6 +1,7 @@
spring.application.name=communityHall
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/testcommunityhall
#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/communityhall_13032025
spring.datasource.username=root
spring.datasource.password=root
@ -35,7 +36,7 @@ spring.servlet.multipart.max-request-size=10MB
spring.jpa.driverClassName= com.mysql.cj.jdbc.Driver
employee.api.url=https://erp.chennaic orporation.gov.in/pgr/external/mobileservice
employee.api.url=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice
app.erpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice?
server.address=0.0.0.0

1
src/main/resources/application-prod.properties

@ -53,3 +53,4 @@ app.getOtpUrl=https://tmegov.onex-aura.com/api/sms?
app.manualRefundCode=8520
app.fullUrl=https://gccservices.chennaicorporation.gov.in/communityhall
app.commErpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice

2
src/main/resources/templates/admin/bookingwaiting.html

@ -51,6 +51,7 @@
<thead class="thead-light">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Booking Id</th>
<th class="text-center">Zone</th>
<th class="text-center">Division</th>
<th class="text-center" width="20%">Hall Name</th>
@ -66,6 +67,7 @@
<tbody>
<tr th:each="booking, rowStat : ${waitingBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td>
<td class="text-center" th:text="${booking.bookingId}"></td>
<td class="text-center" th:text="${booking.hallDetails.zone}"></td>
<td class="text-center" th:text="${booking.hallDetails.division}"></td>
<td class="text-center" th:text="${booking.hallDetails.hallName}"></td>

7
src/main/resources/templates/admin/reports.html

@ -292,6 +292,7 @@
<thead class="thead-dark">
<tr role="row">
<th>S.No</th>
<th width="130px">User Id</th>
<th>Name</th>
<th>Mobile</th>
<th>Address</th>
@ -302,6 +303,7 @@
</thead>
<tr th:each="user, iterStat : ${users}">
<td th:text="${iterStat.count}">0</td>
<td th:text="${user.userId}"></td>
<td th:text="${user.name}"></td>
<td th:text="${user.mobileNo}"></td>
<td
@ -460,8 +462,8 @@
role="grid" width="99.5%">
<thead class="thead-dark">
<tr role="row">
<th>S.No</th>
<th width="110px">User Id</th>
<th>Name</th>
<th>Mobile</th>
<th>Address</th>
@ -471,6 +473,7 @@
<tr th:each="userbookingList, iterStat : ${userbookingLists}">
<td th:text="${iterStat.count}">0</td>
<td th:text="${userbookingList[0]}"></td>
<td th:text="${userbookingList[1]}"></td>
<td th:text="${userbookingList[2]}"></td>
<td th:text="${userbookingList[3]}"></td>
@ -487,6 +490,7 @@
<thead class="thead-dark">
<tr role="row">
<th>S.No</th>
<th>Hall Id</th>
<th>Hall Name</th>
<th>Zone/Division</th>
<th>Caretaker Name</th>
@ -503,6 +507,7 @@
<tbody>
<tr th:each="hallbookingList, iterStat : ${hallbookingLists}">
<td th:text="${iterStat.count}">0</td>
<td th:text="${hallbookingList[11]}"></td>
<td th:text="${hallbookingList[0]}"></td>
<td th:text="${hallbookingList[3]}"></td> <!-- Combined Zone/Division -->
<td th:text="${hallbookingList[1]}"></td>

2
src/main/resources/templates/admin/viewUploadNoc.html

@ -57,6 +57,7 @@
<thead class="thead-light">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Booking Id</th>
<th class="text-center">Zone</th>
<th class="text-center">Division</th>
<th class="text-center" width="20%">Hall Name</th>
@ -72,6 +73,7 @@
<tbody>
<tr th:each="booking, rowStat : ${waitingBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td>
<td class="text-center" th:text="${booking.bookingId}"></td>
<td class="text-center" th:text="${booking.hallDetails.zone}"></td>
<td class="text-center" th:text="${booking.hallDetails.division}"></td>
<td class="text-center" th:text="${booking.hallDetails.hallName}"></td>

2
src/main/resources/templates/headquarters/bookingwaiting.html

@ -51,6 +51,7 @@
<thead class="thead-light">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Booking Id</th>
<th class="text-center">Zone</th>
<th class="text-center">Division</th>
<th class="text-center" width="20%">Hall Name</th>
@ -66,6 +67,7 @@
<tbody>
<tr th:each="booking, rowStat : ${waitingBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td>
<td class="text-center" th:text="${booking.bookingId}"></td>
<td class="text-center" th:text="${booking.hallDetails.zone}"></td>
<td class="text-center" th:text="${booking.hallDetails.division}"></td>
<td class="text-center" th:text="${booking.hallDetails.hallName}"></td>

6
src/main/resources/templates/headquarters/reports.html

@ -291,6 +291,7 @@
<thead class="thead-dark">
<tr role="row">
<th>S.No</th>
<th width="130px">User Id</th>
<th>Name</th>
<th>Mobile</th>
<th>Address</th>
@ -301,6 +302,7 @@
</thead>
<tr th:each="user, iterStat : ${users}">
<td th:text="${iterStat.count}">0</td>
<td th:text="${user.userId}"></td>
<td th:text="${user.name}"></td>
<td th:text="${user.mobileNo}"></td>
<td
@ -418,6 +420,7 @@
<tr role="row">
<th>S.No</th>
<th width="110px">User Id</th>
<th>Name</th>
<th>Mobile</th>
<th>Address</th>
@ -427,6 +430,7 @@
<tr th:each="userbookingList, iterStat : ${userbookingLists}">
<td th:text="${iterStat.count}">0</td>
<td th:text="${userbookingList[0]}"></td>
<td th:text="${userbookingList[1]}"></td>
<td th:text="${userbookingList[2]}"></td>
<td th:text="${userbookingList[3]}"></td>
@ -443,6 +447,7 @@
<thead class="thead-dark">
<tr role="row">
<th>S.No</th>
<th>Hall Id</th>
<th>Hall Name</th>
<th>Zone/Division</th>
<th>Caretaker Name</th>
@ -459,6 +464,7 @@
<tbody>
<tr th:each="hallbookingList, iterStat : ${hallbookingLists}">
<td th:text="${iterStat.count}">0</td>
<td th:text="${hallbookingList[11]}"></td>
<td th:text="${hallbookingList[0]}"></td>
<td th:text="${hallbookingList[3]}"></td> <!-- Combined Zone/Division -->
<td th:text="${hallbookingList[1]}"></td>

2
src/main/resources/templates/headquarters/viewUploadNoc.html

@ -57,6 +57,7 @@
<thead class="thead-light">
<tr>
<th class="text-center no-sort">S.No</th>
<th class="text-center">Booking Id</th>
<th class="text-center">Zone</th>
<th class="text-center">Division</th>
<th class="text-center" width="20%">Hall Name</th>
@ -72,6 +73,7 @@
<tbody>
<tr th:each="booking, rowStat : ${waitingBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td>
<td class="text-center" th:text="${booking.bookingId}"></td>
<td class="text-center" th:text="${booking.hallDetails.zone}"></td>
<td class="text-center" th:text="${booking.hallDetails.division}"></td>
<td class="text-center" th:text="${booking.hallDetails.hallName}"></td>

27
src/main/resources/templates/officiallogin.html

@ -135,7 +135,8 @@
</div>
</div>
<div class="text-center mb-2" id="sendBtn">
<button type="button" class="btn btn-hero btn-primary" onclick="checkofficialMobileNo(1)">
<button type="button" class="btn btn-hero btn-primary"
onclick="checkofficialMobileNo(1)">
<i class="fa fa-fw fa-sign-in-alt opacity-50 me-1"></i> Send OTP
</button>
</div>
@ -276,7 +277,7 @@
<script>
function sendOTP() {
document.getElementById("error").style.display="none";
document.getElementById("error").style.display = "none";
//alert($('#mobii').val());
var mobileNo = $('#mobii').val();
var pin = $('#password').val();
@ -297,7 +298,7 @@
document.getElementById("otpInput").style.display = "block";
document.getElementById("sendBtn").style.display = "none";
document.getElementById("verifyBtn").style.display = "block";
document.getElementById("resend-container1").style.display="block";
document.getElementById("resend-container1").style.display = "block";
// console.log(mobileNo);
// Calculate the elapsed time since the request started
@ -321,6 +322,7 @@
}
}, 1000);
}
startCountdown2(); // Start Resend OTP count
},
error: function () {
@ -366,7 +368,7 @@
//document.getElementById("saveFeedbackForm").submit();
$.ajax({
type: "GET",
url: '/communityhall/user/api/verifyOTP',
url: '/communityhall/user/api/verifyofficialOTP',
data: {'otp': otpInputs, 'mobileNo': mobileNo},
dataType: 'text',
success: function (bodyMessage) {
@ -376,7 +378,7 @@
document.getElementById("loginBtn").style.display = "block";
document.getElementById("verifyBtn").style.display = "none";
document.getElementById("otpInput").style.display = "none";
document.getElementById("resend-container1").style.display="none";
document.getElementById("resend-container1").style.display = "none";
Swal.fire({
title: 'Login OTP',
@ -410,7 +412,7 @@
}
function login(flag) {
document.getElementById("resend-container1").style.display="none";
document.getElementById("resend-container1").style.display = "none";
var mobileNo = $("#mobii").val();
var pin = $("#password").val();
$.ajax({
@ -425,9 +427,10 @@
$("#mobii").val("");
$("#password").val("");
} else {
if(flag==1){
if (flag == 1) {
sendOTP();
} if(flag==2){
}
if (flag == 2) {
redirectToDashboard(response);
}
}
@ -522,13 +525,13 @@
}
function checkofficialMobileNo(flag) {
if(flag==1){
if (flag == 1) {
var mobileNo = $("#mobii").val();
if (mobileNo.trim() == '' || mobileNo.length == 0) {
alert("Please Enter Mobile No ");
}
}
if(flag==2){
if (flag == 2) {
var pincode = $("#pincode").val('');
var mobileNo = $("#officialmobileno").val();
if (mobileNo.trim() == '' || mobileNo.length == 0) {
@ -544,10 +547,10 @@
success: function (bodyMessage) {
//alert(bodyMessage);
if (bodyMessage == "success") {
if(flag==1){
if (flag == 1) {
login(1);
}
if(flag==2){
if (flag == 2) {
sendOTP2(mobileNo);
}
return false;

26
src/main/resources/templates/user/calculatehallamount.html

@ -504,12 +504,36 @@
var endPeriod = $('#endPeriodDropdown').val();
var reasonForBooking = $('#reasonforBooking').val();
if (reasonforBooking === '') {
$('#reasonforBooking')[0].setCustomValidity('Please select reason for booking.');
$('#reasonforBooking')[0].reportValidity();
return;
} else {
$('#reasonforBooking')[0].setCustomValidity('');
}
// Validate input fields
if (isNaN(numDays) || numDays < 1 || numDays > 7) {
$('#numDaysCount')[0].setCustomValidity('Please select a valid number of days.');
$('#numDaysCount')[0].reportValidity();
return;
}
if (startPeriod === '') {
$('#startPeriodDropdown')[0].setCustomValidity('Please select valid start period.');
$('#startPeriodDropdown')[0].reportValidity();
return;
} else {
$('#startPeriodDropdown')[0].setCustomValidity('');
}
if (endPeriod === '') {
$('#endPeriodDropdown')[0].setCustomValidity('Please select valid end period.');
$('#endPeriodDropdown')[0].reportValidity();
return;
} else {
$('#endPeriodDropdown')[0].setCustomValidity('');
}
if (reasonforBooking === 'SGE') {
var startPeriod = $('#startPeriodDropdown').val("1");
var endPeriod = $('#endPeriodDropdown').val("2");
@ -600,6 +624,8 @@
var isSGE = localStorage.getItem("isSGE") === "true";
var isCGE = localStorage.getItem("isCGE") === "true";
document.getElementById("numDaysCount").disabled = false;
var reasonForBooking = $('#reasonforBooking').val();
if ((reasonForBooking === 'SGE' && !isSGE) || (reasonForBooking === 'CGE' && !isCGE)) {

18
src/main/resources/templates/user/viewhistory.html

@ -674,6 +674,24 @@
th:attr="data-booking-id=${booking.booking_id}">Upload
NOC</span>
</a>
<a class="view-button"
th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
<span class="badge bg-danger"
style="cursor: pointer;"
th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
Booking</span>
</a>
</p>
<p th:case="'waitingfornocapproval'">
<a class="view-button"
th:if="${booking.booking_status == 'WAITING_FOR_NOC_APPROVAL'}">
<span class="badge bg-danger"
style="cursor: pointer;"
th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
Booking</span>
</a>
</p>
<!--<p th:case="'noaction'">
<a class="view-button">

Loading…
Cancel
Save