|
|
@ -215,7 +215,8 @@ public class RegistrationController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@PostMapping("/saveCollegeRegistration") |
|
|
@PostMapping("/saveCollegeRegistration") |
|
|
public Map<String, Object> saveCollegeRegistration(@RequestParam String name, @RequestParam String address, @RequestParam String mobile, |
|
|
|
|
|
|
|
|
public Map<String, Object> saveCollegeRegistration(@RequestParam String name, @RequestParam String address, |
|
|
|
|
|
@RequestParam String mobile, |
|
|
@RequestParam String visitorType, @RequestParam String Collegename, @RequestParam String department, |
|
|
@RequestParam String visitorType, @RequestParam String Collegename, @RequestParam String department, |
|
|
@RequestParam String years, @RequestParam int noofStudents, @RequestParam double Aproxage, |
|
|
@RequestParam String years, @RequestParam int noofStudents, @RequestParam double Aproxage, |
|
|
@RequestParam String language, @RequestParam boolean signLanguage, @RequestParam String visitDayTime) { |
|
|
@RequestParam String language, @RequestParam boolean signLanguage, @RequestParam String visitDayTime) { |
|
|
@ -282,17 +283,36 @@ public class RegistrationController { |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
@GetMapping("/bookingdetails") |
|
|
@GetMapping("/bookingdetails") |
|
|
public ResponseEntity<Map<String,Object>> getBookingDetails( |
|
|
|
|
|
@RequestParam("refId") String refId) { |
|
|
|
|
|
|
|
|
public ResponseEntity<Map<String, Object>> getBookingDetails( |
|
|
|
|
|
@RequestParam(value = "refId", required = false) String refId) { |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
if (refId == null || refId.trim().isEmpty()) { |
|
|
|
|
|
response.put("status", "Error"); |
|
|
|
|
|
response.put("message", "Missing required parameter: refId"); |
|
|
|
|
|
return ResponseEntity.badRequest().body(response); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
Map<String, Object> bookingDetails = registrationService.getBookingByRefId(refId); |
|
|
|
|
|
|
|
|
|
|
|
if (bookingDetails == null || bookingDetails.isEmpty()) { |
|
|
|
|
|
response.put("status", "Error"); |
|
|
|
|
|
response.put("message", "Booking not found for refId: " + refId); |
|
|
|
|
|
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(response); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Map<String,Object> bookingDetails = |
|
|
|
|
|
registrationService.getBookingByRefId(refId); |
|
|
|
|
|
|
|
|
return ResponseEntity.ok(bookingDetails); |
|
|
|
|
|
|
|
|
if (bookingDetails.isEmpty()) { |
|
|
|
|
|
return ResponseEntity.status(HttpStatus.NOT_FOUND).build(); |
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
response.put("status", "Error"); |
|
|
|
|
|
response.put("message", "Internal server error: " + e.getMessage()); |
|
|
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response); |
|
|
} |
|
|
} |
|
|
return ResponseEntity.ok(bookingDetails); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getAllData") |
|
|
@GetMapping("/getAllData") |
|
|
public ResponseEntity<Map<String, Object>> getAllData( |
|
|
public ResponseEntity<Map<String, Object>> getAllData( |
|
|
@ -341,7 +361,14 @@ public class RegistrationController { |
|
|
System.out.println("Visitor Category: " + visitorCategory); |
|
|
System.out.println("Visitor Category: " + visitorCategory); |
|
|
|
|
|
|
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
|
|
|
if (!"individual".equalsIgnoreCase(visitorCategory.trim())) { |
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "Only individual data is allowed."); |
|
|
|
|
|
return ResponseEntity.ok(response); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
List<Map<String, Object>> data = registrationService.getIndividualData(fromDate, toDate, visitorCategory); |
|
|
List<Map<String, Object>> data = registrationService.getIndividualData(fromDate, toDate, visitorCategory); |
|
|
|
|
|
|
|
|
System.out.println("Controller: Data from Service: " + data); |
|
|
System.out.println("Controller: Data from Service: " + data); |
|
|
@ -351,7 +378,7 @@ public class RegistrationController { |
|
|
response.put("data", data); |
|
|
response.put("data", data); |
|
|
} else { |
|
|
} else { |
|
|
response.put("Status", "Error"); |
|
|
response.put("Status", "Error"); |
|
|
response.put("Message", "No Data Found"); |
|
|
|
|
|
|
|
|
response.put("Message", "No Data Found for individual category"); |
|
|
} |
|
|
} |
|
|
return ResponseEntity.ok(response); |
|
|
return ResponseEntity.ok(response); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -365,8 +392,6 @@ public class RegistrationController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getFamilyData") |
|
|
@GetMapping("/getFamilyData") |
|
|
public ResponseEntity<Map<String, Object>> getFamilyData( |
|
|
public ResponseEntity<Map<String, Object>> getFamilyData( |
|
|
@RequestParam String fromDate, |
|
|
@RequestParam String fromDate, |
|
|
@ -380,6 +405,12 @@ public class RegistrationController { |
|
|
|
|
|
|
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
try { |
|
|
try { |
|
|
|
|
|
if (!"family".equalsIgnoreCase(visitorCategory.trim())) { |
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "Only family data is allowed."); |
|
|
|
|
|
return ResponseEntity.ok(response); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
List<Map<String, Object>> data = registrationService.getFamilyData(fromDate, toDate, visitorCategory); |
|
|
List<Map<String, Object>> data = registrationService.getFamilyData(fromDate, toDate, visitorCategory); |
|
|
|
|
|
|
|
|
System.out.println("Controller: Data from Service: " + data); |
|
|
System.out.println("Controller: Data from Service: " + data); |
|
|
@ -389,7 +420,7 @@ public class RegistrationController { |
|
|
response.put("data", data); |
|
|
response.put("data", data); |
|
|
} else { |
|
|
} else { |
|
|
response.put("Status", "Error"); |
|
|
response.put("Status", "Error"); |
|
|
response.put("Message", "No Data Found"); |
|
|
|
|
|
|
|
|
response.put("Message", "No Data Found for family category"); |
|
|
} |
|
|
} |
|
|
return ResponseEntity.ok(response); |
|
|
return ResponseEntity.ok(response); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -413,6 +444,12 @@ public class RegistrationController { |
|
|
|
|
|
|
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
try { |
|
|
try { |
|
|
|
|
|
if (!"school".equalsIgnoreCase(visitorCategory.trim())) { |
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "Only school data is allowed."); |
|
|
|
|
|
return ResponseEntity.ok(response); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
List<Map<String, Object>> data = registrationService.getSchoolData(fromDate, toDate, visitorCategory); |
|
|
List<Map<String, Object>> data = registrationService.getSchoolData(fromDate, toDate, visitorCategory); |
|
|
|
|
|
|
|
|
System.out.println("Controller: Data from Service: " + data); |
|
|
System.out.println("Controller: Data from Service: " + data); |
|
|
@ -422,7 +459,7 @@ public class RegistrationController { |
|
|
response.put("data", data); |
|
|
response.put("data", data); |
|
|
} else { |
|
|
} else { |
|
|
response.put("Status", "Error"); |
|
|
response.put("Status", "Error"); |
|
|
response.put("Message", "No Data Found"); |
|
|
|
|
|
|
|
|
response.put("Message", "No Data Found for school category"); |
|
|
} |
|
|
} |
|
|
return ResponseEntity.ok(response); |
|
|
return ResponseEntity.ok(response); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -446,6 +483,12 @@ public class RegistrationController { |
|
|
|
|
|
|
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
try { |
|
|
try { |
|
|
|
|
|
if (!"college".equalsIgnoreCase(visitorCategory.trim())) { |
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "Only college data is allowed."); |
|
|
|
|
|
return ResponseEntity.ok(response); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
List<Map<String, Object>> data = registrationService.getCollegeData(fromDate, toDate, visitorCategory); |
|
|
List<Map<String, Object>> data = registrationService.getCollegeData(fromDate, toDate, visitorCategory); |
|
|
|
|
|
|
|
|
System.out.println("Controller: Data from Service: " + data); |
|
|
System.out.println("Controller: Data from Service: " + data); |
|
|
@ -455,7 +498,7 @@ public class RegistrationController { |
|
|
response.put("data", data); |
|
|
response.put("data", data); |
|
|
} else { |
|
|
} else { |
|
|
response.put("Status", "Error"); |
|
|
response.put("Status", "Error"); |
|
|
response.put("Message", "No Data Found"); |
|
|
|
|
|
|
|
|
response.put("Message", "No Data Found for college category"); |
|
|
} |
|
|
} |
|
|
return ResponseEntity.ok(response); |
|
|
return ResponseEntity.ok(response); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -467,30 +510,35 @@ public class RegistrationController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/getlist") |
|
|
@GetMapping("/getlist") |
|
|
public Map<String, Object> getlist( |
|
|
|
|
|
@RequestParam Long mobileno){ |
|
|
|
|
|
|
|
|
public Map<String, Object> getlist(@RequestParam(required = false) Long mobileno) { |
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
Map<String, Object> response = new HashMap<>(); |
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> userList = registrationService.getListByMobileNo(mobileno); |
|
|
|
|
|
|
|
|
|
|
|
if(userList !=null && !userList.isEmpty()) { |
|
|
|
|
|
response.put("Message", "Success"); |
|
|
|
|
|
response.put("Data", userList); |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "No Data Found"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "Failed to retrieve data"); |
|
|
|
|
|
} |
|
|
|
|
|
return response; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check if parameter is missing |
|
|
|
|
|
if (mobileno == null) { |
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "Missing required parameter: mobileno"); |
|
|
|
|
|
return response; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
List<Map<String, Object>> userList = registrationService.getListByMobileNo(mobileno); |
|
|
|
|
|
|
|
|
|
|
|
if (userList != null && !userList.isEmpty()) { |
|
|
|
|
|
response.put("Status", "Success"); |
|
|
|
|
|
response.put("Data", userList); |
|
|
|
|
|
} else { |
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "This Mobile Number is not registered"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
response.put("Status", "Error"); |
|
|
|
|
|
response.put("Message", "Failed to retrieve data"); |
|
|
|
|
|
} |
|
|
|
|
|
return response; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getAllBookingCounts") |
|
|
@GetMapping("/getAllBookingCounts") |
|
|
public ResponseEntity<Map<String, Object>> getAllBookingCounts() { |
|
|
public ResponseEntity<Map<String, Object>> getAllBookingCounts() { |
|
|
|