This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\AprovacaoEntradaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class AprovacaoEntradaController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'almoxarifado-cliente-aprovacao-entrada';
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(AprovacaoEntradaService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(AprovacaoEntradaService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function approve($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
AprovacaoEntradaService::approve($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function reject($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
AprovacaoEntradaService::reject($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
return datatables()
|
||||
->of(AprovacaoEntradaService::datatable($request))
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\FabricanteService;
|
||||
use App\Utils\MaskUtil;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class FabricanteController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'almoxarifado-cliente-fabricante';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FabricanteService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
FabricanteService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(FabricanteService::datatable())
|
||||
->filterColumn('fabricante.cnpj', fn ($query, $keyword) => $query
|
||||
->whereRaw('fabricante.cnpj like ?', ['%' . MaskUtil::getOnlyDigits($keyword) . '%'])
|
||||
)
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\FornecedorService;
|
||||
use App\Utils\MaskUtil;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class FornecedorController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'almoxarifado-cliente-fornecedor';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(FornecedorService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
FornecedorService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(FornecedorService::datatable())
|
||||
->filterColumn('fornecedor.cnpj', fn ($query, $keyword) => $query
|
||||
->whereRaw('fornecedor.cnpj like ?', ['%' . MaskUtil::getOnlyDigits($keyword) . '%'])
|
||||
)
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Cadastro\Material\MaterialService as CadastroMaterialService;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\MaterialService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class MaterialController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'almoxarifado-cliente-material';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(MaterialService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
MaterialService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(MaterialService::datatable())
|
||||
->filterColumn('conectasus_material_descricao_completa', fn ($query, $keyword) => $query
|
||||
->whereRaw(CadastroMaterialService::getDescricaoCompletaRaw(
|
||||
'conectasus_material',
|
||||
'conectasus_material_apresentacao',
|
||||
'conectasus_material_apresentacao_unidade_medida'
|
||||
) . " like ?", ["%{$keyword}%"])
|
||||
)
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\PeriodoContabilService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class PeriodoContabilController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'almoxarifado-cliente-periodo-contabil';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PeriodoContabilService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(PeriodoContabilService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
PeriodoContabilService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(PeriodoContabilService::datatable())
|
||||
->filterColumn('periodo_contabil.inicio', fn ($query, $keyword) => $query
|
||||
->whereRaw("DATE_FORMAT(periodo_contabil.inicio, '%d/%m/%Y') like ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(periodo_contabil.inicio, 9, 2),
|
||||
SUBSTR(periodo_contabil.inicio, 6, 2),
|
||||
SUBSTR(periodo_contabil.inicio, 1, 4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
)
|
||||
)
|
||||
->filterColumn('periodo_contabil.fim', fn ($query, $keyword) => $query
|
||||
->whereRaw("DATE_FORMAT(periodo_contabil.fim, '%d/%m/%Y') like ?", ["%{$keyword}%"])
|
||||
->orWhereRaw(
|
||||
"CONCAT(
|
||||
SUBSTR(periodo_contabil.fim, 9, 2),
|
||||
SUBSTR(periodo_contabil.fim, 6, 2),
|
||||
SUBSTR(periodo_contabil.fim, 1, 4)
|
||||
) like ?",
|
||||
["%{$keyword}%"]
|
||||
)
|
||||
)
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService\Almoxarifado\Cliente;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\WebService\Almoxarifado\Cliente\UnidadeService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class UnidadeController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'almoxarifado-cliente-unidade';
|
||||
|
||||
public function list(Request $request)
|
||||
{
|
||||
return response()->json(UnidadeService::list($request), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UnidadeService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UnidadeService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UnidadeService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UnidadeService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
UnidadeService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(UnidadeService::datatable())
|
||||
->filterColumn('conectasus_centro_custo_descricao', fn ($query, $keyword) => $query
|
||||
->whereRaw(
|
||||
"CONCAT(
|
||||
conectasus_unidade.nome_fantasia,
|
||||
IF(conectasus_infraestrutura.nome IS NOT NULL,
|
||||
CONCAT(' - ', conectasus_infraestrutura.nome),
|
||||
''
|
||||
),
|
||||
' - ',
|
||||
conectasus_setor.nome
|
||||
) like ?"
|
||||
, ["%{$keyword}%"])
|
||||
)
|
||||
->filterColumn('is_almoxarifado', fn ($query, $keyword) => $query
|
||||
->whereRaw("IF (unidade.is_almoxarifado, 'SIM', 'NÃO') like ?", ["%{$keyword}%"])
|
||||
)
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService\Laboratorio\Cliente;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\WebService\Laboratorio\Cliente\ExameService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ExameController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'laboratorio-cliente-exame';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request, $laboratorioId)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::store($request, $laboratorioId), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(ExameService::update($request, $laboratorioId, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($laboratorioId, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
ExameService::destroy($laboratorioId, $id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(ExameService::datatable())
|
||||
->filterColumn('laboratorio_descricao', function ($query, $keyword) {
|
||||
$query->whereRaw("CONCAT(
|
||||
conectasus_unidade.nome_fantasia,
|
||||
IF(conectasus_infraestrutura.nome IS NOT NULL,
|
||||
CONCAT(' - ', conectasus_infraestrutura.nome),
|
||||
''
|
||||
)
|
||||
) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService\Laboratorio\Cliente;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\WebService\Laboratorio\Cliente\LaboratorioService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class LaboratorioController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'laboratorio-cliente-laboratorio';
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(LaboratorioService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(LaboratorioService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(LaboratorioService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
LaboratorioService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(LaboratorioService::datatable())
|
||||
->filterColumn('conectasus_infraestrutura_nome', function ($query, $keyword) {
|
||||
$query->whereRaw(
|
||||
"COALESCE(conectasus_infraestrutura.nome, conectasus_unidade.nome_fantasia) LIKE ?",
|
||||
["%{$keyword}%"]
|
||||
);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
60
api/app/Http/Controllers/WebService/UsuarioController.php
Normal file
60
api/app/Http/Controllers/WebService/UsuarioController.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\WebService;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\WebService\UsuarioService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class UsuarioController extends Controller
|
||||
{
|
||||
protected $modulo = 'web-service';
|
||||
protected $funcionalidade = 'usuario';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UsuarioService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UsuarioService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UsuarioService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(UsuarioService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
UsuarioService::destroy($id);
|
||||
|
||||
return response()->noContent();
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(UsuarioService::datatable())
|
||||
->editColumn('permissoes', fn ($u) => explode('#', $u->permissoes))
|
||||
->skipTotalRecords()
|
||||
->toJson();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user