sheets.add(formationData);
return sheets;
}
private void addCurriculumDataRow(Spreadsheet sheet, String alumniName, Integer studentNumber, Student student) {
Alumni alumni = student.getAlumni();
// "NOME", "NUMERO_ALUNO", "CURSO", "INICIO", "CONCLUSAO", "DESCRICAO",
// "EMPREGADO ACTUALMENTE"
for (Registration registration : student.getRegistrationsSet()) {
if (registration.isBolonha()) {
if (registration.hasConcluded()) {
final SortedSet<CycleCurriculumGroup> concludeCycles =
new TreeSet<CycleCurriculumGroup>(CycleCurriculumGroup.COMPARATOR_BY_CYCLE_TYPE_AND_ID);
concludeCycles.addAll(registration.getLastStudentCurricularPlan().getInternalCycleCurriculumGrops());
Row row = sheet.addRow();
row.setCell(alumniName);
row.setCell(studentNumber);
row.setCell(registration.getDegreeName());
row.setCell(registration.getStartDate().toString(DATE_FORMAT));
final CycleCurriculumGroup lastConcludedCycle = concludeCycles.last();
try {
row.setCell(lastConcludedCycle.isConclusionProcessed() ? lastConcludedCycle.getConclusionDate().toString(
DATE_FORMAT) : lastConcludedCycle.calculateConclusionDate().toString(DATE_FORMAT));
} catch (Exception ex) {
row.setCell(NOT_AVAILABLE);
}
row.setCell("Bolonha");
row.setCell(alumni != null && alumni.getIsEmployed() != null ? getApp("label." + alumni.getIsEmployed()) : NOT_AVAILABLE);
}
} else {
if (registration.isRegistrationConclusionProcessed()) {
Row row = sheet.addRow();
row.setCell(alumniName);
row.setCell(studentNumber);
row.setCell(registration.getDegreeName());
row.setCell(registration.getStartDate().toString(DATE_FORMAT));
row.setCell(registration.getConclusionDate() != null ? registration.getConclusionDate().toString(DATE_FORMAT) : NOT_AVAILABLE);
row.setCell("Pre-Bolonha");
row.setCell(alumni != null && alumni.getIsEmployed() != null ? getApp("label." + alumni.getIsEmployed()) : NOT_AVAILABLE);
}
}
}
}