Commit f3d291871133cbdcf8fe4fa2afb3d47a91f09a70
Exists in
master
and in
8 other branches
Merge branch 'fix-92' into desenv
Showing
4 changed files
with
26 additions
and
18 deletions
Show diff stats
rn/PendenciasTramiteRN.php
| @@ -72,17 +72,22 @@ class PendenciasTramiteRN extends InfraRN { | @@ -72,17 +72,22 @@ class PendenciasTramiteRN extends InfraRN { | ||
| 72 | $arrQuantidadeErrosTramite = array(); | 72 | $arrQuantidadeErrosTramite = array(); |
| 73 | 73 | ||
| 74 | while (true) { | 74 | while (true) { |
| 75 | - $this->gravarLogDebug('Recuperando lista de pendências do PEN', 1); | ||
| 76 | - $arrObjPendenciasDTO = $this->obterPendenciasTramite(); | ||
| 77 | - foreach ($arrObjPendenciasDTO as $objPendenciaDTO) { | ||
| 78 | - $mensagemLog = sprintf(">>> Enviando pendência %d (status %s) para fila de processamento", | ||
| 79 | - $objPendenciaDTO->getNumIdentificacaoTramite(), $objPendenciaDTO->getStrStatus()); | ||
| 80 | - $this->gravarLogDebug($mensagemLog, 3, true); | ||
| 81 | - $this->enviarPendenciaFilaProcessamento($objPendenciaDTO); | 75 | + try { |
| 76 | + $this->gravarLogDebug('Recuperando lista de pendências do PEN', 1); | ||
| 77 | + $arrObjPendenciasDTO = $this->obterPendenciasTramite(); | ||
| 78 | + foreach ($arrObjPendenciasDTO as $objPendenciaDTO) { | ||
| 79 | + $mensagemLog = sprintf(">>> Enviando pendência %d (status %s) para fila de processamento", | ||
| 80 | + $objPendenciaDTO->getNumIdentificacaoTramite(), $objPendenciaDTO->getStrStatus()); | ||
| 81 | + $this->gravarLogDebug($mensagemLog, 3, true); | ||
| 82 | + $this->enviarPendenciaFilaProcessamento($objPendenciaDTO); | ||
| 83 | + } | ||
| 84 | + } catch (Exception $e) { | ||
| 85 | + //Apenas registra a falha no log do sistema e reinicia o ciclo de requisição | ||
| 86 | + LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); | ||
| 87 | + } finally { | ||
| 88 | + $this->gravarLogDebug("Reiniciando monitoramento de pendências", 1); | ||
| 89 | + sleep(5); | ||
| 82 | } | 90 | } |
| 83 | - | ||
| 84 | - $this->gravarLogDebug("Reiniciando monitoramento de pendências", 1); | ||
| 85 | - sleep(5); | ||
| 86 | } | 91 | } |
| 87 | } | 92 | } |
| 88 | catch(Exception $e) { | 93 | catch(Exception $e) { |
rn/ProcessarPendenciasRN.php
| @@ -33,9 +33,9 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | @@ -33,9 +33,9 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | ||
| 33 | ini_set('max_execution_time','0'); | 33 | ini_set('max_execution_time','0'); |
| 34 | ini_set('memory_limit','-1'); | 34 | ini_set('memory_limit','-1'); |
| 35 | 35 | ||
| 36 | - InfraDebug::getInstance()->setBolLigado(false); | 36 | + InfraDebug::getInstance()->setBolLigado(true); |
| 37 | InfraDebug::getInstance()->setBolDebugInfra(false); | 37 | InfraDebug::getInstance()->setBolDebugInfra(false); |
| 38 | - InfraDebug::getInstance()->setBolEcho(false); | 38 | + InfraDebug::getInstance()->setBolEcho(true); |
| 39 | InfraDebug::getInstance()->limpar(); | 39 | InfraDebug::getInstance()->limpar(); |
| 40 | 40 | ||
| 41 | PENIntegracao::validarCompatibilidadeModulo(); | 41 | PENIntegracao::validarCompatibilidadeModulo(); |
rn/ReceberComponenteDigitalRN.php
| @@ -100,11 +100,14 @@ class ReceberComponenteDigitalRN extends InfraRN | @@ -100,11 +100,14 @@ class ReceberComponenteDigitalRN extends InfraRN | ||
| 100 | $strHashDoArquivo = hash_file("sha256", $strCaminhoAnexo, true); | 100 | $strHashDoArquivo = hash_file("sha256", $strCaminhoAnexo, true); |
| 101 | 101 | ||
| 102 | if(strcmp($strHashInformado, $strHashDoArquivo) != 0) { | 102 | if(strcmp($strHashInformado, $strHashDoArquivo) != 0) { |
| 103 | - | ||
| 104 | - $this->objProcessoEletronicoRN->recusarTramite($parNumIdentificacaoTramite, "Hash do componente digital não confere com o valor informado pelo remetente.", ProcessoEletronicoRN::MTV_RCSR_TRAM_CD_CORROMPIDO); | ||
| 105 | - | ||
| 106 | - // Adiciono nos detalhes o nome do método para poder manipular o cache | ||
| 107 | - throw new InfraException("Hash do componente digital não confere com o valor informado pelo remetente.", null, __METHOD__); | 103 | + $strMensagem = "Hash do componente digital não confere com o valor informado pelo remetente."; |
| 104 | + $this->objProcessoEletronicoRN->recusarTramite($parNumIdentificacaoTramite, $strMensagem, ProcessoEletronicoRN::MTV_RCSR_TRAM_CD_CORROMPIDO); | ||
| 105 | + | ||
| 106 | + $strHashInformadoBase64 = base64_encode($strHashInformado); | ||
| 107 | + $strHashDoArquivoBase64 = base64_encode($strHashDoArquivo); | ||
| 108 | + $strDetalhes = "Hash do componente digital informado pelo PEN: $strHashInformadoBase64 \n"; | ||
| 109 | + $strDetalhes .= "Hash do componente digital calculado pelo SEI: $strHashDoArquivoBase64 \n"; | ||
| 110 | + throw new InfraException($strMensagem, null, $strDetalhes); | ||
| 108 | } | 111 | } |
| 109 | } | 112 | } |
| 110 | 113 |
rn/ReceberProcedimentoRN.php
| @@ -217,7 +217,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -217,7 +217,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
| 217 | } | 217 | } |
| 218 | } | 218 | } |
| 219 | } | 219 | } |
| 220 | - //$this->fecharProcedimentoEmOutraUnidades($objProcedimentoDTO, $objMetadadosProcedimento); | 220 | + |
| 221 | $this->gravarLogDebug("Enviando recibo de conclusão do trâmite $parNumIdentificacaoTramite", 6); | 221 | $this->gravarLogDebug("Enviando recibo de conclusão do trâmite $parNumIdentificacaoTramite", 6); |
| 222 | $objEnviarReciboTramiteRN = new EnviarReciboTramiteRN(); | 222 | $objEnviarReciboTramiteRN = new EnviarReciboTramiteRN(); |
| 223 | $objEnviarReciboTramiteRN->enviarReciboTramiteProcesso($parNumIdentificacaoTramite, $arrayHash); | 223 | $objEnviarReciboTramiteRN->enviarReciboTramiteProcesso($parNumIdentificacaoTramite, $arrayHash); |