use of amu.zhcet.data.user.student.Student in project zhcet-web by zhcet-amu.
the class StudentRegistrationAdapter method fromStudentUpload.
private static Student fromStudentUpload(StudentUpload studentUpload) {
Student student = new Student();
student.setEnrolmentNumber(studentUpload.getEnrolmentNumber());
student.setFacultyNumber(studentUpload.getFacultyNumber());
student.getUser().setName(studentUpload.getName());
Department department = Department.builder().name(StringUtils.capitalizeFirst(studentUpload.getDepartment())).build();
student.getUser().setDepartment(department);
student.setSection(studentUpload.getSection());
student.setHallCode(studentUpload.getHall());
student.setRegistrationYear(studentUpload.getRegistrationYear());
student.setStatus(studentUpload.getStatus());
student.getUser().getDetails().setGender(studentUpload.getGender());
return student;
}
use of amu.zhcet.data.user.student.Student in project zhcet-web by zhcet-amu.
the class StudentAttendanceController method attendance.
@GetMapping
public String attendance(Model model) {
Student student = studentService.getLoggedInStudent().orElseThrow(StudentNotFoundException::new);
model.addAttribute("page_title", "Attendance");
model.addAttribute("page_subtitle", "Attendance Panel for " + student.getEnrolmentNumber() + " | " + student.getUser().getName());
model.addAttribute("page_description", "View attendance of floated courses this session");
model.addAttribute("attendances", attendanceService.getAttendanceByStudent(student));
return "student/attendance";
}
use of amu.zhcet.data.user.student.Student in project zhcet-web by zhcet-amu.
the class SortUtilsTest method testSortCourseRegistrations.
@Test
public void testSortCourseRegistrations() {
CourseRegistration areebRegistration = new CourseRegistration();
CourseRegistration divyRegistration = new CourseRegistration();
CourseRegistration saimRegistration = new CourseRegistration();
Student areeb = new Student();
Student divy = new Student();
Student saim = new Student();
areebRegistration.setStudent(areeb);
divyRegistration.setStudent(divy);
saimRegistration.setStudent(saim);
areeb.setFacultyNumber(AREEB_FACULTY_NO);
areeb.setSection(SECTION_A4PE);
divy.setFacultyNumber(DIVY_FACULTY_NO);
divy.setSection(SECTION_A4PE);
saim.setFacultyNumber(SAIM_FACULTY_NO);
saim.setSection(SECTION_A5PE);
List<CourseRegistration> courseRegistrations = new ArrayList<>();
courseRegistrations.addAll(Arrays.asList(divyRegistration, saimRegistration, areebRegistration));
SortUtils.sortCourseAttendance(courseRegistrations);
assertThat(courseRegistrations, contains(areebRegistration, divyRegistration, saimRegistration));
}
use of amu.zhcet.data.user.student.Student in project zhcet-web by zhcet-amu.
the class CourseRegistrationUploadAdapter method fromRegistrationUpload.
private CourseRegistration fromRegistrationUpload(RegistrationUpload upload) {
Student student = studentService.getByFacultyNumber(upload.getFacultyNo()).orElseGet(() -> Student.builder().facultyNumber(upload.getFacultyNo()).build());
CourseRegistration courseRegistration = new CourseRegistration();
courseRegistration.setMode(upload.getMode());
courseRegistration.setStudent(student);
return courseRegistration;
}
Aggregations