Commit d74a32138f9927c50ec3c637efd7a101f363294f
1 parent
5a6871cb
Exists in
master
and in
1 other branch
[FEAT] Adicionando último serviço;
Showing
4 changed files
with
106 additions
and
28 deletions
Show diff stats
controlador_ws.php
@@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
6 | require_once dirname(__FILE__).'/../../SEI.php'; | 6 | require_once dirname(__FILE__).'/../../SEI.php'; |
7 | require_once dirname(__FILE__).'/vendor/autoload.php'; | 7 | require_once dirname(__FILE__).'/vendor/autoload.php'; |
8 | 8 | ||
9 | -//ini_set('xdebug.var_display_max_depth', 100); | ||
10 | -//ini_set('xdebug.var_display_max_children', 100); | ||
11 | -//ini_set('xdebug.var_display_max_data', 2048); | 9 | +ini_set('xdebug.var_display_max_depth', 100); |
10 | +ini_set('xdebug.var_display_max_children', 100); | ||
11 | +ini_set('xdebug.var_display_max_data', 2048); | ||
12 | //echo '<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>'; | 12 | //echo '<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>'; |
13 | 13 | ||
14 | 14 | ||
@@ -331,6 +331,24 @@ $app->group('/api/v1',function(){ | @@ -331,6 +331,24 @@ $app->group('/api/v1',function(){ | ||
331 | } | 331 | } |
332 | return $response->withJSON($rn->pesquisarProcedimento($dto)); | 332 | return $response->withJSON($rn->pesquisarProcedimento($dto)); |
333 | }); | 333 | }); |
334 | + $this->get('/listar/meus/acompanhamentos', function($request, $response, $args){ | ||
335 | + /** @var $request Slim\Http\Request */ | ||
336 | + $rn = new MdWsSeiProcedimentoRN(); | ||
337 | + $dto = new MdWsSeiProtocoloDTO(); | ||
338 | + if($request->getParam('grupo')){ | ||
339 | + $dto->setNumIdGrupoAcompanhamentoProcedimento($request->getParam('grupo')); | ||
340 | + } | ||
341 | + if($request->getParam('usuario')){ | ||
342 | + $dto->setNumIdUsuarioGeradorAcompanhamento($request->getParam('usuario')); | ||
343 | + } | ||
344 | + if($request->getParam('limit')){ | ||
345 | + $dto->setNumMaxRegistrosRetorno($request->getParam('limit')); | ||
346 | + } | ||
347 | + if(!is_null($request->getParam('start'))){ | ||
348 | + $dto->setNumPaginaAtual($request->getParam('start')); | ||
349 | + } | ||
350 | + return $response->withJSON($rn->listarProcedimentoAcompanhamento($dto)); | ||
351 | + }); | ||
334 | 352 | ||
335 | /** | 353 | /** |
336 | * Método que envia o processo | 354 | * Método que envia o processo |
@@ -395,6 +413,13 @@ $app->group('/api/v1',function(){ | @@ -395,6 +413,13 @@ $app->group('/api/v1',function(){ | ||
395 | } | 413 | } |
396 | return $response->withJSON($rn->listarAtividadesProcesso($dto)); | 414 | return $response->withJSON($rn->listarAtividadesProcesso($dto)); |
397 | }); | 415 | }); |
416 | + $this->post('/lancar/andamento/processo', function($request, $response, $args){ | ||
417 | + /** @var $request Slim\Http\Request */ | ||
418 | + $rn = new MdWsSeiAtividadeRN(); | ||
419 | + $dto = $rn->encapsulaLancarAndamentoProcesso($request->getParams()); | ||
420 | + | ||
421 | + return $response->withJSON($rn->lancarAndamentoProcesso($dto)); | ||
422 | + }); | ||
398 | 423 | ||
399 | })->add( new TokenValidationMiddleware()); | 424 | })->add( new TokenValidationMiddleware()); |
400 | 425 |
rn/MdWsSeiAtividadeRN.php
@@ -69,6 +69,46 @@ class MdWsSeiAtividadeRN extends InfraRN { | @@ -69,6 +69,46 @@ class MdWsSeiAtividadeRN extends InfraRN { | ||
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | + /** | ||
73 | + * Método que encapsula os dados para o cadastramento do andamento do processo | ||
74 | + * @param array $post | ||
75 | + * @return AtualizarAndamentoDTO | ||
76 | + */ | ||
77 | + public function encapsulaLancarAndamentoProcesso(array $data){ | ||
78 | + $entradaLancarAndamentoAPI = new EntradaLancarAndamentoAPI(); | ||
79 | + $entradaLancarAndamentoAPI->setIdTarefa(TarefaRN::$TI_ATUALIZACAO_ANDAMENTO); | ||
80 | + if($data['protocolo']){ | ||
81 | + $entradaLancarAndamentoAPI->setIdProcedimento($data['protocolo']); | ||
82 | + } | ||
83 | + | ||
84 | + if($data['descricao']){ | ||
85 | + $atributoAndamentoAPI = new AtributoAndamentoAPI(); | ||
86 | + $atributoAndamentoAPI->setNome('DESCRICAO'); | ||
87 | + $atributoAndamentoAPI->setValor($data['descricao']); | ||
88 | + $atributoAndamentoAPI->setIdOrigem(null); | ||
89 | + $entradaLancarAndamentoAPI->setAtributos(array($atributoAndamentoAPI)); | ||
90 | + } | ||
91 | + | ||
92 | + return $entradaLancarAndamentoAPI; | ||
93 | + } | ||
94 | + | ||
95 | + /** | ||
96 | + * Método que cadastra o andamento manual de um processo | ||
97 | + * @param EntradaLancarAndamentoAPI $entradaLancarAndamentoAPIParam | ||
98 | + * @info usar o método auxiliar encapsulaLancarAndamentoProcesso para faciliar | ||
99 | + * @return array | ||
100 | + */ | ||
101 | + protected function lancarAndamentoProcessoControlado(EntradaLancarAndamentoAPI $entradaLancarAndamentoAPIParam){ | ||
102 | + try{ | ||
103 | + $seiRN = new SeiRN(); | ||
104 | + $seiRN->lancarAndamento($entradaLancarAndamentoAPIParam); | ||
105 | + | ||
106 | + return MdWsSeiRest::formataRetornoSucessoREST('Observação cadastrada com sucesso!'); | ||
107 | + }catch (Exception $e){ | ||
108 | + return MdWsSeiRest::formataRetornoErroREST($e); | ||
109 | + } | ||
110 | + } | ||
111 | + | ||
72 | 112 | ||
73 | 113 | ||
74 | } | 114 | } |
75 | \ No newline at end of file | 115 | \ No newline at end of file |
rn/MdWsSeiProcedimentoRN.php
@@ -126,36 +126,41 @@ class MdWsSeiProcedimentoRN extends InfraRN { | @@ -126,36 +126,41 @@ class MdWsSeiProcedimentoRN extends InfraRN { | ||
126 | * @param MdWsSeiProtocoloDTO $mdWsSeiProtocoloDTOConsulta | 126 | * @param MdWsSeiProtocoloDTO $mdWsSeiProtocoloDTOConsulta |
127 | * @return array | 127 | * @return array |
128 | */ | 128 | */ |
129 | - protected function listarProcedimentoAcompanhamentoConectado(MdWsSeiProtocoloDTO $mdWsSeiProtocoloDTOConsulta) { | 129 | + protected function listarProcedimentoAcompanhamentoConectado(MdWsSeiProtocoloDTO $mdWsSeiProtocoloDTOParam) { |
130 | try{ | 130 | try{ |
131 | $usuarioAtribuicaoAtividade = null; | 131 | $usuarioAtribuicaoAtividade = null; |
132 | - $mdWsSeiProtocoloDTO = new MdWsSeiProtocoloDTO(); | ||
133 | - if($mdWsSeiProtocoloDTOConsulta->isSetNumIdUsuarioAtribuicaoAtividade()){ | ||
134 | - $mdWsSeiProtocoloDTO->setNumIdUsuarioAtribuicaoAtividade($mdWsSeiProtocoloDTOConsulta->getNumIdUsuarioAtribuicaoAtividade()); | ||
135 | - $usuarioAtribuicaoAtividade = $mdWsSeiProtocoloDTOConsulta->getNumIdUsuarioAtribuicaoAtividade(); | 132 | + $mdWsSeiProtocoloDTOConsulta = new MdWsSeiProtocoloDTO(); |
133 | + if($mdWsSeiProtocoloDTOParam->isSetNumIdGrupoAcompanhamentoProcedimento()){ | ||
134 | + $mdWsSeiProtocoloDTOConsulta->setNumIdGrupoAcompanhamentoProcedimento($mdWsSeiProtocoloDTOParam->getNumIdGrupoAcompanhamentoProcedimento()); | ||
136 | } | 135 | } |
137 | - if(!$mdWsSeiProtocoloDTOConsulta->isSetNumIdUsuarioGeradorAcompanhamento()){ | ||
138 | - $mdWsSeiProtocoloDTO->setNumIdUsuarioGeradorAcompanhamento(SessaoSEI::getInstance()->getNumIdUsuario()); | 136 | + |
137 | + if(!$mdWsSeiProtocoloDTOParam->isSetNumIdUsuarioGeradorAcompanhamento()){ | ||
138 | + $mdWsSeiProtocoloDTOConsulta->setNumIdUsuarioGeradorAcompanhamento(SessaoSEI::getInstance()->getNumIdUsuario()); | ||
139 | }else{ | 139 | }else{ |
140 | - $mdWsSeiProtocoloDTO->setNumIdUsuarioGeradorAcompanhamento($mdWsSeiProtocoloDTOConsulta->getNumIdUsuarioGeradorAcompanhamento()); | 140 | + $mdWsSeiProtocoloDTOConsulta->setNumIdUsuarioGeradorAcompanhamento($mdWsSeiProtocoloDTOParam->getNumIdUsuarioGeradorAcompanhamento()); |
141 | } | 141 | } |
142 | 142 | ||
143 | - if(is_null($mdWsSeiProtocoloDTOConsulta->getNumPaginaAtual())){ | ||
144 | - $mdWsSeiProtocoloDTO->setNumPaginaAtual(0); | 143 | + if(is_null($mdWsSeiProtocoloDTOParam->getNumPaginaAtual())){ |
144 | + $mdWsSeiProtocoloDTOConsulta->setNumPaginaAtual(0); | ||
145 | }else{ | 145 | }else{ |
146 | - $mdWsSeiProtocoloDTO->setNumPaginaAtual($mdWsSeiProtocoloDTOConsulta->getNumPaginaAtual()); | 146 | + $mdWsSeiProtocoloDTOConsulta->setNumPaginaAtual($mdWsSeiProtocoloDTOParam->getNumPaginaAtual()); |
147 | } | 147 | } |
148 | 148 | ||
149 | - if(!$mdWsSeiProtocoloDTOConsulta->isSetNumMaxRegistrosRetorno()){ | ||
150 | - $mdWsSeiProtocoloDTO->setNumMaxRegistrosRetorno(10); | 149 | + if(!$mdWsSeiProtocoloDTOParam->isSetNumMaxRegistrosRetorno()){ |
150 | + $mdWsSeiProtocoloDTOConsulta->setNumMaxRegistrosRetorno(10); | ||
151 | }else{ | 151 | }else{ |
152 | - $mdWsSeiProtocoloDTO->setNumMaxRegistrosRetorno($mdWsSeiProtocoloDTOConsulta->getNumMaxRegistrosRetorno()); | 152 | + $mdWsSeiProtocoloDTOConsulta->setNumMaxRegistrosRetorno($mdWsSeiProtocoloDTOParam->getNumMaxRegistrosRetorno()); |
153 | } | 153 | } |
154 | + | ||
154 | $protocoloRN = new ProtocoloRN(); | 155 | $protocoloRN = new ProtocoloRN(); |
155 | $mdWsSeiProtocoloDTOConsulta->retTodos(); | 156 | $mdWsSeiProtocoloDTOConsulta->retTodos(); |
157 | + $mdWsSeiProtocoloDTOConsulta->retDblIdProtocolo(); | ||
158 | + $mdWsSeiProtocoloDTOConsulta->retStrNomeTipoProcedimentoProcedimento(); | ||
159 | + $mdWsSeiProtocoloDTOConsulta->retStrSiglaUnidadeGeradora(); | ||
156 | $mdWsSeiProtocoloDTOConsulta->retStrSinCienciaProcedimento(); | 160 | $mdWsSeiProtocoloDTOConsulta->retStrSinCienciaProcedimento(); |
157 | $mdWsSeiProtocoloDTOConsulta->setOrdDthGeracaoAcompanhamento(InfraDTO::$TIPO_ORDENACAO_ASC); | 161 | $mdWsSeiProtocoloDTOConsulta->setOrdDthGeracaoAcompanhamento(InfraDTO::$TIPO_ORDENACAO_ASC); |
158 | $mdWsSeiProtocoloDTOConsulta->retStrNomeTipoProcedimentoProcedimento(); | 162 | $mdWsSeiProtocoloDTOConsulta->retStrNomeTipoProcedimentoProcedimento(); |
163 | + | ||
159 | $ret = $protocoloRN->listarRN0668($mdWsSeiProtocoloDTOConsulta); | 164 | $ret = $protocoloRN->listarRN0668($mdWsSeiProtocoloDTOConsulta); |
160 | $result = $this->montaRetornoListagemProcessos($ret, $usuarioAtribuicaoAtividade); | 165 | $result = $this->montaRetornoListagemProcessos($ret, $usuarioAtribuicaoAtividade); |
161 | 166 |
teste.php
@@ -28,6 +28,14 @@ class TesteAtividade { | @@ -28,6 +28,14 @@ class TesteAtividade { | ||
28 | 28 | ||
29 | var_dump($rn->listarAtividades($dto)); | 29 | var_dump($rn->listarAtividades($dto)); |
30 | } | 30 | } |
31 | + public function lancarAndamentoProcessoControlado(){ | ||
32 | + $rn = new MdWsSeiAtividadeRN(); | ||
33 | + $dto = $rn->encapsulaLancarAndamentoProcesso(array( | ||
34 | + 'protocolo' => 30, | ||
35 | + 'descricao' => 'La vamos nós!' | ||
36 | + )); | ||
37 | + var_dump($rn->lancarAndamentoProcesso($dto)); | ||
38 | + } | ||
31 | 39 | ||
32 | } | 40 | } |
33 | 41 | ||
@@ -205,17 +213,6 @@ class TesteProcedimento { | @@ -205,17 +213,6 @@ class TesteProcedimento { | ||
205 | var_dump($rn->concluirProcesso($api)); | 213 | var_dump($rn->concluirProcesso($api)); |
206 | } | 214 | } |
207 | 215 | ||
208 | - //o----- antigos | ||
209 | - | ||
210 | - | ||
211 | - public function atribuirProcessoControlado(){ | ||
212 | - $api = new EntradaAtribuirProcessoAPI(); | ||
213 | - $api->setProtocoloProcedimento('99990000001201762'); | ||
214 | - $api->setIdUsuario('100000001'); | ||
215 | - $rn = new MdWsSeiProcedimentoRN(); | ||
216 | - var_dump($rn->atribuirProcesso($api)); | ||
217 | - } | ||
218 | - | ||
219 | public function listarProcedimentoAcompanhamentoConectado(){ | 216 | public function listarProcedimentoAcompanhamentoConectado(){ |
220 | $dto = new MdWsSeiProtocoloDTO(); | 217 | $dto = new MdWsSeiProtocoloDTO(); |
221 | $rn = new MdWsSeiProcedimentoRN(); | 218 | $rn = new MdWsSeiProcedimentoRN(); |
@@ -226,6 +223,17 @@ class TesteProcedimento { | @@ -226,6 +223,17 @@ class TesteProcedimento { | ||
226 | 223 | ||
227 | var_dump($rn->listarProcedimentoAcompanhamento($dto)); | 224 | var_dump($rn->listarProcedimentoAcompanhamento($dto)); |
228 | } | 225 | } |
226 | + | ||
227 | + //o----- antigos | ||
228 | + | ||
229 | + | ||
230 | + public function atribuirProcessoControlado(){ | ||
231 | + $api = new EntradaAtribuirProcessoAPI(); | ||
232 | + $api->setProtocoloProcedimento('99990000001201762'); | ||
233 | + $api->setIdUsuario('100000001'); | ||
234 | + $rn = new MdWsSeiProcedimentoRN(); | ||
235 | + var_dump($rn->atribuirProcesso($api)); | ||
236 | + } | ||
229 | } | 237 | } |
230 | 238 | ||
231 | class TesteGrupoAcompanhamento { | 239 | class TesteGrupoAcompanhamento { |