diff --git a/src/libs/convert/diffLocation.js b/src/libs/convert/diffLocation.js new file mode 100644 index 0000000000000000000000000000000000000000..a25d6983d0413e9865afdfb2a0ac4d3b6f6f4453 --- /dev/null +++ b/src/libs/convert/diffLocation.js @@ -0,0 +1,32 @@ +/* +Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre +Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR + +This file is part of simcaq-node. + +simcaq-node is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +simcaq-node is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with simcaq-node. If not, see <https://www.gnu.org/licenses/>. +*/ + +module.exports = function location(id) { + switch (id) { + case 0: + return 'Não está em localidade diferenciada'; + case 1: + return 'Ãrea de assentamento'; + case 2: + return 'Terra indÃgena'; + case 3: + return 'Ãrea remanescente de quilombos' + } +}; diff --git a/src/libs/middlewares/id2str.js b/src/libs/middlewares/id2str.js index 668faa80dd7f0075f64ee85a8ab46334cd56b7e8..80086152ad1b22195ed1a14e4cf2a64d26a0ff3d 100644 --- a/src/libs/middlewares/id2str.js +++ b/src/libs/middlewares/id2str.js @@ -92,6 +92,7 @@ const licentiateDegree = require(`${libs}/convert/licentiateDegree`); const enrolledVacanciesFreshmen = require(`${libs}/convert/enrolledVacanciesFreshmen`); const enterSituation = require(`${libs}/convert/enterSituation`); const enrollmentSituation = require(`${libs}/convert/enrollmentSituation`); +const diffLocation = require(`${libs}/convert/diffLocation`); const ids = { gender_id: gender, @@ -175,7 +176,8 @@ const ids = { licentiate_degree_id: licentiateDegree, enrolled_vacancies_freshmen: enrolledVacanciesFreshmen, enter_situation: enterSituation, - enrollment_situation: enrollmentSituation + enrollment_situation: enrollmentSituation, + diff_location_id_par: diffLocation }; function transform(removeId=false) { @@ -286,5 +288,6 @@ module.exports = { licentiateDegree, enrolledVacanciesFreshmen, enterSituation, - enrollmentSituation + enrollmentSituation, + diffLocation }; diff --git a/src/libs/routes/employees.js b/src/libs/routes/employees.js index 20dcb7b26195ad6ccb0d662a96c70b269a05acb1..83c9971c3d4a7f796f6ee1bbd9a41e274cd7f97a 100644 --- a/src/libs/routes/employees.js +++ b/src/libs/routes/employees.js @@ -593,6 +593,7 @@ employeesApp.get('/', rqfSchool.parse(), (req, res, next) => { }, rqfSchool.build(), query, rqfSchool.parse(), id2str.transform(), (req, res, next) => { req.allTeacher = req.result; + console.log("resultado employees", req.allTeacher) req.resetSql(); if ("function" in req.dims) { req.sql.field('SUM(CASE WHEN escola.qt_prof_admin = 88888 THEN 0 ELSE escola.qt_prof_admin END)', 'qtde_admin') @@ -628,6 +629,7 @@ employeesApp.get('/', rqfSchool.parse(), (req, res, next) => { }, rqfSchool.build(), query, rqfSchool.parse(), id2str.transform(), (req, res, next) => { + console.log("resultado employees2", req.allTeacher) if ("function" in req.dims) { let aux_employes = formatFunction(req.result, req.dims); req.allTeacher = formatFunction(req.allTeacher, req.dims); diff --git a/src/libs/routes/school.js b/src/libs/routes/school.js index eb521f6bc9444f0c34d71d3eda4263a4b98b01d8..1101d35524ee9c08313c1ba289d8562449519677 100644 --- a/src/libs/routes/school.js +++ b/src/libs/routes/school.js @@ -66,7 +66,7 @@ schoolApp.get('/diff_location', cache('15 day'), (req, res, next) => { {id: 3, name: "Terra remanescente de quilombos"}, ]; next(); -}, response('rural_location')); +}, response('diff_location')); schoolApp.get('/adm_dependency', (req, res, next) => { req.result = [];