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. 98
      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. 56
      src/main/java/com/gcc/communityHall/service/BookingService.java
  6. 62
      src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
  7. 1
      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. 9
      src/main/resources/templates/officiallogin.html
  16. 26
      src/main/resources/templates/user/calculatehallamount.html
  17. 18
      src/main/resources/templates/user/viewhistory.html

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

@ -1,4 +1,5 @@
package com.gcc.communityHall.controller; package com.gcc.communityHall.controller;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.ArrayList; import java.util.ArrayList;
@ -146,8 +147,7 @@ public class Admincontroller {
@GetMapping("/Reports") @GetMapping("/Reports")
public String viewReports(Model model,HttpSession session)
{
public String viewReports(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
if (adminname != null) { if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno"); long mobileno = (long) session.getAttribute("mobileno");
@ -160,8 +160,7 @@ public class Admincontroller {
} }
@GetMapping("/getReport") @GetMapping("/getReport")
public String getReports(Model model,HttpSession session)
{
public String getReports(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
if (adminname != null) { if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno"); long mobileno = (long) session.getAttribute("mobileno");
@ -175,8 +174,7 @@ public class Admincontroller {
@GetMapping("/HallDetails") @GetMapping("/HallDetails")
public String viewHallDetails(Model model,HttpSession session)
{
public String viewHallDetails(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
if (adminname != null) { if (adminname != null) {
long mobileno = (long) session.getAttribute("mobileno"); long mobileno = (long) session.getAttribute("mobileno");
@ -188,6 +186,7 @@ public class Admincontroller {
} }
} }
@GetMapping("/halldetailslist") @GetMapping("/halldetailslist")
public String viewhalldetailsList(Model model, HttpSession session) { public String viewhalldetailsList(Model model, HttpSession session) {
List<HallDetails> list = hallDetailsRepo.findAll(); List<HallDetails> list = hallDetailsRepo.findAll();
@ -288,12 +287,12 @@ public String RefundFailedList(Model model,HttpSession session) {
model.addAttribute("refundfailedcancelledbookings", refundfailedcancelledbookings); model.addAttribute("refundfailedcancelledbookings", refundfailedcancelledbookings);
model.addAttribute("refundfailedrejectedbookings", refundfailedrejectedbookings); model.addAttribute("refundfailedrejectedbookings", refundfailedrejectedbookings);
return "admin/refund-failedlist"; return "admin/refund-failedlist";
}
else {
} else {
session.invalidate(); session.invalidate();
return "redirect:/communityhall/login"; return "redirect:/communityhall/login";
} }
} }
@GetMapping("/settlement-completedlist") @GetMapping("/settlement-completedlist")
public String viewSettlementcompletedMaster(Model model, HttpSession session) { public String viewSettlementcompletedMaster(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
@ -314,6 +313,7 @@ else {
return "redirect:/communityhall/login"; return "redirect:/communityhall/login";
} }
} }
@GetMapping("/ReasonMaster") @GetMapping("/ReasonMaster")
public String viewreasonMaster(Model model, HttpSession session) { public String viewreasonMaster(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
@ -327,6 +327,7 @@ else {
return "redirect:/communityhall/login"; return "redirect:/communityhall/login";
} }
} }
@GetMapping("/userdeactive") @GetMapping("/userdeactive")
public String viewuserDetails(Model model, HttpSession session) { public String viewuserDetails(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
@ -340,6 +341,7 @@ else {
return "redirect:/communityhall/login"; return "redirect:/communityhall/login";
} }
} }
@GetMapping("/Gccblocking") @GetMapping("/Gccblocking")
public String viewGccBlocking(Model model, HttpSession session) { public String viewGccBlocking(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
@ -385,8 +387,6 @@ else {
} }
// Utility method to ensure distinct by a key // Utility method to ensure distinct by a key
private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Set<Object> seen = new HashSet<>(); Set<Object> seen = new HashSet<>();
@ -440,6 +440,7 @@ else {
// Redirect to a success page or return a ModelAndView as per your application flow // Redirect to a success page or return a ModelAndView as per your application flow
return "redirect:/communityhall/admin/halldetailslist"; return "redirect:/communityhall/admin/halldetailslist";
} }
@GetMapping("/approval-history") @GetMapping("/approval-history")
public String viewApproval(Model model, HttpSession session) { public String viewApproval(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
@ -497,6 +498,7 @@ else {
return "redirect:/communityhall/login"; return "redirect:/communityhall/login";
} }
} }
@GetMapping("/booking-list") @GetMapping("/booking-list")
public String viewBookingList(Model model, HttpSession session) { public String viewBookingList(Model model, HttpSession session) {
String adminname = (String) session.getAttribute("usertype"); String adminname = (String) session.getAttribute("usertype");
@ -647,23 +649,19 @@ else {
} }
} }
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")) { if (!request.equals("5")) {
return new ArrayList<>(); return new ArrayList<>();
} }
if(filterby.isEmpty())
{
if (filterby.isEmpty()) {
return bookingService.getBookingHallDetailsReportByBookingDate(fromDate, toDate, zone, division, hallid); 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,49 +687,36 @@ 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")) { if (!request.equals("2")) {
return new ArrayList<>(); return new ArrayList<>();
} }
if(filterby.isEmpty() && bookingStatus.isEmpty() && bookingId == null)
{
if (filterby.isEmpty() && bookingStatus.isEmpty() && bookingId == null) {
return bookingService.getBookingDetailsByBookingDate(fromDate, toDate, zone, division, hallid); return bookingService.getBookingDetailsByBookingDate(fromDate, toDate, zone, division, hallid);
} }
if(bookingId!=null && bookingStatus.isEmpty())
{
if (bookingId != null && bookingStatus.isEmpty()) {
return bookingDetailsRepo.getAllBookingDetailsWithBookingId(fromDate, toDate, bookingId); return bookingDetailsRepo.getAllBookingDetailsWithBookingId(fromDate, toDate, bookingId);
} }
if(bookingId!=null && !bookingStatus.isEmpty())
{
if (bookingId != null && !bookingStatus.isEmpty()) {
return bookingDetailsRepo.getAllBookingDetailsWithBookingIdwithbookingStatus(fromDate, toDate, bookingId, bookingStatus); return bookingDetailsRepo.getAllBookingDetailsWithBookingIdwithbookingStatus(fromDate, toDate, bookingId, bookingStatus);
} }
if(bookingId==null && filterby.isEmpty() && !bookingStatus.isEmpty())
{
if (bookingId == null && filterby.isEmpty() && !bookingStatus.isEmpty()) {
return bookingService.getBookingDetailsByBookingDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid); return bookingService.getBookingDetailsByBookingDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid);
} }
if(!filterby.isEmpty())
{
if (!filterby.isEmpty()) {
if ("1".equals(filterby))
{
if(bookingStatus.isEmpty())
{
if ("1".equals(filterby)) {
if (bookingStatus.isEmpty()) {
return bookingService.getBookingDetailsByBookingDate(fromDate, toDate, zone, division, hallid); return bookingService.getBookingDetailsByBookingDate(fromDate, toDate, zone, division, hallid);
}
else
{
} else {
return bookingService.getBookingDetailsByBookingDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid); return bookingService.getBookingDetailsByBookingDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid);
} }
} }
if ("2".equals(filterby))
{
if(bookingStatus.isEmpty())
{
if ("2".equals(filterby)) {
if (bookingStatus.isEmpty()) {
return bookingService.getBookingDetailsByEventDate(fromDate, toDate, zone, division, hallid); return bookingService.getBookingDetailsByEventDate(fromDate, toDate, zone, division, hallid);
}
else {
} else {
return bookingService.getBookingDetailsByEventDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid); return bookingService.getBookingDetailsByEventDateWithStatus(fromDate, toDate, bookingStatus, zone, division, hallid);
} }
@ -746,36 +731,26 @@ else {
if (!request.equals("6")) { if (!request.equals("6")) {
return new ArrayList<>(); return new ArrayList<>();
} }
if(filterby.isEmpty() && refundStatus.isEmpty())
{
if (filterby.isEmpty() && refundStatus.isEmpty()) {
return bookingService.getAllBookingsettlementDetailsByBookingDate(fromDate, toDate); return bookingService.getAllBookingsettlementDetailsByBookingDate(fromDate, toDate);
} }
if(filterby.isEmpty() && !refundStatus.isEmpty())
{
if (filterby.isEmpty() && !refundStatus.isEmpty()) {
return bookingService.getAllBookingsettlementDetailsByBookingDateWithStatus(fromDate, toDate, refundStatus); 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); return bookingService.getAllBookingsettlementDetailsByBookingDate(fromDate, toDate);
}
else
{
} else {
return bookingService.getAllBookingsettlementDetailsByBookingDateWithStatus(fromDate, toDate, refundStatus); 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); return bookingService.getAllBookingsettlementDetailsByEventDate(fromDate, toDate);
}
else {
} else {
return bookingService.getAllBookingsettlementDetailsByEventDateWithStatus(fromDate, toDate, refundStatus); return bookingService.getAllBookingsettlementDetailsByEventDateWithStatus(fromDate, toDate, refundStatus);
} }
@ -851,6 +826,7 @@ else {
return "redirect:/communityhall/login"; return "redirect:/communityhall/login";
} }
} }
// @GetMapping("/getDeveloperdetails") // @GetMapping("/getDeveloperdetails")
// public String getDetails(Model model,HttpSession session) // public String getDetails(Model model,HttpSession session)
// { // {

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

