.getCategory().getCode(), teacher.getPerson().getNome(), teacher.getHoursByCategory(executionPeriodEntry.getBeginDateYearMonthDay(), executionPeriodEntry.getEndDateYearMonthDay()),
.getCategory().getCode(), teacher.getPerson().getNome(), teacher.getHoursByCategory(executionPeriodEntry),
	public List run(Integer departmentId, List<Integer> executionPeriodsIDs) throws FenixServiceException, ExcepcaoPersistencia, ParseException {						final List<ExecutionPeriod> executionPeriodList = new ArrayList<ExecutionPeriod>();		for(Integer executionPeriodID : executionPeriodsIDs){			executionPeriodList.add(rootDomainObject.readExecutionPeriodByOID(executionPeriodID));		}				final List<ExecutionPeriod> allExecutionPeriods = rootDomainObject.getExecutionPeriods();		final ExecutionPeriod startPeriod = findStartPeriod(allExecutionPeriods);				ExecutionPeriod endPeriod = findEndPeriod(executionPeriodList, startPeriod); 				DistributionTeacherServicesByTeachersDTO returnDTO = new DistributionTeacherServicesByTeachersDTO();		Department department =  rootDomainObject.readDepartmentByOID(departmentId); 				for (ExecutionPeriod executionPeriodEntry : executionPeriodList) {														List<Teacher> teachers = department.getTeachers(executionPeriodEntry.getBeginDateYearMonthDay(),                    executionPeriodEntry.getEndDateYearMonthDay());									for (Teacher teacher : teachers) {				if(teacher.getCategory() == null){					continue;				}								Double accumulatedCredits = (startPeriod == null ? 0.0 : teacher.getCreditsBetweenExecutionPeriods(startPeriod, endPeriod)); 								if(returnDTO.isTeacherPresent(teacher.getIdInternal())){					returnDTO.addHoursToTeacher(teacher.getIdInternal(), teacher.getHoursByCategory(executionPeriodEntry.getBeginDateYearMonthDay(), executionPeriodEntry.getEndDateYearMonthDay()));					returnDTO.addCreditsToTeacher(teacher.getIdInternal(), teacher.getServiceExemptionCredits(executionPeriodEntry) + teacher.getManagementFunctionsCredits(executionPeriodEntry));									} else {					returnDTO.addTeacher(teacher.getIdInternal(), teacher.getTeacherNumber(), teacher							.getCategory().getCode(), teacher.getPerson().getNome(), teacher.getHoursByCategory(executionPeriodEntry.getBeginDateYearMonthDay(), executionPeriodEntry.getEndDateYearMonthDay()), 							teacher.getServiceExemptionCredits(executionPeriodEntry) + teacher.getManagementFunctionsCredits(executionPeriodEntry), accumulatedCredits);				}									for (Professorship professorShip : teacher.getProfessorships()) {					ExecutionCourse executionCourse = professorShip.getExecutionCourse();							if (executionCourse.getExecutionPeriod() != executionPeriodEntry) {						continue;					}												Map<Integer, String> degreeNameMap = new LinkedHashMap<Integer, String>();					Map<Integer, Set<String>> degreeCurricularYearsMap = new LinkedHashMap<Integer, Set<String>>();					for (CurricularCourse curricularCourse : executionCourse							.getAssociatedCurricularCourses()) {						String degreeName = curricularCourse.getDegreeCurricularPlan().getDegree().getSigla();						Integer degreeIdInternal = curricularCourse.getDegreeCurricularPlan().getDegree().getIdInternal();						if(!degreeNameMap.containsKey(degreeIdInternal)) {							degreeNameMap.put(degreeIdInternal, degreeName);							degreeCurricularYearsMap.put(degreeIdInternal, new LinkedHashSet<String>());						}														Set<String> curricularYears = new LinkedHashSet<String>();												for (CurricularCourseScope curricularCourseScope : curricularCourse.getScopes()) {														if(curricularCourseScope.isActive(executionPeriodEntry.getEndDate())) {								CurricularSemester curricularSemester = curricularCourseScope										.getCurricularSemester();								curricularYears.add(curricularSemester.getCurricularYear().getYear().toString());							}						}						degreeCurricularYearsMap.get(degreeIdInternal).addAll(curricularYears);					}							Double hoursSpentByTeacher = StrictMath.ceil(teacher							.getHoursLecturedOnExecutionCourse(executionCourse));							returnDTO.addExecutionCourseToTeacher(teacher.getIdInternal(), executionCourse							.getIdInternal(), executionCourse.getNome(), hoursSpentByTeacher.intValue(),							degreeNameMap, degreeCurricularYearsMap, executionCourse.getExecutionPeriod().getName());						}								List<PersonFunction> teacherManagementFunctions = teacher.getManagementFunctions(executionPeriodEntry);												for(PersonFunction personFunction: teacherManagementFunctions) {					returnDTO.addManagementFunctionToTeacher(teacher.getIdInternal(), personFunction.getFunction().getName(), personFunction.getCredits());				}									                               TeacherServiceExemption teacherServiceExemption = teacher.getDominantServiceExemption(executionPeriodEntry);				                if(teacherServiceExemption != null) {                    double exemptionCredits = (double) teacher.getServiceExemptionCredits(executionPeriodEntry);                    if(exemptionCredits > 0.0) {                        returnDTO.addExemptionSituationToTeacher(teacher.getIdInternal(), teacherServiceExemption.getType().getName(), exemptionCredits);                    }				}			}		}		ArrayList<TeacherDistributionServiceEntryDTO> returnArraylist = new ArrayList<TeacherDistributionServiceEntryDTO>();		for (TeacherDistributionServiceEntryDTO teacher : returnDTO.getTeachersMap().values()) {			returnArraylist.add(teacher);		}		Collections.sort(returnArraylist);		return returnArraylist;	}