예제 #1
0
  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;
  }
예제 #2
0
  private double getEnrolmentsEctsCredits(
      final Registration registration, final ExecutionYear executionYear) {
    double result = 0.0;
    double annualCredits = 0.0;

    for (final ExecutionSemester executionSemester : executionYear.getExecutionPeriodsSet()) {
      for (final Enrolment enrolment :
          registration.getLastStudentCurricularPlan().getEnrolmentsSet()) {
        if (enrolment.isValid(executionSemester)) {
          if (enrolment.isAnual()) {
            this.enrolledInAnualCoursesLastYear = true;

            if (executionSemester.getSemester() == 1) {
              annualCredits += enrolment.getEctsCredits();
            }
            continue;
          }

          result += enrolment.getEctsCredits();
        }
      }
    }

    return result + annualCredits;
  }
예제 #3
0
  private void checkParameters(final RegistrationAcademicServiceRequestCreateBean bean) {
    final CurriculumGroup curriculumGroup = bean.getCurriculumGroup();
    final CourseGroup newCourseGroup = bean.getCourseGroup();
    final ExecutionYear executionYear = bean.getExecutionYear();
    final Registration registration = bean.getRegistration();

    if (curriculumGroup == null) {
      throw new DomainException("error.CourseGroupChangeRequest.curriculumGroup.cannot.be.null");
    }

    if (newCourseGroup == null) {
      throw new DomainException("error.CourseGroupChangeRequest.newCourseGroup.cannot.be.null");
    }

    if (executionYear == null) {
      throw new DomainException("error.CourseGroupChangeRequest.executionYear.cannot.be.null");
    }

    if (!registration.getLastStudentCurricularPlan().hasCurriculumModule(curriculumGroup)) {
      throw new DomainException("error.CourseGroupChangeRequest.invalid.curriculumGroup");
    }

    if (!registration.getLastDegreeCurricularPlan().hasDegreeModule(newCourseGroup)) {
      throw new DomainException("error.CourseGroupChangeRequest.invalid.newCourseGroup");
    }
  }
  private final Collection<ICurriculumEntry> getEntriesToReport(final boolean useConcluded) {
    final HashSet<ICurriculumEntry> result = new HashSet<ICurriculumEntry>();

    final Registration registration = getRegistration();
    ICurriculum curriculum;
    if (registration.isBolonha()) {
      for (final CycleCurriculumGroup cycle :
          registration.getLastStudentCurricularPlan().getInternalCycleCurriculumGrops()) {
        if (cycle.hasAnyApprovedCurriculumLines()
            && (useConcluded || !cycle.isConclusionProcessed())) {
          curriculum = cycle.getCurriculum(getFilteringDate());
          filterEntries(result, this, curriculum);
        }
      }
    } else {
      curriculum = getRegistration().getCurriculum(getFilteringDate());
      filterEntries(result, this, curriculum);
    }

    return result;
  }
예제 #5
0
  public Integer getCurricularYearInCurrentYear() {
    ExecutionYear currentYear = getForExecutionYear();

    if (student == null) {
      return 0;
    }

    Registration lastRegistration = student.getLastActiveRegistration();

    if (lastRegistration == null) {
      return null;
    }

    if (lastRegistration.getDegreeType().equals(DegreeType.BOLONHA_DEGREE)) {
      return lastRegistration
          .getCurriculum(new DateTime(), currentYear, CycleType.FIRST_CYCLE)
          .getCurricularYear();
    } else if (lastRegistration
        .getDegreeType()
        .equals(DegreeType.BOLONHA_INTEGRATED_MASTER_DEGREE)) {
      if (lastRegistration.hasConcludedFirstCycle()) {
        return lastRegistration.getCurricularYear(currentYear);
      } else {
        if (lastRegistration.getLastStudentCurricularPlan().getCycle(CycleType.FIRST_CYCLE)
            != null) {
          return lastRegistration
              .getCurriculum(new DateTime(), currentYear, CycleType.FIRST_CYCLE)
              .getCurricularYear();
        } else {
          return lastRegistration
              .getCurriculum(new DateTime(), currentYear, CycleType.SECOND_CYCLE)
              .getCurricularYear();
        }
      }
    } else if (lastRegistration.getDegreeType().equals(DegreeType.BOLONHA_MASTER_DEGREE)) {
      return lastRegistration.getCurricularYear(currentYear);
    }

    return lastRegistration.getCurricularYear(currentYear);
  }
예제 #6
0
 public StudentCurricularPlan getStudentCurricularPlan() {
   final Registration registration = getRegistration();
   return registration == null ? null : registration.getLastStudentCurricularPlan();
 }