@ -238,8 +238,8 @@ public class UserAPIController {
//System.out.println(purpose); //System.out.println(purpose);
//System.out.print("\n MobileNo---:"+mobileNo); //System.out.print("\n MobileNo---:"+mobileNo);
Random rand = new Random(); 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); System.out.print("\n otp---:"+otp);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd-MMM-yyyy%20HH:mm"); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd-MMM-yyyy%20HH:mm");
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
@ -250,7 +250,7 @@ public class UserAPIController {
System.out.println(urlString); System.out.println(urlString);
System.out.println("\n urlString---: "+urlString); System.out.println("\n urlString---: "+urlString);
String bodyMessage = ""+otp; String bodyMessage = ""+otp;
try {
/*try {
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
String Response = restTemplate.getForObject(urlString, String.class); String Response = restTemplate.getForObject(urlString, String.class);
bodyMessage=Response; bodyMessage=Response;
@ -267,7 +267,7 @@ public class UserAPIController {
} catch (Exception e) { } catch (Exception e) {
// System.out.print("ERROR in Sending---: "+e); // System.out.print("ERROR in Sending---: "+e);
bodyMessage = "Error"; bodyMessage = "Error";
}
}*/
HttpSession session = request.getSession(); HttpSession session = request.getSession();
session.setAttribute("otp", otp); 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); 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 " + "FROM transaction_response tr " +
"JOIN hall_details hd ON tr.hall_id = hd.hall_id " + "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 " + "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 (:bookingId IS NULL OR tr.booking_id = :bookingId) " +
"AND (:hallId IS NULL OR tr.hall_id = :hallId)", nativeQuery = true) "AND (:hallId IS NULL OR tr.hall_id = :hallId)", nativeQuery = true)
List<Object[]> getTransactionResponseByBookingId(@Param("fromDate") String fromDate, 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 DATE(bd.booking_date) <= :toDate " +
"AND bd.booking_status NOT IN ('PENDING')" + "AND bd.booking_status NOT IN ('PENDING')" +
"GROUP BY " + "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); 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 " + "JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " + "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) nativeQuery = true)
List<Object[]> getAllBookingDetailsWithStatus(@Param("fromDate") String fromDate, List<Object[]> getAllBookingDetailsWithStatus(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @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 " + "JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " + "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) nativeQuery = true)
List<Object[]> getAllBookingDetailsWithBookingId(@Param("fromDate") String fromDate, List<Object[]> getAllBookingDetailsWithBookingId(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @Param("toDate") String toDate,
@ -210,7 +210,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"WHERE DATE(bd.booking_date) >= :fromDate " + "WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " + "AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId)" + "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) nativeQuery = true)
List<Object[]> getAllBookingDetailsWithBookingIdwithbookingStatus(@Param("fromDate") String fromDate, List<Object[]> getAllBookingDetailsWithBookingIdwithbookingStatus(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @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 hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " + "JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "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) nativeQuery = true)
List<Object[]> getAllBookingDetails(@Param("fromDate") String fromDate, @Param("toDate") String toDate); 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 'Past'\r\n"
+ " WHEN bd.start_date = CURDATE() THEN 'Current'\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' 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.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'" + " WHEN bd.reason IN ('State Govt Event','Central Govt Event','Commericial & Others') AND bd.booking_status='APPROVED' THEN 'noaction'"
+ " ELSE 'Future' \r\n" + " 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 (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " + "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) " +
"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, List<Object[]> getBookingDetailsByBookingDate(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid); @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 (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " + "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) " +
"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, List<Object[]> getBookingDetailsByBookingDateWithStatus(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @Param("toDate") String toDate,
@Param("bookingStatus") String bookingStatus, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid); @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 (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " + "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) " +
"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, List<Object[]> getBookingDetailsByEventDate(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid); @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 (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " + "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) " +
"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, List<Object[]> getBookingDetailsByEventDateWithStatus(@Param("fromDate") String fromDate,
@Param("toDate") String toDate, @Param("toDate") String toDate,
@Param("bookingStatus") String bookingStatus, @Param("zone") String zone, @Param("division") String division, @Param("hallid") Integer hallid); @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 (:paymentStatus IS NULL OR p.payment_status = :paymentStatus)" +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " + "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) 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); 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 (:paymentStatus IS NULL OR p.payment_status = :paymentStatus)" +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " + "AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " + "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) 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); 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(bd.gst) AS gst, " +
"SUM(p.amount_received) AS AmountReceived, " + "SUM(p.amount_received) AS AmountReceived, " +
"COALESCE(SUM(r.amount - r.balace_amount), 0) AS AmountRefund, " + "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 " + "FROM " +
"booking_details bd " + "booking_details bd " +
"JOIN " + "JOIN " +
@ -1270,7 +1272,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:division IS NULL OR :division = 'ALL' OR h.division = :division) " + "AND (:division IS NULL OR :division = 'ALL' OR h.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR h.hall_id = :hallid) " + "AND (:hallid IS NULL OR :hallid = '1000' OR h.hall_id = :hallid) " +
"GROUP BY " + "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); 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 " + "JOIN users us ON bd.users_user_id = us.user_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " + "left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "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); List<BookingDetails> getAllBookingsettlementDetailsByBookingDate(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
@Query(value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " + @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 " + "left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " + "WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " + "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); 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 " + @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 " + "JOIN users us ON bd.users_user_id = us.user_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " + "left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.start_date) >= :fromDate " + "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); List<BookingDetails> getAllBookingsettlementDetailsByEventDate(@Param("fromDate") String fromDate, @Param("toDate") String toDate);
@Query(value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " + @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 " + "left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.start_date) >= :fromDate " + "WHERE DATE(bd.start_date) >= :fromDate " +
"AND DATE(bd.end_date) <= :toDate " + "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); List<BookingDetails> getAllBookingsettlementDetailsByEventDateWithStatus(@Param("fromDate") String fromDate, @Param("toDate") String toDate, @Param("refundStatus") String refundStatus);
// In BookingDetailsRepository.java // In BookingDetailsRepository.java

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

@ -19,7 +19,9 @@ import com.gcc.communityHall.entity.GccBlockingDate;
public interface BookingService { public interface BookingService {
BookingDetails getBookingsById(int BookingId); BookingDetails getBookingsById(int BookingId);
BookingDetails updateBookingDetails(BookingDetails bd); 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 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 Map<String, Object> saveBookingDetails(Map<String, Object> formData);
@ -27,23 +29,30 @@ public interface BookingService {
public BookingDetails updateBookingStatustoGCCBlocked(BookingDetails bookingDetails); public BookingDetails updateBookingStatustoGCCBlocked(BookingDetails bookingDetails);
public BookingDetails updateBookingStatus(int bookingId, BookingDetails.BookingStatus status, String comments); public BookingDetails updateBookingStatus(int bookingId, BookingDetails.BookingStatus status, String comments);
public BookingDetails updateBookingStatusById(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 EbDetails updateEbDetails(int bookingId, double startUnit, double endUnit, char status);
//typeOfCancel depends { } //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 String confirmBooking(int bookingId);
public BookingDetails getBookingDetailsWithSettlement(int settlementId); public BookingDetails getBookingDetailsWithSettlement(int settlementId);
//sreeja //sreeja
List<BookingDetails> getPresentsEventsByUserId(Integer hallId); List<BookingDetails> getPresentsEventsByUserId(Integer hallId);
List<BookingDetails> getPastsEventsByUserId(Integer hallId); List<BookingDetails> getPastsEventsByUserId(Integer hallId);
List<BookingDetails> getFuturesEventsByUserId(Integer hallId); List<BookingDetails> getFuturesEventsByUserId(Integer hallId);
List<BookingDetails> getSettlementList(Integer hallId); List<BookingDetails> getSettlementList(Integer hallId);
public List<BookingDetails> getFilteredBookings(LocalDate fromDate, LocalDate toDate, List<Long> hallIds); 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( public String processEbDetailsAndDamage(
@ -53,10 +62,10 @@ public interface BookingService {
String assetNames[], String comments[], int quantities[], Double assetAmounts[], MultipartFile assetImages[]); String assetNames[], String comments[], int quantities[], Double assetAmounts[], MultipartFile assetImages[]);
public int checkUserBookinglimitation(int userId); 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); //List<BookingDetails> getAllBookingDetailsWithStatus(String fromDate, String toDate, String bookingStatus);
@ -66,10 +75,15 @@ public interface BookingService {
List<Object[]> getBookingUserDetailsReport(String fromDate, String toDate); List<Object[]> getBookingUserDetailsReport(String fromDate, String toDate);
List<Object[]> getBookingHallDetailsReport(String fromDate, String toDate); List<Object[]> getBookingHallDetailsReport(String fromDate, String toDate);
List<GccBlockingDate> getBlockedEvents(LocalDate fromDate, LocalDate toDate, List<Long> hallIds); List<GccBlockingDate> getBlockedEvents(LocalDate fromDate, LocalDate toDate, List<Long> hallIds);
List<Map<String, Object>> getOfflineBookings(); 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 updateCancelledBookingStatus(int bookingId, BookingStatus status, String comments);
BookingDetails updateRefundStatus(int bookingId, RefundStatus status); BookingDetails updateRefundStatus(int bookingId, RefundStatus status);
//officer service //officer service
@ -80,13 +94,19 @@ public interface BookingService {
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); 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); List<Object> getGccBlockingEvents(String hallId);
int getBlockedHallCount(String blockingReason, Date startDate, Date endDate); int getBlockedHallCount(String blockingReason, Date startDate, Date endDate);
@Transactional @Transactional
void cancelAllBookings(String fromDate, String toDate, List<Long> hallIdsList, 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); List<BookingDetails> findBookingDetailsByBookingId(Long bookingId);
//admin dashboard //admin dashboard
@ -102,31 +122,55 @@ public interface BookingService {
//admin reports //admin reports
List<Object[]> getBookingDetailsByBookingDate(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[]> 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[]> 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[]> 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[]> 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[]> 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[]> getBookingHallDetailsReportByEventDate(String fromDate, String toDate, String zone, String division, Integer hallid);
List<BookingDetails> getAllBookingsettlementDetailsByBookingDate(String fromDate, String toDate); List<BookingDetails> getAllBookingsettlementDetailsByBookingDate(String fromDate, String toDate);
List<BookingDetails> getAllBookingsettlementDetailsByBookingDateWithStatus(String fromDate, String toDate, String refundStatus); List<BookingDetails> getAllBookingsettlementDetailsByBookingDateWithStatus(String fromDate, String toDate, String refundStatus);
List<BookingDetails> getAllBookingsettlementDetailsByEventDate(String fromDate, String toDate); List<BookingDetails> getAllBookingsettlementDetailsByEventDate(String fromDate, String toDate);
List<BookingDetails> getAllBookingsettlementDetailsByEventDateWithStatus(String fromDate, String toDate, String refundStatus); List<BookingDetails> getAllBookingsettlementDetailsByEventDateWithStatus(String fromDate, String toDate, String refundStatus);
List<BookingDetails> getAllBookingDetailsBookingDateByZone(String fromDate, String toDate, String zone); List<BookingDetails> getAllBookingDetailsBookingDateByZone(String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingDetailsEventDateByZone(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> getAllBookingDetailsBookingDateByZoneWithStatus(String fromDate, String toDate, String zone, String bookingStatus);
List<BookingDetails> getAllBookingDetailsEventDateByZoneWithStatus(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> getAllBookingsettlementDetailsByZoneByBookingDate(String fromDate, String toDate, String zone);
List<BookingDetails> getAllBookingsettlementDetailsByZoneByEventDate(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> getAllBookingsettlementDetailsByZoneByBookingDateWithStatus(String fromDate, String toDate, String zone, String refundStatus);
List<BookingDetails> getAllBookingsettlementDetailsByZoneByEventDateWithStatus(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[]> getBookingHallDetailsReportByZoneByEventDate(String fromDate, String toDate, String zone);
List<Object[]> getBookingHallDetailsReportByZoneByBookingDateHallname(String fromDate, String toDate, String zone, Integer hallId); List<Object[]> getBookingHallDetailsReportByZoneByBookingDateHallname(String fromDate, String toDate, String zone, Integer hallId);
List<Object[]> getBookingHallDetailsReportByZoneByEventDateHallname(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); BookingDetails saveebdetails(int bookingId, double startingReading, MultipartFile startingReadingimage);
String confirmStateBooking(int bookingId); String confirmStateBooking(int bookingId);
String uploadNOCFile(MultipartFile file, int bookingId); String uploadNOCFile(MultipartFile file, int bookingId);
//gccapps //gccapps
@ -135,6 +179,7 @@ List<Object[]> getBookingHallDetailsReportByZoneByBookingDate(String fromDate, S
List<BookingDetails> getRejectedBookingDetails(); List<BookingDetails> getRejectedBookingDetails();
List<Object[]> getAllPaymentsDetails(String fromDate, String toDate); List<Object[]> getAllPaymentsDetails(String fromDate, String toDate);
List<BookingDetails> getPastsEvents(); List<BookingDetails> getPastsEvents();
List<BookingDetails> getPresentsEvents(); List<BookingDetails> getPresentsEvents();
@ -144,11 +189,16 @@ List<Object[]> getBookingHallDetailsReportByZoneByBookingDate(String fromDate, S
List<BookingDetails> getSettlementApprovedList(); List<BookingDetails> getSettlementApprovedList();
List<Map<String, Object>> getHallDetails(Integer hall_id); List<Map<String, Object>> getHallDetails(Integer hall_id);
List<BookingDetails> getWaitingforNOCapproval(); List<BookingDetails> getWaitingforNOCapproval();
List<Object[]> getAllExtraPaymentsDetails(String fromDate, String toDate, String paymentStatus, String zone, String division, Integer hallid); List<Object[]> getAllExtraPaymentsDetails(String fromDate, String toDate, String paymentStatus, String zone, String division, Integer hallid);
//developer //developer
List<Object[]> getTransactionresponse(String fromDate, String toDate, Long bookingId, Long hallId); List<Object[]> getTransactionresponse(String fromDate, String toDate, Long bookingId, Long hallId);
List<Object[]> getRefundResponse(String fromDate, String toDate, Long bookingId); 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); List<BookingDetails> getBookingsByDateAndHall(String bookingDate, Long hallId);

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

@ -326,7 +326,12 @@ public class BookingServiceImpl implements BookingService {
bookingCalendarRepository.save(bookingCalendar); bookingCalendarRepository.save(bookingCalendar);
i++; i++;
} }
String reason = bookingDetails.getReason();
String statusMessage = processBookingStatusAndSendMessages(bookingDetails);
return statusMessage;
/*String reason = bookingDetails.getReason();
ReasonMaster reasondetails = reasonMasterRepository.findByReason(reason); ReasonMaster reasondetails = reasonMasterRepository.findByReason(reason);
String reasoncode = reasondetails.getReasoncode(); String reasoncode = reasondetails.getReasoncode();
if (reasoncode == null) { if (reasoncode == null) {
@ -348,8 +353,9 @@ public class BookingServiceImpl implements BookingService {
whatsappMsgServiceImpl.sendMsg(whatsupmsg); whatsappMsgServiceImpl.sendMsg(whatsupmsg);
whatsappMsgServiceImpl.sendSMS(urlString); whatsappMsgServiceImpl.sendSMS(urlString);
return "Booking confirmed successfully"; return "Booking confirmed successfully";
}
}*/
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
bookingFailure(bookingDetails, 2); bookingFailure(bookingDetails, 2);
// System.out.println(bookingDetails.getBookingStatus()+","+bookingDetails.getRefundStatus()+","+bookingDetails.getComments()); // System.out.println(bookingDetails.getBookingStatus()+","+bookingDetails.getRefundStatus()+","+bookingDetails.getComments());
return "redirect:/communityhall/user/acknowledgement?bookingId=" + bookingDetails.getBookingId(); 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 @Override
@Transactional @Transactional
public String confirmStateBooking(int bookingId) { public String confirmStateBooking(int bookingId) {

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

@ -1,6 +1,7 @@
spring.application.name=communityHall 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/testcommunityhall
#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/communityhall_13032025
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=root spring.datasource.password=root

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

@ -53,3 +53,4 @@ app.getOtpUrl=https://tmegov.onex-aura.com/api/sms?
app.manualRefundCode=8520 app.manualRefundCode=8520
app.fullUrl=https://gccservices.chennaicorporation.gov.in/communityhall 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"> <thead class="thead-light">
<tr> <tr>
<th class="text-center no-sort">S.No</th> <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">Zone</th>
<th class="text-center">Division</th> <th class="text-center">Division</th>
<th class="text-center" width="20%">Hall Name</th> <th class="text-center" width="20%">Hall Name</th>
@ -66,6 +67,7 @@
<tbody> <tbody>
<tr th:each="booking, rowStat : ${waitingBookings}"> <tr th:each="booking, rowStat : ${waitingBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td> <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.zone}"></td>
<td class="text-center" th:text="${booking.hallDetails.division}"></td> <td class="text-center" th:text="${booking.hallDetails.division}"></td>
<td class="text-center" th:text="${booking.hallDetails.hallName}"></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"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
<th width="130px">User Id</th>
<th>Name</th> <th>Name</th>
<th>Mobile</th> <th>Mobile</th>
<th>Address</th> <th>Address</th>
@ -302,6 +303,7 @@
</thead> </thead>
<tr th:each="user, iterStat : ${users}"> <tr th:each="user, iterStat : ${users}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td th:text="${user.userId}"></td>
<td th:text="${user.name}"></td> <td th:text="${user.name}"></td>
<td th:text="${user.mobileNo}"></td> <td th:text="${user.mobileNo}"></td>
<td <td
@ -460,8 +462,8 @@
role="grid" width="99.5%"> role="grid" width="99.5%">
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
<th width="110px">User Id</th>
<th>Name</th> <th>Name</th>
<th>Mobile</th> <th>Mobile</th>
<th>Address</th> <th>Address</th>
@ -471,6 +473,7 @@
<tr th:each="userbookingList, iterStat : ${userbookingLists}"> <tr th:each="userbookingList, iterStat : ${userbookingLists}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td th:text="${userbookingList[0]}"></td>
<td th:text="${userbookingList[1]}"></td> <td th:text="${userbookingList[1]}"></td>
<td th:text="${userbookingList[2]}"></td> <td th:text="${userbookingList[2]}"></td>
<td th:text="${userbookingList[3]}"></td> <td th:text="${userbookingList[3]}"></td>
@ -487,6 +490,7 @@
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
<th>Hall Id</th>
<th>Hall Name</th> <th>Hall Name</th>
<th>Zone/Division</th> <th>Zone/Division</th>
<th>Caretaker Name</th> <th>Caretaker Name</th>
@ -503,6 +507,7 @@
<tbody> <tbody>
<tr th:each="hallbookingList, iterStat : ${hallbookingLists}"> <tr th:each="hallbookingList, iterStat : ${hallbookingLists}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td th:text="${hallbookingList[11]}"></td>
<td th:text="${hallbookingList[0]}"></td> <td th:text="${hallbookingList[0]}"></td>
<td th:text="${hallbookingList[3]}"></td> <!-- Combined Zone/Division --> <td th:text="${hallbookingList[3]}"></td> <!-- Combined Zone/Division -->
<td th:text="${hallbookingList[1]}"></td> <td th:text="${hallbookingList[1]}"></td>

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

@ -57,6 +57,7 @@
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th class="text-center no-sort">S.No</th> <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">Zone</th>
<th class="text-center">Division</th> <th class="text-center">Division</th>
<th class="text-center" width="20%">Hall Name</th> <th class="text-center" width="20%">Hall Name</th>
@ -72,6 +73,7 @@
<tbody> <tbody>
<tr th:each="booking, rowStat : ${waitingBookings}"> <tr th:each="booking, rowStat : ${waitingBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td> <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.zone}"></td>
<td class="text-center" th:text="${booking.hallDetails.division}"></td> <td class="text-center" th:text="${booking.hallDetails.division}"></td>
<td class="text-center" th:text="${booking.hallDetails.hallName}"></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"> <thead class="thead-light">
<tr> <tr>
<th class="text-center no-sort">S.No</th> <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">Zone</th>
<th class="text-center">Division</th> <th class="text-center">Division</th>
<th class="text-center" width="20%">Hall Name</th> <th class="text-center" width="20%">Hall Name</th>
@ -66,6 +67,7 @@
<tbody> <tbody>
<tr th:each="booking, rowStat : ${waitingBookings}"> <tr th:each="booking, rowStat : ${waitingBookings}">
<td class="text-center" th:text="${rowStat.index + 1}"></td> <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.zone}"></td>
<td class="text-center" th:text="${booking.hallDetails.division}"></td> <td class="text-center" th:text="${booking.hallDetails.division}"></td>
<td class="text-center" th:text="${booking.hallDetails.hallName}"></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"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
<th width="130px">User Id</th>
<th>Name</th> <th>Name</th>
<th>Mobile</th> <th>Mobile</th>
<th>Address</th> <th>Address</th>
@ -301,6 +302,7 @@
</thead> </thead>
<tr th:each="user, iterStat : ${users}"> <tr th:each="user, iterStat : ${users}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td th:text="${user.userId}"></td>
<td th:text="${user.name}"></td> <td th:text="${user.name}"></td>
<td th:text="${user.mobileNo}"></td> <td th:text="${user.mobileNo}"></td>
<td <td
@ -418,6 +420,7 @@
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
<th width="110px">User Id</th>
<th>Name</th> <th>Name</th>
<th>Mobile</th> <th>Mobile</th>
<th>Address</th> <th>Address</th>
@ -427,6 +430,7 @@
<tr th:each="userbookingList, iterStat : ${userbookingLists}"> <tr th:each="userbookingList, iterStat : ${userbookingLists}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td th:text="${userbookingList[0]}"></td>
<td th:text="${userbookingList[1]}"></td> <td th:text="${userbookingList[1]}"></td>
<td th:text="${userbookingList[2]}"></td> <td th:text="${userbookingList[2]}"></td>
<td th:text="${userbookingList[3]}"></td> <td th:text="${userbookingList[3]}"></td>
@ -443,6 +447,7 @@
<thead class="thead-dark"> <thead class="thead-dark">
<tr role="row"> <tr role="row">
<th>S.No</th> <th>S.No</th>
<th>Hall Id</th>
<th>Hall Name</th> <th>Hall Name</th>
<th>Zone/Division</th> <th>Zone/Division</th>
<th>Caretaker Name</th> <th>Caretaker Name</th>
@ -459,6 +464,7 @@
<tbody> <tbody>
<tr th:each="hallbookingList, iterStat : ${hallbookingLists}"> <tr th:each="hallbookingList, iterStat : ${hallbookingLists}">
<td th:text="${iterStat.count}">0</td> <td th:text="${iterStat.count}">0</td>
<td th:text="${hallbookingList[11]}"></td>
<td th:text="${hallbookingList[0]}"></td> <td th:text="${hallbookingList[0]}"></td>
<td th:text="${hallbookingList[3]}"></td> <!-- Combined Zone/Division --> <td th:text="${hallbookingList[3]}"></td> <!-- Combined Zone/Division -->
<td th:text="${hallbookingList[1]}"></td> <td th:text="${hallbookingList[1]}"></td>

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

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

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

@ -135,7 +135,8 @@
</div> </div>
</div> </div>
<div class="text-center mb-2" id="sendBtn"> <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 <i class="fa fa-fw fa-sign-in-alt opacity-50 me-1"></i> Send OTP
</button> </button>
</div> </div>
@ -321,6 +322,7 @@
} }
}, 1000); }, 1000);
} }
startCountdown2(); // Start Resend OTP count startCountdown2(); // Start Resend OTP count
}, },
error: function () { error: function () {
@ -366,7 +368,7 @@
//document.getElementById("saveFeedbackForm").submit(); //document.getElementById("saveFeedbackForm").submit();
$.ajax({ $.ajax({
type: "GET", type: "GET",
url: '/communityhall/user/api/verifyOTP',
url: '/communityhall/user/api/verifyofficialOTP',
data: {'otp': otpInputs, 'mobileNo': mobileNo}, data: {'otp': otpInputs, 'mobileNo': mobileNo},
dataType: 'text', dataType: 'text',
success: function (bodyMessage) { success: function (bodyMessage) {
@ -427,7 +429,8 @@
} else { } else {
if (flag == 1) { if (flag == 1) {
sendOTP(); sendOTP();
} if(flag==2){
}
if (flag == 2) {
redirectToDashboard(response); redirectToDashboard(response);
} }
} }

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

@ -504,12 +504,36 @@
var endPeriod = $('#endPeriodDropdown').val(); var endPeriod = $('#endPeriodDropdown').val();
var reasonForBooking = $('#reasonforBooking').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 // Validate input fields
if (isNaN(numDays) || numDays < 1 || numDays > 7) { if (isNaN(numDays) || numDays < 1 || numDays > 7) {
$('#numDaysCount')[0].setCustomValidity('Please select a valid number of days.'); $('#numDaysCount')[0].setCustomValidity('Please select a valid number of days.');
$('#numDaysCount')[0].reportValidity(); $('#numDaysCount')[0].reportValidity();
return; 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') { if (reasonforBooking === 'SGE') {
var startPeriod = $('#startPeriodDropdown').val("1"); var startPeriod = $('#startPeriodDropdown').val("1");
var endPeriod = $('#endPeriodDropdown').val("2"); var endPeriod = $('#endPeriodDropdown').val("2");
@ -600,6 +624,8 @@
var isSGE = localStorage.getItem("isSGE") === "true"; var isSGE = localStorage.getItem("isSGE") === "true";
var isCGE = localStorage.getItem("isCGE") === "true"; var isCGE = localStorage.getItem("isCGE") === "true";
document.getElementById("numDaysCount").disabled = false;
var reasonForBooking = $('#reasonforBooking').val(); var reasonForBooking = $('#reasonforBooking').val();
if ((reasonForBooking === 'SGE' && !isSGE) || (reasonForBooking === 'CGE' && !isCGE)) { 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 th:attr="data-booking-id=${booking.booking_id}">Upload
NOC</span> NOC</span>
</a> </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>
<!--<p th:case="'noaction'"> <!--<p th:case="'noaction'">
<a class="view-button"> <a class="view-button">

Loading…
Cancel
Save