Commit 31274e05f3588754060beb96e76cd7343d11342d
1 parent
af6861f7
Exists in
master
and in
21 other branches
correção no recebimento de documentos cancelador
Showing
2 changed files
with
100 additions
and
16 deletions
Show diff stats
rn/ReceberProcedimentoRN.php
... | ... | @@ -111,7 +111,7 @@ class ReceberProcedimentoRN extends InfraRN |
111 | 111 | #############################INICIA O RECEBIMENTO DOS COMPONENTES DIGITAIS US010################################################ |
112 | 112 | $arrObjTramite = $this->objProcessoEletronicoRN->consultarTramites($parNumIdentificacaoTramite); |
113 | 113 | $objTramite = $arrObjTramite[0]; |
114 | - | |
114 | + | |
115 | 115 | //Obtém lista de componentes digitais que precisam ser obtidos |
116 | 116 | if(!is_array($objTramite->componenteDigitalPendenteDeRecebimento)){ |
117 | 117 | $objTramite->componenteDigitalPendenteDeRecebimento = array($objTramite->componenteDigitalPendenteDeRecebimento); |
... | ... | @@ -136,8 +136,8 @@ class ReceberProcedimentoRN extends InfraRN |
136 | 136 | |
137 | 137 | //Cria o array com a lista de hash |
138 | 138 | $arrayHash = array(); |
139 | - | |
140 | - //Percorre os componentes que precisam ser recebidos | |
139 | + | |
140 | + //Percorre os componentes que precisam ser recebidos | |
141 | 141 | foreach($objTramite->componenteDigitalPendenteDeRecebimento as $componentePendente){ |
142 | 142 | |
143 | 143 | if(!is_null($componentePendente)){ |
... | ... | @@ -168,10 +168,10 @@ class ReceberProcedimentoRN extends InfraRN |
168 | 168 | if($objTramite->situacaoAtual == ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_RECUSADO) { |
169 | 169 | return; |
170 | 170 | } |
171 | - | |
171 | + | |
172 | 172 | $objProcedimentoDTO = $this->registrarProcesso($strNumeroRegistro, $parNumIdentificacaoTramite, $objProcesso, $objMetadadosProcedimento); |
173 | 173 | |
174 | - | |
174 | + | |
175 | 175 | foreach($this->documentosRetirados as $documentoCancelado){ |
176 | 176 | //Instancia o DTO do protocolo |
177 | 177 | $objEntradaCancelarDocumentoAPI = new EntradaCancelarDocumentoAPI(); |
... | ... | @@ -371,6 +371,8 @@ class ReceberProcedimentoRN extends InfraRN |
371 | 371 | |
372 | 372 | private function registrarProcesso($parStrNumeroRegistro, $parNumIdentificacaoTramite, $parObjProcesso, $parObjMetadadosProcedimento) |
373 | 373 | { |
374 | + | |
375 | + | |
374 | 376 | // Validação dos dados do processo recebido |
375 | 377 | $objInfraException = new InfraException(); |
376 | 378 | $this->validarDadosProcesso($objInfraException, $parObjProcesso); |
... | ... | @@ -385,10 +387,12 @@ class ReceberProcedimentoRN extends InfraRN |
385 | 387 | $dblIdProcedimento = $this->consultarProcedimentoExistente($parStrNumeroRegistro, $parObjProcesso->protocolo); |
386 | 388 | |
387 | 389 | if(isset($dblIdProcedimento)){ |
388 | - //TODO: Tratar situação em que o processo (NUP) já existia na base do sistema mas não havia nenhum NRE registrado para ele | |
390 | + | |
391 | + //TODO: Tratar situação em que o processo (NUP) já existia na base do sistema mas não havia nenhum NRE registrado para ele | |
389 | 392 | $objProcedimentoDTO = $this->atualizarProcedimento($dblIdProcedimento, $parObjMetadadosProcedimento, $parObjProcesso); |
390 | 393 | } |
391 | 394 | else { |
395 | + | |
392 | 396 | //TODO: Gerar Procedimento com status BLOQUEADO, aguardando o recebimento dos componentes digitais |
393 | 397 | $objProcedimentoDTO = $this->gerarProcedimento($parObjMetadadosProcedimento, $parObjProcesso); |
394 | 398 | } |
... | ... | @@ -439,8 +443,9 @@ class ReceberProcedimentoRN extends InfraRN |
439 | 443 | return $dblIdProcedimento; |
440 | 444 | } |
441 | 445 | |
442 | - private function atualizarProcedimento($parDblIdProcedimento, $objMetadadosProcedimento, $objProcesso){ | |
443 | - | |
446 | + private function atualizarProcedimento($parDblIdProcedimento, $objMetadadosProcedimento, $objProcesso){ | |
447 | + | |
448 | + | |
444 | 449 | if(!isset($parDblIdProcedimento)){ |
445 | 450 | throw new InfraException('Parâmetro $parDblIdProcedimento não informado.'); |
446 | 451 | } |
... | ... | @@ -467,7 +472,8 @@ class ReceberProcedimentoRN extends InfraRN |
467 | 472 | //} |
468 | 473 | |
469 | 474 | //$objProcedimentoDTO = $arrObjProcedimentoDTO[0]; |
470 | - | |
475 | + | |
476 | + | |
471 | 477 | $objSeiRN = new SeiRN(); |
472 | 478 | |
473 | 479 | $objAtividadeDTO = new AtividadeDTO(); |
... | ... | @@ -490,6 +496,8 @@ class ReceberProcedimentoRN extends InfraRN |
490 | 496 | $objEntradaReabrirProcessoAPI->setIdProcedimento($parDblIdProcedimento); |
491 | 497 | $objSeiRN->reabrirProcesso($objEntradaReabrirProcessoAPI); |
492 | 498 | } |
499 | + | |
500 | + | |
493 | 501 | |
494 | 502 | $objEntradaDesbloquearProcessoAPI = new EntradaDesbloquearProcessoAPI(); |
495 | 503 | $objEntradaDesbloquearProcessoAPI->setIdProcedimento($parDblIdProcedimento); |
... | ... | @@ -505,7 +513,7 @@ class ReceberProcedimentoRN extends InfraRN |
505 | 513 | $objProcedimentoRN = new ProcedimentoRN(); |
506 | 514 | $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); |
507 | 515 | |
508 | - //TODO: Obter código da unidade através de mapeamento entre SEI e Barramento | |
516 | + //TODO: Obter código da unidade através de mapeamento entre SEI e Barramento | |
509 | 517 | $objUnidadeDTO = $this->atribuirDadosUnidade($objProcedimentoDTO, $objDestinatario); |
510 | 518 | |
511 | 519 | $this->registrarAndamentoRecebimentoProcesso($objProcedimentoDTO, $objMetadadosProcedimento, $objUnidadeDTO); |
... | ... | @@ -891,8 +899,10 @@ class ReceberProcedimentoRN extends InfraRN |
891 | 899 | $arrStrHashConteudo = InfraArray::converterArrInfraDTO($arrObjComponenteDigitalDTO, 'IdDocumento', 'HashConteudo'); |
892 | 900 | |
893 | 901 | $objProtocoloBD = new ProtocoloBD($this->getObjInfraIBanco()); |
894 | - | |
902 | + $objSeiRN = new SeiRN(); | |
903 | + | |
895 | 904 | $arrObjDocumentoDTO = array(); |
905 | + | |
896 | 906 | foreach($arrObjDocumentos as $objDocumento){ |
897 | 907 | |
898 | 908 | // @join_tec US027 (#3498) |
... | ... | @@ -910,14 +920,18 @@ class ReceberProcedimentoRN extends InfraRN |
910 | 920 | //Instancia o DTO do protocolo |
911 | 921 | $objProtocoloDTO = new ProtocoloDTO(); |
912 | 922 | $objProtocoloDTO->setDblIdProtocolo($dblIdProtocolo); |
913 | - $objProtocoloDTO->retTodos(); | |
923 | + $objProtocoloDTO->retStrStaEstado(); | |
914 | 924 | |
915 | 925 | $objProtocoloDTO = $objProtocoloBD->consultar($objProtocoloDTO); |
916 | 926 | |
917 | - if($objProtocoloDTO->getStrStaEstado() != ProtocoloRN::$TE_CANCELADO){ | |
918 | - $objProtocoloDTO->setStrMotivoCancelamento('Cancelado pelo remetente'); | |
919 | - $objProtocoloRN = new PenProtocoloRN(); | |
920 | - $objProtocoloRN->cancelar($objProtocoloDTO); | |
927 | + if($objProtocoloDTO->getStrStaEstado() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO){ | |
928 | + //Instancia o DTO do protocolo | |
929 | + $objEntradaCancelarDocumentoAPI = new EntradaCancelarDocumentoAPI(); | |
930 | + $objEntradaCancelarDocumentoAPI->setIdDocumento($dblIdProtocolo); | |
931 | + $objEntradaCancelarDocumentoAPI->setMotivo('Cancelado pelo remetente'); | |
932 | + | |
933 | + $objSeiRN->cancelarDocumento($objEntradaCancelarDocumentoAPI); | |
934 | + | |
921 | 935 | } |
922 | 936 | |
923 | 937 | ... | ... |
... | ... | @@ -0,0 +1,70 @@ |
1 | +<?php | |
2 | +/** | |
3 | + * Script para atualizaçăo do sistema SEI. | |
4 | + * | |
5 | + * Modificar o "short_open_tag" para "On" no php.ini | |
6 | + * | |
7 | + * PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00) | |
8 | + * Copyright (c) 1997-2010 The PHP Group | |
9 | + * Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies | |
10 | + * | |
11 | + * @author Join Tecnologia | |
12 | + */ | |
13 | + | |
14 | +try { | |
15 | + | |
16 | + require_once dirname(__FILE__).'/../../SEI.php'; | |
17 | + | |
18 | + $objPenConsoleRN = new PenConsoleRN(); | |
19 | + $arrArgs = $objPenConsoleRN->getTokens(); | |
20 | + | |
21 | + $objAtualizarRN = new PenAtualizarSeiRN($arrArgs); | |
22 | + $objAtualizarRN->atualizarVersao(); | |
23 | + | |
24 | + exit(0); | |
25 | +} | |
26 | +catch(InfraException $e){ | |
27 | + | |
28 | + print $e->getStrDescricao().PHP_EOL; | |
29 | +} | |
30 | +catch(Exception $e) { | |
31 | + | |
32 | + print InfraException::inspecionar($e); | |
33 | + | |
34 | + try { | |
35 | + LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); | |
36 | + } catch (Exception $e) { | |
37 | + | |
38 | + } | |
39 | + | |
40 | + exit(1); | |
41 | +} | |
42 | + | |
43 | +print PHP_EOL; | |
44 | + | |
45 | +/** | |
46 | + # Apagar modulo PEN no SEI pelo MySQL | |
47 | + | |
48 | + SET FOREIGN_KEY_CHECKS = 0; | |
49 | + DROP TABLE `sei`.`pen_componente_digital`; | |
50 | + DROP TABLE `sei`.`pen_envio_recebimento_tramite`; | |
51 | + DROP TABLE `sei`.`pen_especie_documental`; | |
52 | + DROP TABLE `sei`.`pen_procedimento_andamento`; | |
53 | + DROP TABLE `sei`.`pen_procedimento_expedir_andamento`; | |
54 | + DROP TABLE `sei`.`pen_processo_eletronico`; | |
55 | + DROP TABLE `sei`.`pen_protocolo`; | |
56 | + DROP TABLE `sei`.`pen_receber_tramites_recusados`; | |
57 | + DROP TABLE `sei`.`pen_recibo_tramite`; | |
58 | + DROP TABLE `sei`.`pen_recibo_tramite_enviado`; | |
59 | + DROP TABLE `sei`.`pen_recibo_tramite_recebido`; | |
60 | + DROP TABLE `sei`.`pen_rel_processo_apensado`; | |
61 | + DROP TABLE `sei`.`pen_rel_serie_especie`; | |
62 | + DROP TABLE `sei`.`pen_rel_tarefa_operacao`; | |
63 | + DROP TABLE `sei`.`pen_rel_tipo_documento_mapeamento_recebido`; | |
64 | + DROP TABLE `sei`.`pen_tramite`; | |
65 | + DROP TABLE `sei`.`pen_tramite_pendente`; | |
66 | + ALTER TABLE unidade DROP COLUMN id_unidade_rh; | |
67 | + SET FOREIGN_KEY_CHECKS = 1; | |
68 | + | |
69 | + | |
70 | + */ | |
0 | 71 | \ No newline at end of file | ... | ... |