public BigDecimal getNumberOfApprovedEctsOneYearAgo() { ExecutionYear oneYearAgo = getForExecutionYear().getPreviousExecutionYear(); BigDecimal result = BigDecimal.ZERO; if (student == null) { return BigDecimal.ZERO; } for (final Registration registration : student.getRegistrationsSet()) { if (registration.isBolonha() && registration.hasAnyEnrolmentsIn(oneYearAgo)) { result = result .add( calculateApprovedECTS( registration .getLastStudentCurricularPlan() .getAprovedEnrolmentsInExecutionPeriod( oneYearAgo.getFirstExecutionPeriod()))) .add( calculateApprovedECTS( registration .getLastStudentCurricularPlan() .getAprovedEnrolmentsInExecutionPeriod( oneYearAgo.getLastExecutionPeriod()))); } } return result; }
public static Collection<ExecutionYear> getEnrolmentsExecutionYears(final Student student) { Set<ExecutionYear> executionYears = new HashSet<ExecutionYear>(); for (final Registration registration : student.getRegistrationsSet()) { if (RegistrationStateType.CANCELED.equals(registration.getLastActiveState())) { continue; } if (RegistrationStateType.TRANSITION.equals(registration.getLastActiveState())) { continue; } executionYears.addAll(registration.getEnrolmentsExecutionYears()); } return executionYears; }
public BigDecimal getNumberOfEnrolledEctsOneYearAgo() { ExecutionYear oneYearAgo = getForExecutionYear().getPreviousExecutionYear(); BigDecimal result = BigDecimal.ZERO; if (student == null) { return BigDecimal.ZERO; } for (final Registration registration : student.getRegistrationsSet()) { if (registration.isBolonha() && registration.hasAnyEnrolmentsIn(oneYearAgo)) { result = result.add(new BigDecimal(getEnrolmentsEctsCredits(registration, oneYearAgo))); } } return result; }
private String getDegrees(final Person person) { final StringBuilder stringBuilder = new StringBuilder(); final Student student = person.getStudent(); if (student != null) { final Set<String> names = new TreeSet<String>(); for (final Registration registration : student.getRegistrationsSet()) { final Degree degree = registration.getDegree(); names.add(degree.getSigla()); } for (final String name : names) { if (stringBuilder.length() > 0) { stringBuilder.append(", "); } stringBuilder.append(name); } } return stringBuilder.toString(); }
public Integer getCountNumberOfDegreeChanges() { int numberOfDegreeChanges = 0; if (student == null) { return 0; } List<Registration> registrations = new ArrayList<Registration>(student.getRegistrationsSet()); Collections.sort(registrations, Registration.COMPARATOR_BY_START_DATE); for (final Registration iter : registrations) { final SortedSet<RegistrationState> states = new TreeSet<RegistrationState>(RegistrationState.DATE_COMPARATOR); states.addAll(iter.getRegistrationStates(RegistrationStateType.INTERNAL_ABANDON)); if (!states.isEmpty()) { numberOfDegreeChanges++; } } return numberOfDegreeChanges; }