Commit 621f35df authored by Matheus Horstmann's avatar Matheus Horstmann 🐴
Browse files

Merge branch 'refatora-backend' into 'development'

arruma pesquisa por curso

See merge request !42
parents e2bb9772 128046e6
......@@ -18,6 +18,7 @@ ds.automigrate(lbTables, function(err) {
loadModelFromOldDB(old_db.get_salas, app.models.Sala, LOG_CREATE),
loadModelFromOldDB(old_db.get_blocos, app.models.Bloco, LOG_CREATE),
loadModelFromOldDB(old_db.get_Tipodesala, app.models.Tipodesala, LOG_CREATE),
loadModelFromOldDB(old_db.get_professores, app.models.Professor, LOG_CREATE),
criaUsuario,
criaSecretario,
criaRoles,
......@@ -28,7 +29,6 @@ ds.automigrate(lbTables, function(err) {
criaSemestre,
criaTurmas,
criaHorarios,
loadModelFromOldDB(old_db.get_professores, app.models.Professor, LOG_CREATE),
loadModelFromOldDB(old_db.get_departamentos, app.models.Departamento, LOG_CREATE),
loadModelFromOldDB(old_db.get_setores, app.models.Setor, LOG_CREATE),
loadModelFromOldDB(old_db.get_disciplinas, app.models.Disciplina, LOG_CREATE),
......@@ -146,7 +146,7 @@ function criaTurmas(cb){
{
"disciplinaCod":"ci055",
"data_inicio":"2019-02-26T13:58:50.150Z",
"semestre": "2018/1",
"semestre": "2017/1",
"data_fim":"2019-02-26T13:58:50.150Z",
"codigo": "t3",
"organizador":"a",
......@@ -159,7 +159,7 @@ function criaTurmas(cb){
"disciplinaCod":"ci055",
"data_inicio":"2019-02-26T13:58:50.150Z",
"data_fim":"2019-02-26T13:58:50.150Z",
"semestre": "2018/1",
"semestre": "2017/1",
"codigo": "t4",
"organizador":"a",
"vagas":49,
......@@ -168,10 +168,13 @@ function criaTurmas(cb){
"periodo": 1
},
], function(err, turmas){
turmas[0].horarios.add(1);
turmas[1].horarios.add(2);
turmas[2].horarios.add(3);
turmas[3].horarios.add(4);
var _professores = ["CI065A","elias","albini","agregio"]
var _cursos = ["21A","96A","23A","21A"]
for(var i=0; i<turmas.length; i++) {
turmas[i].horarios.add(i+1)
turmas[i].professores.add(_professores[i])
turmas[i].cursos.add(_cursos[i])
}
cb(err);
}.bind(this));
}
......
*.json
\ No newline at end of file
[ {"nome":"Mesae Carteira"}, {"nome":"Carteira com Braço"}, {"nome":"Mesa estilo Prancheta"}, {"nome":"Anfiteatro"}, {"nome":"Laboratório"}, {"nome":"Laboratório de Química"}, {"nome":"Laboratório de Pesquisa"}, {"nome":"Laboratório de Informática"}, {"nome":"Laboratório de Elétrica"}, {"nome":"Gabinete de Professor"}, {"nome":"Bancadas"}, {"nome":"Mesa de reunião e cadeiras "}, {"nome":"Laboratório de Fisioterapia"}, {"nome":"Laboratório de Anatomia"}, {"nome":"Laboratório de Microscópios"}, {"nome":"Laboratório de Tribologia"} ]
[
{
"disciplina1": " bmed011",
"disciplina1": "bmed011",
"disciplina2": "bmed013"
},
{
"disciplina1": " cd031",
"disciplina1": "cd031",
"disciplina2": "ceg204"
},
{
"disciplina1": " cd027",
"disciplina1": "cd027",
"disciplina2": "ceg206"
},
{
"disciplina1": " ci202",
"disciplina1": "ci202",
"disciplina2": "ci184"
},
{
"disciplina1": " ci202",
"disciplina1": "ci202",
"disciplina2": "ci181"
},
{
......@@ -24,19 +24,19 @@
"disciplina2": "ci181"
},
{
"disciplina1": " bt057",
"disciplina1": "bt057",
"disciplina2": "bt058"
},
{
"disciplina1": " cd015",
"disciplina1": "cd015",
"disciplina2": "cd029"
},
{
"disciplina1": " cd015",
"disciplina1": "cd015",
"disciplina2": "cd044"
},
{
"disciplina1": " cd015",
"disciplina1": "cd015",
"disciplina2": "ceg001"
},
{
......@@ -52,23 +52,23 @@
"disciplina2": "ceg001"
},
{
"disciplina1": " cd035",
"disciplina1": "cd035",
"disciplina2": "ceg210"
},
{
"disciplina1": " cq025",
"disciplina1": "cq025",
"disciplina2": "cq207"
},
{
"disciplina1": " ce003",
"disciplina1": "ce003",
"disciplina2": "ce009"
},
{
"disciplina1": " ci208",
"disciplina1": "ci208",
"disciplina2": "ci180"
},
{
"disciplina1": " ci208",
"disciplina1": "ci208",
"disciplina2": "ci183"
},
{
......@@ -76,15 +76,15 @@
"disciplina2": "ci183"
},
{
"disciplina1": " ci240",
"disciplina1": "ci240",
"disciplina2": "ci182"
},
{
"disciplina1": " cd014",
"disciplina1": "cd014",
"disciplina2": "cd020"
},
{
"disciplina1": " cd014",
"disciplina1": "cd014",
"disciplina2": "cd033"
},
{
......@@ -92,27 +92,27 @@
"disciplina2": "cd033"
},
{
"disciplina1": " gb115",
"disciplina1": "gb115",
"disciplina2": "gb131"
},
{
"disciplina1": " tmec010",
"disciplina1": "tmec010",
"disciplina2": "tm327"
},
{
"disciplina1": " tmec058",
"disciplina1": "tmec058",
"disciplina2": "tm031"
},
{
"disciplina1": " tmec027",
"disciplina1": "tmec027",
"disciplina2": "tm262"
},
{
"disciplina1": " tmec040",
"disciplina1": "tmec040",
"disciplina2": "tm038"
},
{
"disciplina1": " tmec040",
"disciplina1": "tmec040",
"disciplina2": "tm268"
},
{
......@@ -120,31 +120,31 @@
"disciplina2": "tm268"
},
{
"disciplina1": " tmec004",
"disciplina1": "tmec004",
"disciplina2": "tm052"
},
{
"disciplina1": " tmec017",
"disciplina1": "tmec017",
"disciplina2": "tm227"
},
{
"disciplina1": " tmec018",
"disciplina1": "tmec018",
"disciplina2": "tm228"
},
{
"disciplina1": " tmec030",
"disciplina1": "tmec030",
"disciplina2": "tm252"
},
{
"disciplina1": " tmec020",
"disciplina1": "tmec020",
"disciplina2": "tm347"
},
{
"disciplina1": " tmec031",
"disciplina1": "tmec031",
"disciplina2": "tm259"
},
{
"disciplina1": " tmec031",
"disciplina1": "tmec031",
"disciplina2": "tm368"
},
{
......@@ -152,35 +152,35 @@
"disciplina2": "tm368"
},
{
"disciplina1": " tmec019",
"disciplina1": "tmec019",
"disciplina2": "tm230"
},
{
"disciplina1": " tmec001",
"disciplina1": "tmec001",
"disciplina2": "tm236"
},
{
"disciplina1": " tmec026",
"disciplina1": "tmec026",
"disciplina2": "tm244"
},
{
"disciplina1": " tmec032",
"disciplina1": "tmec032",
"disciplina2": "tm245"
},
{
"disciplina1": " tmec042",
"disciplina1": "tmec042",
"disciplina2": "tm256"
},
{
"disciplina1": " tmec034",
"disciplina1": "tmec034",
"disciplina2": "tm264"
},
{
"disciplina1": " tmec039",
"disciplina1": "tmec039",
"disciplina2": "tm249"
},
{
"disciplina1": " tmec039",
"disciplina1": "tmec039",
"disciplina2": "tm342"
},
{
......@@ -188,11 +188,11 @@
"disciplina2": "tm342"
},
{
"disciplina1": " tmec038",
"disciplina1": "tmec038",
"disciplina2": "tm246"
},
{
"disciplina1": " tmec038",
"disciplina1": "tmec038",
"disciplina2": "tm357"
},
{
......@@ -200,23 +200,23 @@
"disciplina2": "tm357"
},
{
"disciplina1": " tmec075",
"disciplina1": "tmec075",
"disciplina2": "tm265"
},
{
"disciplina1": " tmec073",
"disciplina1": "tmec073",
"disciplina2": "tm266"
},
{
"disciplina1": " bmed001",
"disciplina1": "bmed001",
"disciplina2": "bmed003"
},
{
"disciplina1": " tm251",
"disciplina1": "tm251",
"disciplina2": "tm359"
},
{
"disciplina1": " tm251",
"disciplina1": "tm251",
"disciplina2": "tmec036"
},
{
......@@ -224,263 +224,263 @@
"disciplina2": "tmec036"
},
{
"disciplina1": " bq064",
"disciplina1": "bq064",
"disciplina2": "bq401"
},
{
"disciplina1": " cm041",
"disciplina1": "cm041",
"disciplina2": "cm047"
},
{
"disciplina1": " cm044",
"disciplina1": "cm044",
"disciplina2": "cma314"
},
{
"disciplina1": " bmed002",
"disciplina1": "bmed002",
"disciplina2": "bmed004"
},
{
"disciplina1": " th041",
"disciplina1": "th041",
"disciplina2": "th056"
},
{
"disciplina1": " tt008",
"disciplina1": "tt008",
"disciplina2": "tt081"
},
{
"disciplina1": " tt080",
"disciplina1": "tt080",
"disciplina2": "tt007"
},
{
"disciplina1": " cf060",
"disciplina1": "cf060",
"disciplina2": "cf110"
},
{
"disciplina1": " cf059",
"disciplina1": "cf059",
"disciplina2": "cf109"
},
{
"disciplina1": " bz013",
"disciplina1": "bz013",
"disciplina2": "bz070"
},
{
"disciplina1": " bz014",
"disciplina1": "bz014",
"disciplina2": "bz071"
},
{
"disciplina1": " bb080",
"disciplina1": "bb080",
"disciplina2": "bb020"
},
{
"disciplina1": " bb079",
"disciplina1": "bb079",
"disciplina2": "bb019"
},
{
"disciplina1": " bq053",
"disciplina1": "bq053",
"disciplina2": "bq066"
},
{
"disciplina1": " bq007",
"disciplina1": "bq007",
"disciplina2": "bq058"
},
{
"disciplina1": " bq004",
"disciplina1": "bq004",
"disciplina2": "bq067"
},
{
"disciplina1": " bmed010",
"disciplina1": "bmed010",
"disciplina2": "bmed012"
},
{
"disciplina1": " bp063",
"disciplina1": "bp063",
"disciplina2": "bp310"
},
{
"disciplina1": " dprf040",
"disciplina1": "dprf040",
"disciplina2": "dprf048"
},
{
"disciplina1": " dprf014",
"disciplina1": "dprf014",
"disciplina2": "dprf067"
},
{
"disciplina1": " bg053",
"disciplina1": "bg053",
"disciplina2": "bg069"
},
{
"disciplina1": " hh116",
"disciplina1": "hh116",
"disciplina2": "hh154"
},
{
"disciplina1": " hh120",
"disciplina1": "hh120",
"disciplina2": "hh155"
},
{
"disciplina1": " hh125",
"disciplina1": "hh125",
"disciplina2": "hh159"
},
{
"disciplina1": " hh164",
"disciplina1": "hh164",
"disciplina2": "hh209"
},
{
"disciplina1": " hh168",
"disciplina1": "hh168",
"disciplina2": "hh214"
},
{
"disciplina1": " hh169",
"disciplina1": "hh169",
"disciplina2": "hh215"
},
{
"disciplina1": " hh171",
"disciplina1": "hh171",
"disciplina2": "hh299"
},
{
"disciplina1": " hh174",
"disciplina1": "hh174",
"disciplina2": "hh221"
},
{
"disciplina1": " hh176",
"disciplina1": "hh176",
"disciplina2": "hh223"
},
{
"disciplina1": " hh046",
"disciplina1": "hh046",
"disciplina2": "hh606"
},
{
"disciplina1": " hh050",
"disciplina1": "hh050",
"disciplina2": "hh303"
},
{
"disciplina1": " hh051",
"disciplina1": "hh051",
"disciplina2": "hh304"
},
{
"disciplina1": " hs037",
"disciplina1": "hs037",
"disciplina2": "hs207"
},
{
"disciplina1": " ci055",
"disciplina1": "ci055",
"disciplina2": "ci1055"
},
{
"disciplina1": " ci1002",
"disciplina1": "ci1002",
"disciplina2": "ci067"
},
{
"disciplina1": " CI301",
"disciplina1": "CI301",
"disciplina2": "ci1007"
},
{
"disciplina1": " ci1056",
"disciplina1": "ci1056",
"disciplina2": "ci056"
},
{
"disciplina1": " ci1057",
"disciplina1": "ci1057",
"disciplina2": "ci057"
},
{
"disciplina1": " ci1058",
"disciplina1": "ci1058",
"disciplina2": "ci058"
},
{
"disciplina1": " ci1059",
"disciplina1": "ci1059",
"disciplina2": "ci059"
},
{
"disciplina1": " ci1061",
"disciplina1": "ci1061",
"disciplina2": "ci061"
},
{
"disciplina1": " ci1062",
"disciplina1": "ci1062",
"disciplina2": "ci062"
},
{
"disciplina1": " ci1064",
"disciplina1": "ci1064",
"disciplina2": "ci064"
},
{
"disciplina1": " ci1065",
"disciplina1": "ci1065",
"disciplina2": "ci065"
},
{
"disciplina1": " ci1068",
"disciplina1": "ci1068",
"disciplina2": "ci068"
},
{
"disciplina1": " ci1162",
"disciplina1": "ci1162",
"disciplina2": "ci162"
},
{
"disciplina1": " ci1163",
"disciplina1": "ci1163",
"disciplina2": "ci163"
},
{
"disciplina1": " ci1164",
"disciplina1": "ci1164",
"disciplina2": "ci164"
},
{
"disciplina1": " ci1209",
"disciplina1": "ci1209",
"disciplina2": "ci209"
},
{
"disciplina1": " ci1210",
"disciplina1": "ci1210",
"disciplina2": "ci210"
},
{
"disciplina1": " ci1211",
"disciplina1": "ci1211",
"disciplina2": "ci211"
},
{
"disciplina1": " ci1212",
"disciplina1": "ci1212",
"disciplina2": "ci212"
},
{
"disciplina1": " ci1215",
"disciplina1": "ci1215",
"disciplina2": "ci215"
},
{
"disciplina1": " gb077",
"disciplina1": "gb077",
"disciplina2": "gb806"
},
{
"disciplina1": " ci1221",
"disciplina1": "ci1221",
"disciplina2": "ci221"
},
{
"disciplina1": " ci1237",
"disciplina1": "ci1237",
"disciplina2": "ci237"
},