This commit is contained in:
66
api/app/Http/Controllers/Bpa/ExportacaoController.php
Normal file
66
api/app/Http/Controllers/Bpa/ExportacaoController.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bpa;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Bpa\ExportacaoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ExportacaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'bpa';
|
||||
protected $funcionalidade = 'exportacao';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::update($request, $id), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExportacaoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(ExportacaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bpa;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Bpa\ProcedimentoConsolidadoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ProcedimentoConsolidadoController extends Controller
|
||||
{
|
||||
protected $modulo = 'bpa';
|
||||
protected $funcionalidade = 'procedimento-consolidado';
|
||||
|
||||
public function list(Request $request)
|
||||
{
|
||||
return response()->json(ProcedimentoConsolidadoService::list($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoConsolidadoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoConsolidadoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoConsolidadoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoConsolidadoService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoConsolidadoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoConsolidadoService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoConsolidadoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(ProcedimentoConsolidadoService::datatable())
|
||||
->filterColumn('procedimento_codigo', function ($query, $keyword) {
|
||||
|
||||
$query
|
||||
->whereRaw("procedimento_codigo like ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(procedimento_codigo,1,2),
|
||||
'.',
|
||||
SUBSTR(procedimento_codigo,3,2),
|
||||
'.',
|
||||
SUBSTR(procedimento_codigo,5,2),
|
||||
'.',
|
||||
SUBSTR(procedimento_codigo,7,3),
|
||||
'-',
|
||||
SUBSTR(procedimento_codigo,10,1)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bpa;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Bpa\ProcedimentoIndividualizadoService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ProcedimentoIndividualizadoController extends Controller
|
||||
{
|
||||
protected $modulo = 'bpa';
|
||||
protected $funcionalidade = 'procedimento-individualizado';
|
||||
|
||||
public function list(Request $request)
|
||||
{
|
||||
return response()->json(ProcedimentoIndividualizadoService::list($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoIndividualizadoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoIndividualizadoService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoIndividualizadoService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoIndividualizadoService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoIndividualizadoService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoIndividualizadoService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ProcedimentoIndividualizadoService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(ProcedimentoIndividualizadoService::datatable())
|
||||
->filterColumn('procedimento_codigo', function ($query, $keyword) {
|
||||
|
||||
$query
|
||||
->whereRaw("procedimento_codigo like ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(procedimento_codigo,1,2),
|
||||
'.',
|
||||
SUBSTR(procedimento_codigo,3,2),
|
||||
'.',
|
||||
SUBSTR(procedimento_codigo,5,2),
|
||||
'.',
|
||||
SUBSTR(procedimento_codigo,7,3),
|
||||
'-',
|
||||
SUBSTR(procedimento_codigo,10,1)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bpa;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Bpa\RelatorioBpaConsolidadoService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioBpaConsolidadoController extends Controller
|
||||
{
|
||||
protected $modulo = 'bpa';
|
||||
protected $funcionalidade = 'relatorio-bpa-consolidado';
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioBpaConsolidadoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioBpaConsolidadoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function getInconsistencias()
|
||||
{
|
||||
return response()->json(RelatorioBpaConsolidadoService::getInconsistencias(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bpa;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Bpa\RelatorioBpaIndividualizadoService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioBpaIndividualizadoController extends Controller
|
||||
{
|
||||
protected $modulo = 'bpa';
|
||||
protected $funcionalidade = 'relatorio-bpa-individualizado';
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioBpaIndividualizadoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioBpaIndividualizadoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function getInconsistencias($bpaProcedimentoId)
|
||||
{
|
||||
return response()->json(RelatorioBpaIndividualizadoService::getInconsistencias($bpaProcedimentoId), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bpa;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Bpa\RelatorioInconsistenciaService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioInconsistenciaController extends Controller
|
||||
{
|
||||
protected $modulo = 'bpa';
|
||||
protected $funcionalidade = 'relatorio-inconsistencia';
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioInconsistenciaService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioInconsistenciaService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioInconsistenciaService::show($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()->of(RelatorioInconsistenciaService::datatable())->make(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bpa;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Bpa\RelatorioQuantitativoProducaoService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class RelatorioQuantitativoProducaoController extends Controller
|
||||
{
|
||||
protected $modulo = 'bpa';
|
||||
protected $funcionalidade = 'relatorio-quantitativo-producao';
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioQuantitativoProducaoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(RelatorioQuantitativoProducaoService::list(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user