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
e651fecd
Commit
e651fecd
authored
1 year ago
by
Ruksana Semeir
Browse files
Options
Download
Patches
Plain Diff
Added code for provisional id generation
parent
8d7c1465
github/fork/ruksana2808/filter_bug_examCycle
1 merge request
!192
Added code for provisional id generation
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/StudentController.java
+4
-3
...psmf/examsAndAdmissions/controller/StudentController.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/StudentService.java
+7
-2
...ento/upsmf/examsAndAdmissions/service/StudentService.java
with
11 additions
and
5 deletions
+11
-5
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/StudentController.java
+
4
−
3
View file @
e651fecd
...
...
@@ -37,10 +37,11 @@ public class StudentController {
public
ResponseEntity
<
ResponseDto
>
getFilteredStudents
(
@RequestParam
(
required
=
false
)
Long
instituteId
,
@RequestParam
(
required
=
false
)
Long
courseId
,
@RequestParam
(
required
=
false
)
String
session
,
@RequestParam
(
required
=
false
)
VerificationStatus
verificationStatus
)
{
@RequestParam
(
required
=
false
)
String
academicYear
,
@RequestParam
(
required
=
false
)
VerificationStatus
verificationStatus
,
@RequestParam
(
required
=
false
)
Long
examCycleId
)
{
ResponseDto
response
=
studentService
.
getFilteredStudents
(
instituteId
,
courseId
,
session
,
verificationStatus
);
ResponseDto
response
=
studentService
.
getFilteredStudents
(
instituteId
,
courseId
,
academicYear
,
verificationStatus
,
examCycleId
);
// return ResponseEntity.status(response.getResponseCode()).body(response);
return
new
ResponseEntity
<>(
response
,
HttpStatus
.
OK
);
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/StudentService.java
+
7
−
2
View file @
e651fecd
...
...
@@ -189,10 +189,12 @@ public class StudentService {
}
private
String
generateProvisionalNumber
(
Student
student
)
{
return
student
.
getCourse
().
getCourseCode
()
+
"-"
+
UUID
.
randomUUID
().
toString
();
int
hashCode
=
Math
.
abs
(
student
.
getMobileNo
().
hashCode
());
int
truncatedHashCode
=
hashCode
%
100000000
;
return
String
.
valueOf
(
truncatedHashCode
);
}
public
ResponseDto
getFilteredStudents
(
Long
instituteId
,
Long
courseId
,
String
session
,
VerificationStatus
verificationStatus
)
{
public
ResponseDto
getFilteredStudents
(
Long
instituteId
,
Long
courseId
,
String
session
,
VerificationStatus
verificationStatus
,
Long
examCycleId
)
{
ResponseDto
response
=
new
ResponseDto
(
Constants
.
API_GET_FILTERED_STUDENTS
);
try
{
...
...
@@ -216,6 +218,9 @@ public class StudentService {
if
(
verificationStatus
!=
null
)
{
predicates
.
add
(
criteriaBuilder
.
equal
(
studentRoot
.
get
(
"verificationStatus"
),
verificationStatus
));
}
if
(
examCycleId
!=
null
){
predicates
.
add
(
criteriaBuilder
.
equal
(
studentRoot
.
get
(
"exam"
),
examCycleId
));
}
criteriaQuery
.
where
(
predicates
.
toArray
(
new
Predicate
[
0
]));
...
...
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