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
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
b90b9cc8
Commit
b90b9cc8
authored
2 years ago
by
jpko19
Browse files
Options
Downloads
Patches
Plain Diff
Add TEA in pee_por_categoria
parent
96b12b32
No related branches found
No related tags found
4 merge requests
!329
Update enrollment - new filters
,
!328
Dev
,
!327
Issue753 change names
,
!309
Merge new updates into master
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/libs/convert/peePorCategoria.js
+3
-1
3 additions, 1 deletion
src/libs/convert/peePorCategoria.js
src/libs/middlewares/reqQueryFields.js
+7
-3
7 additions, 3 deletions
src/libs/middlewares/reqQueryFields.js
src/libs/routes/enrollment.js
+19
-5
19 additions, 5 deletions
src/libs/routes/enrollment.js
with
29 additions
and
9 deletions
src/libs/convert/peePorCategoria.js
+
3
−
1
View file @
b90b9cc8
...
...
@@ -45,6 +45,8 @@ module.exports = function peeCategory(id) {
case
12
:
return
'
Transtorno Desintegrativo da Infância
'
;
case
13
:
return
'
Superdotado
'
;
return
'
Altas habilidades / Superdotação
'
;
case
14
:
return
'
Transtorno do Espectro Austista (TEA)
'
;
}
};
This diff is collapsed.
Click to expand it.
src/libs/middlewares/reqQueryFields.js
+
7
−
3
View file @
b90b9cc8
...
...
@@ -173,11 +173,15 @@ class ReqQueryFields {
}
let
categorias
=
[
''
,
'
blindness
'
,
'
low_vision
'
,
'
deafness
'
,
'
hearing_deficiency
'
,
'
deafblindness
'
,
'
physical_disability
'
,
'
intellectual_disability
'
,
'
multiple_disabilities
'
,
'
autism
'
,
'
asperger_syndrom
'
,
'
rett_syndrom
'
,
'
childhood_desintegrative_disorder
'
,
'
supergifted
'
];
'
multiple_disabilities
'
,
'
autism
'
,
'
asperger_syndrom
'
,
'
rett_syndrom
'
,
'
childhood_desintegrative_disorder
'
,
'
supergifted
'
,
'
autism_spectrum_disorder
'
];
if
(
obj
.
pee_por_categoria
!==
undefined
&&
queryField
===
'
filter
'
)
for
(
var
cat
of
obj
.
pee_por_categoria
)
if
(
obj
.
pee_por_categoria
!==
undefined
&&
queryField
===
'
filter
'
){
for
(
var
cat
of
obj
.
pee_por_categoria
){
cat
=
parseInt
(
cat
);
obj
[
categorias
[
cat
]]
=
true
;
}
delete
obj
.
pee_por_categoria
;
}
// Se o array existe e não está vazio fazemos a interseção
...
...
This diff is collapsed.
Click to expand it.
src/libs/routes/enrollment.js
+
19
−
5
View file @
b90b9cc8
...
...
@@ -250,7 +250,7 @@ enrollmentApp.get('/pee', (req, res, next) => {
enrollmentApp
.
get
(
'
/pee_por_categoria
'
,
(
req
,
res
,
next
)
=>
{
req
.
result
=
[];
for
(
let
i
=
1
;
i
<=
1
3
;
++
i
)
{
for
(
let
i
=
1
;
i
<=
1
4
;
++
i
)
{
req
.
result
.
push
({
id
:
i
,
name
:
id2str
.
peePorCategoria
(
i
)
...
...
@@ -717,6 +717,16 @@ rqf.addField({
type
:
'
boolean
'
,
field
:
'
autismo
'
}
}).
addValue
({
name
:
'
autism_spectrum_disorder
'
,
table
:
'
matricula
'
,
tableField
:
'
transtorno_espectro_autista
'
,
resultField
:
'
autism_spectrum_disorder
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
boolean
'
,
field
:
'
transtorno_espectro_autista
'
}
}).
addValue
({
name
:
'
asperger_syndrom
'
,
table
:
'
matricula
'
,
...
...
@@ -767,7 +777,7 @@ rqf.addField({
type
:
'
boolean
'
,
field
:
'
possui_necessidade_especial
'
}
}).
addValue
ToField
({
}).
addValue
({
name
:
'
pee_por_categoria
'
,
table
:
'
matricula
'
,
tableField
:
'
possui_necessidade_especial
'
,
...
...
@@ -777,7 +787,7 @@ rqf.addField({
type
:
'
boolean
'
,
field
:
'
possui_necessidade_especial
'
}
}
,
'
dims
'
);
});
enrollmentApp
.
get
(
'
/
'
,
rqf
.
parse
(),
(
req
,
res
,
next
)
=>
{
if
(
'
pee_por_categoria
'
in
req
.
dims
){
...
...
@@ -792,10 +802,11 @@ enrollmentApp.get('/', rqf.parse(), (req, res, next) => {
.
field
(
'
SUM(CASE WHEN deficiencia_intelectual = true THEN 1 ELSE 0 END)
'
,
'
Deficiência intelectual
'
)
.
field
(
'
SUM(CASE WHEN deficiencia_multiplas = true THEN 1 ELSE 0 END)
'
,
'
Deficiências múltiplas
'
)
.
field
(
'
SUM(CASE WHEN autismo = true THEN 1 ELSE 0 END)
'
,
'
Autismo
'
)
.
field
(
'
SUM(CASE WHEN transtorno_espectro_autista = true THEN 1 ELSE 0 END)
'
,
'
Transtorno do Espectro Autista (TEA)
'
)
.
field
(
'
SUM(CASE WHEN sindrome_asperger = true THEN 1 ELSE 0 END)
'
,
'
Síndrome de Asperger
'
)
.
field
(
'
SUM(CASE WHEN sindrome_rett = true THEN 1 ELSE 0 END)
'
,
'
Síndrome de Rett
'
)
.
field
(
'
SUM(CASE WHEN transtorno_desintegrativo_da_infancia = true THEN 1 ELSE 0 END)
'
,
'
Transtorno desintegrativo da infância
'
)
.
field
(
'
SUM(CASE WHEN superdotado = true THEN 1 ELSE 0 END)
'
,
'
Superdota
d
o
'
)
.
field
(
'
SUM(CASE WHEN superdotado = true THEN 1 ELSE 0 END)
'
,
'
Altas habilidades /
Superdota
çã
o
'
)
.
field
(
'
matricula.ano_censo
'
,
'
year
'
)
.
from
(
'
matricula
'
)
.
group
(
'
matricula.ano_censo
'
)
...
...
@@ -811,7 +822,10 @@ enrollmentApp.get('/', rqf.parse(), (req, res, next) => {
.
where
(
'
((matricula.tipo<=3 OR matricula.tipo IS NULL) AND (matricula.tipo_atendimento_turma IS NULL OR matricula.tipo_atendimento_turma <= 2))
'
);
}
next
();
},
rqf
.
build
(),
query
,
id2str
.
transform
(
false
),
(
req
,
res
,
next
)
=>
{
},
rqf
.
build
(),
(
req
,
res
,
next
)
=>
{
console
.
log
(
'
sql:
'
+
req
.
sql
.
toString
());
next
();
},
query
,
id2str
.
transform
(
false
),
(
req
,
res
,
next
)
=>
{
if
(
req
.
pee_por_categoria
===
true
){
let
result
=
req
.
result
;
let
result_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