Commit df45990c authored by Radheshhathwar's avatar Radheshhathwar
Browse files

Hall ticket changes

1 merge request!184Hall ticket changes
Showing with 5 additions and 5 deletions
+5 -5
......@@ -61,4 +61,6 @@ public interface StudentExamRegistrationRepository extends JpaRepository<Student
StudentExamRegistration getByStudentId(Long id);
StudentExamRegistration getByStudentIdAndExamCycleId(Long studentId, Long examCycleId);
List<StudentExamRegistration> getByExamCycleIdAndStudentId(Long examCycleId, Long studentId);
}
......@@ -700,15 +700,13 @@ public class HallTicketService {
public ResponseDto getDetailsByStudentIdAndExamCycleId(Long studentId, Long examCycleId) {
ResponseDto response = new ResponseDto(Constants.API_HALLTICKET_GET_DETAILS_BY_STUDENT_AND_EXAM_CYCLE);
Optional<StudentExamRegistration> optionalRegistration =
studentExamRegistrationRepository.findByStudentIdAndExamCycleId(studentId, examCycleId);
List<StudentExamRegistration> registrationList = studentExamRegistrationRepository.getByExamCycleIdAndStudentId(examCycleId, studentId);
if (!optionalRegistration.isPresent()) {
if (registrationList == null) {
ResponseDto.setErrorResponse(response, "NOT_FOUND", "No data found for given student ID and exam cycle ID.", HttpStatus.NOT_FOUND);
return response;
}
StudentExamRegistration registration = optionalRegistration.get();
StudentExamRegistration registration = registrationList.get(0);
Map<String, Object> formattedData = new HashMap<>();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment