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
5b255a5d
Unverified
Commit
5b255a5d
authored
1 year ago
by
Ankit Verma
Committed by
GitHub
1 year ago
Browse files
Options
Download
Plain Diff
Merge pull request #189 from Radheshhathwar/development
Added courseYear and courseName
parents
9209e044
6a286253
github/fork/ruksana2808/filter_bug_examCycle
development
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/HallTicketController.java
+3
-1
...f/examsAndAdmissions/controller/HallTicketController.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/model/dto/DataCorrectionRequest.java
+1
-1
...f/examsAndAdmissions/model/dto/DataCorrectionRequest.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/model/dto/DataCorrectionRequestDto.java
+1
-0
...xamsAndAdmissions/model/dto/DataCorrectionRequestDto.java
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/HallTicketService.java
+19
-1
...o/upsmf/examsAndAdmissions/service/HallTicketService.java
with
24 additions
and
3 deletions
+24
-3
src/main/java/com/tarento/upsmf/examsAndAdmissions/controller/HallTicketController.java
+
3
−
1
View file @
5b255a5d
...
...
@@ -90,14 +90,16 @@ public class HallTicketController {
@RequestParam
(
value
=
"updatedFirstName"
,
required
=
false
)
Optional
<
String
>
updatedFirstNameOpt
,
@RequestParam
(
value
=
"updatedLastName"
,
required
=
false
)
Optional
<
String
>
updatedLastNameOpt
,
@RequestParam
(
value
=
"updatedDOB"
,
required
=
false
)
Optional
<
String
>
dobOpt
,
// Taking as string for optional handling
@RequestParam
(
value
=
"updatedCourseYear"
,
required
=
false
)
Optional
<
String
>
courseYear
,
@RequestParam
(
"proof"
)
MultipartFile
proof
)
throws
IOException
{
// Convert Optional<String> to actual value or null if not present
String
updatedFirstName
=
updatedFirstNameOpt
.
orElse
(
null
);
String
updatedLastName
=
updatedLastNameOpt
.
orElse
(
null
);
LocalDate
updatedDOB
=
dobOpt
.
isPresent
()
?
LocalDate
.
parse
(
dobOpt
.
get
())
:
null
;
String
updatedCourseYear
=
courseYear
.
orElse
(
null
);
ResponseDto
responseDto
=
hallTicketService
.
requestHallTicketDataCorrection
(
studentId
,
examCycleId
,
updatedFirstName
,
updatedLastName
,
updatedDOB
,
proof
);
ResponseDto
responseDto
=
hallTicketService
.
requestHallTicketDataCorrection
(
studentId
,
examCycleId
,
updatedFirstName
,
updatedLastName
,
updatedDOB
,
updatedCourseYear
,
proof
);
return
ResponseEntity
.
status
(
responseDto
.
getResponseCode
().
value
()).
body
(
responseDto
);
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/model/dto/DataCorrectionRequest.java
+
1
−
1
View file @
5b255a5d
...
...
@@ -36,6 +36,6 @@ public class DataCorrectionRequest {
private
String
updatedFirstName
;
private
String
updatedLastName
;
private
LocalDate
updatedDOB
;
private
String
updatedCourseYear
;
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/model/dto/DataCorrectionRequestDto.java
+
1
−
0
View file @
5b255a5d
...
...
@@ -15,6 +15,7 @@ public class DataCorrectionRequestDto {
private
String
updatedFirstName
;
private
String
updatedLastName
;
private
LocalDate
updatedDOB
;
private
String
updatedCourseYear
;
private
String
status
;
private
String
proofAttachmentPath
;
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/examsAndAdmissions/service/HallTicketService.java
+
19
−
1
View file @
5b255a5d
...
...
@@ -53,6 +53,8 @@ public class HallTicketService {
@Autowired
DataCorrectionRequestRepository
dataCorrectionRequestRepository
;
@Autowired
CourseRepository
courseRepository
;
@Autowired
private
StudentRepository
studentRepository
;
@Autowired
private
ExamCycleRepository
examCycleRepository
;
...
...
@@ -263,6 +265,7 @@ public class HallTicketService {
String
updatedFirstName
,
String
updatedLastName
,
LocalDate
updatedDOB
,
String
updatedCourseYear
,
@RequestParam
(
"file"
)
MultipartFile
proof
)
throws
IOException
{
ResponseDto
response
=
new
ResponseDto
(
Constants
.
API_HALLTICKET_REQUEST_DATA_CORRECTION
);
...
...
@@ -296,6 +299,9 @@ public class HallTicketService {
if
(
updatedDOB
!=
null
)
{
request
.
setUpdatedDOB
(
updatedDOB
);
}
if
(
updatedCourseYear
!=
null
){
request
.
setUpdatedCourseYear
(
updatedCourseYear
);
}
request
.
setExamCycle
(
optionalExamCycle
.
get
());
request
.
setStatus
(
"NEW"
);
...
...
@@ -320,6 +326,7 @@ public class HallTicketService {
dto
.
setUpdatedFirstName
(
request
.
getUpdatedFirstName
());
dto
.
setUpdatedLastName
(
request
.
getUpdatedLastName
());
dto
.
setUpdatedDOB
(
request
.
getUpdatedDOB
());
dto
.
setUpdatedCourseYear
(
request
.
getUpdatedCourseYear
());
dto
.
setStatus
(
request
.
getStatus
());
dto
.
setProofAttachmentPath
(
request
.
getProofAttachmentPath
());
return
dto
;
...
...
@@ -346,13 +353,16 @@ public class HallTicketService {
formattedRequest
.
put
(
"firstName"
,
request
.
getUpdatedFirstName
());
formattedRequest
.
put
(
"lastName"
,
request
.
getUpdatedLastName
());
formattedRequest
.
put
(
"dob"
,
request
.
getUpdatedDOB
());
formattedRequest
.
put
(
"courseYear"
,
request
.
getUpdatedCourseYear
());
if
(
request
.
getStudent
()
!=
null
)
{
Student
student
=
request
.
getStudent
();
formattedRequest
.
put
(
"prevFirstName"
,
student
.
getFirstName
());
formattedRequest
.
put
(
"prevLastName"
,
student
.
getSurname
());
// changed from 'surName'
formattedRequest
.
put
(
"prevDob"
,
student
.
getDateOfBirth
());
formattedRequest
.
put
(
"preCourseYear"
,
student
.
getCourse
().
getCourseYear
());
formattedRequest
.
put
(
"enrollmentNumber"
,
student
.
getEnrollmentNumber
());
formattedRequest
.
put
(
"courseName"
,
student
.
getCourse
().
getCourseName
());
if
(
Objects
.
equals
(
request
.
getUpdatedFirstName
(),
student
.
getFirstName
())){
formattedRequest
.
put
(
"firstNameFlag"
,
FALSE
);
}
...
...
@@ -371,6 +381,12 @@ public class HallTicketService {
else
{
formattedRequest
.
put
(
"dobFlag"
,
TRUE
);
}
if
(
Objects
.
equals
(
request
.
getUpdatedCourseYear
(),
student
.
getCourse
().
getCourseYear
())){
formattedRequest
.
put
(
"courseYearFlag"
,
FALSE
);
}
else
{
formattedRequest
.
put
(
"courseYearFlag"
,
TRUE
);
}
List
<
StudentExamRegistration
>
registration
=
studentExamRegistrationRepository
.
getByExamCycleIdAndStudentId
(
request
.
getExamCycle
().
getId
(),
request
.
getStudent
().
getId
());
if
(!
registration
.
isEmpty
())
{
...
...
@@ -437,8 +453,10 @@ public class HallTicketService {
student
.
setFirstName
(
request
.
getUpdatedFirstName
());
student
.
setSurname
(
request
.
getUpdatedLastName
());
student
.
setDateOfBirth
(
request
.
getUpdatedDOB
());
Course
course
=
request
.
getStudent
().
getCourse
();
course
.
setCourseYear
(
request
.
getUpdatedCourseYear
());
studentRepository
.
save
(
student
);
courseRepository
.
save
(
course
);
// 2. Regenerate the hall ticket with the updated details
// Optional<StudentExamRegistration> registrationOptional = Optional.ofNullable(studentExamRegistrationRepository.findByStudent(student));
List
<
StudentExamRegistration
>
registrationOptional
=
studentExamRegistrationRepository
.
getByStudentId
(
student
.
getId
());
...
...
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