public static String createNewLine(
     final Person person, final CardGenerationBatch cardGenerationBatch) {
   final Student student = person.getStudent();
   if (student != null && !student.getActiveRegistrations().isEmpty()) {
     final StudentCurricularPlan studentCurricularPlan =
         findStudentCurricularPlan(cardGenerationBatch, student);
     if (studentCurricularPlan != null) {
       final String line = CardGenerationEntry.createLine(studentCurricularPlan);
       return line;
     }
   }
   return null;
 }
示例#2
0
  private Registration getActiveRegistration(Student student) {
    List<Registration> activeRegistrations = student.getActiveRegistrations();

    if (activeRegistrations.isEmpty()) {
      return student.getLastRegistration();
    }

    for (Registration registration : activeRegistrations) {
      if (registration.getDegree().getDegreeType().isEmpty()) {
        continue;
      }

      return registration;
    }

    return student.getLastRegistration();
  }