Commit d96f7de08ceb9f2d67caa6b82d36d266b7a925f9

Authored by Eduardo Heinske
1 parent b3ca60c2
Exists in master and in 1 other branch desenv

Ajuste nos serviços

controlador_ws.php
@@ -991,7 +991,7 @@ $app->group('/api/v1',function(){ @@ -991,7 +991,7 @@ $app->group('/api/v1',function(){
991 991
992 $especificacaoFormatado = iconv('UTF-8', 'ISO-8859-1', $request->getParam('especificacao')); 992 $especificacaoFormatado = iconv('UTF-8', 'ISO-8859-1', $request->getParam('especificacao'));
993 $observacoesFormatado = iconv('UTF-8', 'ISO-8859-1', $request->getParam('observacoes')); 993 $observacoesFormatado = iconv('UTF-8', 'ISO-8859-1', $request->getParam('observacoes'));
994 - 994 +
995 //Atribuir parametros para o DTO 995 //Atribuir parametros para o DTO
996 $dto->setNumIdProcedimento($request->getParam('id')); 996 $dto->setNumIdProcedimento($request->getParam('id'));
997 $dto->setArrObjInteressado($interessados); 997 $dto->setArrObjInteressado($interessados);
editor_sei_mobile.php
@@ -14,16 +14,17 @@ require_once dirname(__FILE__) . '/vendor/autoload.php'; @@ -14,16 +14,17 @@ require_once dirname(__FILE__) . '/vendor/autoload.php';
14 session_start(); 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 throw new InfraException('Deve ser passado valor para o (id_documento).'); 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 throw new InfraException('Deve ser passado token no header.'); 24 throw new InfraException('Deve ser passado token no header.');
25 25
26 -$token = $_POST['token']; 26 +
  27 +$token = $_REQUEST['token'];
27 28
28 if(!$token) 29 if(!$token)
29 return new InfraException('Acesso negado!'); 30 return new InfraException('Acesso negado!');
@@ -46,11 +47,11 @@ $usuarioDTO->setStrSenha($tokenData[1]); @@ -46,11 +47,11 @@ $usuarioDTO->setStrSenha($tokenData[1]);
46 $contextoDTO->setNumIdContexto(null); 47 $contextoDTO->setNumIdContexto(null);
47 $orgaoDTO = new OrgaoDTO(); 48 $orgaoDTO = new OrgaoDTO();
48 $orgaoDTO->setNumIdOrgao(null); 49 $orgaoDTO->setNumIdOrgao(null);
49 -$rn->apiAutenticar($usuarioDTO, $contextoDTO, $orgaoDTO); 50 +$return = $rn->apiAutenticar($usuarioDTO, $contextoDTO, $orgaoDTO);
50 51
51 // Recupera o id do procedimento 52 // Recupera o id do procedimento
52 $protocoloDTO = new DocumentoDTO(); 53 $protocoloDTO = new DocumentoDTO();
53 -$protocoloDTO->setDblIdDocumento($_POST['documento_id']); 54 +$protocoloDTO->setDblIdDocumento($_REQUEST['id_documento']);
54 $protocoloDTO->retDblIdProcedimento(); 55 $protocoloDTO->retDblIdProcedimento();
55 $protocoloRN = new DocumentoRN(); 56 $protocoloRN = new DocumentoRN();
56 $protocoloDTO = $protocoloRN->consultarRN0005($protocoloDTO); 57 $protocoloDTO = $protocoloRN->consultarRN0005($protocoloDTO);
@@ -58,8 +59,8 @@ $protocoloDTO = $protocoloRN->consultarRN0005($protocoloDTO); @@ -58,8 +59,8 @@ $protocoloDTO = $protocoloRN->consultarRN0005($protocoloDTO);
58 if(empty($protocoloDTO)) 59 if(empty($protocoloDTO))
59 return new InfraException('Documento não encontrado'); 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 header('Location: ' . $linkassinado); 65 header('Location: ' . $linkassinado);
65 66
rn/MdWsSeiDocumentoRN.php
@@ -197,7 +197,31 @@ class MdWsSeiDocumentoRN extends DocumentoRN { @@ -197,7 +197,31 @@ class MdWsSeiDocumentoRN extends DocumentoRN {
197 */ 197 */
198 protected function pesquisarTemplateDocumentoConectado(MdWsSeiDocumentoDTO $dto) { 198 protected function pesquisarTemplateDocumentoConectado(MdWsSeiDocumentoDTO $dto) {
199 try { 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 $id_tipo_documento = $dto->getNumIdTipoDocumento(); 225 $id_tipo_documento = $dto->getNumIdTipoDocumento();
202 //$idTipoProcedimento = $dto->getNumIdTipoProcedimento(); 226 //$idTipoProcedimento = $dto->getNumIdTipoProcedimento();
203 $idProcedimento = $dto->getNumIdProcesso(); 227 $idProcedimento = $dto->getNumIdProcesso();
@@ -223,15 +247,6 @@ class MdWsSeiDocumentoRN extends DocumentoRN { @@ -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 $serie = ""; 250 $serie = "";
236 if ($arrSerieDTO) { 251 if ($arrSerieDTO) {
237 $serie = $arrSerieDTO[0]; 252 $serie = $arrSerieDTO[0];
@@ -245,7 +260,7 @@ class MdWsSeiDocumentoRN extends DocumentoRN { @@ -245,7 +260,7 @@ class MdWsSeiDocumentoRN extends DocumentoRN {
245 260
246 $interessados = null; 261 $interessados = null;
247 $arrayRetorno["nivelAcessoPermitido"] = null; 262 $arrayRetorno["nivelAcessoPermitido"] = null;
248 - 263 +
249 if ($idProcedimento) { 264 if ($idProcedimento) {
250 $objParticipanteDTO = new ParticipanteDTO(); 265 $objParticipanteDTO = new ParticipanteDTO();
251 $objParticipanteDTO->setDblIdProtocolo($idProcedimento); 266 $objParticipanteDTO->setDblIdProtocolo($idProcedimento);
@@ -264,13 +279,7 @@ class MdWsSeiDocumentoRN extends DocumentoRN { @@ -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 $nivelAcessoPermitidoDTO = new NivelAcessoPermitidoDTO(); 283 $nivelAcessoPermitidoDTO = new NivelAcessoPermitidoDTO();
275 $nivelAcessoPermitidoDTO->setNumIdTipoProcedimento($objProcedimentoDTO[0]->getNumIdTipoProcedimento()); // FILTRO PELO TIPO DE PROCESSO 284 $nivelAcessoPermitidoDTO->setNumIdTipoProcedimento($objProcedimentoDTO[0]->getNumIdTipoProcedimento()); // FILTRO PELO TIPO DE PROCESSO
276 $nivelAcessoPermitidoDTO->retStrStaNivelAcesso(); // ID DO NÍVEL DE ACESSO - ProtocoloRN::$NA_PUBLICO, ProtocoloRN::$NA_RESTRITO ou ProtocoloRN::$NA_SIGILOSO 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,7 +1093,7 @@ class MdWsSeiDocumentoRN extends DocumentoRN {
1084 $objRelBlocoUnidadeDTO->retStrStaTipoBloco(); 1093 $objRelBlocoUnidadeDTO->retStrStaTipoBloco();
1085 $objRelBlocoUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); 1094 $objRelBlocoUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual());
1086 $objRelBlocoUnidadeDTO->setStrSinRetornado('N'); 1095 $objRelBlocoUnidadeDTO->setStrSinRetornado('N');
1087 - //$objRelBlocoUnidadeDTO->setStrStaEstadoBloco(BlocoRN::$TE_DISPONIBILIZADO); 1096 + $objRelBlocoUnidadeDTO->setStrStaEstadoBloco(BlocoRN::$TE_DISPONIBILIZADO);
1088 1097
1089 $objRelBlocoUnidadeRN = new RelBlocoUnidadeRN(); 1098 $objRelBlocoUnidadeRN = new RelBlocoUnidadeRN();
1090 $arrObjRelBlocoUnidadeDTO = $objRelBlocoUnidadeRN->listarRN1304($objRelBlocoUnidadeDTO); 1099 $arrObjRelBlocoUnidadeDTO = $objRelBlocoUnidadeRN->listarRN1304($objRelBlocoUnidadeDTO);
@@ -1100,10 +1109,14 @@ class MdWsSeiDocumentoRN extends DocumentoRN { @@ -1100,10 +1109,14 @@ class MdWsSeiDocumentoRN extends DocumentoRN {
1100 $objRelBlocoProtocoloDTO->retStrStaProtocoloProtocolo(); 1109 $objRelBlocoProtocoloDTO->retStrStaProtocoloProtocolo();
1101 $objRelBlocoProtocoloDTO->retDblIdProcedimentoDocumento(); 1110 $objRelBlocoProtocoloDTO->retDblIdProcedimentoDocumento();
1102 $objRelBlocoProtocoloDTO->setNumIdBloco(InfraArray::converterArrInfraDTO($arrObjRelBlocoUnidadeDTO,'IdBloco'),InfraDTO::$OPER_IN); 1111 $objRelBlocoProtocoloDTO->setNumIdBloco(InfraArray::converterArrInfraDTO($arrObjRelBlocoUnidadeDTO,'IdBloco'),InfraDTO::$OPER_IN);
1103 - 1112 + $objRelBlocoProtocoloDTO->setDblIdProtocolo($documentoDTO->getDblIdDocumento());
  1113 +
1104 $objRelBlocoProtocoloRN = new RelBlocoProtocoloRN(); 1114 $objRelBlocoProtocoloRN = new RelBlocoProtocoloRN();
1105 $arrObjRelBlocoProtocoloDTO = $objRelBlocoProtocoloRN->listarRN1291($objRelBlocoProtocoloDTO); 1115 $arrObjRelBlocoProtocoloDTO = $objRelBlocoProtocoloRN->listarRN1291($objRelBlocoProtocoloDTO);
1106 - $hasBloco = true; 1116 +
  1117 + if(count($arrObjRelBlocoProtocoloDTO)){
  1118 + $hasBloco = true;
  1119 + }
1107 } 1120 }
1108 1121
1109 1122