Commit 072d5b7c9b175d1bff97360c4e2d5a6cd62a94ae
1 parent
8b03f071
Exists in
master
and in
7 other branches
Correção no recebimento de processos com documentos cancelados e com hash's igua…
…is. Recebimento de processos com a unidade geradora
Showing
4 changed files
with
61 additions
and
38 deletions
Show diff stats
rn/PenAtualizadorRN.php
@@ -14,7 +14,7 @@ abstract class PenAtualizadorRN extends InfraRN { | @@ -14,7 +14,7 @@ abstract class PenAtualizadorRN extends InfraRN { | ||
14 | const VER_005 = '0.0.5'; | 14 | const VER_005 = '0.0.5'; |
15 | const VER_006 = '0.0.6'; | 15 | const VER_006 = '0.0.6'; |
16 | const VER_007 = '0.0.7'; | 16 | const VER_007 = '0.0.7'; |
17 | - // const VER_008 = '0.0.8'; | 17 | + const VER_008 = '0.0.8'; |
18 | 18 | ||
19 | protected $sei_versao; | 19 | protected $sei_versao; |
20 | 20 |
rn/PenAtualizarSeiRN.php
@@ -929,6 +929,23 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | @@ -929,6 +929,23 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | ||
929 | $objInfraSequencia->criarSequencia('md_pen_recibo_tramite_hash', '1', '1', '9999999999'); | 929 | $objInfraSequencia->criarSequencia('md_pen_recibo_tramite_hash', '1', '1', '9999999999'); |
930 | } | 930 | } |
931 | } | 931 | } |
932 | + | ||
933 | + protected function instalarV008R004S006IW003(){ | ||
934 | + | ||
935 | + $objBD = new GenericoBD($this->inicializarObjInfraIBanco()); | ||
936 | + | ||
937 | + $objTarefaDTO = new TarefaDTO(); | ||
938 | + $objTarefaDTO->setStrIdTarefaModulo('PEN_PROCESSO_RECEBIDO'); | ||
939 | + $objTarefaDTO->retNumIdTarefa(); | ||
940 | + | ||
941 | + $objTarefaDTO = $objBD->consultar($objTarefaDTO); | ||
942 | + | ||
943 | + $objTarefaDTO->setStrSinLancarAndamentoFechado('N'); | ||
944 | + $objTarefaDTO->setStrSinPermiteProcessoFechado('S'); | ||
945 | + | ||
946 | + $objBD->alterar($objTarefaDTO); | ||
947 | + | ||
948 | + } | ||
932 | 949 | ||
933 | /* protected function instalarV008R004S006WI001(){ | 950 | /* protected function instalarV008R004S006WI001(){ |
934 | $objMetaBD = $this->inicializarObjMetaBanco(); | 951 | $objMetaBD = $this->inicializarObjMetaBanco(); |
rn/PendenciasTramiteRN.php
@@ -55,7 +55,8 @@ class PendenciasTramiteRN extends InfraRN { | @@ -55,7 +55,8 @@ class PendenciasTramiteRN extends InfraRN { | ||
55 | InfraDebug::getInstance()->setBolEcho(false); | 55 | InfraDebug::getInstance()->setBolEcho(false); |
56 | InfraDebug::getInstance()->limpar(); | 56 | InfraDebug::getInstance()->limpar(); |
57 | 57 | ||
58 | - SessaoSEI::getInstance(false)->simularLogin(SessaoSEI::$USUARIO_SEI, SessaoSEI::$UNIDADE_TESTE); | 58 | + $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); |
59 | + SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objInfraParametro->getValor('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | ||
59 | 60 | ||
60 | $numSeg = InfraUtil::verificarTempoProcessamento(); | 61 | $numSeg = InfraUtil::verificarTempoProcessamento(); |
61 | InfraDebug::getInstance()->gravar('MONITORANDO OS TRÂMITES PENDENTES ENVIADOS PARA O ÓRGÃO (PEN)'); | 62 | InfraDebug::getInstance()->gravar('MONITORANDO OS TRÂMITES PENDENTES ENVIADOS PARA O ÓRGÃO (PEN)'); |
rn/ReceberProcedimentoRN.php
@@ -81,6 +81,9 @@ class ReceberProcedimentoRN extends InfraRN | @@ -81,6 +81,9 @@ class ReceberProcedimentoRN extends InfraRN | ||
81 | protected function receberProcedimentoControlado($parNumIdentificacaoTramite) | 81 | protected function receberProcedimentoControlado($parNumIdentificacaoTramite) |
82 | { | 82 | { |
83 | 83 | ||
84 | + $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); | ||
85 | + SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objInfraParametro->getValor('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | ||
86 | + | ||
84 | $objSeiRN = new SeiRN(); | 87 | $objSeiRN = new SeiRN(); |
85 | 88 | ||
86 | error_log(__METHOD__.'('.$parNumIdentificacaoTramite.')'); | 89 | error_log(__METHOD__.'('.$parNumIdentificacaoTramite.')'); |
@@ -487,10 +490,9 @@ class ReceberProcedimentoRN extends InfraRN | @@ -487,10 +490,9 @@ class ReceberProcedimentoRN extends InfraRN | ||
487 | $numIdUnidade = $objAtividadeDTO->getNumIdUnidade(); | 490 | $numIdUnidade = $objAtividadeDTO->getNumIdUnidade(); |
488 | } | 491 | } |
489 | 492 | ||
490 | - SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $numIdUnidade); | ||
491 | 493 | ||
492 | $objSeiRN = new SeiRN(); | 494 | $objSeiRN = new SeiRN(); |
493 | - | 495 | + |
494 | $objAtividadeDTO = new AtividadeDTO(); | 496 | $objAtividadeDTO = new AtividadeDTO(); |
495 | $objAtividadeDTO->retDthConclusao(); | 497 | $objAtividadeDTO->retDthConclusao(); |
496 | $objAtividadeDTO->setDblIdProtocolo($parDblIdProcedimento); | 498 | $objAtividadeDTO->setDblIdProtocolo($parDblIdProcedimento); |
@@ -504,7 +506,18 @@ class ReceberProcedimentoRN extends InfraRN | @@ -504,7 +506,18 @@ class ReceberProcedimentoRN extends InfraRN | ||
504 | $flgReabrir = false; | 506 | $flgReabrir = false; |
505 | } | 507 | } |
506 | } | 508 | } |
509 | + | ||
510 | + $objProcedimentoDTO = new ProcedimentoDTO(); | ||
511 | + $objProcedimentoDTO->setDblIdProcedimento($parDblIdProcedimento); | ||
512 | + $objProcedimentoDTO->retTodos(); | ||
513 | + $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado(); | ||
507 | 514 | ||
515 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
516 | + $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); | ||
517 | + | ||
518 | + $this->registrarAndamentoRecebimentoProcesso($objProcedimentoDTO, $objMetadadosProcedimento); | ||
519 | + | ||
520 | + | ||
508 | if($flgReabrir){ | 521 | if($flgReabrir){ |
509 | $objEntradaReabrirProcessoAPI = new EntradaReabrirProcessoAPI(); | 522 | $objEntradaReabrirProcessoAPI = new EntradaReabrirProcessoAPI(); |
510 | $objEntradaReabrirProcessoAPI->setIdProcedimento($parDblIdProcedimento); | 523 | $objEntradaReabrirProcessoAPI->setIdProcedimento($parDblIdProcedimento); |
@@ -516,21 +529,10 @@ class ReceberProcedimentoRN extends InfraRN | @@ -516,21 +529,10 @@ class ReceberProcedimentoRN extends InfraRN | ||
516 | $objEntradaDesbloquearProcessoAPI = new EntradaDesbloquearProcessoAPI(); | 529 | $objEntradaDesbloquearProcessoAPI = new EntradaDesbloquearProcessoAPI(); |
517 | $objEntradaDesbloquearProcessoAPI->setIdProcedimento($parDblIdProcedimento); | 530 | $objEntradaDesbloquearProcessoAPI->setIdProcedimento($parDblIdProcedimento); |
518 | $objSeiRN->desbloquearProcesso($objEntradaDesbloquearProcessoAPI); | 531 | $objSeiRN->desbloquearProcesso($objEntradaDesbloquearProcessoAPI); |
519 | - | ||
520 | - | ||
521 | - | ||
522 | - $objProcedimentoDTO = new ProcedimentoDTO(); | ||
523 | - $objProcedimentoDTO->setDblIdProcedimento($parDblIdProcedimento); | ||
524 | - $objProcedimentoDTO->retTodos(); | ||
525 | - $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado(); | ||
526 | - | ||
527 | - $objProcedimentoRN = new ProcedimentoRN(); | ||
528 | - $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); | ||
529 | - | 532 | + |
530 | //TODO: Obter código da unidade através de mapeamento entre SEI e Barramento | 533 | //TODO: Obter código da unidade através de mapeamento entre SEI e Barramento |
531 | $objUnidadeDTO = $this->atribuirDadosUnidade($objProcedimentoDTO, $objDestinatario); | 534 | $objUnidadeDTO = $this->atribuirDadosUnidade($objProcedimentoDTO, $objDestinatario); |
532 | 535 | ||
533 | - $this->registrarAndamentoRecebimentoProcesso($objProcedimentoDTO, $objMetadadosProcedimento, $objUnidadeDTO); | ||
534 | $this->atribuirDocumentos($objProcedimentoDTO, $objProcesso, $objUnidadeDTO, $objMetadadosProcedimento); | 536 | $this->atribuirDocumentos($objProcedimentoDTO, $objProcesso, $objUnidadeDTO, $objMetadadosProcedimento); |
535 | $this->registrarProcedimentoNaoVisualizado($objProcedimentoDTO); | 537 | $this->registrarProcedimentoNaoVisualizado($objProcedimentoDTO); |
536 | 538 | ||
@@ -641,7 +643,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -641,7 +643,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
641 | $objProcedimentoDTOGerado = $objProcedimentoRN->gerarRN0156($objProcedimentoDTO); | 643 | $objProcedimentoDTOGerado = $objProcedimentoRN->gerarRN0156($objProcedimentoDTO); |
642 | $objProcedimentoDTO->setDblIdProcedimento($objProcedimentoDTOGerado->getDblIdProcedimento()); | 644 | $objProcedimentoDTO->setDblIdProcedimento($objProcedimentoDTOGerado->getDblIdProcedimento()); |
643 | 645 | ||
644 | - $this->registrarAndamentoRecebimentoProcesso($objProcedimentoDTO, $objMetadadosProcedimento, $objUnidadeDTO); | 646 | + $this->registrarAndamentoRecebimentoProcesso($objProcedimentoDTO, $objMetadadosProcedimento); |
645 | $this->atribuirDocumentos($objProcedimentoDTO, $objProcesso, $objUnidadeDTO, $objMetadadosProcedimento); | 647 | $this->atribuirDocumentos($objProcedimentoDTO, $objProcesso, $objUnidadeDTO, $objMetadadosProcedimento); |
646 | $this->registrarProcedimentoNaoVisualizado($objProcedimentoDTOGerado); | 648 | $this->registrarProcedimentoNaoVisualizado($objProcedimentoDTOGerado); |
647 | 649 | ||
@@ -677,7 +679,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -677,7 +679,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
677 | $objAtividadeRN->excluirRN0034($objAtividadeRN->listarRN0036($objAtividadeDTO)); | 679 | $objAtividadeRN->excluirRN0034($objAtividadeRN->listarRN0036($objAtividadeDTO)); |
678 | } | 680 | } |
679 | 681 | ||
680 | - private function registrarAndamentoRecebimentoProcesso(ProcedimentoDTO $objProcedimentoDTO, $parObjMetadadosProcedimento, $objUnidadeDTO) | 682 | + private function registrarAndamentoRecebimentoProcesso(ProcedimentoDTO $objProcedimentoDTO, $parObjMetadadosProcedimento) |
681 | { | 683 | { |
682 | //Processo recebido da entidade @ENTIDADE_ORIGEM@ - @REPOSITORIO_ORIGEM@ | 684 | //Processo recebido da entidade @ENTIDADE_ORIGEM@ - @REPOSITORIO_ORIGEM@ |
683 | //TODO: Atribuir atributos necessários para formação da mensagem do andamento | 685 | //TODO: Atribuir atributos necessários para formação da mensagem do andamento |
@@ -751,7 +753,10 @@ class ReceberProcedimentoRN extends InfraRN | @@ -751,7 +753,10 @@ class ReceberProcedimentoRN extends InfraRN | ||
751 | $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | 753 | $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); |
752 | $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO)); | 754 | $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO)); |
753 | $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); | 755 | $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); |
754 | - | 756 | + $objAtividadeDTO->setDthConclusao(null); |
757 | + $objAtividadeDTO->setNumIdUsuarioConclusao(null); | ||
758 | + $objAtividadeDTO->setStrSinInicial('N'); | ||
759 | + | ||
755 | $objAtividadeRN = new AtividadeRN(); | 760 | $objAtividadeRN = new AtividadeRN(); |
756 | $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | 761 | $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); |
757 | 762 | ||
@@ -910,7 +915,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -910,7 +915,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
910 | $objComponenteDigitalBD = new ComponenteDigitalBD($this->getObjInfraIBanco()); | 915 | $objComponenteDigitalBD = new ComponenteDigitalBD($this->getObjInfraIBanco()); |
911 | $arrObjComponenteDigitalDTO = $objComponenteDigitalBD->listar($objComponenteDigitalDTO); | 916 | $arrObjComponenteDigitalDTO = $objComponenteDigitalBD->listar($objComponenteDigitalDTO); |
912 | $arrObjComponenteDigitalDTOIndexado = InfraArray::indexarArrInfraDTO($arrObjComponenteDigitalDTO, "Ordem"); | 917 | $arrObjComponenteDigitalDTOIndexado = InfraArray::indexarArrInfraDTO($arrObjComponenteDigitalDTO, "Ordem"); |
913 | - $arrStrHashConteudo = InfraArray::converterArrInfraDTO($arrObjComponenteDigitalDTO, 'IdDocumento', 'HashConteudo'); | 918 | + // $arrStrHashConteudo = InfraArray::converterArrInfraDTO($arrObjComponenteDigitalDTO, 'IdDocumento', 'HashConteudo'); |
914 | 919 | ||
915 | $objProtocoloBD = new ProtocoloBD($this->getObjInfraIBanco()); | 920 | $objProtocoloBD = new ProtocoloBD($this->getObjInfraIBanco()); |
916 | $objSeiRN = new SeiRN(); | 921 | $objSeiRN = new SeiRN(); |
@@ -920,16 +925,17 @@ class ReceberProcedimentoRN extends InfraRN | @@ -920,16 +925,17 @@ class ReceberProcedimentoRN extends InfraRN | ||
920 | foreach($arrObjDocumentos as $objDocumento){ | 925 | foreach($arrObjDocumentos as $objDocumento){ |
921 | 926 | ||
922 | // @join_tec US027 (#3498) | 927 | // @join_tec US027 (#3498) |
923 | - // Previne que o documento digital seja cadastrado na base de dados | ||
924 | if(isset($objDocumento->retirado) && $objDocumento->retirado === true) { | 928 | if(isset($objDocumento->retirado) && $objDocumento->retirado === true) { |
925 | 929 | ||
926 | - $strHashConteudo = ProcessoEletronicoRN::getHashFromMetaDados($objDocumento->componenteDigital->hash); | 930 | + //$strHashConteudo = ProcessoEletronicoRN::getHashFromMetaDados($objDocumento->componenteDigital->hash); |
927 | 931 | ||
928 | // Caso já esteja cadastrado, de um reenvio anterior, então move para bloqueado | 932 | // Caso já esteja cadastrado, de um reenvio anterior, então move para bloqueado |
929 | - if(array_key_exists($strHashConteudo, $arrStrHashConteudo)) { | 933 | + if(array_key_exists($objDocumento->ordem, $arrObjComponenteDigitalDTOIndexado)) { |
930 | 934 | ||
931 | //Busca o ID do protocolo | 935 | //Busca o ID do protocolo |
932 | - $dblIdProtocolo = $arrStrHashConteudo[$strHashConteudo]; | 936 | + //$dblIdProtocolo = $arrStrHashConteudo[$strHashConteudo]; |
937 | + $objComponenteIndexado = $arrObjComponenteDigitalDTOIndexado[$objDocumento->ordem]; | ||
938 | + $dblIdProtocolo = $objComponenteIndexado->getDblIdDocumento(); | ||
933 | 939 | ||
934 | //Instancia o DTO do protocolo | 940 | //Instancia o DTO do protocolo |
935 | $objProtocoloDTO = new ProtocoloDTO(); | 941 | $objProtocoloDTO = new ProtocoloDTO(); |
@@ -939,12 +945,12 @@ class ReceberProcedimentoRN extends InfraRN | @@ -939,12 +945,12 @@ class ReceberProcedimentoRN extends InfraRN | ||
939 | $objProtocoloDTO = $objProtocoloBD->consultar($objProtocoloDTO); | 945 | $objProtocoloDTO = $objProtocoloBD->consultar($objProtocoloDTO); |
940 | 946 | ||
941 | if($objProtocoloDTO->getStrStaEstado() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO){ | 947 | if($objProtocoloDTO->getStrStaEstado() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO){ |
942 | - //Instancia o DTO do protocolo | ||
943 | - $objEntradaCancelarDocumentoAPI = new EntradaCancelarDocumentoAPI(); | ||
944 | - $objEntradaCancelarDocumentoAPI->setIdDocumento($dblIdProtocolo); | ||
945 | - $objEntradaCancelarDocumentoAPI->setMotivo('Cancelado pelo remetente'); | ||
946 | - | ||
947 | - $objSeiRN->cancelarDocumento($objEntradaCancelarDocumentoAPI); | 948 | + //Instancia o DTO do protocolo |
949 | + $objEntradaCancelarDocumentoAPI = new EntradaCancelarDocumentoAPI(); | ||
950 | + $objEntradaCancelarDocumentoAPI->setIdDocumento($dblIdProtocolo); | ||
951 | + $objEntradaCancelarDocumentoAPI->setMotivo('Cancelado pelo remetente'); | ||
952 | + | ||
953 | + $objSeiRN->cancelarDocumento($objEntradaCancelarDocumentoAPI); | ||
948 | 954 | ||
949 | } | 955 | } |
950 | 956 | ||
@@ -1103,13 +1109,8 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1103,13 +1109,8 @@ class ReceberProcedimentoRN extends InfraRN | ||
1103 | $objDocumentoDTO->setStrConteudo(null); | 1109 | $objDocumentoDTO->setStrConteudo(null); |
1104 | //$objDocumentoDTO->setStrSinFormulario('N'); | 1110 | //$objDocumentoDTO->setStrSinFormulario('N'); |
1105 | 1111 | ||
1106 | - // @join_tec US027 (#3498) | ||
1107 | - $numIdUnidadeGeradora = $this->objInfraParametro->getValor('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO', false); | ||
1108 | - // Registro existe e pode estar vazio | ||
1109 | - if(!empty($numIdUnidadeGeradora)) { | ||
1110 | - $objDocumentoDTO->getObjProtocoloDTO()->setNumIdUnidadeGeradora($numIdUnidadeGeradora); | ||
1111 | - } | ||
1112 | - $objDocumentoDTO->setStrSinBloqueado('S'); | 1112 | + $objDocumentoDTO->getObjProtocoloDTO()->setNumIdUnidadeGeradora(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
1113 | + $objDocumentoDTO->setStrSinBloqueado('S'); | ||
1113 | 1114 | ||
1114 | //TODO: Fazer a atribuição dos componentes digitais do processo a partir desse ponto | 1115 | //TODO: Fazer a atribuição dos componentes digitais do processo a partir desse ponto |
1115 | $this->atribuirComponentesDigitais($objDocumentoDTO, $objDocumento->componenteDigital); | 1116 | $this->atribuirComponentesDigitais($objDocumentoDTO, $objDocumento->componenteDigital); |
@@ -1136,7 +1137,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1136,7 +1137,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
1136 | } | 1137 | } |
1137 | 1138 | ||
1138 | } | 1139 | } |
1139 | - | 1140 | + |
1140 | foreach($this->documentosRetirados as $documentoCancelado){ | 1141 | foreach($this->documentosRetirados as $documentoCancelado){ |
1141 | //Instancia o DTO do protocolo | 1142 | //Instancia o DTO do protocolo |
1142 | $objEntradaCancelarDocumentoAPI = new EntradaCancelarDocumentoAPI(); | 1143 | $objEntradaCancelarDocumentoAPI = new EntradaCancelarDocumentoAPI(); |
@@ -1147,6 +1148,10 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1147,6 +1148,10 @@ class ReceberProcedimentoRN extends InfraRN | ||
1147 | } | 1148 | } |
1148 | 1149 | ||
1149 | $objProcedimentoDTO->setArrObjDocumentoDTO($arrObjDocumentoDTO); | 1150 | $objProcedimentoDTO->setArrObjDocumentoDTO($arrObjDocumentoDTO); |
1151 | + | ||
1152 | + /* if($numIdUnidadeAtual != $numIdUnidadeGeradora){ | ||
1153 | + SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $numIdUnidadeAtual); | ||
1154 | + } */ | ||
1150 | } | 1155 | } |
1151 | 1156 | ||
1152 | //TODO: Método deverá poderá ser transferido para a classe responsável por fazer o recebimento dos componentes digitais | 1157 | //TODO: Método deverá poderá ser transferido para a classe responsável por fazer o recebimento dos componentes digitais |