diff --git a/cd_waste_docs/cdwaste_aadhar/1_adhaar.jpg b/cd_waste_docs/cdwaste_aadhar/1_adhaar.jpg new file mode 100644 index 0000000..6085888 Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/1_adhaar.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/2_aadhaar card.jpg b/cd_waste_docs/cdwaste_aadhar/2_aadhaar card.jpg new file mode 100644 index 0000000..13bc2c1 Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/2_aadhaar card.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/3_adhaar.jpg b/cd_waste_docs/cdwaste_aadhar/3_adhaar.jpg new file mode 100644 index 0000000..6085888 Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/3_adhaar.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/4_adhaar.jpg b/cd_waste_docs/cdwaste_aadhar/4_adhaar.jpg new file mode 100644 index 0000000..6085888 Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/4_adhaar.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/5_adhaar.jpg b/cd_waste_docs/cdwaste_aadhar/5_adhaar.jpg new file mode 100644 index 0000000..6085888 Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/5_adhaar.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/6_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_aadhar/6_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/6_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/6_adhaar.jpg b/cd_waste_docs/cdwaste_aadhar/6_adhaar.jpg new file mode 100644 index 0000000..6085888 Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/6_adhaar.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/7_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_aadhar/7_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/7_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/7_adhaar.jpg b/cd_waste_docs/cdwaste_aadhar/7_adhaar.jpg new file mode 100644 index 0000000..6085888 Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/7_adhaar.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/8_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_aadhar/8_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/8_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_aadhar/8_adhaar.jpg b/cd_waste_docs/cdwaste_aadhar/8_adhaar.jpg new file mode 100644 index 0000000..6085888 Binary files /dev/null and b/cd_waste_docs/cdwaste_aadhar/8_adhaar.jpg differ diff --git a/cd_waste_docs/cdwaste_leasedoc/3_vehicle rc book.jpg b/cd_waste_docs/cdwaste_leasedoc/3_vehicle rc book.jpg new file mode 100644 index 0000000..c927225 Binary files /dev/null and b/cd_waste_docs/cdwaste_leasedoc/3_vehicle rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/1_rc book.jpg b/cd_waste_docs/cdwaste_rcbookdoc/1_rc book.jpg new file mode 100644 index 0000000..909feed Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/1_rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/2_rc book.jpg b/cd_waste_docs/cdwaste_rcbookdoc/2_rc book.jpg new file mode 100644 index 0000000..909feed Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/2_rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/3_rc book.jpg b/cd_waste_docs/cdwaste_rcbookdoc/3_rc book.jpg new file mode 100644 index 0000000..909feed Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/3_rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/4_rc book.jpg b/cd_waste_docs/cdwaste_rcbookdoc/4_rc book.jpg new file mode 100644 index 0000000..909feed Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/4_rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/5_rc book.jpg b/cd_waste_docs/cdwaste_rcbookdoc/5_rc book.jpg new file mode 100644 index 0000000..909feed Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/5_rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/6_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_rcbookdoc/6_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/6_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/6_rc book.jpg b/cd_waste_docs/cdwaste_rcbookdoc/6_rc book.jpg new file mode 100644 index 0000000..909feed Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/6_rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/7_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_rcbookdoc/7_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/7_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/7_rc book.jpg b/cd_waste_docs/cdwaste_rcbookdoc/7_rc book.jpg new file mode 100644 index 0000000..909feed Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/7_rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/8_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_rcbookdoc/8_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/8_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_rcbookdoc/8_rc book.jpg b/cd_waste_docs/cdwaste_rcbookdoc/8_rc book.jpg new file mode 100644 index 0000000..909feed Binary files /dev/null and b/cd_waste_docs/cdwaste_rcbookdoc/8_rc book.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/1_baby.jpg b/cd_waste_docs/cdwaste_userphoto/1_baby.jpg new file mode 100644 index 0000000..093232d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/1_baby.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/2_baby.jpg b/cd_waste_docs/cdwaste_userphoto/2_baby.jpg new file mode 100644 index 0000000..093232d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/2_baby.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/3_baby.jpg b/cd_waste_docs/cdwaste_userphoto/3_baby.jpg new file mode 100644 index 0000000..093232d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/3_baby.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/4_baby.jpg b/cd_waste_docs/cdwaste_userphoto/4_baby.jpg new file mode 100644 index 0000000..093232d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/4_baby.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/5_baby.jpg b/cd_waste_docs/cdwaste_userphoto/5_baby.jpg new file mode 100644 index 0000000..093232d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/5_baby.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/6_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_userphoto/6_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/6_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/6_baby.jpg b/cd_waste_docs/cdwaste_userphoto/6_baby.jpg new file mode 100644 index 0000000..093232d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/6_baby.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/7_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_userphoto/7_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/7_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/7_baby.jpg b/cd_waste_docs/cdwaste_userphoto/7_baby.jpg new file mode 100644 index 0000000..093232d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/7_baby.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/8_IMG_20250212_151602.jpg b/cd_waste_docs/cdwaste_userphoto/8_IMG_20250212_151602.jpg new file mode 100644 index 0000000..1d47d9d Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/8_IMG_20250212_151602.jpg differ diff --git a/cd_waste_docs/cdwaste_userphoto/8_bby.jpg b/cd_waste_docs/cdwaste_userphoto/8_bby.jpg new file mode 100644 index 0000000..bdd6145 Binary files /dev/null and b/cd_waste_docs/cdwaste_userphoto/8_bby.jpg differ diff --git a/pom.xml b/pom.xml index 24010ac..64b5d79 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com - volunteersregistration + volunteer 0.0.1-SNAPSHOT volunteersregistration volunteers registration diff --git a/src/main/java/com/volunteersregistration/config/AppConstants.java b/src/main/java/com/volunteersregistration/config/AppConstants.java index b8d8418..6ab1aae 100644 --- a/src/main/java/com/volunteersregistration/config/AppConstants.java +++ b/src/main/java/com/volunteersregistration/config/AppConstants.java @@ -1,11 +1,11 @@ package com.volunteersregistration.config; public final class AppConstants { -// public static String key_id="rzp_live_ySI5Ns54Y7qOcJ"; -// public static String key_secret="Nwf1TjhUtaskof8vePkRR8Sb"; + public static String key_id="rzp_live_ySI5Ns54Y7qOcJ"; + public static String key_secret="Nwf1TjhUtaskof8vePkRR8Sb"; //uncomment for testing payment - public static String key_id="rzp_test_tDkHFEqWXmuEi8"; - public static String key_secret="cBQUjMcKZ4J6vmOKSyNZ92py"; +// public static String key_id="rzp_test_tDkHFEqWXmuEi8"; +// public static String key_secret="cBQUjMcKZ4J6vmOKSyNZ92py"; } diff --git a/src/main/java/com/volunteersregistration/controller/ApiController.java b/src/main/java/com/volunteersregistration/controller/ApiController.java index aa8ded9..ad49f07 100644 --- a/src/main/java/com/volunteersregistration/controller/ApiController.java +++ b/src/main/java/com/volunteersregistration/controller/ApiController.java @@ -20,7 +20,7 @@ import com.volunteersregistration.config.UserSession; import com.volunteersregistration.entity.LoginDetail; import com.volunteersregistration.repository.LoginDetailRepo; - +import com.volunteersregistration.repository.VolunteerRegistrationRepo; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpSession; @@ -56,7 +56,8 @@ public class ApiController { private AppConfigur appConfig; - + @Autowired + private VolunteerRegistrationRepo volunteerRegistrationRepo; //for login @@ -135,5 +136,16 @@ public class ApiController { return "Error"; } } + + + @GetMapping(value = "/getAllCategory") + public List> getAllCategory() { + return volunteerRegistrationRepo.getAllCategory(); + } + + @GetMapping(value = "/getSubCategoryById") + public List> getSubCategoryById(@RequestParam int category_id) { + return volunteerRegistrationRepo.getSubCategoryById(category_id); + } } \ No newline at end of file diff --git a/src/main/java/com/volunteersregistration/controller/VolunteerController.java b/src/main/java/com/volunteersregistration/controller/VolunteerController.java index f3e0832..b29b021 100644 --- a/src/main/java/com/volunteersregistration/controller/VolunteerController.java +++ b/src/main/java/com/volunteersregistration/controller/VolunteerController.java @@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import com.volunteersregistration.config.UserSession; +import com.volunteersregistration.repository.VolunteerRegistrationRepo; import com.volunteersregistration.service.VolunteerRegistrationService; import jakarta.servlet.http.HttpServletRequest; @@ -32,6 +33,8 @@ public class VolunteerController { @Autowired private UserSession usersession; + + @Autowired public VolunteerRegistrationService volunteerRegistrationService; @@ -39,6 +42,8 @@ public class VolunteerController { public String register(@RequestParam(required = false) String ref, Model model) { System.out.println("indesx page....." + ref); model.addAttribute("ref", ref); + + return "index"; } @@ -55,6 +60,7 @@ public class VolunteerController { } return "kynreport"; // Render page if logged in } + @GetMapping(value = {"/allreports"}) public String allreports(Model model, HttpServletRequest request) { diff --git a/src/main/java/com/volunteersregistration/repository/VolunteerRegistrationRepo.java b/src/main/java/com/volunteersregistration/repository/VolunteerRegistrationRepo.java index 3fab629..d3e974a 100644 --- a/src/main/java/com/volunteersregistration/repository/VolunteerRegistrationRepo.java +++ b/src/main/java/com/volunteersregistration/repository/VolunteerRegistrationRepo.java @@ -23,4 +23,10 @@ public interface VolunteerRegistrationRepo extends JpaRepository> findByDateRange(@Param("fromDate") String fromDate, @Param("toDate") String toDate); + + @Query(value = "SELECT * FROM category_master WHERE is_active=1 AND is_delete=0", nativeQuery = true) + List> getAllCategory(); + + @Query(value ="SELECT * FROM sub_category_master WHERE is_active=1 AND is_delete=0 AND category_id=:category_id", nativeQuery = true) + List> getSubCategoryById(@Param("category_id") int category_id); } diff --git a/src/main/java/com/volunteersregistration/service/VolunteerRegistrationService.java b/src/main/java/com/volunteersregistration/service/VolunteerRegistrationService.java index 16d3cd7..47201da 100644 --- a/src/main/java/com/volunteersregistration/service/VolunteerRegistrationService.java +++ b/src/main/java/com/volunteersregistration/service/VolunteerRegistrationService.java @@ -16,6 +16,7 @@ import java.util.List; import java.util.Map; import java.util.StringJoiner; + @Service public class VolunteerRegistrationService { @Autowired @@ -154,5 +155,10 @@ public class VolunteerRegistrationService { } return new ArrayList<>(); } + + + public List> getAllCategory() { + return volunteerRegistrationRepo.getAllCategory(); + } } diff --git a/src/main/java/com/volunteersregistration/wasteCollector/controller/ApiController.java b/src/main/java/com/volunteersregistration/wasteCollector/controller/ApiController.java index 0de12cf..e3038ac 100644 --- a/src/main/java/com/volunteersregistration/wasteCollector/controller/ApiController.java +++ b/src/main/java/com/volunteersregistration/wasteCollector/controller/ApiController.java @@ -283,14 +283,19 @@ public class ApiController { } } - - - + @PostMapping("/accept") public ResponseEntity> acceptuserById(@RequestParam("registerId") Long registerId) { int rowsAffected = registrationService.updateUseraccept(registerId); + String refnum= wasteregistrationrepo.getreferencenumbyidforsms(registerId); + System.out.println("Register ID--------->"+registerId); + String mobilenum= wasteregistrationrepo.getmobilenumByRefnum(refnum); + System.out.println("Mobile Num--------->"+mobilenum); + + + // Fetch the WasteRegistration entity by registerId to get cdate WasteRegistration waste = wasteregistrationrepo.findByRegisterId(registerId); if (waste == null) { @@ -301,21 +306,17 @@ public class ApiController { } // Get the creation date (cdate) from the retrieved WasteRegistration - LocalDateTime cdate = waste.getCdate(); - + LocalDateTime cdate = waste.getCdate(); // Extract the year from cdate for firstnum int firstnum = cdate.getYear(); - - Cdlicense cdlicense= new Cdlicense(); - + Cdlicense cdlicense= new Cdlicense(); cdlicense.setCdate(LocalDateTime.now()); - cdlicense.setRegister_id(registerId); - + cdlicense.setRegister_id(registerId); String formattedRegisterId = String.format("%05d", registerId); cdlicense.setLicense_num(firstnum + "/" + formattedRegisterId); cdlicenserepo.save(cdlicense); - + Map response = new HashMap<>(); if (rowsAffected > 0) { response.put("status", "success"); @@ -327,10 +328,29 @@ public class ApiController { return ResponseEntity.ok(response); } + + + @PostMapping("/reject") public ResponseEntity> rejectuserById(@RequestParam("registerId") Long registerId,@RequestParam("reason")String reason) { int rowsAffected = registrationService.updateUserreject(reason,registerId); + String refnum= wasteregistrationrepo.getreferencenumbyidforsms(registerId); + System.out.println("Register ID--------->"+registerId); + String mobilenum= wasteregistrationrepo.getmobilenumByRefnum(refnum); + System.out.println("Mobile Num--------->"+mobilenum); + + + // Fetch the WasteRegistration entity by registerId to get cdate + WasteRegistration waste = wasteregistrationrepo.findByRegisterId(registerId); + if (waste == null) { + Map errorResponse = new HashMap<>(); + errorResponse.put("status", "error"); + errorResponse.put("message", "No WasteRegistration found for RegisterId: " + registerId); + return ResponseEntity.ok(errorResponse); + } + + Map response = new HashMap<>(); if (rowsAffected > 0) { response.put("status", "success"); @@ -342,14 +362,18 @@ public class ApiController { return ResponseEntity.ok(response); } + + @GetMapping("/generateQRCode") public ResponseEntity generateQRCodeForUser(@RequestParam("registerId") String registerId) { try { // Base URL and full URL construction - // String baseUrl = "https://gccservices.chennaicorporation.gov.in/volunteer/wastecollectors"; + //String baseUrl = "https://gccservices.chennaicorporation.gov.in/volunteer/wastecollectors"; + + String baseUrl = "https://gccservices.in/volunteer/wastecollectors"; - String baseUrl ="http://localhost:8071/volunteer/wastecollectors"; + // String baseUrl ="http://localhost:8071/volunteer/wastecollectors"; String refNum=wasteregistrationrepo.getreferencenumbyid(registerId); @@ -396,7 +420,7 @@ public class ApiController { public ResponseEntity>> viewapprovedList() { // Assuming a service method to fetch the data by register_id List> approvedDetails = registrationService.viewapprovedList(); - System.out.println(approvedDetails); + System.out.println("approvedDetails====="+approvedDetails); return ResponseEntity.ok(approvedDetails); } diff --git a/src/main/java/com/volunteersregistration/wasteCollector/controller/MainController.java b/src/main/java/com/volunteersregistration/wasteCollector/controller/MainController.java index c179bfe..e0a3b0e 100644 --- a/src/main/java/com/volunteersregistration/wasteCollector/controller/MainController.java +++ b/src/main/java/com/volunteersregistration/wasteCollector/controller/MainController.java @@ -78,6 +78,7 @@ public class MainController { public String wastecollectorsnew(Model model, @RequestParam("register_id") String reference_num) { WasteRegistration refnum=registrationRepo.findByReferenceNum(reference_num); + System.out.println("-----------Ref---------------"+refnum); if (refnum == null) { // If not found, add a message to the model and return a specific view model.addAttribute("message", "Sorry, your details not found..."); diff --git a/src/main/java/com/volunteersregistration/wasteCollector/repository/CdlicenseRepository.java b/src/main/java/com/volunteersregistration/wasteCollector/repository/CdlicenseRepository.java index 16767cd..625584f 100644 --- a/src/main/java/com/volunteersregistration/wasteCollector/repository/CdlicenseRepository.java +++ b/src/main/java/com/volunteersregistration/wasteCollector/repository/CdlicenseRepository.java @@ -10,8 +10,12 @@ import com.volunteersregistration.wasteCollector.entity.Cdlicense; @Repository public interface CdlicenseRepository extends JpaRepository { - @Query(value="SELECT license_num\r\n" - + "FROM cdlicense\r\n" - + "where register_id=:register_id", nativeQuery = true) +// @Query(value="SELECT license_num\r\n" +// + "FROM cdlicense\r\n" +// + "where register_id=:register_id", nativeQuery = true) +// String findlicensenumber(@Param("register_id") String register_id); + + @Query(value="SELECT license_num FROM cdlicense WHERE register_id=:register_id LIMIT 1", nativeQuery = true) String findlicensenumber(@Param("register_id") String register_id); + } diff --git a/src/main/java/com/volunteersregistration/wasteCollector/repository/WasteRegistrationRepo.java b/src/main/java/com/volunteersregistration/wasteCollector/repository/WasteRegistrationRepo.java index a72e9de..5a8a0b2 100644 --- a/src/main/java/com/volunteersregistration/wasteCollector/repository/WasteRegistrationRepo.java +++ b/src/main/java/com/volunteersregistration/wasteCollector/repository/WasteRegistrationRepo.java @@ -20,7 +20,10 @@ import com.volunteersregistration.wasteCollector.entity.WasteRegistration; @Repository public interface WasteRegistrationRepo extends JpaRepository { - @Query(value = "SELECT * FROM waste_collectors_registration WHERE vehicle_num = :vehicle_num", nativeQuery = true) +// @Query(value = "SELECT * FROM waste_collectors_registration WHERE vehicle_num = :vehicle_num", nativeQuery = true) +// Optional findByVehicleNum(@Param("vehicle_num") String vehicle_num); + + @Query(value = "SELECT * FROM waste_collectors_registration WHERE vehicle_num = :vehicle_num ORDER BY cdate DESC LIMIT 1", nativeQuery = true) Optional findByVehicleNum(@Param("vehicle_num") String vehicle_num); @Query(value = "SELECT * FROM waste_collectors_registration WHERE reference_num = :reference_num", nativeQuery = true) @@ -90,10 +93,10 @@ List> findUserDetailsById(@Param("registerId") Long register @Query(value = "SELECT name, vehicle_num,vehicletype,register_id,CONCAT(:baseUrl,user_photourl) as user_photourl FROM waste_collectors_registration where register_id=:register_id ", nativeQuery = true) List> viewIdDetails(@Param("register_id") String register_id,String baseUrl); - @Query(value = "SELECT register_id, name, mobile_no, acceptedby, accepteddate, address, vehicletype , vehicle_num FROM waste_collectors_registration WHERE application_status = 'APPROVED'", nativeQuery = true) + @Query(value = "SELECT register_id, name, mobile_no, acceptedby, date(accepteddate)as accept, address, vehicletype , vehicle_num FROM waste_collectors_registration WHERE application_status = 'APPROVED'", nativeQuery = true) List> approvedDetails(); - @Query(value = "SELECT register_id, name, mobile_no, acceptedby, accepteddate, address, vehicletype , vehicle_num, reason FROM waste_collectors_registration WHERE application_status = 'REJECTED'", nativeQuery = true) + @Query(value = "SELECT register_id, name, mobile_no, acceptedby, date(accepteddate)as reject, address, vehicletype , vehicle_num, reason FROM waste_collectors_registration WHERE application_status = 'REJECTED'", nativeQuery = true) List> rejectedDetails(); @Query(value="select mobile_no\r\n" @@ -110,7 +113,12 @@ List> findUserDetailsById(@Param("registerId") Long register @Query(value="select reference_num\r\n" + "from waste_collectors_registration\r\n" + "where register_id=:register_id",nativeQuery = true) - String getreferencenumbyid(@Param("register_id") String register_id); + String getreferencenumbyid(String register_id); + + @Query(value="select reference_num\r\n" + + "from waste_collectors_registration\r\n" + + "where register_id=:registerId",nativeQuery = true) + String getreferencenumbyidforsms(Long registerId); @Query(value="select register_id\r\n" diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 7c63de5..416feea 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -2,16 +2,16 @@ spring.application.name=volunteersregistration spring.datasource.url=jdbc:mysql://localhost:3306/volunteer spring.datasource.username=root -spring.datasource.password=Anto +spring.datasource.password=root spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver server.port=8071 -server.servlet.session.timeout=1m +server.servlet.session.timeout=5m -spring.servlet.multipart.max-file-size=20MB -spring.servlet.multipart.max-request-size=100MB +spring.servlet.multipart.max-file-size=30MB +spring.servlet.multipart.max-request-size=120MB app.baseUrl=http://localhost:8071 app.getOtpUrl=https://tmegov.onex-aura.com/api/sms? diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index ebee3d6..e803359 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -1,19 +1,20 @@ spring.application.name=volunteersregistration -spring.datasource.url=jdbc:mysql://localhost:3306/volunteer +spring.datasource.url=jdbc:mysql://gcc-facial-db-instance-1.cf48eqcciziq.ap-south-1.rds.amazonaws.com:3306/volunteer spring.datasource.username=root -spring.datasource.password=gccroot +spring.datasource.password=gcc-facial-password spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver server.port=8071 -server.servlet.session.timeout=1m +server.servlet.session.timeout=5m spring.servlet.multipart.max-file-size=30MB spring.servlet.multipart.max-request-size=120MB -app.baseUrl=https://gccservices.chennaicorporation.gov.in/volunteer +#app.baseUrl=https://gccservices.chennaicorporation.gov.in/volunteer +app.baseUrl=https://gccservices.in/volunteer app.getOtpUrl=https://tmegov.onex-aura.com/api/sms? app.title=GREATER CHENNAI CORPORATION - volunteers app.erpUrl=https://erp.chennaicorporation.gov.in/pgr/external/mobileservice? diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 257b306..b589b60 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1 @@ -spring.profiles.active=dev \ No newline at end of file + spring.profiles.active=dev \ No newline at end of file diff --git a/src/main/resources/static/images/full_ripon.png b/src/main/resources/static/images/full_ripon.png new file mode 100644 index 0000000..9d78fec Binary files /dev/null and b/src/main/resources/static/images/full_ripon.png differ diff --git a/src/main/resources/static/images/gcc_logo.png b/src/main/resources/static/images/gcc_logo.png new file mode 100644 index 0000000..c9f6573 Binary files /dev/null and b/src/main/resources/static/images/gcc_logo.png differ diff --git a/src/main/resources/static/images/sample1.jpg b/src/main/resources/static/images/sample1.jpg new file mode 100644 index 0000000..cedf558 Binary files /dev/null and b/src/main/resources/static/images/sample1.jpg differ diff --git a/src/main/resources/templates/allreports.html b/src/main/resources/templates/allreports.html index d7be2b8..47bb11a 100644 --- a/src/main/resources/templates/allreports.html +++ b/src/main/resources/templates/allreports.html @@ -152,12 +152,12 @@
+ placeholder="From Date" onclick="this.showPicker()"/>
+ placeholder="To Date" onclick="this.showPicker()"/>
@@ -173,7 +173,7 @@
- +
@@ -228,15 +228,15 @@ - + - - - + + + @@ -310,12 +310,12 @@ - + - - + + @@ -368,6 +368,7 @@ Org Email Pincode Preferred Area + Preferred Zone Previous Volunteered Sub Category Refer By @@ -385,14 +386,15 @@ 0 0 0 - 0 + 0 0 0 0 0 - 0 - 0 + 0 + + 0 @@ -414,6 +416,7 @@ Org Email Pincode Preferred Area + Preferred Zone Previous Volunteered Sub Category Refer By @@ -514,6 +517,49 @@ document.getElementById('logoutButton').addEventListener('click', function () { window.location.href = 'kynreportlogin' }); + + document.addEventListener("DOMContentLoaded", function () { + const fromDateInput = document.getElementById("fromdate"); + const toDateInput = document.getElementById("todate"); + const form = document.getElementById("myForm"); + + + if (fromDateInput.value) { + toDateInput.min = fromDateInput.value; + } + if (toDateInput.value) { + fromDateInput.max = toDateInput.value; + } + + + fromDateInput.addEventListener("change", function () { + if (fromDateInput.value) { + toDateInput.min = fromDateInput.value; + } else { + toDateInput.removeAttribute("min"); + } + }); + + toDateInput.addEventListener("change", function () { + if (toDateInput.value) { + fromDateInput.max = toDateInput.value; + } else { + fromDateInput.removeAttribute("max"); + } + }); + + + form.addEventListener("reset", function () { + + setTimeout(function () { + fromDateInput.removeAttribute("max"); + toDateInput.removeAttribute("min"); + }, 0); + }); + }); + /* function reloadPage() { + location.reload(); + } */ diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 3b0de62..353b91a 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -201,10 +201,11 @@
-
+ + @@ -220,17 +221,17 @@
@@ -880,7 +881,9 @@
- + + +
@@ -895,16 +898,18 @@ onsubmit="return verifyOtp();"> @@ -961,7 +966,7 @@ document.querySelector('.individual-form').style.display = 'none'; document.querySelector('.corporate-form').style.display = 'none'; document.querySelector('.ngo-form').style.display = 'none'; - function handleCategoryChange() { + /* function handleCategoryChange() { // Get selected category var category = document.getElementById("category").value; @@ -994,7 +999,58 @@ document.querySelector('.ngo-form').style.display = 'block'; subcategory.innerHTML += ``; } + } */ + + $(document).ready(function () { + $.ajax({ + url: "/volunteer/api/registration/getAllCategory", + type: "GET", + success: function (categories) { + let categoryDropdown = $('#category'); + categoryDropdown.append(``); + categories.forEach(function (cat) { + categoryDropdown.append(``); + }); + } + }); + }); + + function handleCategoryChange() { + var categoryId = $('#category').val(); + + // Hide all forms + $('.individual-form, .corporate-form, .ngo-form').hide(); + + // Clear and reset subcategory dropdown + let subcategory = $('#subcategory'); + subcategory.empty().append(''); + + // Determine form visibility based on selected category name + let selectedText = $('#category option:selected').text(); + + if (selectedText === "Individual") { + $('.individual-form').show(); + } else if (selectedText === "Corporate") { + $('.corporate-form').show(); + } else if (selectedText === "NGO/Other Associations") { + $('.ngo-form').show(); + } + + // Fetch subcategories + if (categoryId !== "-1") { + $.ajax({ + url: "/volunteer/api/registration/getSubCategoryById", + type: "GET", + data: { category_id: categoryId }, + success: function (subcategories) { + subcategories.forEach(function (sub) { + subcategory.append(``); + }); + } + }); + } } + function uncheckAnyArea() { } @@ -1010,7 +1066,10 @@ let emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/; let mobilePattern = /^[0-9]{10}$/; let pincodePattern = /^[0-9]{6}$/; + function validateForm() { + + var isValid = true; $('.text-danger').text(''); @@ -1020,13 +1079,23 @@ i++; }; }); - var category = document.getElementById("category").value; - if (category == undefined || category === "-1") { + var category = document.getElementById("category"); + var selectedTextcategory = category.options[category.selectedIndex].text; + //console.log("selectedTextcategory=="+selectedTextcategory); + if (selectedTextcategory === "Select") { $("#categoryError").text("Please Select Category"); isValid = false; } - if (category === "Individual") { - var subcategory = document.getElementById("subcategory").value; + var subcategory = document.getElementById("subcategory"); + var selectedTextsubcategory = subcategory.options[subcategory.selectedIndex].text; + //console.log("selectedTextsubcategory=="+selectedTextsubcategory); + if (selectedTextsubcategory === "Select") { + $("#subcategoryError").text("Please Select SubCategory !"); + isValid = false; + } + + if (selectedTextcategory === "Individual") { + var name = document.getElementById("name").value = document.getElementById("name").value.trim(); var email = document.getElementById("email").value = document.getElementById("email").value.trim(); let genderSelected = document.querySelector('input[name="gender"]:checked'); @@ -1044,10 +1113,9 @@ var dob = document.getElementById("dob").value = document.getElementById("dob").value.trim(); var aadhar = document.getElementById("aadhar").value = document.getElementById("aadhar").value.trim(); var bloodgroup = document.getElementById("bloodgroup").value; - if (subcategory == -1) { - $("#subcategoryError").text("Please Select SubCategory !"); - isValid = false; - } + + + if (name == undefined || name == "") { $("#nameError").text("Please Enter Name !"); isValid = false; @@ -1064,9 +1132,9 @@ // Check if verifiedOTP is disabled only during form submission if ($('#verifiedOTP').prop('disabled')) { Swal.fire({ - title: "Error!", + title: "Warning!", text: "OTP not Verified", - icon: "error", + icon: "warning", confirmButtonText: "OK" }); isValid = false; // Set isValid to false if verifiedOTP is disabled @@ -1126,14 +1194,12 @@ if (isValid) { $("#submitBtn").prop("disabled", true); - - //document.getElementById("submitBtn").disabled = true; saveTheIndividualForm(); + return false; } - return false; } - else if (category === "Corporate") { + else if (selectedTextcategory === "Corporate") { var cmpName = document.getElementById("cmpName").value = document.getElementById("cmpName").value.trim(); var cmpEmail = document.getElementById("cmpEmail").value = document.getElementById("cmpEmail").value.trim(); var cmpLandline = document.getElementById("cmpLandline").value = document.getElementById("cmpLandline").value.trim(); @@ -1182,20 +1248,18 @@ alert("Please select Preferred Area details !"); isValid = false; } - if (isValid) { + /* if (isValid) { saveCorporateDetails(); - } + } */ if (isValid) { - // Disable the submit button $("#submitBtn").prop("disabled", true); - - //$("#submitBtn").prop("disabled", true); saveCorporateDetails(); + return false; } return false; } - else if (category === "NGO") { + else if (selectedTextcategory === "NGO/Other Associations") { var cmpName = document.getElementById("ngoOrgName").value = document.getElementById("ngoOrgName").value.trim(); var ngoOrgEmail = document.getElementById("ngoOrgEmail").value = document.getElementById("ngoOrgEmail").value.trim(); var cmpLandline = document.getElementById("oLandline").value = document.getElementById("oLandline").value.trim(); @@ -1208,8 +1272,8 @@ var cmpPVolSelect = document.querySelector('input[name="oPvolY"]:checked'); var oPoE = document.getElementById("oPoE").value = document.getElementById("oPoE").value.trim(); - if (cmpName == undefined || cmpName == "") { - $("#ngoOrgNameError").text("Please Enter Organisation Name"); + if (cmpName == ""|| cmpName == undefined ) { + $("#ngoOrgNameError").text("Please Enter Organization Name"); isValid = false; } if (cmpAddress == undefined || cmpAddress == "") { @@ -1245,21 +1309,16 @@ isValid = false; } if (isValid) { + $("#submitBtn").prop("disabled", true); saveNGODetails(); + return false; } return false; - } - if (isValid) { - // Disable the submit button - //$("#submitBtn").prop("disabled", true); - $("#submitBtn").prop("disabled", true); - saveNGODetails(); - } - - return false; - } + return isValid; // Prevent default form submit in all cases + } + function saveTheIndividualForm() { @@ -1270,8 +1329,8 @@ // Create JSON object with form data var volunteerData = { - category: $("#category").val(), - subCategory: $("#subcategory").val(), + category: $("#category option:selected").text(), + subCategory: $("#subcategory option:selected").text(), name: $("#name").val(), email: $("#email").val(), dob: $("#dob").val(), @@ -1327,8 +1386,8 @@ preferredAreas.push($(this).val()); }); var copInfo = { - category: $("#category").val(), - subCategory: $("#subcategory").val(), + category: $("#category option:selected").text(), + subCategory: $("#subcategory option:selected").text(), compName: $("#cmpName").val(), compEmail: $("#cmpEmail").val(), landline: $("#cmpLandline").val(), @@ -1377,18 +1436,18 @@ preferredAreas.push($(this).val()); }); var ngoInfo = { - category: $("#category").val(), - subCategory: $("#subcategory").val(), + category: $("#category option:selected").text(), + subCategory: $("#subcategory option:selected").text(), orgName: $("#ngoOrgName").val(), orgEmail: $("#ngoOrgEmail").val(), - landline: $("#oLandline").val(), - mobileNo: $("#oMobile").val(), + /* landline: $("#oLandline").val(), + mobileNo: $("#oMobile").val(), */ district: $("#oDistrict").val(), address: $("#oAddress").val(), pinCode: $("#oPincode").val(), no_of_vol: $("#oNvol").val(), contactPerson: $("#oPoc").val(), - contactPerMobile: $("#oPom").val(), + mobileNo: $("#oPom").val(), cntPerEmail: $("#oPoE").val(), cntPerDesign: $("#oPod").val(), previous_volunteered: $("input[name='oPvolY']:checked").val(), @@ -1421,6 +1480,7 @@ } + function successPopup(id) { $("#submitBtn").prop("disabled", true); @@ -1606,6 +1666,10 @@ aadharError.textContent = 'Aadhar number must be exactly 12 digits.'; } } + + + + diff --git a/src/main/resources/templates/kynreportlogin.html b/src/main/resources/templates/kynreportlogin.html index bdb89f1..6bfb49c 100644 --- a/src/main/resources/templates/kynreportlogin.html +++ b/src/main/resources/templates/kynreportlogin.html @@ -1,448 +1,199 @@ - - - GCC - Volunteers - - - - - + + + GCC - Volunteers + + - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - -
-
-
-
diff --git a/src/main/resources/templates/modules/wastecollectors/noidcard.html b/src/main/resources/templates/modules/wastecollectors/noidcard.html index d7d9d2b..0e6a0c9 100644 --- a/src/main/resources/templates/modules/wastecollectors/noidcard.html +++ b/src/main/resources/templates/modules/wastecollectors/noidcard.html @@ -85,8 +85,17 @@

+
+
+
+ diff --git a/src/main/resources/templates/modules/wastecollectors/otp.html b/src/main/resources/templates/modules/wastecollectors/otp.html index e9a9b70..263ba16 100644 --- a/src/main/resources/templates/modules/wastecollectors/otp.html +++ b/src/main/resources/templates/modules/wastecollectors/otp.html @@ -149,7 +149,8 @@
+ aria-describedby="basic-addon1" + title="Please enter a valid 10-digit mobile number">