Skip to content
Snippets Groups Projects
Commit fc0f2c23 authored by Fernando Erd's avatar Fernando Erd
Browse files

Add finish enrollment by year

parent f62e9202
No related branches found
No related tags found
1 merge request!264Issue/668
Pipeline #23669 passed
'use strict';
/*
Copyright (C) 2016 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 finishUniversity(id) {
switch (id) {
case 0:
return 'Não concluinte';
case 1:
return 'Concluinte';
default:
return 'Não declarado';
}
};
......@@ -85,6 +85,7 @@ const govermentAgreement = require(`${libs}/convert/govermentAgreement`);
const arrangement = require(`${libs}/convert/arrangement`);
const nightTime = require(`${libs}/convert/nightTime`);
const discipline = require(`${libs}/convert/discipline`);
const finishUniversity = require(`${libs}/convert/finishUniversity`);
const ids = {
gender_id: gender,
......@@ -161,7 +162,8 @@ const ids = {
age_student_code_id: ageStudentCode,
transport_id: transport,
arrangement_id: arrangement,
arrangement_id: discipline
discipline: discipline,
finish_id: finishUniversity
};
function transform(removeId=false) {
......@@ -264,5 +266,7 @@ module.exports = {
transport,
govermentAgreement,
arrangement,
nightTime
nightTime,
discipline,
finishUniversity
};
......@@ -91,6 +91,17 @@ universityEnrollmentApp.get('/ocde_geral', (req, res, next) => {
next();
}, response('ocde_geral'));
universityEnrollmentApp.get('/finish', (req, res, next) => {
req.result = [
{id: 0, name: "Não Concluinte"},
{id: 1, name: "Concluinte"},
];
next();
next();
}, response('finish'));
universityEnrollmentApp.get('/ocde_specific', (req, res, next) => {
req.result = [];
const defaultCase = null;
......@@ -630,15 +641,7 @@ rqf.addField({
});
universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
if ("finish" in req.dims) {
req.sql.from('localoferta_ens_superior_matricula')
.field('SUM(aluno_ens_superior.concluinte)', 'total')
.field("'Brasil'", 'name')
.field('localoferta_ens_superior_matricula.ano_censo', 'year')
.group('localoferta_ens_superior_matricula.ano_censo')
.order('localoferta_ens_superior_matricula.ano_censo')
delete req.dims.finish
}else if ("localoffer" in req.dims) {
if ("localoffer" in req.dims) {
if ("university" in req.dims) {
req.sql.from('localoferta_ens_superior_matricula')
.field('curso_ens_superior.ano_censo', 'year')
......@@ -658,7 +661,7 @@ universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
.order('localoferta_ens_superior_matricula.ano_censo')
.order('localoferta_ens_superior_matricula.cod_local_oferta');
}
} else if (("state" in req.dims) || ("city" in req.dims) || ("region" in req.dims) || ("mesoregion" in req.dims) || ("microregion" in req.dims)
} else if (("state" in req.dims) || ("city" in req.dims) || ("region" in req.dims) || ("mesoregion" in req.dims) || ("microregion" in req.dims) ||
("state" in req.filter) || ("city" in req.filter) || ("region" in req.filter) || ("mesoregion" in req.filter) || ("microregion" in req.filter)) {
req.sql.from('localoferta_ens_superior_matricula')
.field('DISTINCT COUNT(*)', 'total')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment