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
30baa296
There was a problem fetching the pipeline summary.
Commit
30baa296
authored
6 years ago
by
Glenda Train
Browse files
Options
Downloads
Plain Diff
Merge branch 'development' of gitlab.c3sl.ufpr.br:simcaq/simcaq-node into fix_age_range
parents
99e06b06
7ba4aac4
No related branches found
No related tags found
1 merge request
!131
Fix age range
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+12
-0
12 additions, 0 deletions
CHANGELOG.md
src/libs/routes/classroomCount.js
+10
-2
10 additions, 2 deletions
src/libs/routes/classroomCount.js
with
22 additions
and
2 deletions
CHANGELOG.md
+
12
−
0
View file @
30baa296
...
...
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
The format is based on
[
Keep a Changelog
](
http://keepachangelog.com/
)
and this project adheres to
[
Semantic Versioning
](
http://semver.org/
)
.
## 1.3.2 - 2018-06-20
### Changed
-
Fixed math error in classroom count at total classroom needed expression
## 1.3.1 - 2018-06-19
### Changed
-
Fixed bug with Federal District and missing cities in classroom count
## 1.3.0 - 2018-06-18
### Added
-
Daily charge amount route
## 1.2.3 - 2018-06-14
### Changed
-
Fixed roundig error in classroom count route
...
...
This diff is collapsed.
Click to expand it.
src/libs/routes/classroomCount.js
+
10
−
2
View file @
30baa296
...
...
@@ -246,6 +246,7 @@ classroomCountApp.post('/', rqf.parse(), (req, res, next) => {
let
result
=
[];
let
hashSet
=
new
Set
();
let
enrollments
=
[...
req
.
enrollment
];
let
leftovers
=
[];
while
(
i
<
req
.
classroom
.
length
)
{
let
classroom
=
req
.
classroom
[
i
];
// Cria hash única para cada espacialidade, dado um ano
...
...
@@ -305,7 +306,12 @@ classroomCountApp.post('/', rqf.parse(), (req, res, next) => {
enrollmentMatch
=
false
;
continue
;
}
else
if
(
classroom
.
city_name
>
enrollment
.
city_name
)
{
++
j
;
let
enrollmentHash
=
''
+
enrollment
.
year
+
enrollment
.
state_id
+
enrollment
.
city_id
;
if
(
hashSet
.
has
(
enrollmentHash
))
{
leftovers
.
push
(
enrollments
.
splice
(
j
,
1
));
// Para inspeção, adiciona os que "sobram" no array de sobras
}
else
{
++
j
;
}
continue
;
}
...
...
@@ -385,10 +391,12 @@ classroomCountApp.post('/', rqf.parse(), (req, res, next) => {
educationLevel
.
enrollment
.
night_classes
=
Math
.
ceil
((
educationLevel
.
enrollment
.
total_enrollment_night
/
enrollmentEducationLevel
.
numberStudentClass
));
// Total de salas
educationLevel
.
enrollment
.
total_classrooms_needed
=
(
educationLevel
.
enrollment
.
full_period_classes
+
educationLevel
.
enrollment
.
day_classes
);
educationLevel
.
enrollment
.
total_classrooms_needed
=
(
educationLevel
.
enrollment
.
full_period_classes
+
educationLevel
.
enrollment
.
day_classes
/
2
);
if
(
educationLevel
.
enrollment
.
night_classes
>
educationLevel
.
enrollment
.
day_classes
)
educationLevel
.
enrollment
.
total_classrooms_needed
+=
(
educationLevel
.
enrollment
.
night_classes
-
educationLevel
.
enrollment
.
day_classes
);
educationLevel
.
enrollment
.
total_classrooms_needed
=
Math
.
ceil
(
educationLevel
.
enrollment
.
total_classrooms_needed
);
enrollment
=
enrollments
[
j
];
}
...
...
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