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. 1278
      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. 254
      src/main/java/com/gcc/communityHall/service/BookingService.java
  6. 64
      src/main/java/com/gcc/communityHall/service/Impl/BookingServiceImpl.java
  7. 5
      src/main/resources/application-dev.properties
  8. 3
      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

1278
src/main/java/com/gcc/communityHall/controller/Admincontroller.java
File diff suppressed because it is too large
View File

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

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

@ -19,137 +19,187 @@ 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 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 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);
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 String processEbDetailsAndDamage(
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 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);
public int checkUserBookinglimitation(int userId);
List<BookingDetails> getAllBookingsByUserId(Integer userId);
List<Map<String, Object>> getAllBookingEventsByUserId(Integer userId);
List<BookingDetails> getAllBookingsByUserId(Integer userId);
//List<BookingDetails> getAllBookingDetailsWithStatus(String fromDate, String toDate, String bookingStatus);
//List<Object[]> getAllPaymentsDetails( String fromDate, String toDate);
List<Map<String, Object>> getAllBookingEventsByUserId(Integer userId);
List<Object[]> getBookingUserDetailsReport(String fromDate, String toDate);
//List<BookingDetails> getAllBookingDetailsWithStatus(String fromDate, String toDate, String bookingStatus);
//List<Object[]> getAllPaymentsDetails( String fromDate, String toDate);
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);
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> getAllBookingDetailsByZoneWithStatus(String fromDate, String toDate, String zone,String bookingStatus);
List<Object[]> getAllPaymentsDetailsByZone (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> 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);
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);
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);
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<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> 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[]> getBookingHallDetailsReportByZoneByEventDate(String fromDate, String toDate, String zone);
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);
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> getAllBookingDetailsByZoneWithStatus(String fromDate, String toDate, String zone, String bookingStatus);
List<Object[]> getAllPaymentsDetailsByZone(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> 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);
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);
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);
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<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> 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[]> 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
List<BookingDetails> getApprovedBookingDetails();
List<BookingDetails> getRejectedBookingDetails();
BookingDetails saveebdetails(int bookingId, double startingReading, MultipartFile startingReadingimage);
String confirmStateBooking(int bookingId);
String uploadNOCFile(MultipartFile file, int bookingId);
//gccapps
List<BookingDetails> getApprovedBookingDetails();
List<BookingDetails> getRejectedBookingDetails();
List<Object[]> getAllPaymentsDetails(String fromDate, String toDate);
List<BookingDetails> getPastsEvents();
List<BookingDetails> getPresentsEvents();
List<BookingDetails> getFuturesEvents();
List<BookingDetails> getSettlementApprovedList();
List<Map<String, Object>> getHallDetails(Integer hall_id);
List<Object[]> getAllPaymentsDetails( String fromDate, String toDate);
List<BookingDetails> getPastsEvents();
List<BookingDetails> getWaitingforNOCapproval();
List<BookingDetails> getPresentsEvents();
List<Object[]> getAllExtraPaymentsDetails(String fromDate, String toDate, String paymentStatus, String zone, String division, Integer hallid);
List<BookingDetails> getFuturesEvents();
//developer
List<Object[]> getTransactionresponse(String fromDate, String toDate, Long bookingId, Long hallId);
List<BookingDetails> getSettlementApprovedList();
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) {

5
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
@ -70,4 +71,4 @@ app.getOtpUrl=https://tmegov.onex-aura.com/api/sms?
app.manualRefundCode=8520
app.fullUrl=http://localhost:8080
app.commErpUrl=http://coc-staging.egovernments.org:9980/pgr/external/mobileservice
app.commErpUrl=http://coc-staging.egovernments.org:9980/pgr/external/mobileservice

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

@ -52,4 +52,5 @@ app.getOtpUrl=https://tmegov.onex-aura.com/api/sms?
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">
<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