Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
fc0f2c23
Commit
fc0f2c23
authored
4 years ago
by
Fernando Erd
Browse files
Options
Downloads
Patches
Plain Diff
Add finish enrollment by year
parent
f62e9202
No related branches found
No related tags found
1 merge request
!264
Issue/668
Pipeline
#23669
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/libs/convert/finishUniversity.js
+32
-0
32 additions, 0 deletions
src/libs/convert/finishUniversity.js
src/libs/middlewares/id2str.js
+6
-2
6 additions, 2 deletions
src/libs/middlewares/id2str.js
src/libs/routes/universityEnrollment.js
+13
-10
13 additions, 10 deletions
src/libs/routes/universityEnrollment.js
with
51 additions
and
12 deletions
src/libs/convert/finishUniversity.js
0 → 100644
+
32
−
0
View file @
fc0f2c23
'
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
'
;
}
};
This diff is collapsed.
Click to expand it.
src/libs/middlewares/id2str.js
+
6
−
2
View file @
fc0f2c23
...
...
@@ -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
};
This diff is collapsed.
Click to expand it.
src/libs/routes/universityEnrollment.js
+
13
−
10
View file @
fc0f2c23
...
...
@@ -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
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment