Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
examsAndAdmissions
Commits
c8e19e47
Unverified
Commit
c8e19e47
authored
1 year ago
by
Ankit Verma
Committed by
GitHub
1 year ago
Browse files
Options
Download
Plain Diff
Merge pull request #185 from Radheshhathwar/development
Handled hall ticket message
parents
54ae6b3e
72009f68
github/fork/ruksana2808/filter_bug_examCycle
development
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/HallTicketService.java
+16
-11
...o/upsmf/examsAndAdmissions/service/HallTicketService.java
with
16 additions
and
11 deletions
+16
-11
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/HallTicketService.java
+
16
−
11
View file @
c8e19e47
...
...
@@ -128,6 +128,7 @@ public class HallTicketService {
return
responseDto
;
}
public
ResponseDto
getHallTicketForStudent
(
Long
id
,
String
dateOfBirth
)
{
ResponseDto
response
=
new
ResponseDto
(
Constants
.
API_HALLTICKET_GET
);
...
...
@@ -517,6 +518,7 @@ public class HallTicketService {
response
.
setError
(
errorDetails
);
response
.
setResponseCode
(
status
);
}
private
byte
[]
generateHallTicket
(
StudentExamRegistration
registration
)
{
PDDocument
document
=
new
PDDocument
();
// Get the exam cycle for the registration
...
...
@@ -586,6 +588,7 @@ public class HallTicketService {
return
baos
.
toByteArray
();
}
private
List
<
StudentExamRegistration
>
fetchPendingDataForHallTickets
(
Long
courseId
,
Long
examCycleId
,
Long
instituteId
)
{
CriteriaBuilder
criteriaBuilder
=
entityManager
.
getCriteriaBuilder
();
CriteriaQuery
<
StudentExamRegistration
>
criteriaQuery
=
criteriaBuilder
.
createQuery
(
StudentExamRegistration
.
class
);
...
...
@@ -662,13 +665,14 @@ public class HallTicketService {
return
dto
;
}
private
double
computeAttendancePercentage
(
StudentExamRegistration
registration
)
{
// Fetch the student enrollment number from the associated student
String
studentEnrollmentNumber
=
registration
.
getStudent
().
getEnrollmentNumber
();
String
examCycleData
=
registration
.
getExamCycle
().
getExamCycleName
();
// Check if an attendance record exists for this student enrollment number
if
(!
attendanceRepository
.
existsByStudentEnrollmentNumberAndExamCycleData
(
studentEnrollmentNumber
,
examCycleData
))
{
if
(!
attendanceRepository
.
existsByStudentEnrollmentNumberAndExamCycleData
(
studentEnrollmentNumber
,
examCycleData
))
{
return
0.0
;
}
...
...
@@ -697,15 +701,15 @@ public class HallTicketService {
return
response
.
getBody
();
}
public
ResponseDto
getDetailsByStudentIdAndExamCycleId
(
Long
studentId
,
Long
examCycleId
)
{
ResponseDto
response
=
new
ResponseDto
(
Constants
.
API_HALLTICKET_GET_DETAILS_BY_STUDENT_AND_EXAM_CYCLE
);
public
ResponseDto
getDetailsByStudentIdAndExamCycleId
(
Long
studentId
,
Long
examCycleId
)
{
ResponseDto
response
=
new
ResponseDto
(
Constants
.
API_HALLTICKET_GET_DETAILS_BY_STUDENT_AND_EXAM_CYCLE
);
List
<
StudentExamRegistration
>
registrationList
=
studentExamRegistrationRepository
.
getByExamCycleIdAndStudentId
(
examCycleId
,
studentId
);
List
<
StudentExamRegistration
>
registrationList
=
studentExamRegistrationRepository
.
getByExamCycleIdAndStudentId
(
examCycleId
,
studentId
);
if
(
registrationList
==
null
)
{
ResponseDto
.
setErrorResponse
(
response
,
"NOT_FOUND"
,
"No data found for given student ID and exam cycle ID."
,
HttpStatus
.
NOT_FOUND
);
return
response
;
}
if
(
registrationList
.
isEmpty
()
)
{
ResponseDto
.
setErrorResponse
(
response
,
"NOT_FOUND"
,
"No data found for given student ID and exam cycle ID."
,
HttpStatus
.
NOT_FOUND
);
return
response
;
}
else
{
StudentExamRegistration
registration
=
registrationList
.
get
(
0
);
Map
<
String
,
Object
>
formattedData
=
new
HashMap
<>();
...
...
@@ -716,16 +720,16 @@ public class HallTicketService {
formattedData
.
put
(
"lastName"
,
student
.
getSurname
());
formattedData
.
put
(
"enrollmentNumber"
,
student
.
getEnrollmentNumber
());
formattedData
.
put
(
"dateOfBirth"
,
student
.
getDateOfBirth
());
if
(
student
.
getCourse
()
!=
null
)
{
if
(
student
.
getCourse
()
!=
null
)
{
formattedData
.
put
(
"courseName"
,
student
.
getCourse
().
getCourseName
());
formattedData
.
put
(
"courseYear"
,
student
.
getCourse
().
getCourseYear
());
}
// Add Hall Ticket details
if
(
registration
.
getHallTicketStatus
()
!=
null
)
{
if
(
registration
.
getHallTicketStatus
()
!=
null
)
{
formattedData
.
put
(
"hallTicketStatus"
,
registration
.
getHallTicketStatus
().
toString
());
// assuming HallTicketStatus is an enum
}
if
(
registration
.
getHallTicketGenerationDate
()
!=
null
)
{
if
(
registration
.
getHallTicketGenerationDate
()
!=
null
)
{
formattedData
.
put
(
"hallTicketGenerationDate"
,
registration
.
getHallTicketGenerationDate
());
}
...
...
@@ -770,4 +774,5 @@ public class HallTicketService {
return
response
;
}
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets