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
5fc9839d
Commit
5fc9839d
authored
5 years ago
by
Fernando Erd
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/v1.12.5'
parents
407e130f
e96edb55
No related branches found
No related tags found
1 merge request
!248
v1.12.5
Pipeline
#22651
failed
5 years ago
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
src/libs/middlewares/addMissing.js
+0
-4
0 additions, 4 deletions
src/libs/middlewares/addMissing.js
src/libs/routes/courseCount.js
+31
-11
31 additions, 11 deletions
src/libs/routes/courseCount.js
with
35 additions
and
15 deletions
CHANGELOG.md
+
4
−
0
View file @
5fc9839d
...
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
...
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on
[
Keep a Changelog
](
http://keepachangelog.com/
)
The format is based on
[
Keep a Changelog
](
http://keepachangelog.com/
)
and this project adheres to
[
Semantic Versioning
](
http://semver.org/
)
.
and this project adheres to
[
Semantic Versioning
](
http://semver.org/
)
.
## 1.12.5 - 2020-01-27
## Changed
-
Fix duplicated cities in courseCount
## 1.12.4 - 2020-01-27
## 1.12.4 - 2020-01-27
## Changed
## Changed
-
Fix addMissing
-
Fix addMissing
...
...
This diff is collapsed.
Click to expand it.
src/libs/middlewares/addMissing.js
+
0
−
4
View file @
5fc9839d
...
@@ -37,7 +37,6 @@ function binarySearch(value, vector, a, b) {
...
@@ -37,7 +37,6 @@ function binarySearch(value, vector, a, b) {
module
.
exports
=
function
addMissing
(
rqf
)
{
module
.
exports
=
function
addMissing
(
rqf
)
{
return
(
req
,
res
,
next
)
=>
{
return
(
req
,
res
,
next
)
=>
{
let
dims
=
Object
.
keys
(
req
.
dims
).
filter
(
i
=>
{
return
i
!==
'
size
'
;
});
let
dims
=
Object
.
keys
(
req
.
dims
).
filter
(
i
=>
{
return
i
!==
'
size
'
;
});
console
.
log
(
req
.
dims
,
dims
);
// FIXME: No momento, só funciona para duas dimensões (padrão para o LDE)
// FIXME: No momento, só funciona para duas dimensões (padrão para o LDE)
// if((dims.length != 2) && (dims.length == 1 && req.filter.min_year == req.filter.max_year)) return next();
// if((dims.length != 2) && (dims.length == 1 && req.filter.min_year == req.filter.max_year)) return next();
// if(req.filter.min_year != req.filter.max_year) return next();
// if(req.filter.min_year != req.filter.max_year) return next();
...
@@ -86,9 +85,6 @@ module.exports = function addMissing(rqf) {
...
@@ -86,9 +85,6 @@ module.exports = function addMissing(rqf) {
if
(
dims
[
0
]
===
'
min_year
'
)
// year should be sorted by its value
if
(
dims
[
0
]
===
'
min_year
'
)
// year should be sorted by its value
dimsValues
[
'
year
'
].
sort
();
dimsValues
[
'
year
'
].
sort
();
console
.
log
(
dimsNames
)
console
.
log
(
dimsValues
)
let
newResult
=
[];
let
newResult
=
[];
let
rqfName
=
Object
.
keys
(
dimsValues
)[
0
];
let
rqfName
=
Object
.
keys
(
dimsValues
)[
0
];
let
rqfName2
=
Object
.
keys
(
dimsValues
)[
1
];
let
rqfName2
=
Object
.
keys
(
dimsValues
)[
1
];
...
...
This diff is collapsed.
Click to expand it.
src/libs/routes/courseCount.js
+
31
−
11
View file @
5fc9839d
...
@@ -226,13 +226,19 @@ rqf.addField({
...
@@ -226,13 +226,19 @@ rqf.addField({
}
}
}).
addValue
({
}).
addValue
({
name
:
'
city
'
,
name
:
'
city
'
,
table
:
'
curso_ens_super
io
r
'
,
table
:
'
municip
io
'
,
tableField
:
[
'
municipio_curso
'
,
'
cod_municipio_curso
'
],
tableField
:
[
'
nome
'
,
'
id
'
],
resultField
:
[
'
city_name
'
,
'
city_id
'
],
resultField
:
[
'
city_name
'
,
'
city_id
'
],
where
:
{
where
:
{
relation
:
'
=
'
,
relation
:
'
=
'
,
type
:
'
integer
'
,
type
:
'
integer
'
,
field
:
'
cod_municipio_curso
'
field
:
'
cod_municipio_curso
'
,
table
:
'
@
'
},
join
:
{
primary
:
'
id
'
,
foreign
:
'
cod_municipio_curso
'
,
foreignTable
:
'
@
'
}
}
}).
addValue
({
}).
addValue
({
name
:
'
university
'
,
name
:
'
university
'
,
...
@@ -399,14 +405,28 @@ rqf.addField({
...
@@ -399,14 +405,28 @@ rqf.addField({
});
});
courseCountApp
.
get
(
'
/
'
,
rqf
.
parse
(),
(
req
,
res
,
next
)
=>
{
courseCountApp
.
get
(
'
/
'
,
rqf
.
parse
(),
(
req
,
res
,
next
)
=>
{
if
(
"
university
"
in
req
.
dims
)
{
req
.
sql
.
from
(
'
curso_ens_superior
'
)
req
.
sql
.
from
(
'
curso_ens_superior
'
)
.
field
(
'
COUNT(curso_ens_superior.cod_curso)
'
,
'
total
'
)
.
field
(
'
COUNT(curso_ens_superior.cod_curso)
'
,
'
total
'
)
.
field
(
"
'Brasil'
"
,
'
name
'
)
.
field
(
"
'Brasil'
"
,
'
name
'
)
.
field
(
'
curso_ens_superior.ano_censo
'
,
'
year
'
)
.
field
(
'
curso_ens_superior.ano_censo
'
,
'
year
'
)
.
group
(
'
curso_ens_superior.cod_ies
'
)
.
group
(
'
curso_ens_superior.ano_censo
'
)
.
group
(
'
curso_ens_superior.ano_censo
'
)
.
order
(
'
curso_ens_superior.cod_ies
'
)
.
order
(
'
curso_ens_superior.ano_censo
'
)
.
order
(
'
curso_ens_superior.ano_censo
'
)
.
where
(
'
curso_ens_superior.tipo_atributo_ingresso <> 1 OR curso_ens_superior.tipo_atributo_ingresso is NULL
'
)
.
where
(
'
curso_ens_superior.tipo_atributo_ingresso <> 1 OR curso_ens_superior.tipo_atributo_ingresso is NULL
'
)
.
where
(
'
curso_ens_superior.cod_nivel_academico = 1
'
);
.
where
(
'
curso_ens_superior.cod_nivel_academico = 1
'
);
}
else
{
req
.
sql
.
from
(
'
curso_ens_superior
'
)
.
field
(
'
COUNT(curso_ens_superior.cod_curso)
'
,
'
total
'
)
.
field
(
"
'Brasil'
"
,
'
name
'
)
.
field
(
'
curso_ens_superior.ano_censo
'
,
'
year
'
)
.
group
(
'
curso_ens_superior.ano_censo
'
)
.
order
(
'
curso_ens_superior.ano_censo
'
)
.
where
(
'
curso_ens_superior.tipo_atributo_ingresso <> 1 OR curso_ens_superior.tipo_atributo_ingresso is NULL
'
)
.
where
(
'
curso_ens_superior.cod_nivel_academico = 1
'
);
}
next
();
next
();
},
rqf
.
build
(),
query
,
id2str
.
transform
(),
addMissing
(
rqf
),
response
(
'
course_count
'
));
},
rqf
.
build
(),
query
,
id2str
.
transform
(),
addMissing
(
rqf
),
response
(
'
course_count
'
));
...
...
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