Commit 85d77f48827c846d81f156e0acc22e97226c3157
1 parent
c50006ab
Exists in
master
and in
21 other branches
Reorganização dos logs dos serviços de monitoramento e processamento de pendências
Showing
11 changed files
with
645 additions
and
682 deletions
Show diff stats
PENIntegracao.php
README.md
@@ -76,10 +76,15 @@ Estes dois componentes são utilizados para gerenciar a fila de recebimento de n | @@ -76,10 +76,15 @@ Estes dois componentes são utilizados para gerenciar a fila de recebimento de n | ||
76 | directory=/opt/sei/web | 76 | directory=/opt/sei/web |
77 | user=apache | 77 | user=apache |
78 | autostart=true | 78 | autostart=true |
79 | - autorestart=true | 79 | + edutorestart=true |
80 | + startsecs=15 | ||
81 | + startretries=3 | ||
82 | + log_stdout=true | ||
80 | log_stderr=true | 83 | log_stderr=true |
81 | - stdout_logfile=/var/log/supervisor/sei-supervisord-stdout.log | ||
82 | - stderr_logfile=/var/log/supervisor/sei-supervisord-stderr.log | 84 | + logfile=/var/log/supervisor/sei_processar_pendencias.log |
85 | + logfile_maxbytes=10MB | ||
86 | + logfile_backups=50 | ||
87 | + | ||
83 | 88 | ||
84 | [program:sei_monitorar_pendencias] | 89 | [program:sei_monitorar_pendencias] |
85 | command=/usr/bin/php -c /etc/php.ini /opt/sei/web/modulos/pen/rn/PendenciasTramiteRN.php | 90 | command=/usr/bin/php -c /etc/php.ini /opt/sei/web/modulos/pen/rn/PendenciasTramiteRN.php |
@@ -88,9 +93,14 @@ Estes dois componentes são utilizados para gerenciar a fila de recebimento de n | @@ -88,9 +93,14 @@ Estes dois componentes são utilizados para gerenciar a fila de recebimento de n | ||
88 | user=apache | 93 | user=apache |
89 | autostart=true | 94 | autostart=true |
90 | autorestart=true | 95 | autorestart=true |
96 | + startsecs=15 | ||
97 | + startretries=3 | ||
98 | + log_stdout=true | ||
91 | log_stderr=true | 99 | log_stderr=true |
92 | - stdout_logfile=/var/log/supervisor/sei-supervisord-stdout.log | ||
93 | - stderr_logfile=/var/log/supervisor/sei-supervisord-stderr.log | 100 | + logfile=/var/log/supervisor/sei_monitorar_pendencias.log |
101 | + logfile_maxbytes=10MB | ||
102 | + logfile_backups=50 | ||
103 | + | ||
94 | 104 | ||
95 | 4. Configurar a tarefa de reinicialização de serviços caso se identifique possíveis indisponibilidades. | 105 | 4. Configurar a tarefa de reinicialização de serviços caso se identifique possíveis indisponibilidades. |
96 | 106 |
pen_map_unidade_cadastrar.php
1 | <?php | 1 | <?php |
2 | /** | 2 | /** |
3 | - * | 3 | + * |
4 | * @author Join Tecnologia (Thiago Farias) | 4 | * @author Join Tecnologia (Thiago Farias) |
5 | * Construção e moldura do arquivo, equivalente a exemplos já existentes no sistema. | 5 | * Construção e moldura do arquivo, equivalente a exemplos já existentes no sistema. |
6 | */ | 6 | */ |
@@ -15,24 +15,24 @@ define('PEN_PAGINA_GET_ID', 'id_unidade'); | @@ -15,24 +15,24 @@ define('PEN_PAGINA_GET_ID', 'id_unidade'); | ||
15 | 15 | ||
16 | $objPagina = PaginaSEI::getInstance(); | 16 | $objPagina = PaginaSEI::getInstance(); |
17 | $objBanco = BancoSEI::getInstance(); | 17 | $objBanco = BancoSEI::getInstance(); |
18 | -$objSessao = SessaoSEI::getInstance(); | 18 | +$objSessao = SessaoSEI::getInstance(); |
19 | 19 | ||
20 | try { | 20 | try { |
21 | 21 | ||
22 | $objBanco->abrirConexao(); | 22 | $objBanco->abrirConexao(); |
23 | - | 23 | + |
24 | $objSessao->validarLink(); | 24 | $objSessao->validarLink(); |
25 | $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | 25 | $objSessao->validarPermissao(PEN_RECURSO_ATUAL); |
26 | - | 26 | + |
27 | $arrComandos = array(); | 27 | $arrComandos = array(); |
28 | 28 | ||
29 | $bolSomenteLeitura = false; | 29 | $bolSomenteLeitura = false; |
30 | - | 30 | + |
31 | switch ($_GET['acao']) { | 31 | switch ($_GET['acao']) { |
32 | case PEN_RECURSO_BASE.'_cadastrar': | 32 | case PEN_RECURSO_BASE.'_cadastrar': |
33 | $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | 33 | $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; |
34 | - $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; | ||
35 | - | 34 | + $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; |
35 | + | ||
36 | if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | 36 | if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ |
37 | $strTitulo = sprintf('Editar %s', PEN_PAGINA_TITULO); | 37 | $strTitulo = sprintf('Editar %s', PEN_PAGINA_TITULO); |
38 | } | 38 | } |
@@ -40,32 +40,32 @@ try { | @@ -40,32 +40,32 @@ try { | ||
40 | $strTitulo = sprintf('Novo %s', PEN_PAGINA_TITULO); | 40 | $strTitulo = sprintf('Novo %s', PEN_PAGINA_TITULO); |
41 | } | 41 | } |
42 | break; | 42 | break; |
43 | - | 43 | + |
44 | case PEN_RECURSO_BASE.'_visualizar': | 44 | case PEN_RECURSO_BASE.'_visualizar': |
45 | $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar" class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';">Fechar</button>'; | 45 | $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar" class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';">Fechar</button>'; |
46 | $bolSomenteLeitura = true; | 46 | $bolSomenteLeitura = true; |
47 | - $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); | 47 | + $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); |
48 | break; | 48 | break; |
49 | - | ||
50 | - | 49 | + |
50 | + | ||
51 | default: | 51 | default: |
52 | throw new InfraException("Ação '" . $_GET['acao'] . "' não reconhecida."); | 52 | throw new InfraException("Ação '" . $_GET['acao'] . "' não reconhecida."); |
53 | - } | ||
54 | - | 53 | + } |
54 | + | ||
55 | $objPenUnidadeRN = new PenUnidadeRN(); | 55 | $objPenUnidadeRN = new PenUnidadeRN(); |
56 | - | 56 | + |
57 | //-------------------------------------------------------------------------- | 57 | //-------------------------------------------------------------------------- |
58 | // Ao por POST esta salvando o formulrio | 58 | // Ao por POST esta salvando o formulrio |
59 | if(strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { | 59 | if(strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { |
60 | - | 60 | + |
61 | if(!array_key_exists('id_unidade', $_POST) || empty($_POST['id_unidade'])) { | 61 | if(!array_key_exists('id_unidade', $_POST) || empty($_POST['id_unidade'])) { |
62 | throw new InfraException('Nenhuma "Unidade" foi selecionada'); | 62 | throw new InfraException('Nenhuma "Unidade" foi selecionada'); |
63 | } | 63 | } |
64 | - | 64 | + |
65 | if(!array_key_exists('id_unidade_rh', $_POST) || $_POST['id_unidade_rh'] === '' || $_POST['id_unidade_rh'] === null) { | 65 | if(!array_key_exists('id_unidade_rh', $_POST) || $_POST['id_unidade_rh'] === '' || $_POST['id_unidade_rh'] === null) { |
66 | throw new InfraException('Nenhuma "Unidade RH" foi selecionada'); | 66 | throw new InfraException('Nenhuma "Unidade RH" foi selecionada'); |
67 | } | 67 | } |
68 | - | 68 | + |
69 | $objGenericoBD = new GenericoBD($objBanco); | 69 | $objGenericoBD = new GenericoBD($objBanco); |
70 | $objPenUnidadeRHDTO = new PenUnidadeDTO(); | 70 | $objPenUnidadeRHDTO = new PenUnidadeDTO(); |
71 | if ($_POST['id_unidade']) { | 71 | if ($_POST['id_unidade']) { |
@@ -74,15 +74,15 @@ try { | @@ -74,15 +74,15 @@ try { | ||
74 | $objPenUnidadeRHDTO->setNumIdUnidadeRH($_POST['id_unidade_rh']); | 74 | $objPenUnidadeRHDTO->setNumIdUnidadeRH($_POST['id_unidade_rh']); |
75 | $objPenUnidadeRHDTO->retTodos(); | 75 | $objPenUnidadeRHDTO->retTodos(); |
76 | $objResultado = $objGenericoBD->listar($objPenUnidadeRHDTO); | 76 | $objResultado = $objGenericoBD->listar($objPenUnidadeRHDTO); |
77 | - | 77 | + |
78 | if (count($objResultado) > 0) { | 78 | if (count($objResultado) > 0) { |
79 | throw new InfraException('Já existe um registro com a "Unidade RH" para o código: ' .$_POST['id_unidade_rh'] ); | 79 | throw new InfraException('Já existe um registro com a "Unidade RH" para o código: ' .$_POST['id_unidade_rh'] ); |
80 | } | 80 | } |
81 | - | 81 | + |
82 | $objPenUnidadeDTO = new PenUnidadeDTO(); | 82 | $objPenUnidadeDTO = new PenUnidadeDTO(); |
83 | $objPenUnidadeDTO->setNumIdUnidade($_POST['id_unidade']); | 83 | $objPenUnidadeDTO->setNumIdUnidade($_POST['id_unidade']); |
84 | $objPenUnidadeDTO->setNumIdUnidadeRH($_POST['id_unidade_rh']); | 84 | $objPenUnidadeDTO->setNumIdUnidadeRH($_POST['id_unidade_rh']); |
85 | - | 85 | + |
86 | $numIdUnidade = 0; | 86 | $numIdUnidade = 0; |
87 | if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | 87 | if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { |
88 | $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); | 88 | $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); |
@@ -93,41 +93,41 @@ try { | @@ -93,41 +93,41 @@ try { | ||
93 | $unidade = $objPenUnidadeRN->cadastrar($objPenUnidadeDTO); | 93 | $unidade = $objPenUnidadeRN->cadastrar($objPenUnidadeDTO); |
94 | $numIdUnidade = $unidade->getNumIdUnidade(); | 94 | $numIdUnidade = $unidade->getNumIdUnidade(); |
95 | } | 95 | } |
96 | - | 96 | + |
97 | header('Location: '.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem='.$_GET['acao'].'&id_mapeamento='.$numIdUnidade.PaginaSEI::getInstance()->montarAncora($numIdUnidade))); | 97 | header('Location: '.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem='.$_GET['acao'].'&id_mapeamento='.$numIdUnidade.PaginaSEI::getInstance()->montarAncora($numIdUnidade))); |
98 | exit(0); | 98 | exit(0); |
99 | } | 99 | } |
100 | // Ao por GET + ID esta carregando o formulrio | 100 | // Ao por GET + ID esta carregando o formulrio |
101 | else if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | 101 | else if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ |
102 | - | 102 | + |
103 | $objPenUnidadeDTO = new PenUnidadeDTO(); | 103 | $objPenUnidadeDTO = new PenUnidadeDTO(); |
104 | $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); | 104 | $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); |
105 | $objPenUnidadeDTO->retTodos(); | 105 | $objPenUnidadeDTO->retTodos(); |
106 | - | 106 | + |
107 | $objEspecieDocumentalBD = new GenericoBD(BancoSEI::getInstance()); | 107 | $objEspecieDocumentalBD = new GenericoBD(BancoSEI::getInstance()); |
108 | $objPenUnidadeDTO = $objEspecieDocumentalBD->consultar($objPenUnidadeDTO); | 108 | $objPenUnidadeDTO = $objEspecieDocumentalBD->consultar($objPenUnidadeDTO); |
109 | } | 109 | } |
110 | - | 110 | + |
111 | if(empty($objPenUnidadeDTO)){ | 111 | if(empty($objPenUnidadeDTO)){ |
112 | $objPenUnidadeDTO = new PenUnidadeDTO(); | 112 | $objPenUnidadeDTO = new PenUnidadeDTO(); |
113 | $objPenUnidadeDTO->setNumIdUnidade(0); | 113 | $objPenUnidadeDTO->setNumIdUnidade(0); |
114 | $objPenUnidadeDTO->setNumIdUnidadeRH(0); | 114 | $objPenUnidadeDTO->setNumIdUnidadeRH(0); |
115 | } | 115 | } |
116 | - | 116 | + |
117 | 117 | ||
118 | if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | 118 | if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { |
119 | $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); | 119 | $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); |
120 | } | 120 | } |
121 | - | 121 | + |
122 | //Monta o select das unidades | 122 | //Monta o select das unidades |
123 | $objUnidadeDTO = new UnidadeDTO(); | 123 | $objUnidadeDTO = new UnidadeDTO(); |
124 | $arrNumIdUnidadeUsados = $objPenUnidadeRN->getIdUnidadeEmUso($objPenUnidadeDTO); | 124 | $arrNumIdUnidadeUsados = $objPenUnidadeRN->getIdUnidadeEmUso($objPenUnidadeDTO); |
125 | - | 125 | + |
126 | if(!empty($arrNumIdUnidadeUsados)) { | 126 | if(!empty($arrNumIdUnidadeUsados)) { |
127 | // Remove os que já estão em uso | 127 | // Remove os que já estão em uso |
128 | $objUnidadeDTO->setNumIdUnidade($arrNumIdUnidadeUsados, InfraDTO::$OPER_NOT_IN); | 128 | $objUnidadeDTO->setNumIdUnidade($arrNumIdUnidadeUsados, InfraDTO::$OPER_NOT_IN); |
129 | } | 129 | } |
130 | - | 130 | + |
131 | $objUnidadeDTO->retNumIdUnidade(); | 131 | $objUnidadeDTO->retNumIdUnidade(); |
132 | $objUnidadeDTO->retStrSigla(); | 132 | $objUnidadeDTO->retStrSigla(); |
133 | $objUnidadeDTO->retStrDescricao(); | 133 | $objUnidadeDTO->retStrDescricao(); |
@@ -136,8 +136,8 @@ try { | @@ -136,8 +136,8 @@ try { | ||
136 | foreach ($objPenUnidadeRN->listar($objUnidadeDTO) as $dados) { | 136 | foreach ($objPenUnidadeRN->listar($objUnidadeDTO) as $dados) { |
137 | $arrMapIdUnidade[$dados->getNumIdUnidade()] = $dados->getStrSigla() . ' - ' . $dados->getStrDescricao(); | 137 | $arrMapIdUnidade[$dados->getNumIdUnidade()] = $dados->getStrSigla() . ' - ' . $dados->getStrDescricao(); |
138 | } | 138 | } |
139 | -} | ||
140 | -catch (InfraException $e) { | 139 | +} |
140 | +catch (InfraException $e) { | ||
141 | $objPagina->processarExcecao($e); | 141 | $objPagina->processarExcecao($e); |
142 | } | 142 | } |
143 | catch(Exception $e) { | 143 | catch(Exception $e) { |
@@ -157,17 +157,17 @@ $objPagina->montarStyle(); | @@ -157,17 +157,17 @@ $objPagina->montarStyle(); | ||
157 | <style type="text/css"> | 157 | <style type="text/css"> |
158 | 158 | ||
159 | .input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | 159 | .input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} |
160 | -.input-field-first{position:absolute;left:0%;top:15%;width:25%} | 160 | +.input-field-first{position:absolute;left:0%;top:15%;width:25%} |
161 | 161 | ||
162 | .input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | 162 | .input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} |
163 | .input-field-third {position:absolute;left:0%;top:55%;width:25%;} | 163 | .input-field-third {position:absolute;left:0%;top:55%;width:25%;} |
164 | - | 164 | + |
165 | </style> | 165 | </style> |
166 | <?php $objPagina->montarJavaScript(); ?> | 166 | <?php $objPagina->montarJavaScript(); ?> |
167 | <script type="text/javascript"> | 167 | <script type="text/javascript"> |
168 | 168 | ||
169 | function inicializar(){ | 169 | function inicializar(){ |
170 | - | 170 | + |
171 | 171 | ||
172 | } | 172 | } |
173 | 173 | ||
@@ -175,20 +175,20 @@ function onSubmit() { | @@ -175,20 +175,20 @@ function onSubmit() { | ||
175 | 175 | ||
176 | var form = jQuery('#<?php print PEN_RECURSO_BASE; ?>_form'); | 176 | var form = jQuery('#<?php print PEN_RECURSO_BASE; ?>_form'); |
177 | var field = jQuery('select[name=id_unidade]', form); | 177 | var field = jQuery('select[name=id_unidade]', form); |
178 | - | 178 | + |
179 | if(field.val() === 'null' || field.val() == ''){ | 179 | if(field.val() === 'null' || field.val() == ''){ |
180 | alert('Nenhuma "Unidades - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>" foi selecionada'); | 180 | alert('Nenhuma "Unidades - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>" foi selecionada'); |
181 | field.focus(); | 181 | field.focus(); |
182 | return false; | 182 | return false; |
183 | } | 183 | } |
184 | - | 184 | + |
185 | field = jQuery('#selUnidadeRh', form); | 185 | field = jQuery('#selUnidadeRh', form); |
186 | - | 186 | + |
187 | if(field.val() === 'null' || field.val() == '' || field.val() == '0' || field.val() == 0){ | 187 | if(field.val() === 'null' || field.val() == '' || field.val() == '0' || field.val() == 0){ |
188 | alert('Nenhum "ID da Unidade - PEN" foi selecionada'); | 188 | alert('Nenhum "ID da Unidade - PEN" foi selecionada'); |
189 | field.focus(); | 189 | field.focus(); |
190 | return false; | 190 | return false; |
191 | - } | 191 | + } |
192 | } | 192 | } |
193 | 193 | ||
194 | </script> | 194 | </script> |
@@ -200,7 +200,7 @@ $objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | @@ -200,7 +200,7 @@ $objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | ||
200 | <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | 200 | <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> |
201 | <?php $objPagina->montarAreaValidacao(); ?> | 201 | <?php $objPagina->montarAreaValidacao(); ?> |
202 | <?php $objPagina->abrirAreaDados('12em'); ?> | 202 | <?php $objPagina->abrirAreaDados('12em'); ?> |
203 | - | 203 | + |
204 | <div> | 204 | <div> |
205 | <label for="id_unidade" class="infraLabelObrigatorio">Unidades - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | 205 | <label for="id_unidade" class="infraLabelObrigatorio">Unidades - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> |
206 | 206 | ||
@@ -211,9 +211,9 @@ $objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | @@ -211,9 +211,9 @@ $objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | ||
211 | 211 | ||
212 | <div class="infraAreaDados"> | 212 | <div class="infraAreaDados"> |
213 | <label for="selUnidadeRh" class="infraLabelObrigatorio">ID da Unidade - PEN:</label> <br> | 213 | <label for="selUnidadeRh" class="infraLabelObrigatorio">ID da Unidade - PEN:</label> <br> |
214 | - <input type="number" id="selUnidadeRh" value="<?php echo $objPenUnidadeDTO->getNumIdUnidadeRH(); ?>" name="id_unidade_rh" class="infraText"/> | 214 | + <input type="number" id="selUnidadeRh" value="<?= PaginaSEI::tratarHTML($objPenUnidadeDTO->getNumIdUnidadeRH()); ?>" name="id_unidade_rh" class="infraText"/> |
215 | </div> | 215 | </div> |
216 | - | 216 | + |
217 | <?php print $objPagina->fecharAreaDados(); ?> | 217 | <?php print $objPagina->fecharAreaDados(); ?> |
218 | </form> | 218 | </form> |
219 | <?php $objPagina->fecharBody(); ?> | 219 | <?php $objPagina->fecharBody(); ?> |
pen_map_unidade_listar.php
@@ -4,7 +4,7 @@ require_once dirname(__FILE__) . '/../../SEI.php'; | @@ -4,7 +4,7 @@ require_once dirname(__FILE__) . '/../../SEI.php'; | ||
4 | 4 | ||
5 | /** | 5 | /** |
6 | * Consulta os logs do estado do procedimento ao ser expedido | 6 | * Consulta os logs do estado do procedimento ao ser expedido |
7 | - * | 7 | + * |
8 | * @author Join Tecnologia | 8 | * @author Join Tecnologia |
9 | */ | 9 | */ |
10 | 10 | ||
@@ -18,104 +18,104 @@ define('PEN_PAGINA_GET_ID', 'id_unidade'); | @@ -18,104 +18,104 @@ define('PEN_PAGINA_GET_ID', 'id_unidade'); | ||
18 | 18 | ||
19 | $objPagina = PaginaSEI::getInstance(); | 19 | $objPagina = PaginaSEI::getInstance(); |
20 | $objBanco = BancoSEI::getInstance(); | 20 | $objBanco = BancoSEI::getInstance(); |
21 | -$objSessao = SessaoSEI::getInstance(); | 21 | +$objSessao = SessaoSEI::getInstance(); |
22 | $objDebug = InfraDebug::getInstance(); | 22 | $objDebug = InfraDebug::getInstance(); |
23 | - | 23 | + |
24 | 24 | ||
25 | try { | 25 | try { |
26 | - | 26 | + |
27 | $objDebug->setBolLigado(false); | 27 | $objDebug->setBolLigado(false); |
28 | $objDebug->setBolDebugInfra(true); | 28 | $objDebug->setBolDebugInfra(true); |
29 | $objDebug->limpar(); | 29 | $objDebug->limpar(); |
30 | 30 | ||
31 | $objSessao->validarLink(); | 31 | $objSessao->validarLink(); |
32 | $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | 32 | $objSessao->validarPermissao(PEN_RECURSO_ATUAL); |
33 | - | 33 | + |
34 | $objBanco->abrirConexao(); | 34 | $objBanco->abrirConexao(); |
35 | - | ||
36 | - | 35 | + |
36 | + | ||
37 | //-------------------------------------------------------------------------- | 37 | //-------------------------------------------------------------------------- |
38 | // Ações | 38 | // Ações |
39 | if(array_key_exists('acao', $_GET)) { | 39 | if(array_key_exists('acao', $_GET)) { |
40 | - | 40 | + |
41 | $arrParam = array_merge($_GET, $_POST); | 41 | $arrParam = array_merge($_GET, $_POST); |
42 | - | 42 | + |
43 | switch($_GET['acao']) { | 43 | switch($_GET['acao']) { |
44 | - | 44 | + |
45 | case PEN_RECURSO_BASE.'_excluir': | 45 | case PEN_RECURSO_BASE.'_excluir': |
46 | - | 46 | + |
47 | if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | 47 | if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { |
48 | - | 48 | + |
49 | $objPenUnidadeDTO = new PenUnidadeDTO(); | 49 | $objPenUnidadeDTO = new PenUnidadeDTO(); |
50 | $objPenUnidadeRN = new PenUnidadeRN(); | 50 | $objPenUnidadeRN = new PenUnidadeRN(); |
51 | - | 51 | + |
52 | $arrParam['hdnInfraItensSelecionados'] = explode(',',$arrParam['hdnInfraItensSelecionados']); | 52 | $arrParam['hdnInfraItensSelecionados'] = explode(',',$arrParam['hdnInfraItensSelecionados']); |
53 | - | 53 | + |
54 | if(is_array($arrParam['hdnInfraItensSelecionados'])) { | 54 | if(is_array($arrParam['hdnInfraItensSelecionados'])) { |
55 | - | 55 | + |
56 | foreach($arrParam['hdnInfraItensSelecionados'] as $NumIdUnidade) { | 56 | foreach($arrParam['hdnInfraItensSelecionados'] as $NumIdUnidade) { |
57 | - | 57 | + |
58 | $objPenUnidadeDTO->setNumIdUnidade($NumIdUnidade); | 58 | $objPenUnidadeDTO->setNumIdUnidade($NumIdUnidade); |
59 | $objPenUnidadeRN->excluir($objPenUnidadeDTO); | 59 | $objPenUnidadeRN->excluir($objPenUnidadeDTO); |
60 | } | 60 | } |
61 | } | 61 | } |
62 | else { | 62 | else { |
63 | - | 63 | + |
64 | $objPenUnidadeDTO->setNumIdUnidade($arrParam['hdnInfraItensSelecionados']); | 64 | $objPenUnidadeDTO->setNumIdUnidade($arrParam['hdnInfraItensSelecionados']); |
65 | $objPenUnidadeRN->excluir($objPenUnidadeDTO); | 65 | $objPenUnidadeRN->excluir($objPenUnidadeDTO); |
66 | } | 66 | } |
67 | - | 67 | + |
68 | $objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO); | 68 | $objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO); |
69 | - | 69 | + |
70 | header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | 70 | header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); |
71 | exit(0); | 71 | exit(0); |
72 | } | 72 | } |
73 | else { | 73 | else { |
74 | - | 74 | + |
75 | throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | 75 | throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); |
76 | } | 76 | } |
77 | break; | 77 | break; |
78 | - | 78 | + |
79 | case PEN_RECURSO_BASE.'_desativar': | 79 | case PEN_RECURSO_BASE.'_desativar': |
80 | - | 80 | + |
81 | if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | 81 | if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { |
82 | - | 82 | + |
83 | PenUnidadeRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'N'); | 83 | PenUnidadeRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'N'); |
84 | - | 84 | + |
85 | $objPagina->adicionarMensagem('Desativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | 85 | $objPagina->adicionarMensagem('Desativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); |
86 | - | 86 | + |
87 | header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | 87 | header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); |
88 | exit(0); | 88 | exit(0); |
89 | } | 89 | } |
90 | else { | 90 | else { |
91 | - | 91 | + |
92 | throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | 92 | throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); |
93 | } | 93 | } |
94 | break; | 94 | break; |
95 | - | 95 | + |
96 | case PEN_RECURSO_BASE.'_ativar': | 96 | case PEN_RECURSO_BASE.'_ativar': |
97 | if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | 97 | if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { |
98 | - | 98 | + |
99 | PenUnidadeRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'S'); | 99 | PenUnidadeRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'S'); |
100 | - | 100 | + |
101 | $objPagina->adicionarMensagem('Ativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | 101 | $objPagina->adicionarMensagem('Ativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); |
102 | - | 102 | + |
103 | header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | 103 | header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); |
104 | exit(0); | 104 | exit(0); |
105 | } | 105 | } |
106 | break; | 106 | break; |
107 | - | 107 | + |
108 | case PEN_RECURSO_BASE.'_listar': | 108 | case PEN_RECURSO_BASE.'_listar': |
109 | // Ação padrão desta tela | 109 | // Ação padrão desta tela |
110 | break; | 110 | break; |
111 | - | 111 | + |
112 | default: | 112 | default: |
113 | throw new InfraException('Ação não permitida nesta tela'); | 113 | throw new InfraException('Ação não permitida nesta tela'); |
114 | - | 114 | + |
115 | } | 115 | } |
116 | } | 116 | } |
117 | //-------------------------------------------------------------------------- | 117 | //-------------------------------------------------------------------------- |
118 | - | 118 | + |
119 | $arrComandos = array(); | 119 | $arrComandos = array(); |
120 | $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>'; | 120 | $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>'; |
121 | $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton"><span class="infraTeclaAtalho">N</span>ovo</button>'; | 121 | $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton"><span class="infraTeclaAtalho">N</span>ovo</button>'; |
@@ -131,51 +131,51 @@ try { | @@ -131,51 +131,51 @@ try { | ||
131 | $objPenUnidadeDTOFiltro->retStrDescricao(); | 131 | $objPenUnidadeDTOFiltro->retStrDescricao(); |
132 | $objPenUnidadeDTOFiltro->retNumIdUnidade(); | 132 | $objPenUnidadeDTOFiltro->retNumIdUnidade(); |
133 | $objPenUnidadeDTOFiltro->retNumIdUnidadeRH(); | 133 | $objPenUnidadeDTOFiltro->retNumIdUnidadeRH(); |
134 | - | 134 | + |
135 | //-------------------------------------------------------------------------- | 135 | //-------------------------------------------------------------------------- |
136 | - // Filtragem | 136 | + // Filtragem |
137 | if(array_key_exists('sigla', $_POST) && (!empty($_POST['sigla']) && $_POST['sigla'] !== 'null')) { | 137 | if(array_key_exists('sigla', $_POST) && (!empty($_POST['sigla']) && $_POST['sigla'] !== 'null')) { |
138 | $objPenUnidadeDTOFiltro->setStrSigla('%'.$_POST['sigla'].'%', InfraDTO::$OPER_LIKE); | 138 | $objPenUnidadeDTOFiltro->setStrSigla('%'.$_POST['sigla'].'%', InfraDTO::$OPER_LIKE); |
139 | } | 139 | } |
140 | - | 140 | + |
141 | if(array_key_exists('descricao', $_POST) && (!empty($_POST['descricao']) && $_POST['descricao'] !== 'null')) { | 141 | if(array_key_exists('descricao', $_POST) && (!empty($_POST['descricao']) && $_POST['descricao'] !== 'null')) { |
142 | $objPenUnidadeDTOFiltro->setStrDescricao('%'.$_POST['descricao'].'%', InfraDTO::$OPER_LIKE); | 142 | $objPenUnidadeDTOFiltro->setStrDescricao('%'.$_POST['descricao'].'%', InfraDTO::$OPER_LIKE); |
143 | - } | ||
144 | - | 143 | + } |
144 | + | ||
145 | $objFiltroDTO = clone $objPenUnidadeDTOFiltro; | 145 | $objFiltroDTO = clone $objPenUnidadeDTOFiltro; |
146 | - | 146 | + |
147 | if(!$objFiltroDTO->isSetStrSigla()) { | 147 | if(!$objFiltroDTO->isSetStrSigla()) { |
148 | - $objFiltroDTO->setStrSigla(''); | 148 | + $objFiltroDTO->setStrSigla(''); |
149 | } | 149 | } |
150 | 150 | ||
151 | if(!$objFiltroDTO->isSetStrDescricao()) { | 151 | if(!$objFiltroDTO->isSetStrDescricao()) { |
152 | $objFiltroDTO->setStrDescricao(''); | 152 | $objFiltroDTO->setStrDescricao(''); |
153 | } | 153 | } |
154 | - | 154 | + |
155 | //-------------------------------------------------------------------------- | 155 | //-------------------------------------------------------------------------- |
156 | $objGenericoBD = new GenericoBD($objBanco); | 156 | $objGenericoBD = new GenericoBD($objBanco); |
157 | - | 157 | + |
158 | // Unidade Local | 158 | // Unidade Local |
159 | $objPenUnidadeDTO = new PenUnidadeDTO(); | 159 | $objPenUnidadeDTO = new PenUnidadeDTO(); |
160 | $objPenUnidadeDTO->setDistinct(true); | 160 | $objPenUnidadeDTO->setDistinct(true); |
161 | $objPenUnidadeDTO->retNumIdUnidade(); | 161 | $objPenUnidadeDTO->retNumIdUnidade(); |
162 | $objPenUnidadeDTO->retNumIdUnidadeRH(); | 162 | $objPenUnidadeDTO->retNumIdUnidadeRH(); |
163 | - | 163 | + |
164 | $objPenUnidadeRN = new PenUnidadeRN(); | 164 | $objPenUnidadeRN = new PenUnidadeRN(); |
165 | $objArrPenUnidadeDTO = $objPenUnidadeRN->listar($objPenUnidadeDTO); | 165 | $objArrPenUnidadeDTO = $objPenUnidadeRN->listar($objPenUnidadeDTO); |
166 | $arrMapIdUnidade = InfraArray::converterArrInfraDTO($objArrPenUnidadeDTO, 'IdUnidade', 'IdUnidade'); | 166 | $arrMapIdUnidade = InfraArray::converterArrInfraDTO($objArrPenUnidadeDTO, 'IdUnidade', 'IdUnidade'); |
167 | $arrMapIdUnidadeRH = InfraArray::converterArrInfraDTO($objArrPenUnidadeDTO, 'IdUnidadeRH', 'IdUnidadeRH'); | 167 | $arrMapIdUnidadeRH = InfraArray::converterArrInfraDTO($objArrPenUnidadeDTO, 'IdUnidadeRH', 'IdUnidadeRH'); |
168 | - | ||
169 | - $objPagina->prepararOrdenacao($objPenUnidadeDTOFiltro, 'IdUnidade', InfraDTO::$TIPO_ORDENACAO_ASC); | 168 | + |
169 | + $objPagina->prepararOrdenacao($objPenUnidadeDTOFiltro, 'IdUnidade', InfraDTO::$TIPO_ORDENACAO_ASC); | ||
170 | $objPagina->prepararPaginacao($objPenUnidadeDTOFiltro); | 170 | $objPagina->prepararPaginacao($objPenUnidadeDTOFiltro); |
171 | $arrObjPenUnidadeDTO = $objGenericoBD->listar($objPenUnidadeDTOFiltro); | 171 | $arrObjPenUnidadeDTO = $objGenericoBD->listar($objPenUnidadeDTOFiltro); |
172 | $objPagina->processarPaginacao($objPenUnidadeDTOFiltro); | 172 | $objPagina->processarPaginacao($objPenUnidadeDTOFiltro); |
173 | - | 173 | + |
174 | $numRegistros = count($arrObjPenUnidadeDTO); | 174 | $numRegistros = count($arrObjPenUnidadeDTO); |
175 | if(!empty($arrObjPenUnidadeDTO)){ | 175 | if(!empty($arrObjPenUnidadeDTO)){ |
176 | - | 176 | + |
177 | $strResultado = ''; | 177 | $strResultado = ''; |
178 | - | 178 | + |
179 | $strResultado .= '<table width="99%" class="infraTable">'."\n"; | 179 | $strResultado .= '<table width="99%" class="infraTable">'."\n"; |
180 | $strResultado .= '<caption class="infraCaption">'.$objPagina->gerarCaptionTabela(PEN_PAGINA_TITULO, $numRegistros).'</caption>'; | 180 | $strResultado .= '<caption class="infraCaption">'.$objPagina->gerarCaptionTabela(PEN_PAGINA_TITULO, $numRegistros).'</caption>'; |
181 | 181 | ||
@@ -190,10 +190,10 @@ try { | @@ -190,10 +190,10 @@ try { | ||
190 | $strCssTr = ''; | 190 | $strCssTr = ''; |
191 | 191 | ||
192 | $index = 0; | 192 | $index = 0; |
193 | - | 193 | + |
194 | foreach($arrObjPenUnidadeDTO as $objPenUnidadeDTO) { | 194 | foreach($arrObjPenUnidadeDTO as $objPenUnidadeDTO) { |
195 | $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; | 195 | $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; |
196 | - | 196 | + |
197 | $strResultado .= '<tr class="'.$strCssTr.'">'; | 197 | $strResultado .= '<tr class="'.$strCssTr.'">'; |
198 | $strResultado .= '<td>'.$objPagina->getTrCheck($index, $objPenUnidadeDTO->getNumIdUnidade(), '').'</td>'; | 198 | $strResultado .= '<td>'.$objPagina->getTrCheck($index, $objPenUnidadeDTO->getNumIdUnidade(), '').'</td>'; |
199 | $strResultado .= '<td>'.$objPenUnidadeDTO->getNumIdUnidade().'</td>'; | 199 | $strResultado .= '<td>'.$objPenUnidadeDTO->getNumIdUnidade().'</td>'; |
@@ -201,16 +201,16 @@ try { | @@ -201,16 +201,16 @@ try { | ||
201 | $strResultado .= '<td>'.$objPenUnidadeDTO->getStrSigla().'</td>'; | 201 | $strResultado .= '<td>'.$objPenUnidadeDTO->getStrSigla().'</td>'; |
202 | $strResultado .= '<td>'.$objPenUnidadeDTO->getStrDescricao().'</td>'; | 202 | $strResultado .= '<td>'.$objPenUnidadeDTO->getStrDescricao().'</td>'; |
203 | $strResultado .= '<td align="center">'; | 203 | $strResultado .= '<td align="center">'; |
204 | - | 204 | + |
205 | //$strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_visualizar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenUnidadeDTO->getNumIdUnidade()).'"><img src="imagens/consultar.gif" title="Consultar Mapeamento" alt="Consultar Mapeamento" class="infraImg"></a>'; | 205 | //$strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_visualizar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenUnidadeDTO->getNumIdUnidade()).'"><img src="imagens/consultar.gif" title="Consultar Mapeamento" alt="Consultar Mapeamento" class="infraImg"></a>'; |
206 | if($objSessao->verificarPermissao('pen_map_unidade_alterar')) { | 206 | if($objSessao->verificarPermissao('pen_map_unidade_alterar')) { |
207 | $strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenUnidadeDTO->getNumIdUnidade()).'"><img src="imagens/alterar.gif" title="Alterar Mapeamento" alt="Alterar Mapeamento" class="infraImg"></a>'; | 207 | $strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenUnidadeDTO->getNumIdUnidade()).'"><img src="imagens/alterar.gif" title="Alterar Mapeamento" alt="Alterar Mapeamento" class="infraImg"></a>'; |
208 | } | 208 | } |
209 | - | 209 | + |
210 | if($objSessao->verificarPermissao('pen_map_unidade_excluir')) { | 210 | if($objSessao->verificarPermissao('pen_map_unidade_excluir')) { |
211 | $strResultado .= '<a href="#" onclick="onCLickLinkDelete(\''.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&hdnInfraItensSelecionados='.$objPenUnidadeDTO->getNumIdUnidade()).'\', this)"><img src="imagens/excluir.gif" title="Excluir Mapeamento" alt="Excluir Mapeamento" class="infraImg"></a>'; | 211 | $strResultado .= '<a href="#" onclick="onCLickLinkDelete(\''.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&hdnInfraItensSelecionados='.$objPenUnidadeDTO->getNumIdUnidade()).'\', this)"><img src="imagens/excluir.gif" title="Excluir Mapeamento" alt="Excluir Mapeamento" class="infraImg"></a>'; |
212 | } | 212 | } |
213 | - | 213 | + |
214 | $strResultado .= '</td>'; | 214 | $strResultado .= '</td>'; |
215 | $strResultado .= '</tr>'."\n"; | 215 | $strResultado .= '</tr>'."\n"; |
216 | 216 | ||
@@ -220,13 +220,13 @@ try { | @@ -220,13 +220,13 @@ try { | ||
220 | } | 220 | } |
221 | } | 221 | } |
222 | catch(InfraException $e){ | 222 | catch(InfraException $e){ |
223 | - | 223 | + |
224 | print '<pre>'; | 224 | print '<pre>'; |
225 | print_r($e); | 225 | print_r($e); |
226 | print '</pre>'; | 226 | print '</pre>'; |
227 | exit(0); | 227 | exit(0); |
228 | //$objPagina->processarExcecao($e); | 228 | //$objPagina->processarExcecao($e); |
229 | -} | 229 | +} |
230 | 230 | ||
231 | 231 | ||
232 | $objPagina->montarDocType(); | 232 | $objPagina->montarDocType(); |
@@ -239,7 +239,7 @@ $objPagina->montarStyle(); | @@ -239,7 +239,7 @@ $objPagina->montarStyle(); | ||
239 | <style type="text/css"> | 239 | <style type="text/css"> |
240 | 240 | ||
241 | .input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | 241 | .input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} |
242 | -.input-field-first{position:absolute;left:0%;top:50%;width:25%} | 242 | +.input-field-first{position:absolute;left:0%;top:50%;width:25%} |
243 | 243 | ||
244 | .input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} | 244 | .input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} |
245 | .input-field-second{position:absolute;left:30%;top:50%;width:25%;} | 245 | .input-field-second{position:absolute;left:30%;top:50%;width:25%;} |
@@ -250,7 +250,7 @@ $objPagina->montarStyle(); | @@ -250,7 +250,7 @@ $objPagina->montarStyle(); | ||
250 | </style> | 250 | </style> |
251 | <?php $objPagina->montarJavaScript(); ?> | 251 | <?php $objPagina->montarJavaScript(); ?> |
252 | <script type="text/javascript"> | 252 | <script type="text/javascript"> |
253 | - | 253 | + |
254 | function inicializar(){ | 254 | function inicializar(){ |
255 | 255 | ||
256 | infraEfeitoTabelas(); | 256 | infraEfeitoTabelas(); |
@@ -271,61 +271,61 @@ function tratarEnter(ev){ | @@ -271,61 +271,61 @@ function tratarEnter(ev){ | ||
271 | } | 271 | } |
272 | 272 | ||
273 | function onCLickLinkDelete(url, link) { | 273 | function onCLickLinkDelete(url, link) { |
274 | - | 274 | + |
275 | var row = jQuery(link).parents('tr:first'); | 275 | var row = jQuery(link).parents('tr:first'); |
276 | - | 276 | + |
277 | var strEspecieDocumental = row.find('td:eq(1)').text(); | 277 | var strEspecieDocumental = row.find('td:eq(1)').text(); |
278 | var strTipoDocumento = row.find('td:eq(2)').text(); | 278 | var strTipoDocumento = row.find('td:eq(2)').text(); |
279 | - | 279 | + |
280 | if(confirm('Confirma a exclusão do mapeamento da unidade?')){ | 280 | if(confirm('Confirma a exclusão do mapeamento da unidade?')){ |
281 | - | 281 | + |
282 | window.location = url; | 282 | window.location = url; |
283 | } | 283 | } |
284 | - | 284 | + |
285 | } | 285 | } |
286 | 286 | ||
287 | function onClickBtnNovo(){ | 287 | function onClickBtnNovo(){ |
288 | - | 288 | + |
289 | window.location = '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_origem']); ?>'; | 289 | window.location = '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_origem']); ?>'; |
290 | } | 290 | } |
291 | 291 | ||
292 | function onClickBtnAtivar(){ | 292 | function onClickBtnAtivar(){ |
293 | - | 293 | + |
294 | try { | 294 | try { |
295 | - | 295 | + |
296 | var form = jQuery('#frmAcompanharEstadoProcesso'); | 296 | var form = jQuery('#frmAcompanharEstadoProcesso'); |
297 | form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_ativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | 297 | form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_ativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); |
298 | form.submit(); | 298 | form.submit(); |
299 | } | 299 | } |
300 | catch(e){ | 300 | catch(e){ |
301 | - | 301 | + |
302 | alert('Erro : ' + e.message); | 302 | alert('Erro : ' + e.message); |
303 | - } | ||
304 | - | 303 | + } |
304 | + | ||
305 | } | 305 | } |
306 | 306 | ||
307 | function onClickBtnDesativar(){ | 307 | function onClickBtnDesativar(){ |
308 | - | 308 | + |
309 | try { | 309 | try { |
310 | - | 310 | + |
311 | var form = jQuery('#frmAcompanharEstadoProcesso'); | 311 | var form = jQuery('#frmAcompanharEstadoProcesso'); |
312 | form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_desativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | 312 | form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_desativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); |
313 | form.submit(); | 313 | form.submit(); |
314 | } | 314 | } |
315 | catch(e){ | 315 | catch(e){ |
316 | - | 316 | + |
317 | alert('Erro : ' + e.message); | 317 | alert('Erro : ' + e.message); |
318 | } | 318 | } |
319 | } | 319 | } |
320 | 320 | ||
321 | function onClickBtnExcluir(){ | 321 | function onClickBtnExcluir(){ |
322 | - | 322 | + |
323 | try { | 323 | try { |
324 | - | 324 | + |
325 | var len = jQuery('input[name*=chkInfraItem]:checked').length; | 325 | var len = jQuery('input[name*=chkInfraItem]:checked').length; |
326 | - | 326 | + |
327 | if(len > 0){ | 327 | if(len > 0){ |
328 | - | 328 | + |
329 | if(confirm('Confirma a exclusão de ' + len + ' mapeamento(s) ?')) { | 329 | if(confirm('Confirma a exclusão de ' + len + ' mapeamento(s) ?')) { |
330 | var form = jQuery('#frmAcompanharEstadoProcesso'); | 330 | var form = jQuery('#frmAcompanharEstadoProcesso'); |
331 | form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | 331 | form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); |
@@ -333,12 +333,12 @@ function onClickBtnExcluir(){ | @@ -333,12 +333,12 @@ function onClickBtnExcluir(){ | ||
333 | } | 333 | } |
334 | } | 334 | } |
335 | else { | 335 | else { |
336 | - | 336 | + |
337 | alert('Selecione pelo menos um mapeamento para Excluir'); | 337 | alert('Selecione pelo menos um mapeamento para Excluir'); |
338 | } | 338 | } |
339 | } | 339 | } |
340 | catch(e){ | 340 | catch(e){ |
341 | - | 341 | + |
342 | alert('Erro : ' + e.message); | 342 | alert('Erro : ' + e.message); |
343 | } | 343 | } |
344 | } | 344 | } |
@@ -349,20 +349,19 @@ $objPagina->fecharHead(); | @@ -349,20 +349,19 @@ $objPagina->fecharHead(); | ||
349 | $objPagina->abrirBody(PEN_PAGINA_TITULO,'onload="inicializar();"'); | 349 | $objPagina->abrirBody(PEN_PAGINA_TITULO,'onload="inicializar();"'); |
350 | ?> | 350 | ?> |
351 | <form id="frmAcompanharEstadoProcesso" method="post" action="<?php// print $objSessao->assinarLink($strProprioLink); ?>"> | 351 | <form id="frmAcompanharEstadoProcesso" method="post" action="<?php// print $objSessao->assinarLink($strProprioLink); ?>"> |
352 | - | 352 | + |
353 | <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | 353 | <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> |
354 | <?php //$objPagina->montarAreaValidacao(); ?> | 354 | <?php //$objPagina->montarAreaValidacao(); ?> |
355 | <?php $objPagina->abrirAreaDados('40px'); ?> | 355 | <?php $objPagina->abrirAreaDados('40px'); ?> |
356 | - | 356 | + |
357 | <label for="sigla" class="infraLabelObrigatorio input-label-first">Sigla:</label> | 357 | <label for="sigla" class="infraLabelObrigatorio input-label-first">Sigla:</label> |
358 | - <input type="text" class="input-field-first" name="sigla" value="<?php echo (isset($_POST['sigla']) ? $_POST['sigla'] : ''); ?>"> | ||
359 | - | 358 | + <input type="text" class="input-field-first" name="sigla" value="<?= PaginaSEI::tratarHTML(isset($_POST['sigla']) ? $_POST['sigla'] : ''); ?>"> |
359 | + | ||
360 | <label for="descricao" class="infraLabelObrigatorio input-label-second">Descrição:</label> | 360 | <label for="descricao" class="infraLabelObrigatorio input-label-second">Descrição:</label> |
361 | - <input type="text" class="input-field-second" name="descricao" value="<?php echo (isset($_POST['descricao']) ? $_POST['descricao'] : ''); ?>"> | ||
362 | - | ||
363 | - | 361 | + <input type="text" class="input-field-second" name="descricao" value="<?= PaginaSEI::tratarHTML(isset($_POST['descricao']) ? $_POST['descricao'] : ''); ?>"> |
362 | + | ||
364 | <?php $objPagina->fecharAreaDados(); ?> | 363 | <?php $objPagina->fecharAreaDados(); ?> |
365 | - | 364 | + |
366 | <?php if($numRegistros > 0): ?> | 365 | <?php if($numRegistros > 0): ?> |
367 | <?php $objPagina->montarAreaTabela($strResultado, $numRegistros); ?> | 366 | <?php $objPagina->montarAreaTabela($strResultado, $numRegistros); ?> |
368 | <?php //$objPagina->montarAreaDebug(); ?> | 367 | <?php //$objPagina->montarAreaDebug(); ?> |
pen_parametros_configuracao.php
@@ -4,27 +4,27 @@ | @@ -4,27 +4,27 @@ | ||
4 | */ | 4 | */ |
5 | try { | 5 | try { |
6 | require_once dirname(__FILE__) . '/../../SEI.php'; | 6 | require_once dirname(__FILE__) . '/../../SEI.php'; |
7 | - | 7 | + |
8 | session_start(); | 8 | session_start(); |
9 | - | 9 | + |
10 | define('PEN_RECURSO_ATUAL', 'pen_parametros_configuracao'); | 10 | define('PEN_RECURSO_ATUAL', 'pen_parametros_configuracao'); |
11 | define('PEN_PAGINA_TITULO', 'Parâmetros de Configuração do Módulo de Tramitações PEN'); | 11 | define('PEN_PAGINA_TITULO', 'Parâmetros de Configuração do Módulo de Tramitações PEN'); |
12 | 12 | ||
13 | $objPagina = PaginaSEI::getInstance(); | 13 | $objPagina = PaginaSEI::getInstance(); |
14 | $objBanco = BancoSEI::getInstance(); | 14 | $objBanco = BancoSEI::getInstance(); |
15 | $objSessao = SessaoSEI::getInstance(); | 15 | $objSessao = SessaoSEI::getInstance(); |
16 | - | ||
17 | - | 16 | + |
17 | + | ||
18 | $o = new PenRelHipoteseLegalEnvioRN(); | 18 | $o = new PenRelHipoteseLegalEnvioRN(); |
19 | $os = new PenRelHipoteseLegalRecebidoRN(); | 19 | $os = new PenRelHipoteseLegalRecebidoRN(); |
20 | - | 20 | + |
21 | $objSessao->validarPermissao('pen_parametros_configuracao'); | 21 | $objSessao->validarPermissao('pen_parametros_configuracao'); |
22 | - | 22 | + |
23 | $objPenParametroDTO = new PenParametroDTO(); | 23 | $objPenParametroDTO = new PenParametroDTO(); |
24 | $objPenParametroDTO->retTodos(); | 24 | $objPenParametroDTO->retTodos(); |
25 | $objPenParametroRN = new PenParametroRN(); | 25 | $objPenParametroRN = new PenParametroRN(); |
26 | $retParametros = $objPenParametroRN->listar($objPenParametroDTO); | 26 | $retParametros = $objPenParametroRN->listar($objPenParametroDTO); |
27 | - | 27 | + |
28 | /* Busca os dados para montar dropdown ( TIPO DE PROCESSO EXTERNO ) */ | 28 | /* Busca os dados para montar dropdown ( TIPO DE PROCESSO EXTERNO ) */ |
29 | $objTipoProcedimentoDTO = new TipoProcedimentoDTO(); | 29 | $objTipoProcedimentoDTO = new TipoProcedimentoDTO(); |
30 | $objTipoProcedimentoDTO->retNumIdTipoProcedimento(); | 30 | $objTipoProcedimentoDTO->retNumIdTipoProcedimento(); |
@@ -32,7 +32,7 @@ try { | @@ -32,7 +32,7 @@ try { | ||
32 | $objTipoProcedimentoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | 32 | $objTipoProcedimentoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); |
33 | $objTipoProcedimentoRN = new TipoProcedimentoRN(); | 33 | $objTipoProcedimentoRN = new TipoProcedimentoRN(); |
34 | $arrObjTipoProcedimentoDTO = $objTipoProcedimentoRN->listarRN0244($objTipoProcedimentoDTO); | 34 | $arrObjTipoProcedimentoDTO = $objTipoProcedimentoRN->listarRN0244($objTipoProcedimentoDTO); |
35 | - | 35 | + |
36 | /* Busca os dados para montar dropdown ( UNIDADE GERADORA DOCUMENTO RECEBIDO ) */ | 36 | /* Busca os dados para montar dropdown ( UNIDADE GERADORA DOCUMENTO RECEBIDO ) */ |
37 | $objUnidadeDTO = new UnidadeDTO(); | 37 | $objUnidadeDTO = new UnidadeDTO(); |
38 | $objUnidadeDTO->retNumIdUnidade(); | 38 | $objUnidadeDTO->retNumIdUnidade(); |
@@ -40,29 +40,29 @@ try { | @@ -40,29 +40,29 @@ try { | ||
40 | $objUnidadeDTO->setOrdStrSigla(InfraDTO::$TIPO_ORDENACAO_ASC); | 40 | $objUnidadeDTO->setOrdStrSigla(InfraDTO::$TIPO_ORDENACAO_ASC); |
41 | $objUnidadeRN = new UnidadeRN(); | 41 | $objUnidadeRN = new UnidadeRN(); |
42 | $arrObjUnidade = $objUnidadeRN->listarRN0127($objUnidadeDTO); | 42 | $arrObjUnidade = $objUnidadeRN->listarRN0127($objUnidadeDTO); |
43 | - | 43 | + |
44 | if ($objPenParametroDTO===null){ | 44 | if ($objPenParametroDTO===null){ |
45 | throw new PENException("Registros não encontrados."); | 45 | throw new PENException("Registros não encontrados."); |
46 | } | 46 | } |
47 | - | 47 | + |
48 | switch ($_GET['acao']) { | 48 | switch ($_GET['acao']) { |
49 | case 'pen_parametros_configuracao_salvar': | 49 | case 'pen_parametros_configuracao_salvar': |
50 | try { | 50 | try { |
51 | $objPenParametroRN = new PenParametroRN(); | 51 | $objPenParametroRN = new PenParametroRN(); |
52 | - | 52 | + |
53 | if (!empty(count($_POST['parametro']))) { | 53 | if (!empty(count($_POST['parametro']))) { |
54 | foreach ($_POST['parametro'] as $nome => $valor) { | 54 | foreach ($_POST['parametro'] as $nome => $valor) { |
55 | $objPenParametroDTO = new PenParametroDTO(); | 55 | $objPenParametroDTO = new PenParametroDTO(); |
56 | $objPenParametroDTO->setStrNome($nome); | 56 | $objPenParametroDTO->setStrNome($nome); |
57 | $objPenParametroDTO->retStrNome(); | 57 | $objPenParametroDTO->retStrNome(); |
58 | - | 58 | + |
59 | if($objPenParametroRN->contar($objPenParametroDTO) > 0) { | 59 | if($objPenParametroRN->contar($objPenParametroDTO) > 0) { |
60 | $objPenParametroDTO->setStrValor($valor); | 60 | $objPenParametroDTO->setStrValor($valor); |
61 | $objPenParametroRN->alterar($objPenParametroDTO); | 61 | $objPenParametroRN->alterar($objPenParametroDTO); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | } | 64 | } |
65 | - | 65 | + |
66 | } catch (Exception $e) { | 66 | } catch (Exception $e) { |
67 | $objPagina->processarExcecao($e); | 67 | $objPagina->processarExcecao($e); |
68 | } | 68 | } |
@@ -85,7 +85,7 @@ try { | @@ -85,7 +85,7 @@ try { | ||
85 | if ($objSessao->verificarPermissao('pen_parametros_configuracao_alterar')) { | 85 | if ($objSessao->verificarPermissao('pen_parametros_configuracao_alterar')) { |
86 | $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | 86 | $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; |
87 | } | 87 | } |
88 | -$arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao=pen_parametros_configuracao&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; | 88 | +$arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao=pen_parametros_configuracao&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; |
89 | 89 | ||
90 | $objPagina->montarDocType(); | 90 | $objPagina->montarDocType(); |
91 | $objPagina->abrirHtml(); | 91 | $objPagina->abrirHtml(); |
@@ -133,32 +133,32 @@ $objPagina->abrirBody($strTitulo, 'onload="inicializar();"'); | @@ -133,32 +133,32 @@ $objPagina->abrirBody($strTitulo, 'onload="inicializar();"'); | ||
133 | <? | 133 | <? |
134 | $objPagina->montarBarraComandosSuperior($arrComandos); | 134 | $objPagina->montarBarraComandosSuperior($arrComandos); |
135 | foreach ($retParametros as $parametro) { | 135 | foreach ($retParametros as $parametro) { |
136 | - | 136 | + |
137 | //Esse parâmetro não aparece, por já existencia de uma tela só para alteração do próprio. | 137 | //Esse parâmetro não aparece, por já existencia de uma tela só para alteração do próprio. |
138 | if ($parametro->getStrNome() != 'HIPOTESE_LEGAL_PADRAO') { | 138 | if ($parametro->getStrNome() != 'HIPOTESE_LEGAL_PADRAO') { |
139 | //Constroi o label | 139 | //Constroi o label |
140 | - ?> <label id="lbl<?php echo $parametro->getStrNome(); ?>" for="txt<?php echo $parametro->getStrNome(); ?>" accesskey="N" class="infraLabelObrigatorio"><?php echo $parametro->getStrDescricao(); ?>:</label><br> <?php | 140 | + ?> <label id="lbl<?= PaginaSEI::tratarHTML($parametro->getStrNome()); ?>" for="txt<?= PaginaSEI::tratarHTML($parametro->getStrNome()); ?>" accesskey="N" class="infraLabelObrigatorio"><?= PaginaSEI::tratarHTML($parametro->getStrDescricao()); ?>:</label><br> <?php |
141 | } | 141 | } |
142 | - | 142 | + |
143 | //Constroi o campo de valor | 143 | //Constroi o campo de valor |
144 | switch ($parametro->getStrNome()) { | 144 | switch ($parametro->getStrNome()) { |
145 | - | 145 | + |
146 | //Esse parâmetro não aparece, por já existencia de uma tela só para alteração do próprio. | 146 | //Esse parâmetro não aparece, por já existencia de uma tela só para alteração do próprio. |
147 | case 'HIPOTESE_LEGAL_PADRAO': | 147 | case 'HIPOTESE_LEGAL_PADRAO': |
148 | echo ''; | 148 | echo ''; |
149 | break; | 149 | break; |
150 | - | 150 | + |
151 | case 'PEN_SENHA_CERTIFICADO_DIGITAL': | 151 | case 'PEN_SENHA_CERTIFICADO_DIGITAL': |
152 | echo '<input type="password" id="PARAMETRO_'.$parametro->getStrNome().'" name="parametro['.$parametro->getStrNome().']" class="infraText input-field-input" value="'.$objPagina->tratarHTML($parametro->getStrValor()).'" onkeypress="return infraMascaraTexto(this,event);" tabindex="'.$objPagina->getProxTabDados().'" maxlength="100" /><br>'; | 152 | echo '<input type="password" id="PARAMETRO_'.$parametro->getStrNome().'" name="parametro['.$parametro->getStrNome().']" class="infraText input-field-input" value="'.$objPagina->tratarHTML($parametro->getStrValor()).'" onkeypress="return infraMascaraTexto(this,event);" tabindex="'.$objPagina->getProxTabDados().'" maxlength="100" /><br>'; |
153 | break; | 153 | break; |
154 | - | 154 | + |
155 | case 'PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO': | 155 | case 'PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO': |
156 | echo '<select id="PARAMETRO_PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO" name="parametro[PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO]" class="input-field" >'; | 156 | echo '<select id="PARAMETRO_PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO" name="parametro[PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO]" class="input-field" >'; |
157 | echo ' <option value="S" ' . ($parametro->getStrValor() == 'S' ? 'selected="selected"' : '') . '>Sim</option>'; | 157 | echo ' <option value="S" ' . ($parametro->getStrValor() == 'S' ? 'selected="selected"' : '') . '>Sim</option>'; |
158 | echo ' <option value="N" ' . ($parametro->getStrValor() == 'N' ? 'selected="selected"' : '') . '>Não</option>'; | 158 | echo ' <option value="N" ' . ($parametro->getStrValor() == 'N' ? 'selected="selected"' : '') . '>Não</option>'; |
159 | echo '<select>'; | 159 | echo '<select>'; |
160 | break; | 160 | break; |
161 | - | 161 | + |
162 | case 'PEN_TIPO_PROCESSO_EXTERNO': | 162 | case 'PEN_TIPO_PROCESSO_EXTERNO': |
163 | echo '<select name="parametro[PEN_TIPO_PROCESSO_EXTERNO]" class="input-field" >'; | 163 | echo '<select name="parametro[PEN_TIPO_PROCESSO_EXTERNO]" class="input-field" >'; |
164 | foreach ($arrObjTipoProcedimentoDTO as $procedimento) { | 164 | foreach ($arrObjTipoProcedimentoDTO as $procedimento) { |
@@ -166,7 +166,7 @@ $objPagina->abrirBody($strTitulo, 'onload="inicializar();"'); | @@ -166,7 +166,7 @@ $objPagina->abrirBody($strTitulo, 'onload="inicializar();"'); | ||
166 | } | 166 | } |
167 | echo '<select>'; | 167 | echo '<select>'; |
168 | break; | 168 | break; |
169 | - | 169 | + |
170 | case 'PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO': | 170 | case 'PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO': |
171 | echo '<select name="parametro[PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO]" class="input-field" >'; | 171 | echo '<select name="parametro[PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO]" class="input-field" >'; |
172 | foreach ($arrObjUnidade as $unidade) { | 172 | foreach ($arrObjUnidade as $unidade) { |
@@ -187,4 +187,4 @@ $objPagina->abrirBody($strTitulo, 'onload="inicializar();"'); | @@ -187,4 +187,4 @@ $objPagina->abrirBody($strTitulo, 'onload="inicializar();"'); | ||
187 | <? | 187 | <? |
188 | $objPagina->fecharBody(); | 188 | $objPagina->fecharBody(); |
189 | $objPagina->fecharHtml(); | 189 | $objPagina->fecharHtml(); |
190 | -?> | ||
191 | \ No newline at end of file | 190 | \ No newline at end of file |
191 | +?> |
rn/ExpedirProcedimentoRN.php
1 | <?php | 1 | <?php |
2 | - | 2 | + |
3 | require_once dirname(__FILE__) . '/../../../SEI.php'; | 3 | require_once dirname(__FILE__) . '/../../../SEI.php'; |
4 | 4 | ||
5 | class ExpedirProcedimentoRN extends InfraRN { | 5 | class ExpedirProcedimentoRN extends InfraRN { |
@@ -27,10 +27,10 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -27,10 +27,10 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
27 | const TC_TIPO_CONTEUDO_OUTROS = 'out'; | 27 | const TC_TIPO_CONTEUDO_OUTROS = 'out'; |
28 | 28 | ||
29 | //TODO: Alterar codificao do SEI para reconhecer esse novo estado do processo | 29 | //TODO: Alterar codificao do SEI para reconhecer esse novo estado do processo |
30 | - //Esse estado ser utilizado juntamente com os estados da expedio | 30 | + //Esse estado ser utilizado juntamente com os estados da expedio |
31 | const TE_PROCEDIMENTO_BLOQUEADO = '4'; | 31 | const TE_PROCEDIMENTO_BLOQUEADO = '4'; |
32 | const TE_PROCEDIMENTO_EM_PROCESSAMENTO = '5'; | 32 | const TE_PROCEDIMENTO_EM_PROCESSAMENTO = '5'; |
33 | - | 33 | + |
34 | //Verso com mudana na API relacionada obrigatoriedade do carimbo de publicao | 34 | //Verso com mudana na API relacionada obrigatoriedade do carimbo de publicao |
35 | const VERSAO_CARIMBO_PUBLICACAO_OBRIGATORIO = '3.0.7'; | 35 | const VERSAO_CARIMBO_PUBLICACAO_OBRIGATORIO = '3.0.7'; |
36 | 36 | ||
@@ -73,14 +73,14 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -73,14 +73,14 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
73 | "video/ogg", | 73 | "video/ogg", |
74 | "video/webm" | 74 | "video/webm" |
75 | ); | 75 | ); |
76 | - | 76 | + |
77 | public function __construct() { | 77 | public function __construct() { |
78 | parent::__construct(); | 78 | parent::__construct(); |
79 | 79 | ||
80 | //TODO: Remover criao de objetos de negcio no construtor da classe para evitar problemas de performance desnecessrios | 80 | //TODO: Remover criao de objetos de negcio no construtor da classe para evitar problemas de performance desnecessrios |
81 | $this->objProcessoEletronicoRN = new ProcessoEletronicoRN(); | 81 | $this->objProcessoEletronicoRN = new ProcessoEletronicoRN(); |
82 | $this->objParticipanteRN = new ParticipanteRN(); | 82 | $this->objParticipanteRN = new ParticipanteRN(); |
83 | - $this->objProcedimentoRN = new ProcedimentoRN(); | 83 | + $this->objProcedimentoRN = new ProcedimentoRN(); |
84 | $this->objProtocoloRN = new ProtocoloRN(); | 84 | $this->objProtocoloRN = new ProtocoloRN(); |
85 | $this->objDocumentoRN = new DocumentoRN(); | 85 | $this->objDocumentoRN = new DocumentoRN(); |
86 | $this->objAtividadeRN = new AtividadeRN(); | 86 | $this->objAtividadeRN = new AtividadeRN(); |
@@ -96,14 +96,14 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -96,14 +96,14 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
96 | $this->barraProgresso->setNumMax(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_CONCLUSAO); | 96 | $this->barraProgresso->setNumMax(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_CONCLUSAO); |
97 | } | 97 | } |
98 | 98 | ||
99 | - protected function inicializarObjInfraIBanco() | 99 | + protected function inicializarObjInfraIBanco() |
100 | { | 100 | { |
101 | return BancoSEI::getInstance(); | 101 | return BancoSEI::getInstance(); |
102 | } | 102 | } |
103 | 103 | ||
104 | - public function listarRepositoriosDeEstruturas() | 104 | + public function listarRepositoriosDeEstruturas() |
105 | { | 105 | { |
106 | - $dadosArray = array(); | 106 | + $dadosArray = array(); |
107 | $arrObjRepositorioDTO = $this->objProcessoEletronicoRN->listarRepositoriosDeEstruturas(); | 107 | $arrObjRepositorioDTO = $this->objProcessoEletronicoRN->listarRepositoriosDeEstruturas(); |
108 | foreach ($arrObjRepositorioDTO as $repositorio) { | 108 | foreach ($arrObjRepositorioDTO as $repositorio) { |
109 | $dadosArray[$repositorio->getNumId()] = $repositorio->getStrNome(); | 109 | $dadosArray[$repositorio->getNumId()] = $repositorio->getStrNome(); |
@@ -118,10 +118,10 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -118,10 +118,10 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
118 | } | 118 | } |
119 | 119 | ||
120 | public function expedirProcedimentoControlado(ExpedirProcedimentoDTO $objExpedirProcedimentoDTO) { | 120 | public function expedirProcedimentoControlado(ExpedirProcedimentoDTO $objExpedirProcedimentoDTO) { |
121 | - | 121 | + |
122 | $numIdTramite = 0; | 122 | $numIdTramite = 0; |
123 | - | ||
124 | - try { | 123 | + |
124 | + try { | ||
125 | //Valida Permissão | 125 | //Valida Permissão |
126 | SessaoSEI::getInstance()->validarAuditarPermissao('pen_procedimento_expedir',__METHOD__, $objExpedirProcedimentoDTO); | 126 | SessaoSEI::getInstance()->validarAuditarPermissao('pen_procedimento_expedir',__METHOD__, $objExpedirProcedimentoDTO); |
127 | 127 | ||
@@ -133,7 +133,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -133,7 +133,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
133 | $this->barraProgresso->mover(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_VALIDACAO); | 133 | $this->barraProgresso->mover(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_VALIDACAO); |
134 | $this->barraProgresso->setStrRotulo(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_VALIDACAO); | 134 | $this->barraProgresso->setStrRotulo(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_VALIDACAO); |
135 | 135 | ||
136 | - $objInfraException = new InfraException(); | 136 | + $objInfraException = new InfraException(); |
137 | 137 | ||
138 | //Carregamento dos dados de processo e documento para validação e envio externo | 138 | //Carregamento dos dados de processo e documento para validação e envio externo |
139 | $objProcedimentoDTO = $this->consultarProcedimento($dblIdProcedimento); | 139 | $objProcedimentoDTO = $this->consultarProcedimento($dblIdProcedimento); |
@@ -148,52 +148,52 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -148,52 +148,52 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
148 | $this->barraProgresso->mover(0); | 148 | $this->barraProgresso->mover(0); |
149 | $this->barraProgresso->setStrRotulo('Erro durante validação dos dados do processo.'); | 149 | $this->barraProgresso->setStrRotulo('Erro durante validação dos dados do processo.'); |
150 | $objInfraException->lancarValidacoes(); | 150 | $objInfraException->lancarValidacoes(); |
151 | - } | 151 | + } |
152 | 152 | ||
153 | $this->barraProgresso->mover(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_PROCEDIMENTO); | 153 | $this->barraProgresso->mover(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_PROCEDIMENTO); |
154 | $this->barraProgresso->setStrRotulo(sprintf(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_PROCEDIMENTO, $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado())); | 154 | $this->barraProgresso->setStrRotulo(sprintf(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_PROCEDIMENTO, $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado())); |
155 | 155 | ||
156 | //Construo dos cabecalho para envio do processo | 156 | //Construo dos cabecalho para envio do processo |
157 | $objCabecalho = $this->construirCabecalho($objExpedirProcedimentoDTO); | 157 | $objCabecalho = $this->construirCabecalho($objExpedirProcedimentoDTO); |
158 | - | ||
159 | - //Construo do processo para envio | 158 | + |
159 | + //Construo do processo para envio | ||
160 | $objProcesso = $this->construirProcesso($dblIdProcedimento, $objExpedirProcedimentoDTO->getArrIdProcessoApensado()); | 160 | $objProcesso = $this->construirProcesso($dblIdProcedimento, $objExpedirProcedimentoDTO->getArrIdProcessoApensado()); |
161 | - | 161 | + |
162 | try { | 162 | try { |
163 | $param = new stdClass(); | 163 | $param = new stdClass(); |
164 | $param->novoTramiteDeProcesso = new stdClass(); | 164 | $param->novoTramiteDeProcesso = new stdClass(); |
165 | $param->novoTramiteDeProcesso->cabecalho = $objCabecalho; | 165 | $param->novoTramiteDeProcesso->cabecalho = $objCabecalho; |
166 | $param->novoTramiteDeProcesso->processo = $objProcesso; | 166 | $param->novoTramiteDeProcesso->processo = $objProcesso; |
167 | - $novoTramite = $this->objProcessoEletronicoRN->enviarProcesso($param); | 167 | + $novoTramite = $this->objProcessoEletronicoRN->enviarProcesso($param); |
168 | $numIdTramite = $novoTramite->dadosTramiteDeProcessoCriado->IDT; | 168 | $numIdTramite = $novoTramite->dadosTramiteDeProcessoCriado->IDT; |
169 | - | 169 | + |
170 | } catch (\Exception $e) { | 170 | } catch (\Exception $e) { |
171 | throw new InfraException("Error Processing Request", $e); | 171 | throw new InfraException("Error Processing Request", $e); |
172 | - } | 172 | + } |
173 | + | ||
173 | 174 | ||
174 | 175 | ||
175 | - | ||
176 | $this->atualizarPenProtocolo($dblIdProcedimento); | 176 | $this->atualizarPenProtocolo($dblIdProcedimento); |
177 | - | 177 | + |
178 | if (isset($novoTramite->dadosTramiteDeProcessoCriado)) { | 178 | if (isset($novoTramite->dadosTramiteDeProcessoCriado)) { |
179 | - | 179 | + |
180 | $objTramite = $novoTramite->dadosTramiteDeProcessoCriado; | 180 | $objTramite = $novoTramite->dadosTramiteDeProcessoCriado; |
181 | - | 181 | + |
182 | $this->objProcedimentoAndamentoRN->setOpts($dblIdProcedimento, $objTramite->IDT, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)); | 182 | $this->objProcedimentoAndamentoRN->setOpts($dblIdProcedimento, $objTramite->IDT, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)); |
183 | try { | 183 | try { |
184 | - | 184 | + |
185 | $this->objProcedimentoAndamentoRN->cadastrar('Envio do metadados do processo', 'S'); | 185 | $this->objProcedimentoAndamentoRN->cadastrar('Envio do metadados do processo', 'S'); |
186 | - | 186 | + |
187 | $idAtividadeExpedicao = $this->bloquearProcedimentoExpedicao($objExpedirProcedimentoDTO, $objProcesso->idProcedimentoSEI); | 187 | $idAtividadeExpedicao = $this->bloquearProcedimentoExpedicao($objExpedirProcedimentoDTO, $objProcesso->idProcedimentoSEI); |
188 | //$this->registrarAndamentoExpedicaoProcesso($objExpedirProcedimentoDTO, $objProcesso); | 188 | //$this->registrarAndamentoExpedicaoProcesso($objExpedirProcedimentoDTO, $objProcesso); |
189 | 189 | ||
190 | - | 190 | + |
191 | $this->objProcessoEletronicoRN->cadastrarTramiteDeProcesso( | 191 | $this->objProcessoEletronicoRN->cadastrarTramiteDeProcesso( |
192 | - $objProcesso->idProcedimentoSEI, | ||
193 | - $objTramite->NRE, | ||
194 | - $objTramite->IDT, | ||
195 | - $objTramite->dataHoraDeRegistroDoTramite, $objProcesso, | ||
196 | - $objTramite->ticketParaEnvioDeComponentesDigitais, | 192 | + $objProcesso->idProcedimentoSEI, |
193 | + $objTramite->NRE, | ||
194 | + $objTramite->IDT, | ||
195 | + $objTramite->dataHoraDeRegistroDoTramite, $objProcesso, | ||
196 | + $objTramite->ticketParaEnvioDeComponentesDigitais, | ||
197 | $objTramite->componentesDigitaisSolicitados); | 197 | $objTramite->componentesDigitaisSolicitados); |
198 | 198 | ||
199 | 199 | ||
@@ -202,12 +202,12 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -202,12 +202,12 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
202 | //error_log('before enviarComponentesDigitais'); | 202 | //error_log('before enviarComponentesDigitais'); |
203 | 203 | ||
204 | //TODO: Erro no BARRAMENTO: Processo no pode ser enviado se possuir 2 documentos iguais(mesmo hash) | 204 | //TODO: Erro no BARRAMENTO: Processo no pode ser enviado se possuir 2 documentos iguais(mesmo hash) |
205 | - //TODO: Melhoria no barramento de servios. O mtodo solicitar metadados no deixa claro quais os componentes digitais que | 205 | + //TODO: Melhoria no barramento de servios. O mtodo solicitar metadados no deixa claro quais os componentes digitais que |
206 | //precisam ser baixados. No cenrio de retorno de um processo existente, a nica forma consultar o status do trâmite para | 206 | //precisam ser baixados. No cenrio de retorno de um processo existente, a nica forma consultar o status do trâmite para |
207 | - //saber quais precisam ser baixados. O processo poderia ser mais otimizado se o retorno nos metadados j informasse quais os | 207 | + //saber quais precisam ser baixados. O processo poderia ser mais otimizado se o retorno nos metadados j informasse quais os |
208 | //componentes precisam ser baixados, semelhante ao que ocorre no enviarProcesso onde o barramento informa quais os componentes | 208 | //componentes precisam ser baixados, semelhante ao que ocorre no enviarProcesso onde o barramento informa quais os componentes |
209 | //que precisam ser enviados | 209 | //que precisam ser enviados |
210 | - $this->enviarComponentesDigitais($objTramite->NRE, $objTramite->IDT, $objProcesso->protocolo); | 210 | + $this->enviarComponentesDigitais($objTramite->NRE, $objTramite->IDT, $objProcesso->protocolo); |
211 | //error_log('after enviarComponentesDigitais'); | 211 | //error_log('after enviarComponentesDigitais'); |
212 | //$strNumeroRegistro, $numIdTramite, $strProtocolo | 212 | //$strNumeroRegistro, $numIdTramite, $strProtocolo |
213 | //error_log('==========================>>>>' . print_r($objTramite, true)); | 213 | //error_log('==========================>>>>' . print_r($objTramite, true)); |
@@ -222,45 +222,45 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -222,45 +222,45 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
222 | 222 | ||
223 | //return ; | 223 | //return ; |
224 | 224 | ||
225 | - # $this->enviarDocProdimentoTramite(); | 225 | + # $this->enviarDocProdimentoTramite(); |
226 | // $this->gravarAuditoria(__METHOD__ , $objExpedirProcedimentoDTO->getDblIdProcedimento()); | 226 | // $this->gravarAuditoria(__METHOD__ , $objExpedirProcedimentoDTO->getDblIdProcedimento()); |
227 | //$this->bloquearProcesso($objExpedirProcedimentoDTO->getDblIdProcedimento()); | 227 | //$this->bloquearProcesso($objExpedirProcedimentoDTO->getDblIdProcedimento()); |
228 | #$this->enviarDocProdimentoTramite(); | 228 | #$this->enviarDocProdimentoTramite(); |
229 | - //return array('mensagem' => 'Processo em expedio!', 'retorno' => 1); | 229 | + //return array('mensagem' => 'Processo em expedio!', 'retorno' => 1); |
230 | 230 | ||
231 | //TODO: Alterar atualizao para somente apresentar ao final de todo o trâmite | 231 | //TODO: Alterar atualizao para somente apresentar ao final de todo o trâmite |
232 | $this->barraProgresso->mover(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_CONCLUSAO); | 232 | $this->barraProgresso->mover(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_CONCLUSAO); |
233 | $this->barraProgresso->setStrRotulo(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_CONCLUSAO); | 233 | $this->barraProgresso->setStrRotulo(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_CONCLUSAO); |
234 | - | 234 | + |
235 | // @join_tec US008.06 (#23092) | 235 | // @join_tec US008.06 (#23092) |
236 | $this->objProcedimentoAndamentoRN->cadastrar('Concluído envio dos componentes do processo', 'S'); | 236 | $this->objProcedimentoAndamentoRN->cadastrar('Concluído envio dos componentes do processo', 'S'); |
237 | - | ||
238 | - | 237 | + |
238 | + | ||
239 | $this->receberReciboDeEnvio($objTramite->IDT); | 239 | $this->receberReciboDeEnvio($objTramite->IDT); |
240 | - } | 240 | + } |
241 | catch (\Exception $e) { | 241 | catch (\Exception $e) { |
242 | //@TODO: Melhorar essa estrutura | 242 | //@TODO: Melhorar essa estrutura |
243 | //Realiza o desbloqueio do processo | 243 | //Realiza o desbloqueio do processo |
244 | try{ | 244 | try{ |
245 | $this->desbloquearProcessoExpedicao($objProcesso->idProcedimentoSEI); | 245 | $this->desbloquearProcessoExpedicao($objProcesso->idProcedimentoSEI); |
246 | - } catch (InfraException $ex) { } | ||
247 | - | 246 | + } catch (InfraException $ex) { } |
247 | + | ||
248 | //@TODO: Melhorar essa estrutura | 248 | //@TODO: Melhorar essa estrutura |
249 | //Realiza o cancelamento do tramite | 249 | //Realiza o cancelamento do tramite |
250 | try{ | 250 | try{ |
251 | if($numIdTramite != 0){ | 251 | if($numIdTramite != 0){ |
252 | $this->objProcessoEletronicoRN->cancelarTramite($numIdTramite); | 252 | $this->objProcessoEletronicoRN->cancelarTramite($numIdTramite); |
253 | } | 253 | } |
254 | - } catch (InfraException $ex) { } | ||
255 | - | 254 | + } catch (InfraException $ex) { } |
255 | + | ||
256 | $this->registrarAndamentoExpedicaoAbortada($objProcesso->idProcedimentoSEI); | 256 | $this->registrarAndamentoExpedicaoAbortada($objProcesso->idProcedimentoSEI); |
257 | - | 257 | + |
258 | // @join_tec US008.06 (#23092) | 258 | // @join_tec US008.06 (#23092) |
259 | $this->objProcedimentoAndamentoRN->cadastrar('Concluído envio dos componentes do processo', 'N'); | 259 | $this->objProcedimentoAndamentoRN->cadastrar('Concluído envio dos componentes do processo', 'N'); |
260 | throw $e; | 260 | throw $e; |
261 | } | 261 | } |
262 | } | 262 | } |
263 | - | 263 | + |
264 | } catch (\Exception $e) { | 264 | } catch (\Exception $e) { |
265 | throw new InfraException('Falha de comunicação com o serviços de integração. Por favor, tente novamente mais tarde.', $e); | 265 | throw new InfraException('Falha de comunicação com o serviços de integração. Por favor, tente novamente mais tarde.', $e); |
266 | } | 266 | } |
@@ -272,7 +272,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -272,7 +272,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
272 | //TODO: Atribuir atributos necessrios para formao da mensagem do andamento | 272 | //TODO: Atribuir atributos necessrios para formao da mensagem do andamento |
273 | //TODO: Especificar quais andamentos sero registrados | 273 | //TODO: Especificar quais andamentos sero registrados |
274 | $arrObjAtributoAndamentoDTO = array(); | 274 | $arrObjAtributoAndamentoDTO = array(); |
275 | - | 275 | + |
276 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | 276 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
277 | $objAtributoAndamentoDTO->setStrNome('REPOSITORIO_DESTINO'); | 277 | $objAtributoAndamentoDTO->setStrNome('REPOSITORIO_DESTINO'); |
278 | $objAtributoAndamentoDTO->setStrValor($objExpedirProcedimentoDTO->getStrRepositorioDestino()); | 278 | $objAtributoAndamentoDTO->setStrValor($objExpedirProcedimentoDTO->getStrRepositorioDestino()); |
@@ -294,7 +294,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -294,7 +294,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
294 | $objUnidadeDTO = new UnidadeDTO(); | 294 | $objUnidadeDTO = new UnidadeDTO(); |
295 | $objUnidadeDTO->retStrSigla(); | 295 | $objUnidadeDTO->retStrSigla(); |
296 | $objUnidadeDTO->retStrDescricao(); | 296 | $objUnidadeDTO->retStrDescricao(); |
297 | - $objUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | 297 | + $objUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
298 | $objUnidadeDTO = $this->objUnidadeRN->consultarRN0125($objUnidadeDTO); | 298 | $objUnidadeDTO = $this->objUnidadeRN->consultarRN0125($objUnidadeDTO); |
299 | 299 | ||
300 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | 300 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
@@ -330,7 +330,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -330,7 +330,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
330 | 330 | ||
331 | } | 331 | } |
332 | 332 | ||
333 | - private function construirCabecalho(ExpedirProcedimentoDTO $objExpedirProcedimentoDTO) | 333 | + private function construirCabecalho(ExpedirProcedimentoDTO $objExpedirProcedimentoDTO) |
334 | { | 334 | { |
335 | if(!isset($objExpedirProcedimentoDTO)){ | 335 | if(!isset($objExpedirProcedimentoDTO)){ |
336 | throw new InfraException('Parâmetro $objExpedirProcedimentoDTO não informado.'); | 336 | throw new InfraException('Parâmetro $objExpedirProcedimentoDTO não informado.'); |
@@ -346,35 +346,35 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -346,35 +346,35 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
346 | $objProcessoEletronicoDTO->setOrd('IdProcedimento', InfraDTO::$TIPO_ORDENACAO_DESC); | 346 | $objProcessoEletronicoDTO->setOrd('IdProcedimento', InfraDTO::$TIPO_ORDENACAO_DESC); |
347 | $objProcessoEletronicoDTO->retStrNumeroRegistro(); | 347 | $objProcessoEletronicoDTO->retStrNumeroRegistro(); |
348 | 348 | ||
349 | - $objProcessoEletronicoDTO = $objProcessoEletronicoBD->consultar($objProcessoEletronicoDTO); | 349 | + $objProcessoEletronicoDTO = $objProcessoEletronicoBD->consultar($objProcessoEletronicoDTO); |
350 | if(isset($objProcessoEletronicoDTO)) { | 350 | if(isset($objProcessoEletronicoDTO)) { |
351 | $strNumeroRegistro = $objProcessoEletronicoDTO->getStrNumeroRegistro(); | 351 | $strNumeroRegistro = $objProcessoEletronicoDTO->getStrNumeroRegistro(); |
352 | } | 352 | } |
353 | - | 353 | + |
354 | // Consultar se processo eletrônico existe no PEN algum trâmite CANCELADO, caso | 354 | // Consultar se processo eletrônico existe no PEN algum trâmite CANCELADO, caso |
355 | // sim deve ser gerada uma nova NRE, pois a atual ser recusada pelo PEN quando | 355 | // sim deve ser gerada uma nova NRE, pois a atual ser recusada pelo PEN quando |
356 | // for enviado | 356 | // for enviado |
357 | - /* if(!InfraString::isBolVazia($strNumeroRegistro)) { | 357 | + /* if(!InfraString::isBolVazia($strNumeroRegistro)) { |
358 | $arrObjTramite = $this->objProcessoEletronicoRN->consultarTramites(null, $strNumeroRegistro); | 358 | $arrObjTramite = $this->objProcessoEletronicoRN->consultarTramites(null, $strNumeroRegistro); |
359 | if(!empty($arrObjTramite) && is_array($arrObjTramite) && count($arrObjTramite) === 1) { | 359 | if(!empty($arrObjTramite) && is_array($arrObjTramite) && count($arrObjTramite) === 1) { |
360 | $objTramite = current($arrObjTramite); | 360 | $objTramite = current($arrObjTramite); |
361 | if($objTramite->situacaoAtual == ProcessoeletronicoRN::$STA_SITUACAO_TRAMITE_CANCELADO || $objTramite->situacaoAtual == ProcessoeletronicoRN::$STA_SITUACAO_TRAMITE_RECUSADO){ | 361 | if($objTramite->situacaoAtual == ProcessoeletronicoRN::$STA_SITUACAO_TRAMITE_CANCELADO || $objTramite->situacaoAtual == ProcessoeletronicoRN::$STA_SITUACAO_TRAMITE_RECUSADO){ |
362 | $strNumeroRegistro = null; | 362 | $strNumeroRegistro = null; |
363 | - } | 363 | + } |
364 | } | 364 | } |
365 | } */ | 365 | } */ |
366 | - | 366 | + |
367 | 367 | ||
368 | return $this->objProcessoEletronicoRN->construirCabecalho( | 368 | return $this->objProcessoEletronicoRN->construirCabecalho( |
369 | //TODO: Desabilitado consulta do NRE para questes de teste | 369 | //TODO: Desabilitado consulta do NRE para questes de teste |
370 | - $strNumeroRegistro, | 370 | + $strNumeroRegistro, |
371 | $objExpedirProcedimentoDTO->getNumIdRepositorioOrigem(), | 371 | $objExpedirProcedimentoDTO->getNumIdRepositorioOrigem(), |
372 | $objExpedirProcedimentoDTO->getNumIdUnidadeOrigem(), | 372 | $objExpedirProcedimentoDTO->getNumIdUnidadeOrigem(), |
373 | $objExpedirProcedimentoDTO->getNumIdRepositorioDestino(), | 373 | $objExpedirProcedimentoDTO->getNumIdRepositorioDestino(), |
374 | $objExpedirProcedimentoDTO->getNumIdUnidadeDestino(), | 374 | $objExpedirProcedimentoDTO->getNumIdUnidadeDestino(), |
375 | $objExpedirProcedimentoDTO->getBolSinUrgente(), | 375 | $objExpedirProcedimentoDTO->getBolSinUrgente(), |
376 | - $objExpedirProcedimentoDTO->getNumIdMotivoUrgencia(), | ||
377 | - false /*obrigarEnvioDeTodosOsComponentesDigitais*/); | 376 | + $objExpedirProcedimentoDTO->getNumIdMotivoUrgencia(), |
377 | + false /*obrigarEnvioDeTodosOsComponentesDigitais*/); | ||
378 | 378 | ||
379 | } | 379 | } |
380 | 380 | ||
@@ -383,30 +383,30 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -383,30 +383,30 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
383 | if(!isset($dblIdProcedimento)){ | 383 | if(!isset($dblIdProcedimento)){ |
384 | throw new InfraException('Parâmetro $dblIdProcedimento não informado.'); | 384 | throw new InfraException('Parâmetro $dblIdProcedimento não informado.'); |
385 | } | 385 | } |
386 | - | 386 | + |
387 | //TODO: Passar dados do ProcedimentoDTO via parâmetro j carregado anteriormente | 387 | //TODO: Passar dados do ProcedimentoDTO via parâmetro j carregado anteriormente |
388 | $objProcedimentoDTO = $this->consultarProcedimento($dblIdProcedimento); | 388 | $objProcedimentoDTO = $this->consultarProcedimento($dblIdProcedimento); |
389 | $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalEnvioRN(); | 389 | $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalEnvioRN(); |
390 | - | 390 | + |
391 | $objProcesso = new stdClass(); | 391 | $objProcesso = new stdClass(); |
392 | $objProcesso->protocolo = utf8_encode($objProcedimentoDTO->getStrProtocoloProcedimentoFormatado()); | 392 | $objProcesso->protocolo = utf8_encode($objProcedimentoDTO->getStrProtocoloProcedimentoFormatado()); |
393 | $objProcesso->nivelDeSigilo = $this->obterNivelSigiloPEN($objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo()); | 393 | $objProcesso->nivelDeSigilo = $this->obterNivelSigiloPEN($objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo()); |
394 | $objProcesso->processoDeNegocio = utf8_encode($objProcedimentoDTO->getStrNomeTipoProcedimento()); | 394 | $objProcesso->processoDeNegocio = utf8_encode($objProcedimentoDTO->getStrNomeTipoProcedimento()); |
395 | $objProcesso->descricao = utf8_encode($objProcedimentoDTO->getStrDescricaoProtocolo()); | 395 | $objProcesso->descricao = utf8_encode($objProcedimentoDTO->getStrDescricaoProtocolo()); |
396 | $objProcesso->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($objProcedimentoDTO->getDtaGeracaoProtocolo()); | 396 | $objProcesso->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($objProcedimentoDTO->getDtaGeracaoProtocolo()); |
397 | - | 397 | + |
398 | if($objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ | 398 | if($objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ |
399 | $objProcesso->hipoteseLegal = new stdClass(); | 399 | $objProcesso->hipoteseLegal = new stdClass(); |
400 | $objProcesso->hipoteseLegal->identificacao = $objPenRelHipoteseLegalRN->getIdHipoteseLegalPEN($objProcedimentoDTO->getNumIdHipoteseLegalProtocolo()); | 400 | $objProcesso->hipoteseLegal->identificacao = $objPenRelHipoteseLegalRN->getIdHipoteseLegalPEN($objProcedimentoDTO->getNumIdHipoteseLegalProtocolo()); |
401 | } | 401 | } |
402 | - | ||
403 | - $this->atribuirProdutorProcesso($objProcesso, | ||
404 | - $objProcedimentoDTO->getNumIdUsuarioGeradorProtocolo(), | ||
405 | - $objProcedimentoDTO->getNumIdUnidadeGeradoraProtocolo()); | ||
406 | - | 402 | + |
403 | + $this->atribuirProdutorProcesso($objProcesso, | ||
404 | + $objProcedimentoDTO->getNumIdUsuarioGeradorProtocolo(), | ||
405 | + $objProcedimentoDTO->getNumIdUnidadeGeradoraProtocolo()); | ||
406 | + | ||
407 | $this->atribuirDataHoraDeRegistro($objProcesso, $objProcedimentoDTO->getDblIdProcedimento()); | 407 | $this->atribuirDataHoraDeRegistro($objProcesso, $objProcedimentoDTO->getDblIdProcedimento()); |
408 | 408 | ||
409 | - $this->atribuirDocumentos($objProcesso, $dblIdProcedimento); | 409 | + $this->atribuirDocumentos($objProcesso, $dblIdProcedimento); |
410 | $this->atribuirDadosInteressados($objProcesso, $dblIdProcedimento); | 410 | $this->atribuirDadosInteressados($objProcesso, $dblIdProcedimento); |
411 | $this->adicionarProcessosApensados($objProcesso, $arrIdProcessoApensado); | 411 | $this->adicionarProcessosApensados($objProcesso, $arrIdProcessoApensado); |
412 | 412 | ||
@@ -415,7 +415,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -415,7 +415,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
415 | } | 415 | } |
416 | 416 | ||
417 | //TODO: Implementar mapeamento de atividades que sero enviadas para barramento (semelhante Protocolo Integrado) | 417 | //TODO: Implementar mapeamento de atividades que sero enviadas para barramento (semelhante Protocolo Integrado) |
418 | - private function atribuirDadosHistorico($objProcesso, $dblIdProcedimento) | 418 | + private function atribuirDadosHistorico($objProcesso, $dblIdProcedimento) |
419 | { | 419 | { |
420 | $objProcedimentoHistoricoDTO = new ProcedimentoHistoricoDTO(); | 420 | $objProcedimentoHistoricoDTO = new ProcedimentoHistoricoDTO(); |
421 | $objProcedimentoHistoricoDTO->setDblIdProcedimento($dblIdProcedimento); | 421 | $objProcedimentoHistoricoDTO->setDblIdProcedimento($dblIdProcedimento); |
@@ -452,24 +452,24 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -452,24 +452,24 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
452 | 452 | ||
453 | /** | 453 | /** |
454 | * Muda o estado de um procedimento | 454 | * Muda o estado de um procedimento |
455 | - * | 455 | + * |
456 | * @param object $objProcesso | 456 | * @param object $objProcesso |
457 | * @param string $strStaEstado | 457 | * @param string $strStaEstado |
458 | * @throws InfraException | 458 | * @throws InfraException |
459 | * @return null | 459 | * @return null |
460 | */ | 460 | */ |
461 | public static function mudarEstadoProcedimento($objProcesso, $strStaEstado){ | 461 | public static function mudarEstadoProcedimento($objProcesso, $strStaEstado){ |
462 | - | 462 | + |
463 | if(!isset($objProcesso)) { | 463 | if(!isset($objProcesso)) { |
464 | throw new InfraException('Parâmetro $objProcesso não informado.'); | 464 | throw new InfraException('Parâmetro $objProcesso não informado.'); |
465 | } | 465 | } |
466 | - | 466 | + |
467 | try { | 467 | try { |
468 | - | 468 | + |
469 | //muda estado do protocolo | 469 | //muda estado do protocolo |
470 | - $objProtocoloDTO = new ProtocoloDTO(); | 470 | + $objProtocoloDTO = new ProtocoloDTO(); |
471 | $objProtocoloDTO->setStrStaEstado($strStaEstado); | 471 | $objProtocoloDTO->setStrStaEstado($strStaEstado); |
472 | - $objProtocoloDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); | 472 | + $objProtocoloDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); |
473 | 473 | ||
474 | $objProtocoloRN = new ProtocoloRN(); | 474 | $objProtocoloRN = new ProtocoloRN(); |
475 | $objProtocoloRN->alterarRN0203($objProtocoloDTO); | 475 | $objProtocoloRN->alterarRN0203($objProtocoloDTO); |
@@ -478,7 +478,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -478,7 +478,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
478 | $objAtividadeDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); | 478 | $objAtividadeDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); |
479 | $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | 479 | $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
480 | $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO); | 480 | $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO); |
481 | - | 481 | + |
482 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | 482 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
483 | $objAtributoAndamentoDTO->setStrNome('MOTIVO'); | 483 | $objAtributoAndamentoDTO->setStrNome('MOTIVO'); |
484 | $objAtributoAndamentoDTO->setStrIdOrigem(null); | 484 | $objAtributoAndamentoDTO->setStrIdOrigem(null); |
@@ -491,17 +491,17 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -491,17 +491,17 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
491 | catch(Exception $e){ | 491 | catch(Exception $e){ |
492 | throw new InfraException('Erro ao mudar o estado do processo.',$e); | 492 | throw new InfraException('Erro ao mudar o estado do processo.',$e); |
493 | } | 493 | } |
494 | - | 494 | + |
495 | if (isset($objProcesso->processoApensado) && is_array($objProcesso->processoApensado)) { | 495 | if (isset($objProcesso->processoApensado) && is_array($objProcesso->processoApensado)) { |
496 | foreach ($objProcesso->processoApensado as $objProcessoApensado) { | 496 | foreach ($objProcesso->processoApensado as $objProcessoApensado) { |
497 | static::mudarEstadoProcedimento($objProcessoApensado, $strStaEstado); | 497 | static::mudarEstadoProcedimento($objProcessoApensado, $strStaEstado); |
498 | } | 498 | } |
499 | } | 499 | } |
500 | } | 500 | } |
501 | - | 501 | + |
502 | /** | 502 | /** |
503 | * Muda o estado de um procedimento | 503 | * Muda o estado de um procedimento |
504 | - * | 504 | + * |
505 | * @param object $objProcesso | 505 | * @param object $objProcesso |
506 | * @param string $strStaEstado | 506 | * @param string $strStaEstado |
507 | * @throws InfraException | 507 | * @throws InfraException |
@@ -510,16 +510,16 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -510,16 +510,16 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
510 | public static function mudarEstadoProcedimentoNormal($objProcesso, $strStaEstado){ | 510 | public static function mudarEstadoProcedimentoNormal($objProcesso, $strStaEstado){ |
511 | 511 | ||
512 | //Muda o estado do Protocolo para normal | 512 | //Muda o estado do Protocolo para normal |
513 | - $objProtocoloDTO = new ProtocoloDTO(); | 513 | + $objProtocoloDTO = new ProtocoloDTO(); |
514 | $objProtocoloDTO->setStrStaEstado($strStaEstado); | 514 | $objProtocoloDTO->setStrStaEstado($strStaEstado); |
515 | - $objProtocoloDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); | 515 | + $objProtocoloDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); |
516 | 516 | ||
517 | $objProtocoloRN = new ProtocoloRN(); | 517 | $objProtocoloRN = new ProtocoloRN(); |
518 | $objProtocoloRN->alterarRN0203($objProtocoloDTO); | 518 | $objProtocoloRN->alterarRN0203($objProtocoloDTO); |
519 | 519 | ||
520 | } | 520 | } |
521 | - | ||
522 | - | 521 | + |
522 | + | ||
523 | public function bloquearProcedimentoExpedicao($objExpedirProcedimentoDTO, $numIdProcedimento) { | 523 | public function bloquearProcedimentoExpedicao($objExpedirProcedimentoDTO, $numIdProcedimento) { |
524 | 524 | ||
525 | //Instancia a API do SEI para bloquei do processo | 525 | //Instancia a API do SEI para bloquei do processo |
@@ -597,8 +597,8 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -597,8 +597,8 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
597 | $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | 597 | $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); |
598 | $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)); | 598 | $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)); |
599 | $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); | 599 | $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); |
600 | - | ||
601 | - //Registra o andamento no histrico e | 600 | + |
601 | + //Registra o andamento no histrico e | ||
602 | $objAtividadeRN = new AtividadeRN(); | 602 | $objAtividadeRN = new AtividadeRN(); |
603 | $atividade = $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | 603 | $atividade = $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); |
604 | 604 | ||
@@ -606,7 +606,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -606,7 +606,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
606 | } | 606 | } |
607 | 607 | ||
608 | public function desbloquearProcessoExpedicao($numIdProcedimento){ | 608 | public function desbloquearProcessoExpedicao($numIdProcedimento){ |
609 | - | 609 | + |
610 | //Intancia o objeto de desbloqueio da API do SEI | 610 | //Intancia o objeto de desbloqueio da API do SEI |
611 | $objEntradaDesbloquearProcessoAPI = new EntradaDesbloquearProcessoAPI(); | 611 | $objEntradaDesbloquearProcessoAPI = new EntradaDesbloquearProcessoAPI(); |
612 | $objEntradaDesbloquearProcessoAPI->setIdProcedimento($numIdProcedimento); | 612 | $objEntradaDesbloquearProcessoAPI->setIdProcedimento($numIdProcedimento); |
@@ -616,9 +616,9 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -616,9 +616,9 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
616 | $objSeiRN->desbloquearProcesso($objEntradaDesbloquearProcessoAPI); | 616 | $objSeiRN->desbloquearProcesso($objEntradaDesbloquearProcessoAPI); |
617 | 617 | ||
618 | } | 618 | } |
619 | - | 619 | + |
620 | public function registrarAndamentoExpedicaoAbortada($dblIdProtocolo) { | 620 | public function registrarAndamentoExpedicaoAbortada($dblIdProtocolo) { |
621 | - | 621 | + |
622 | //Seta todos os atributos do histrico de aborto da expedio | 622 | //Seta todos os atributos do histrico de aborto da expedio |
623 | $objAtividadeDTO = new AtividadeDTO(); | 623 | $objAtividadeDTO = new AtividadeDTO(); |
624 | $objAtividadeDTO->setDblIdProtocolo($dblIdProtocolo); | 624 | $objAtividadeDTO->setDblIdProtocolo($dblIdProtocolo); |
@@ -637,8 +637,8 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -637,8 +637,8 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
637 | 637 | ||
638 | try{ | 638 | try{ |
639 | //Muda o status do protocolo para "Normal" | 639 | //Muda o status do protocolo para "Normal" |
640 | - | ||
641 | - | 640 | + |
641 | + | ||
642 | $arrObjAtributoAndamentoDTO = array(); | 642 | $arrObjAtributoAndamentoDTO = array(); |
643 | 643 | ||
644 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | 644 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
@@ -646,32 +646,32 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -646,32 +646,32 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
646 | $objAtributoAndamentoDTO->setStrValor($motivo); | 646 | $objAtributoAndamentoDTO->setStrValor($motivo); |
647 | $objAtributoAndamentoDTO->setStrIdOrigem($numUnidadeDestino); | 647 | $objAtributoAndamentoDTO->setStrIdOrigem($numUnidadeDestino); |
648 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; | 648 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; |
649 | - | ||
650 | - | 649 | + |
650 | + | ||
651 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | 651 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
652 | $objAtributoAndamentoDTO->setStrNome('UNIDADE_DESTINO'); | 652 | $objAtributoAndamentoDTO->setStrNome('UNIDADE_DESTINO'); |
653 | $objAtributoAndamentoDTO->setStrValor($unidade_destino); | 653 | $objAtributoAndamentoDTO->setStrValor($unidade_destino); |
654 | $objAtributoAndamentoDTO->setStrIdOrigem($numUnidadeDestino); | 654 | $objAtributoAndamentoDTO->setStrIdOrigem($numUnidadeDestino); |
655 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; | 655 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; |
656 | 656 | ||
657 | - | 657 | + |
658 | $objAtividadeDTO = new AtividadeDTO(); | 658 | $objAtividadeDTO = new AtividadeDTO(); |
659 | $objAtividadeDTO->setDblIdProtocolo($idProtocolo); | 659 | $objAtividadeDTO->setDblIdProtocolo($idProtocolo); |
660 | $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | 660 | $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
661 | $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_RECUSADO); | 661 | $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_RECUSADO); |
662 | $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); | 662 | $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); |
663 | - | 663 | + |
664 | $objAtividadeRN = new AtividadeRN(); | 664 | $objAtividadeRN = new AtividadeRN(); |
665 | $atividade = $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | 665 | $atividade = $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); |
666 | - | ||
667 | - $objProtocoloDTO = new ProtocoloDTO(); | 666 | + |
667 | + $objProtocoloDTO = new ProtocoloDTO(); | ||
668 | $objProtocoloDTO->setStrStaEstado(ProtocoloRN::$TE_NORMAL); | 668 | $objProtocoloDTO->setStrStaEstado(ProtocoloRN::$TE_NORMAL); |
669 | - $objProtocoloDTO->setDblIdProtocolo($idProtocolo); | ||
670 | - | 669 | + $objProtocoloDTO->setDblIdProtocolo($idProtocolo); |
670 | + | ||
671 | $objProtocoloRN = new ProtocoloRN(); | 671 | $objProtocoloRN = new ProtocoloRN(); |
672 | $objProtocoloRN->alterarRN0203($objProtocoloDTO); | 672 | $objProtocoloRN->alterarRN0203($objProtocoloDTO); |
673 | - | ||
674 | - | 673 | + |
674 | + | ||
675 | }catch (InfraException $e){ | 675 | }catch (InfraException $e){ |
676 | throw new InfraException($e->getStrDescricao()); | 676 | throw new InfraException($e->getStrDescricao()); |
677 | } | 677 | } |
@@ -679,21 +679,21 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -679,21 +679,21 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
679 | throw new InfraException($e->getMessage()); | 679 | throw new InfraException($e->getMessage()); |
680 | } | 680 | } |
681 | } | 681 | } |
682 | - | 682 | + |
683 | private function bloquearProcedimento($objProcesso) | 683 | private function bloquearProcedimento($objProcesso) |
684 | { | 684 | { |
685 | if(!isset($objProcesso)) { | 685 | if(!isset($objProcesso)) { |
686 | throw new InfraException('Parâmetro $objProcesso não informado.'); | 686 | throw new InfraException('Parâmetro $objProcesso não informado.'); |
687 | } | 687 | } |
688 | 688 | ||
689 | - //TODO: Solicitar ao TRF4 um meio de bloquear o processo, indicando que ele encontra-se em | 689 | + //TODO: Solicitar ao TRF4 um meio de bloquear o processo, indicando que ele encontra-se em |
690 | //expedio e possui tratamento diferenciado | 690 | //expedio e possui tratamento diferenciado |
691 | 691 | ||
692 | - $objRelProtocoloProtocoloDTO = new RelProtocoloProtocoloDTO(); | 692 | + $objRelProtocoloProtocoloDTO = new RelProtocoloProtocoloDTO(); |
693 | //$objRelProtocoloProtocoloDTO->setDblIdProtocolo1($dblIdProcedimentoApensado); | 693 | //$objRelProtocoloProtocoloDTO->setDblIdProtocolo1($dblIdProcedimentoApensado); |
694 | $objRelProtocoloProtocoloDTO->setDblIdProtocolo1(null); | 694 | $objRelProtocoloProtocoloDTO->setDblIdProtocolo1(null); |
695 | $objRelProtocoloProtocoloDTO->setDblIdProtocolo2($objProcesso->idProcedimentoSEI); | 695 | $objRelProtocoloProtocoloDTO->setDblIdProtocolo2($objProcesso->idProcedimentoSEI); |
696 | - $objRelProtocoloProtocoloDTO->setStrMotivo("Processo sobrestado devido sua expedição para outra entidade."); | 696 | + $objRelProtocoloProtocoloDTO->setStrMotivo("Processo sobrestado devido sua expedição para outra entidade."); |
697 | $this->objProcedimentoRN->sobrestarRN1014(array($objRelProtocoloProtocoloDTO)); | 697 | $this->objProcedimentoRN->sobrestarRN1014(array($objRelProtocoloProtocoloDTO)); |
698 | 698 | ||
699 | if(isset($objProcesso->processoApensado) && is_array($objProcesso->processoApensado)) { | 699 | if(isset($objProcesso->processoApensado) && is_array($objProcesso->processoApensado)) { |
@@ -720,7 +720,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -720,7 +720,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
720 | $objProcedimentoHistoricoDTO->setDblIdProcedimento($dblIdProcedimento); | 720 | $objProcedimentoHistoricoDTO->setDblIdProcedimento($dblIdProcedimento); |
721 | $objProcedimentoHistoricoDTO->setStrStaHistorico(ProcedimentoRN::$TH_PERSONALIZADO); | 721 | $objProcedimentoHistoricoDTO->setStrStaHistorico(ProcedimentoRN::$TH_PERSONALIZADO); |
722 | $objProcedimentoHistoricoDTO->adicionarCriterio(array('IdTarefa','IdTarefa'), array(InfraDTO::$OPER_IGUAL,InfraDTO::$OPER_IGUAL), array(TarefaRN::$TI_GERACAO_PROCEDIMENTO, ProcessoeletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO), InfraDTO::$OPER_LOGICO_OR); | 722 | $objProcedimentoHistoricoDTO->adicionarCriterio(array('IdTarefa','IdTarefa'), array(InfraDTO::$OPER_IGUAL,InfraDTO::$OPER_IGUAL), array(TarefaRN::$TI_GERACAO_PROCEDIMENTO, ProcessoeletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO), InfraDTO::$OPER_LOGICO_OR); |
723 | - $objProcedimentoHistoricoDTO->setStrSinGerarLinksHistorico('N'); | 723 | + $objProcedimentoHistoricoDTO->setStrSinGerarLinksHistorico('N'); |
724 | $objProcedimentoHistoricoDTO->setNumMaxRegistrosRetorno(1); | 724 | $objProcedimentoHistoricoDTO->setNumMaxRegistrosRetorno(1); |
725 | $objProcedimentoHistoricoDTO->setOrdNumIdTarefa(InfraDTO::$TIPO_ORDENACAO_ASC); | 725 | $objProcedimentoHistoricoDTO->setOrdNumIdTarefa(InfraDTO::$TIPO_ORDENACAO_ASC); |
726 | 726 | ||
@@ -747,7 +747,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -747,7 +747,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
747 | 747 | ||
748 | $objUsuarioProdutor = $this->consultarUsuario($dblIdProcedimento); | 748 | $objUsuarioProdutor = $this->consultarUsuario($dblIdProcedimento); |
749 | if(isset($objUsuarioProdutor)) { | 749 | if(isset($objUsuarioProdutor)) { |
750 | - //Dados do produtor do processo | 750 | + //Dados do produtor do processo |
751 | $objProcesso->produtor->nome = utf8_encode($objUsuarioProdutor->getStrNome()); | 751 | $objProcesso->produtor->nome = utf8_encode($objUsuarioProdutor->getStrNome()); |
752 | //TODO: Obter tipo de pessoa fsica dos contatos do SEI | 752 | //TODO: Obter tipo de pessoa fsica dos contatos do SEI |
753 | $objProcesso->produtor->numeroDeIdentificacao = $objUsuarioProdutor->getDblCpfContato(); | 753 | $objProcesso->produtor->numeroDeIdentificacao = $objUsuarioProdutor->getDblCpfContato(); |
@@ -773,7 +773,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -773,7 +773,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
773 | 773 | ||
774 | $arrParticipantesDTO = $this->listarInteressados($dblIdProcedimento); | 774 | $arrParticipantesDTO = $this->listarInteressados($dblIdProcedimento); |
775 | 775 | ||
776 | - if(isset($arrParticipantesDTO) && count($arrParticipantesDTO) > 0) | 776 | + if(isset($arrParticipantesDTO) && count($arrParticipantesDTO) > 0) |
777 | { | 777 | { |
778 | $objProcesso->interessado = array(); | 778 | $objProcesso->interessado = array(); |
779 | 779 | ||
@@ -781,7 +781,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -781,7 +781,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
781 | $interessado = new stdClass(); | 781 | $interessado = new stdClass(); |
782 | $interessado->nome = utf8_encode($participanteDTO->getStrNomeContato()); | 782 | $interessado->nome = utf8_encode($participanteDTO->getStrNomeContato()); |
783 | $objProcesso->interessado[] = $interessado; | 783 | $objProcesso->interessado[] = $interessado; |
784 | - } | 784 | + } |
785 | } | 785 | } |
786 | } | 786 | } |
787 | 787 | ||
@@ -802,30 +802,30 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -802,30 +802,30 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
802 | $ordemDocumento = 1; | 802 | $ordemDocumento = 1; |
803 | $objProcesso->documento = array(); | 803 | $objProcesso->documento = array(); |
804 | 804 | ||
805 | - | 805 | + |
806 | 806 | ||
807 | foreach ($arrDocumentosDTO as $documentoDTO) { | 807 | foreach ($arrDocumentosDTO as $documentoDTO) { |
808 | 808 | ||
809 | - //$protocoloDocumentoDTO = $this->consultarProtocoloDocumento($documeto->getDblIdProcedimento()); | 809 | + //$protocoloDocumentoDTO = $this->consultarProtocoloDocumento($documeto->getDblIdProcedimento()); |
810 | 810 | ||
811 | $documento = new stdClass(); | 811 | $documento = new stdClass(); |
812 | $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalEnvioRN(); | 812 | $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalEnvioRN(); |
813 | //TODO: Atribuir das informações abaixo ao documento | 813 | //TODO: Atribuir das informações abaixo ao documento |
814 | //<protocoloDoDocumentoAnexado>123</protocoloDoDocumentoAnexado> | 814 | //<protocoloDoDocumentoAnexado>123</protocoloDoDocumentoAnexado> |
815 | - //<protocoloDoProcessoAnexado>456</protocoloDoProcessoAnexado> | 815 | + //<protocoloDoProcessoAnexado>456</protocoloDoProcessoAnexado> |
816 | //Retirado | 816 | //Retirado |
817 | 817 | ||
818 | //Considera o nmero/nome do documento externo para descrio do documento | 818 | //Considera o nmero/nome do documento externo para descrio do documento |
819 | if($documentoDTO->getStrStaProtocoloProtocolo() == ProtocoloRN::$TP_DOCUMENTO_RECEBIDO && $documentoDTO->getStrNumero() != null) { | 819 | if($documentoDTO->getStrStaProtocoloProtocolo() == ProtocoloRN::$TP_DOCUMENTO_RECEBIDO && $documentoDTO->getStrNumero() != null) { |
820 | $strDescricaoDocumento = $documentoDTO->getStrNumero(); | 820 | $strDescricaoDocumento = $documentoDTO->getStrNumero(); |
821 | - | 821 | + |
822 | }else{ | 822 | }else{ |
823 | $strDescricaoDocumento = "***"; | 823 | $strDescricaoDocumento = "***"; |
824 | } | 824 | } |
825 | - | 825 | + |
826 | // Não é um documento externo | 826 | // Não é um documento externo |
827 | /*elseif($documentoDTO->isSetNumIdTipoConferencia()){ | 827 | /*elseif($documentoDTO->isSetNumIdTipoConferencia()){ |
828 | - | 828 | + |
829 | $objTipoProcedimentoDTO = new PenTipoProcedimentoDTO(true); | 829 | $objTipoProcedimentoDTO = new PenTipoProcedimentoDTO(true); |
830 | $objTipoProcedimentoDTO->retStrNome(); | 830 | $objTipoProcedimentoDTO->retStrNome(); |
831 | $objTipoProcedimentoDTO->setBolExclusaoLogica(false); | 831 | $objTipoProcedimentoDTO->setBolExclusaoLogica(false); |
@@ -834,10 +834,10 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -834,10 +834,10 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
834 | $objTipoProcedimentoBD = new TipoProcedimentoBD(BancoSEI::getInstance()); | 834 | $objTipoProcedimentoBD = new TipoProcedimentoBD(BancoSEI::getInstance()); |
835 | 835 | ||
836 | $objTipoProcedimentoDTO = $objTipoProcedimentoBD->consultar($objTipoProcedimentoDTO); | 836 | $objTipoProcedimentoDTO = $objTipoProcedimentoBD->consultar($objTipoProcedimentoDTO); |
837 | - | 837 | + |
838 | $strDescricaoDocumento = $objTipoProcedimentoDTO->getStrNome(); | 838 | $strDescricaoDocumento = $objTipoProcedimentoDTO->getStrNome(); |
839 | }*/ | 839 | }*/ |
840 | - | 840 | + |
841 | $documento->retirado = ($documentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_DOCUMENTO_CANCELADO) ? true : false; | 841 | $documento->retirado = ($documentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_DOCUMENTO_CANCELADO) ? true : false; |
842 | 842 | ||
843 | $documento->ordem = $ordemDocumento++; | 843 | $documento->ordem = $ordemDocumento++; |
@@ -845,7 +845,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -845,7 +845,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
845 | $documento->nivelDeSigilo = $this->obterNivelSigiloPEN($documentoDTO->getStrStaNivelAcessoLocalProtocolo()); | 845 | $documento->nivelDeSigilo = $this->obterNivelSigiloPEN($documentoDTO->getStrStaNivelAcessoLocalProtocolo()); |
846 | 846 | ||
847 | if($documentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ | 847 | if($documentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ |
848 | - | 848 | + |
849 | $documento->hipoteseLegal = new stdClass(); | 849 | $documento->hipoteseLegal = new stdClass(); |
850 | $documento->hipoteseLegal->identificacao = $objPenRelHipoteseLegalRN->getIdHipoteseLegalPEN($documentoDTO->getNumIdHipoteseLegalProtocolo()); | 850 | $documento->hipoteseLegal->identificacao = $objPenRelHipoteseLegalRN->getIdHipoteseLegalPEN($documentoDTO->getNumIdHipoteseLegalProtocolo()); |
851 | // $documento->hipoteseLegal->nome = 'Nomee'; | 851 | // $documento->hipoteseLegal->nome = 'Nomee'; |
@@ -859,20 +859,20 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -859,20 +859,20 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
859 | $documento->produtor->nome = utf8_encode($usuarioDTO->getStrNome()); | 859 | $documento->produtor->nome = utf8_encode($usuarioDTO->getStrNome()); |
860 | $documento->produtor->numeroDeIdentificacao = $usuarioDTO->getDblCpfContato(); | 860 | $documento->produtor->numeroDeIdentificacao = $usuarioDTO->getDblCpfContato(); |
861 | //TODO: Obter tipo de pessoa fsica dos contextos/contatos do SEI | 861 | //TODO: Obter tipo de pessoa fsica dos contextos/contatos do SEI |
862 | - $documento->produtor->tipo = self::STA_TIPO_PESSOA_FISICA;; | 862 | + $documento->produtor->tipo = self::STA_TIPO_PESSOA_FISICA;; |
863 | } | 863 | } |
864 | - | ||
865 | - | 864 | + |
865 | + | ||
866 | $unidadeDTO = $this->consultarUnidade($documentoDTO->getNumIdUnidadeResponsavel()); | 866 | $unidadeDTO = $this->consultarUnidade($documentoDTO->getNumIdUnidadeResponsavel()); |
867 | if(isset($unidadeDTO)) { | 867 | if(isset($unidadeDTO)) { |
868 | $documento->produtor->unidade = new stdClass(); | 868 | $documento->produtor->unidade = new stdClass(); |
869 | $documento->produtor->unidade->nome = utf8_encode($unidadeDTO->getStrDescricao()); | 869 | $documento->produtor->unidade->nome = utf8_encode($unidadeDTO->getStrDescricao()); |
870 | $documento->produtor->unidade->tipo = self::STA_TIPO_PESSOA_ORGAOPUBLICO; | 870 | $documento->produtor->unidade->tipo = self::STA_TIPO_PESSOA_ORGAOPUBLICO; |
871 | - //TODO: Informar dados da estrutura organizacional (estruturaOrganizacional) | 871 | + //TODO: Informar dados da estrutura organizacional (estruturaOrganizacional) |
872 | } | 872 | } |
873 | - | 873 | + |
874 | $documento->produtor->numeroDeIdentificacao = $documentoDTO->getStrProtocoloDocumentoFormatado(); | 874 | $documento->produtor->numeroDeIdentificacao = $documentoDTO->getStrProtocoloDocumentoFormatado(); |
875 | - | 875 | + |
876 | $this->atribuirDataHoraDeRegistro($documento, $documentoDTO->getDblIdProcedimento(), $documentoDTO->getDblIdDocumento()); | 876 | $this->atribuirDataHoraDeRegistro($documento, $documentoDTO->getDblIdProcedimento(), $documentoDTO->getDblIdDocumento()); |
877 | 877 | ||
878 | //TODO: Implementar mapeamento de espécies documentais | 878 | //TODO: Implementar mapeamento de espécies documentais |
@@ -885,18 +885,18 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -885,18 +885,18 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
885 | $this->atribuirNumeracaoDocumento($documento, $documentoDTO); | 885 | $this->atribuirNumeracaoDocumento($documento, $documentoDTO); |
886 | 886 | ||
887 | if($documento->retirado === true){ | 887 | if($documento->retirado === true){ |
888 | - | 888 | + |
889 | $penComponenteDigitalDTO = new ComponenteDigitalDTO(); | 889 | $penComponenteDigitalDTO = new ComponenteDigitalDTO(); |
890 | $penComponenteDigitalDTO->retTodos(); | 890 | $penComponenteDigitalDTO->retTodos(); |
891 | $penComponenteDigitalDTO->setDblIdDocumento($documentoDTO->getDblIdDocumento()); | 891 | $penComponenteDigitalDTO->setDblIdDocumento($documentoDTO->getDblIdDocumento()); |
892 | - | 892 | + |
893 | $penComponenteDigitalBD = new ComponenteDigitalBD($this->getObjInfraIBanco()); | 893 | $penComponenteDigitalBD = new ComponenteDigitalBD($this->getObjInfraIBanco()); |
894 | - | 894 | + |
895 | if($penComponenteDigitalBD->contar($penComponenteDigitalDTO) > 0){ | 895 | if($penComponenteDigitalBD->contar($penComponenteDigitalDTO) > 0){ |
896 | - | 896 | + |
897 | $arrPenComponenteDigitalDTO = $penComponenteDigitalBD->listar($penComponenteDigitalDTO); | 897 | $arrPenComponenteDigitalDTO = $penComponenteDigitalBD->listar($penComponenteDigitalDTO); |
898 | $componenteDigital = $arrPenComponenteDigitalDTO[0]; | 898 | $componenteDigital = $arrPenComponenteDigitalDTO[0]; |
899 | - | 899 | + |
900 | $documento->componenteDigital = new stdClass(); | 900 | $documento->componenteDigital = new stdClass(); |
901 | $documento->componenteDigital->ordem = 1; | 901 | $documento->componenteDigital->ordem = 1; |
902 | $documento->componenteDigital->nome = utf8_encode($componenteDigital->getStrNome()); | 902 | $documento->componenteDigital->nome = utf8_encode($componenteDigital->getStrNome()); |
@@ -905,24 +905,24 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -905,24 +905,24 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
905 | $documento->componenteDigital->mimeType = $componenteDigital->getStrMimeType(); | 905 | $documento->componenteDigital->mimeType = $componenteDigital->getStrMimeType(); |
906 | $documento->componenteDigital->tipoDeConteudo = $componenteDigital->getStrTipoConteudo(); | 906 | $documento->componenteDigital->tipoDeConteudo = $componenteDigital->getStrTipoConteudo(); |
907 | $documento->componenteDigital->idAnexo = $componenteDigital->getNumIdAnexo(); | 907 | $documento->componenteDigital->idAnexo = $componenteDigital->getNumIdAnexo(); |
908 | - | ||
909 | - | ||
910 | - | 908 | + |
909 | + | ||
910 | + | ||
911 | // -------------------------- INICIO DA TAREFA US074 -------------------------------// | 911 | // -------------------------- INICIO DA TAREFA US074 -------------------------------// |
912 | $documento = $this->atribuirDadosAssinaturaDigital($documentoDTO, $documento, $componenteDigital->getStrHashConteudo()); | 912 | $documento = $this->atribuirDadosAssinaturaDigital($documentoDTO, $documento, $componenteDigital->getStrHashConteudo()); |
913 | // -------------------------- FIM TAREFA US074 -------------------------------// | 913 | // -------------------------- FIM TAREFA US074 -------------------------------// |
914 | - | ||
915 | - | 914 | + |
915 | + | ||
916 | if($componenteDigital->getStrMimeType() == 'outro'){ | 916 | if($componenteDigital->getStrMimeType() == 'outro'){ |
917 | $documento->componenteDigital->dadosComplementaresDoTipoDeArquivo = 'outro'; | 917 | $documento->componenteDigital->dadosComplementaresDoTipoDeArquivo = 'outro'; |
918 | } | 918 | } |
919 | - | 919 | + |
920 | }else{ | 920 | }else{ |
921 | $this->atribuirComponentesDigitais($documento, $documentoDTO); | 921 | $this->atribuirComponentesDigitais($documento, $documentoDTO); |
922 | - | 922 | + |
923 | } | 923 | } |
924 | - | ||
925 | - | 924 | + |
925 | + | ||
926 | }else{ | 926 | }else{ |
927 | $this->atribuirComponentesDigitais($documento, $documentoDTO); | 927 | $this->atribuirComponentesDigitais($documento, $documentoDTO); |
928 | } | 928 | } |
@@ -936,18 +936,18 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -936,18 +936,18 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
936 | $documento->idDocumentoSEI = $documentoDTO->getDblIdDocumento(); | 936 | $documento->idDocumentoSEI = $documentoDTO->getDblIdDocumento(); |
937 | $objProcesso->documento[] = $documento; | 937 | $objProcesso->documento[] = $documento; |
938 | } | 938 | } |
939 | - | 939 | + |
940 | } | 940 | } |
941 | - | 941 | + |
942 | public function atribuirComponentesDigitaisRetirados($documentoDTO){ | 942 | public function atribuirComponentesDigitaisRetirados($documentoDTO){ |
943 | - | 943 | + |
944 | } | 944 | } |
945 | 945 | ||
946 | private function obterEspecieMapeada($parNumIdSerie) | 946 | private function obterEspecieMapeada($parNumIdSerie) |
947 | { | 947 | { |
948 | if(!isset($parNumIdSerie) || $parNumIdSerie == 0) { | 948 | if(!isset($parNumIdSerie) || $parNumIdSerie == 0) { |
949 | throw new InfraException('Parâmetro $parNumIdSerie não informado.'); | 949 | throw new InfraException('Parâmetro $parNumIdSerie não informado.'); |
950 | - } | 950 | + } |
951 | 951 | ||
952 | $objPenRelTipoDocMapEnviadoDTO = new PenRelTipoDocMapEnviadoDTO(); | 952 | $objPenRelTipoDocMapEnviadoDTO = new PenRelTipoDocMapEnviadoDTO(); |
953 | $objPenRelTipoDocMapEnviadoDTO->setNumIdSerie($parNumIdSerie); | 953 | $objPenRelTipoDocMapEnviadoDTO->setNumIdSerie($parNumIdSerie); |
@@ -978,7 +978,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -978,7 +978,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
978 | throw new InfraException('Parâmetro $objComponenteDigital não informado.'); | 978 | throw new InfraException('Parâmetro $objComponenteDigital não informado.'); |
979 | } | 979 | } |
980 | 980 | ||
981 | - if(isset($objAssinaturaDTO)) { | 981 | + if(isset($objAssinaturaDTO)) { |
982 | $objComponenteDigital->assinaturaDigital = new stdClass(); | 982 | $objComponenteDigital->assinaturaDigital = new stdClass(); |
983 | //TODO: Obter as informações corretas dos metadados da assinatura digital | 983 | //TODO: Obter as informações corretas dos metadados da assinatura digital |
984 | $objComponenteDigital->assinaturaDigital->dataHora = $this->objProcessoEletronicoRN->converterDataWebService($objComponenteDigital->getDthAberturaAtividade()); | 984 | $objComponenteDigital->assinaturaDigital->dataHora = $this->objProcessoEletronicoRN->converterDataWebService($objComponenteDigital->getDthAberturaAtividade()); |
@@ -1009,7 +1009,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1009,7 +1009,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1009 | $strConteudoAssinatura = $arrInformacaoArquivo['CONTEUDO']; | 1009 | $strConteudoAssinatura = $arrInformacaoArquivo['CONTEUDO']; |
1010 | $hashDoComponenteDigital = hash($strAlgoritmoHash, $strConteudoAssinatura, true); | 1010 | $hashDoComponenteDigital = hash($strAlgoritmoHash, $strConteudoAssinatura, true); |
1011 | $hashDoComponenteDigital = base64_encode($hashDoComponenteDigital); | 1011 | $hashDoComponenteDigital = base64_encode($hashDoComponenteDigital); |
1012 | - | 1012 | + |
1013 | $objDocumento->componenteDigital = new stdClass(); | 1013 | $objDocumento->componenteDigital = new stdClass(); |
1014 | $objDocumento->componenteDigital->ordem = 1; | 1014 | $objDocumento->componenteDigital->ordem = 1; |
1015 | $objDocumento->componenteDigital->nome = utf8_encode($arrInformacaoArquivo["NOME"]); | 1015 | $objDocumento->componenteDigital->nome = utf8_encode($arrInformacaoArquivo["NOME"]); |
@@ -1017,20 +1017,20 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1017,20 +1017,20 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1017 | $objDocumento->componenteDigital->tamanhoEmBytes = $arrInformacaoArquivo['TAMANHO']; | 1017 | $objDocumento->componenteDigital->tamanhoEmBytes = $arrInformacaoArquivo['TAMANHO']; |
1018 | 1018 | ||
1019 | //TODO: Validar os tipos de mimetype de acordo com o WSDL do SEI | 1019 | //TODO: Validar os tipos de mimetype de acordo com o WSDL do SEI |
1020 | - //Caso no identifique o tipo correto, informar o valor [outro] | 1020 | + //Caso no identifique o tipo correto, informar o valor [outro] |
1021 | $objDocumento->componenteDigital->mimeType = $arrInformacaoArquivo['MIME_TYPE']; | 1021 | $objDocumento->componenteDigital->mimeType = $arrInformacaoArquivo['MIME_TYPE']; |
1022 | $objDocumento->componenteDigital->tipoDeConteudo = $this->obterTipoDeConteudo($arrInformacaoArquivo['MIME_TYPE']); | 1022 | $objDocumento->componenteDigital->tipoDeConteudo = $this->obterTipoDeConteudo($arrInformacaoArquivo['MIME_TYPE']); |
1023 | - | ||
1024 | - | 1023 | + |
1024 | + | ||
1025 | // -------------------------- INICIO DA TAREFA US074 -------------------------------/ | 1025 | // -------------------------- INICIO DA TAREFA US074 -------------------------------/ |
1026 | $objDocumento = $this->atribuirDadosAssinaturaDigital($objDocumentoDTO, $objDocumento, $hashDoComponenteDigital); | 1026 | $objDocumento = $this->atribuirDadosAssinaturaDigital($objDocumentoDTO, $objDocumento, $hashDoComponenteDigital); |
1027 | // -------------------------- FIM TAREFA US074 -------------------------------// | 1027 | // -------------------------- FIM TAREFA US074 -------------------------------// |
1028 | - | ||
1029 | - | 1028 | + |
1029 | + | ||
1030 | if($arrInformacaoArquivo['MIME_TYPE'] == 'outro'){ | 1030 | if($arrInformacaoArquivo['MIME_TYPE'] == 'outro'){ |
1031 | $objDocumento->componenteDigital->dadosComplementaresDoTipoDeArquivo = $arrInformacaoArquivo['dadosComplementaresDoTipoDeArquivo']; | 1031 | $objDocumento->componenteDigital->dadosComplementaresDoTipoDeArquivo = $arrInformacaoArquivo['dadosComplementaresDoTipoDeArquivo']; |
1032 | } | 1032 | } |
1033 | - | 1033 | + |
1034 | //TODO: Preencher dados complementares do tipo de arquivo | 1034 | //TODO: Preencher dados complementares do tipo de arquivo |
1035 | //$objDocumento->componenteDigital->dadosComplementaresDoTipoDeArquivo = ''; | 1035 | //$objDocumento->componenteDigital->dadosComplementaresDoTipoDeArquivo = ''; |
1036 | 1036 | ||
@@ -1041,10 +1041,10 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1041,10 +1041,10 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1041 | $objDocumento->componenteDigital->idAnexo = $arrInformacaoArquivo['ID_ANEXO']; | 1041 | $objDocumento->componenteDigital->idAnexo = $arrInformacaoArquivo['ID_ANEXO']; |
1042 | return $objDocumento; | 1042 | return $objDocumento; |
1043 | } | 1043 | } |
1044 | - | 1044 | + |
1045 | public function atribuirDadosAssinaturaDigital($objDocumentoDTO, $objDocumento, $strHashDocumento) { | 1045 | public function atribuirDadosAssinaturaDigital($objDocumentoDTO, $objDocumento, $strHashDocumento) { |
1046 | - | ||
1047 | - | 1046 | + |
1047 | + | ||
1048 | //Busca as Tarjas | 1048 | //Busca as Tarjas |
1049 | $objDocumentoDTOTarjas = new DocumentoDTO(); | 1049 | $objDocumentoDTOTarjas = new DocumentoDTO(); |
1050 | $objDocumentoDTOTarjas->retDblIdDocumento(); | 1050 | $objDocumentoDTOTarjas->retDblIdDocumento(); |
@@ -1064,7 +1064,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1064,7 +1064,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1064 | $objDocumentoRN = new DocumentoRN(); | 1064 | $objDocumentoRN = new DocumentoRN(); |
1065 | $objDocumentoDTOTarjas = $objDocumentoRN->consultarRN0005($objDocumentoDTOTarjas); | 1065 | $objDocumentoDTOTarjas = $objDocumentoRN->consultarRN0005($objDocumentoDTOTarjas); |
1066 | $objAssinaturaRN = new AssinaturaRN(); | 1066 | $objAssinaturaRN = new AssinaturaRN(); |
1067 | - $tarjas = $objAssinaturaRN->montarTarjas($objDocumentoDTOTarjas); | 1067 | + $tarjas = $objAssinaturaRN->montarTarjas($objDocumentoDTOTarjas); |
1068 | 1068 | ||
1069 | 1069 | ||
1070 | //Remove todos os 12 espaos padres aps remover as tags. | 1070 | //Remove todos os 12 espaos padres aps remover as tags. |
@@ -1086,12 +1086,12 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1086,12 +1086,12 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1086 | $objAssinaturaDTO->retStrP7sBase64(); | 1086 | $objAssinaturaDTO->retStrP7sBase64(); |
1087 | $objAssinaturaRN = new AssinaturaRN(); | 1087 | $objAssinaturaRN = new AssinaturaRN(); |
1088 | $resAssinatura = $objAssinaturaRN->listarRN1323($objAssinaturaDTO); | 1088 | $resAssinatura = $objAssinaturaRN->listarRN1323($objAssinaturaDTO); |
1089 | - | 1089 | + |
1090 | 1090 | ||
1091 | $objDocumento->componenteDigital->assinaturaDigital = array(); | 1091 | $objDocumento->componenteDigital->assinaturaDigital = array(); |
1092 | //Para cada assinatura | 1092 | //Para cada assinatura |
1093 | foreach ($resAssinatura as $keyOrder => $assinatura) { | 1093 | foreach ($resAssinatura as $keyOrder => $assinatura) { |
1094 | - | 1094 | + |
1095 | //Busca data da assinatura | 1095 | //Busca data da assinatura |
1096 | $objAtividadeDTO = new AtividadeDTO(); | 1096 | $objAtividadeDTO = new AtividadeDTO(); |
1097 | $objAtividadeDTO->setNumIdAtividade($assinatura->getNumIdAtividade()); | 1097 | $objAtividadeDTO->setNumIdAtividade($assinatura->getNumIdAtividade()); |
@@ -1100,36 +1100,36 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1100,36 +1100,36 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1100 | $objAtividadeDTO->retNumIdAtividade(); | 1100 | $objAtividadeDTO->retNumIdAtividade(); |
1101 | $objAtividadeRN = new AtividadeRN(); | 1101 | $objAtividadeRN = new AtividadeRN(); |
1102 | $objAtividade = $objAtividadeRN->consultarRN0033($objAtividadeDTO); | 1102 | $objAtividade = $objAtividadeRN->consultarRN0033($objAtividadeDTO); |
1103 | - | 1103 | + |
1104 | $objAssinaturaDigital = new stdClass(); | 1104 | $objAssinaturaDigital = new stdClass(); |
1105 | $objAssinaturaDigital->dataHora = $this->objProcessoEletronicoRN->converterDataWebService($objAtividade->getDthAbertura()); | 1105 | $objAssinaturaDigital->dataHora = $this->objProcessoEletronicoRN->converterDataWebService($objAtividade->getDthAbertura()); |
1106 | $objAssinaturaDigital->hash = new SoapVar("<hash algoritmo='".self::ALGORITMO_HASH_ASSINATURA."'>{$strHashDocumento}</hash>", XSD_ANYXML); | 1106 | $objAssinaturaDigital->hash = new SoapVar("<hash algoritmo='".self::ALGORITMO_HASH_ASSINATURA."'>{$strHashDocumento}</hash>", XSD_ANYXML); |
1107 | $objAssinaturaDigital->cadeiaDoCertificado = new SoapVar('<cadeiaDoCertificado formato="PKCS7">'.($assinatura->getStrP7sBase64() ? $assinatura->getStrP7sBase64() : 'null').'</cadeiaDoCertificado>', XSD_ANYXML); | 1107 | $objAssinaturaDigital->cadeiaDoCertificado = new SoapVar('<cadeiaDoCertificado formato="PKCS7">'.($assinatura->getStrP7sBase64() ? $assinatura->getStrP7sBase64() : 'null').'</cadeiaDoCertificado>', XSD_ANYXML); |
1108 | $objAssinaturaDigital->razao = utf8_encode($dataTarjas[$keyOrder]); | 1108 | $objAssinaturaDigital->razao = utf8_encode($dataTarjas[$keyOrder]); |
1109 | $objAssinaturaDigital->observacao = utf8_encode($dataTarjas[count($dataTarjas) - 1]); | 1109 | $objAssinaturaDigital->observacao = utf8_encode($dataTarjas[count($dataTarjas) - 1]); |
1110 | - | ||
1111 | - $objDocumento->componenteDigital->assinaturaDigital[] = $objAssinaturaDigital; | 1110 | + |
1111 | + $objDocumento->componenteDigital->assinaturaDigital[] = $objAssinaturaDigital; | ||
1112 | } | 1112 | } |
1113 | - | ||
1114 | - | ||
1115 | - | 1113 | + |
1114 | + | ||
1115 | + | ||
1116 | return $objDocumento; | 1116 | return $objDocumento; |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | private function obterDadosArquivo(DocumentoDTO $objDocumentoDTO) | 1119 | private function obterDadosArquivo(DocumentoDTO $objDocumentoDTO) |
1120 | { | 1120 | { |
1121 | - | 1121 | + |
1122 | if(!isset($objDocumentoDTO)){ | 1122 | if(!isset($objDocumentoDTO)){ |
1123 | throw new InfraException('Parâmetro $objDocumentoDTO não informado.'); | 1123 | throw new InfraException('Parâmetro $objDocumentoDTO não informado.'); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | $arrInformacaoArquivo = array(); | 1126 | $arrInformacaoArquivo = array(); |
1127 | $strProtocoloDocumentoFormatado = $objDocumentoDTO->getStrProtocoloDocumentoFormatado(); | 1127 | $strProtocoloDocumentoFormatado = $objDocumentoDTO->getStrProtocoloDocumentoFormatado(); |
1128 | - | 1128 | + |
1129 | $objInfraParametro = new InfraParametro($this->getObjInfraIBanco()); | 1129 | $objInfraParametro = new InfraParametro($this->getObjInfraIBanco()); |
1130 | $idSerieEmail = $objInfraParametro->getValor('ID_SERIE_EMAIL'); | 1130 | $idSerieEmail = $objInfraParametro->getValor('ID_SERIE_EMAIL'); |
1131 | $docEmailEnviado = $objDocumentoDTO->getNumIdSerie() == $idSerieEmail && $objDocumentoDTO->getStrStaDocumento() == DocumentoRN::$TD_FORMULARIO_AUTOMATICO ? true : false; | 1131 | $docEmailEnviado = $objDocumentoDTO->getNumIdSerie() == $idSerieEmail && $objDocumentoDTO->getStrStaDocumento() == DocumentoRN::$TD_FORMULARIO_AUTOMATICO ? true : false; |
1132 | - | 1132 | + |
1133 | if($objDocumentoDTO->getStrStaDocumento() == DocumentoRN::$TD_EDITOR_INTERNO) { | 1133 | if($objDocumentoDTO->getStrStaDocumento() == DocumentoRN::$TD_EDITOR_INTERNO) { |
1134 | 1134 | ||
1135 | $objEditorDTO = new EditorDTO(); | 1135 | $objEditorDTO = new EditorDTO(); |
@@ -1139,13 +1139,13 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1139,13 +1139,13 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1139 | $objEditorDTO->setStrSinRodape('S'); | 1139 | $objEditorDTO->setStrSinRodape('S'); |
1140 | $objEditorDTO->setStrSinIdentificacaoVersao('S'); | 1140 | $objEditorDTO->setStrSinIdentificacaoVersao('S'); |
1141 | $objEditorDTO->setStrSinProcessarLinks('S'); | 1141 | $objEditorDTO->setStrSinProcessarLinks('S'); |
1142 | - | 1142 | + |
1143 | $numVersaoAtual = intval(str_replace('.', '', SEI_VERSAO)); | 1143 | $numVersaoAtual = intval(str_replace('.', '', SEI_VERSAO)); |
1144 | $numVersaoCarimboObrigatorio = intval(str_replace('.', '', self::VERSAO_CARIMBO_PUBLICACAO_OBRIGATORIO)); | 1144 | $numVersaoCarimboObrigatorio = intval(str_replace('.', '', self::VERSAO_CARIMBO_PUBLICACAO_OBRIGATORIO)); |
1145 | if ($numVersaoAtual >= $numVersaoCarimboObrigatorio) { | 1145 | if ($numVersaoAtual >= $numVersaoCarimboObrigatorio) { |
1146 | - $objEditorDTO->setStrSinCarimboPublicacao('N'); | ||
1147 | - } | ||
1148 | - | 1146 | + $objEditorDTO->setStrSinCarimboPublicacao('N'); |
1147 | + } | ||
1148 | + | ||
1149 | $objEditorRN = new EditorRN(); | 1149 | $objEditorRN = new EditorRN(); |
1150 | $strConteudoAssinatura = $objEditorRN->consultarHtmlVersao($objEditorDTO); | 1150 | $strConteudoAssinatura = $objEditorRN->consultarHtmlVersao($objEditorDTO); |
1151 | 1151 | ||
@@ -1157,49 +1157,49 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1157,49 +1157,49 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1157 | $arrInformacaoArquivo['ID_ANEXO'] = null; | 1157 | $arrInformacaoArquivo['ID_ANEXO'] = null; |
1158 | 1158 | ||
1159 | } else if($objDocumentoDTO->getStrStaProtocoloProtocolo() == ProtocoloRN::$TP_DOCUMENTO_RECEBIDO) { | 1159 | } else if($objDocumentoDTO->getStrStaProtocoloProtocolo() == ProtocoloRN::$TP_DOCUMENTO_RECEBIDO) { |
1160 | - | 1160 | + |
1161 | $objAnexoDTO = $this->consultarAnexo($objDocumentoDTO->getDblIdDocumento()); | 1161 | $objAnexoDTO = $this->consultarAnexo($objDocumentoDTO->getDblIdDocumento()); |
1162 | 1162 | ||
1163 | if(!isset($objAnexoDTO)){ | 1163 | if(!isset($objAnexoDTO)){ |
1164 | throw new InfraException("Componente digital do documento {$strProtocoloDocumentoFormatado} não pode ser localizado."); | 1164 | throw new InfraException("Componente digital do documento {$strProtocoloDocumentoFormatado} não pode ser localizado."); |
1165 | } | 1165 | } |
1166 | - | 1166 | + |
1167 | //VALIDAO DE TAMANHO DE DOCUMENTOS EXTERNOS PARA A EXPEDIO | 1167 | //VALIDAO DE TAMANHO DE DOCUMENTOS EXTERNOS PARA A EXPEDIO |
1168 | $objPenParametroRN = new PenParametroRN(); | 1168 | $objPenParametroRN = new PenParametroRN(); |
1169 | if($objAnexoDTO->getNumTamanho() > ($objPenParametroRN->getParametro('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO') * 1024 * 1024) && $objDocumentoDTO->getStrStaEstadoProtocolo() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO){ | 1169 | if($objAnexoDTO->getNumTamanho() > ($objPenParametroRN->getParametro('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO') * 1024 * 1024) && $objDocumentoDTO->getStrStaEstadoProtocolo() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO){ |
1170 | $strTamanhoFormatado = round(($objAnexoDTO->getNumTamanho() / 1024) / 1024,2); | 1170 | $strTamanhoFormatado = round(($objAnexoDTO->getNumTamanho() / 1024) / 1024,2); |
1171 | throw new InfraException("O tamanho do documento {$strTamanhoFormatado} MB é maior que os {$objPenParametroRN->getParametro('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO')} MB permitidos para trâmite externo de documentos."); | 1171 | throw new InfraException("O tamanho do documento {$strTamanhoFormatado} MB é maior que os {$objPenParametroRN->getParametro('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO')} MB permitidos para trâmite externo de documentos."); |
1172 | - } | 1172 | + } |
1173 | 1173 | ||
1174 | //Obtenção do conteúdo do documento externo | 1174 | //Obtenção do conteúdo do documento externo |
1175 | //TODO: Particionar o documento em tamanho menor caso ultrapasse XX megabytes | 1175 | //TODO: Particionar o documento em tamanho menor caso ultrapasse XX megabytes |
1176 | $strCaminhoAnexo = $this->objAnexoRN->obterLocalizacao($objAnexoDTO); | 1176 | $strCaminhoAnexo = $this->objAnexoRN->obterLocalizacao($objAnexoDTO); |
1177 | 1177 | ||
1178 | $fp = fopen($strCaminhoAnexo, "rb"); | 1178 | $fp = fopen($strCaminhoAnexo, "rb"); |
1179 | - try { | 1179 | + try { |
1180 | $strConteudoAssinatura = fread($fp, filesize($strCaminhoAnexo)); | 1180 | $strConteudoAssinatura = fread($fp, filesize($strCaminhoAnexo)); |
1181 | fclose($fp); | 1181 | fclose($fp); |
1182 | } catch(Exception $e) { | 1182 | } catch(Exception $e) { |
1183 | fclose($fp); | 1183 | fclose($fp); |
1184 | throw new InfraException("Erro obtendo conteúdo do anexo do documento {$strProtocoloDocumentoFormatado}", $e); | 1184 | throw new InfraException("Erro obtendo conteúdo do anexo do documento {$strProtocoloDocumentoFormatado}", $e); |
1185 | - } | 1185 | + } |
1186 | 1186 | ||
1187 | $finfo = finfo_open(FILEINFO_MIME_TYPE); | 1187 | $finfo = finfo_open(FILEINFO_MIME_TYPE); |
1188 | try { | 1188 | try { |
1189 | $strMimeType = finfo_file($finfo, $strCaminhoAnexo); | 1189 | $strMimeType = finfo_file($finfo, $strCaminhoAnexo); |
1190 | - | 1190 | + |
1191 | $strDadosComplementaresDoTipoDeArquivo = ""; | 1191 | $strDadosComplementaresDoTipoDeArquivo = ""; |
1192 | - | 1192 | + |
1193 | if(!array_search($strMimeType, $this->arrPenMimeTypes)){ | 1193 | if(!array_search($strMimeType, $this->arrPenMimeTypes)){ |
1194 | $strDadosComplementaresDoTipoDeArquivo = $strMimeType; | 1194 | $strDadosComplementaresDoTipoDeArquivo = $strMimeType; |
1195 | $strMimeType = 'outro'; | 1195 | $strMimeType = 'outro'; |
1196 | } | 1196 | } |
1197 | - | 1197 | + |
1198 | finfo_close($finfo); | 1198 | finfo_close($finfo); |
1199 | } catch(Exception $e) { | 1199 | } catch(Exception $e) { |
1200 | finfo_close($finfo); | 1200 | finfo_close($finfo); |
1201 | throw new InfraException("Erro obtendo informações do anexo do documento {$strProtocoloDocumentoFormatado}", $e); | 1201 | throw new InfraException("Erro obtendo informações do anexo do documento {$strProtocoloDocumentoFormatado}", $e); |
1202 | - } | 1202 | + } |
1203 | 1203 | ||
1204 | $arrInformacaoArquivo['NOME'] = $objAnexoDTO->getStrNome(); | 1204 | $arrInformacaoArquivo['NOME'] = $objAnexoDTO->getStrNome(); |
1205 | $arrInformacaoArquivo['CONTEUDO'] = $strConteudoAssinatura; | 1205 | $arrInformacaoArquivo['CONTEUDO'] = $strConteudoAssinatura; |
@@ -1208,23 +1208,23 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1208,23 +1208,23 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1208 | $arrInformacaoArquivo['ID_ANEXO'] = $objAnexoDTO->getNumIdAnexo(); | 1208 | $arrInformacaoArquivo['ID_ANEXO'] = $objAnexoDTO->getNumIdAnexo(); |
1209 | $arrInformacaoArquivo['dadosComplementaresDoTipoDeArquivo'] = $strDadosComplementaresDoTipoDeArquivo; | 1209 | $arrInformacaoArquivo['dadosComplementaresDoTipoDeArquivo'] = $strDadosComplementaresDoTipoDeArquivo; |
1210 | 1210 | ||
1211 | - } | 1211 | + } |
1212 | else { | 1212 | else { |
1213 | 1213 | ||
1214 | $objDocumentoDTO2 = new DocumentoDTO(); | 1214 | $objDocumentoDTO2 = new DocumentoDTO(); |
1215 | $objDocumentoDTO2->setDblIdDocumento($objDocumentoDTO->getDblIdDocumento()); | 1215 | $objDocumentoDTO2->setDblIdDocumento($objDocumentoDTO->getDblIdDocumento()); |
1216 | $objDocumentoDTO2->setObjInfraSessao(SessaoSEI::getInstance()); | 1216 | $objDocumentoDTO2->setObjInfraSessao(SessaoSEI::getInstance()); |
1217 | // $objDocumentoDTO2->setStrLinkDownload('controlador.php?acao=documento_download_anexo'); | 1217 | // $objDocumentoDTO2->setStrLinkDownload('controlador.php?acao=documento_download_anexo'); |
1218 | - | 1218 | + |
1219 | $objDocumentoRN = new DocumentoRN(); | 1219 | $objDocumentoRN = new DocumentoRN(); |
1220 | $strResultado = $objDocumentoRN->consultarHtmlFormulario($objDocumentoDTO2); | 1220 | $strResultado = $objDocumentoRN->consultarHtmlFormulario($objDocumentoDTO2); |
1221 | - | 1221 | + |
1222 | $arrInformacaoArquivo['NOME'] = $strProtocoloDocumentoFormatado . ".html"; | 1222 | $arrInformacaoArquivo['NOME'] = $strProtocoloDocumentoFormatado . ".html"; |
1223 | $arrInformacaoArquivo['CONTEUDO'] = $strResultado; | 1223 | $arrInformacaoArquivo['CONTEUDO'] = $strResultado; |
1224 | $arrInformacaoArquivo['TAMANHO'] = strlen($strResultado); | 1224 | $arrInformacaoArquivo['TAMANHO'] = strlen($strResultado); |
1225 | $arrInformacaoArquivo['MIME_TYPE'] = 'text/html'; | 1225 | $arrInformacaoArquivo['MIME_TYPE'] = 'text/html'; |
1226 | $arrInformacaoArquivo['ID_ANEXO'] = null; | 1226 | $arrInformacaoArquivo['ID_ANEXO'] = null; |
1227 | - | 1227 | + |
1228 | } | 1228 | } |
1229 | 1229 | ||
1230 | return $arrInformacaoArquivo; | 1230 | return $arrInformacaoArquivo; |
@@ -1247,7 +1247,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1247,7 +1247,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1247 | } else if(preg_match(self::REGEX_ARQUIVO_VIDEO, $strMimeType)){ | 1247 | } else if(preg_match(self::REGEX_ARQUIVO_VIDEO, $strMimeType)){ |
1248 | $resultado = self::TC_TIPO_CONTEUDO_VIDEO; | 1248 | $resultado = self::TC_TIPO_CONTEUDO_VIDEO; |
1249 | } | 1249 | } |
1250 | - | 1250 | + |
1251 | return $resultado; | 1251 | return $resultado; |
1252 | } | 1252 | } |
1253 | 1253 | ||
@@ -1263,7 +1263,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1263,7 +1263,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1263 | $objDocumento->identificacao->complemento = utf8_encode($parObjDocumentoDTO->getStrDescricaoUnidadeGeradoraProtocolo()); | 1263 | $objDocumento->identificacao->complemento = utf8_encode($parObjDocumentoDTO->getStrDescricaoUnidadeGeradoraProtocolo()); |
1264 | }else if($strStaNumeracao == SerieRN::$TN_SEQUENCIAL_ORGAO){ | 1264 | }else if($strStaNumeracao == SerieRN::$TN_SEQUENCIAL_ORGAO){ |
1265 | $objOrgaoDTO = $this->consultarOrgao($parObjDocumentoDTO->getNumIdOrgaoUnidadeGeradoraProtocolo()); | 1265 | $objOrgaoDTO = $this->consultarOrgao($parObjDocumentoDTO->getNumIdOrgaoUnidadeGeradoraProtocolo()); |
1266 | - $objDocumento->identificacao = new stdClass(); | 1266 | + $objDocumento->identificacao = new stdClass(); |
1267 | $objDocumento->identificacao->numero = $parObjDocumentoDTO->getStrNumero(); | 1267 | $objDocumento->identificacao->numero = $parObjDocumentoDTO->getStrNumero(); |
1268 | $objDocumento->identificacao->siglaDaUnidadeProdutora = $objOrgaoDTO->getStrSigla(); | 1268 | $objDocumento->identificacao->siglaDaUnidadeProdutora = $objOrgaoDTO->getStrSigla(); |
1269 | $objDocumento->identificacao->complemento = utf8_encode($objOrgaoDTO->getStrDescricao()); | 1269 | $objDocumento->identificacao->complemento = utf8_encode($objOrgaoDTO->getStrDescricao()); |
@@ -1283,7 +1283,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1283,7 +1283,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1283 | } | 1283 | } |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | - private function adicionarProcessosApensados($objProcesso, $arrIdProcessoApensado) | 1286 | + private function adicionarProcessosApensados($objProcesso, $arrIdProcessoApensado) |
1287 | { | 1287 | { |
1288 | if(isset($arrIdProcessoApensado) && is_array($arrIdProcessoApensado) && count($arrIdProcessoApensado) > 0) { | 1288 | if(isset($arrIdProcessoApensado) && is_array($arrIdProcessoApensado) && count($arrIdProcessoApensado) > 0) { |
1289 | $objProcesso->processoApensado = array(); | 1289 | $objProcesso->processoApensado = array(); |
@@ -1293,7 +1293,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1293,7 +1293,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1293 | } | 1293 | } |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | - private function consultarUnidade($numIdUnidade) | 1296 | + private function consultarUnidade($numIdUnidade) |
1297 | { | 1297 | { |
1298 | if(!isset($numIdUnidade)){ | 1298 | if(!isset($numIdUnidade)){ |
1299 | throw new InfraException('Parâmetro $numIdUnidade não informado.'); | 1299 | throw new InfraException('Parâmetro $numIdUnidade não informado.'); |
@@ -1329,14 +1329,14 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1329,14 +1329,14 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1329 | return $this->objOrgaoRN->consultarRN1352($objOrgaoDTO); | 1329 | return $this->objOrgaoRN->consultarRN1352($objOrgaoDTO); |
1330 | } | 1330 | } |
1331 | 1331 | ||
1332 | - public function consultarProcedimento($numIdProcedimento) | 1332 | + public function consultarProcedimento($numIdProcedimento) |
1333 | { | 1333 | { |
1334 | if(!isset($numIdProcedimento)){ | 1334 | if(!isset($numIdProcedimento)){ |
1335 | throw new InfraException('Parâmetro $numIdProcedimento não informado.'); | 1335 | throw new InfraException('Parâmetro $numIdProcedimento não informado.'); |
1336 | } | 1336 | } |
1337 | 1337 | ||
1338 | $objProcedimentoDTO = new ProcedimentoDTO(); | 1338 | $objProcedimentoDTO = new ProcedimentoDTO(); |
1339 | - $objProcedimentoDTO->setDblIdProcedimento($numIdProcedimento); | 1339 | + $objProcedimentoDTO->setDblIdProcedimento($numIdProcedimento); |
1340 | $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado(); | 1340 | $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado(); |
1341 | $objProcedimentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | 1341 | $objProcedimentoDTO->retStrStaNivelAcessoGlobalProtocolo(); |
1342 | $objProcedimentoDTO->retStrStaNivelAcessoLocalProtocolo(); | 1342 | $objProcedimentoDTO->retStrStaNivelAcessoLocalProtocolo(); |
@@ -1367,7 +1367,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1367,7 +1367,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1367 | return $this->objParticipanteRN->listarRN0189($objParticipanteDTO); | 1367 | return $this->objParticipanteRN->listarRN0189($objParticipanteDTO); |
1368 | } | 1368 | } |
1369 | 1369 | ||
1370 | - private function consultarProtocoloDocumento($numIdProcedimento) | 1370 | + private function consultarProtocoloDocumento($numIdProcedimento) |
1371 | { | 1371 | { |
1372 | $objProtocoloDTO = new ProtocoloDTO(); | 1372 | $objProtocoloDTO = new ProtocoloDTO(); |
1373 | 1373 | ||
@@ -1394,17 +1394,17 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1394,17 +1394,17 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1394 | $objAnexoDTO->retNumTamanho(); | 1394 | $objAnexoDTO->retNumTamanho(); |
1395 | $objAnexoDTO->retStrProtocoloFormatadoProtocolo(); | 1395 | $objAnexoDTO->retStrProtocoloFormatadoProtocolo(); |
1396 | $objAnexoDTO->setDblIdProtocolo($dblIdDocumento); | 1396 | $objAnexoDTO->setDblIdProtocolo($dblIdDocumento); |
1397 | - | 1397 | + |
1398 | return $this->objAnexoRN->consultarRN0736($objAnexoDTO); | 1398 | return $this->objAnexoRN->consultarRN0736($objAnexoDTO); |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | - private function consultarUsuario($numIdUsuario) | 1401 | + private function consultarUsuario($numIdUsuario) |
1402 | { | 1402 | { |
1403 | if(!isset($numIdUsuario)){ | 1403 | if(!isset($numIdUsuario)){ |
1404 | throw new InfraException('Parâmetro $numIdUsuario não informado.'); | 1404 | throw new InfraException('Parâmetro $numIdUsuario não informado.'); |
1405 | } | 1405 | } |
1406 | 1406 | ||
1407 | - $objUsuarioDTO = new UsuarioDTO(); | 1407 | + $objUsuarioDTO = new UsuarioDTO(); |
1408 | $objUsuarioDTO->setNumIdUsuario($numIdUsuario); | 1408 | $objUsuarioDTO->setNumIdUsuario($numIdUsuario); |
1409 | $objUsuarioDTO->retStrNome(); | 1409 | $objUsuarioDTO->retStrNome(); |
1410 | $objUsuarioDTO->retDblCpfContato(); | 1410 | $objUsuarioDTO->retDblCpfContato(); |
@@ -1412,22 +1412,22 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1412,22 +1412,22 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1412 | return $this->objUsuarioRN->consultarRN0489($objUsuarioDTO); | 1412 | return $this->objUsuarioRN->consultarRN0489($objUsuarioDTO); |
1413 | } | 1413 | } |
1414 | 1414 | ||
1415 | - public function listarDocumentos($idProcedimento) | ||
1416 | - { | 1415 | + public function listarDocumentos($idProcedimento) |
1416 | + { | ||
1417 | if(!isset($idProcedimento)){ | 1417 | if(!isset($idProcedimento)){ |
1418 | throw new InfraException('Parâmetro $idProcedimento não informado.'); | 1418 | throw new InfraException('Parâmetro $idProcedimento não informado.'); |
1419 | } | 1419 | } |
1420 | 1420 | ||
1421 | - $documentoDTO = new DocumentoDTO(); | 1421 | + $documentoDTO = new DocumentoDTO(); |
1422 | $documentoDTO->setDblIdProcedimento($idProcedimento); | 1422 | $documentoDTO->setDblIdProcedimento($idProcedimento); |
1423 | $documentoDTO->retStrDescricaoUnidadeGeradoraProtocolo(); | 1423 | $documentoDTO->retStrDescricaoUnidadeGeradoraProtocolo(); |
1424 | - $documentoDTO->retNumIdOrgaoUnidadeGeradoraProtocolo(); | 1424 | + $documentoDTO->retNumIdOrgaoUnidadeGeradoraProtocolo(); |
1425 | $documentoDTO->retStrSiglaUnidadeGeradoraProtocolo(); | 1425 | $documentoDTO->retStrSiglaUnidadeGeradoraProtocolo(); |
1426 | $documentoDTO->retStrStaNivelAcessoLocalProtocolo(); | 1426 | $documentoDTO->retStrStaNivelAcessoLocalProtocolo(); |
1427 | $documentoDTO->retStrProtocoloDocumentoFormatado(); | 1427 | $documentoDTO->retStrProtocoloDocumentoFormatado(); |
1428 | $documentoDTO->retStrStaEstadoProtocolo(); | 1428 | $documentoDTO->retStrStaEstadoProtocolo(); |
1429 | $documentoDTO->retNumIdUsuarioGeradorProtocolo(); | 1429 | $documentoDTO->retNumIdUsuarioGeradorProtocolo(); |
1430 | - $documentoDTO->retStrStaProtocoloProtocolo(); | 1430 | + $documentoDTO->retStrStaProtocoloProtocolo(); |
1431 | $documentoDTO->retNumIdUnidadeResponsavel(); | 1431 | $documentoDTO->retNumIdUnidadeResponsavel(); |
1432 | $documentoDTO->retStrDescricaoProtocolo(); | 1432 | $documentoDTO->retStrDescricaoProtocolo(); |
1433 | $documentoDTO->retDtaGeracaoProtocolo(); | 1433 | $documentoDTO->retDtaGeracaoProtocolo(); |
@@ -1441,52 +1441,52 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1441,52 +1441,52 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1441 | $documentoDTO->retStrStaDocumento(); | 1441 | $documentoDTO->retStrStaDocumento(); |
1442 | $documentoDTO->retNumIdHipoteseLegalProtocolo(); | 1442 | $documentoDTO->retNumIdHipoteseLegalProtocolo(); |
1443 | $documentoDTO->setOrdStrProtocoloDocumentoFormatado(InfraDTO::$TIPO_ORDENACAO_ASC); | 1443 | $documentoDTO->setOrdStrProtocoloDocumentoFormatado(InfraDTO::$TIPO_ORDENACAO_ASC); |
1444 | - | 1444 | + |
1445 | return $this->objDocumentoRN->listarRN0008($documentoDTO); | 1445 | return $this->objDocumentoRN->listarRN0008($documentoDTO); |
1446 | } | 1446 | } |
1447 | 1447 | ||
1448 | /** | 1448 | /** |
1449 | * Retorna o nome do documento no PEN | 1449 | * Retorna o nome do documento no PEN |
1450 | - * | 1450 | + * |
1451 | * @param int | 1451 | * @param int |
1452 | * @return string | 1452 | * @return string |
1453 | */ | 1453 | */ |
1454 | private function consultarNomeDocumentoPEN(DocumentoDTO $objDocumentoDTO){ | 1454 | private function consultarNomeDocumentoPEN(DocumentoDTO $objDocumentoDTO){ |
1455 | - | 1455 | + |
1456 | $objMapDTO = new PenRelTipoDocMapEnviadoDTO(true); | 1456 | $objMapDTO = new PenRelTipoDocMapEnviadoDTO(true); |
1457 | $objMapDTO->setNumMaxRegistrosRetorno(1); | 1457 | $objMapDTO->setNumMaxRegistrosRetorno(1); |
1458 | $objMapDTO->setNumIdSerie($objDocumentoDTO->getNumIdSerie()); | 1458 | $objMapDTO->setNumIdSerie($objDocumentoDTO->getNumIdSerie()); |
1459 | $objMapDTO->retStrNomeSerie(); | 1459 | $objMapDTO->retStrNomeSerie(); |
1460 | - | 1460 | + |
1461 | $objMapBD = new GenericoBD($this->getObjInfraIBanco()); | 1461 | $objMapBD = new GenericoBD($this->getObjInfraIBanco()); |
1462 | $objMapDTO = $objMapBD->consultar($objMapDTO); | 1462 | $objMapDTO = $objMapBD->consultar($objMapDTO); |
1463 | - | 1463 | + |
1464 | if(empty($objMapDTO)) { | 1464 | if(empty($objMapDTO)) { |
1465 | $strNome = '[ref '.$objDocumentoDTO->getStrNomeSerie().']'; | 1465 | $strNome = '[ref '.$objDocumentoDTO->getStrNomeSerie().']'; |
1466 | } | 1466 | } |
1467 | else { | 1467 | else { |
1468 | $strNome = $objMapDTO->getStrNomeSerie(); | 1468 | $strNome = $objMapDTO->getStrNomeSerie(); |
1469 | - | 1469 | + |
1470 | } | 1470 | } |
1471 | - | 1471 | + |
1472 | return $strNome; | 1472 | return $strNome; |
1473 | } | 1473 | } |
1474 | - | 1474 | + |
1475 | private function consultarDocumento($dblIdDocumento) | 1475 | private function consultarDocumento($dblIdDocumento) |
1476 | { | 1476 | { |
1477 | if(!isset($dblIdDocumento)){ | 1477 | if(!isset($dblIdDocumento)){ |
1478 | throw new InfraException('Parâmetro $dblIdDocumento não informado.'); | 1478 | throw new InfraException('Parâmetro $dblIdDocumento não informado.'); |
1479 | } | 1479 | } |
1480 | 1480 | ||
1481 | - $documentoDTO = new DocumentoDTO(); | 1481 | + $documentoDTO = new DocumentoDTO(); |
1482 | $documentoDTO->setDblIdDocumento($dblIdDocumento); | 1482 | $documentoDTO->setDblIdDocumento($dblIdDocumento); |
1483 | $documentoDTO->retStrDescricaoUnidadeGeradoraProtocolo(); | 1483 | $documentoDTO->retStrDescricaoUnidadeGeradoraProtocolo(); |
1484 | - //$documentoDTO->retNumIdOrgaoUnidadeGeradoraProtocolo(); | 1484 | + //$documentoDTO->retNumIdOrgaoUnidadeGeradoraProtocolo(); |
1485 | //$documentoDTO->retStrSiglaUnidadeGeradoraProtocolo(); | 1485 | //$documentoDTO->retStrSiglaUnidadeGeradoraProtocolo(); |
1486 | //$documentoDTO->retStrStaNivelAcessoLocalProtocolo(); | 1486 | //$documentoDTO->retStrStaNivelAcessoLocalProtocolo(); |
1487 | $documentoDTO->retStrProtocoloDocumentoFormatado(); | 1487 | $documentoDTO->retStrProtocoloDocumentoFormatado(); |
1488 | //$documentoDTO->retNumIdUsuarioGeradorProtocolo(); | 1488 | //$documentoDTO->retNumIdUsuarioGeradorProtocolo(); |
1489 | - $documentoDTO->retStrStaProtocoloProtocolo(); | 1489 | + $documentoDTO->retStrStaProtocoloProtocolo(); |
1490 | //$documentoDTO->retNumIdUnidadeResponsavel(); | 1490 | //$documentoDTO->retNumIdUnidadeResponsavel(); |
1491 | $documentoDTO->retStrDescricaoProtocolo(); | 1491 | $documentoDTO->retStrDescricaoProtocolo(); |
1492 | //$documentoDTO->retDtaGeracaoProtocolo(); | 1492 | //$documentoDTO->retDtaGeracaoProtocolo(); |
@@ -1499,7 +1499,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1499,7 +1499,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1499 | $documentoDTO->retStrStaEstadoProtocolo(); | 1499 | $documentoDTO->retStrStaEstadoProtocolo(); |
1500 | $documentoDTO->retNumIdHipoteseLegalProtocolo(); | 1500 | $documentoDTO->retNumIdHipoteseLegalProtocolo(); |
1501 | //$documentoDTO->retStrNumero(); | 1501 | //$documentoDTO->retStrNumero(); |
1502 | - | 1502 | + |
1503 | return $this->objDocumentoRN->consultarRN0005($documentoDTO); | 1503 | return $this->objDocumentoRN->consultarRN0005($documentoDTO); |
1504 | } | 1504 | } |
1505 | 1505 | ||
@@ -1531,17 +1531,17 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1531,17 +1531,17 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1531 | $objComponenteDigitalDTO->retStrProtocolo(); | 1531 | $objComponenteDigitalDTO->retStrProtocolo(); |
1532 | $objComponenteDigitalDTO->retStrNome(); | 1532 | $objComponenteDigitalDTO->retStrNome(); |
1533 | $objComponenteDigitalDTO->retDblIdProcedimento(); | 1533 | $objComponenteDigitalDTO->retDblIdProcedimento(); |
1534 | - | 1534 | + |
1535 | $arrComponentesDigitaisDTO = $objComponenteDigitalBD->listar($objComponenteDigitalDTO); | 1535 | $arrComponentesDigitaisDTO = $objComponenteDigitalBD->listar($objComponenteDigitalDTO); |
1536 | 1536 | ||
1537 | if (isset($arrComponentesDigitaisDTO) && count($arrComponentesDigitaisDTO) > 0) { | 1537 | if (isset($arrComponentesDigitaisDTO) && count($arrComponentesDigitaisDTO) > 0) { |
1538 | 1538 | ||
1539 | //TODO: Valida inconsistncia da quantidade de documentos solicitados e aqueles cadastrados no SEI | 1539 | //TODO: Valida inconsistncia da quantidade de documentos solicitados e aqueles cadastrados no SEI |
1540 | - | ||
1541 | - | ||
1542 | - //Construir objeto Componentes digitais | 1540 | + |
1541 | + | ||
1542 | + //Construir objeto Componentes digitais | ||
1543 | foreach ($arrComponentesDigitaisDTO as $objComponenteDigitalDTO) { | 1543 | foreach ($arrComponentesDigitaisDTO as $objComponenteDigitalDTO) { |
1544 | - | 1544 | + |
1545 | $this->barraProgresso->mover(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_DOCUMENTO); | 1545 | $this->barraProgresso->mover(ProcessoEletronicoINT::NEE_EXPEDICAO_ETAPA_DOCUMENTO); |
1546 | $this->barraProgresso->setStrRotulo(sprintf(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_DOCUMENTO, $objComponenteDigitalDTO->getStrProtocoloDocumentoFormatado())); | 1546 | $this->barraProgresso->setStrRotulo(sprintf(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_DOCUMENTO, $objComponenteDigitalDTO->getStrProtocoloDocumentoFormatado())); |
1547 | 1547 | ||
@@ -1563,7 +1563,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1563,7 +1563,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1563 | $dadosDoComponenteDigital->conteudoDoComponenteDigital = new SoapVar($arrInformacaoArquivo['CONTEUDO'], XSD_BASE64BINARY); | 1563 | $dadosDoComponenteDigital->conteudoDoComponenteDigital = new SoapVar($arrInformacaoArquivo['CONTEUDO'], XSD_BASE64BINARY); |
1564 | 1564 | ||
1565 | 1565 | ||
1566 | - | 1566 | + |
1567 | try { | 1567 | try { |
1568 | //Enviar componentes digitais | 1568 | //Enviar componentes digitais |
1569 | $parametros = new stdClass(); | 1569 | $parametros = new stdClass(); |
@@ -1590,33 +1590,33 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1590,33 +1590,33 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1590 | $objInfraException->adicionarValidacao('Parâmetro $objExpedirProcedimentoDTO não informado.'); | 1590 | $objInfraException->adicionarValidacao('Parâmetro $objExpedirProcedimentoDTO não informado.'); |
1591 | } | 1591 | } |
1592 | 1592 | ||
1593 | - //TODO: Validar se repositrio de origem foi informado | 1593 | + //TODO: Validar se repositrio de origem foi informado |
1594 | if (InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdRepositorioOrigem())){ | 1594 | if (InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdRepositorioOrigem())){ |
1595 | $objInfraException->adicionarValidacao('Identificação do repositório de estruturas da unidade atual não informado.'); | 1595 | $objInfraException->adicionarValidacao('Identificação do repositório de estruturas da unidade atual não informado.'); |
1596 | } | 1596 | } |
1597 | - | 1597 | + |
1598 | //TODO: Validar se unidade de origem foi informado | 1598 | //TODO: Validar se unidade de origem foi informado |
1599 | if (InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdUnidadeOrigem())){ | 1599 | if (InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdUnidadeOrigem())){ |
1600 | $objInfraException->adicionarValidacao('Identificação da unidade atual no repositório de estruturas organizacionais não informado.'); | 1600 | $objInfraException->adicionarValidacao('Identificação da unidade atual no repositório de estruturas organizacionais não informado.'); |
1601 | } | 1601 | } |
1602 | - | 1602 | + |
1603 | //TODO: Validar se repositrio foi devidamente informado | 1603 | //TODO: Validar se repositrio foi devidamente informado |
1604 | if (InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdRepositorioDestino())){ | 1604 | if (InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdRepositorioDestino())){ |
1605 | $objInfraException->adicionarValidacao('Repositório de estruturas organizacionais não informado.'); | 1605 | $objInfraException->adicionarValidacao('Repositório de estruturas organizacionais não informado.'); |
1606 | } | 1606 | } |
1607 | - | 1607 | + |
1608 | //TODO: Validar se unidade foi devidamente informada | 1608 | //TODO: Validar se unidade foi devidamente informada |
1609 | if (InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdUnidadeDestino())){ | 1609 | if (InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdUnidadeDestino())){ |
1610 | $objInfraException->adicionarValidacao('Unidade de destino não informado.'); | 1610 | $objInfraException->adicionarValidacao('Unidade de destino não informado.'); |
1611 | } | 1611 | } |
1612 | 1612 | ||
1613 | - //TODO: Validar se motivo de urgncia foi devidamente informado, caso expedio urgente | 1613 | + //TODO: Validar se motivo de urgncia foi devidamente informado, caso expedio urgente |
1614 | if ($objExpedirProcedimentoDTO->getBolSinUrgente() && InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdMotivoUrgencia())){ | 1614 | if ($objExpedirProcedimentoDTO->getBolSinUrgente() && InfraString::isBolVazia($objExpedirProcedimentoDTO->getNumIdMotivoUrgencia())){ |
1615 | $objInfraException->adicionarValidacao('Motivo de urgência não informado.'); | 1615 | $objInfraException->adicionarValidacao('Motivo de urgência não informado.'); |
1616 | } | 1616 | } |
1617 | } | 1617 | } |
1618 | 1618 | ||
1619 | - private function validarDocumentacaoExistende(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) | 1619 | + private function validarDocumentacaoExistende(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) |
1620 | { | 1620 | { |
1621 | $arrObjDocumentoDTO = $objProcedimentoDTO->getArrObjDocumentoDTO(); | 1621 | $arrObjDocumentoDTO = $objProcedimentoDTO->getArrObjDocumentoDTO(); |
1622 | if(!isset($arrObjDocumentoDTO) || count($arrObjDocumentoDTO) == 0) { | 1622 | if(!isset($arrObjDocumentoDTO) || count($arrObjDocumentoDTO) == 0) { |
@@ -1626,7 +1626,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1626,7 +1626,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1626 | 1626 | ||
1627 | private function validarDadosProcedimento(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) | 1627 | private function validarDadosProcedimento(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) |
1628 | { | 1628 | { |
1629 | - if($objProcedimentoDTO->isSetStrDescricaoProtocolo() && InfraString::isBolVazia($objProcedimentoDTO->getStrDescricaoProtocolo())) { | 1629 | + if($objProcedimentoDTO->isSetStrDescricaoProtocolo() && InfraString::isBolVazia($objProcedimentoDTO->getStrDescricaoProtocolo())) { |
1630 | $objInfraException->adicionarValidacao("Descrição do processo {$objProcedimentoDTO->getStrProtocoloProcedimentoFormatado()} não informado.", $strAtributoValidacao); | 1630 | $objInfraException->adicionarValidacao("Descrição do processo {$objProcedimentoDTO->getStrProtocoloProcedimentoFormatado()} não informado.", $strAtributoValidacao); |
1631 | } | 1631 | } |
1632 | 1632 | ||
@@ -1636,44 +1636,44 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1636,44 +1636,44 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1636 | } | 1636 | } |
1637 | 1637 | ||
1638 | private function validarDadosDocumentos(InfraException $objInfraException, $arrDocumentoDTO, $strAtributoValidacao = null) { | 1638 | private function validarDadosDocumentos(InfraException $objInfraException, $arrDocumentoDTO, $strAtributoValidacao = null) { |
1639 | - | 1639 | + |
1640 | if(!empty($arrDocumentoDTO)) { | 1640 | if(!empty($arrDocumentoDTO)) { |
1641 | - | 1641 | + |
1642 | $objDocMapDTO = new PenRelTipoDocMapEnviadoDTO(); | 1642 | $objDocMapDTO = new PenRelTipoDocMapEnviadoDTO(); |
1643 | $objGenericoBD = new GenericoBD($this->inicializarObjInfraIBanco()); | 1643 | $objGenericoBD = new GenericoBD($this->inicializarObjInfraIBanco()); |
1644 | $objPenRelHipoteseLegalEnvioRN = new PenRelHipoteseLegalEnvioRN(); | 1644 | $objPenRelHipoteseLegalEnvioRN = new PenRelHipoteseLegalEnvioRN(); |
1645 | - | 1645 | + |
1646 | foreach($arrDocumentoDTO as $objDocumentoDTO) { | 1646 | foreach($arrDocumentoDTO as $objDocumentoDTO) { |
1647 | $objDocMapDTO->unSetTodos(); | 1647 | $objDocMapDTO->unSetTodos(); |
1648 | $objDocMapDTO->setNumIdSerie($objDocumentoDTO->getNumIdSerie()); | 1648 | $objDocMapDTO->setNumIdSerie($objDocumentoDTO->getNumIdSerie()); |
1649 | - | ||
1650 | - if($objGenericoBD->contar($objDocMapDTO) == 0) { | ||
1651 | - | 1649 | + |
1650 | + if($objGenericoBD->contar($objDocMapDTO) == 0) { | ||
1651 | + | ||
1652 | $strDescricao = sprintf( | 1652 | $strDescricao = sprintf( |
1653 | - 'Não existe mapeamento de envio para %s no documento %s', | 1653 | + 'Não existe mapeamento de envio para %s no documento %s', |
1654 | $objDocumentoDTO->getStrNomeSerie(), | 1654 | $objDocumentoDTO->getStrNomeSerie(), |
1655 | - $objDocumentoDTO->getStrProtocoloDocumentoFormatado() | 1655 | + $objDocumentoDTO->getStrProtocoloDocumentoFormatado() |
1656 | ); | 1656 | ); |
1657 | - | 1657 | + |
1658 | $objInfraException->adicionarValidacao($strDescricao, $strAtributoValidacao); | 1658 | $objInfraException->adicionarValidacao($strDescricao, $strAtributoValidacao); |
1659 | } | 1659 | } |
1660 | - | ||
1661 | - if (!empty($objDocumentoDTO->getNumIdHipoteseLegalProtocolo()) | 1660 | + |
1661 | + if (!empty($objDocumentoDTO->getNumIdHipoteseLegalProtocolo()) | ||
1662 | && empty($objPenRelHipoteseLegalEnvioRN->getIdHipoteseLegalPEN($objDocumentoDTO->getNumIdHipoteseLegalProtocolo()))) { | 1662 | && empty($objPenRelHipoteseLegalEnvioRN->getIdHipoteseLegalPEN($objDocumentoDTO->getNumIdHipoteseLegalProtocolo()))) { |
1663 | - | 1663 | + |
1664 | $objHipoteseLegalDTO = new HipoteseLegalDTO(); | 1664 | $objHipoteseLegalDTO = new HipoteseLegalDTO(); |
1665 | $objHipoteseLegalDTO->setNumIdHipoteseLegal($objDocumentoDTO->getNumIdHipoteseLegalProtocolo()); | 1665 | $objHipoteseLegalDTO->setNumIdHipoteseLegal($objDocumentoDTO->getNumIdHipoteseLegalProtocolo()); |
1666 | $objHipoteseLegalDTO->retStrNome(); | 1666 | $objHipoteseLegalDTO->retStrNome(); |
1667 | $objHipoteseLegalRN = new HipoteseLegalRN(); | 1667 | $objHipoteseLegalRN = new HipoteseLegalRN(); |
1668 | $dados = $objHipoteseLegalRN->consultar($objHipoteseLegalDTO); | 1668 | $dados = $objHipoteseLegalRN->consultar($objHipoteseLegalDTO); |
1669 | - | 1669 | + |
1670 | $objInfraException->adicionarValidacao('Hipótese legal "'.$dados->getStrNome().'" do documento '.$objDocumentoDTO->getStrNomeSerie(). ' ' . $objDocumentoDTO->getStrProtocoloDocumentoFormatado() .' não mapeada', $strAtributoValidacao); | 1670 | $objInfraException->adicionarValidacao('Hipótese legal "'.$dados->getStrNome().'" do documento '.$objDocumentoDTO->getStrNomeSerie(). ' ' . $objDocumentoDTO->getStrProtocoloDocumentoFormatado() .' não mapeada', $strAtributoValidacao); |
1671 | } | 1671 | } |
1672 | } | 1672 | } |
1673 | } | 1673 | } |
1674 | } | 1674 | } |
1675 | 1675 | ||
1676 | - private function validarProcessoAbertoUnidade(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) | 1676 | + private function validarProcessoAbertoUnidade(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) |
1677 | { | 1677 | { |
1678 | $objAtividadeDTO = new AtividadeDTO(); | 1678 | $objAtividadeDTO = new AtividadeDTO(); |
1679 | $objAtividadeDTO->setDistinct(true); | 1679 | $objAtividadeDTO->setDistinct(true); |
@@ -1684,26 +1684,26 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1684,26 +1684,26 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1684 | 1684 | ||
1685 | $arrObjAtividadeDTO = $this->objAtividadeRN->listarRN0036($objAtividadeDTO); | 1685 | $arrObjAtividadeDTO = $this->objAtividadeRN->listarRN0036($objAtividadeDTO); |
1686 | 1686 | ||
1687 | - if(isset($arrObjAtividadeDTO) && count($arrObjAtividadeDTO) > 1) { | 1687 | + if(isset($arrObjAtividadeDTO) && count($arrObjAtividadeDTO) > 1) { |
1688 | $strSiglaUnidade = implode(', ', InfraArray::converterArrInfraDTO($arrObjAtividadeDTO, 'SiglaUnidade')); | 1688 | $strSiglaUnidade = implode(', ', InfraArray::converterArrInfraDTO($arrObjAtividadeDTO, 'SiglaUnidade')); |
1689 | $objInfraException->adicionarValidacao("Não é possível trâmitar um processo aberto em mais de uma unidade. ($strSiglaUnidade)", $strAtributoValidacao); | 1689 | $objInfraException->adicionarValidacao("Não é possível trâmitar um processo aberto em mais de uma unidade. ($strSiglaUnidade)", $strAtributoValidacao); |
1690 | } | 1690 | } |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | - private function validarNivelAcessoProcesso(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) | 1693 | + private function validarNivelAcessoProcesso(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) |
1694 | { | 1694 | { |
1695 | - // $objProcedimentoDTO = new ProcedimentoDTO(); | 1695 | + // $objProcedimentoDTO = new ProcedimentoDTO(); |
1696 | 1696 | ||
1697 | // $objProcedimentoDTO->setDblIdProcedimento($idProcedimento); | 1697 | // $objProcedimentoDTO->setDblIdProcedimento($idProcedimento); |
1698 | // $objProcedimentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | 1698 | // $objProcedimentoDTO->retStrStaNivelAcessoGlobalProtocolo(); |
1699 | 1699 | ||
1700 | // $objProcedimentoDTO = $this->objProcedimentoRN->consultarRN0201($objProcedimentoDTO); | 1700 | // $objProcedimentoDTO = $this->objProcedimentoRN->consultarRN0201($objProcedimentoDTO); |
1701 | - | 1701 | + |
1702 | if ($objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_SIGILOSO) { | 1702 | if ($objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_SIGILOSO) { |
1703 | $objInfraException->adicionarValidacao('Não é possível trâmitar um processo com informações sigilosas.', $strAtributoValidacao); | 1703 | $objInfraException->adicionarValidacao('Não é possível trâmitar um processo com informações sigilosas.', $strAtributoValidacao); |
1704 | } | 1704 | } |
1705 | } | 1705 | } |
1706 | - | 1706 | + |
1707 | /** | 1707 | /** |
1708 | * Valida existncia da Hiptese legal de Envio | 1708 | * Valida existncia da Hiptese legal de Envio |
1709 | * @param InfraException $objInfraException | 1709 | * @param InfraException $objInfraException |
@@ -1719,9 +1719,9 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1719,9 +1719,9 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1719 | } | 1719 | } |
1720 | 1720 | ||
1721 | private function validarAssinaturas(InfraException $objInfraException, $objProcedimentoDTO, $strAtributoValidacao = null) { | 1721 | private function validarAssinaturas(InfraException $objInfraException, $objProcedimentoDTO, $strAtributoValidacao = null) { |
1722 | - | 1722 | + |
1723 | $bolAssinaturaCorretas = true; | 1723 | $bolAssinaturaCorretas = true; |
1724 | - | 1724 | + |
1725 | $objDocumentoDTO = new DocumentoDTO(); | 1725 | $objDocumentoDTO = new DocumentoDTO(); |
1726 | $objDocumentoDTO->setDblIdProcedimento($objProcedimentoDTO->getDblIdProcedimento()); | 1726 | $objDocumentoDTO->setDblIdProcedimento($objProcedimentoDTO->getDblIdProcedimento()); |
1727 | // $objDocumentoDTO->setStrStaEditor(array(EditorRN::$TE_EDOC, EditorRN::$TE_INTERNO), InfraDTO::$OPER_IN); | 1727 | // $objDocumentoDTO->setStrStaEditor(array(EditorRN::$TE_EDOC, EditorRN::$TE_INTERNO), InfraDTO::$OPER_IN); |
@@ -1731,9 +1731,9 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1731,9 +1731,9 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1731 | 1731 | ||
1732 | $objDocumentoRN = new DocumentoRN(); | 1732 | $objDocumentoRN = new DocumentoRN(); |
1733 | $arrObjDocumentoDTO = (array)$objDocumentoRN->listarRN0008($objDocumentoDTO); | 1733 | $arrObjDocumentoDTO = (array)$objDocumentoRN->listarRN0008($objDocumentoDTO); |
1734 | - | 1734 | + |
1735 | if(!empty($arrObjDocumentoDTO)) { | 1735 | if(!empty($arrObjDocumentoDTO)) { |
1736 | - | 1736 | + |
1737 | $objAssinaturaDTO = new AssinaturaDTO(); | 1737 | $objAssinaturaDTO = new AssinaturaDTO(); |
1738 | $objAssinaturaDTO->setDistinct(true); | 1738 | $objAssinaturaDTO->setDistinct(true); |
1739 | $objAssinaturaDTO->retDblIdDocumento(); | 1739 | $objAssinaturaDTO->retDblIdDocumento(); |
@@ -1747,7 +1747,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1747,7 +1747,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1747 | // Se o documento no tem assinatura e não foi cancelado ento | 1747 | // Se o documento no tem assinatura e não foi cancelado ento |
1748 | // cai na regra de validao | 1748 | // cai na regra de validao |
1749 | if($objAssinaturaRN->contarRN1324($objAssinaturaDTO) == 0 && $objDocumentoDTO->getStrStaEstadoProtocolo() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO && ($objDocumentoDTO->getStrStaDocumento() == DocumentoRN::$TD_EDITOR_EDOC || $objDocumentoDTO->getStrStaDocumento() == DocumentoRN::$TD_EDITOR_INTERNO) ){ | 1749 | if($objAssinaturaRN->contarRN1324($objAssinaturaDTO) == 0 && $objDocumentoDTO->getStrStaEstadoProtocolo() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO && ($objDocumentoDTO->getStrStaDocumento() == DocumentoRN::$TD_EDITOR_EDOC || $objDocumentoDTO->getStrStaDocumento() == DocumentoRN::$TD_EDITOR_INTERNO) ){ |
1750 | - | 1750 | + |
1751 | $bolAssinaturaCorretas = false; | 1751 | $bolAssinaturaCorretas = false; |
1752 | } | 1752 | } |
1753 | } | 1753 | } |
@@ -1764,17 +1764,17 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1764,17 +1764,17 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1764 | * @param ProcedimentoDTO $objProcedimentoDTO Informações sobre o procedimento a ser expedido | 1764 | * @param ProcedimentoDTO $objProcedimentoDTO Informações sobre o procedimento a ser expedido |
1765 | * @param string $strAtributoValidacao indice para o InfraException separar os processos | 1765 | * @param string $strAtributoValidacao indice para o InfraException separar os processos |
1766 | */ | 1766 | */ |
1767 | - public function validarPreCondicoesExpedirProcedimento(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) | 1767 | + public function validarPreCondicoesExpedirProcedimento(InfraException $objInfraException, ProcedimentoDTO $objProcedimentoDTO, $strAtributoValidacao = null) |
1768 | { | 1768 | { |
1769 | //TODO: Validar pr-condies dos processos e documentos apensados | 1769 | //TODO: Validar pr-condies dos processos e documentos apensados |
1770 | $this->validarDadosProcedimento($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); | 1770 | $this->validarDadosProcedimento($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); |
1771 | - $this->validarDadosDocumentos($objInfraException, $objProcedimentoDTO->getArrObjDocumentoDTO(), $strAtributoValidacao); | 1771 | + $this->validarDadosDocumentos($objInfraException, $objProcedimentoDTO->getArrObjDocumentoDTO(), $strAtributoValidacao); |
1772 | 1772 | ||
1773 | $this->validarDocumentacaoExistende($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); | 1773 | $this->validarDocumentacaoExistende($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); |
1774 | $this->validarProcessoAbertoUnidade($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); | 1774 | $this->validarProcessoAbertoUnidade($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); |
1775 | $this->validarNivelAcessoProcesso($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); | 1775 | $this->validarNivelAcessoProcesso($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); |
1776 | $this->validarHipoteseLegalEnvio($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); | 1776 | $this->validarHipoteseLegalEnvio($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); |
1777 | - $this->validarAssinaturas($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); | 1777 | + $this->validarAssinaturas($objInfraException, $objProcedimentoDTO, $strAtributoValidacao); |
1778 | } | 1778 | } |
1779 | 1779 | ||
1780 | 1780 | ||
@@ -1803,9 +1803,9 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1803,9 +1803,9 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1803 | if(!$idUnidadeAtual){ | 1803 | if(!$idUnidadeAtual){ |
1804 | $objInfraException->adicionarValidacao('Processo inválido.'); | 1804 | $objInfraException->adicionarValidacao('Processo inválido.'); |
1805 | } | 1805 | } |
1806 | - | ||
1807 | - $objInfraException->lancarValidacoes(); | ||
1808 | - //Pesquisar procedimentos que esto abertos na unidade atual | 1806 | + |
1807 | + $objInfraException->lancarValidacoes(); | ||
1808 | + //Pesquisar procedimentos que esto abertos na unidade atual | ||
1809 | $objAtividadeDTO = new AtividadeDTO(); | 1809 | $objAtividadeDTO = new AtividadeDTO(); |
1810 | $objAtividadeDTO->setDistinct(true); | 1810 | $objAtividadeDTO->setDistinct(true); |
1811 | $objAtividadeDTO->retDblIdProtocolo(); | 1811 | $objAtividadeDTO->retDblIdProtocolo(); |
@@ -1813,7 +1813,7 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1813,7 +1813,7 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1813 | $objAtividadeDTO->retNumIdUnidade(); | 1813 | $objAtividadeDTO->retNumIdUnidade(); |
1814 | $objAtividadeDTO->retStrDescricaoUnidadeOrigem(); | 1814 | $objAtividadeDTO->retStrDescricaoUnidadeOrigem(); |
1815 | $objAtividadeDTO->setNumIdUnidade($idUnidadeAtual); | 1815 | $objAtividadeDTO->setNumIdUnidade($idUnidadeAtual); |
1816 | - $objAtividadeDTO->setDblIdProtocolo($dblIdProcedimentoAtual, InfraDTO::$OPER_DIFERENTE); | 1816 | + $objAtividadeDTO->setDblIdProtocolo($dblIdProcedimentoAtual, InfraDTO::$OPER_DIFERENTE); |
1817 | $objAtividadeDTO->setDthConclusao(null); | 1817 | $objAtividadeDTO->setDthConclusao(null); |
1818 | $objAtividadeDTO->setStrStaEstadoProtocolo(ProtocoloRN::$TE_NORMAL); | 1818 | $objAtividadeDTO->setStrStaEstadoProtocolo(ProtocoloRN::$TE_NORMAL); |
1819 | 1819 | ||
@@ -1841,13 +1841,13 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1841,13 +1841,13 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1841 | 1841 | ||
1842 | if(is_array($value) && count($value) == 1) { | 1842 | if(is_array($value) && count($value) == 1) { |
1843 | $arrResultado[] = $value[0]; | 1843 | $arrResultado[] = $value[0]; |
1844 | - } | 1844 | + } |
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | $arrObjProcessosApensados = array_slice($arrResultado, 0, $numRegistros); | 1847 | $arrObjProcessosApensados = array_slice($arrResultado, 0, $numRegistros); |
1848 | 1848 | ||
1849 | } catch(Exception $e) { | 1849 | } catch(Exception $e) { |
1850 | - throw new InfraException("Error Processing Request", $e); | 1850 | + throw new InfraException("Error Processing Request", $e); |
1851 | } | 1851 | } |
1852 | 1852 | ||
1853 | return $arrObjProcessosApensados; | 1853 | return $arrObjProcessosApensados; |
@@ -1860,21 +1860,21 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1860,21 +1860,21 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1860 | $objAtividadeDTO->retDblIdProtocolo(); | 1860 | $objAtividadeDTO->retDblIdProtocolo(); |
1861 | $objAtividadeDTO->retNumIdUnidade(); | 1861 | $objAtividadeDTO->retNumIdUnidade(); |
1862 | //$objAtividadeDTO->setNumIdUnidade($idUnidadeAtual); | 1862 | //$objAtividadeDTO->setNumIdUnidade($idUnidadeAtual); |
1863 | - $objAtividadeDTO->setDblIdProtocolo($dblIdProcedimentoAtual, InfraDTO::$OPER_DIFERENTE); | 1863 | + $objAtividadeDTO->setDblIdProtocolo($dblIdProcedimentoAtual, InfraDTO::$OPER_DIFERENTE); |
1864 | $objAtividadeDTO->setDthConclusao(null); | 1864 | $objAtividadeDTO->setDthConclusao(null); |
1865 | $objAtividadeDTO->setStrStaEstadoProtocolo(ProtocoloRN::$TE_NORMAL); | 1865 | $objAtividadeDTO->setStrStaEstadoProtocolo(ProtocoloRN::$TE_NORMAL); |
1866 | - | 1866 | + |
1867 | $arrObjAtividadeDTO = $this->objAtividadeRN->listarRN0036($objAtividadeDTO); | 1867 | $arrObjAtividadeDTO = $this->objAtividadeRN->listarRN0036($objAtividadeDTO); |
1868 | - | 1868 | + |
1869 | $arrayProcedimentos = array(); | 1869 | $arrayProcedimentos = array(); |
1870 | - | 1870 | + |
1871 | foreach($arrObjAtividadeDTO as $atividade){ | 1871 | foreach($arrObjAtividadeDTO as $atividade){ |
1872 | $arrayProcedimentos[$atividade->getDblIdProtocolo()][$atividade->getNumIdUnidade()] = 1; | 1872 | $arrayProcedimentos[$atividade->getDblIdProtocolo()][$atividade->getNumIdUnidade()] = 1; |
1873 | } | 1873 | } |
1874 | - | 1874 | + |
1875 | return $arrayProcedimentos; | 1875 | return $arrayProcedimentos; |
1876 | } | 1876 | } |
1877 | - | 1877 | + |
1878 | public function listarProcessosApensadosAvancado(AtividadeDTO $objAtividadeDTO, $dblIdProcedimentoAtual, $idUnidadeAtual, $strPalavrasPesquisa = '', $strDescricaoPesquisa = '', $numRegistros = 15) { | 1878 | public function listarProcessosApensadosAvancado(AtividadeDTO $objAtividadeDTO, $dblIdProcedimentoAtual, $idUnidadeAtual, $strPalavrasPesquisa = '', $strDescricaoPesquisa = '', $numRegistros = 15) { |
1879 | 1879 | ||
1880 | $arrObjProcessosApensados = array(); | 1880 | $arrObjProcessosApensados = array(); |
@@ -1886,21 +1886,21 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1886,21 +1886,21 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1886 | if(!$idUnidadeAtual){ | 1886 | if(!$idUnidadeAtual){ |
1887 | $objInfraException->adicionarValidacao('Processo inválido.'); | 1887 | $objInfraException->adicionarValidacao('Processo inválido.'); |
1888 | } | 1888 | } |
1889 | - | ||
1890 | - $objInfraException->lancarValidacoes(); | ||
1891 | - //Pesquisar procedimentos que esto abertos na unidade atual | ||
1892 | - | 1889 | + |
1890 | + $objInfraException->lancarValidacoes(); | ||
1891 | + //Pesquisar procedimentos que esto abertos na unidade atual | ||
1892 | + | ||
1893 | $objAtividadeDTO->setDistinct(true); | 1893 | $objAtividadeDTO->setDistinct(true); |
1894 | $objAtividadeDTO->retDblIdProtocolo(); | 1894 | $objAtividadeDTO->retDblIdProtocolo(); |
1895 | $objAtividadeDTO->retStrProtocoloFormatadoProtocolo(); | 1895 | $objAtividadeDTO->retStrProtocoloFormatadoProtocolo(); |
1896 | $objAtividadeDTO->retNumIdUnidade(); | 1896 | $objAtividadeDTO->retNumIdUnidade(); |
1897 | $objAtividadeDTO->retStrDescricaoUnidadeOrigem(); | 1897 | $objAtividadeDTO->retStrDescricaoUnidadeOrigem(); |
1898 | $objAtividadeDTO->setNumIdUnidade($idUnidadeAtual); | 1898 | $objAtividadeDTO->setNumIdUnidade($idUnidadeAtual); |
1899 | - $objAtividadeDTO->setDblIdProtocolo($dblIdProcedimentoAtual, InfraDTO::$OPER_DIFERENTE); | 1899 | + $objAtividadeDTO->setDblIdProtocolo($dblIdProcedimentoAtual, InfraDTO::$OPER_DIFERENTE); |
1900 | $objAtividadeDTO->setDthConclusao(null); | 1900 | $objAtividadeDTO->setDthConclusao(null); |
1901 | $objAtividadeDTO->setStrStaEstadoProtocolo(ProtocoloRN::$TE_NORMAL); | 1901 | $objAtividadeDTO->setStrStaEstadoProtocolo(ProtocoloRN::$TE_NORMAL); |
1902 | ///$objAtividadeDTO->setStrDescricaoProtocolo('%'.$strDescricaoPesquisa.'%',InfraDTO::$OPER_LIKE); | 1902 | ///$objAtividadeDTO->setStrDescricaoProtocolo('%'.$strDescricaoPesquisa.'%',InfraDTO::$OPER_LIKE); |
1903 | - | 1903 | + |
1904 | $arrPalavrasPesquisa = explode(' ',$strPalavrasPesquisa); | 1904 | $arrPalavrasPesquisa = explode(' ',$strPalavrasPesquisa); |
1905 | for($i=0; $i<count($arrPalavrasPesquisa); $i++) { | 1905 | for($i=0; $i<count($arrPalavrasPesquisa); $i++) { |
1906 | $arrPalavrasPesquisa[$i] = '%'.$arrPalavrasPesquisa[$i].'%'; | 1906 | $arrPalavrasPesquisa[$i] = '%'.$arrPalavrasPesquisa[$i].'%'; |
@@ -1924,13 +1924,13 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1924,13 +1924,13 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1924 | 1924 | ||
1925 | if(is_array($value) && count($value) == 1) { | 1925 | if(is_array($value) && count($value) == 1) { |
1926 | $arrResultado[] = $value[0]; | 1926 | $arrResultado[] = $value[0]; |
1927 | - } | 1927 | + } |
1928 | } | 1928 | } |
1929 | 1929 | ||
1930 | $arrObjProcessosApensados = array_slice($arrResultado, 0, $numRegistros); | 1930 | $arrObjProcessosApensados = array_slice($arrResultado, 0, $numRegistros); |
1931 | 1931 | ||
1932 | } catch(Exception $e) { | 1932 | } catch(Exception $e) { |
1933 | - throw new InfraException("Error Processing Request", $e); | 1933 | + throw new InfraException("Error Processing Request", $e); |
1934 | } | 1934 | } |
1935 | 1935 | ||
1936 | return $arrObjProcessosApensados; | 1936 | return $arrObjProcessosApensados; |
@@ -1939,21 +1939,21 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1939,21 +1939,21 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1939 | 1939 | ||
1940 | /** | 1940 | /** |
1941 | * Recebe o recibo de tramite do procedimento do barramento | 1941 | * Recebe o recibo de tramite do procedimento do barramento |
1942 | - * | 1942 | + * |
1943 | * @param int $parNumIdTramite | 1943 | * @param int $parNumIdTramite |
1944 | * @return bool | 1944 | * @return bool |
1945 | */ | 1945 | */ |
1946 | protected function receberReciboDeEnvioControlado($parNumIdTramite){ | 1946 | protected function receberReciboDeEnvioControlado($parNumIdTramite){ |
1947 | - | 1947 | + |
1948 | if (empty($parNumIdTramite)) { | 1948 | if (empty($parNumIdTramite)) { |
1949 | return false; | 1949 | return false; |
1950 | } | 1950 | } |
1951 | - | 1951 | + |
1952 | $objReciboTramiteEnviadoDTO = new ReciboTramiteEnviadoDTO(); | 1952 | $objReciboTramiteEnviadoDTO = new ReciboTramiteEnviadoDTO(); |
1953 | $objReciboTramiteEnviadoDTO->setNumIdTramite($parNumIdTramite); | 1953 | $objReciboTramiteEnviadoDTO->setNumIdTramite($parNumIdTramite); |
1954 | - | 1954 | + |
1955 | $objGenericoBD = new GenericoBD(BancoSEI::getInstance()); | 1955 | $objGenericoBD = new GenericoBD(BancoSEI::getInstance()); |
1956 | - | 1956 | + |
1957 | if ($objGenericoBD->contar($objReciboTramiteEnviadoDTO) > 0) { | 1957 | if ($objGenericoBD->contar($objReciboTramiteEnviadoDTO) > 0) { |
1958 | return false; | 1958 | return false; |
1959 | } | 1959 | } |
@@ -1967,13 +1967,13 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1967,13 +1967,13 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1967 | $objReciboTramiteDTO->setDthRecebimento($objDateTime->format('d/m/Y H:i:s')); | 1967 | $objReciboTramiteDTO->setDthRecebimento($objDateTime->format('d/m/Y H:i:s')); |
1968 | $objReciboTramiteDTO->setStrCadeiaCertificado($objReciboEnvio->cadeiaDoCertificado); | 1968 | $objReciboTramiteDTO->setStrCadeiaCertificado($objReciboEnvio->cadeiaDoCertificado); |
1969 | $objReciboTramiteDTO->setStrHashAssinatura($objReciboEnvio->hashDaAssinatura); | 1969 | $objReciboTramiteDTO->setStrHashAssinatura($objReciboEnvio->hashDaAssinatura); |
1970 | - | 1970 | + |
1971 | $objGenericoBD->cadastrar($objReciboTramiteDTO); | 1971 | $objGenericoBD->cadastrar($objReciboTramiteDTO); |
1972 | - | 1972 | + |
1973 | if(isset($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital)) { | 1973 | if(isset($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital)) { |
1974 | $objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital = !is_array($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital) ? array($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital) : $objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital; | 1974 | $objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital = !is_array($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital) ? array($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital) : $objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital; |
1975 | if($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital && is_array($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital)){ | 1975 | if($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital && is_array($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital)){ |
1976 | - | 1976 | + |
1977 | foreach($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital as $strHashComponenteDigital){ | 1977 | foreach($objReciboEnvio->reciboDeEnvio->hashDoComponenteDigital as $strHashComponenteDigital){ |
1978 | 1978 | ||
1979 | $objReciboTramiteHashDTO = new ReciboTramiteHashDTO(); | 1979 | $objReciboTramiteHashDTO = new ReciboTramiteHashDTO(); |
@@ -1986,13 +1986,13 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1986,13 +1986,13 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1986 | } | 1986 | } |
1987 | } | 1987 | } |
1988 | } | 1988 | } |
1989 | - | 1989 | + |
1990 | return true; | 1990 | return true; |
1991 | } | 1991 | } |
1992 | - | 1992 | + |
1993 | /** | 1993 | /** |
1994 | * Atualiza os dados do protocolo somente para o modulo PEN | 1994 | * Atualiza os dados do protocolo somente para o modulo PEN |
1995 | - * | 1995 | + * |
1996 | * @param int $dblIdProtocolo | 1996 | * @param int $dblIdProtocolo |
1997 | * @return null | 1997 | * @return null |
1998 | */ | 1998 | */ |
@@ -2002,53 +2002,47 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -2002,53 +2002,47 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
2002 | $objProtocoloDTO->setDblIdProtocolo($dblIdProtocolo); | 2002 | $objProtocoloDTO->setDblIdProtocolo($dblIdProtocolo); |
2003 | $objProtocoloDTO->retTodos(); | 2003 | $objProtocoloDTO->retTodos(); |
2004 | $objProtocoloDTO->getNumMaxRegistrosRetorno(1); | 2004 | $objProtocoloDTO->getNumMaxRegistrosRetorno(1); |
2005 | - | 2005 | + |
2006 | $objProtocoloBD = new ProtocoloBD($this->getObjInfraIBanco()); | 2006 | $objProtocoloBD = new ProtocoloBD($this->getObjInfraIBanco()); |
2007 | $objProtocoloDTO = $objProtocoloBD->consultar($objProtocoloDTO); | 2007 | $objProtocoloDTO = $objProtocoloBD->consultar($objProtocoloDTO); |
2008 | - | 2008 | + |
2009 | if(empty($objProtocoloDTO)) { | 2009 | if(empty($objProtocoloDTO)) { |
2010 | 2010 | ||
2011 | $objProtocoloDTO = new PenProtocoloDTO(); | 2011 | $objProtocoloDTO = new PenProtocoloDTO(); |
2012 | - $objProtocoloDTO->setDblIdProtocolo($dblIdProtocolo); | 2012 | + $objProtocoloDTO->setDblIdProtocolo($dblIdProtocolo); |
2013 | $objProtocoloDTO->setStrSinObteveRecusa('N'); | 2013 | $objProtocoloDTO->setStrSinObteveRecusa('N'); |
2014 | 2014 | ||
2015 | - $objProtocoloBD->cadastrar($objProtocoloDTO); | 2015 | + $objProtocoloBD->cadastrar($objProtocoloDTO); |
2016 | } | 2016 | } |
2017 | else { | 2017 | else { |
2018 | 2018 | ||
2019 | $objProtocoloDTO->setStrSinObteveRecusa('N'); | 2019 | $objProtocoloDTO->setStrSinObteveRecusa('N'); |
2020 | $objProtocoloBD->alterar($objProtocoloDTO); | 2020 | $objProtocoloBD->alterar($objProtocoloDTO); |
2021 | - } | 2021 | + } |
2022 | } | 2022 | } |
2023 | 2023 | ||
2024 | 2024 | ||
2025 | /** | 2025 | /** |
2026 | * @author Fabio.braga@softimais.com.br | 2026 | * @author Fabio.braga@softimais.com.br |
2027 | - * @deprecated consulta processo | 2027 | + * @deprecated consulta processo |
2028 | * data : 28/05/2015 | 2028 | * data : 28/05/2015 |
2029 | - * @return objet | 2029 | + * @return objet |
2030 | */ | 2030 | */ |
2031 | public function listarTramiteParaCancelar($idProcedimento) { | 2031 | public function listarTramiteParaCancelar($idProcedimento) { |
2032 | $objProtocoloDTO = $this->consultarProtocoloPk($idProcedimento); | 2032 | $objProtocoloDTO = $this->consultarProtocoloPk($idProcedimento); |
2033 | - | ||
2034 | - echo "DEBUG protocolo <hr> <pre>"; | ||
2035 | - var_dump($objProtocoloDTO); | ||
2036 | - die("</pre>"); | ||
2037 | - | ||
2038 | - | ||
2039 | $result = $this->objProcessoEletronicoRN->serviceConsultarTramitesProtocolo( $objProtocoloDTO->getStrProtocoloFormatado( ) ); | 2033 | $result = $this->objProcessoEletronicoRN->serviceConsultarTramitesProtocolo( $objProtocoloDTO->getStrProtocoloFormatado( ) ); |
2040 | return $result; | 2034 | return $result; |
2041 | } | 2035 | } |
2042 | - | 2036 | + |
2043 | 2037 | ||
2044 | /** | 2038 | /** |
2045 | * Cancela uma expedio de um Procedimento para outra unidade | 2039 | * Cancela uma expedio de um Procedimento para outra unidade |
2046 | - * | 2040 | + * |
2047 | * @param int $dblIdProcedimento | 2041 | * @param int $dblIdProcedimento |
2048 | * @throws InfraException | 2042 | * @throws InfraException |
2049 | */ | 2043 | */ |
2050 | public function cancelarTramite($dblIdProcedimento) { | 2044 | public function cancelarTramite($dblIdProcedimento) { |
2051 | - | 2045 | + |
2052 | //Busca os dados do protocolo | 2046 | //Busca os dados do protocolo |
2053 | $objDtoProtocolo = new ProtocoloDTO(); | 2047 | $objDtoProtocolo = new ProtocoloDTO(); |
2054 | $objDtoProtocolo->retStrProtocoloFormatado(); | 2048 | $objDtoProtocolo->retStrProtocoloFormatado(); |
@@ -2059,39 +2053,39 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -2059,39 +2053,39 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
2059 | $objDtoProtocolo = $objProtocoloBD->consultar($objDtoProtocolo); | 2053 | $objDtoProtocolo = $objProtocoloBD->consultar($objDtoProtocolo); |
2060 | 2054 | ||
2061 | $this->cancelarTramiteInternoControlado($objDtoProtocolo); | 2055 | $this->cancelarTramiteInternoControlado($objDtoProtocolo); |
2062 | - | 2056 | + |
2063 | } | 2057 | } |
2064 | - | 2058 | + |
2065 | protected function cancelarTramiteInternoControlado(ProtocoloDTO $objDtoProtocolo) { | 2059 | protected function cancelarTramiteInternoControlado(ProtocoloDTO $objDtoProtocolo) { |
2066 | - | ||
2067 | - | 2060 | + |
2061 | + | ||
2068 | //Obtem o id_rh que representa a unidade no barramento | 2062 | //Obtem o id_rh que representa a unidade no barramento |
2069 | $objPenParametroRN = new PenParametroRN(); | 2063 | $objPenParametroRN = new PenParametroRN(); |
2070 | $numIdRespositorio = $objPenParametroRN->getParametro('PEN_ID_REPOSITORIO_ORIGEM'); | 2064 | $numIdRespositorio = $objPenParametroRN->getParametro('PEN_ID_REPOSITORIO_ORIGEM'); |
2071 | - | 2065 | + |
2072 | //Obtem os dados da unidade | 2066 | //Obtem os dados da unidade |
2073 | $objPenUnidadeDTO = new PenUnidadeDTO(); | 2067 | $objPenUnidadeDTO = new PenUnidadeDTO(); |
2074 | $objPenUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | 2068 | $objPenUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
2075 | $objPenUnidadeDTO->retNumIdUnidadeRH(); | 2069 | $objPenUnidadeDTO->retNumIdUnidadeRH(); |
2076 | - | 2070 | + |
2077 | $objGenericoBD = new GenericoBD($this->inicializarObjInfraIBanco()); | 2071 | $objGenericoBD = new GenericoBD($this->inicializarObjInfraIBanco()); |
2078 | $objPenUnidadeDTO = $objGenericoBD->consultar($objPenUnidadeDTO); | 2072 | $objPenUnidadeDTO = $objGenericoBD->consultar($objPenUnidadeDTO); |
2079 | - | 2073 | + |
2080 | $objTramiteDTO = new TramiteDTO(); | 2074 | $objTramiteDTO = new TramiteDTO(); |
2081 | $objTramiteDTO->setNumIdProcedimento($objDtoProtocolo->retDblIdProtocolo()); | 2075 | $objTramiteDTO->setNumIdProcedimento($objDtoProtocolo->retDblIdProtocolo()); |
2082 | $objTramiteDTO->setOrd('Registro', InfraDTO::$TIPO_ORDENACAO_DESC); | 2076 | $objTramiteDTO->setOrd('Registro', InfraDTO::$TIPO_ORDENACAO_DESC); |
2083 | $objTramiteDTO->setNumMaxRegistrosRetorno(1); | 2077 | $objTramiteDTO->setNumMaxRegistrosRetorno(1); |
2084 | $objTramiteDTO->retNumIdTramite(); | 2078 | $objTramiteDTO->retNumIdTramite(); |
2085 | - | 2079 | + |
2086 | $objTramiteBD = new TramiteBD($this->getObjInfraIBanco()); | 2080 | $objTramiteBD = new TramiteBD($this->getObjInfraIBanco()); |
2087 | $arrObjTramiteDTO = $objTramiteBD->listar($objTramiteDTO); | 2081 | $arrObjTramiteDTO = $objTramiteBD->listar($objTramiteDTO); |
2088 | - | 2082 | + |
2089 | if(!$arrObjTramiteDTO){ | 2083 | if(!$arrObjTramiteDTO){ |
2090 | throw new InfraException('Trâmite não encontrado para esse processo. '); | 2084 | throw new InfraException('Trâmite não encontrado para esse processo. '); |
2091 | } | 2085 | } |
2092 | - | 2086 | + |
2093 | $objTramiteDTO = $arrObjTramiteDTO[0]; | 2087 | $objTramiteDTO = $arrObjTramiteDTO[0]; |
2094 | - | 2088 | + |
2095 | //Armazena o id do protocolo | 2089 | //Armazena o id do protocolo |
2096 | $dblIdProcedimento = $objDtoProtocolo->getDblIdProtocolo(); | 2090 | $dblIdProcedimento = $objDtoProtocolo->getDblIdProtocolo(); |
2097 | 2091 | ||
@@ -2185,57 +2179,57 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -2185,57 +2179,57 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
2185 | $objAtividadeRN = new AtividadeRN(); | 2179 | $objAtividadeRN = new AtividadeRN(); |
2186 | $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | 2180 | $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); |
2187 | } | 2181 | } |
2188 | - | 2182 | + |
2189 | /** | 2183 | /** |
2190 | * Verifica se o processo se encontra em expedio | 2184 | * Verifica se o processo se encontra em expedio |
2191 | - * | 2185 | + * |
2192 | * @param integer $parNumIdProcedimento | 2186 | * @param integer $parNumIdProcedimento |
2193 | * @return boolean|object | 2187 | * @return boolean|object |
2194 | */ | 2188 | */ |
2195 | public function verificarProcessoEmExpedicao($parNumIdProcedimento){ | 2189 | public function verificarProcessoEmExpedicao($parNumIdProcedimento){ |
2196 | - | 2190 | + |
2197 | $objProcedimentoDTO = new ProcedimentoDTO(); | 2191 | $objProcedimentoDTO = new ProcedimentoDTO(); |
2198 | $objProcedimentoDTO->setDblIdProcedimento($parNumIdProcedimento); | 2192 | $objProcedimentoDTO->setDblIdProcedimento($parNumIdProcedimento); |
2199 | $objProcedimentoDTO->retStrStaEstadoProtocolo(); | 2193 | $objProcedimentoDTO->retStrStaEstadoProtocolo(); |
2200 | $objProcedimentoDTO->retDblIdProcedimento(); | 2194 | $objProcedimentoDTO->retDblIdProcedimento(); |
2201 | - | 2195 | + |
2202 | $objProcedimentoRN = new ProcedimentoRN(); | 2196 | $objProcedimentoRN = new ProcedimentoRN(); |
2203 | $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); | 2197 | $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); |
2204 | - | ||
2205 | - | 2198 | + |
2199 | + | ||
2206 | if($objProcedimentoDTO && $objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_PROCEDIMENTO_BLOQUEADO){ | 2200 | if($objProcedimentoDTO && $objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_PROCEDIMENTO_BLOQUEADO){ |
2207 | - | 2201 | + |
2208 | $objAtividadeDTO = new AtividadeDTO(); | 2202 | $objAtividadeDTO = new AtividadeDTO(); |
2209 | $objAtividadeDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento()); | 2203 | $objAtividadeDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento()); |
2210 | $objAtividadeDTO->setNumIdTarefa( | 2204 | $objAtividadeDTO->setNumIdTarefa( |
2211 | - array(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO), | 2205 | + array(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO), |
2212 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO), | 2206 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO), |
2213 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_CANCELADO), | 2207 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_CANCELADO), |
2214 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_RECUSADO), | 2208 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_RECUSADO), |
2215 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO), | 2209 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO), |
2216 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_ABORTADO), | 2210 | ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_ABORTADO), |
2217 | - ), | 2211 | + ), |
2218 | InfraDTO::$OPER_IN); | 2212 | InfraDTO::$OPER_IN); |
2219 | $objAtividadeDTO->setNumMaxRegistrosRetorno(1); | 2213 | $objAtividadeDTO->setNumMaxRegistrosRetorno(1); |
2220 | $objAtividadeDTO->setOrdDthAbertura(InfraDTO::$TIPO_ORDENACAO_DESC); | 2214 | $objAtividadeDTO->setOrdDthAbertura(InfraDTO::$TIPO_ORDENACAO_DESC); |
2221 | $objAtividadeDTO->retNumIdAtividade(); | 2215 | $objAtividadeDTO->retNumIdAtividade(); |
2222 | $objAtividadeDTO->retNumIdTarefa(); | 2216 | $objAtividadeDTO->retNumIdTarefa(); |
2223 | - | 2217 | + |
2224 | $objAtividadeRN = new AtividadeRN(); | 2218 | $objAtividadeRN = new AtividadeRN(); |
2225 | $arrAtividadeDTO = (array) $objAtividadeRN->listarRN0036($objAtividadeDTO); | 2219 | $arrAtividadeDTO = (array) $objAtividadeRN->listarRN0036($objAtividadeDTO); |
2226 | - | 2220 | + |
2227 | if($arrAtividadeDTO){ | 2221 | if($arrAtividadeDTO){ |
2228 | return $arrAtividadeDTO[0]; | 2222 | return $arrAtividadeDTO[0]; |
2229 | }else{ | 2223 | }else{ |
2230 | return false; | 2224 | return false; |
2231 | } | 2225 | } |
2232 | - | ||
2233 | - | 2226 | + |
2227 | + | ||
2234 | }else{ | 2228 | }else{ |
2235 | return false; | 2229 | return false; |
2236 | - } | 2230 | + } |
2237 | } | 2231 | } |
2238 | - | 2232 | + |
2239 | 2233 | ||
2240 | public function consultaUnidadePk($idUnidade) { | 2234 | public function consultaUnidadePk($idUnidade) { |
2241 | 2235 | ||
@@ -2266,21 +2260,21 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -2266,21 +2260,21 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
2266 | $objProtocoloDTO = new ProtocoloDTO(); | 2260 | $objProtocoloDTO = new ProtocoloDTO(); |
2267 | $objProtocoloDTO->setDblIdProtocolo($idPrtocedimento); | 2261 | $objProtocoloDTO->setDblIdProtocolo($idPrtocedimento); |
2268 | $objProtocoloDTO->retTodos(); | 2262 | $objProtocoloDTO->retTodos(); |
2269 | - | 2263 | + |
2270 | 2264 | ||
2271 | $objProtocoloDTO = $this->objProtocoloRN->consultarRN0186($objProtocoloDTO); | 2265 | $objProtocoloDTO = $this->objProtocoloRN->consultarRN0186($objProtocoloDTO); |
2272 | - | 2266 | + |
2273 | 2267 | ||
2274 | $objProtocoloDTO->UnidadeGeradora = $this->consultaUnidadePk($objProtocoloDTO->getNumIdUnidadeGeradora()); | 2268 | $objProtocoloDTO->UnidadeGeradora = $this->consultaUnidadePk($objProtocoloDTO->getNumIdUnidadeGeradora()); |
2275 | - | 2269 | + |
2276 | $objProtocoloDTO->UsuarioCriador = $this->consultaUsuarioPk($objProtocoloDTO->getNumIdUsuarioGerador()); | 2270 | $objProtocoloDTO->UsuarioCriador = $this->consultaUsuarioPk($objProtocoloDTO->getNumIdUsuarioGerador()); |
2277 | - | 2271 | + |
2278 | $objProtocoloDTO->Documentos = $this->consultaDocumentosProcesso($idPrtocedimento); | 2272 | $objProtocoloDTO->Documentos = $this->consultaDocumentosProcesso($idPrtocedimento); |
2279 | 2273 | ||
2280 | return $objProtocoloDTO; | 2274 | return $objProtocoloDTO; |
2281 | } | 2275 | } |
2282 | 2276 | ||
2283 | - | 2277 | + |
2284 | public function consultaDocumentosProcesso($idPrtocedimento) { | 2278 | public function consultaDocumentosProcesso($idPrtocedimento) { |
2285 | 2279 | ||
2286 | $documentoRespArray = array(); | 2280 | $documentoRespArray = array(); |
@@ -2292,5 +2286,5 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -2292,5 +2286,5 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
2292 | $documentoDTO = $this->objDocumentoRN->listarRN0008($documentoDTO); | 2286 | $documentoDTO = $this->objDocumentoRN->listarRN0008($documentoDTO); |
2293 | 2287 | ||
2294 | return $documentoDTO; | 2288 | return $documentoDTO; |
2295 | - } | ||
2296 | -} | ||
2297 | \ No newline at end of file | 2289 | \ No newline at end of file |
2290 | + } | ||
2291 | +} |
rn/PENAgendamentoRN.php
@@ -252,7 +252,7 @@ class PENAgendamentoRN extends InfraRN { | @@ -252,7 +252,7 @@ class PENAgendamentoRN extends InfraRN { | ||
252 | "Favor, entrar em contato com a equipe de suporte técnico."; | 252 | "Favor, entrar em contato com a equipe de suporte técnico."; |
253 | throw new InfraException($msg, $e); | 253 | throw new InfraException($msg, $e); |
254 | } else { | 254 | } else { |
255 | - LogSEI::getInstance()->gravar("Todos os serviços necessários na integração com o Processo Eletrônico Nacional - PEN estão ativos."); | 255 | + LogSEI::getInstance()->gravar("Todos os serviços necessários para a integração com o Processo Eletrônico Nacional - PEN estão ativos.", LogSEI::$INFORMACAO); |
256 | } | 256 | } |
257 | } catch (Exception $e) { | 257 | } catch (Exception $e) { |
258 | throw new InfraException('Erro ao analisar status do serviços Gearmand e Supervisord', $e); | 258 | throw new InfraException('Erro ao analisar status do serviços Gearmand e Supervisord', $e); |
rn/PendenciasTramiteRN.php
@@ -46,16 +46,14 @@ class PendenciasTramiteRN extends InfraRN { | @@ -46,16 +46,14 @@ class PendenciasTramiteRN extends InfraRN { | ||
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | - | ||
50 | - | ||
51 | public function monitorarPendencias() { | 49 | public function monitorarPendencias() { |
52 | try{ | 50 | try{ |
53 | ini_set('max_execution_time','0'); | 51 | ini_set('max_execution_time','0'); |
54 | ini_set('memory_limit','-1'); | 52 | ini_set('memory_limit','-1'); |
55 | 53 | ||
56 | - InfraDebug::getInstance()->setBolLigado(true); | 54 | + InfraDebug::getInstance()->setBolLigado(false); |
57 | InfraDebug::getInstance()->setBolDebugInfra(false); | 55 | InfraDebug::getInstance()->setBolDebugInfra(false); |
58 | - InfraDebug::getInstance()->setBolEcho(true); | 56 | + InfraDebug::getInstance()->setBolEcho(false); |
59 | InfraDebug::getInstance()->limpar(); | 57 | InfraDebug::getInstance()->limpar(); |
60 | 58 | ||
61 | PENIntegracao::validarCompatibilidadeModulo(); | 59 | PENIntegracao::validarCompatibilidadeModulo(); |
@@ -65,7 +63,7 @@ class PendenciasTramiteRN extends InfraRN { | @@ -65,7 +63,7 @@ class PendenciasTramiteRN extends InfraRN { | ||
65 | 63 | ||
66 | $mensagemInicioMonitoramento = 'Iniciando serviço de monitoramento de pendências de trâmites de processos'; | 64 | $mensagemInicioMonitoramento = 'Iniciando serviço de monitoramento de pendências de trâmites de processos'; |
67 | LogSEI::getInstance()->gravar($mensagemInicioMonitoramento, LogSEI::$INFORMACAO); | 65 | LogSEI::getInstance()->gravar($mensagemInicioMonitoramento, LogSEI::$INFORMACAO); |
68 | - $this->gravarLogDebug($mensagemInicioMonitoramento); | 66 | + $this->gravarLogDebug($mensagemInicioMonitoramento, 0, true); |
69 | 67 | ||
70 | $numIdTramiteRecebido = 0; | 68 | $numIdTramiteRecebido = 0; |
71 | $strStatusTramiteRecebido = ''; | 69 | $strStatusTramiteRecebido = ''; |
@@ -76,7 +74,9 @@ class PendenciasTramiteRN extends InfraRN { | @@ -76,7 +74,9 @@ class PendenciasTramiteRN extends InfraRN { | ||
76 | $this->gravarLogDebug('Recuperando lista de pendências do PEN', 1); | 74 | $this->gravarLogDebug('Recuperando lista de pendências do PEN', 1); |
77 | $arrObjPendenciasDTO = $this->obterPendenciasTramite(); | 75 | $arrObjPendenciasDTO = $this->obterPendenciasTramite(); |
78 | foreach ($arrObjPendenciasDTO as $objPendenciaDTO) { | 76 | foreach ($arrObjPendenciasDTO as $objPendenciaDTO) { |
79 | - $this->gravarLogDebug(sprintf(">>> Enviando pendência %d (status %s) para fila de processamento", $objPendenciaDTO->getNumIdentificacaoTramite(), $objPendenciaDTO->getStrStatus()), 3); | 77 | + $mensagemLog = sprintf(">>> Enviando pendência %d (status %s) para fila de processamento", |
78 | + $objPendenciaDTO->getNumIdentificacaoTramite(), $objPendenciaDTO->getStrStatus()); | ||
79 | + $this->gravarLogDebug($mensagemLog, 3, true); | ||
80 | $this->enviarPendenciaFilaProcessamento($objPendenciaDTO); | 80 | $this->enviarPendenciaFilaProcessamento($objPendenciaDTO); |
81 | } | 81 | } |
82 | 82 | ||
@@ -88,6 +88,7 @@ class PendenciasTramiteRN extends InfraRN { | @@ -88,6 +88,7 @@ class PendenciasTramiteRN extends InfraRN { | ||
88 | InfraDebug::getInstance()->setBolLigado(false); | 88 | InfraDebug::getInstance()->setBolLigado(false); |
89 | InfraDebug::getInstance()->setBolDebugInfra(false); | 89 | InfraDebug::getInstance()->setBolDebugInfra(false); |
90 | InfraDebug::getInstance()->setBolEcho(false); | 90 | InfraDebug::getInstance()->setBolEcho(false); |
91 | + LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); | ||
91 | throw $e; | 92 | throw $e; |
92 | } | 93 | } |
93 | } | 94 | } |
@@ -215,12 +216,10 @@ class PendenciasTramiteRN extends InfraRN { | @@ -215,12 +216,10 @@ class PendenciasTramiteRN extends InfraRN { | ||
215 | case ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_METADADOS_RECEBIDO_DESTINATARIO: | 216 | case ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_METADADOS_RECEBIDO_DESTINATARIO: |
216 | case ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_COMPONENTES_RECEBIDOS_DESTINATARIO: | 217 | case ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_COMPONENTES_RECEBIDOS_DESTINATARIO: |
217 | $client->addTaskBackground('receberProcedimento', $strWorkload, null); | 218 | $client->addTaskBackground('receberProcedimento', $strWorkload, null); |
218 | - $numCont++; | ||
219 | break; | 219 | break; |
220 | 220 | ||
221 | case ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_RECIBO_ENVIADO_DESTINATARIO: | 221 | case ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_RECIBO_ENVIADO_DESTINATARIO: |
222 | $client->addTaskBackground('receberReciboTramite', $strWorkload, null); | 222 | $client->addTaskBackground('receberReciboTramite', $strWorkload, null); |
223 | - $numCont++; | ||
224 | break; | 223 | break; |
225 | 224 | ||
226 | case ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_RECIBO_RECEBIDO_REMETENTE: | 225 | case ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_RECIBO_RECEBIDO_REMETENTE: |
@@ -242,11 +241,14 @@ class PendenciasTramiteRN extends InfraRN { | @@ -242,11 +241,14 @@ class PendenciasTramiteRN extends InfraRN { | ||
242 | } | 241 | } |
243 | } | 242 | } |
244 | 243 | ||
245 | - private function gravarLogDebug($mensagem, $identacao=0) | 244 | + private function gravarLogDebug($strMensagem, $numIdentacao=0, $bolEcho=false) |
246 | { | 245 | { |
247 | - $mensagem = sprintf("[%s] %s %s", date("d/m/Y H:i:s"), str_repeat("\t", $identacao), $mensagem); | ||
248 | - InfraDebug::getInstance()->gravar($mensagem); | 246 | + $strDataLog = date("d/m/Y H:i:s"); |
247 | + $strLog = sprintf("[%s] [MONITORAMENTO] %s %s", $strDataLog, str_repeat("\t", $numIdentacao), $strMensagem); | ||
248 | + InfraDebug::getInstance()->gravar($strLog); | ||
249 | + if(!InfraDebug::getInstance()->isBolEcho() && $bolEcho) echo sprintf("\n[%s] [MONITORAMENTO] %s", $strDataLog, $strMensagem); | ||
249 | } | 250 | } |
251 | + | ||
250 | } | 252 | } |
251 | 253 | ||
252 | SessaoSEI::getInstance(false); | 254 | SessaoSEI::getInstance(false); |
rn/ProcessarPendenciasRN.php
@@ -22,7 +22,6 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | @@ -22,7 +22,6 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | ||
22 | 22 | ||
23 | public function __construct() | 23 | public function __construct() |
24 | { | 24 | { |
25 | - //Configuração do worker do Gearman para realizar o processamento de tarefas | ||
26 | $this->objGearmanWorker = new GearmanWorker(); | 25 | $this->objGearmanWorker = new GearmanWorker(); |
27 | $this->objGearmanWorker->addServer(); | 26 | $this->objGearmanWorker->addServer(); |
28 | $this->configurarCallbacks(); | 27 | $this->configurarCallbacks(); |
@@ -44,10 +43,9 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | @@ -44,10 +43,9 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | ||
44 | $objPenParametroRN = new PenParametroRN(); | 43 | $objPenParametroRN = new PenParametroRN(); |
45 | SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objPenParametroRN->getParametro('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | 44 | SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objPenParametroRN->getParametro('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); |
46 | 45 | ||
47 | - $numSeg = InfraUtil::verificarTempoProcessamento(); | ||
48 | - | ||
49 | - InfraDebug::getInstance()->gravar('ANALISANDO OS TRÂMITES PENDENTES ENVIADOS PARA O ÓRGÃO (PEN)'); | ||
50 | - echo "[".date("d/m/Y H:i:s")."] Iniciando serviço de processamento de pendências de trâmites de processos...\n"; | 46 | + $mensagemInicioProcessamento = 'Iniciando serviço de processamento de pendências de trâmites de processos'; |
47 | + LogSEI::getInstance()->gravar($mensagemInicioProcessamento, LogSEI::$INFORMACAO); | ||
48 | + $this->gravarLogDebug($mensagemInicioProcessamento, 0, true); | ||
51 | 49 | ||
52 | while($this->objGearmanWorker->work()) | 50 | while($this->objGearmanWorker->work()) |
53 | { | 51 | { |
@@ -57,69 +55,48 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | @@ -57,69 +55,48 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | ||
57 | break; | 55 | break; |
58 | } | 56 | } |
59 | } | 57 | } |
60 | - | ||
61 | - $numSeg = InfraUtil::verificarTempoProcessamento($numSeg); | ||
62 | - InfraDebug::getInstance()->gravar('TEMPO TOTAL DE EXECUCAO: '.$numSeg.' s'); | ||
63 | - InfraDebug::getInstance()->gravar('FIM'); | ||
64 | - LogSEI::getInstance()->gravar(InfraDebug::getInstance()->getStrDebug()); | ||
65 | } | 58 | } |
66 | catch(Exception $e) { | 59 | catch(Exception $e) { |
67 | - $strAssunto = 'Falha no processamento de pendências do PEN'; | ||
68 | - $strErro = ''; | ||
69 | - $strErro .= 'Servidor: '.gethostname()."\n\n"; | ||
70 | - $strErro .= 'Data/Hora: '.InfraData::getStrDataHoraAtual()."\n\n"; | ||
71 | - $strErro .= 'Erro: '.InfraException::inspecionar($e); | 60 | + $strAssunto = 'Falha no processamento de pendências de trâmite do PEN'; |
61 | + $strErro = 'Erro: '. InfraException::inspecionar($e); | ||
72 | LogSEI::getInstance()->gravar($strAssunto."\n\n".$strErro); | 62 | LogSEI::getInstance()->gravar($strAssunto."\n\n".$strErro); |
63 | + throw new InfraException($strAssunto."\n\n".$strErro, $e); | ||
73 | } | 64 | } |
74 | } | 65 | } |
75 | 66 | ||
76 | private function configurarCallbacks() | 67 | private function configurarCallbacks() |
77 | { | 68 | { |
78 | - | ||
79 | - //PROCESSAMENTO DE TAREFAS RELACIONADAS AO ENVIO DE UM PROCESSO ELETRÔNICO | ||
80 | - ////////////////////////////////////////////////////////////////////////// | ||
81 | - | ||
82 | - //Etapa 01 - Processamento de pendências envio dos metadados do processo | 69 | + // Processamento de pendências envio dos metadados do processo |
83 | $this->objGearmanWorker->addFunction("enviarProcesso", function ($job) { | 70 | $this->objGearmanWorker->addFunction("enviarProcesso", function ($job) { |
84 | - | ||
85 | - InfraDebug::getInstance()->gravar("[".date("d/m/Y H:i:s")."] Processando tarefa [enviarProcesso] " . $job->workload()); | ||
86 | - //TODO: Implementar tarefa relacionada | ||
87 | - //... | ||
88 | - | ||
89 | - //Agendamento de nova tarefa para envio dos componentes digitais do processo | ||
90 | - //$this->objGearmanClient->addTask("enviarComponenteDigital", $numIdentificacaoTramite, null); | 71 | + $this->gravarLogDebug("Processando envio de processo [enviarComponenteDigital] com IDT " . $job->workload(), 0, true); |
91 | }); | 72 | }); |
92 | 73 | ||
93 | - //Etapa 02 - Processamento de pendências envio dos componentes digitais do processo | 74 | + // Processamento de pendências envio dos componentes digitais do processo |
94 | $this->objGearmanWorker->addFunction("enviarComponenteDigital", function ($job) { | 75 | $this->objGearmanWorker->addFunction("enviarComponenteDigital", function ($job) { |
95 | - | ||
96 | - InfraDebug::getInstance()->gravar("[".date("d/m/Y H:i:s")."] Processando tarefa [enviarComponenteDigital] " . $job->workload()); | ||
97 | - //TODO: Implementar tarefa relacionada | ||
98 | - //... | ||
99 | - | ||
100 | - //Agendamento de nova tarefa para recebimento do recibo de envio do processo | ||
101 | - //$this->objGearmanClient->addTask("receberReciboTramite", $numIdentificacaoTramite, null); | 76 | + $this->gravarLogDebug("Processando envio de componentes digitais [enviarComponenteDigital] com IDT " . $job->workload(), 0, true); |
102 | }); | 77 | }); |
103 | 78 | ||
104 | - //Etapa 03 - Processamento de pendências de recebimento do recibo de envio do processo | 79 | + // Processamento de pendências de recebimento do recibo de envio do processo |
105 | $this->objGearmanWorker->addFunction("receberReciboTramite", function ($job) { | 80 | $this->objGearmanWorker->addFunction("receberReciboTramite", function ($job) { |
106 | - $numIdentificacaoTramite = intval($job->workload()); | ||
107 | - InfraDebug::getInstance()->gravar("[".date("d/m/Y H:i:s")."] Processando tarefa [receberReciboTramite] " . $job->workload()); | ||
108 | - $objPenTramiteProcessadoRN = new PenTramiteProcessadoRN(PenTramiteProcessadoRN::STR_TIPO_RECIBO); | ||
109 | - if(!$objPenTramiteProcessadoRN->isProcedimentoRecebido($numIdentificacaoTramite)){ | ||
110 | - $objReceberReciboTramiteRN = new ReceberReciboTramiteRN(); | ||
111 | - $objReceberReciboTramiteRN->receberReciboDeTramite($numIdentificacaoTramite); | 81 | + try{ |
82 | + $this->gravarLogDebug("Processando recebimento de recibo de trâmite [receberReciboTramite] com IDT " . $job->workload(), 0, true); | ||
83 | + $numIdentificacaoTramite = intval($job->workload()); | ||
84 | + $objPenTramiteProcessadoRN = new PenTramiteProcessadoRN(PenTramiteProcessadoRN::STR_TIPO_RECIBO); | ||
85 | + if(!$objPenTramiteProcessadoRN->isProcedimentoRecebido($numIdentificacaoTramite)){ | ||
86 | + $objReceberReciboTramiteRN = new ReceberReciboTramiteRN(); | ||
87 | + $objReceberReciboTramiteRN->receberReciboDeTramite($numIdentificacaoTramite); | ||
88 | + } | ||
89 | + } | ||
90 | + catch(Exception $e){ | ||
91 | + LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); | ||
112 | } | 92 | } |
113 | }); | 93 | }); |
114 | 94 | ||
115 | - //PROCESSAMENTO DE TAREFAS RELACIONADAS AO RECEBIMENTO DE UM PROCESSO ELETRÔNICO | ||
116 | - ////////////////////////////////////////////////////////////////////////// | ||
117 | - | ||
118 | //Processamento de pendências de recebimento dos metadados do processo | 95 | //Processamento de pendências de recebimento dos metadados do processo |
119 | $this->objGearmanWorker->addFunction("receberProcedimento", function ($job) { | 96 | $this->objGearmanWorker->addFunction("receberProcedimento", function ($job) { |
120 | try{ | 97 | try{ |
98 | + $this->gravarLogDebug("Processando recebimento de processo [receberProcedimento] com IDT " . $job->workload(), 0, true); | ||
121 | $numIdentificacaoTramite = intval($job->workload()); | 99 | $numIdentificacaoTramite = intval($job->workload()); |
122 | - InfraDebug::getInstance()->gravar("[".date("d/m/Y H:i:s")."] Processando tarefa [receberProcedimento] " . $job->workload()); | ||
123 | $objPenTramiteProcessadoRN = new PenTramiteProcessadoRN(PenTramiteProcessadoRN::STR_TIPO_PROCESSO); | 100 | $objPenTramiteProcessadoRN = new PenTramiteProcessadoRN(PenTramiteProcessadoRN::STR_TIPO_PROCESSO); |
124 | 101 | ||
125 | if(!$objPenTramiteProcessadoRN->isProcedimentoRecebido($numIdentificacaoTramite)){ | 102 | if(!$objPenTramiteProcessadoRN->isProcedimentoRecebido($numIdentificacaoTramite)){ |
@@ -137,36 +114,48 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | @@ -137,36 +114,48 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa | ||
137 | 114 | ||
138 | // Verifica no barramento os procedimentos que foram enviados por esta unidade e foram recusados pelas mesmas | 115 | // Verifica no barramento os procedimentos que foram enviados por esta unidade e foram recusados pelas mesmas |
139 | $this->objGearmanWorker->addFunction("receberTramitesRecusados", function ($job) { | 116 | $this->objGearmanWorker->addFunction("receberTramitesRecusados", function ($job) { |
140 | - InfraDebug::getInstance()->gravar("[".date("d/m/Y H:i:s")."] Processando tarefa [receberRecusaTramite] " . $job->workload()); | ||
141 | - $numIdentificacaoTramite = intval($job->workload()); | ||
142 | - $objReceberProcedimentoRN = new ReceberProcedimentoRN(); | ||
143 | - $objReceberProcedimentoRN->receberTramitesRecusados($numIdentificacaoTramite); | 117 | + try { |
118 | + $this->gravarLogDebug("Processando trâmite recusado [receberTramitesRecusados] com IDT " . $job->workload(), 0, true); | ||
119 | + $numIdentificacaoTramite = intval($job->workload()); | ||
120 | + $objReceberProcedimentoRN = new ReceberProcedimentoRN(); | ||
121 | + $objReceberProcedimentoRN->receberTramitesRecusados($numIdentificacaoTramite); | ||
122 | + } catch (Exception $e) { | ||
123 | + LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); | ||
124 | + } | ||
125 | + | ||
144 | }); | 126 | }); |
145 | 127 | ||
146 | //Processamento de pendências de recebimento dos componentes digitais do processo | 128 | //Processamento de pendências de recebimento dos componentes digitais do processo |
147 | $this->objGearmanWorker->addFunction("receberComponenteDigital", function ($job) { | 129 | $this->objGearmanWorker->addFunction("receberComponenteDigital", function ($job) { |
148 | - | ||
149 | - InfraDebug::getInstance()->gravar("[".date("d/m/Y H:i:s")."] Processando tarefa [receberComponenteDigital] " . $job->workload()); | ||
150 | - //TODO: A próxima etapa deveria ser o recebimento dos componentes digitais, rotina tradada na função receberProcedimento(...) | ||
151 | - | ||
152 | - //Agendamento de nova tarefa para envio do recibo de conclusão do trâmite | 130 | + $this->gravarLogDebug("Processando recebimento de componentes digitais [receberComponenteDigital] com IDT " . $job->workload(), 0, true); |
153 | ProcessarPendenciasRN::processarTarefa("enviarReciboTramiteProcesso", $job->workload()); | 131 | ProcessarPendenciasRN::processarTarefa("enviarReciboTramiteProcesso", $job->workload()); |
154 | - //$this->objGearmanClient->addTaskBackground("enviarReciboTramiteProcesso", $numIdentificacaoTramite, null); | ||
155 | }); | 132 | }); |
156 | 133 | ||
157 | //Processamento de pendências de envio do recibo de conclusão do trãmite do processo | 134 | //Processamento de pendências de envio do recibo de conclusão do trãmite do processo |
158 | $this->objGearmanWorker->addFunction("enviarReciboTramiteProcesso", function ($job) { | 135 | $this->objGearmanWorker->addFunction("enviarReciboTramiteProcesso", function ($job) { |
159 | - InfraDebug::getInstance()->gravar("[".date("d/m/Y H:i:s")."] Processando tarefa [enviarReciboTramiteProcesso] " . $job->workload()); | ||
160 | - $numIdentificacaoTramite = intval($job->workload()); | ||
161 | - $objEnviarReciboTramiteRN = new EnviarReciboTramiteRN(); | ||
162 | - $objEnviarReciboTramiteRN->enviarReciboTramiteProcesso($numIdentificacaoTramite); | 136 | + try { |
137 | + $this->gravarLogDebug("Processando envio do recibo de trâmite [enviarReciboTramiteProcesso] com IDT " . $job->workload(), 0, true); | ||
138 | + $numIdentificacaoTramite = intval($job->workload()); | ||
139 | + $objEnviarReciboTramiteRN = new EnviarReciboTramiteRN(); | ||
140 | + $objEnviarReciboTramiteRN->enviarReciboTramiteProcesso($numIdentificacaoTramite); | ||
141 | + } catch (Exception $e) { | ||
142 | + LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); | ||
143 | + } | ||
163 | }); | 144 | }); |
164 | } | 145 | } |
165 | 146 | ||
147 | + private function gravarLogDebug($strMensagem, $numIdentacao=0, $bolEcho=false) | ||
148 | + { | ||
149 | + $strDataLog = date("d/m/Y H:i:s"); | ||
150 | + $strLog = sprintf("[%s] [PROCESSAMENTO] %s %s", $strDataLog, str_repeat("\t", $numIdentacao), $strMensagem); | ||
151 | + InfraDebug::getInstance()->gravar($strLog); | ||
152 | + if(!InfraDebug::getInstance()->isBolEcho() && $bolEcho) echo sprintf("\n[%s] [PROCESSAMENTO] %s", $strDataLog, $strMensagem); | ||
153 | + } | ||
154 | + | ||
166 | static function processarTarefa($strNomeTarefa, $strWorkload) | 155 | static function processarTarefa($strNomeTarefa, $strWorkload) |
167 | { | 156 | { |
168 | $objClient = new GearmanClient(); | 157 | $objClient = new GearmanClient(); |
169 | - $objClient->addServer('localhost', 4730); | 158 | + $objClient->addServer(); |
170 | $objClient->doBackground($strNomeTarefa, $strWorkload); | 159 | $objClient->doBackground($strNomeTarefa, $strWorkload); |
171 | } | 160 | } |
172 | } | 161 | } |
rn/ProcessoEletronicoRN.php
1 | <?php | 1 | <?php |
2 | -//@TODOJOIN: VERIFICAR SE NÃO EXISTEM TRY CATCH QUE OCULTAM ERROS. CASO EXISTAM CATCH COM EXEPTION DO PHP, RETIRALOS | 2 | +//@TODOJOIN: VERIFICAR SE NÃO EXISTEM TRY CATCH QUE OCULTAM ERROS. CASO EXISTAM CATCH COM EXEPTION DO PHP, RETIRALOS |
3 | class ProcessoEletronicoRN extends InfraRN { | 3 | class ProcessoEletronicoRN extends InfraRN { |
4 | 4 | ||
5 | //const PEN_WEBSERVICE_LOCATION = 'https://desenv-api-pen.intra.planejamento/interoperabilidade/soap/v1_1/'; | 5 | //const PEN_WEBSERVICE_LOCATION = 'https://desenv-api-pen.intra.planejamento/interoperabilidade/soap/v1_1/'; |
6 | 6 | ||
7 | - /* TAREFAS DE EXPEDIÇÃO DE PROCESSOS */ | ||
8 | - //Está definindo o comportamento para a tarefa $TI_PROCESSO_EM_PROCESSAMENTO | 7 | + /* TAREFAS DE EXPEDIÇÃO DE PROCESSOS */ |
8 | + //Está definindo o comportamento para a tarefa $TI_PROCESSO_EM_PROCESSAMENTO | ||
9 | public static $TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO = 'PEN_PROCESSO_EXPEDIDO'; | 9 | public static $TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO = 'PEN_PROCESSO_EXPEDIDO'; |
10 | public static $TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO = 'PEN_PROCESSO_RECEBIDO'; | 10 | public static $TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO = 'PEN_PROCESSO_RECEBIDO'; |
11 | public static $TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_CANCELADO = 'PEN_PROCESSO_CANCELADO'; | 11 | public static $TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_CANCELADO = 'PEN_PROCESSO_CANCELADO'; |
@@ -14,28 +14,28 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -14,28 +14,28 @@ class ProcessoEletronicoRN extends InfraRN { | ||
14 | public static $TI_PROCESSO_ELETRONICO_PROCESSO_ABORTADO = 'PEN_EXPEDICAO_PROCESSO_ABORTADA'; | 14 | public static $TI_PROCESSO_ELETRONICO_PROCESSO_ABORTADO = 'PEN_EXPEDICAO_PROCESSO_ABORTADA'; |
15 | 15 | ||
16 | 16 | ||
17 | - /* NÃVEL DE SIGILO DE PROCESSOS E DOCUMENTOS */ | 17 | + /* NÍVEL DE SIGILO DE PROCESSOS E DOCUMENTOS */ |
18 | public static $STA_SIGILO_PUBLICO = '1'; | 18 | public static $STA_SIGILO_PUBLICO = '1'; |
19 | public static $STA_SIGILO_RESTRITO = '2'; | 19 | public static $STA_SIGILO_RESTRITO = '2'; |
20 | public static $STA_SIGILO_SIGILOSO = '3'; | 20 | public static $STA_SIGILO_SIGILOSO = '3'; |
21 | 21 | ||
22 | - /* RELAÇÃO DE SITUAÇÕES POSSÃVEIS EM UM TRÂMITE */ | ||
23 | - public static $STA_SITUACAO_TRAMITE_INICIADO = 1; // Iniciado - Metadados recebidos pela solução | ||
24 | - public static $STA_SITUACAO_TRAMITE_COMPONENTES_ENVIADOS_REMETENTE = 2; // Componentes digitais recebidos pela solução | ||
25 | - public static $STA_SITUACAO_TRAMITE_METADADOS_RECEBIDO_DESTINATARIO = 3; // Metadados recebidos pelo destinatário | ||
26 | - public static $STA_SITUACAO_TRAMITE_COMPONENTES_RECEBIDOS_DESTINATARIO = 4; // Componentes digitais recebidos pelo destinatário | ||
27 | - public static $STA_SITUACAO_TRAMITE_RECIBO_ENVIADO_DESTINATARIO = 5; // Recibo de conclusão do trâmite enviado pelo destinatário do processo | ||
28 | - public static $STA_SITUACAO_TRAMITE_RECIBO_RECEBIDO_REMETENTE = 6; // Recibo de conclusão do trâmite recebido pelo remetente do processo | ||
29 | - public static $STA_SITUACAO_TRAMITE_CANCELADO = 7; // Trâmite do processo ou documento cancelado pelo usuário (Qualquer situação diferente de 5 e 6) | ||
30 | - public static $STA_SITUACAO_TRAMITE_RECUSADO = 8; // Trâmite do processo recusado pelo destinatário (Situações 2, 3, 4) | ||
31 | - public static $STA_SITUACAO_TRAMITE_CIENCIA_RECUSA = 9; // Remetente ciente da recusa do trâmite | 22 | + /* RELAÇÃO DE SITUAÇÕES POSSÍVEIS EM UM TRÂMITE */ |
23 | + public static $STA_SITUACAO_TRAMITE_INICIADO = 1; // Iniciado - Metadados recebidos pela solução | ||
24 | + public static $STA_SITUACAO_TRAMITE_COMPONENTES_ENVIADOS_REMETENTE = 2; // Componentes digitais recebidos pela solução | ||
25 | + public static $STA_SITUACAO_TRAMITE_METADADOS_RECEBIDO_DESTINATARIO = 3; // Metadados recebidos pelo destinatário | ||
26 | + public static $STA_SITUACAO_TRAMITE_COMPONENTES_RECEBIDOS_DESTINATARIO = 4; // Componentes digitais recebidos pelo destinatário | ||
27 | + public static $STA_SITUACAO_TRAMITE_RECIBO_ENVIADO_DESTINATARIO = 5; // Recibo de conclusão do trâmite enviado pelo destinatário do processo | ||
28 | + public static $STA_SITUACAO_TRAMITE_RECIBO_RECEBIDO_REMETENTE = 6; // Recibo de conclusão do trâmite recebido pelo remetente do processo | ||
29 | + public static $STA_SITUACAO_TRAMITE_CANCELADO = 7; // Trâmite do processo ou documento cancelado pelo usuário (Qualquer situação diferente de 5 e 6) | ||
30 | + public static $STA_SITUACAO_TRAMITE_RECUSADO = 8; // Trâmite do processo recusado pelo destinatário (Situações 2, 3, 4) | ||
31 | + public static $STA_SITUACAO_TRAMITE_CIENCIA_RECUSA = 9; // Remetente ciente da recusa do trâmite | ||
32 | 32 | ||
33 | public static $STA_TIPO_RECIBO_ENVIO = '1'; // Recibo de envio | 33 | public static $STA_TIPO_RECIBO_ENVIO = '1'; // Recibo de envio |
34 | public static $STA_TIPO_RECIBO_CONCLUSAO_ENVIADO = '2'; // Recibo de recebimento enviado | 34 | public static $STA_TIPO_RECIBO_CONCLUSAO_ENVIADO = '2'; // Recibo de recebimento enviado |
35 | public static $STA_TIPO_RECIBO_CONCLUSAO_RECEBIDO = '3'; // Recibo de recebimento recebido | 35 | public static $STA_TIPO_RECIBO_CONCLUSAO_RECEBIDO = '3'; // Recibo de recebimento recebido |
36 | 36 | ||
37 | - /* OPERAÇÕES DO HISTÓRICO DO PROCESSO */ | ||
38 | - // 02 a 18 estão registrados na tabela rel_tarefa_operacao | 37 | + /* OPERAÇÕES DO HISTÓRICO DO PROCESSO */ |
38 | + // 02 a 18 estão registrados na tabela rel_tarefa_operacao | ||
39 | public static $OP_OPERACAO_REGISTRO = "01"; | 39 | public static $OP_OPERACAO_REGISTRO = "01"; |
40 | 40 | ||
41 | 41 | ||
@@ -51,12 +51,12 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -51,12 +51,12 @@ class ProcessoEletronicoRN extends InfraRN { | ||
51 | */ | 51 | */ |
52 | const MTV_RCSR_TRAM_CD_CORROMPIDO = '02'; | 52 | const MTV_RCSR_TRAM_CD_CORROMPIDO = '02'; |
53 | /** | 53 | /** |
54 | - * Motivo para recusar de tramite de componente digital que não foi enviado | 54 | + * Motivo para recusar de tramite de componente digital que não foi enviado |
55 | */ | 55 | */ |
56 | const MTV_RCSR_TRAM_CD_FALTA = '03'; | 56 | const MTV_RCSR_TRAM_CD_FALTA = '03'; |
57 | 57 | ||
58 | /** | 58 | /** |
59 | - * Espécie documentoal não mapeada | 59 | + * Espécie documentoal não mapeada |
60 | */ | 60 | */ |
61 | const MTV_RCSR_TRAM_CD_ESPECIE_NAO_MAPEADA = '03'; | 61 | const MTV_RCSR_TRAM_CD_ESPECIE_NAO_MAPEADA = '03'; |
62 | 62 | ||
@@ -66,10 +66,10 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -66,10 +66,10 @@ class ProcessoEletronicoRN extends InfraRN { | ||
66 | const MTV_RCSR_TRAM_CD_OUTROU = '99'; | 66 | const MTV_RCSR_TRAM_CD_OUTROU = '99'; |
67 | 67 | ||
68 | public static $MOTIVOS_RECUSA = array( | 68 | public static $MOTIVOS_RECUSA = array( |
69 | - "01" => "Formato de componente digital não suportado", | 69 | + "01" => "Formato de componente digital não suportado", |
70 | "02" => "Componente digital corrompido", | 70 | "02" => "Componente digital corrompido", |
71 | "03" => "Falta de componentes digitais", | 71 | "03" => "Falta de componentes digitais", |
72 | - "04" => "Espécie documental não mapeada no destinatário", | 72 | + "04" => "Espécie documental não mapeada no destinatário", |
73 | "99" => "Outro" | 73 | "99" => "Outro" |
74 | ); | 74 | ); |
75 | 75 | ||
@@ -86,16 +86,12 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -86,16 +86,12 @@ class ProcessoEletronicoRN extends InfraRN { | ||
86 | $strSenhaCertificadoDigital = $objPenParametroRN->getParametro('PEN_SENHA_CERTIFICADO_DIGITAL'); | 86 | $strSenhaCertificadoDigital = $objPenParametroRN->getParametro('PEN_SENHA_CERTIFICADO_DIGITAL'); |
87 | 87 | ||
88 | if (InfraString::isBolVazia($strEnderecoWebService)) { | 88 | if (InfraString::isBolVazia($strEnderecoWebService)) { |
89 | - throw new InfraException('Endereço do serviço de integração do Processo Eletrônico Nacional (PEN) não informado.'); | 89 | + throw new InfraException('Endereço do serviço de integração do Processo Eletrônico Nacional (PEN) não informado.'); |
90 | } | 90 | } |
91 | 91 | ||
92 | - /* if (!@file_get_contents($strLocalizacaoCertificadoDigital)) { | ||
93 | - throw new InfraException("Certificado digital de autenticação do serviço de integração do Processo Eletrônico Nacional(PEN) não encontrado."); | ||
94 | - }*/ | ||
95 | - | ||
96 | - //TODO: Urgente - Remover senha do certificado de autenticação dos serviços do PEN da tabela de parâmetros | 92 | + //TODO: Urgente - Remover senha do certificado de autenticação dos serviços do PEN da tabela de parâmetros |
97 | if (InfraString::isBolVazia($strSenhaCertificadoDigital)) { | 93 | if (InfraString::isBolVazia($strSenhaCertificadoDigital)) { |
98 | - throw new InfraException('Dados de autenticação do serviço de integração do Processo Eletrõnico Nacional(PEN) não informados.'); | 94 | + throw new InfraException('Dados de autenticação do serviço de integração do Processo Eletrõnico Nacional(PEN) não informados.'); |
99 | } | 95 | } |
100 | 96 | ||
101 | $this->strWSDL = $strEnderecoWebService . '?wsdl'; | 97 | $this->strWSDL = $strEnderecoWebService . '?wsdl'; |
@@ -127,14 +123,14 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -127,14 +123,14 @@ class ProcessoEletronicoRN extends InfraRN { | ||
127 | * Verifica se o uma url esta ativa | 123 | * Verifica se o uma url esta ativa |
128 | * | 124 | * |
129 | * @param string $strUrl url a ser testada | 125 | * @param string $strUrl url a ser testada |
130 | - * @param string $strLocalCert local fÃsico do certificado .pem | 126 | + * @param string $strLocalCert local físico do certificado .pem |
131 | * @throws InfraException | 127 | * @throws InfraException |
132 | * @return null | 128 | * @return null |
133 | */ | 129 | */ |
134 | private function testaUrl($strUrl = '', $strLocalCert = ''){ | 130 | private function testaUrl($strUrl = '', $strLocalCert = ''){ |
135 | 131 | ||
136 | $arrParseUrl = parse_url($this->strWSDL); | 132 | $arrParseUrl = parse_url($this->strWSDL); |
137 | - // é melhor a página inicial que todo o arquivo wsdl | 133 | + // é melhor a página inicial que todo o arquivo wsdl |
138 | $strUrl = $arrParseUrl['scheme'].'://'.$arrParseUrl['host']; | 134 | $strUrl = $arrParseUrl['scheme'].'://'.$arrParseUrl['host']; |
139 | 135 | ||
140 | $strCommand = sprintf('curl %s --insecure --cert %s 2>&1', $strUrl, $this->options['local_cert']); | 136 | $strCommand = sprintf('curl %s --insecure --cert %s 2>&1', $strUrl, $this->options['local_cert']); |
@@ -145,7 +141,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -145,7 +141,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
145 | 141 | ||
146 | if($numRetorno > 0){ | 142 | if($numRetorno > 0){ |
147 | 143 | ||
148 | - throw new InfraException('Falha de comunicação com o Barramento de Serviços. Por favor, tente novamente mais tarde.', $e); | 144 | + throw new InfraException('Falha de comunicação com o Barramento de Serviços. Por favor, tente novamente mais tarde.', $e); |
149 | } | 145 | } |
150 | } | 146 | } |
151 | 147 | ||
@@ -177,14 +173,14 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -177,14 +173,14 @@ class ProcessoEletronicoRN extends InfraRN { | ||
177 | $this->objPenWs = new BeSimple\SoapClient\SoapClient($this->strWSDL, $this->options); | 173 | $this->objPenWs = new BeSimple\SoapClient\SoapClient($this->strWSDL, $this->options); |
178 | } | 174 | } |
179 | } catch (Exception $e) { | 175 | } catch (Exception $e) { |
180 | - throw new InfraException('Erro acessando serviço.', $e); | 176 | + throw new InfraException('Erro acessando serviço.', $e); |
181 | } | 177 | } |
182 | } | 178 | } |
183 | 179 | ||
184 | return $this->objPenWs; | 180 | return $this->objPenWs; |
185 | } | 181 | } |
186 | 182 | ||
187 | - //TODO: Avaliar otimização de tal serviço para buscar individualmente os dados do repositório de estruturas | 183 | + //TODO: Avaliar otimização de tal serviço para buscar individualmente os dados do repositório de estruturas |
188 | public function consultarRepositoriosDeEstruturas($numIdentificacaoDoRepositorioDeEstruturas) { | 184 | public function consultarRepositoriosDeEstruturas($numIdentificacaoDoRepositorioDeEstruturas) { |
189 | 185 | ||
190 | $objRepositorioDTO = null; | 186 | $objRepositorioDTO = null; |
@@ -212,7 +208,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -212,7 +208,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
212 | } | 208 | } |
213 | } | 209 | } |
214 | } catch(Exception $e){ | 210 | } catch(Exception $e){ |
215 | - throw new InfraException("Erro durante obtenção dos repositórios", $e); | 211 | + throw new InfraException("Erro durante obtenção dos repositórios", $e); |
216 | } | 212 | } |
217 | 213 | ||
218 | return $objRepositorioDTO; | 214 | return $objRepositorioDTO; |
@@ -244,7 +240,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -244,7 +240,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
244 | } | 240 | } |
245 | } | 241 | } |
246 | } catch(Exception $e){ | 242 | } catch(Exception $e){ |
247 | - throw new InfraException("Erro durante obtenção dos repositórios", $e); | 243 | + throw new InfraException("Erro durante obtenção dos repositórios", $e); |
248 | } | 244 | } |
249 | 245 | ||
250 | return $arrObjRepositorioDTO; | 246 | return $arrObjRepositorioDTO; |
@@ -275,7 +271,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -275,7 +271,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
275 | $objEstrutura->hierarquia->nivel = array($objEstrutura->hierarquia->nivel); | 271 | $objEstrutura->hierarquia->nivel = array($objEstrutura->hierarquia->nivel); |
276 | } | 272 | } |
277 | 273 | ||
278 | - foreach ($objEstrutura->hierarquia->nivel as &$objNivel) { | 274 | + foreach ($objEstrutura->hierarquia->nivel as &$objNivel) { |
279 | $objNivel->nome = utf8_decode($objNivel->nome); | 275 | $objNivel->nome = utf8_decode($objNivel->nome); |
280 | } | 276 | } |
281 | } | 277 | } |
@@ -295,7 +291,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -295,7 +291,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
295 | } | 291 | } |
296 | } | 292 | } |
297 | catch (Exception $e) { | 293 | catch (Exception $e) { |
298 | - throw new InfraException("Erro durante obtenção das unidades", $e); | 294 | + throw new InfraException("Erro durante obtenção das unidades", $e); |
299 | } | 295 | } |
300 | } | 296 | } |
301 | 297 | ||
@@ -306,7 +302,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -306,7 +302,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
306 | try{ | 302 | try{ |
307 | $idRepositorioEstrutura = filter_var($idRepositorioEstrutura, FILTER_SANITIZE_NUMBER_INT); | 303 | $idRepositorioEstrutura = filter_var($idRepositorioEstrutura, FILTER_SANITIZE_NUMBER_INT); |
308 | if(!$idRepositorioEstrutura) { | 304 | if(!$idRepositorioEstrutura) { |
309 | - throw new InfraException("Repositório de Estruturas inválido"); | 305 | + throw new InfraException("Repositório de Estruturas inválido"); |
310 | } | 306 | } |
311 | 307 | ||
312 | $parametros = new stdClass(); | 308 | $parametros = new stdClass(); |
@@ -339,14 +335,10 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -339,14 +335,10 @@ class ProcessoEletronicoRN extends InfraRN { | ||
339 | $item->setStrCodigoNoOrgaoEntidade($estrutura->codigoNoOrgaoEntidade); | 335 | $item->setStrCodigoNoOrgaoEntidade($estrutura->codigoNoOrgaoEntidade); |
340 | 336 | ||
341 | if(!empty($estrutura->hierarquia->nivel)) { | 337 | if(!empty($estrutura->hierarquia->nivel)) { |
342 | - | ||
343 | $array = array(); | 338 | $array = array(); |
344 | - | ||
345 | foreach($estrutura->hierarquia->nivel as $nivel) { | 339 | foreach($estrutura->hierarquia->nivel as $nivel) { |
346 | - | ||
347 | $array[] = utf8_decode($nivel->sigla); | 340 | $array[] = utf8_decode($nivel->sigla); |
348 | } | 341 | } |
349 | - | ||
350 | $item->setArrHierarquia($array); | 342 | $item->setArrHierarquia($array); |
351 | } | 343 | } |
352 | 344 | ||
@@ -355,7 +347,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -355,7 +347,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
355 | } | 347 | } |
356 | 348 | ||
357 | } catch (Exception $e) { | 349 | } catch (Exception $e) { |
358 | - throw new InfraException("Erro durante obtenção das unidades", $e); | 350 | + throw new InfraException("Erro durante obtenção das unidades", $e); |
359 | } | 351 | } |
360 | 352 | ||
361 | return $arrObjEstruturaDTO; | 353 | return $arrObjEstruturaDTO; |
@@ -400,18 +392,17 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -400,18 +392,17 @@ class ProcessoEletronicoRN extends InfraRN { | ||
400 | public function enviarProcesso($parametros) | 392 | public function enviarProcesso($parametros) |
401 | { | 393 | { |
402 | try { | 394 | try { |
403 | - //error_log("PARAMETROS:" . print_r($parametros, true)); | ||
404 | return $this->getObjPenWs()->enviarProcesso($parametros); | 395 | return $this->getObjPenWs()->enviarProcesso($parametros); |
405 | } catch (\SoapFault $fault) { | 396 | } catch (\SoapFault $fault) { |
406 | 397 | ||
407 | 398 | ||
408 | if (!empty($fault->detail->interoperabilidadeException->codigoErro) && $fault->detail->interoperabilidadeException->codigoErro == '0005') { | 399 | if (!empty($fault->detail->interoperabilidadeException->codigoErro) && $fault->detail->interoperabilidadeException->codigoErro == '0005') { |
409 | - $mensagem = 'O código mapeado para a unidade ' . utf8_decode($parametros->novoTramiteDeProcesso->processo->documento[0]->produtor->unidade->nome) . ' está incorreto.'; | 400 | + $mensagem = 'O código mapeado para a unidade ' . utf8_decode($parametros->novoTramiteDeProcesso->processo->documento[0]->produtor->unidade->nome) . ' está incorreto.'; |
410 | } else { | 401 | } else { |
411 | $mensagem = $this->tratarFalhaWebService($fault); | 402 | $mensagem = $this->tratarFalhaWebService($fault); |
412 | } | 403 | } |
413 | - //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon | ||
414 | - //relacionado ao a renderização de mensagens de erro na barra de progresso | 404 | + //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon |
405 | + //relacionado ao a renderização de mensagens de erro na barra de progresso | ||
415 | error_log($mensagem); | 406 | error_log($mensagem); |
416 | throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); | 407 | throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); |
417 | 408 | ||
@@ -454,7 +445,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -454,7 +445,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
454 | return $arrObjPendenciaDTO; | 445 | return $arrObjPendenciaDTO; |
455 | } | 446 | } |
456 | 447 | ||
457 | - //TODO: Tratar cada um dos possÃveis erros gerados pelos serviços de integração do PEN | 448 | + //TODO: Tratar cada um dos possíveis erros gerados pelos serviços de integração do PEN |
458 | private function tratarFalhaWebService(SoapFault $fault) | 449 | private function tratarFalhaWebService(SoapFault $fault) |
459 | { | 450 | { |
460 | error_log('$e->faultcode:' . $fault->faultcode); | 451 | error_log('$e->faultcode:' . $fault->faultcode); |
@@ -466,7 +457,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -466,7 +457,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
466 | 457 | ||
467 | switch ($strWsException->codigoErro) { | 458 | switch ($strWsException->codigoErro) { |
468 | case '0044': | 459 | case '0044': |
469 | - $mensagem = 'Processo já possui um trâmite em andamento'; | 460 | + $mensagem = 'Processo já possui um trâmite em andamento'; |
470 | break; | 461 | break; |
471 | 462 | ||
472 | default: | 463 | default: |
@@ -505,25 +496,16 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -505,25 +496,16 @@ class ProcessoEletronicoRN extends InfraRN { | ||
505 | public function enviarComponenteDigital($parametros) | 496 | public function enviarComponenteDigital($parametros) |
506 | { | 497 | { |
507 | try { | 498 | try { |
508 | - //error_log('$this->getObjPenWs()->enviarComponenteDigital($parametros)'); | ||
509 | - //error_log("||||||||||||||||||" . print_r($parametros, true)); | ||
510 | return $this->getObjPenWs()->enviarComponenteDigital($parametros); | 499 | return $this->getObjPenWs()->enviarComponenteDigital($parametros); |
511 | - | ||
512 | } catch (\SoapFault $fault) { | 500 | } catch (\SoapFault $fault) { |
513 | - //error_log("REQUEST:" . $this->getObjPenWs()->__getLastRequest()); | ||
514 | - //error_log("ERROR:" . print_r($fault, true)); | ||
515 | - | ||
516 | $mensagem = $this->tratarFalhaWebService($fault); | 501 | $mensagem = $this->tratarFalhaWebService($fault); |
517 | 502 | ||
518 | - //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon | ||
519 | - //relacionado ao a renderização de mensagens de erro na barra de progresso | 503 | + //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon |
504 | + //relacionado ao a renderização de mensagens de erro na barra de progresso | ||
520 | throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); | 505 | throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); |
521 | - | ||
522 | } catch (\Exception $e) { | 506 | } catch (\Exception $e) { |
523 | - | ||
524 | throw new InfraException("Error Processing Request", $e); | 507 | throw new InfraException("Error Processing Request", $e); |
525 | } | 508 | } |
526 | - | ||
527 | } | 509 | } |
528 | 510 | ||
529 | 511 | ||
@@ -536,8 +518,8 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -536,8 +518,8 @@ class ProcessoEletronicoRN extends InfraRN { | ||
536 | return $this->getObjPenWs()->solicitarMetadados($parametros); | 518 | return $this->getObjPenWs()->solicitarMetadados($parametros); |
537 | } catch (\SoapFault $fault) { | 519 | } catch (\SoapFault $fault) { |
538 | $mensagem = $this->tratarFalhaWebService($fault); | 520 | $mensagem = $this->tratarFalhaWebService($fault); |
539 | - //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon | ||
540 | - //relacionado ao a renderização de mensagens de erro na barra de progresso | 521 | + //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon |
522 | + //relacionado ao a renderização de mensagens de erro na barra de progresso | ||
541 | error_log($mensagem); | 523 | error_log($mensagem); |
542 | throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); | 524 | throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); |
543 | 525 | ||
@@ -588,22 +570,22 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -588,22 +570,22 @@ class ProcessoEletronicoRN extends InfraRN { | ||
588 | public function cadastrarTramiteDeProcesso($parDblIdProcedimento, $parStrNumeroRegistro, $parNumIdentificacaoTramite, $parDthRegistroTramite, $parObjProcesso, $parNumTicketComponentesDigitais = null, $parObjComponentesDigitaisSolicitados = null) | 570 | public function cadastrarTramiteDeProcesso($parDblIdProcedimento, $parStrNumeroRegistro, $parNumIdentificacaoTramite, $parDthRegistroTramite, $parObjProcesso, $parNumTicketComponentesDigitais = null, $parObjComponentesDigitaisSolicitados = null) |
589 | { | 571 | { |
590 | if(!isset($parDblIdProcedimento) || $parDblIdProcedimento == 0) { | 572 | if(!isset($parDblIdProcedimento) || $parDblIdProcedimento == 0) { |
591 | - throw new InfraException('Parâmetro $parDblIdProcedimento não informado.'); | 573 | + throw new InfraException('Parâmetro $parDblIdProcedimento não informado.'); |
592 | } | 574 | } |
593 | 575 | ||
594 | if(!isset($parStrNumeroRegistro)) { | 576 | if(!isset($parStrNumeroRegistro)) { |
595 | - throw new InfraException('Parâmetro $parStrNumeroRegistro não informado.'); | 577 | + throw new InfraException('Parâmetro $parStrNumeroRegistro não informado.'); |
596 | } | 578 | } |
597 | 579 | ||
598 | if(!isset($parNumIdentificacaoTramite) || $parNumIdentificacaoTramite == 0) { | 580 | if(!isset($parNumIdentificacaoTramite) || $parNumIdentificacaoTramite == 0) { |
599 | - throw new InfraException('Parâmetro $parStrNumeroRegistro não informado.'); | 581 | + throw new InfraException('Parâmetro $parStrNumeroRegistro não informado.'); |
600 | } | 582 | } |
601 | 583 | ||
602 | if(!isset($parObjProcesso)) { | 584 | if(!isset($parObjProcesso)) { |
603 | - throw new InfraException('Parâmetro $objProcesso não informado.'); | 585 | + throw new InfraException('Parâmetro $objProcesso não informado.'); |
604 | } | 586 | } |
605 | 587 | ||
606 | - //Monta dados do processo eletrônico | 588 | + //Monta dados do processo eletrônico |
607 | $objProcessoEletronicoDTO = new ProcessoEletronicoDTO(); | 589 | $objProcessoEletronicoDTO = new ProcessoEletronicoDTO(); |
608 | $objProcessoEletronicoDTO->setStrNumeroRegistro($parStrNumeroRegistro); | 590 | $objProcessoEletronicoDTO->setStrNumeroRegistro($parStrNumeroRegistro); |
609 | $objProcessoEletronicoDTO->setDblIdProcedimento($parDblIdProcedimento); | 591 | $objProcessoEletronicoDTO->setDblIdProcedimento($parDblIdProcedimento); |
@@ -627,7 +609,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -627,7 +609,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
627 | $objProcessoEletronicoDTO->setArrObjRelProcessoEletronicoApensado($arrObjRelProcessoEletronicoApensadoDTO); | 609 | $objProcessoEletronicoDTO->setArrObjRelProcessoEletronicoApensado($arrObjRelProcessoEletronicoApensadoDTO); |
628 | } | 610 | } |
629 | 611 | ||
630 | - //Monta dados do trâmite do processo | 612 | + //Monta dados do trâmite do processo |
631 | $objTramiteDTO = new TramiteDTO(); | 613 | $objTramiteDTO = new TramiteDTO(); |
632 | $objTramiteDTO->setStrNumeroRegistro($parStrNumeroRegistro); | 614 | $objTramiteDTO->setStrNumeroRegistro($parStrNumeroRegistro); |
633 | $objTramiteDTO->setNumIdTramite($parNumIdentificacaoTramite); | 615 | $objTramiteDTO->setNumIdTramite($parNumIdentificacaoTramite); |
@@ -647,16 +629,16 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -647,16 +629,16 @@ class ProcessoEletronicoRN extends InfraRN { | ||
647 | } | 629 | } |
648 | 630 | ||
649 | 631 | ||
650 | - //TODO: Tratar a exceção de recebimento de um trâmite que já havia sido tratado no sistema | 632 | + //TODO: Tratar a exceção de recebimento de um trâmite que já havia sido tratado no sistema |
651 | protected function cadastrarTramiteDeProcessoInternoControlado(ProcessoEletronicoDTO $parObjProcessoEletronicoDTO) { | 633 | protected function cadastrarTramiteDeProcessoInternoControlado(ProcessoEletronicoDTO $parObjProcessoEletronicoDTO) { |
652 | 634 | ||
653 | if(!isset($parObjProcessoEletronicoDTO)) { | 635 | if(!isset($parObjProcessoEletronicoDTO)) { |
654 | - throw new InfraException('Parâmetro $parObjProcessoEletronicoDTO não informado.'); | 636 | + throw new InfraException('Parâmetro $parObjProcessoEletronicoDTO não informado.'); |
655 | } | 637 | } |
656 | 638 | ||
657 | $idProcedimento = $parObjProcessoEletronicoDTO->getDblIdProcedimento(); | 639 | $idProcedimento = $parObjProcessoEletronicoDTO->getDblIdProcedimento(); |
658 | 640 | ||
659 | - //Registra os dados do processo eletrônico | 641 | + //Registra os dados do processo eletrônico |
660 | //TODO: Revisar a forma como o barramento tratar o NRE para os processos apensados | 642 | //TODO: Revisar a forma como o barramento tratar o NRE para os processos apensados |
661 | $objProcessoEletronicoDTOFiltro = new ProcessoEletronicoDTO(); | 643 | $objProcessoEletronicoDTOFiltro = new ProcessoEletronicoDTO(); |
662 | $objProcessoEletronicoDTOFiltro->setStrNumeroRegistro($parObjProcessoEletronicoDTO->getStrNumeroRegistro()); | 644 | $objProcessoEletronicoDTOFiltro->setStrNumeroRegistro($parObjProcessoEletronicoDTO->getStrNumeroRegistro()); |
@@ -686,7 +668,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -686,7 +668,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
686 | } | 668 | } |
687 | } | 669 | } |
688 | 670 | ||
689 | - //Registrar informações sobre o trâmite do processo | 671 | + //Registrar informações sobre o trâmite do processo |
690 | $arrObjTramiteDTO = $parObjProcessoEletronicoDTO->getArrObjTramiteDTO(); | 672 | $arrObjTramiteDTO = $parObjProcessoEletronicoDTO->getArrObjTramiteDTO(); |
691 | $parObjTramiteDTO = $arrObjTramiteDTO[0]; | 673 | $parObjTramiteDTO = $arrObjTramiteDTO[0]; |
692 | 674 | ||
@@ -704,7 +686,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -704,7 +686,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
704 | 686 | ||
705 | $objProcessoEletronicoDTO->setArrObjTramiteDTO(array($objTramiteDTO)); | 687 | $objProcessoEletronicoDTO->setArrObjTramiteDTO(array($objTramiteDTO)); |
706 | 688 | ||
707 | - //Registra informações sobre o componente digital do documento | 689 | + //Registra informações sobre o componente digital do documento |
708 | $arrObjComponenteDigitalDTO = array(); | 690 | $arrObjComponenteDigitalDTO = array(); |
709 | $objComponenteDigitalBD = new ComponenteDigitalBD($this->getObjInfraIBanco()); | 691 | $objComponenteDigitalBD = new ComponenteDigitalBD($this->getObjInfraIBanco()); |
710 | 692 | ||
@@ -726,7 +708,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -726,7 +708,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
726 | 708 | ||
727 | foreach ($parObjTramiteDTO->getArrObjComponenteDigitalDTO() as $objComponenteDigitalDTO) { | 709 | foreach ($parObjTramiteDTO->getArrObjComponenteDigitalDTO() as $objComponenteDigitalDTO) { |
728 | 710 | ||
729 | - //Verifica se o documento foi inserido pelo trâmite atual | 711 | + //Verifica se o documento foi inserido pelo trâmite atual |
730 | if($objComponenteDigitalDTO->getDblIdDocumento() != null){ | 712 | if($objComponenteDigitalDTO->getDblIdDocumento() != null){ |
731 | 713 | ||
732 | $objComponenteDigitalDTO->setDblIdProcedimento($idProcedimento); | 714 | $objComponenteDigitalDTO->setDblIdProcedimento($idProcedimento); |
@@ -761,7 +743,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -761,7 +743,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
761 | $objTramiteDTO->setArrObjComponenteDigitalDTO($arrObjComponenteDigitalDTO); | 743 | $objTramiteDTO->setArrObjComponenteDigitalDTO($arrObjComponenteDigitalDTO); |
762 | 744 | ||
763 | 745 | ||
764 | - //TODO: Adicionar controle de excessão | 746 | + //TODO: Adicionar controle de excessão |
765 | //... | 747 | //... |
766 | 748 | ||
767 | return $objProcessoEletronicoDTO; | 749 | return $objProcessoEletronicoDTO; |
@@ -808,7 +790,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -808,7 +790,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
808 | 790 | ||
809 | //Por enquanto, considera que o documento possui apenas um componente digital | 791 | //Por enquanto, considera que o documento possui apenas um componente digital |
810 | if(is_array($objDocumento->componenteDigital) && count($objDocumento->componenteDigital) != 1) { | 792 | if(is_array($objDocumento->componenteDigital) && count($objDocumento->componenteDigital) != 1) { |
811 | - throw new InfraException("Erro processando componentes digitais do processo " . $parObjProcesso->protocolo . "\n Somente é permitido o recebimento de documentos com apenas um Componente Digital."); | 793 | + throw new InfraException("Erro processando componentes digitais do processo " . $parObjProcesso->protocolo . "\n Somente é permitido o recebimento de documentos com apenas um Componente Digital."); |
812 | } | 794 | } |
813 | 795 | ||
814 | $objComponenteDigital = $objDocumento->componenteDigital; | 796 | $objComponenteDigital = $objDocumento->componenteDigital; |
@@ -822,7 +804,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -822,7 +804,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
822 | $objComponenteDigitalDTO->setStrMimeType($objComponenteDigital->mimeType); | 804 | $objComponenteDigitalDTO->setStrMimeType($objComponenteDigital->mimeType); |
823 | $objComponenteDigitalDTO->setStrDadosComplementares($objComponenteDigital->dadosComplementaresDoTipoDeArquivo); | 805 | $objComponenteDigitalDTO->setStrDadosComplementares($objComponenteDigital->dadosComplementaresDoTipoDeArquivo); |
824 | 806 | ||
825 | - //Registrar componente digital necessita ser enviado pelo trâmite espefÃfico //TODO: Teste $parObjComponentesDigitaisSolicitados aqui | 807 | + //Registrar componente digital necessita ser enviado pelo trâmite espefífico //TODO: Teste $parObjComponentesDigitaisSolicitados aqui |
826 | if(isset($parObjComponentesDigitaisSolicitados)){ | 808 | if(isset($parObjComponentesDigitaisSolicitados)){ |
827 | $arrObjItensSolicitados = is_array($parObjComponentesDigitaisSolicitados->processo) ? $parObjComponentesDigitaisSolicitados->processo : array($parObjComponentesDigitaisSolicitados->processo); | 809 | $arrObjItensSolicitados = is_array($parObjComponentesDigitaisSolicitados->processo) ? $parObjComponentesDigitaisSolicitados->processo : array($parObjComponentesDigitaisSolicitados->processo); |
828 | 810 | ||
@@ -870,22 +852,16 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -870,22 +852,16 @@ class ProcessoEletronicoRN extends InfraRN { | ||
870 | return $this->getObjPenWs()->receberComponenteDigital($parametros); | 852 | return $this->getObjPenWs()->receberComponenteDigital($parametros); |
871 | 853 | ||
872 | } catch (\SoapFault $fault) { | 854 | } catch (\SoapFault $fault) { |
873 | - //error_log("REQUEST:" . $this->getObjPenWs()->__getLastRequest()); | ||
874 | - //error_log("ERROR:" . print_r($fault, true)); | ||
875 | - $mensagem = $this->tratarFalhaWebService($fault); | ||
876 | - | ||
877 | - //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon | ||
878 | - //relacionado ao a renderização de mensagens de erro na barra de progresso | ||
879 | - error_log($mensagem); | ||
880 | - throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); | ||
881 | - | 855 | + $mensagem = $this->tratarFalhaWebService($fault); |
856 | + //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon | ||
857 | + //rlacionado ao a renderização de mensagens de erro na barra de progresso | ||
858 | + error_log($mensagem); | ||
859 | + throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); | ||
882 | } catch (\Exception $e) { | 860 | } catch (\Exception $e) { |
883 | throw new InfraException("Error Processing Request", $e); | 861 | throw new InfraException("Error Processing Request", $e); |
884 | } | 862 | } |
885 | } | 863 | } |
886 | 864 | ||
887 | - | ||
888 | - | ||
889 | public function consultarTramites($parNumIdTramite = null, $parNumeroRegistro = null, $parNumeroUnidadeRemetente = null, $parNumeroUnidadeDestino = null, $parProtocolo = null, $parNumeroRepositorioEstruturas = null) | 865 | public function consultarTramites($parNumIdTramite = null, $parNumeroRegistro = null, $parNumeroUnidadeRemetente = null, $parNumeroUnidadeDestino = null, $parProtocolo = null, $parNumeroRepositorioEstruturas = null) |
890 | { | 866 | { |
891 | try | 867 | try |
@@ -1010,7 +986,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1010,7 +986,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1010 | } | 986 | } |
1011 | 987 | ||
1012 | if (!in_array($objProtocoloDTO->getStrStaEstado(), array(ProtocoloRN::$TE_EM_PROCESSAMENTO, ProtocoloRn::$TE_BLOQUEADO))) { | 988 | if (!in_array($objProtocoloDTO->getStrStaEstado(), array(ProtocoloRN::$TE_EM_PROCESSAMENTO, ProtocoloRn::$TE_BLOQUEADO))) { |
1013 | - throw new InfraException(utf8_encode('O processo não esta com o estado com "Em Processamento" ou "Bloqueado"')); | 989 | + throw new InfraException(utf8_encode('O processo não esta com o estado com "Em Processamento" ou "Bloqueado"')); |
1014 | } | 990 | } |
1015 | 991 | ||
1016 | $objTramiteDTO = new TramiteDTO(); | 992 | $objTramiteDTO = new TramiteDTO(); |
@@ -1023,7 +999,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1023,7 +999,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1023 | $arrObjTramiteDTO = $objTramiteBD->listar($objTramiteDTO); | 999 | $arrObjTramiteDTO = $objTramiteBD->listar($objTramiteDTO); |
1024 | 1000 | ||
1025 | if(!$arrObjTramiteDTO){ | 1001 | if(!$arrObjTramiteDTO){ |
1026 | - throw new InfraException('Trâmite não encontrado'); | 1002 | + throw new InfraException('Trâmite não encontrado'); |
1027 | } | 1003 | } |
1028 | 1004 | ||
1029 | $objTramiteDTO = $arrObjTramiteDTO[0]; | 1005 | $objTramiteDTO = $arrObjTramiteDTO[0]; |
@@ -1063,7 +1039,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1063,7 +1039,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1063 | $objPenUnidadeDTO = $objBD->consultar($objPenUnidadeDTO); | 1039 | $objPenUnidadeDTO = $objBD->consultar($objPenUnidadeDTO); |
1064 | 1040 | ||
1065 | if (empty($objPenUnidadeDTO)) { | 1041 | if (empty($objPenUnidadeDTO)) { |
1066 | - throw new InfraException(utf8_encode('Número da Unidade RH não foi encontrado')); | 1042 | + throw new InfraException(utf8_encode('Número da Unidade RH não foi encontrado')); |
1067 | } | 1043 | } |
1068 | 1044 | ||
1069 | $numIdEstrutura = $objPenUnidadeDTO->getNumIdUnidadeRH(); | 1045 | $numIdEstrutura = $objPenUnidadeDTO->getNumIdUnidadeRH(); |
@@ -1072,13 +1048,13 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1072,13 +1048,13 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1072 | if ($objTramite->remetente->numeroDeIdentificacaoDaEstrutura != $numIdEstrutura || | 1048 | if ($objTramite->remetente->numeroDeIdentificacaoDaEstrutura != $numIdEstrutura || |
1073 | $objTramite->remetente->identificacaoDoRepositorioDeEstruturas != $numIdRepositorio) { | 1049 | $objTramite->remetente->identificacaoDoRepositorioDeEstruturas != $numIdRepositorio) { |
1074 | 1050 | ||
1075 | - throw new InfraException(utf8_encode('O último trâmite desse processo não pertence a esse órgão')); | 1051 | + throw new InfraException(utf8_encode('O último trâmite desse processo não pertence a esse órgão')); |
1076 | } | 1052 | } |
1077 | 1053 | ||
1078 | switch ($objTramite->situacaoAtual) { | 1054 | switch ($objTramite->situacaoAtual) { |
1079 | 1055 | ||
1080 | case static::$STA_SITUACAO_TRAMITE_RECIBO_ENVIADO_DESTINATARIO: | 1056 | case static::$STA_SITUACAO_TRAMITE_RECIBO_ENVIADO_DESTINATARIO: |
1081 | - // @todo: caso command-line informar o procedimento que será executado | 1057 | + // @todo: caso command-line informar o procedimento que será executado |
1082 | $objPenTramiteProcessadoRN = new PenTramiteProcessadoRN(PenTramiteProcessadoRN::STR_TIPO_RECIBO); | 1058 | $objPenTramiteProcessadoRN = new PenTramiteProcessadoRN(PenTramiteProcessadoRN::STR_TIPO_RECIBO); |
1083 | 1059 | ||
1084 | if(!$objPenTramiteProcessadoRN->isProcedimentoRecebido($objTramite->IDT)){ | 1060 | if(!$objPenTramiteProcessadoRN->isProcedimentoRecebido($objTramite->IDT)){ |
@@ -1089,7 +1065,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1089,7 +1065,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1089 | break; | 1065 | break; |
1090 | 1066 | ||
1091 | case static::$STA_SITUACAO_TRAMITE_RECIBO_RECEBIDO_REMETENTE: | 1067 | case static::$STA_SITUACAO_TRAMITE_RECIBO_RECEBIDO_REMETENTE: |
1092 | - throw new InfraException(utf8_encode('O trâmite externo deste processo já foi concluÃdo')); | 1068 | + throw new InfraException(utf8_encode('O trâmite externo deste processo já foi concluído')); |
1093 | break; | 1069 | break; |
1094 | 1070 | ||
1095 | default: | 1071 | default: |
@@ -1153,15 +1129,12 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1153,15 +1129,12 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1153 | openssl_free_key($objPrivatekey); | 1129 | openssl_free_key($objPrivatekey); |
1154 | } | 1130 | } |
1155 | 1131 | ||
1156 | - //error_log("REQUEST:" . $this->getObjPenWs()->__getLastRequest()); | ||
1157 | - //error_log("ERROR:" . print_r($fault, true)); | ||
1158 | $mensagem = $this->tratarFalhaWebService($fault); | 1132 | $mensagem = $this->tratarFalhaWebService($fault); |
1159 | 1133 | ||
1160 | - //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon | ||
1161 | - //relacionado ao a renderização de mensagens de erro na barra de progresso | 1134 | + //TODO: Remover formatação do javascript após resolução do BUG enviado para Mairon |
1135 | + //relacionado ao a renderização de mensagens de erro na barra de progresso | ||
1162 | error_log($mensagem); | 1136 | error_log($mensagem); |
1163 | throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); | 1137 | throw new InfraException(InfraString::formatarJavaScript($mensagem), $fault); |
1164 | - | ||
1165 | } catch (\Exception $e) { | 1138 | } catch (\Exception $e) { |
1166 | if(isset($objPrivatekey)){ | 1139 | if(isset($objPrivatekey)){ |
1167 | openssl_free_key($objPrivatekey); | 1140 | openssl_free_key($objPrivatekey); |
@@ -1216,11 +1189,11 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1216,11 +1189,11 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1216 | throw new InfraException("Error Processing Request", $e); | 1189 | throw new InfraException("Error Processing Request", $e); |
1217 | } | 1190 | } |
1218 | 1191 | ||
1219 | - //TODO: Implementar mapeamento entre operações do PEN e tarefas do SEI | 1192 | + //TODO: Implementar mapeamento entre operações do PEN e tarefas do SEI |
1220 | public function converterOperacaoDTO($objOperacaoPEN) | 1193 | public function converterOperacaoDTO($objOperacaoPEN) |
1221 | { | 1194 | { |
1222 | if(!isset($objOperacaoPEN)) { | 1195 | if(!isset($objOperacaoPEN)) { |
1223 | - throw new InfraException('Parâmetro $objOperacaoPEN não informado.'); | 1196 | + throw new InfraException('Parâmetro $objOperacaoPEN não informado.'); |
1224 | } | 1197 | } |
1225 | 1198 | ||
1226 | $objOperacaoDTO = new OperacaoDTO(); | 1199 | $objOperacaoDTO = new OperacaoDTO(); |
@@ -1237,17 +1210,17 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1237,17 +1210,17 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1237 | switch ($objOperacaoPEN->codigo) { | 1210 | switch ($objOperacaoPEN->codigo) { |
1238 | case "01": $objOperacaoDTO->setStrNome("Registro"); break; | 1211 | case "01": $objOperacaoDTO->setStrNome("Registro"); break; |
1239 | case "02": $objOperacaoDTO->setStrNome("Envio de documento avulso/processo"); break; | 1212 | case "02": $objOperacaoDTO->setStrNome("Envio de documento avulso/processo"); break; |
1240 | - case "03": $objOperacaoDTO->setStrNome("Cancelamento/exclusão ou envio de documento"); break; | 1213 | + case "03": $objOperacaoDTO->setStrNome("Cancelamento/exclusão ou envio de documento"); break; |
1241 | case "04": $objOperacaoDTO->setStrNome("Recebimento de documento"); break; | 1214 | case "04": $objOperacaoDTO->setStrNome("Recebimento de documento"); break; |
1242 | - case "05": $objOperacaoDTO->setStrNome("Autuação"); break; | ||
1243 | - case "06": $objOperacaoDTO->setStrNome("Juntada por anexação"); break; | ||
1244 | - case "07": $objOperacaoDTO->setStrNome("Juntada por apensação"); break; | ||
1245 | - case "08": $objOperacaoDTO->setStrNome("Desapensação"); break; | 1215 | + case "05": $objOperacaoDTO->setStrNome("Autuação"); break; |
1216 | + case "06": $objOperacaoDTO->setStrNome("Juntada por anexação"); break; | ||
1217 | + case "07": $objOperacaoDTO->setStrNome("Juntada por apensação"); break; | ||
1218 | + case "08": $objOperacaoDTO->setStrNome("Desapensação"); break; | ||
1246 | case "09": $objOperacaoDTO->setStrNome("Arquivamento"); break; | 1219 | case "09": $objOperacaoDTO->setStrNome("Arquivamento"); break; |
1247 | case "10": $objOperacaoDTO->setStrNome("Arquivamento no Arquivo Nacional"); break; | 1220 | case "10": $objOperacaoDTO->setStrNome("Arquivamento no Arquivo Nacional"); break; |
1248 | - case "11": $objOperacaoDTO->setStrNome("Eliminação"); break; | 1221 | + case "11": $objOperacaoDTO->setStrNome("Eliminação"); break; |
1249 | case "12": $objOperacaoDTO->setStrNome("Sinistro"); break; | 1222 | case "12": $objOperacaoDTO->setStrNome("Sinistro"); break; |
1250 | - case "13": $objOperacaoDTO->setStrNome("Reconstituição de processo"); break; | 1223 | + case "13": $objOperacaoDTO->setStrNome("Reconstituição de processo"); break; |
1251 | case "14": $objOperacaoDTO->setStrNome("Desarquivamento"); break; | 1224 | case "14": $objOperacaoDTO->setStrNome("Desarquivamento"); break; |
1252 | case "15": $objOperacaoDTO->setStrNome("Desmembramento"); break; | 1225 | case "15": $objOperacaoDTO->setStrNome("Desmembramento"); break; |
1253 | case "16": $objOperacaoDTO->setStrNome("Desentranhamento"); break; | 1226 | case "16": $objOperacaoDTO->setStrNome("Desentranhamento"); break; |
@@ -1259,7 +1232,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1259,7 +1232,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1259 | return $objOperacaoDTO; | 1232 | return $objOperacaoDTO; |
1260 | } | 1233 | } |
1261 | 1234 | ||
1262 | - //TODO: Implementar mapeamento entre operações do PEN e tarefas do SEI | 1235 | + //TODO: Implementar mapeamento entre operações do PEN e tarefas do SEI |
1263 | public function obterCodigoOperacaoPENMapeado($numIdTarefa) | 1236 | public function obterCodigoOperacaoPENMapeado($numIdTarefa) |
1264 | { | 1237 | { |
1265 | $strCodigoOperacao = self::$OP_OPERACAO_REGISTRO; | 1238 | $strCodigoOperacao = self::$OP_OPERACAO_REGISTRO; |
@@ -1281,7 +1254,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1281,7 +1254,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1281 | return $strCodigoOperacao; | 1254 | return $strCodigoOperacao; |
1282 | } | 1255 | } |
1283 | 1256 | ||
1284 | - //TODO: Implementar mapeamento entre operações do PEN e tarefas do SEI | 1257 | + //TODO: Implementar mapeamento entre operações do PEN e tarefas do SEI |
1285 | public function obterIdTarefaSEIMapeado($strCodigoOperacao) | 1258 | public function obterIdTarefaSEIMapeado($strCodigoOperacao) |
1286 | { | 1259 | { |
1287 | return self::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO; | 1260 | return self::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO; |
@@ -1290,7 +1263,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1290,7 +1263,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1290 | 1263 | ||
1291 | /** | 1264 | /** |
1292 | * Cancela um tramite externo de um procedimento para outra unidade, gera | 1265 | * Cancela um tramite externo de um procedimento para outra unidade, gera |
1293 | - * falha caso a unidade de destino já tenha começado a receber o procedimento. | 1266 | + * falha caso a unidade de destino já tenha começado a receber o procedimento. |
1294 | * | 1267 | * |
1295 | * @param type $idTramite | 1268 | * @param type $idTramite |
1296 | * @param type $idProtocolo | 1269 | * @param type $idProtocolo |
@@ -1319,7 +1292,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1319,7 +1292,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1319 | } | 1292 | } |
1320 | 1293 | ||
1321 | /** | 1294 | /** |
1322 | - * Método que faz a recusa de um trâmite | 1295 | + * Método que faz a recusa de um trâmite |
1323 | * | 1296 | * |
1324 | * @param integer $idTramite | 1297 | * @param integer $idTramite |
1325 | * @param string $justificativa | 1298 | * @param string $justificativa |
@@ -1380,7 +1353,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1380,7 +1353,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1380 | $objGenericoBD = new GenericoBD($this->inicializarObjInfraIBanco()); | 1353 | $objGenericoBD = new GenericoBD($this->inicializarObjInfraIBanco()); |
1381 | $objPenUnidadeDTO = $objGenericoBD->consultar($objPenUnidadeDTO); | 1354 | $objPenUnidadeDTO = $objGenericoBD->consultar($objPenUnidadeDTO); |
1382 | 1355 | ||
1383 | - //Obtem os dados do último trâmite desse processo no barramento | 1356 | + //Obtem os dados do último trâmite desse processo no barramento |
1384 | $objProtocoloDTO = new ProtocoloDTO(); | 1357 | $objProtocoloDTO = new ProtocoloDTO(); |
1385 | $objProtocoloDTO->setStrProtocoloFormatado($strProtocolo); | 1358 | $objProtocoloDTO->setStrProtocoloFormatado($strProtocolo); |
1386 | $objProtocoloDTO->retDblIdProtocolo(); | 1359 | $objProtocoloDTO->retDblIdProtocolo(); |
@@ -1456,7 +1429,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1456,7 +1429,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1456 | return $hipoteses; | 1429 | return $hipoteses; |
1457 | 1430 | ||
1458 | } catch(Exception $e){ | 1431 | } catch(Exception $e){ |
1459 | - throw new InfraException("Erro durante obtenção da resposta das hipóteses legais", $e); | 1432 | + throw new InfraException("Erro durante obtenção da resposta das hipóteses legais", $e); |
1460 | } | 1433 | } |
1461 | } | 1434 | } |
1462 | 1435 |
rn/ReceberProcedimentoRN.php
@@ -80,16 +80,15 @@ class ReceberProcedimentoRN extends InfraRN | @@ -80,16 +80,15 @@ class ReceberProcedimentoRN extends InfraRN | ||
80 | $objInfraSessao->trocarUnidadeAtual(); | 80 | $objInfraSessao->trocarUnidadeAtual(); |
81 | } | 81 | } |
82 | 82 | ||
83 | - // TODO: Adicionar comandos de debug. Vide SeiWs.php gerarProcedimento | 83 | + // TODO: Adicionar comandos de debug. Vide SeiWs.php gerarProcedimento |
84 | protected function receberProcedimentoControlado($parNumIdentificacaoTramite) | 84 | protected function receberProcedimentoControlado($parNumIdentificacaoTramite) |
85 | { | 85 | { |
86 | + | ||
86 | $objPenParametroRN = new PenParametroRN(); | 87 | $objPenParametroRN = new PenParametroRN(); |
87 | SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objPenParametroRN->getParametro('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | 88 | SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objPenParametroRN->getParametro('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); |
88 | 89 | ||
89 | $objSeiRN = new SeiRN(); | 90 | $objSeiRN = new SeiRN(); |
90 | 91 | ||
91 | - error_log(__METHOD__.'('.$parNumIdentificacaoTramite.')'); | ||
92 | - | ||
93 | if (!isset($parNumIdentificacaoTramite)) { | 92 | if (!isset($parNumIdentificacaoTramite)) { |
94 | throw new InfraException('Parâmetro $parNumIdentificacaoTramite não informado.'); | 93 | throw new InfraException('Parâmetro $parNumIdentificacaoTramite não informado.'); |
95 | } | 94 | } |
@@ -113,7 +112,6 @@ class ReceberProcedimentoRN extends InfraRN | @@ -113,7 +112,6 @@ class ReceberProcedimentoRN extends InfraRN | ||
113 | if($this->tramiteRegistrado($strNumeroRegistro, $parNumIdentificacaoTramite)) { | 112 | if($this->tramiteRegistrado($strNumeroRegistro, $parNumIdentificacaoTramite)) { |
114 | return ; | 113 | return ; |
115 | } | 114 | } |
116 | - | ||
117 | // Validação dos dados do processo recebido | 115 | // Validação dos dados do processo recebido |
118 | $objInfraException = new InfraException(); | 116 | $objInfraException = new InfraException(); |
119 | $this->validarDadosDestinatario($objInfraException, $objMetadadosProcedimento); | 117 | $this->validarDadosDestinatario($objInfraException, $objMetadadosProcedimento); |
@@ -133,7 +131,6 @@ class ReceberProcedimentoRN extends InfraRN | @@ -133,7 +131,6 @@ class ReceberProcedimentoRN extends InfraRN | ||
133 | 131 | ||
134 | //Faz a validação da extensão dos componentes digitais a serem recebidos | 132 | //Faz a validação da extensão dos componentes digitais a serem recebidos |
135 | $this->validarExtensaoComponentesDigitais($parNumIdentificacaoTramite, $objProcesso); | 133 | $this->validarExtensaoComponentesDigitais($parNumIdentificacaoTramite, $objProcesso); |
136 | - | ||
137 | //Faz a validação das permissões de leitura e escrita | 134 | //Faz a validação das permissões de leitura e escrita |
138 | $this->verificarPermissoesDiretorios($parNumIdentificacaoTramite); | 135 | $this->verificarPermissoesDiretorios($parNumIdentificacaoTramite); |
139 | 136 | ||
@@ -148,7 +145,6 @@ class ReceberProcedimentoRN extends InfraRN | @@ -148,7 +145,6 @@ class ReceberProcedimentoRN extends InfraRN | ||
148 | //Cria o array com a lista de hash | 145 | //Cria o array com a lista de hash |
149 | $arrayHash = array(); | 146 | $arrayHash = array(); |
150 | 147 | ||
151 | - | ||
152 | //Percorre os componentes que precisam ser recebidos | 148 | //Percorre os componentes que precisam ser recebidos |
153 | foreach($objTramite->componenteDigitalPendenteDeRecebimento as $key => $componentePendente){ | 149 | foreach($objTramite->componenteDigitalPendenteDeRecebimento as $key => $componentePendente){ |
154 | 150 | ||
@@ -167,7 +163,6 @@ class ReceberProcedimentoRN extends InfraRN | @@ -167,7 +163,6 @@ class ReceberProcedimentoRN extends InfraRN | ||
167 | $receberComponenteDigitalRN->validarIntegridadeDoComponenteDigital($arrAnexosComponentes[$key][$componentePendente], $componentePendente, $parNumIdentificacaoTramite); | 163 | $receberComponenteDigitalRN->validarIntegridadeDoComponenteDigital($arrAnexosComponentes[$key][$componentePendente], $componentePendente, $parNumIdentificacaoTramite); |
168 | } | 164 | } |
169 | } | 165 | } |
170 | - | ||
171 | if(count($arrAnexosComponentes) > 0){ | 166 | if(count($arrAnexosComponentes) > 0){ |
172 | 167 | ||
173 | $receberComponenteDigitalRN->setArrAnexos($arrAnexosComponentes); | 168 | $receberComponenteDigitalRN->setArrAnexos($arrAnexosComponentes); |
@@ -187,7 +182,6 @@ class ReceberProcedimentoRN extends InfraRN | @@ -187,7 +182,6 @@ class ReceberProcedimentoRN extends InfraRN | ||
187 | 182 | ||
188 | 183 | ||
189 | 184 | ||
190 | - | ||
191 | // @join_tec US008.08 (#23092) | 185 | // @join_tec US008.08 (#23092) |
192 | $this->objProcedimentoAndamentoRN->setOpts($objProcedimentoDTO->getDblIdProcedimento(), $parNumIdentificacaoTramite, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO)); | 186 | $this->objProcedimentoAndamentoRN->setOpts($objProcedimentoDTO->getDblIdProcedimento(), $parNumIdentificacaoTramite, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO)); |
193 | $this->objProcedimentoAndamentoRN->cadastrar('Obtendo metadados do processo', 'S'); | 187 | $this->objProcedimentoAndamentoRN->cadastrar('Obtendo metadados do processo', 'S'); |
@@ -229,7 +223,6 @@ class ReceberProcedimentoRN extends InfraRN | @@ -229,7 +223,6 @@ class ReceberProcedimentoRN extends InfraRN | ||
229 | } | 223 | } |
230 | 224 | ||
231 | 225 | ||
232 | - | ||
233 | // throw new InfraException("COMPONENTES DIGITAIS A SEREM ANEXADOS: ".var_export($arrayHash, true)); | 226 | // throw new InfraException("COMPONENTES DIGITAIS A SEREM ANEXADOS: ".var_export($arrayHash, true)); |
234 | if(count($arrayHash) > 0){ | 227 | if(count($arrayHash) > 0){ |
235 | 228 | ||
@@ -279,15 +272,13 @@ class ReceberProcedimentoRN extends InfraRN | @@ -279,15 +272,13 @@ class ReceberProcedimentoRN extends InfraRN | ||
279 | } | 272 | } |
280 | } | 273 | } |
281 | } | 274 | } |
282 | - | ||
283 | //$this->fecharProcedimentoEmOutraUnidades($objProcedimentoDTO, $objMetadadosProcedimento); | 275 | //$this->fecharProcedimentoEmOutraUnidades($objProcedimentoDTO, $objMetadadosProcedimento); |
284 | 276 | ||
285 | $objEnviarReciboTramiteRN = new EnviarReciboTramiteRN(); | 277 | $objEnviarReciboTramiteRN = new EnviarReciboTramiteRN(); |
286 | - $objEnviarReciboTramiteRN->enviarReciboTramiteProcesso($parNumIdentificacaoTramite, $arrayHash); | ||
287 | - | ||
288 | - $objPenTramiteProcessadoRN = new PenTramiteProcessadoRN(PenTramiteProcessadoRN::STR_TIPO_PROCESSO); | ||
289 | - $objPenTramiteProcessadoRN->setRecebido($parNumIdentificacaoTramite); | 278 | + $objEnviarReciboTramiteRN->enviarReciboTramiteProcesso($parNumIdentificacaoTramite, $arrayHash); |
290 | 279 | ||
280 | + $objPenTramiteProcessadoRN = new PenTramiteProcessadoRN(PenTramiteProcessadoRN::STR_TIPO_PROCESSO); | ||
281 | + $objPenTramiteProcessadoRN->setRecebido($parNumIdentificacaoTramite); | ||
291 | } | 282 | } |
292 | 283 | ||
293 | /** | 284 | /** |
@@ -1699,7 +1690,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1699,7 +1690,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
1699 | $tramite = $this->objProcessoEletronicoRN->consultarTramites($parNumIdentificacaoTramite); | 1690 | $tramite = $this->objProcessoEletronicoRN->consultarTramites($parNumIdentificacaoTramite); |
1700 | 1691 | ||
1701 | if(!isset($tramite[0])){ | 1692 | if(!isset($tramite[0])){ |
1702 | - throw new InfraException("Não foi encontrado o trâmite de número {$parNumIdentificacaoTramite} para realizar a ciência da recusa"); | 1693 | + throw new InfraException("Não foi encontrado no PEN o trâmite de número {$parNumIdentificacaoTramite} para realizar a ciência da recusa"); |
1703 | } | 1694 | } |
1704 | 1695 | ||
1705 | $tramite = $tramite[0]; | 1696 | $tramite = $tramite[0]; |
@@ -1711,6 +1702,10 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1711,6 +1702,10 @@ class ReceberProcedimentoRN extends InfraRN | ||
1711 | $objTramiteBD = new TramiteBD(BancoSEI::getInstance()); | 1702 | $objTramiteBD = new TramiteBD(BancoSEI::getInstance()); |
1712 | $objTramiteDTO = $objTramiteBD->consultar($objTramiteDTO); | 1703 | $objTramiteDTO = $objTramiteBD->consultar($objTramiteDTO); |
1713 | 1704 | ||
1705 | + if(!isset($objTramiteDTO)){ | ||
1706 | + throw new InfraException("Não foi encontrado no sistema o trâmite de número {$parNumIdentificacaoTramite} para realizar a ciência da recusa"); | ||
1707 | + } | ||
1708 | + | ||
1714 | SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objTramiteDTO->getNumIdUnidade()); | 1709 | SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objTramiteDTO->getNumIdUnidade()); |
1715 | 1710 | ||
1716 | //Busca os dados do procedimento | 1711 | //Busca os dados do procedimento |
@@ -1729,6 +1724,7 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1729,6 +1724,7 @@ class ReceberProcedimentoRN extends InfraRN | ||
1729 | $objAtividadeDTO->setOrdDthAbertura(InfraDTO::$TIPO_ORDENACAO_DESC); | 1724 | $objAtividadeDTO->setOrdDthAbertura(InfraDTO::$TIPO_ORDENACAO_DESC); |
1730 | $objAtividadeDTO->retNumIdAtividade(); | 1725 | $objAtividadeDTO->retNumIdAtividade(); |
1731 | 1726 | ||
1727 | + //TODO: Necessário refatoração para chamada da casse AtividadeRN, e não a classe AtividadeBD com risco de quebra de regas internas do sistema | ||
1732 | $objAtividadeBD = new AtividadeBD($this->getObjInfraIBanco()); | 1728 | $objAtividadeBD = new AtividadeBD($this->getObjInfraIBanco()); |
1733 | $objAtividadeDTO = $objAtividadeBD->consultar($objAtividadeDTO); | 1729 | $objAtividadeDTO = $objAtividadeBD->consultar($objAtividadeDTO); |
1734 | 1730 |