Commit d96f7de08ceb9f2d67caa6b82d36d266b7a925f9
1 parent
b3ca60c2
Exists in
master
and in
1 other branch
Ajuste nos serviços
Showing
3 changed files
with
43 additions
and
29 deletions
Show diff stats
controlador_ws.php
... | ... | @@ -991,7 +991,7 @@ $app->group('/api/v1',function(){ |
991 | 991 | |
992 | 992 | $especificacaoFormatado = iconv('UTF-8', 'ISO-8859-1', $request->getParam('especificacao')); |
993 | 993 | $observacoesFormatado = iconv('UTF-8', 'ISO-8859-1', $request->getParam('observacoes')); |
994 | - | |
994 | + | |
995 | 995 | //Atribuir parametros para o DTO |
996 | 996 | $dto->setNumIdProcedimento($request->getParam('id')); |
997 | 997 | $dto->setArrObjInteressado($interessados); | ... | ... |
editor_sei_mobile.php
... | ... | @@ -14,16 +14,17 @@ require_once dirname(__FILE__) . '/vendor/autoload.php'; |
14 | 14 | session_start(); |
15 | 15 | |
16 | 16 | |
17 | -//$_POST['documento_id'] = '105'; | |
18 | -//$_POST['token'] = 'YTE5YzgzNDM0OWFhMDNlNzAxMWY3OWNkN2UwZTYwZDdlZDAxNzFkM2FUVnhUV2sxYnoxOGZHazFjVTFwTlc4OWZId3dmSHc9'; | |
17 | +//$_REQUEST['documento_id'] = '105'; | |
18 | +//$_REQUEST['token'] = 'YTE5YzgzNDM0OWFhMDNlNzAxMWY3OWNkN2UwZTYwZDdlZDAxNzFkM2FUVnhUV2sxYnoxOGZHazFjVTFwTlc4OWZId3dmSHc9'; | |
19 | 19 | |
20 | -if(empty($_POST['documento_id'])) | |
20 | +if(empty($_REQUEST['id_documento'])) | |
21 | 21 | throw new InfraException('Deve ser passado valor para o (id_documento).'); |
22 | 22 | |
23 | -if(empty($_POST['token'])) | |
23 | +if(empty($_REQUEST['token'])) | |
24 | 24 | throw new InfraException('Deve ser passado token no header.'); |
25 | 25 | |
26 | -$token = $_POST['token']; | |
26 | + | |
27 | +$token = $_REQUEST['token']; | |
27 | 28 | |
28 | 29 | if(!$token) |
29 | 30 | return new InfraException('Acesso negado!'); |
... | ... | @@ -46,11 +47,11 @@ $usuarioDTO->setStrSenha($tokenData[1]); |
46 | 47 | $contextoDTO->setNumIdContexto(null); |
47 | 48 | $orgaoDTO = new OrgaoDTO(); |
48 | 49 | $orgaoDTO->setNumIdOrgao(null); |
49 | -$rn->apiAutenticar($usuarioDTO, $contextoDTO, $orgaoDTO); | |
50 | +$return = $rn->apiAutenticar($usuarioDTO, $contextoDTO, $orgaoDTO); | |
50 | 51 | |
51 | 52 | // Recupera o id do procedimento |
52 | 53 | $protocoloDTO = new DocumentoDTO(); |
53 | -$protocoloDTO->setDblIdDocumento($_POST['documento_id']); | |
54 | +$protocoloDTO->setDblIdDocumento($_REQUEST['id_documento']); | |
54 | 55 | $protocoloDTO->retDblIdProcedimento(); |
55 | 56 | $protocoloRN = new DocumentoRN(); |
56 | 57 | $protocoloDTO = $protocoloRN->consultarRN0005($protocoloDTO); |
... | ... | @@ -58,8 +59,8 @@ $protocoloDTO = $protocoloRN->consultarRN0005($protocoloDTO); |
58 | 59 | if(empty($protocoloDTO)) |
59 | 60 | return new InfraException('Documento não encontrado'); |
60 | 61 | |
61 | -$linkassinado = SessaoSEI::getInstance()->assinarLink('/sei/controlador.php?acao=editor_montar&acao_origem=arvore_visualizar&id_procedimento=' . $protocoloDTO->getDblIdProcedimento() . '&id_documento=' . $_POST['documento_id']); | |
62 | 62 | |
63 | +$linkassinado = SessaoSEI::getInstance()->assinarLink('/sei/controlador.php?acao=editor_montar&acao_origem=arvore_visualizar&id_procedimento=' . $protocoloDTO->getDblIdProcedimento() . '&id_documento=' . $_REQUEST['id_documento']); | |
63 | 64 | |
64 | 65 | header('Location: ' . $linkassinado); |
65 | 66 | ... | ... |
rn/MdWsSeiDocumentoRN.php
... | ... | @@ -197,7 +197,31 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
197 | 197 | */ |
198 | 198 | protected function pesquisarTemplateDocumentoConectado(MdWsSeiDocumentoDTO $dto) { |
199 | 199 | try { |
200 | + | |
201 | + $objProcedimentoDTO = new ProcedimentoDTO(); | |
202 | + $objProcedimentoDTO->setDblIdProcedimento($dto->getNumIdProcesso()); | |
203 | + $objProcedimentoDTO->retNumIdTipoProcedimento(); | |
200 | 204 | |
205 | + $objProcedimentoRN = new ProcedimentoRN(); | |
206 | + $objProcedimentoDTO = $objProcedimentoRN->listarRN0278($objProcedimentoDTO); | |
207 | + | |
208 | + if (!$objProcedimentoDTO) { | |
209 | + throw new Exception('Não foi encontrado processo com id ' . $dto->getNumIdProcesso()); | |
210 | + } | |
211 | + | |
212 | + // Consulta se o tipo de documento permite a inclusão de destinatários e interessados | |
213 | + $serieDTO = new SerieDTO(); | |
214 | + $serieDTO->setNumIdSerie($dto->getNumIdTipoDocumento()); | |
215 | + $serieDTO->retStrSinDestinatario(); | |
216 | + $serieDTO->retStrSinInteressado(); | |
217 | + | |
218 | + $serieRN = new SerieRN(); | |
219 | + $arrSerieDTO = $serieRN->listarRN0646($serieDTO); | |
220 | + | |
221 | + if (!$arrSerieDTO) { | |
222 | + throw new Exception('Não foi encontrado processo um tipo de processo ' . $dto->getNumIdTipoDocumento()); | |
223 | + } | |
224 | + | |
201 | 225 | $id_tipo_documento = $dto->getNumIdTipoDocumento(); |
202 | 226 | //$idTipoProcedimento = $dto->getNumIdTipoProcedimento(); |
203 | 227 | $idProcedimento = $dto->getNumIdProcesso(); |
... | ... | @@ -223,15 +247,6 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
223 | 247 | } |
224 | 248 | } |
225 | 249 | |
226 | - // Consulta se o tipo de documento permite a inclusão de destinatários e interessados | |
227 | - $serieDTO = new SerieDTO(); | |
228 | - $serieDTO->setNumIdSerie($id_tipo_documento); | |
229 | - $serieDTO->retStrSinDestinatario(); | |
230 | - $serieDTO->retStrSinInteressado(); | |
231 | - | |
232 | - $serieRN = new SerieRN(); | |
233 | - $arrSerieDTO = $serieRN->listarRN0646($serieDTO); | |
234 | - | |
235 | 250 | $serie = ""; |
236 | 251 | if ($arrSerieDTO) { |
237 | 252 | $serie = $arrSerieDTO[0]; |
... | ... | @@ -245,7 +260,7 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
245 | 260 | |
246 | 261 | $interessados = null; |
247 | 262 | $arrayRetorno["nivelAcessoPermitido"] = null; |
248 | - | |
263 | + | |
249 | 264 | if ($idProcedimento) { |
250 | 265 | $objParticipanteDTO = new ParticipanteDTO(); |
251 | 266 | $objParticipanteDTO->setDblIdProtocolo($idProcedimento); |
... | ... | @@ -264,13 +279,7 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
264 | 279 | } |
265 | 280 | } |
266 | 281 | |
267 | - $objProcedimentoDTO = new ProcedimentoDTO(); | |
268 | - $objProcedimentoDTO->setDblIdProcedimento($idProcedimento); | |
269 | - $objProcedimentoDTO->retNumIdTipoProcedimento(); | |
270 | - | |
271 | - $objProcedimentoRN = new ProcedimentoRN(); | |
272 | - $objProcedimentoDTO = $objProcedimentoRN->listarRN0278($objProcedimentoDTO); | |
273 | - | |
282 | + | |
274 | 283 | $nivelAcessoPermitidoDTO = new NivelAcessoPermitidoDTO(); |
275 | 284 | $nivelAcessoPermitidoDTO->setNumIdTipoProcedimento($objProcedimentoDTO[0]->getNumIdTipoProcedimento()); // FILTRO PELO TIPO DE PROCESSO |
276 | 285 | $nivelAcessoPermitidoDTO->retStrStaNivelAcesso(); // ID DO NÍVEL DE ACESSO - ProtocoloRN::$NA_PUBLICO, ProtocoloRN::$NA_RESTRITO ou ProtocoloRN::$NA_SIGILOSO |
... | ... | @@ -1084,7 +1093,7 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
1084 | 1093 | $objRelBlocoUnidadeDTO->retStrStaTipoBloco(); |
1085 | 1094 | $objRelBlocoUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
1086 | 1095 | $objRelBlocoUnidadeDTO->setStrSinRetornado('N'); |
1087 | - //$objRelBlocoUnidadeDTO->setStrStaEstadoBloco(BlocoRN::$TE_DISPONIBILIZADO); | |
1096 | + $objRelBlocoUnidadeDTO->setStrStaEstadoBloco(BlocoRN::$TE_DISPONIBILIZADO); | |
1088 | 1097 | |
1089 | 1098 | $objRelBlocoUnidadeRN = new RelBlocoUnidadeRN(); |
1090 | 1099 | $arrObjRelBlocoUnidadeDTO = $objRelBlocoUnidadeRN->listarRN1304($objRelBlocoUnidadeDTO); |
... | ... | @@ -1100,10 +1109,14 @@ class MdWsSeiDocumentoRN extends DocumentoRN { |
1100 | 1109 | $objRelBlocoProtocoloDTO->retStrStaProtocoloProtocolo(); |
1101 | 1110 | $objRelBlocoProtocoloDTO->retDblIdProcedimentoDocumento(); |
1102 | 1111 | $objRelBlocoProtocoloDTO->setNumIdBloco(InfraArray::converterArrInfraDTO($arrObjRelBlocoUnidadeDTO,'IdBloco'),InfraDTO::$OPER_IN); |
1103 | - | |
1112 | + $objRelBlocoProtocoloDTO->setDblIdProtocolo($documentoDTO->getDblIdDocumento()); | |
1113 | + | |
1104 | 1114 | $objRelBlocoProtocoloRN = new RelBlocoProtocoloRN(); |
1105 | 1115 | $arrObjRelBlocoProtocoloDTO = $objRelBlocoProtocoloRN->listarRN1291($objRelBlocoProtocoloDTO); |
1106 | - $hasBloco = true; | |
1116 | + | |
1117 | + if(count($arrObjRelBlocoProtocoloDTO)){ | |
1118 | + $hasBloco = true; | |
1119 | + } | |
1107 | 1120 | } |
1108 | 1121 | |
1109 | 1122 | ... | ... |