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