348,6 → 348,7 |
private void persist(Docente teacherSiges, Teacher teacher, boolean newUser, String year,DefaultLogMessages logmessages) throws Exception |
{ |
String msgS; |
System.out.println("STATING PERSIST"); |
|
try |
{ |
459,12 → 460,14 |
} |
else |
{ |
System.out.println("STATING STEPS"); |
//1 - PROCEDIMENTO CADEIRAS SAO CARREGADAS DO BACO DA LISTA QUE VEM DO SIGES -> units |
//2 - Sao retiradas da lista units as que o teacher tem mas que foram removidas localmente |
//3 - Sao adicionadas ao teacher as que o docente ainda nao tiver da lista units |
//4 - Remover da lista do teacher as unidades que não vêm do SIGES e que não foram adicionadas localmente |
|
//PASSO 1 |
System.out.println("STATING STEP 1"); |
Set<CourseUnit> units = new HashSet<CourseUnit>(); |
|
for (Disciplina disciplina : teacherSiges.getDisciplinas()) |
556,6 → 559,7 |
else |
units.addAll(loadedunits); |
} |
System.out.println("STATING STEP 2"); |
//PASSO 2 |
//2 - Sao retiradas da lista units as que o teacher tem mas que foram removidas localmente |
Iterator<CourseUnit> iter = units.iterator(); |
573,6 → 577,7 |
iter.remove(); |
} |
} |
System.out.println("STATING STEP 3"); |
//PASSO 3 |
//3 - da lista units sao adicionadas ao teacher as que sobraram do passo 2 e o docente ainda nao tiver |
if (teacher.getTeachedUnits() != null) |
601,6 → 606,7 |
else |
teacher.setTeachedUnits(units); |
|
System.out.println("STATING STEP 4"); |
//PASSO 4 |
//Remover unidades deste ano que nao vem do SIGES e que nao foram adicionadas localmente |
Iterator<CourseUnit> iterNowUnits = teacher.getTeachedUnits().iterator(); |
649,6 → 655,7 |
} |
} |
} |
System.out.println("END STEP 4"); |
} |
|
|