-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/2.0.0' into main
- Loading branch information
Showing
84 changed files
with
4,860 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Lumen | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
lumen-build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | ||
with: | ||
php-version: '7.4' | ||
- uses: actions/checkout@v2 | ||
- name: Copy .env | ||
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | ||
- name: Install Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Directory Permissions | ||
run: chmod -R 777 storage |
69 changes: 69 additions & 0 deletions
69
app/DAO/ResidenciaMultiprofissional/AtividadeModuloDAO.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
namespace App\DAO\ResidenciaMultiprofissional; | ||
|
||
use App\Model\ResidenciaMultiprofissional\AtividadeModulo; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class AtividadeModuloDAO | ||
{ | ||
private $model; | ||
private $enfaseDAO; | ||
private $nucleoProfissionalDAO; | ||
|
||
public function __construct() | ||
{ | ||
$this->model = new AtividadeModulo(); | ||
$this->enfaseDAO = new EnfaseDAO(); | ||
$this->nucleoProfissionalDAO = new NucleoProfissionalDAO(); | ||
} | ||
|
||
public function get($id) | ||
{ | ||
$select = DB::select("SELECT * FROM {$this->model->getTable()} WHERE unidadetematicaid = :unidadetematicaid", ['unidadetematicaid' => $id]); | ||
if (count($select)) { | ||
$atividadeModulo = new AtividadeModulo(); | ||
|
||
$select = $select[0]; | ||
|
||
$atividadeModulo->id = $select->unidadetematicaid; | ||
$atividadeModulo->periodo = $select->periodo; | ||
$atividadeModulo->descricao = $select->descricao; | ||
$atividadeModulo->sumula = $select->sumula; | ||
$atividadeModulo->cargaHoraria = $select->cargahoraria; | ||
|
||
$atividadeModulo->enfases = $this->getEnfasesAtividadeModulo($select->unidadetematicaid); | ||
$atividadeModulo->nucleosprofissionais = $this->getNucleosProfissionaisAtividadeModulo($select->unidadetematicaid); | ||
} | ||
return $atividadeModulo; | ||
} | ||
|
||
public function getEnfasesAtividadeModulo($id) | ||
{ | ||
$select = DB::select('SELECT * FROM res.enfasedaunidadetematica WHERE unidadetematicaid = :unidadetematicaid', ['unidadetematicaid' => $id]); | ||
$enfases = array(); | ||
|
||
if (count($select)) { | ||
foreach ($select as $enfase) { | ||
$enfases[] = $this->enfaseDAO->get($enfase->enfaseid); | ||
} | ||
} | ||
|
||
return $enfases; | ||
} | ||
|
||
public function getNucleosProfissionaisAtividadeModulo($id) | ||
{ | ||
$select = DB::select('SELECT * FROM res.nucleodaunidadetematica WHERE unidadetematicaid = :unidadetematicaid', ['unidadetematicaid' => $id]); | ||
$nucleos = array(); | ||
|
||
if (count($select)) { | ||
foreach ($select as $nucleo) { | ||
$nucleos[] = $this->nucleoProfissionalDAO->get($nucleo->nucleoprofissionalid); | ||
} | ||
} | ||
|
||
return $nucleos; | ||
} | ||
|
||
} |
159 changes: 159 additions & 0 deletions
159
app/DAO/ResidenciaMultiprofissional/CargaHorariaComplementarDAO.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
<?php | ||
|
||
namespace App\DAO\ResidenciaMultiprofissional; | ||
|
||
use App\Model\BaseModel\BaseModelSagu; | ||
use App\Model\ResidenciaMultiprofissional\CargaHorariaComplementar; | ||
use App\Model\ResidenciaMultiprofissional\OfertaModuloFalta; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class CargaHorariaComplementarDAO | ||
{ | ||
private $model; | ||
private $cargaHorariaComplementarTipoDAO; | ||
|
||
public function __construct() | ||
{ | ||
$this->model = new CargaHorariaComplementar(); | ||
$this->cargaHorariaComplementarTipoDAO = new CargaHorariaComplementarTipoDAO(); | ||
} | ||
|
||
public function get($id) | ||
{ | ||
$select = DB::select( | ||
"SELECT * FROM {$this->model->getTable()} | ||
WHERE cargahorariacomplementarid = :cargahorariacomplementarid", | ||
[ | ||
'cargahorariacomplementarid' => $id | ||
] | ||
); | ||
$cargaHorariaComplementar = new CargaHorariaComplementar(); | ||
|
||
if (count($select)) { | ||
$select = $select[0]; | ||
|
||
$cargaHorariaComplementar->id = $select->cargahorariacomplementarid; | ||
$cargaHorariaComplementar->tipoCargaHorariaComplementar = $this->cargaHorariaComplementarTipoDAO->get($select->tipodecargahorariacomplementarid); | ||
$cargaHorariaComplementar->residente = $select->residenteid; | ||
$cargaHorariaComplementar->cargaHoraria = $select->cargahoraria; | ||
$cargaHorariaComplementar->justificativa = $select->justificativa; | ||
$cargaHorariaComplementar->tipoCargaHoraria = $select->tipocargahoraria; | ||
$cargaHorariaComplementar->oferta = $select->ofertadeunidadetematicaid; | ||
|
||
} | ||
|
||
return $cargaHorariaComplementar; | ||
} | ||
|
||
public function getCargaHorariaComplementarDoResidenteNaOferta($residenteId, $ofertaId) | ||
{ | ||
$select = DB::select( | ||
"SELECT cargahorariacomplementarid FROM {$this->model->getTable()} | ||
WHERE residenteid = :residenteid | ||
AND ofertadeunidadetematicaid = :ofertadeunidadetematicaid", | ||
[ | ||
'residenteid' => $residenteId, | ||
'ofertadeunidadetematicaid' => $ofertaId | ||
] | ||
); | ||
|
||
|
||
$cargaHorariaComplementarResidente = []; | ||
if (count($select)) { | ||
foreach ($select as $cargaHorariaComplementar) { | ||
$cargaHorariaComplementarResidente[] = $this->get($cargaHorariaComplementar->cargahorariacomplementarid); | ||
} | ||
} | ||
return $cargaHorariaComplementarResidente; | ||
} | ||
|
||
public function getCargaHorariaComplementarDoResidenteNaOfertaPorTipo($residenteId, $ofertaId, $tipoCargaHoraria) | ||
{ | ||
$select = DB::select( | ||
"SELECT cargahorariacomplementarid FROM {$this->model->getTable()} | ||
WHERE residenteid = :residenteid | ||
AND ofertadeunidadetematicaid = :ofertadeunidadetematicaid | ||
AND tipocargahoraria = :tipocargahoraria | ||
", | ||
[ | ||
'residenteid' => $residenteId, | ||
'ofertadeunidadetematicaid' => $ofertaId, | ||
'tipocargahoraria' => $tipoCargaHoraria | ||
] | ||
); | ||
|
||
$cargaHorariaComplementarResidente = 0; | ||
if (count($select)) { | ||
foreach ($select as $cargaHorariaComplementar) { | ||
$cargaHorariaComplementarResidenteObj = $this->get($cargaHorariaComplementar->cargahorariacomplementarid); | ||
$cargaHorariaComplementarResidente += $cargaHorariaComplementarResidenteObj->cargaHoraria; | ||
} | ||
} | ||
return $cargaHorariaComplementarResidente; | ||
} | ||
|
||
public function insert(CargaHorariaComplementar $cargaHorariaComplementar) | ||
{ | ||
$result = DB::insert(" | ||
insert into {$this->model->getTable()} | ||
(tipodecargahorariacomplementarid, residenteid, cargahoraria, tipocargahoraria, ofertadeunidadetematicaid, justificativa) | ||
values (?, ?, ?, ?, ?, ?)", | ||
[ | ||
$cargaHorariaComplementar->tipoCargaHorariaComplementar, | ||
$cargaHorariaComplementar->residente, | ||
$cargaHorariaComplementar->cargaHoraria, | ||
$cargaHorariaComplementar->tipoCargaHoraria, | ||
$cargaHorariaComplementar->oferta, | ||
$cargaHorariaComplementar->justificativa | ||
]); | ||
|
||
if ($result) { | ||
$rowId = DB::connection()->getPdo()->lastInsertId(); | ||
return $this->get($rowId); | ||
} | ||
|
||
return $result; | ||
} | ||
|
||
public function update(CargaHorariaComplementar $cargaHorariaComplementar) | ||
{ | ||
$result = DB::update(" | ||
UPDATE {$this->model->getTable()} | ||
SET | ||
tipodecargahorariacomplementarid = ?, | ||
residenteid = ?, | ||
cargahoraria = ?, | ||
tipocargahoraria = ?, | ||
ofertadeunidadetematicaid = ?, | ||
justificativa = ? | ||
WHERE cargahorariacomplementarid = ?", | ||
[ | ||
$cargaHorariaComplementar->tipoCargaHorariaComplementar, | ||
$cargaHorariaComplementar->residente, | ||
$cargaHorariaComplementar->cargaHoraria, | ||
$cargaHorariaComplementar->tipoCargaHoraria, | ||
$cargaHorariaComplementar->oferta, | ||
$cargaHorariaComplementar->justificativa, | ||
$cargaHorariaComplementar->id | ||
]); | ||
|
||
if ($result) { | ||
return $this->get($cargaHorariaComplementar->id); | ||
} | ||
|
||
return $result; | ||
} | ||
|
||
public function delete(CargaHorariaComplementar $cargaHorariaComplementar) | ||
{ | ||
$result = DB::update(" | ||
DELETE FROM {$this->model->getTable()} | ||
WHERE cargahorariacomplementarid = ?", | ||
[ | ||
$cargaHorariaComplementar->id | ||
]); | ||
|
||
return $result; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
app/DAO/ResidenciaMultiprofissional/CargaHorariaComplementarTipoDAO.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace App\DAO\ResidenciaMultiprofissional; | ||
|
||
use App\Model\ResidenciaMultiprofissional\CargaHorariaComplementarTipo; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class CargaHorariaComplementarTipoDAO | ||
{ | ||
private $model; | ||
|
||
public function __construct() | ||
{ | ||
$this->model = new CargaHorariaComplementarTipo(); | ||
} | ||
|
||
public function get($id) | ||
{ | ||
$select = DB::select( | ||
"SELECT * FROM {$this->model->getTable()} | ||
WHERE tipodecargahorariacomplementarid = :tipodecargahorariacomplementarid", | ||
[ | ||
'tipodecargahorariacomplementarid' => $id | ||
] | ||
); | ||
$cargaHorariaComplementarTipo = new CargaHorariaComplementarTipo(); | ||
|
||
if (count($select)) { | ||
$select = $select[0]; | ||
|
||
$cargaHorariaComplementarTipo->id = $select->tipodecargahorariacomplementarid; | ||
$cargaHorariaComplementarTipo->descricao = $select->descricao; | ||
} | ||
|
||
return $cargaHorariaComplementarTipo; | ||
} | ||
|
||
public function retornaTodos() | ||
{ | ||
$select = DB::select( | ||
"SELECT tipodecargahorariacomplementarid FROM {$this->model->getTable()}" | ||
); | ||
|
||
$tiposCargaHorariaComplementar = []; | ||
if (count($select)) { | ||
foreach ($select as $tipo) { | ||
$tiposCargaHorariaComplementar[] = $this->get($tipo->tipodecargahorariacomplementarid); | ||
} | ||
} | ||
|
||
return $tiposCargaHorariaComplementar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace App\DAO\ResidenciaMultiprofissional; | ||
|
||
use App\Model\ResidenciaMultiprofissional\Enfase; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class EnfaseDAO | ||
{ | ||
private $model; | ||
|
||
public function __construct() | ||
{ | ||
$this->model = new Enfase(); | ||
} | ||
|
||
public function get($id) | ||
{ | ||
$select = DB::select("SELECT * FROM {$this->model->getTable()} WHERE enfaseid = :enfaseid", ['enfaseid' => $id]); | ||
if (count($select)) { | ||
$enfase = new Enfase(); | ||
|
||
$select = $select[0]; | ||
|
||
$enfase->id = $select->enfaseid; | ||
$enfase->descricao = $select->descricao; | ||
$enfase->abreviatura = $select->abreviatura; | ||
} | ||
return $enfase; | ||
} | ||
|
||
public function getEnfases() | ||
{ | ||
$select = DB::select("SELECT * FROM {$this->model->getTable()} ORDER BY descricao"); | ||
$enfases = array(); | ||
if (count($select)) { | ||
foreach ($select as $enfase) { | ||
$enfases[] = $this->get($enfase->enfaseid); | ||
} | ||
} | ||
|
||
return $enfases; | ||
} | ||
} |
Oops, something went wrong.