Commit eeff643a5f71260e5d5bef28ef274f34287283e1
1 parent
96599235
Exists in
master
and in
21 other branches
Início da implementação da alteração do nível de sigilo e hipótese legal
Showing
3 changed files
with
308 additions
and
35 deletions
Show diff stats
@@ -0,0 +1,123 @@ | @@ -0,0 +1,123 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +require_once __DIR__ . '/../../SEI.php'; | ||
4 | +SessaoSEI::getInstance(false)->simularLogin(SessaoSEI::$USUARIO_SEI, SessaoSEI::$UNIDADE_TESTE); | ||
5 | +/* | ||
6 | + ###############################CONSULTAR ASSUNTO############################################# | ||
7 | + //FILTROS PASSADOS POR PARÂMETRO | ||
8 | + $ID = 0; | ||
9 | + $FILTER = ''; | ||
10 | + $START = 0; | ||
11 | + $LIMIT = 0; | ||
12 | + | ||
13 | + //INSTANCIA O DTO E INFORMA OS FILTROS DA BUSCA | ||
14 | + $assuntoDTO = new AssuntoDTO(); | ||
15 | + | ||
16 | + IF($ID) | ||
17 | + $assuntoDTO->setNumIdAssunto($ID); | ||
18 | + | ||
19 | + if($FILTER) | ||
20 | + $assuntoDTO->setStrCodigoEstruturado('%'.$FILTER.'%',InfraDTO::$OPER_LIKE); | ||
21 | + $assuntoDTO->setStrDescricao('%'.$FILTER.'%',InfraDTO::$OPER_LIKE); | ||
22 | + | ||
23 | + IF($START) | ||
24 | + $assuntoDTO->setNumMaxRegistrosRetorno($LIMIT); | ||
25 | + | ||
26 | + IF($LIMIT) | ||
27 | + $assuntoDTO->setNumPaginaAtual($START); | ||
28 | + | ||
29 | + $assuntoDTO->retNumIdAssunto(); | ||
30 | + $assuntoDTO->retStrCodigoEstruturado(); | ||
31 | + $assuntoDTO->retStrDescricao(); | ||
32 | + | ||
33 | + // REALIZA A CHAMADA DA DE ASSUNTOS | ||
34 | + $assuntoRN = new AssuntoRN(); | ||
35 | + $arrAssuntoDTO = $assuntoRN->listarRN0247($assuntoDTO); | ||
36 | + | ||
37 | + | ||
38 | + ###################PESQUISAR ASSUNTOS################################################### | ||
39 | + $ID = 0; | ||
40 | + $FILTER = ''; | ||
41 | + $START = 0; | ||
42 | + $LIMIT = 5; | ||
43 | + | ||
44 | + $contatoDTO = new ContatoDTO(); | ||
45 | + | ||
46 | + if($ID) | ||
47 | + $contatoDTO->setNumIdContato($ID); | ||
48 | + | ||
49 | + if($FILTER) | ||
50 | + $contatoDTO->setStrNome('%'.$FILTER.'%',InfraDTO::$OPER_LIKE); | ||
51 | + | ||
52 | + IF($LIMIT) | ||
53 | + $contatoDTO->setNumMaxRegistrosRetorno($LIMIT); | ||
54 | + | ||
55 | + IF($START) | ||
56 | + $contatoDTO->setNumPaginaAtual($START); | ||
57 | + | ||
58 | + $contatoDTO->retNumIdContato(); | ||
59 | + $contatoDTO->retStrSigla(); | ||
60 | + $contatoDTO->retStrNome(); | ||
61 | + | ||
62 | + $contatoRN = new ContatoRN(); | ||
63 | + $arrContatoDTO = $contatoRN->listarRN0325($contatoDTO); | ||
64 | + | ||
65 | + ###################PESQUISAR TIPOS DE DOCUMENTO################################################### | ||
66 | + */ | ||
67 | + | ||
68 | +###################TEMPLATE DE CRIAÇÃO DE DOCUMENTO DE UM TIPO ESPECÍFICO############################################ | ||
69 | +$ID_TIPO_DOCUMENTO = 46; | ||
70 | + | ||
71 | +//Consulta os assuntos sugeridos para um tipo de documento | ||
72 | +$relSerieAssuntoDTO = new RelSerieAssuntoDTO(); | ||
73 | +$relSerieAssuntoDTO->setNumIdSerie($ID_TIPO_DOCUMENTO); // FILTRO PELO TIPO DE DOCUMENTO | ||
74 | +$relSerieAssuntoDTO->retNumIdAssuntoProxy(); // ID DO ASSUNTO QUE DEVE SE RETORNADO | ||
75 | +$relSerieAssuntoDTO->retStrCodigoEstruturadoAssunto(); // CÓDIGO DO ASSUNTO QUE DEVE SE RETORNADO | ||
76 | +$relSerieAssuntoDTO->retStrDescricaoAssunto(); // DESCRIÇÃO DO ASSUNTO | ||
77 | + | ||
78 | +$relSerieAssuntoRN = new RelSerieAssuntoRN(); | ||
79 | +$arrRelSerieAssuntoDTO = $relSerieAssuntoRN->listar($relSerieAssuntoDTO); | ||
80 | + | ||
81 | +// Consulta se o tipo de documento permite a inclusão de destinatários e interessados | ||
82 | +$serieDTO = new SerieDTO(); | ||
83 | +$serieDTO->setNumIdSerie($ID_TIPO_DOCUMENTO); | ||
84 | +$serieDTO->retStrSinDestinatario(); | ||
85 | +$serieDTO->retStrSinInteressado(); | ||
86 | + | ||
87 | +$serieRN = new SerieRN(); | ||
88 | +$arrSerieDTO = $serieRN->listarRN0646($serieDTO); | ||
89 | + | ||
90 | +######################PESQUISAR HIPÓTESES LEGAIS ############################################ | ||
91 | + | ||
92 | +$ID = 0; | ||
93 | +$FILTER = ''; | ||
94 | +$NIVEL_ACESSO = 2; | ||
95 | +$START = 0; | ||
96 | +$LIMIT = 5; | ||
97 | + | ||
98 | +$hipoteseLegalDTO = new HipoteseLegalDTO(); | ||
99 | + | ||
100 | +if ($ID) | ||
101 | + $hipoteseLegalDTO->setNumIdHipoteseLegal($ID); | ||
102 | + | ||
103 | +if ($NIVEL_ACESSO) | ||
104 | + $hipoteseLegalDTO->setStrStaNivelAcesso($NIVEL_ACESSO); | ||
105 | + | ||
106 | +if ($FILTER) | ||
107 | + $hipoteseLegalDTO->setStrNome('%' . $FILTER . '%', InfraDTO::$OPER_LIKE); | ||
108 | + | ||
109 | +IF ($LIMIT) | ||
110 | + $hipoteseLegalDTO->setNumMaxRegistrosRetorno($LIMIT); | ||
111 | + | ||
112 | +IF ($START) | ||
113 | + $hipoteseLegalDTO->setNumPaginaAtual($START); | ||
114 | + | ||
115 | +$hipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
116 | +$hipoteseLegalDTO->retStrNome(); | ||
117 | + | ||
118 | +$hipoteseLegalRN = new HipoteseLegalRN(); | ||
119 | +$arrHipoteseLegalDTO = $hipoteseLegalRN->listar($hipoteseLegalDTO); | ||
120 | + | ||
121 | +######################PESQUISAR HIPÓTESES LEGAIS ############################################ | ||
122 | + | ||
123 | +var_dump($arrHipoteseLegalDTO); | ||
0 | \ No newline at end of file | 124 | \ No newline at end of file |
@@ -0,0 +1,96 @@ | @@ -0,0 +1,96 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +require_once __DIR__ . '/../../SEI.php'; | ||
4 | +SessaoSEI::getInstance(false)->simularLogin(null, null, '100000001', '110000001'); | ||
5 | + | ||
6 | +$idProcesso = 12; | ||
7 | +$idTipoDocumento = 12; | ||
8 | +$descricao = 'descrição de teste'; | ||
9 | +$nivelAcesso = 1; | ||
10 | +$hipoteseLegal = 1; | ||
11 | +$grauSigilo = ''; | ||
12 | +$arrAssuntos = array(array('id' => 2), array('id' => 4)); | ||
13 | +$arrInteressados = array(array('id' => 100000008), array('id' => 100000010), array('id' => 100000002), array('id' => 100000006)); | ||
14 | +$arrDestinatarios = array(array('id' => 100000008)); | ||
15 | +$arrRemetentes = array(array('id' => 100000008)); | ||
16 | + | ||
17 | + | ||
18 | +$objDocumentoDTO = new DocumentoDTO(); | ||
19 | +$objDocumentoDTO->setDblIdDocumento(null); | ||
20 | +$objDocumentoDTO->setDblIdProcedimento($idProcesso); | ||
21 | + | ||
22 | + | ||
23 | +$objProtocoloDTO = new ProtocoloDTO(); | ||
24 | +$objProtocoloDTO->setDblIdProtocolo(null); | ||
25 | +$objProtocoloDTO->setStrStaProtocolo('G'); | ||
26 | +// $objProtocoloDTO->setDtaGeracao($dtaGeracao); | ||
27 | + | ||
28 | +$objDocumentoDTO->setNumIdSerie($idTipoDocumento); | ||
29 | +// $objDocumentoDTO->setStrNomeSerie($nomeTipo); | ||
30 | + | ||
31 | +$objDocumentoDTO->setDblIdDocumentoEdoc(null); | ||
32 | +$objDocumentoDTO->setDblIdDocumentoEdocBase(null); | ||
33 | +$objDocumentoDTO->setNumIdUnidadeResponsavel(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | ||
34 | +$objDocumentoDTO->setNumIdTipoConferencia(null); | ||
35 | +$objDocumentoDTO->setStrNumero(''); | ||
36 | +// $objDocumentoDTO->setNumIdTipoConferencia($objDocumentoAPI->getIdTipoConferencia()); | ||
37 | + | ||
38 | +$objProtocoloDTO->setStrStaNivelAcessoLocal($nivelAcesso); | ||
39 | +$objProtocoloDTO->setNumIdHipoteseLegal($hipoteseLegal); | ||
40 | +$objProtocoloDTO->setStrDescricao($descricao); | ||
41 | +$objProtocoloDTO->setStrStaGrauSigilo($grauSigilo); | ||
42 | + | ||
43 | +$arrParticipantesDTO = array(); | ||
44 | + | ||
45 | +foreach ($arrRemetentes as $k => $remetente) { | ||
46 | + $objParticipanteDTO = new ParticipanteDTO(); | ||
47 | + $objParticipanteDTO->setNumIdContato($remetente['id']); | ||
48 | + $objParticipanteDTO->setStrStaParticipacao(ParticipanteRN::$TP_REMETENTE); | ||
49 | + $objParticipanteDTO->setNumSequencia($k); | ||
50 | + $arrParticipantesDTO[] = $objParticipanteDTO; | ||
51 | +} | ||
52 | + | ||
53 | +foreach ($arrInteressados as $k => $interessado) { | ||
54 | + $objParticipanteDTO = new ParticipanteDTO(); | ||
55 | + $objParticipanteDTO->setNumIdContato($interessado['id']); | ||
56 | + $objParticipanteDTO->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO); | ||
57 | + $objParticipanteDTO->setNumSequencia($k); | ||
58 | + $arrParticipantesDTO[] = $objParticipanteDTO; | ||
59 | +} | ||
60 | + | ||
61 | +foreach ($arrDestinatarios as $k => $destinatario) { | ||
62 | + $objParticipanteDTO = new ParticipanteDTO(); | ||
63 | + $objParticipanteDTO->setNumIdContato($destinatario['id']); | ||
64 | + $objParticipanteDTO->setStrStaParticipacao(ParticipanteRN::$TP_DESTINATARIO); | ||
65 | + $objParticipanteDTO->setNumSequencia($k); | ||
66 | + $arrParticipantesDTO[] = $objParticipanteDTO; | ||
67 | +} | ||
68 | +$arrRelProtocoloAssuntoDTO = array(); | ||
69 | + | ||
70 | +foreach ($arrAssuntos as $k => $assunto) { | ||
71 | + $relProtocoloAssuntoDTO = new RelProtocoloAssuntoDTO(); | ||
72 | + $relProtocoloAssuntoDTO->setNumIdAssunto($assunto['id']); | ||
73 | + $relProtocoloAssuntoDTO->setDblIdProtocolo($idDocumento); | ||
74 | + $relProtocoloAssuntoDTO->setNumSequencia($k); | ||
75 | + $arrRelProtocoloAssuntoDTO[] = $relProtocoloAssuntoDTO; | ||
76 | +} | ||
77 | + | ||
78 | +$objProtocoloDTO->setArrObjParticipanteDTO($arrParticipantesDTO); | ||
79 | +$objProtocoloDTO->setArrObjRelProtocoloAssuntoDTO($arrRelProtocoloAssuntoDTO); | ||
80 | + | ||
81 | +//OBSERVACOES | ||
82 | +$objObservacaoDTO = new ObservacaoDTO(); | ||
83 | +$objObservacaoDTO->setStrDescricao($observacao); | ||
84 | +$objProtocoloDTO->setArrObjObservacaoDTO(array($objObservacaoDTO)); | ||
85 | + | ||
86 | +$objDocumentoDTO->setObjProtocoloDTO($objProtocoloDTO); | ||
87 | +$objDocumentoDTO->setStrStaDocumento(DocumentoRN::$TD_EDITOR_INTERNO); | ||
88 | + | ||
89 | +try { | ||
90 | + $objDocumentoRN = new DocumentoRN(); | ||
91 | + $obj = $objDocumentoRN->cadastrarRN0003($objDocumentoDTO); | ||
92 | + | ||
93 | + var_dump($obj); | ||
94 | +} catch (Exception $ex) { | ||
95 | + var_dump($ex); | ||
96 | +} |
rn/ReceberProcedimentoRN.php
@@ -99,7 +99,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -99,7 +99,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
99 | 99 | ||
100 | //!Substituir a unidade destinatária para a receptora (!1!) | 100 | //!Substituir a unidade destinatária para a receptora (!1!) |
101 | if (isset($objMetadadosProcedimento->metadados->unidadeReceptora)) { | 101 | if (isset($objMetadadosProcedimento->metadados->unidadeReceptora)) { |
102 | - $this->destinatarioReal = $objMetadadosProcedimento->metadados->destinatario->numeroDeIdentificacaoDaEstrutura; | 102 | + $this->destinatarioReal = $objMetadadosProcedimento->metadados->destinatario; |
103 | $objMetadadosProcedimento->metadados->destinatario = $objMetadadosProcedimento->metadados->unidadeReceptora; | 103 | $objMetadadosProcedimento->metadados->destinatario = $objMetadadosProcedimento->metadados->unidadeReceptora; |
104 | } | 104 | } |
105 | 105 | ||
@@ -537,9 +537,13 @@ class ReceberProcedimentoRN extends InfraRN | @@ -537,9 +537,13 @@ class ReceberProcedimentoRN extends InfraRN | ||
537 | $objEntradaReabrirProcessoAPI->setIdProcedimento($parDblIdProcedimento); | 537 | $objEntradaReabrirProcessoAPI->setIdProcedimento($parDblIdProcedimento); |
538 | $objSeiRN->reabrirProcesso($objEntradaReabrirProcessoAPI); | 538 | $objSeiRN->reabrirProcesso($objEntradaReabrirProcessoAPI); |
539 | } | 539 | } |
540 | + | ||
541 | + //Cadastro das atividades para quando o destinatário é desviado pelo receptor (!3!) | ||
542 | + if ($this->destinatarioReal->numeroDeIdentificacaoDaEstrutura) { | ||
543 | + $this->gerarAndamentoUnidadeReceptora($parDblIdProcedimento); | ||
544 | + } | ||
540 | 545 | ||
541 | 546 | ||
542 | - | ||
543 | $objEntradaDesbloquearProcessoAPI = new EntradaDesbloquearProcessoAPI(); | 547 | $objEntradaDesbloquearProcessoAPI = new EntradaDesbloquearProcessoAPI(); |
544 | $objEntradaDesbloquearProcessoAPI->setIdProcedimento($parDblIdProcedimento); | 548 | $objEntradaDesbloquearProcessoAPI->setIdProcedimento($parDblIdProcedimento); |
545 | $objSeiRN->desbloquearProcesso($objEntradaDesbloquearProcessoAPI); | 549 | $objSeiRN->desbloquearProcesso($objEntradaDesbloquearProcessoAPI); |
@@ -553,7 +557,11 @@ class ReceberProcedimentoRN extends InfraRN | @@ -553,7 +557,11 @@ class ReceberProcedimentoRN extends InfraRN | ||
553 | //TODO: Avaliar necessidade de restringir referência circular entre processos | 557 | //TODO: Avaliar necessidade de restringir referência circular entre processos |
554 | //TODO: Registrar que o processo foi recebido com outros apensados. Necessário para posterior reenvio | 558 | //TODO: Registrar que o processo foi recebido com outros apensados. Necessário para posterior reenvio |
555 | $this->atribuirProcessosApensados($objProcedimentoDTO, $objProcesso->processoApensado); | 559 | $this->atribuirProcessosApensados($objProcedimentoDTO, $objProcesso->processoApensado); |
556 | - | 560 | + |
561 | + //Realiza a alteração dos metadados do processo | ||
562 | + //TODO: Implementar alteração de todos os metadados | ||
563 | + //$this->alterarMetadadosProcedimento($objProcedimentoDTO->getDblIdProcedimento(), $objProcesso); | ||
564 | + | ||
557 | //TODO: Finalizar o envio do documento para a respectiva unidade | 565 | //TODO: Finalizar o envio do documento para a respectiva unidade |
558 | $this->enviarProcedimentoUnidade($objProcedimentoDTO, true); | 566 | $this->enviarProcedimentoUnidade($objProcedimentoDTO, true); |
559 | 567 | ||
@@ -570,8 +578,39 @@ class ReceberProcedimentoRN extends InfraRN | @@ -570,8 +578,39 @@ class ReceberProcedimentoRN extends InfraRN | ||
570 | 578 | ||
571 | 579 | ||
572 | } | 580 | } |
581 | + | ||
582 | + private function gerarAndamentoUnidadeReceptora($parNumIdProcedimento) { | ||
583 | + | ||
584 | + $objUnidadeDTO = new PenUnidadeDTO(); | ||
585 | + $objUnidadeDTO->setNumIdUnidadeRH($this->destinatarioReal->numeroDeIdentificacaoDaEstrutura); | ||
586 | + $objUnidadeDTO->setStrSinAtivo('S'); | ||
587 | + $objUnidadeDTO->retStrDescricao(); //descricao | ||
588 | + | ||
589 | + $objUnidadeRN = new UnidadeRN(); | ||
590 | + $objUnidadeDTO = $objUnidadeRN->consultarRN0125($objUnidadeDTO); | ||
591 | + | ||
592 | + $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | ||
593 | + $objAtributoAndamentoDTO->setStrNome('DESCRICAO'); | ||
594 | + $objAtributoAndamentoDTO->setStrValor('Processo remetido para a unidade ' . $objUnidadeDTO->getStrDescricao()); | ||
595 | + $objAtributoAndamentoDTO->setStrIdOrigem($this->destinatarioReal->numeroDeIdentificacaoDaEstrutura); | ||
573 | 596 | ||
574 | - private function gerarProcedimento($objMetadadosProcedimento, $objProcesso){ | 597 | + $arrObjAtributoAndamentoDTO = array($objAtributoAndamentoDTO); |
598 | + | ||
599 | + $objAtividadeDTO = new AtividadeDTO(); | ||
600 | + $objAtividadeDTO->setDblIdProtocolo($parNumIdProcedimento); | ||
601 | + $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | ||
602 | + $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | ||
603 | + $objAtividadeDTO->setNumIdTarefa(TarefaRN::$TI_ATUALIZACAO_ANDAMENTO); | ||
604 | + $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); | ||
605 | + $objAtividadeDTO->setDthConclusao(null); | ||
606 | + $objAtividadeDTO->setNumIdUsuarioConclusao(null); | ||
607 | + $objAtividadeDTO->setStrSinInicial('N'); | ||
608 | + | ||
609 | + $objAtividadeRN = new AtividadeRN(); | ||
610 | + $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | ||
611 | + } | ||
612 | + | ||
613 | + private function gerarProcedimento($objMetadadosProcedimento, $objProcesso){ | ||
575 | 614 | ||
576 | if(!isset($objMetadadosProcedimento)){ | 615 | if(!isset($objMetadadosProcedimento)){ |
577 | throw new InfraException('Parâmetro $objMetadadosProcedimento não informado.'); | 616 | throw new InfraException('Parâmetro $objMetadadosProcedimento não informado.'); |
@@ -631,7 +670,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -631,7 +670,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
631 | //!Criação da observação de aviso para qual é a real unidade emitida (!2!) | 670 | //!Criação da observação de aviso para qual é a real unidade emitida (!2!) |
632 | if ($this->destinatarioReal) { | 671 | if ($this->destinatarioReal) { |
633 | $objUnidadeDTO = new PenUnidadeDTO(); | 672 | $objUnidadeDTO = new PenUnidadeDTO(); |
634 | - $objUnidadeDTO->setNumIdUnidadeRH($this->destinatarioReal); | 673 | + $objUnidadeDTO->setNumIdUnidadeRH($this->destinatarioReal->numeroDeIdentificacaoDaEstrutura); |
635 | $objUnidadeDTO->setStrSinAtivo('S'); | 674 | $objUnidadeDTO->setStrSinAtivo('S'); |
636 | $objUnidadeDTO->retStrDescricao(); | 675 | $objUnidadeDTO->retStrDescricao(); |
637 | 676 | ||
@@ -718,7 +757,31 @@ class ReceberProcedimentoRN extends InfraRN | @@ -718,7 +757,31 @@ class ReceberProcedimentoRN extends InfraRN | ||
718 | return $objProcedimentoDTO; | 757 | return $objProcedimentoDTO; |
719 | } | 758 | } |
720 | 759 | ||
721 | - | 760 | + private function alterarMetadadosProcedimento($parNumIdProcedimento, $parObjMetadadoProcedimento){ |
761 | + | ||
762 | + //Realiza a alteração dos metadados do processo(Por hora, apenas do nível de sigilo e hipótese legal) | ||
763 | + $objProtocoloDTO = new ProtocoloDTO(); | ||
764 | + $objProtocoloDTO->setDblIdProcedimento($parNumIdProcedimento); | ||
765 | + $objProtocoloDTO->setStrStaNivelAcessoLocal($this->obterNivelSigiloSEI($parObjMetadadoProcedimento->nivelSigilo)); | ||
766 | + $objProtocoloDTO->setNumIdHipoteseLegal($this->obterHipoteseLegalSEI($parObjMetadadoProcedimento->hipoteseLegal->identificacao)); | ||
767 | + | ||
768 | + $objProtocoloRN = new ProtocoloRN(); | ||
769 | + $objProtocoloRN->alterarRN0203($objProtocoloDTO); | ||
770 | + } | ||
771 | + | ||
772 | + private function alterarMetadadosDocumento($parNumIdDocumento, $parObjMetadadoDocumento){ | ||
773 | + //Realiza a alteração dos metadados do documento(Por hora, apenas do nível de sigilo e hipótese legal) | ||
774 | + $objProtocoloDTO = new ProtocoloDTO(); | ||
775 | + $objProtocoloDTO->setDblIdProtocolo($parNumIdDocumento); | ||
776 | + $objProtocoloDTO->setStrStaNivelAcessoLocal($this->obterNivelSigiloSEI($parObjMetadadoDocumento->nivelSigilo)); | ||
777 | + $objProtocoloDTO->setNumIdHipoteseLegal($this->obterHipoteseLegalSEI($parObjMetadadoDocumento->hipoteseLegal->identificacao)); | ||
778 | + | ||
779 | + $objProtocoloRN = new ProtocoloRN(); | ||
780 | + $objProtocoloRN->alterarRN0203($objProtocoloDTO); | ||
781 | + | ||
782 | + } | ||
783 | + | ||
784 | + | ||
722 | private function removerAndamentosProcedimento($parObjProtocoloDTO) | 785 | private function removerAndamentosProcedimento($parObjProtocoloDTO) |
723 | { | 786 | { |
724 | //TODO: Remover apenas as atividades geradas pelo recebimento do processo, não as atividades geradas anteriormente | 787 | //TODO: Remover apenas as atividades geradas pelo recebimento do processo, não as atividades geradas anteriormente |
@@ -814,35 +877,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -814,35 +877,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
814 | $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | 877 | $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); |
815 | 878 | ||
816 | 879 | ||
817 | - //Cadastro das atividades para quando o destinatário é desviado pelo receptor (!3!) | ||
818 | - if ($this->destinatarioReal) { | ||
819 | - $objUnidadeDTO = new PenUnidadeDTO(); | ||
820 | - $objUnidadeDTO->setNumIdUnidadeRH($this->destinatarioReal); | ||
821 | - $objUnidadeDTO->setStrSinAtivo('S'); | ||
822 | - $objUnidadeDTO->retStrDescricao(); //descricao | ||
823 | - $objUnidadeRN = new UnidadeRN(); | ||
824 | - $objUnidadeDTO = $objUnidadeRN->consultarRN0125($objUnidadeDTO); | ||
825 | - | ||
826 | - $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | ||
827 | - $objAtributoAndamentoDTO->setStrNome('DESCRICAO'); | ||
828 | - $objAtributoAndamentoDTO->setStrValor('Processo remetido para a unidade ' . $objUnidadeDTO->getStrDescricao()); | ||
829 | - $objAtributoAndamentoDTO->setStrIdOrigem($objNivel->numeroDeIdentificacaoDaEstrutura); | ||
830 | - | ||
831 | - $arrObjAtributoAndamentoDTO = array($objAtributoAndamentoDTO); | ||
832 | - | ||
833 | - $objAtividadeDTO = new AtividadeDTO(); | ||
834 | - $objAtividadeDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento()); | ||
835 | - $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | ||
836 | - $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | ||
837 | - $objAtividadeDTO->setNumIdTarefa(TarefaRN::$TI_ATUALIZACAO_ANDAMENTO); | ||
838 | - $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); | ||
839 | - $objAtividadeDTO->setDthConclusao(null); | ||
840 | - $objAtividadeDTO->setNumIdUsuarioConclusao(null); | ||
841 | - $objAtividadeDTO->setStrSinInicial('N'); | ||
842 | - | ||
843 | - $objAtividadeRN = new AtividadeRN(); | ||
844 | - $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | ||
845 | - } | 880 | + |
846 | } | 881 | } |
847 | 882 | ||
848 | 883 | ||
@@ -1012,6 +1047,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1012,6 +1047,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
1012 | 1047 | ||
1013 | //$strHashConteudo = ProcessoEletronicoRN::getHashFromMetaDados($objDocumento->componenteDigital->hash); | 1048 | //$strHashConteudo = ProcessoEletronicoRN::getHashFromMetaDados($objDocumento->componenteDigital->hash); |
1014 | 1049 | ||
1050 | + | ||
1015 | // Caso já esteja cadastrado, de um reenvio anterior, então move para bloqueado | 1051 | // Caso já esteja cadastrado, de um reenvio anterior, então move para bloqueado |
1016 | if(array_key_exists($objDocumento->ordem, $arrObjComponenteDigitalDTOIndexado)) { | 1052 | if(array_key_exists($objDocumento->ordem, $arrObjComponenteDigitalDTOIndexado)) { |
1017 | 1053 | ||
@@ -1045,6 +1081,8 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1045,6 +1081,8 @@ class ReceberProcedimentoRN extends InfraRN | ||
1045 | } | 1081 | } |
1046 | 1082 | ||
1047 | if(array_key_exists($objDocumento->ordem, $arrObjComponenteDigitalDTOIndexado)){ | 1083 | if(array_key_exists($objDocumento->ordem, $arrObjComponenteDigitalDTOIndexado)){ |
1084 | + //$objComponenteDigitalDTO = $arrObjComponenteDigitalDTO[$objDocumento->ordem]; | ||
1085 | + //$this->alterarMetadadosDocumento($objComponenteDigitalDTO->getNumIdDocumento(), $objDocumento); | ||
1048 | continue; | 1086 | continue; |
1049 | } | 1087 | } |
1050 | 1088 | ||
@@ -1374,6 +1412,21 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1374,6 +1412,21 @@ class ReceberProcedimentoRN extends InfraRN | ||
1374 | break; | 1412 | break; |
1375 | } | 1413 | } |
1376 | } | 1414 | } |
1415 | + | ||
1416 | + private function obterHipoteseLegalSEI($parNumIdHipoteseLegalPEN) { | ||
1417 | + //Atribuí a hipótese legal | ||
1418 | + $objHipoteseLegalRecebido = new PenRelHipoteseLegalRecebidoRN(); | ||
1419 | + $objPenParametroRN = new PenParametroRN(); | ||
1420 | + $numIdHipoteseLegalPadrao = $objPenParametroRN->getParametro('HIPOTESE_LEGAL_PADRAO'); | ||
1421 | + | ||
1422 | + $numIdHipoteseLegal = $objHipoteseLegalRecebido->getIdHipoteseLegalSEI($parNumIdHipoteseLegalPEN); | ||
1423 | + | ||
1424 | + if (empty($numIdHipoteseLegal)) { | ||
1425 | + return $numIdHipoteseLegalPadrao; | ||
1426 | + } else { | ||
1427 | + return $numIdHipoteseLegal; | ||
1428 | + } | ||
1429 | + } | ||
1377 | 1430 | ||
1378 | //TODO: Implementar o mapeamento entre as unidade do SEI e Barramento de Serviços (Secretaria de Saúde: 218794) | 1431 | //TODO: Implementar o mapeamento entre as unidade do SEI e Barramento de Serviços (Secretaria de Saúde: 218794) |
1379 | private function obterUnidadeMapeada($numIdentificacaoDaEstrutura) | 1432 | private function obterUnidadeMapeada($numIdentificacaoDaEstrutura) |
@@ -1390,6 +1443,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1390,6 +1443,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
1390 | return $objUnidadeRN->consultarRN0125($objUnidadeDTO); | 1443 | return $objUnidadeRN->consultarRN0125($objUnidadeDTO); |
1391 | } | 1444 | } |
1392 | 1445 | ||
1446 | + | ||
1393 | /** | 1447 | /** |
1394 | * | 1448 | * |
1395 | * @return SerieDTO | 1449 | * @return SerieDTO |