Skip to content
Snippets Groups Projects
Commit ba4d6d35 authored by Névisson Gonçalves's avatar Névisson Gonçalves
Browse files

Ajustes para não consultar rota no PQR da carreira de professor.

parent 3da98f3e
Branches
No related tags found
1 merge request!1v1
......@@ -85,7 +85,7 @@ export class PqrService {
return this.workJourneyTeacherService.getData();
case CareerAndRemunerationTeachersComponent:
return this.careerAndRemunerationTeachersService.getData();
return this.careerAndRemunerationTeachersService.getData(true);
case InfrastructureSchoolBuildingsComponent:
return this.infrastructureSchoolBuildingsService.getData(true);
......
......@@ -39,7 +39,7 @@ export class CareerAndRemunerationTeachersComponent extends BaseNavigableCompone
}
processData(): Observable<CareerAndRemunerationTeachers> {
return this.careerAndRemunerationTeachersService.getData();
return this.careerAndRemunerationTeachersService.getData(this.pqrMode);
}
processSessionData(sessionData: CareerAndRemunerationTeachers): void {
......@@ -68,6 +68,7 @@ export class CareerAndRemunerationTeachersComponent extends BaseNavigableCompone
}
ngDoCheck(): void {
if (!this.pqrMode) {
if (this.data.teacherFormationLevels && this.data.teacherFormationLevels.levels.length > 0) {
if (this.data.teacherFormationLevels.levels[0].diagnostic !== undefined) {
if (!_.isEqual(this.data.teacherFormationLevels.levels, this.prevTeacherFormationLevels)) {
......@@ -77,6 +78,7 @@ export class CareerAndRemunerationTeachersComponent extends BaseNavigableCompone
}
}
}
}
newFormationLevel(): void {
const newFormationLevel = this.careerAndRemunerationTeachersService.getNewTeacherFormationLevel(this.data.teacherFormationLevels.levels.length);
......
......@@ -27,7 +27,7 @@ export class CareerAndRemunerationTeachersService implements NavigableComponentS
constructor(private httpService: HttpService, private utilitiesService: UtilitiesService, private sessionService: SessionService, private currentYearService: CurrentYearService) { }
getData(): Observable<CareerAndRemunerationTeachers> {
getData(pqrMode: boolean = false): Observable<CareerAndRemunerationTeachers> {
const simulationYears = this.getSimulationYears();
const careerAndRemunerationTeachers: CareerAndRemunerationTeachers = new CareerAndRemunerationTeachers({ years: simulationYears });
......@@ -49,11 +49,15 @@ export class CareerAndRemunerationTeachersService implements NavigableComponentS
}
careerAndRemunerationTeachers.teacherFormationLevels = teacherFormationLevels;
if (!pqrMode) {
return this.getDiagnostic().pipe(
map((diagnostics) => {
this.setPercTeacherDistributionCareerLevel(careerAndRemunerationTeachers, diagnostics);
return careerAndRemunerationTeachers;
}));
} else {
return of(careerAndRemunerationTeachers);
}
}));
}));
}
......@@ -125,7 +129,7 @@ export class CareerAndRemunerationTeachersService implements NavigableComponentS
const totalPercentageOfYear: number =
this.utilitiesService.roundNumber((teacherFormationLevelOfYear.percTeacherDistributionCareerLevel.map((percDistributionLevel: TeacherDistributionCareerLevel) =>
percDistributionLevel.percentage).reduce((a, b) => {
return b ? a + b : a;
return a + b;
})), 2);
careerAndRemunerationTeachers.totals.push(new TeacherDistributionCareerLevel({ year: year, percentage: totalPercentageOfYear * 1e0 / 1e0 }));
......@@ -261,9 +265,9 @@ export class CareerAndRemunerationTeachersService implements NavigableComponentS
const yearsSimulation: Array<number> = this.utilitiesService.getSimulationYears();
for (let i = 0; i < data.teacherFormationLevels.levels.length; i++) {
data.teacherFormationLevels.levels[i].diagnostic = undefined;
data.teacherFormationLevels.levels[i].diagnostic = 0;
data.teacherFormationLevels.levels[i].percTeacherDistributionCareerLevel = yearsSimulation.map(yearSimulation =>
new TeacherDistributionCareerLevel({ year: yearSimulation, percentage: undefined }));
new TeacherDistributionCareerLevel({ year: yearSimulation, percentage: 0 }));
}
}
......@@ -275,14 +279,13 @@ export class CareerAndRemunerationTeachersService implements NavigableComponentS
const totalPercentageOfYear: number =
this.utilitiesService.roundNumber(((teacherFormationLevelOfYear.percTeacherDistributionCareerLevel.map((percDistributionLevel: TeacherDistributionCareerLevel) =>
percDistributionLevel.percentage).reduce((a, b) => {
return b ? a + b : a;
return a + b;
}))), 2);
if (totalPercentageOfYear !== 100) {
let formation = _.find(careerAndRemunerationTeachers.teacherFormationLevels.levels, l => l.formationLevel.id === FormationLevelEnum.Superior);
if (formation === undefined || formation === null) {
if (formation.diagnostic === 0) {
formation = _.find(careerAndRemunerationTeachers.teacherFormationLevels.levels, l => l.formationLevel.id === FormationLevelEnum.Medio);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment