Commit 7196771cda50f3f62316090100a4b2014d3a485d

Authored by eduardo.batista
1 parent 256ad9ae
Exists in master and in 1 other branch desenv

[Feat] Adicionando serviço para reabrir processo.

controlador_ws.php
... ... @@ -512,6 +512,14 @@ $app->group('/api/v1',function(){
512 512 }
513 513 return $response->withJSON($rn->concluirProcesso($dto));
514 514 });
  515 + $this->post('/reabrir/{procedimento}', function($request, $response, $args){
  516 + //o- novo pacote 4
  517 + /** @var $request Slim\Http\Request */
  518 + $rn = new MdWsSeiProcedimentoRN();
  519 + $dto = new EntradaReabrirProcessoAPI();
  520 + $dto->setIdProcedimento($request->getAttribute('route')->getArgument('procedimento'));
  521 + return $response->withJSON($rn->reabrirProcesso($dto));
  522 + });
515 523 $this->post('/acompanhar', function($request, $response, $args){
516 524 /** @var $request Slim\Http\Request */
517 525 $rn = new MdWsSeiAcompanhamentoRN();
... ...
rn/MdWsSeiProcedimentoRN.php
... ... @@ -860,6 +860,26 @@ class MdWsSeiProcedimentoRN extends InfraRN
860 860 }
861 861  
862 862 /**
  863 + * Metodo que reabre o procedimento/processo
  864 + * @param EntradaReabrirProcessoAPI $entradaReabrirProcessoAPI
  865 + * @return array
  866 + */
  867 + protected function reabrirProcessoControlado(EntradaReabrirProcessoAPI $entradaReabrirProcessoAPI)
  868 + {
  869 + try {
  870 + if (!$entradaReabrirProcessoAPI->getIdProcedimento()) {
  871 + throw new InfraException('E obrigtorio informar o id do procedimento!');
  872 + }
  873 + $objSeiRN = new SeiRN();
  874 + $objSeiRN->reabrirProcesso($entradaReabrirProcessoAPI);
  875 +
  876 + return MdWsSeiRest::formataRetornoSucessoREST('Processo reaberto com sucesso!');
  877 + } catch (Exception $e) {
  878 + return MdWsSeiRest::formataRetornoErroREST($e);
  879 + }
  880 + }
  881 +
  882 + /**
863 883 * Metodo que atribui o processo a uma pessoa
864 884 * @param EntradaAtribuirProcessoAPI $entradaAtribuirProcessoAPI
865 885 * @info Os parametros IdUsuario, ProtocoloProcedimento e SinReabrir sao obrigatorios. O parametro ProtocoloProcedimento
... ...