init commit
All checks were successful
build-api-image / build (push) Successful in 51s

This commit is contained in:
Antonio Lopes dos Santos
2026-08-04 16:52:02 -03:00
commit afec302c3e
11594 changed files with 1636728 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
<?php
namespace App\Http\Controllers\Apac;
use App\Http\Controllers\Controller;
use App\Services\Apac\ExportacaoService;
use Illuminate\Http\Response;
class ExportacaoController extends Controller
{
protected $modulo = 'apac';
protected $funcionalidade = 'exportacao';
public function create()
{
$this->auth(__FUNCTION__);
return response()->json(ExportacaoService::create(), Response::HTTP_OK);
}
public function store()
{
$this->auth(__FUNCTION__);
return response()->json(ExportacaoService::store(), Response::HTTP_CREATED);
}
public function update($id)
{
$this->auth(__FUNCTION__);
return response()->json(ExportacaoService::update($id), Response::HTTP_CREATED);
}
public function destroy($id)
{
$this->auth(__FUNCTION__);
return response()->json(ExportacaoService::destroy($id), Response::HTTP_NO_CONTENT);
}
public function datatable()
{
return datatables()->of(ExportacaoService::datatable())->skipTotalRecords()->make(true);
}
public function download($id)
{
$response = ExportacaoService::download($id);
$headers = [
'Content-Type' => 'text/plain;charset=UTF-8',
];
return response()->download($response['arquivo'], $response['nome'], $headers);
}
}

View File

@@ -0,0 +1,92 @@
<?php
namespace App\Http\Controllers\Apac;
use App\Exceptions\Apac\ProcedimentoSecundarioSemOcupacaoException;
use App\Http\Controllers\Controller;
use App\Services\Apac\ProcedimentoService;
use App\Utils\MaskUtil;
use Illuminate\Http\Response;
class ProcedimentoController extends Controller
{
protected $modulo = 'apac';
protected $funcionalidade = 'procedimento';
public function datatable()
{
return datatables()
->of(ProcedimentoService::datatable())
->filterColumn('solicitacao_autorizacao.data_processamento', function ($query, $keyword) {
$query->whereRaw("DATE_FORMAT(solicitacao_autorizacao.data_processamento, '%d/%m/%Y') like ?", ["%{$keyword}%"])
->orWhereRaw(
"CONCAT(
SUBSTR(solicitacao_autorizacao.data_processamento, 9, 2),
SUBSTR(solicitacao_autorizacao.data_processamento, 6, 2),
SUBSTR(solicitacao_autorizacao.data_processamento, 1, 4)
) like ?",
["%{$keyword}%"]
);
})
->filterColumn('procedimento_principal.codigo', function ($query, $keyword) {
$query->whereRaw("procedimento_principal.codigo like ?", ['%' . str_replace(['.', '-'], '', $keyword) . '%']);
})
->editColumn('procedimento_principal_codigo', fn ($sa) => MaskUtil::getProcedimentoMasked($sa->procedimento_principal_codigo))
->skipTotalRecords()
->make(true);
}
public function create()
{
$this->auth(__FUNCTION__);
return response()->json(ProcedimentoService::create(), Response::HTTP_OK);
}
public function store()
{
$this->auth(__FUNCTION__);
try {
return response()->json(ProcedimentoService::store(), Response::HTTP_CREATED);
}
catch (ProcedimentoSecundarioSemOcupacaoException $e) {
return response()->json([
'message' => 'Existem procedimentos secundários sem CBO preenchido. '
. 'Favor preencher na funcionalidade Regulação > Monitoramento de protocolos.'
], Response::HTTP_BAD_REQUEST);
}
}
public function edit($id)
{
$this->auth(__FUNCTION__);
return response()->json(ProcedimentoService::edit($id), Response::HTTP_OK);
}
public function update($id)
{
$this->auth(__FUNCTION__);
return response()->json(ProcedimentoService::update($id), Response::HTTP_OK);
}
public function destroyAutomaticos($unidadeExecutanteId, $competenciaId)
{
$this->auth(__FUNCTION__);
return response()->json(ProcedimentoService::destroyAutomaticos($unidadeExecutanteId, $competenciaId), Response::HTTP_NO_CONTENT);
}
public function destroy($id)
{
$this->auth(__FUNCTION__);
return response()->json(ProcedimentoService::destroy($id), Response::HTTP_NO_CONTENT);
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Http\Controllers\Apac;
use App\Http\Controllers\Controller;
use App\Services\Apac\RelatorioInconsistenciaService;
use Illuminate\Http\Response;
class RelatorioInconsistenciaController extends Controller
{
protected $modulo = 'apac';
protected $funcionalidade = 'relatorio-inconsistencia';
public function index()
{
$this->auth(__FUNCTION__);
return response()->json(RelatorioInconsistenciaService::index(), Response::HTTP_OK);
}
public function create()
{
return response()->json(RelatorioInconsistenciaService::create(), Response::HTTP_OK);
}
public function list()
{
return response()->json(RelatorioInconsistenciaService::list(), Response::HTTP_OK);
}
public function autocompleteUsuarioExecutante()
{
return datatables()->of(RelatorioInconsistenciaService::autocompleteUsuarioExecutante())->toJson();
}
public function autocompleteProcedimento()
{
return datatables()->of(RelatorioInconsistenciaService::autocompleteProcedimento())->toJson();
}
}