diff --git a/src/libs/convert/educationLevelSchoolYear.js b/src/libs/convert/educationLevelSchoolYear.js index 316efe5efabd62f03ab311cc26684b2cbc8fff58..f4fe43b73539fdf47650994f5773463d98f05a5f 100644 --- a/src/libs/convert/educationLevelSchoolYear.js +++ b/src/libs/convert/educationLevelSchoolYear.js @@ -14,7 +14,7 @@ module.exports = function educationLevelSchoolYear(id) { case 33: return 'Ens. Fundamental - 2ª série/3º ano'; case 34: return 'Ens. Fundamental - 3ª série/4º ano'; case 35: return 'Ens. Fundamental - 4ª série/5º Ano'; - case 4: return 'Ensino Fundamento - anos finais'; + case 4: return 'Ensino Fundamental - anos finais'; case 41: return 'Ens. Fundamental - 5ª série/6º ano'; case 42: return 'Ens. Fundamental - 6ª série/7º ano'; case 43: return 'Ens. Fundamental - 7ª série/8º ano'; diff --git a/src/libs/routes/enrollmentProjection.js b/src/libs/routes/enrollmentProjection.js index 0009de763c4264c4e760d5a1d9106aa3e9c8cf58..1bbe8ea3934a4fe59116ec0a3d96d292a446d59f 100644 --- a/src/libs/routes/enrollmentProjection.js +++ b/src/libs/routes/enrollmentProjection.js @@ -117,12 +117,23 @@ enrollmentProjectionApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { .field('projecao_matricula.etapa_ensino_escola_ano_id', 'education_level_school_year_id') .field('projecao_matricula.ano_censo', 'year') .from('projecao_matricula') + .where('projecao_matricula.etapa_ensino_escola_ano_id <> 7 AND projecao_matricula.etapa_ensino_escola_ano_id < 71') .group('projecao_matricula.etapa_ensino_escola_ano_id') .group('projecao_matricula.ano_censo') .order('projecao_matricula.ano_censo') .order('projecao_matricula.etapa_ensino_escola_ano_id'); next(); -}, query, id2str.transform(), response('enrollment_projection')); +}, query, id2str.transform(), (req, res, next) => { + + req.result.forEach((r) => { + r.urban_day_total = parseInt(r.urban_day_total, 10); + r.urban_night_total = parseInt(r.urban_night_total, 10); + r.rural_day_total = parseInt(r.rural_day_total, 10); + r.rural_night_total = parseInt(r.rural_night_total, 10); + }); + + next(); +}, response('enrollment_projection')); module.exports = enrollmentProjectionApp; \ No newline at end of file