Commit 80e504b2d7515ecf8c8f00ec2ada145c80cf3ce0
1 parent
40a440bb
Exists in
master
and in
21 other branches
Adaptações para o funcionamento do script php para atualização do banco de dados…
…, expedição de processo e recebimento do recibo
Showing
13 changed files
with
377 additions
and
617 deletions
Show diff stats
PENIntegracao.php
... | ... | @@ -3,18 +3,32 @@ |
3 | 3 | class PENIntegracao extends SeiIntegracao { |
4 | 4 | |
5 | 5 | private static $strDiretorio; |
6 | - | |
7 | - public function __construct() { | |
8 | - | |
6 | + | |
7 | + public function getNome() { | |
8 | + return 'Módulo de Integração com o Barramento PEN'; | |
9 | 9 | } |
10 | 10 | |
11 | - public function montarBotaoProcedimento(SeiIntegracaoDTO $objSeiIntegracaoDTO) { | |
11 | + public function getVersao() { | |
12 | + return '1.0.0'; | |
13 | + } | |
12 | 14 | |
15 | + public function getInstituicao() { | |
16 | + return 'TRF4 - Tribunal Regional Federal da 4ª Região'; | |
17 | + } | |
18 | + | |
19 | + public function montarBotaoProcesso(ProcedimentoAPI $objSeiIntegracaoDTO) { | |
20 | + | |
21 | + $objProcedimentoDTO = new ProcedimentoDTO(); | |
22 | + $objProcedimentoDTO->setDblIdProcedimento($objSeiIntegracaoDTO->getIdProcedimento()); | |
23 | + $objProcedimentoDTO->retTodos(); | |
24 | + | |
25 | + $objProcedimentoRN = new ProcedimentoRN(); | |
26 | + $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); | |
27 | + | |
13 | 28 | $objSessaoSEI = SessaoSEI::getInstance(); |
14 | 29 | $objPaginaSEI = PaginaSEI::getInstance(); |
15 | 30 | $strAcoesProcedimento = ""; |
16 | 31 | |
17 | - $objProcedimentoDTO = $objSeiIntegracaoDTO->getObjProcedimentoDTO(); | |
18 | 32 | $dblIdProcedimento = $objProcedimentoDTO->getDblIdProcedimento(); |
19 | 33 | $numIdUsuario = SessaoSEI::getInstance()->getNumIdUsuario(); |
20 | 34 | $numIdUnidadeAtual = SessaoSEI::getInstance()->getNumIdUnidadeAtual(); |
... | ... | @@ -37,28 +51,28 @@ class PENIntegracao extends SeiIntegracao { |
37 | 51 | // e este pode lançar exceções caso alguma configuração dele não estaja correta |
38 | 52 | // invalidando demais ações na tela do Controle de Processo, então ecapsulamos |
39 | 53 | // no try/catch para prevenir o erro em tela adicionamos no log |
40 | - try { | |
54 | + // try { | |
41 | 55 | |
42 | 56 | $objExpedirProcedimentoRN = new ExpedirProcedimentoRN(); |
43 | 57 | $objProcedimentoDTO = $objExpedirProcedimentoRN->consultarProcedimento($dblIdProcedimento); |
44 | 58 | |
45 | - $bolProcessoEstadoNormal = !in_array($objProcedimentoDTO->getStrStaEstadoProtocolo(), array( | |
59 | + /* $bolProcessoEstadoNormal = !in_array($objProcedimentoDTO->getStrStaEstadoProtocolo(), array( | |
46 | 60 | ProtocoloRN::$TE_PROCEDIMENTO_SOBRESTADO, |
47 | 61 | ProtocoloRN::$TE_EM_PROCESSAMENTO, |
48 | 62 | ProtocoloRn::$TE_BLOQUEADO |
49 | - )); | |
63 | + ));*/ | |
50 | 64 | |
51 | 65 | //TODO: Não apresentar |
52 | 66 | //$bolFlagAberto && $bolAcaoProcedimentoEnviar && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo()!=ProtocoloRN::$NA_SIGILOSO |
53 | - if ($bolFlagAberto && $bolAcaoExpedirProcesso && $bolProcessoEstadoNormal && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() != ProtocoloRN::$NA_SIGILOSO) { | |
67 | + // if ($bolFlagAberto && $bolAcaoExpedirProcesso && $bolProcessoEstadoNormal && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() != ProtocoloRN::$NA_SIGILOSO) { | |
54 | 68 | $numTabBotao = $objPaginaSEI->getProxTabBarraComandosSuperior(); |
55 | 69 | $strAcoesProcedimento .= '<a id="validar_expedir_processo" href="' . $objPaginaSEI->formatarXHTML($objSessaoSEI->assinarLink('controlador.php?acao=pen_procedimento_expedir&acao_origem=procedimento_visualizar&acao_retorno=arvore_visualizar&id_procedimento=' . $dblIdProcedimento . '&arvore=1')) . '" tabindex="' . $numTabBotao . '" class="botaoSEI"><img class="infraCorBarraSistema" src="' . $this->getDiretorioImagens() . '/pen_expedir_procedimento.gif" alt="Expedir Processo" title="Expedir Processo" /></a>'; |
56 | - } | |
57 | - | |
58 | - if($objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_EM_PROCESSAMENTO) { | |
59 | - | |
70 | + //} | |
71 | + | |
72 | + /* if ($objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_EM_PROCESSAMENTO) { | |
73 | + | |
60 | 74 | $objProcessoEletronicoRN = new ProcessoEletronicoRN(); |
61 | - | |
75 | + | |
62 | 76 | if ($objProcessoEletronicoRN->isDisponivelCancelarTramite($objProcedimentoDTO->getStrProtocoloProcedimentoFormatado())) { |
63 | 77 | $strAcoesProcedimento .= '<a href="' . $objPaginaSEI->formatarXHTML($objSessaoSEI->assinarLink('controlador.php?acao=pen_procedimento_cancelar_expedir&acao_origem=procedimento_visualizar&acao_retorno=arvore_visualizar&id_procedimento=' . $dblIdProcedimento . '&arvore=1')) . '" tabindex="' . $numTabBotao . '" class="botaoSEI">'; |
64 | 78 | $strAcoesProcedimento .= '<img class="infraCorBarraSistema" src="' . $this->getDiretorioImagens() . '/sei_desanexar_processo.gif" alt="Cancelar Expedição" title="Cancelar Expedição" />'; |
... | ... | @@ -76,82 +90,30 @@ class PENIntegracao extends SeiIntegracao { |
76 | 90 | $strAcoesProcedimento .= '<img class="infraCorBarraSistema" src="' . $this->getDiretorioImagens() . '/pen_consultar_recibos.png" alt="Consultar Recibos" title="Consultar Recibos"/>'; |
77 | 91 | $strAcoesProcedimento .= '</a>'; |
78 | 92 | } |
79 | - /** | |
80 | - * Rodina para validar doc processo | |
81 | - */ | |
82 | - //TODO: Revisar implementação feita pela Softimais nesse arquivo | |
83 | - //$resultProcessoStatus = $objExpedirProcedimentoRn->consultaProcessoStatus($objProcedimentoDTO->getDblIdProcedimento()); | |
84 | - // $objProtocoloDTO = new ProtocoloDTO(); | |
85 | - // $objProtocoloRN = new ProtocoloRN(); | |
86 | - // $objProtocoloDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento()); | |
87 | - // $objProtocoloDTO->retTodos(); | |
88 | - // $objProtocoloDTO = $objProtocoloRN->consultarRN0186($objProtocoloDTO); | |
89 | - //TODO: Verificar a diferença entre Nivel de Acesso Local e Global | |
90 | - //$bolProcessoPublico = $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_PUBLICO; | |
91 | - //$bolProcessoEstado = $objProtocoloDTO->getStrStaEstado() != ProtocoloRN::$TE_PROCEDIMENTO_SOBRESTADO; | |
92 | - // if ($bolAcaoExpedirProcesso && $bolProcessoEstado && $resultProcessoStatus['retorno'] ){ | |
93 | - // if ($bolAcaoExpedirProcesso && $bolProcessoEstado && $resultProcessoStatus['retorno'] ){ | |
94 | - // $strAcoesProcedimento .= '<a id="validar_expedir_processo" href="'.$objPaginaSEI->formatarXHTML($objSessaoSEI->assinarLink('controlador.php?acao=pen_procedimento_expedir&acao_origem=procedimento_visualizar&acao_retorno=arvore_visualizar&id_procedimento='.$dblIdProcedimento.'&arvore=1')).'" tabindex="'.$numTabBotao.'" class="botaoSEI"><img class="infraCorBarraSistema" src="'.$this->getDiretorioImagens().'/pen_expedir_procedimento.gif" alt="Expedir Processo" title="Expedir Processo" /></a>'; | |
95 | - // } | |
96 | - // if ($bolAcaoExpedirProcesso && $bolProcessoPublico && ! $bolProcessoEstado ){ | |
97 | - // $strAcoesProcedimento .= '<a id="validar_expedir_processo" href="'.$objPaginaSEI->formatarXHTML($objSessaoSEI->assinarLink('controlador.php?acao=pen_procedimento_cancelar_expedir&acao_origem=procedimento_visualizar&acao_retorno=arvore_visualizar&id_procedimento='.$dblIdProcedimento.'&arvore=1')).'" tabindex="'.$numTabBotao.'" class="botaoSEI">' | |
98 | - // . '<img class="infraCorBarraSistema" src="'.$this->getDiretorioImagens().'/cancelar_tramitir.gif" alt="Cancelar Tramiter" title="Cancelar Tramiter" />' | |
99 | - // . '</a>'; | |
100 | - // } | |
101 | - } | |
102 | - catch(InfraException $e){ | |
93 | + | |
94 | + /* } catch (InfraException $e) { | |
103 | 95 | LogSEI::getInstance()->gravar($e->getStrDescricao()); |
104 | - } | |
105 | - catch (Exception $e) { | |
96 | + } catch (Exception $e) { | |
106 | 97 | LogSEI::getInstance()->gravar($e->getMessage()); |
107 | - } | |
98 | + }*/ | |
108 | 99 | |
109 | 100 | return array($strAcoesProcedimento); |
110 | 101 | } |
111 | 102 | |
112 | - public function montarIconeProcedimento(SeiIntegracaoDTO $objSeiIntegracaoDTO) { | |
113 | - return array(); | |
114 | - } | |
115 | - | |
116 | - public function montarBotaoDocumento(SeiIntegracaoDTO $objSeiIntegracaoDTO) { | |
117 | - return array(); | |
118 | - } | |
119 | - | |
120 | - public function montarIconeDocumento(SeiIntegracaoDTO $objSeiIntegracaoDTO) { | |
121 | - return array(); | |
122 | - } | |
123 | - | |
124 | - public function excluirProcedimento(ProcedimentoDTO $objProcedimentoDTO) { | |
125 | - | |
126 | - } | |
127 | - | |
128 | - public function atualizarConteudoDocumento(DocumentoDTO $objDocumentoDTO) { | |
129 | - | |
130 | - } | |
131 | - | |
132 | - public function excluirDocumento(DocumentoDTO $objDocumentoDTO) { | |
133 | - | |
134 | - } | |
135 | - | |
136 | - public function montarBotaoControleProcessos() { | |
103 | + | |
104 | + public function montarIconeControleProcessos($arrObjProcedimentoAPI = array()) { | |
137 | 105 | |
138 | - } | |
139 | - | |
140 | - public function montarIconeControleProcessos($arrObjProcedimentoDTO = array()) { | |
141 | - | |
142 | 106 | $arrStrIcone = array(); |
143 | 107 | $arrDblIdProcedimento = array(); |
144 | 108 | |
145 | - foreach ($arrObjProcedimentoDTO as $objProcedimentoDTO) { | |
146 | - | |
147 | - $arrDblIdProcedimento[] = $objProcedimentoDTO->getDblIdProcedimento(); | |
109 | + foreach ($arrObjProcedimentoAPI as $ObjProcedimentoAPI) { | |
110 | + $arrDblIdProcedimento[] = $ObjProcedimentoAPI->getIdProcedimento(); | |
148 | 111 | } |
149 | 112 | |
150 | 113 | $objProcedimentoDTO = new ProcedimentoDTO(); |
151 | 114 | $objProcedimentoDTO->setDblIdProcedimento($arrDblIdProcedimento, InfraDTO::$OPER_IN); |
152 | 115 | $objProcedimentoDTO->retDblIdProcedimento(); |
153 | 116 | $objProcedimentoDTO->retStrStaEstadoProtocolo(); |
154 | - //$objProcedimentoDTO->retStrSinObteveRecusa(); | |
155 | 117 | |
156 | 118 | $objProcedimentoBD = new ProcedimentoBD(BancoSEI::getInstance()); |
157 | 119 | $arrObjProcedimentoDTO = $objProcedimentoBD->listar($objProcedimentoDTO); |
... | ... | @@ -162,27 +124,21 @@ class PENIntegracao extends SeiIntegracao { |
162 | 124 | |
163 | 125 | $dblIdProcedimento = $objProcedimentoDTO->getDblIdProcedimento(); |
164 | 126 | |
165 | - switch ($objProcedimentoDTO->getStrStaEstadoProtocolo()) { | |
166 | - case ProtocoloRN::$TE_EM_PROCESSAMENTO: | |
167 | - $arrStrIcone[$dblIdProcedimento] = array('<img src="' . $this->getDiretorioImagens() . '/pen_em_processamento.png" title="Em processamento" />'); | |
168 | - break; | |
169 | - | |
170 | - case ProtocoloRN::$TE_BLOQUEADO: | |
171 | - break; | |
172 | - | |
173 | - default: | |
174 | - $objPenProtocoloDTO = new PenProtocoloDTO(); | |
175 | - $objPenProtocoloDTO->setDblIdProtocolo($dblIdProcedimento); | |
176 | - $objPenProtocoloDTO->retStrSinObteveRecusa(); | |
177 | - $objPenProtocoloDTO->setNumMaxRegistrosRetorno(1); | |
127 | + if ($objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_PROCEDIMENTO_BLOQUEADO) { | |
128 | + $arrStrIcone[$dblIdProcedimento] = array('<img src="' . $this->getDiretorioImagens() . '/pen_em_processamento.png" title="Em Tramitação Externa" />'); | |
129 | + } else { | |
130 | + $objPenProtocoloDTO = new PenProtocoloDTO(); | |
131 | + $objPenProtocoloDTO->setDblIdProtocolo($dblIdProcedimento); | |
132 | + $objPenProtocoloDTO->retStrSinObteveRecusa(); | |
133 | + $objPenProtocoloDTO->setNumMaxRegistrosRetorno(1); | |
178 | 134 | |
179 | - $objProtocoloBD = new ProtocoloBD(BancoSEI::getInstance()); | |
180 | - $objPenProtocoloDTO = $objProtocoloBD->consultar($objPenProtocoloDTO); | |
135 | + $objProtocoloBD = new ProtocoloBD(BancoSEI::getInstance()); | |
136 | + $objPenProtocoloDTO = $objProtocoloBD->consultar($objPenProtocoloDTO); | |
181 | 137 | |
182 | - if (!empty($objPenProtocoloDTO) && $objPenProtocoloDTO->getStrSinObteveRecusa() == 'S') { | |
138 | + if (!empty($objPenProtocoloDTO) && $objPenProtocoloDTO->getStrSinObteveRecusa() == 'S') { | |
183 | 139 | |
184 | - $arrStrIcone[$dblIdProcedimento] = array('<img src="' . $this->getDiretorioImagens() . '/pen_tramite_recusado.png" title="Um trâmite para esse processo foi recusado" />'); | |
185 | - } | |
140 | + $arrStrIcone[$dblIdProcedimento] = array('<img src="' . $this->getDiretorioImagens() . '/pen_tramite_recusado.png" title="Um trâmite para esse processo foi recusado" />'); | |
141 | + } | |
186 | 142 | } |
187 | 143 | } |
188 | 144 | } |
... | ... | @@ -195,11 +151,11 @@ class PENIntegracao extends SeiIntegracao { |
195 | 151 | } |
196 | 152 | |
197 | 153 | public function getDiretorioImagens() { |
198 | - return static::getDiretorio().'/imagens'; | |
154 | + return static::getDiretorio() . '/imagens'; | |
199 | 155 | } |
200 | 156 | |
201 | 157 | public function montarMensagemSituacaoProcedimento(ProcedimentoDTO $objProcedimentoDTO) { |
202 | - if($objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_EM_PROCESSAMENTO || $objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_BLOQUEADO ){ | |
158 | + if ($objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_EM_PROCESSAMENTO || $objProcedimentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_BLOQUEADO) { | |
203 | 159 | $objAtividadeDTO = new AtividadeDTO(); |
204 | 160 | $objAtividadeDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento()); |
205 | 161 | $objAtividadeDTO->retNumIdAtividade(); |
... | ... | @@ -231,25 +187,116 @@ class PENIntegracao extends SeiIntegracao { |
231 | 187 | } |
232 | 188 | $objAtributoAndamentoDTO = $objAtributoAndamentoFinal; |
233 | 189 | |
190 | + //@TODOJOIN: Retirar esse array_pop(array_pop) pois a versão 5.6 não permite realizar esse tipo de aninhamento. | |
234 | 191 | $strUnidadeDestino = array_pop(array_pop(PaginaSEI::getInstance()->getArrOptionsSelect($objAtributoAndamentoDTO->getStrValor()))); |
235 | 192 | |
236 | - return "<br/>".sprintf('Processo em trâmite externo para "%s".', $strUnidadeDestino); | |
237 | - | |
193 | + return "<br/>" . sprintf('Processo em trâmite externo para "%s".', $strUnidadeDestino); | |
238 | 194 | } |
239 | 195 | } |
240 | - | |
241 | - | |
242 | - public static function getDiretorio(){ | |
243 | - | |
244 | - if(empty(static::$strDiretorio)) { | |
245 | - | |
246 | - $arrModulos = ConfiguracaoSEI::getInstance()->getValor('SEI','Modulos'); | |
247 | 196 | |
248 | - $strModuloPath = realpath($arrModulos['PEN']); | |
249 | - static::$strDiretorio = str_replace(realpath(__DIR__.'/../..'), '', $strModuloPath); | |
250 | - static::$strDiretorio = preg_replace('/^\//', '', static::$strDiretorio); | |
197 | + public static function getDiretorio() { | |
198 | + | |
199 | +// if (empty(static::$strDiretorio)) { | |
200 | +// | |
201 | +// $arrModulos = ConfiguracaoSEI::getInstance()->getValor('SEI', 'Modulos'); | |
202 | +// | |
203 | +// $strModuloPath = realpath($arrModulos['PENIntegracao']); | |
204 | +// | |
205 | +// | |
206 | +// | |
207 | +// static::$strDiretorio = str_replace(realpath(__DIR__ . '/../..'), '', $strModuloPath); | |
208 | +// static::$strDiretorio = preg_replace('/^\//', '', static::$strDiretorio); | |
209 | +// } | |
210 | +// | |
211 | +// return static::$strDiretorio; | |
212 | + return "modulos/pen"; | |
213 | + } | |
214 | + | |
215 | + public function processarControlador($strAcao) { | |
216 | + switch ($strAcao) { | |
217 | + case 'pen_procedimento_expedir': | |
218 | + require_once dirname(__FILE__) . '/pen_procedimento_expedir.php'; | |
219 | + return true; | |
220 | + //TODO: Alterar nome do recurso para pen_procedimento_expedir_unidade_sel | |
221 | + case 'pen_unidade_sel_expedir_procedimento': | |
222 | + require_once dirname(__FILE__) . '/pen_unidade_sel_expedir_procedimento.php'; | |
223 | + return true; | |
224 | + | |
225 | + case 'pen_procedimento_processo_anexado': | |
226 | + require_once dirname(__FILE__) . '/pen_procedimento_processo_anexado.php'; | |
227 | + return true; | |
228 | + | |
229 | + case 'pen_procedimento_cancelar_expedir': | |
230 | + require_once dirname(__FILE__) . '/pen_procedimento_cancelar_expedir.php'; | |
231 | + return true; | |
232 | + | |
233 | + case 'pen_procedimento_expedido_listar': | |
234 | + require_once dirname(__FILE__) . '/pen_procedimento_expedido_listar.php'; | |
235 | + return true; | |
236 | + | |
237 | + case 'pen_map_tipo_doc_enviado_listar': | |
238 | + case 'pen_map_tipo_doc_enviado_excluir': | |
239 | + case 'pen_map_tipo_doc_enviado_desativar': | |
240 | + case 'pen_map_tipo_doc_enviado_ativar': | |
241 | + require_once dirname(__FILE__) . '/pen_map_tipo_doc_enviado_listar.php'; | |
242 | + return true; | |
243 | + | |
244 | + case 'pen_map_tipo_doc_enviado_cadastrar': | |
245 | + case 'pen_map_tipo_doc_enviado_visualizar': | |
246 | + require_once dirname(__FILE__) . '/pen_map_tipo_doc_enviado_cadastrar.php'; | |
247 | + return true; | |
248 | + | |
249 | + case 'pen_map_tipo_doc_recebido_listar': | |
250 | + case 'pen_map_tipo_doc_recebido_excluir': | |
251 | + require_once dirname(__FILE__) . '/pen_map_tipo_doc_recebido_listar.php'; | |
252 | + return true; | |
253 | + | |
254 | + case 'pen_map_tipo_doc_recebido_cadastrar': | |
255 | + case 'pen_map_tipo_doc_recebido_visualizar': | |
256 | + require_once dirname(__FILE__) . '/pen_map_tipo_doc_recebido_cadastrar.php'; | |
257 | + return true; | |
258 | + | |
259 | + case 'apensados_selecionar_expedir_procedimento': | |
260 | + require_once dirname(__FILE__) . '/apensados_selecionar_expedir_procedimento.php'; | |
261 | + return true; | |
262 | + | |
263 | + case 'pen_procedimento_estado': | |
264 | + require_once dirname(__FILE__) . '/pen_procedimento_estado.php'; | |
265 | + return true; | |
251 | 266 | } |
252 | - | |
253 | - return static::$strDiretorio; | |
267 | + | |
268 | + return false; | |
254 | 269 | } |
270 | + | |
271 | + public function processarControladorAjax($strAcao) { | |
272 | + $xml = null; | |
273 | + | |
274 | + switch ($_GET['acao_ajax']) { | |
275 | + | |
276 | + case 'pen_unidade_auto_completar_expedir_procedimento': | |
277 | + $arrObjEstruturaDTO = (array) ProcessoEletronicoINT::autoCompletarEstruturas($_POST['id_repositorio'], $_POST['palavras_pesquisa']); | |
278 | + | |
279 | + if (count($arrObjEstruturaDTO) > 0) { | |
280 | + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjEstruturaDTO, 'NumeroDeIdentificacaoDaEstrutura', 'Nome'); | |
281 | + } else { | |
282 | + throw new InfraException("Unidade não Encontrada.", $e); | |
283 | + } | |
284 | + break; | |
285 | + | |
286 | + case 'pen_apensados_auto_completar_expedir_procedimento': | |
287 | + //TODO: Validar parâmetros passados via ajax | |
288 | + $dblIdProcedimentoAtual = $_POST['id_procedimento_atual']; | |
289 | + $numIdUnidadeAtual = SessaoSEI::getInstance()->getNumIdUnidadeAtual(); | |
290 | + $arrObjProcedimentoDTO = ProcessoEletronicoINT::autoCompletarProcessosApensados($dblIdProcedimentoAtual, $numIdUnidadeAtual, $_POST['palavras_pesquisa']); | |
291 | + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjProcedimentoDTO, 'IdProtocolo', 'ProtocoloFormatadoProtocolo'); | |
292 | + break; | |
293 | + | |
294 | + case 'pen_procedimento_expedir_validar': | |
295 | + require_once dirname(__FILE__) . '/pen_procedimento_expedir_validar.php'; | |
296 | + break; | |
297 | + } | |
298 | + | |
299 | + return $xml; | |
300 | + } | |
301 | + | |
255 | 302 | } | ... | ... |
bd/PenMetaBD.php
... | ... | @@ -25,7 +25,7 @@ class PenMetaBD extends InfraMetaBD { |
25 | 25 | |
26 | 26 | switch($strTableDrive) { |
27 | 27 | |
28 | - case 'InfraMySql': | |
28 | + case 'InfraMySqli': | |
29 | 29 | $strQuery = sprintf("ALTER TABLE `%s` ALTER COLUMN `%s` SET DEFAULT '%s'", $strNomeTabela, $strNomeColuna, $strValorPadrao); |
30 | 30 | break; |
31 | 31 | |
... | ... | @@ -74,13 +74,19 @@ class PenMetaBD extends InfraMetaBD { |
74 | 74 | public function isDriverSuportado(){ |
75 | 75 | |
76 | 76 | $strTableDrive = get_parent_class($this->getObjInfraIBanco()); |
77 | - | |
77 | + | |
78 | 78 | switch($strTableDrive) { |
79 | 79 | |
80 | - case 'InfraMySql': | |
80 | + case 'InfraMySqli': | |
81 | 81 | // Fix para bug de MySQL versão inferior ao 5.5 o default engine |
82 | 82 | // é MyISAM e não tem suporte a FOREING KEYS |
83 | - $this->getObjInfraIBanco()->executarSql('SET STORAGE_ENGINE=InnoDB'); | |
83 | + $version = $this->getObjInfraIBanco()->consultarSql('SELECT VERSION() as versao'); | |
84 | + $version = $version[0]['versao']; | |
85 | + $arrVersion = explode('.', $version); | |
86 | + | |
87 | + if($arrVersion[0].$arrVersion[1] < 57){ | |
88 | + $this->getObjInfraIBanco()->executarSql('@SET STORAGE_ENGINE=InnoDB'); | |
89 | + } | |
84 | 90 | case 'InfraSqlServer': |
85 | 91 | case 'InfraOracle': |
86 | 92 | break; |
... | ... | @@ -125,7 +131,7 @@ class PenMetaBD extends InfraMetaBD { |
125 | 131 | |
126 | 132 | switch($strTableDrive) { |
127 | 133 | |
128 | - case 'InfraMySql': | |
134 | + case 'InfraMySqli': | |
129 | 135 | $this->getObjInfraIBanco()->executarSql('ALTER TABLE '.$strNomeTabela.' DROP PRIMARY KEY'); |
130 | 136 | break; |
131 | 137 | |
... | ... | @@ -147,7 +153,7 @@ class PenMetaBD extends InfraMetaBD { |
147 | 153 | |
148 | 154 | switch($strTableDrive) { |
149 | 155 | |
150 | - case 'InfraMySql': | |
156 | + case 'InfraMySqli': | |
151 | 157 | $strSql = " SELECT COUNT(CONSTRAINT_NAME) AS EXISTE |
152 | 158 | FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS |
153 | 159 | WHERE CONSTRAINT_SCHEMA = '".$objInfraBanco->getBanco()."' |
... | ... | @@ -192,7 +198,7 @@ class PenMetaBD extends InfraMetaBD { |
192 | 198 | |
193 | 199 | switch ($strTableDrive) { |
194 | 200 | |
195 | - case 'InfraMySql': | |
201 | + case 'InfraMySqli': | |
196 | 202 | $strQuery = sprintf("ALTER TABLE `%s` RENAME TO `%s`", $strNomeTabelaAtual, $strNomeTabelaNovo); |
197 | 203 | break; |
198 | 204 | |
... | ... | @@ -222,7 +228,7 @@ class PenMetaBD extends InfraMetaBD { |
222 | 228 | |
223 | 229 | switch($strTableDrive) { |
224 | 230 | |
225 | - case 'InfraMySql': | |
231 | + case 'InfraMySqli': | |
226 | 232 | $strSql = "SELECT COUNT(TABLE_NAME) AS EXISTE |
227 | 233 | FROM INFORMATION_SCHEMA.TABLES |
228 | 234 | WHERE TABLE_SCHEMA = '".$objInfraBanco->getBanco()."' |
... | ... | @@ -255,7 +261,7 @@ class PenMetaBD extends InfraMetaBD { |
255 | 261 | |
256 | 262 | switch($strTableDrive) { |
257 | 263 | |
258 | - case 'InfraMySql': | |
264 | + case 'InfraMySqli': | |
259 | 265 | $strSql = "SELECT COUNT(TABLE_NAME) AS EXISTE |
260 | 266 | FROM INFORMATION_SCHEMA.COLUMNS |
261 | 267 | WHERE TABLE_SCHEMA = '".$objInfraBanco->getBanco()."' | ... | ... |
dto/ComponenteDigitalDTO.php
... | ... | @@ -27,7 +27,7 @@ class ComponenteDigitalDTO extends InfraDTO { |
27 | 27 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'SinEnviar', 'sin_enviar'); |
28 | 28 | |
29 | 29 | $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_NUM, 'TicketEnvioComponentes', 'ticket_envio_componentes', 'md_pen_tramite'); |
30 | - $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'ConteudoAssinaturaDocumento', 'conteudo_assinatura', 'documento'); | |
30 | + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'ConteudoAssinaturaDocumento', 'conteudo_assinatura', 'documento_conteudo'); | |
31 | 31 | $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'ProtocoloDocumentoFormatado', 'protocolo_formatado', 'protocolo'); |
32 | 32 | |
33 | 33 | $this->configurarPK('NumeroRegistro', InfraDTO::$TIPO_PK_INFORMADO); |
... | ... | @@ -37,5 +37,6 @@ class ComponenteDigitalDTO extends InfraDTO { |
37 | 37 | $this->configurarFK('IdTramite', 'md_pen_tramite', 'id_tramite', InfraDTO::$TIPO_FK_OBRIGATORIA); |
38 | 38 | $this->configurarFK('IdDocumento', 'documento', 'id_documento', InfraDTO::$TIPO_FK_OBRIGATORIA); |
39 | 39 | $this->configurarFK('IdDocumento', 'protocolo', 'id_protocolo', InfraDTO::$TIPO_FK_OBRIGATORIA); |
40 | + $this->configurarFK('IdDocumento', 'documento_conteudo', 'id_documento', InfraDTO::$TIPO_FK_OBRIGATORIA); | |
40 | 41 | } |
41 | 42 | } |
42 | 43 | \ No newline at end of file | ... | ... |
pen_procedimento_expedido_listar.php
... | ... | @@ -25,7 +25,7 @@ try { |
25 | 25 | $objFiltroDTO->retStrProtocoloFormatado(); |
26 | 26 | |
27 | 27 | // Verificar no DTO sobre funções de agragação para clausula DISTINCT |
28 | - if(get_parent_class(BancoSEI::getInstance()) != 'InfraMySql') { | |
28 | + if(get_parent_class(BancoSEI::getInstance()) != 'InfraMySqli') { | |
29 | 29 | $objFiltroDTO->retDthConclusaoAtividade(); |
30 | 30 | } |
31 | 31 | $objPaginaSEI->prepararPaginacao($objFiltroDTO, 10); | ... | ... |
rn/ExpedirProcedimentoRN.php
... | ... | @@ -173,15 +173,15 @@ class ExpedirProcedimentoRN extends InfraRN { |
173 | 173 | |
174 | 174 | $objTramite = $novoTramite->dadosTramiteDeProcessoCriado; |
175 | 175 | |
176 | - $this->objProcedimentoAndamentoRN->setOpts($dblIdProcedimento, $objTramite->IDT, ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO); | |
177 | - | |
176 | + | |
177 | + $this->objProcedimentoAndamentoRN->setOpts($dblIdProcedimento, $objTramite->IDT, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)); | |
178 | + | |
178 | 179 | try { |
179 | 180 | |
180 | - | |
181 | - // @join_tec US008.04 (#23092) | |
181 | + | |
182 | 182 | $this->objProcedimentoAndamentoRN->cadastrar('Envio do metadados do processo', 'S'); |
183 | - | |
184 | - $idAtividadeExpedicao = $this->mudarEstadoProcedimentoEmProcessamento($objExpedirProcedimentoDTO, $objProcesso); | |
183 | + | |
184 | + $idAtividadeExpedicao = $this->bloquearProcedimentoExpedicao($objExpedirProcedimentoDTO, $objProcesso->idProcedimentoSEI); | |
185 | 185 | //$this->registrarAndamentoExpedicaoProcesso($objExpedirProcedimentoDTO, $objProcesso); |
186 | 186 | |
187 | 187 | |
... | ... | @@ -238,7 +238,12 @@ class ExpedirProcedimentoRN extends InfraRN { |
238 | 238 | $this->receberReciboDeEnvio($objTramite->IDT); |
239 | 239 | } |
240 | 240 | catch (\Exception $e) { |
241 | - static::mudarEstadoProcedimento($objProcesso, ProtocoloRN::$TE_NORMAL); | |
241 | + echo "<pre>"; | |
242 | + var_dump($e); | |
243 | + die("</pre>"); | |
244 | + $this->desbloquearProcessoExpedicao($objProcesso->idProcedimentoSEI); | |
245 | + $this->registrarAndamentoExpedicaoAbortada($objProtocolo->idProcedimentoSEI); | |
246 | + | |
242 | 247 | // @join_tec US008.06 (#23092) |
243 | 248 | $this->objProcedimentoAndamentoRN->cadastrar('Concluído envio dos componentes do processo', 'N'); |
244 | 249 | throw $e; |
... | ... | @@ -366,7 +371,7 @@ class ExpedirProcedimentoRN extends InfraRN { |
366 | 371 | if(!isset($dblIdProcedimento)){ |
367 | 372 | throw new InfraException('Parâmetro $dblIdProcedimento não informado.'); |
368 | 373 | } |
369 | - | |
374 | + | |
370 | 375 | //TODO: Passar dados do ProcedimentoDTO via parâmetro já carregado anteriormente |
371 | 376 | $objProcedimentoDTO = $this->consultarProcedimento($dblIdProcedimento); |
372 | 377 | |
... | ... | @@ -376,13 +381,14 @@ class ExpedirProcedimentoRN extends InfraRN { |
376 | 381 | $objProcesso->processoDeNegocio = utf8_encode($objProcedimentoDTO->getStrNomeTipoProcedimento()); |
377 | 382 | $objProcesso->descricao = utf8_encode($objProcedimentoDTO->getStrDescricaoProtocolo()); |
378 | 383 | $objProcesso->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($objProcedimentoDTO->getDtaGeracaoProtocolo()); |
379 | - | |
384 | + | |
380 | 385 | $this->atribuirProdutorProcesso($objProcesso, |
381 | 386 | $objProcedimentoDTO->getNumIdUsuarioGeradorProtocolo(), |
382 | 387 | $objProcedimentoDTO->getNumIdUnidadeGeradoraProtocolo()); |
383 | 388 | |
384 | 389 | $this->atribuirDataHoraDeRegistro($objProcesso, $objProcedimentoDTO->getDblIdProcedimento()); |
385 | - $this->atribuirDocumentos($objProcesso, $dblIdProcedimento); | |
390 | + | |
391 | + $this->atribuirDocumentos($objProcesso, $dblIdProcedimento); | |
386 | 392 | $this->atribuirDadosInteressados($objProcesso, $dblIdProcedimento); |
387 | 393 | $this->adicionarProcessosApensados($objProcesso, $arrIdProcessoApensado); |
388 | 394 | |
... | ... | @@ -500,84 +506,58 @@ class ExpedirProcedimentoRN extends InfraRN { |
500 | 506 | |
501 | 507 | } |
502 | 508 | |
503 | - | |
504 | - public static function registrarRetransmissao($idProceso) | |
505 | - { | |
506 | - $objAtividadeDTO = new AtividadeDTO(); | |
507 | - $objAtividadeDTO->setDblIdProtocolo($idProceso); | |
508 | - $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | |
509 | - $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | |
510 | - $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RETRANSMITIDO); | |
511 | - $objAtividadeDTO->setArrObjAtributoAndamentoDTO(array()); | |
512 | 509 | |
513 | - $objAtividadeRN = new AtividadeRN(); | |
514 | - $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | |
515 | - } | |
516 | - | |
517 | - public function mudarEstadoProcedimentoEmProcessamento($objExpedirProcedimentoDTO, $objProcesso) | |
518 | - { | |
510 | + public function bloquearProcedimentoExpedicao($objExpedirProcedimentoDTO, $numIdProcedimento) { | |
511 | + | |
512 | + //Instancia a API do SEI para bloquei do processo | |
513 | + $objEntradaBloquearProcessoAPI = new EntradaBloquearProcessoAPI(); | |
514 | + $objEntradaBloquearProcessoAPI->setIdProcedimento($numIdProcedimento); | |
515 | + | |
516 | + //Realiza o bloquei do processo | |
517 | + $objSeiRN = new SeiRN(); | |
518 | + $objSeiRN->bloquearProcesso($objEntradaBloquearProcessoAPI); | |
519 | 519 | |
520 | - try{ | |
521 | - | |
522 | 520 | |
523 | - //Muda o status do protocolo para "Em Processamento" | |
524 | - $objProtocoloDTO = new ProtocoloDTO(); | |
525 | - $objProtocoloDTO->setStrStaEstado(ProtocoloRN::$TE_EM_PROCESSAMENTO); | |
526 | - $objProtocoloDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); | |
527 | - | |
528 | - $objProtocoloRN = new ProtocoloRN(); | |
529 | - $objProtocoloRN->alterarRN0203($objProtocoloDTO); | |
530 | - | |
531 | 521 | $arrObjAtributoAndamentoDTO = array(); |
532 | - | |
522 | + | |
523 | + //Seta o repositório de destino para constar no histórico | |
533 | 524 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
534 | 525 | $objAtributoAndamentoDTO->setStrNome('REPOSITORIO_DESTINO'); |
535 | 526 | $objAtributoAndamentoDTO->setStrValor($objExpedirProcedimentoDTO->getStrRepositorioDestino()); |
536 | 527 | $objAtributoAndamentoDTO->setStrIdOrigem($objExpedirProcedimentoDTO->getNumIdRepositorioOrigem()); |
537 | 528 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; |
538 | - | |
539 | - // Conselho de Administração - CMAD-CMB / CMB / MF / PR | |
540 | - $arrUnidadeDestino = preg_split('/\s?\/\s?/', $objExpedirProcedimentoDTO->getStrUnidadeDestino()); | |
541 | - | |
542 | - // Conselho de Administração - CMAD-CMB | |
543 | - $arrUnidadeDestino = preg_split('/\s+\-\s+/', current($arrUnidadeDestino)); | |
544 | - | |
545 | - $strUnidadeDestino = array_shift($arrUnidadeDestino); | |
546 | - | |
547 | - | |
548 | - | |
529 | + | |
530 | + //Compõe o atributo que irá compor a estrutura | |
549 | 531 | $objEstrutura = $this->objProcessoEletronicoRN->consultarEstrutura( |
550 | - $objExpedirProcedimentoDTO->getNumIdRepositorioDestino(), | |
551 | - $objExpedirProcedimentoDTO->getNumIdUnidadeDestino(), | |
552 | - true | |
532 | + $objExpedirProcedimentoDTO->getNumIdRepositorioDestino(), $objExpedirProcedimentoDTO->getNumIdUnidadeDestino(), true | |
553 | 533 | ); |
554 | 534 | |
555 | - if(isset($objEstrutura->hierarquia)) { | |
556 | - | |
535 | + if (isset($objEstrutura->hierarquia)) { | |
536 | + | |
557 | 537 | $arrObjNivel = $objEstrutura->hierarquia->nivel; |
558 | - | |
538 | + | |
559 | 539 | $nome = ""; |
560 | 540 | $siglasUnidades = array(); |
561 | 541 | $siglasUnidades[] = $objEstrutura->sigla; |
562 | - | |
563 | - foreach($arrObjNivel as $key => $objNivel){ | |
564 | - $siglasUnidades[] = $objNivel->sigla ; | |
542 | + | |
543 | + foreach ($arrObjNivel as $key => $objNivel) { | |
544 | + $siglasUnidades[] = $objNivel->sigla; | |
565 | 545 | } |
566 | - | |
567 | - for($i = 1; $i <= 3; $i++){ | |
568 | - if(isset($siglasUnidades[count($siglasUnidades) - 1])){ | |
546 | + | |
547 | + for ($i = 1; $i <= 3; $i++) { | |
548 | + if (isset($siglasUnidades[count($siglasUnidades) - 1])) { | |
569 | 549 | unset($siglasUnidades[count($siglasUnidades) - 1]); |
570 | 550 | } |
571 | 551 | } |
572 | 552 | |
573 | - foreach($siglasUnidades as $key => $nomeUnidade){ | |
574 | - if($key == (count($siglasUnidades) - 1)){ | |
575 | - $nome .= $nomeUnidade." "; | |
576 | - }else{ | |
577 | - $nome .= $nomeUnidade." / "; | |
553 | + foreach ($siglasUnidades as $key => $nomeUnidade) { | |
554 | + if ($key == (count($siglasUnidades) - 1)) { | |
555 | + $nome .= $nomeUnidade . " "; | |
556 | + } else { | |
557 | + $nome .= $nomeUnidade . " / "; | |
578 | 558 | } |
579 | 559 | } |
580 | - | |
560 | + | |
581 | 561 | $objNivel = current($arrObjNivel); |
582 | 562 | |
583 | 563 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
... | ... | @@ -585,34 +565,60 @@ class ExpedirProcedimentoRN extends InfraRN { |
585 | 565 | $objAtributoAndamentoDTO->setStrValor($nome); |
586 | 566 | $objAtributoAndamentoDTO->setStrIdOrigem($objNivel->numeroDeIdentificacaoDaEstrutura); |
587 | 567 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; |
588 | - | |
589 | 568 | } |
590 | - | |
569 | + | |
570 | + //Seta a unidade de destino | |
571 | + $arrUnidadeDestino = preg_split('/\s?\/\s?/', $objExpedirProcedimentoDTO->getStrUnidadeDestino()); | |
572 | + $arrUnidadeDestino = preg_split('/\s+\-\s+/', current($arrUnidadeDestino)); | |
573 | + $strUnidadeDestino = array_shift($arrUnidadeDestino); | |
574 | + | |
591 | 575 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
592 | 576 | $objAtributoAndamentoDTO->setStrNome('UNIDADE_DESTINO'); |
593 | 577 | $objAtributoAndamentoDTO->setStrValor($strUnidadeDestino); |
594 | 578 | $objAtributoAndamentoDTO->setStrIdOrigem($objExpedirProcedimentoDTO->getNumIdUnidadeDestino()); |
595 | 579 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; |
596 | - | |
580 | + | |
597 | 581 | $objAtividadeDTO = new AtividadeDTO(); |
598 | - $objAtividadeDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); | |
582 | + $objAtividadeDTO->setDblIdProtocolo($numIdProcedimento); | |
599 | 583 | $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
600 | 584 | $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); |
601 | - $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO); | |
585 | + $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)); | |
602 | 586 | $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); |
603 | - | |
604 | 587 | |
605 | - | |
588 | + //Registra o andamento no histórico e | |
606 | 589 | $objAtividadeRN = new AtividadeRN(); |
607 | 590 | $atividade = $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); |
608 | 591 | |
609 | 592 | return $atividade->getNumIdAtividade(); |
593 | + } | |
594 | + | |
595 | + public function desbloquearProcessoExpedicao($numIdProcedimento){ | |
610 | 596 | |
611 | - }catch(Exception $e){ | |
612 | - die($e->getMessage()); | |
613 | - } | |
597 | + //Intancia o objeto de desbloqueio da API do SEI | |
598 | + $objEntradaDesbloquearProcessoAPI = new EntradaDesbloquearProcessoAPI(); | |
599 | + $objEntradaDesbloquearProcessoAPI->setIdProcedimento($numIdProcedimento); | |
600 | + | |
601 | + //Solicita o Desbloqueio do Processo | |
602 | + $objSeiRN = new SeiRN(); | |
603 | + $objSeiRN->desbloquearProcesso($objEntradaDesbloquearProcessoAPI); | |
604 | + | |
614 | 605 | } |
615 | - | |
606 | + | |
607 | + public function registrarAndamentoExpedicaoAbortada($dblIdProtocolo) { | |
608 | + | |
609 | + //Seta todos os atributos do histórico de aborto da expedição | |
610 | + $objAtividadeDTO = new AtividadeDTO(); | |
611 | + $objAtividadeDTO->setDblIdProtocolo($dblIdProtocolo); | |
612 | + $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | |
613 | + $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | |
614 | + $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_ABORTADO)); | |
615 | + $objAtividadeDTO->setArrObjAtributoAndamentoDTO(array()); | |
616 | + | |
617 | + //Gera o andamento de expedição abortada | |
618 | + $objAtividadeRN = new AtividadeRN(); | |
619 | + $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | |
620 | + } | |
621 | + | |
616 | 622 | public static function receberRecusaProcedimento($motivo, $unidade_destino, $numUnidadeDestino = null, $idProtocolo) |
617 | 623 | { |
618 | 624 | |
... | ... | @@ -731,7 +737,7 @@ class ExpedirProcedimentoRN extends InfraRN { |
731 | 737 | //Dados do produtor do processo |
732 | 738 | $objProcesso->produtor->nome = utf8_encode($objUsuarioProdutor->getStrNome()); |
733 | 739 | //TODO: Obter tipo de pessoa física dos contatos do SEI |
734 | - $objProcesso->produtor->numeroDeIdentificacao = $objUsuarioProdutor->getDblCpf(); | |
740 | + $objProcesso->produtor->numeroDeIdentificacao = $objUsuarioProdutor->getDblCpfContato(); | |
735 | 741 | $objProcesso->produtor->tipo = self::STA_TIPO_PESSOA_FISICA; |
736 | 742 | //TODO: Informar dados da estrutura organizacional (estruturaOrganizacional) |
737 | 743 | |
... | ... | @@ -784,7 +790,7 @@ class ExpedirProcedimentoRN extends InfraRN { |
784 | 790 | $objProcesso->documento = array(); |
785 | 791 | |
786 | 792 | |
787 | - | |
793 | + | |
788 | 794 | foreach ($arrDocumentosDTO as $documentoDTO) { |
789 | 795 | |
790 | 796 | //$protocoloDocumentoDTO = $this->consultarProtocoloDocumento($documeto->getDblIdProcedimento()); |
... | ... | @@ -803,7 +809,7 @@ class ExpedirProcedimentoRN extends InfraRN { |
803 | 809 | }else{ |
804 | 810 | $strDescricaoDocumento = "***"; |
805 | 811 | } |
806 | - | |
812 | + | |
807 | 813 | // Não é um documento externo |
808 | 814 | /*elseif($documentoDTO->isSetNumIdTipoConferencia()){ |
809 | 815 | |
... | ... | @@ -819,22 +825,23 @@ class ExpedirProcedimentoRN extends InfraRN { |
819 | 825 | $strDescricaoDocumento = $objTipoProcedimentoDTO->getStrNome(); |
820 | 826 | }*/ |
821 | 827 | |
822 | - $documento->retirado = ($documentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_CANCELADO) ? true : false; | |
828 | + $documento->retirado = ($documentoDTO->getStrStaEstadoProtocolo() == ProtocoloRN::$TE_DOCUMENTO_CANCELADO) ? true : false; | |
829 | + | |
823 | 830 | $documento->ordem = $ordemDocumento++; |
824 | 831 | $documento->descricao = utf8_encode($strDescricaoDocumento); |
825 | 832 | $documento->nivelDeSigilo = $this->obterNivelSigiloPEN($documentoDTO->getStrStaNivelAcessoLocalProtocolo()); |
826 | 833 | $documento->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($documentoDTO->getDtaGeracaoProtocolo()); |
827 | - | |
834 | + | |
828 | 835 | $usuarioDTO = $this->consultarUsuario($documentoDTO->getNumIdUsuarioGeradorProtocolo()); |
829 | 836 | if(isset($usuarioDTO)) { |
830 | 837 | $documento->produtor = new stdClass(); |
831 | 838 | $documento->produtor->nome = utf8_encode($usuarioDTO->getStrNome()); |
832 | - $documento->produtor->numeroDeIdentificacao = $usuarioDTO->getDblCpf(); | |
839 | + $documento->produtor->numeroDeIdentificacao = $usuarioDTO->getDblCpfContato(); | |
833 | 840 | //TODO: Obter tipo de pessoa física dos contextos/contatos do SEI |
834 | 841 | $documento->produtor->tipo = self::STA_TIPO_PESSOA_FISICA;; |
835 | 842 | } |
836 | 843 | |
837 | - | |
844 | + | |
838 | 845 | $unidadeDTO = $this->consultarUnidade($documentoDTO->getNumIdUnidadeResponsavel()); |
839 | 846 | if(isset($unidadeDTO)) { |
840 | 847 | $documento->produtor->unidade = new stdClass(); |
... | ... | @@ -1256,7 +1263,7 @@ class ExpedirProcedimentoRN extends InfraRN { |
1256 | 1263 | $objUsuarioDTO = new UsuarioDTO(); |
1257 | 1264 | $objUsuarioDTO->setNumIdUsuario($numIdUsuario); |
1258 | 1265 | $objUsuarioDTO->retStrNome(); |
1259 | - $objUsuarioDTO->retDblCpf(); | |
1266 | + $objUsuarioDTO->retDblCpfContato(); | |
1260 | 1267 | |
1261 | 1268 | return $this->objUsuarioRN->consultarRN0489($objUsuarioDTO); |
1262 | 1269 | } |
... | ... | @@ -1543,7 +1550,7 @@ class ExpedirProcedimentoRN extends InfraRN { |
1543 | 1550 | |
1544 | 1551 | $objDocumentoDTO = new DocumentoDTO(); |
1545 | 1552 | $objDocumentoDTO->setDblIdProcedimento($objProcedimentoDTO->getDblIdProcedimento()); |
1546 | - $objDocumentoDTO->setStrStaEditor(array(EditorRN::$TE_EDOC, EditorRN::$TE_INTERNO), InfraDTO::$OPER_IN); | |
1553 | + // $objDocumentoDTO->setStrStaEditor(array(EditorRN::$TE_EDOC, EditorRN::$TE_INTERNO), InfraDTO::$OPER_IN); | |
1547 | 1554 | $objDocumentoDTO->retDblIdDocumento(); |
1548 | 1555 | $objDocumentoDTO->retStrStaEstadoProtocolo(); |
1549 | 1556 | |
... | ... | @@ -1566,7 +1573,7 @@ class ExpedirProcedimentoRN extends InfraRN { |
1566 | 1573 | // cai na regra de validação |
1567 | 1574 | if($objAssinaturaRN->contarRN1324($objAssinaturaDTO) == 0 && $objDocumentoDTO->getStrStaEstadoProtocolo() != ProtocoloRN::$TE_CANCELADO){ |
1568 | 1575 | |
1569 | - $bolAssinaturaCorretas = false; | |
1576 | + //$bolAssinaturaCorretas = false; | |
1570 | 1577 | } |
1571 | 1578 | } |
1572 | 1579 | } | ... | ... |
rn/PenAtualizarSeiRN.php
... | ... | @@ -482,229 +482,43 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
482 | 482 | $fnCadastrar(176,'Resultado','Podendo ser complementado: de Exame Médico; de Contestação'); |
483 | 483 | $fnCadastrar(177,'Vídeo','Podendo ser complementado: de Reunião'); |
484 | 484 | |
485 | -// $objDTO = new PenRelTipoDocMapEnviadoDTO(); | |
486 | -// | |
487 | -// $fnCadastrar = function($numCodigoEspecie, $numIdSerie) use($objDTO, $objBD){ | |
488 | -// | |
489 | -// $objDTO->unSetTodos(); | |
490 | -// $objDTO->setNumCodigoEspecie($numCodigoEspecie); | |
491 | -// $objDTO->setNumIdSerie($numIdSerie); | |
492 | -// | |
493 | -// if($objBD->contar($objDTO) == 0){ | |
494 | -// //$objDTO->strStrSinPadrao('S'); | |
495 | -// $objBD->cadastrar($objDTO); | |
496 | -// } | |
497 | -// }; | |
498 | - //---------------------------------------------------------------------- | |
499 | - // Especie de Documento por Série | |
500 | - //---------------------------------------------------------------------- | |
501 | -// $fnCadastrar(1, 46);// Abaixo-assinado; | |
502 | -// $fnCadastrar(2, 8);// Acordao; | |
503 | -// $fnCadastrar(3, 106);// Acordo; | |
504 | -// $fnCadastrar(4, 48);// Alvara; | |
505 | -// $fnCadastrar(5, 116);// Anais; | |
506 | -// $fnCadastrar(6, 117);// Anteprojeto; | |
507 | -// $fnCadastrar(7, 118);// Apolice; | |
508 | -// $fnCadastrar(8, 119);// Apostila; | |
509 | -// $fnCadastrar(9, 67);// Ata; | |
510 | -// $fnCadastrar(10, 74);// Atestado; | |
511 | -// $fnCadastrar(11, 3);// Ato; | |
512 | -// $fnCadastrar(12, 120);// Auto; | |
513 | -// $fnCadastrar(13, 121);// Aviso; | |
514 | -// $fnCadastrar(14, 32);// Balancete; | |
515 | -// $fnCadastrar(15, 33);// Balanco; | |
516 | -// $fnCadastrar(16, 122);// Bilhete; | |
517 | -// $fnCadastrar(17, 97);// Boletim; | |
518 | -// $fnCadastrar(18, 80);// Carta; | |
519 | -// $fnCadastrar(19, 123);// Cartaz; | |
520 | -// $fnCadastrar(20, 124);// Cedula; | |
521 | -// $fnCadastrar(21, 81);// Certidao; | |
522 | -// $fnCadastrar(22, 82);// Certificado; | |
523 | -// $fnCadastrar(23, 125);// Cheque; | |
524 | -// $fnCadastrar(24, 35);// Comprovante; | |
525 | -// $fnCadastrar(25, 14);// Comunicado; | |
526 | -// $fnCadastrar(26, 197);// Consulta; | |
527 | -// $fnCadastrar(27, 126);// Contracheque; | |
528 | -// $fnCadastrar(28, 37);// Contrato; | |
529 | -// $fnCadastrar(29, 232);// Convenio; | |
530 | -// $fnCadastrar(30, 127);// Convite; | |
531 | -// $fnCadastrar(31, 105);// Convencao; | |
532 | -// $fnCadastrar(32, 128);// Cracha; | |
533 | -// $fnCadastrar(33, 129);// Cronograma; | |
534 | -// $fnCadastrar(34, 130);// Curriculo; | |
535 | -// $fnCadastrar(35, 198);// Debenture; | |
536 | -// $fnCadastrar(36, 41);// Decisao; | |
537 | -// $fnCadastrar(37, 83);// Declaracao; | |
538 | -// $fnCadastrar(38, 131);// Decreto; | |
539 | -// $fnCadastrar(39, 132);// Deliberacao; | |
540 | -// $fnCadastrar(40, 133);// Demonstrativo; | |
541 | -// $fnCadastrar(41, 134);// Depoimento; | |
542 | -// $fnCadastrar(42, 5);// Despacho; | |
543 | -// $fnCadastrar(43, 135);// Diario; | |
544 | -// $fnCadastrar(44, 77);// Diploma; | |
545 | -// $fnCadastrar(45, 199);// Diretriz; | |
546 | -// $fnCadastrar(46, 136);// Dissertacao; | |
547 | -// $fnCadastrar(47, 137);// Dossie; | |
548 | -// $fnCadastrar(48, 68);// Edital; | |
549 | -// $fnCadastrar(49, 30);// E-mail; | |
550 | -// $fnCadastrar(50, 138);// Embargos; | |
551 | -// $fnCadastrar(51, 139);// Emenda; | |
552 | -// $fnCadastrar(52, 140);// Escala; | |
553 | -// $fnCadastrar(53, 141);// Escritura; | |
554 | -// $fnCadastrar(54, 50);// Estatuto; | |
555 | -// $fnCadastrar(55, 142);// Exposicao de Motivos; | |
556 | -// $fnCadastrar(56, 51);// Extrato; | |
557 | -// $fnCadastrar(57, 84);// Fatura; | |
558 | -// $fnCadastrar(58, 143);// Ficha; | |
559 | -// $fnCadastrar(59, 144);// Fluxograma; | |
560 | -// $fnCadastrar(60, 99);// Folha; | |
561 | -// $fnCadastrar(61, 200);// Folheto/Folder; | |
562 | -// $fnCadastrar(62, 145);// Formulario; | |
563 | -// $fnCadastrar(63, 201);// Grade Curricular; | |
564 | -// $fnCadastrar(64, 146);// Guia; | |
565 | -// $fnCadastrar(65, 79);// Historico; | |
566 | -// $fnCadastrar(66, 202);// Indicacao; | |
567 | -// $fnCadastrar(67, 16);// Informe; | |
568 | -// $fnCadastrar(68, 203);// Instrucao; | |
569 | -// $fnCadastrar(69, 147);// Inventario; | |
570 | -// $fnCadastrar(70, 54);// Laudo; | |
571 | -// $fnCadastrar(71, 148);// Lei; | |
572 | -// $fnCadastrar(72, 100);// Lista/Listagem; | |
573 | -// $fnCadastrar(73, 56);// Livro; | |
574 | -// $fnCadastrar(74, 69);// Mandado; | |
575 | -// $fnCadastrar(75, 149);// Manifesto; | |
576 | -// $fnCadastrar(76, 113);// Manual; | |
577 | -// $fnCadastrar(77, 150);// Mapa; | |
578 | -// $fnCadastrar(78, 151);// Medida Provisoria; | |
579 | -// $fnCadastrar(79, 12);// Memorando; | |
580 | -// $fnCadastrar(80, 13);// Memorando-circular; | |
581 | -// $fnCadastrar(81, 152);// Memorial; | |
582 | -// $fnCadastrar(82, 153);// Mensagem; | |
583 | -// $fnCadastrar(83, 204);// Minuta; | |
584 | -// $fnCadastrar(84, 235);// Mocao; | |
585 | -// $fnCadastrar(85, 58);// Norma; | |
586 | -// $fnCadastrar(86, 91);// Nota; | |
587 | -// $fnCadastrar(87, 59);// Notificacao; | |
588 | -// $fnCadastrar(88, 11);// Oficio; | |
589 | -// $fnCadastrar(89, 205);// Oficio-Circular; | |
590 | -// $fnCadastrar(90, 206);// Orcamento; | |
591 | -// $fnCadastrar(91, 207);// Ordem; | |
592 | -// $fnCadastrar(92, 155);// Organograma; | |
593 | -// $fnCadastrar(93, 156);// Orientacao; | |
594 | -// $fnCadastrar(94, 157);// Panfleto; | |
595 | -// $fnCadastrar(95, 191);// Parecer; | |
596 | -// $fnCadastrar(96, 158);// Passaporte; | |
597 | -// $fnCadastrar(97, 159);// Pauta; | |
598 | -// $fnCadastrar(98, 160);// Peticao; | |
599 | -// $fnCadastrar(99, 104);// Planilha; | |
600 | -// $fnCadastrar(100, 73);// Plano; | |
601 | -// $fnCadastrar(101, 161);// Planta; | |
602 | -// $fnCadastrar(102, 10);// Portaria; | |
603 | -// $fnCadastrar(103, 162);// Precatorio; | |
604 | -// $fnCadastrar(104, 71);// Processo; | |
605 | -// $fnCadastrar(105, 60);// Procuracao; | |
606 | -// $fnCadastrar(106, 163);// Programa; | |
607 | -// $fnCadastrar(107, 101);// Projeto; | |
608 | -// $fnCadastrar(108, 75);// Prontuario; | |
609 | -// $fnCadastrar(109, 208);// Pronunciamento; | |
610 | -// $fnCadastrar(110, 85);// Proposta; | |
611 | -// $fnCadastrar(111, 164);// Prospecto; | |
612 | -// $fnCadastrar(112, 165);// Protocolo; | |
613 | -// $fnCadastrar(113, 166);// Prova; | |
614 | -// $fnCadastrar(114, 167);// Questionario; | |
615 | -// $fnCadastrar(115, 168);// Receita; | |
616 | -// $fnCadastrar(116, 169);// Recibo; | |
617 | -// $fnCadastrar(117, 111);// Recurso; | |
618 | -// $fnCadastrar(118, 170);// Regimento; | |
619 | -// $fnCadastrar(119, 62);// Registro; | |
620 | -// $fnCadastrar(120, 171);// Regulamento; | |
621 | -// $fnCadastrar(121, 102);// Relacao; | |
622 | -// $fnCadastrar(122, 63);// Relatorio; | |
623 | -// $fnCadastrar(123, 172);// Release; | |
624 | -// $fnCadastrar(124, 173);// Representacao; | |
625 | -// $fnCadastrar(125, 64);// Requerimento; | |
626 | -// $fnCadastrar(126, 65);// Requisicao; | |
627 | -// $fnCadastrar(127, 1);// Resolucao; | |
628 | -// $fnCadastrar(128, 174);// Resumo; | |
629 | -// $fnCadastrar(129, 175);// Roteiro; | |
630 | -// $fnCadastrar(130, 176);// Sentenca; | |
631 | -// $fnCadastrar(131, 177);// Sinopse; | |
632 | -// $fnCadastrar(132, 178);// Solicitacao; | |
633 | -// $fnCadastrar(133, 2);// Sumula; | |
634 | -// $fnCadastrar(134, 179);// Tabela; | |
635 | -// $fnCadastrar(135, 180);// Telegrama; | |
636 | -// $fnCadastrar(136, 90);// Termo; | |
637 | -// $fnCadastrar(137, 181);// Tese; | |
638 | -// $fnCadastrar(138, 182);// Testamento; | |
639 | -// $fnCadastrar(139, 183);// Titulo; | |
640 | -// $fnCadastrar(140, 94);// Voto; | |
641 | -// $fnCadastrar(141, 87);// Carteira; | |
642 | -// $fnCadastrar(142, 209);// Cartao; | |
643 | -// $fnCadastrar(143, 88);// CPF/CIC; | |
644 | -// $fnCadastrar(144, 201);// CNPJ; | |
645 | -// $fnCadastrar(145, 211);// Calendario | |
646 | -// $fnCadastrar(147, 89);// RG; | |
647 | -// $fnCadastrar(148, 95);// Agenda; | |
648 | -// $fnCadastrar(149, 7);// Analise; | |
649 | -// $fnCadastrar(150, 96);// Anotacao; | |
650 | -// $fnCadastrar(151, 52);// audio; | |
651 | -// $fnCadastrar(152, 97);// Boleto; | |
652 | -// $fnCadastrar(153, 36);// Conta; | |
653 | -// $fnCadastrar(154, 112);// Contrarrazoes; | |
654 | -// $fnCadastrar(155, 38);// Correspondencia; | |
655 | -// $fnCadastrar(156, 29);// Cota; | |
656 | -// $fnCadastrar(157, 98);// Credencial; | |
657 | -// $fnCadastrar(158, 39);// Croqui; | |
658 | -// $fnCadastrar(159, 42);// Defesa; | |
659 | -// $fnCadastrar(160, 44);// Demonstracao; | |
660 | -// $fnCadastrar(161, 45);// Denuncia; | |
661 | -// $fnCadastrar(162, 108);// Esclarecimento; | |
662 | -// $fnCadastrar(163, 49);// Escrituracao | |
663 | -// $fnCadastrar(165, 109);// Impugnacao; | |
664 | -// $fnCadastrar(166, 92);// Informacao; | |
665 | -// $fnCadastrar(167, 110);// Intencao; | |
666 | -// $fnCadastrar(168, 55);// Licenca; | |
667 | -// $fnCadastrar(169, 212);// Materia; | |
668 | -// $fnCadastrar(170, 78);// Material; | |
669 | -// $fnCadastrar(171, 57);// Memoria; | |
670 | -// $fnCadastrar(172, 213);// Movimentacao; | |
671 | -// $fnCadastrar(173, 107);// Pedido; | |
672 | -// $fnCadastrar(174, 61);// Reclamacao; | |
673 | -// $fnCadastrar(175, 27);// Referendo; | |
674 | -// $fnCadastrar(176, 76);// Resultado; | |
675 | -// $fnCadastrar(177, 53);// Video | |
676 | 485 | |
677 | 486 | //---------------------------------------------------------------------- |
678 | 487 | // Tarefas |
679 | 488 | //---------------------------------------------------------------------- |
680 | 489 | $objDTO = new TarefaDTO(); |
681 | 490 | |
682 | - $fnCadastrar = function($numIdTarefa, $strNome = '', $strHistoricoCompleto = 'N', $strHistoricoCompleto = 'N', $strFecharAndamentosAbertos = 'N', $strLancarAndamentoFechado = 'N', $strPermiteProcessoFechado = 'N') use($objDTO, $objBD){ | |
491 | + $fnCadastrar = function($strNome = '', $strHistoricoCompleto = 'N', $strHistoricoCompleto = 'N', $strFecharAndamentosAbertos = 'N', $strLancarAndamentoFechado = 'N', $strPermiteProcessoFechado = 'N', $strIdTarefaModulo = '') use($objDTO, $objBD){ | |
683 | 492 | |
684 | 493 | $objDTO->unSetTodos(); |
685 | - $objDTO->setNumIdTarefa($numIdTarefa); | |
494 | + $objDTO->setStrIdTarefaModulo($strIdTarefaModulo); | |
686 | 495 | |
687 | - if($objBD->contar($objDTO) == 0){ | |
496 | + if($objBD->contar($objDTO) == 0){ | |
497 | + | |
498 | + $objUltimaTarefaDTO = new TarefaDTO(); | |
499 | + $objUltimaTarefaDTO->retNumIdTarefa(); | |
500 | + $objUltimaTarefaDTO->setNumMaxRegistrosRetorno(1); | |
501 | + $objUltimaTarefaDTO->setOrd('IdTarefa', InfraDTO::$TIPO_ORDENACAO_DESC); | |
502 | + $objUltimaTarefaDTO = $objBD->consultar($objUltimaTarefaDTO); | |
688 | 503 | |
504 | + $objDTO->setNumIdTarefa($objUltimaTarefaDTO->getNumIdTarefa() + 1); | |
689 | 505 | $objDTO->setStrNome($strNome); |
690 | 506 | $objDTO->setStrSinHistoricoResumido($strHistoricoCompleto); |
691 | 507 | $objDTO->setStrSinHistoricoCompleto($strHistoricoCompleto); |
692 | 508 | $objDTO->setStrSinFecharAndamentosAbertos($strFecharAndamentosAbertos); |
693 | 509 | $objDTO->setStrSinLancarAndamentoFechado($strLancarAndamentoFechado); |
694 | 510 | $objDTO->setStrSinPermiteProcessoFechado($strPermiteProcessoFechado); |
695 | - | |
511 | + $objDTO->setStrIdTarefaModulo($strIdTarefaModulo); | |
696 | 512 | $objBD->cadastrar($objDTO); |
697 | 513 | } |
698 | 514 | }; |
699 | 515 | |
700 | 516 | |
701 | - $fnCadastrar(22, 'Em processamento. @MOTIVO@', 'S', 'S', 'S', 'N', 'N'); | |
702 | - $fnCadastrar(23, 'Bloqueado. @MOTIVO@', 'S', 'S', 'S', 'N', 'N'); | |
703 | - $fnCadastrar(501, 'Processo expedido para a entidade @UNIDADE_DESTINO@ - @REPOSITORIO_DESTINO@ (@PROCESSO@, @UNIDADE@, @USUARIO@)', 'S', 'S', 'N', 'S', 'N'); | |
704 | - $fnCadastrar(502, 'Processo recebido da entidade @ENTIDADE_ORIGEM@ - @REPOSITORIO_ORIGEM@ (@PROCESSO@, @ENTIDADE_ORIGEM@, @UNIDADE_DESTINO@, @USUARIO@)', 'S', 'S', 'N', 'S', 'N'); | |
705 | - $fnCadastrar(505, 'O processo foi recusado pelo orgão @UNIDADE_DESTINO@ pelo seguinte motivo: @MOTIVO@', 'S', 'S', 'N', 'N', 'S'); | |
706 | - $fnCadastrar(504, 'Expedição do Processo Cancelada em @DATA_HORA@ pelo Usuário @USUARIO@', 'S', 'S', 'N', 'S', 'N'); | |
707 | - $fnCadastrar(506, 'Operacao externa de @OPERACAO@ registrada em @DATA_HORA@ (@PESSOA_IDENTIFICACAO@ - @PESSOA_NOME@)\n @COMPLEMENTO@', 'S', 'S', 'N', 'S', 'N'); | |
517 | + $fnCadastrar('Processo expedido para a entidade @UNIDADE_DESTINO@ - @REPOSITORIO_DESTINO@ (@PROCESSO@, @UNIDADE@, @USUARIO@)', 'S', 'S', 'N', 'S', 'N', 'PEN_PROCESSO_EXPEDIDO'); | |
518 | + $fnCadastrar('Processo recebido da entidade @ENTIDADE_ORIGEM@ - @REPOSITORIO_ORIGEM@ (@PROCESSO@, @ENTIDADE_ORIGEM@, @UNIDADE_DESTINO@, @USUARIO@)', 'S', 'S', 'N', 'S', 'N', 'PEN_PROCESSO_RECEBIDO'); | |
519 | + $fnCadastrar('O processo foi recusado pelo orgão @UNIDADE_DESTINO@ pelo seguinte motivo: @MOTIVO@', 'S', 'S', 'N', 'N', 'S', 'PEN_PROCESSO_RECUSADO'); | |
520 | + $fnCadastrar('Expedição do Processo Cancelada em @DATA_HORA@ pelo Usuário @USUARIO@', 'S', 'S', 'N', 'S', 'N', 'PEN_PROCESSO_CANCELADO'); | |
521 | + $fnCadastrar('Operacao externa de @OPERACAO@ registrada em @DATA_HORA@ (@PESSOA_IDENTIFICACAO@ - @PESSOA_NOME@)\n @COMPLEMENTO@', 'S', 'S', 'S', 'S', 'N', 'PEN_OPERACAO_EXTERNA'); | |
708 | 522 | |
709 | 523 | //---------------------------------------------------------------------- |
710 | 524 | // Operações por Tarefas |
... | ... | @@ -827,10 +641,10 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
827 | 641 | $objDTO = new TarefaDTO(); |
828 | 642 | $objBD = new TarefaBD($objInfraBanco); |
829 | 643 | |
830 | - $fnAlterar = function($numIdTarefa, $strNome) use($objDTO, $objBD){ | |
831 | - | |
644 | + $fnAlterar = function($strIdTarefaModulo, $strNome) use($objDTO, $objBD){ | |
645 | + | |
832 | 646 | $objDTO->unSetTodos(); |
833 | - $objDTO->setNumIdTarefa($numIdTarefa); | |
647 | + $objDTO->setStrIdTarefaModulo($strIdTarefaModulo); | |
834 | 648 | $objDTO->setNumMaxRegistrosRetorno(1); |
835 | 649 | $objDTO->retStrNome(); |
836 | 650 | $objDTO->retNumIdTarefa(); |
... | ... | @@ -848,7 +662,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
848 | 662 | } |
849 | 663 | }; |
850 | 664 | |
851 | - $fnAlterar('502', 'Processo recebido da entidade @ENTIDADE_ORIGEM@ - @REPOSITORIO_ORIGEM@'); | |
665 | + $fnAlterar('PEN_PROCESSO_RECEBIDO', 'Processo recebido da entidade @ENTIDADE_ORIGEM@ - @REPOSITORIO_ORIGEM@'); | |
852 | 666 | } |
853 | 667 | |
854 | 668 | /** |
... | ... | @@ -1011,25 +825,32 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
1011 | 825 | $objBD = new GenericoBD($this->inicializarObjInfraIBanco()); |
1012 | 826 | $objDTO = new TarefaDTO(); |
1013 | 827 | |
1014 | - $fnCadastrar = function($numIdTarefa, $strNome = '', $strHistoricoCompleto = 'N', $strHistoricoCompleto = 'N', $strFecharAndamentosAbertos = 'N', $strLancarAndamentoFechado = 'N', $strPermiteProcessoFechado = 'N') use($objDTO, $objBD){ | |
828 | + $fnCadastrar = function($strNome = '', $strHistoricoCompleto = 'N', $strHistoricoCompleto = 'N', $strFecharAndamentosAbertos = 'N', $strLancarAndamentoFechado = 'N', $strPermiteProcessoFechado = 'N', $strIdTarefaModulo = '') use($objDTO, $objBD){ | |
1015 | 829 | |
1016 | 830 | $objDTO->unSetTodos(); |
1017 | - $objDTO->setNumIdTarefa($numIdTarefa); | |
831 | + $objDTO->setStrIdTarefaModulo($strIdTarefaModulo); | |
1018 | 832 | |
1019 | 833 | if($objBD->contar($objDTO) == 0){ |
1020 | 834 | |
835 | + $objUltimaTarefaDTO = new TarefaDTO(); | |
836 | + $objUltimaTarefaDTO->retNumIdTarefa(); | |
837 | + $objUltimaTarefaDTO->setNumMaxRegistrosRetorno(1); | |
838 | + $objUltimaTarefaDTO->setOrd('IdTarefa', InfraDTO::$TIPO_ORDENACAO_DESC); | |
839 | + $objUltimaTarefaDTO = $objBD->consultar($objUltimaTarefaDTO); | |
840 | + | |
841 | + $objDTO->setNumIdTarefa($objUltimaTarefaDTO->getNumIdTarefa() + 1); | |
1021 | 842 | $objDTO->setStrNome($strNome); |
1022 | 843 | $objDTO->setStrSinHistoricoResumido($strHistoricoCompleto); |
1023 | 844 | $objDTO->setStrSinHistoricoCompleto($strHistoricoCompleto); |
1024 | 845 | $objDTO->setStrSinFecharAndamentosAbertos($strFecharAndamentosAbertos); |
1025 | 846 | $objDTO->setStrSinLancarAndamentoFechado($strLancarAndamentoFechado); |
1026 | 847 | $objDTO->setStrSinPermiteProcessoFechado($strPermiteProcessoFechado); |
1027 | - | |
848 | + $objDTO->setStrIdTarefaModulo($strIdTarefaModulo); | |
1028 | 849 | $objBD->cadastrar($objDTO); |
1029 | 850 | } |
1030 | 851 | }; |
1031 | 852 | |
1032 | - $fnCadastrar(507, 'Expedição do processo foi abortada manualmente devido a falha no trâmite', 'S', 'S', 'N', 'N', 'S'); | |
853 | + $fnCadastrar('Expedição do processo foi abortada manualmente devido a falha no trâmite', 'S', 'S', 'N', 'N', 'S', 'PEN_EXPEDICAO_PROCESSO_ABORTADA'); | |
1033 | 854 | } |
1034 | 855 | |
1035 | 856 | /** |
... | ... | @@ -1049,10 +870,10 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
1049 | 870 | $objDTO->retNumIdTarefa(); |
1050 | 871 | $objDTO->retStrNome(); |
1051 | 872 | |
1052 | - $fnAtualizar = function($numIdTarefa, $strNome) use($objDTO, $objBD){ | |
873 | + $fnAtualizar = function($strIdTarefaModulo, $strNome) use($objDTO, $objBD){ | |
1053 | 874 | |
1054 | 875 | $objDTO->unSetTodos(); |
1055 | - $objDTO->setNumIdTarefa($numIdTarefa); | |
876 | + $objDTO->setStrIdTarefaModulo($strIdTarefaModulo); | |
1056 | 877 | |
1057 | 878 | $objTarefaDTO = $objBD->consultar($objDTO); |
1058 | 879 | |
... | ... | @@ -1064,8 +885,8 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
1064 | 885 | } |
1065 | 886 | }; |
1066 | 887 | // Tramitação externa do processo @processo@ concluída com sucesso. Recebido na @UnidadeDestino@ - @hierarquia_superior@ -@repositório_de_estruturas@ |
1067 | - $fnAtualizar(501, 'Processo em tramitação externa para @UNIDADE_DESTINO@ - @UNIDADE_DESTINO_HIRARQUIA@ - @REPOSITORIO_DESTINO@'); | |
1068 | - $fnAtualizar(502, 'Processo recebido da unidade externa @ENTIDADE_ORIGEM@ - @ENTIDADE_ORIGEM_HIRARQUIA@ - @REPOSITORIO_ORIGEM@'); | |
1069 | - $fnAtualizar(506, 'Tramitação externa do processo @PROTOCOLO_FORMATADO@ concluída com sucesso. Recebido em @UNIDADE_DESTINO@ - @UNIDADE_DESTINO_HIRARQUIA@ - @REPOSITORIO_DESTINO@'); | |
888 | + $fnAtualizar('PEN_PROCESSO_EXPEDIDO', 'Processo em tramitação externa para @UNIDADE_DESTINO@ - @UNIDADE_DESTINO_HIRARQUIA@ - @REPOSITORIO_DESTINO@'); | |
889 | + $fnAtualizar('PEN_PROCESSO_RECEBIDO', 'Processo recebido da unidade externa @ENTIDADE_ORIGEM@ - @ENTIDADE_ORIGEM_HIRARQUIA@ - @REPOSITORIO_ORIGEM@'); | |
890 | + $fnAtualizar('PEN_OPERACAO_EXTERNA', 'Tramitação externa do processo @PROTOCOLO_FORMATADO@ concluída com sucesso. Recebido em @UNIDADE_DESTINO@ - @UNIDADE_DESTINO_HIRARQUIA@ - @REPOSITORIO_DESTINO@'); | |
1070 | 891 | } |
1071 | 892 | } |
1072 | 893 | \ No newline at end of file | ... | ... |
rn/PendenciasTramiteRN.php
1 | 1 | <?php |
2 | 2 | require_once dirname(__FILE__) . '/../../../SEI.php'; |
3 | 3 | |
4 | -//error_reporting(E_ALL); | |
4 | +error_reporting(E_ALL); | |
5 | 5 | |
6 | 6 | //TODO: Modificar nome da classe e método para outro mais apropriado |
7 | 7 | class PendenciasTramiteRN extends InfraRN { |
... | ... | @@ -24,9 +24,10 @@ class PendenciasTramiteRN extends InfraRN { |
24 | 24 | } |
25 | 25 | |
26 | 26 | public function __construct() { |
27 | - | |
28 | - $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); | |
27 | + | |
28 | + $objInfraParametro = new InfraParametro($this->inicializarObjInfraIBanco()); | |
29 | 29 | $this->strLocalizacaoCertificadoDigital = $objInfraParametro->getValor('PEN_LOCALIZACAO_CERTIFICADO_DIGITAL'); |
30 | + | |
30 | 31 | $this->strEnderecoServicoPendencias = $objInfraParametro->getValor('PEN_ENDERECO_WEBSERVICE_PENDENCIAS'); |
31 | 32 | //TODO: Urgente - Remover senha do certificado de autenticação dos serviços do PEN da tabela de parâmetros |
32 | 33 | $this->strSenhaCertificadoDigital = $objInfraParametro->getValor('PEN_SENHA_CERTIFICADO_DIGITAL'); | ... | ... |
rn/ProcedimentoAndamentoRN.php
... | ... | @@ -12,7 +12,7 @@ class ProcedimentoAndamentoRN extends InfraRN { |
12 | 12 | protected $isSetOpts = false; |
13 | 13 | protected $dblIdProcedimento; |
14 | 14 | protected $dblIdTramit; |
15 | - protected $numTarefa = 501; | |
15 | + protected $numTarefa; | |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Instância do driver de conexão com o banco de dados |
... | ... | @@ -47,7 +47,7 @@ class ProcedimentoAndamentoRN extends InfraRN { |
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | - public function setOpts($dblIdProcedimento = 0, $dblIdTramit = 0, $numTarefa = 501){ | |
50 | + public function setOpts($dblIdProcedimento = 0, $dblIdTramit = 0, $numTarefa){ | |
51 | 51 | |
52 | 52 | $this->dblIdProcedimento = $dblIdProcedimento; |
53 | 53 | $this->dblIdTramit = $dblIdTramit; | ... | ... |
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 | 3 | class ProcessoEletronicoRN extends InfraRN { |
3 | 4 | |
4 | 5 | //const PEN_WEBSERVICE_LOCATION = 'https://desenv-api-pen.intra.planejamento/interoperabilidade/soap/v1_1/'; |
5 | 6 | |
6 | 7 | /* TAREFAS DE EXPEDIÇÃO DE PROCESSOS */ |
7 | 8 | //Está definindo o comportamento para a tarefa $TI_PROCESSO_EM_PROCESSAMENTO |
8 | - public static $TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO = 501; | |
9 | - public static $TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO = 502; | |
10 | - public static $TI_PROCESSO_ELETRONICO_PROCESSO_RETRANSMITIDO = 503; | |
11 | - public static $TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_CANCELADO = 504; | |
12 | - public static $TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_RECUSADO = 505; | |
13 | - public static $TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO = 506; | |
14 | - public static $TI_PROCESSO_ELETRONICO_PROCESSO_ABORTADO = 507; | |
9 | + public static $TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO = 'PEN_PROCESSO_EXPEDIDO'; | |
10 | + public static $TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO = 'PEN_PROCESSO_RECEBIDO'; | |
11 | + public static $TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_CANCELADO = 'PEN_PROCESSO_CANCELADO'; | |
12 | + public static $TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_RECUSADO = 'PEN_PROCESSO_RECUSADO'; | |
13 | + public static $TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO = 'PEN_OPERACAO_EXTERNA'; | |
14 | + public static $TI_PROCESSO_ELETRONICO_PROCESSO_ABORTADO = 'PEN_EXPEDICAO_PROCESSO_ABORTADA'; | |
15 | 15 | |
16 | 16 | /* TAREFAS DE EXPEDIÇÃO DE DOCUMENTOS */ |
17 | 17 | //Está definindo o comportamento para a tarefa $TI_PROCESSO_BLOQUEADO |
18 | - public static $TI_PROCESSO_ELETRONICO_DOCUMENTO_EXPEDIDO = 506; | |
18 | + /*public static $TI_PROCESSO_ELETRONICO_DOCUMENTO_EXPEDIDO = 506; | |
19 | 19 | public static $TI_PROCESSO_ELETRONICO_DOCUMENTO_RECEBIDO = 507; |
20 | 20 | public static $TI_PROCESSO_ELETRONICO_DOCUMENTO_RETRANSMITIDO = 508; |
21 | 21 | public static $TI_PROCESSO_ELETRONICO_DOCUMENTO_TRAMITE_CANCELADO = 509; |
22 | - public static $TI_PROCESSO_ELETRONICO_DOCUMENTO_TRAMITE_RECUSADO = 510; | |
22 | + public static $TI_PROCESSO_ELETRONICO_DOCUMENTO_TRAMITE_RECUSADO = 510;*/ | |
23 | 23 | |
24 | 24 | /* NÍVEL DE SIGILO DE PROCESSOS E DOCUMENTOS */ |
25 | 25 | public static $STA_SIGILO_PUBLICO = '1'; |
... | ... | @@ -102,7 +102,7 @@ class ProcessoEletronicoRN extends InfraRN { |
102 | 102 | 'soap_version' => SOAP_1_1 |
103 | 103 | , 'local_cert' => $this->strLocalCert |
104 | 104 | , 'passphrase' => $this->strLocalCertPassword |
105 | - , 'resolve_wsdl_remote_includes' => false | |
105 | + , 'resolve_wsdl_remote_includes' => true | |
106 | 106 | , 'trace' => true |
107 | 107 | , 'encoding' => 'UTF-8' |
108 | 108 | , 'attachment_type' => BeSimple\SoapCommon\Helper::ATTACHMENTS_TYPE_MTOM |
... | ... | @@ -147,7 +147,7 @@ class ProcessoEletronicoRN extends InfraRN { |
147 | 147 | |
148 | 148 | if($this->objPenWs == null) { |
149 | 149 | $this->testaUrl($this->strWSDL, $this->options['local_cert']); |
150 | - try { | |
150 | + // try { | |
151 | 151 | |
152 | 152 | $objConfig = ConfiguracaoSEI::getInstance(); |
153 | 153 | |
... | ... | @@ -156,12 +156,15 @@ class ProcessoEletronicoRN extends InfraRN { |
156 | 156 | $this->objPenWs = new LogPenWs($objConfig->getValor('SEI', 'LogPenWs'), $this->strWSDL, $this->options); |
157 | 157 | } |
158 | 158 | else { |
159 | - | |
159 | + | |
160 | 160 | $this->objPenWs = new BeSimple\SoapClient\SoapClient($this->strWSDL, $this->options); |
161 | 161 | } |
162 | - } catch (Exception $e) { | |
162 | + /* } catch (Exception $e) { | |
163 | + echo "<pre>"; | |
164 | + var_dump($e->getMessage()); | |
165 | + die("</pre>"); | |
163 | 166 | throw new InfraException('Erro acessando serviço.', $e); |
164 | - } | |
167 | + }*/ | |
165 | 168 | } |
166 | 169 | |
167 | 170 | return $this->objPenWs; |
... | ... | @@ -543,6 +546,23 @@ class ProcessoEletronicoRN extends InfraRN { |
543 | 546 | |
544 | 547 | return $resultado; |
545 | 548 | } |
549 | + | |
550 | + public static function obterIdTarefaModulo($strIdTarefaModulo) | |
551 | + { | |
552 | + $objTarefaDTO = new TarefaDTO(); | |
553 | + $objTarefaDTO->retNumIdTarefa(); | |
554 | + $objTarefaDTO->setStrIdTarefaModulo($strIdTarefaModulo); | |
555 | + | |
556 | + $objTarefaRN = new TarefaRN(); | |
557 | + $objTarefaDTO = $objTarefaRN->consultar($objTarefaDTO); | |
558 | + | |
559 | + if($objTarefaDTO){ | |
560 | + return $objTarefaDTO->getNumIdTarefa(); | |
561 | + }else{ | |
562 | + return false; | |
563 | + } | |
564 | + | |
565 | + } | |
546 | 566 | |
547 | 567 | public function cadastrarTramiteDeProcesso($parDblIdProcedimento, $parStrNumeroRegistro, $parNumIdentificacaoTramite, $parDthRegistroTramite, $parObjProcesso, $parNumTicketComponentesDigitais = null, $parObjComponentesDigitaisSolicitados = null) |
548 | 568 | { |
... | ... | @@ -782,13 +802,15 @@ class ProcessoEletronicoRN extends InfraRN { |
782 | 802 | //Registrar componente digital necessita ser enviado pelo trâmite espefífico //TODO: Teste $parObjComponentesDigitaisSolicitados aqui |
783 | 803 | if(isset($parObjComponentesDigitaisSolicitados)){ |
784 | 804 | $arrObjItensSolicitados = is_array($parObjComponentesDigitaisSolicitados->processo) ? $parObjComponentesDigitaisSolicitados->processo : array($parObjComponentesDigitaisSolicitados->processo); |
785 | - foreach ($arrObjItensSolicitados as $objItemSolicitado) { | |
786 | 805 | |
787 | - $objItemSolicitado->hash = is_array($objItemSolicitado->hash) ? $objItemSolicitado->hash : array($objItemSolicitado->hash); | |
806 | + foreach ($arrObjItensSolicitados as $objItemSolicitado) { | |
807 | + if(!is_null($objItemSolicitado)){ | |
808 | + $objItemSolicitado->hash = is_array($objItemSolicitado->hash) ? $objItemSolicitado->hash : array($objItemSolicitado->hash); | |
788 | 809 | |
789 | - if($objItemSolicitado->protocolo == $objComponenteDigitalDTO->getStrProtocolo() && in_array($strHashConteudo, $objItemSolicitado->hash)) { | |
790 | - $objComponenteDigitalDTO->setStrSinEnviar("S"); | |
791 | - } | |
810 | + if($objItemSolicitado->protocolo == $objComponenteDigitalDTO->getStrProtocolo() && in_array($strHashConteudo, $objItemSolicitado->hash)) { | |
811 | + $objComponenteDigitalDTO->setStrSinEnviar("S"); | |
812 | + } | |
813 | + } | |
792 | 814 | } |
793 | 815 | } |
794 | 816 | |
... | ... | @@ -1280,6 +1302,7 @@ class ProcessoEletronicoRN extends InfraRN { |
1280 | 1302 | */ |
1281 | 1303 | public function cancelarTramite($idTramite) { |
1282 | 1304 | |
1305 | + //@TODOJOIN: Adicionar a seguinte linha abaixo dessa : $parametros->filtroDeConsultaDeTramites = new stdClass() | |
1283 | 1306 | //Faz a consulta do tramite |
1284 | 1307 | $paramConsultaTramite = new stdClass(); |
1285 | 1308 | $paramConsultaTramite->filtroDeConsultaDeTramites->IDT = $idTramite; |
... | ... | @@ -1308,7 +1331,8 @@ class ProcessoEletronicoRN extends InfraRN { |
1308 | 1331 | */ |
1309 | 1332 | public function recusarTramite($idTramite, $justificativa, $motivo) { |
1310 | 1333 | try { |
1311 | - | |
1334 | + | |
1335 | + //@TODOJOIN: Adicionar a seguinte linha abaixo dessa : $parametros->recusaDeTramite = new stdClass() | |
1312 | 1336 | $parametros = new stdClass(); |
1313 | 1337 | $parametros->recusaDeTramite->IDT = $idTramite; |
1314 | 1338 | $parametros->recusaDeTramite->justificativa = utf8_encode($justificativa); |
... | ... | @@ -1401,13 +1425,3 @@ class ProcessoEletronicoRN extends InfraRN { |
1401 | 1425 | } |
1402 | 1426 | |
1403 | 1427 | |
1404 | - | |
1405 | -/* | |
1406 | - | |
1407 | - -- $TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO = 501 | |
1408 | - DELETE FROM tarefa where id_tarefa = 501; | |
1409 | - INSERT INTO tarefa (id_tarefa, nome, sin_historico_resumido, sin_historico_completo, sin_fechar_andamentos_abertos, sin_lancar_andamento_fechado, sin_permite_processo_fechado) | |
1410 | - values(501, 'Processo expedido para a entidade @UNIDADE_DESTINO@ - @REPOSITORIO_DESTINO@ (@PROCESSO@, @UNIDADE@, @USUARIO@)', 'S', 'S', 'N', 'S', 'N'); | |
1411 | - | |
1412 | - | |
1413 | - */ | |
1414 | 1428 | \ No newline at end of file | ... | ... |
rn/ReceberProcedimentoRN.php
... | ... | @@ -196,7 +196,7 @@ class ReceberProcedimentoRN extends InfraRN |
196 | 196 | |
197 | 197 | |
198 | 198 | // @join_tec US008.08 (#23092) |
199 | - $this->objProcedimentoAndamentoRN->setOpts($objProcedimentoDTO->getDblIdProcedimento(), $parNumIdentificacaoTramite, ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO); | |
199 | + $this->objProcedimentoAndamentoRN->setOpts($objProcedimentoDTO->getDblIdProcedimento(), $parNumIdentificacaoTramite, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO)); | |
200 | 200 | $this->objProcedimentoAndamentoRN->cadastrar('Obtendo metadados do processo', 'S'); |
201 | 201 | |
202 | 202 | //Verificar se procedimento já existia na base de dados do sistema |
... | ... | @@ -488,9 +488,6 @@ class ReceberProcedimentoRN extends InfraRN |
488 | 488 | //TODO: Obter código da unidade através de mapeamento entre SEI e Barramento |
489 | 489 | $objUnidadeDTO = $this->atribuirDadosUnidade($objProcedimentoDTO, $objDestinatario); |
490 | 490 | |
491 | - // Registrar andamentos do Recebimento do processo | |
492 | - $this->atribuirDadosAndamento($objProcedimentoDTO, $objProcesso->historico, $objUnidadeDTO); | |
493 | - | |
494 | 491 | $this->registrarAndamentoRecebimentoProcesso($objProcedimentoDTO, $objMetadadosProcedimento, $objUnidadeDTO); |
495 | 492 | $this->atribuirDocumentos($objProcedimentoDTO, $objProcesso, $objUnidadeDTO, $objMetadadosProcedimento); |
496 | 493 | $this->registrarProcedimentoNaoVisualizado($objProcedimentoDTO); |
... | ... | @@ -602,9 +599,6 @@ class ReceberProcedimentoRN extends InfraRN |
602 | 599 | $objProcedimentoDTOGerado = $objProcedimentoRN->gerarRN0156($objProcedimentoDTO); |
603 | 600 | $objProcedimentoDTO->setDblIdProcedimento($objProcedimentoDTOGerado->getDblIdProcedimento()); |
604 | 601 | |
605 | - // Registrar andamentos do Recebimento do processo | |
606 | - $this->atribuirDadosAndamento($objProcedimentoDTO, $objProcesso->historico, $objUnidadeDTO); | |
607 | - | |
608 | 602 | $this->registrarAndamentoRecebimentoProcesso($objProcedimentoDTO, $objMetadadosProcedimento, $objUnidadeDTO); |
609 | 603 | $this->atribuirDocumentos($objProcedimentoDTO, $objProcesso, $objUnidadeDTO, $objMetadadosProcedimento); |
610 | 604 | $this->registrarProcedimentoNaoVisualizado($objProcedimentoDTOGerado); |
... | ... | @@ -628,130 +622,7 @@ class ReceberProcedimentoRN extends InfraRN |
628 | 622 | return $objProcedimentoDTO; |
629 | 623 | } |
630 | 624 | |
631 | - private function atribuirDadosAndamento(ProcedimentoDTO $parObjProcedimentoDTO, $objHistorico, $objUnidadeDTO) | |
632 | - { | |
633 | - if(isset($objHistorico) && isset($objHistorico->operacao)){ | |
634 | - | |
635 | - if (!is_array($objHistorico->operacao)) { | |
636 | - $objHistorico->operacao = array($objHistorico->operacao); | |
637 | - } | |
638 | - | |
639 | - $objAtividadeRN = new AtividadeRN(); | |
640 | - $objAtualizarAndamentoDTO = new AtualizarAndamentoDTO(); | |
641 | - | |
642 | - //Variáveis disponíveis na tarefa de andamento externo | |
643 | - //@OPERACAO@ | |
644 | - //@DATA_HORA@ | |
645 | - //@COMPLEMENTO@ | |
646 | - //@PESSOA_NOME@ | |
647 | - //@PESSOA_IDENTIFICACAO@ | |
648 | - | |
649 | - //Buscar último andamento registrado do processo | |
650 | - $objAtividadeDTO = new AtividadeDTO(); | |
651 | - $objAtividadeDTO->retDthAbertura(); | |
652 | - $objAtividadeDTO->retNumIdAtividade(); | |
653 | - $objAtividadeDTO->setDblIdProtocolo($parObjProcedimentoDTO->getDblIdProcedimento()); | |
654 | - $objAtividadeDTO->setOrdDthAbertura(InfraDTO::$TIPO_ORDENACAO_DESC); | |
655 | - $objAtividadeDTO->setNumMaxRegistrosRetorno(1); | |
656 | - | |
657 | - $objAtividadeRN = new AtividadeRN(); | |
658 | - $objAtividadeDTO = $objAtividadeRN->consultarRN0033($objAtividadeDTO); | |
659 | - | |
660 | - //TODO: Avaliar com TRF4 a necessidade de fazer o mapeamento correto para os tipos de operação | |
661 | - $objProcessoEletronicoRN = new ProcessoEletronicoRN(); | |
662 | - /*foreach ($objHistorico->operacao as $objOperacao) { | |
663 | - | |
664 | - $objDthAberturaOperacao = $objProcessoEletronicoRN->converterDataSEI($objOperacao->dataHora); | |
665 | - if(isset($objOperacao->dataHora) && isset($objAtividadeDTO)) { | |
666 | - | |
667 | - if(InfraData::compararDataHora($objAtividadeDTO->getDthAbertura(), $objDthAberturaOperacao) > 0){ | |
668 | - continue; | |
669 | - } | |
670 | - | |
671 | - //TODO: Validar dados recebidos do histórico | |
672 | - | |
673 | - $arrObjAtributoAndamentoDTO = array(); | |
674 | - | |
675 | - $objOperacaoDTO = $this->objProcessoEletronicoRN->converterOperacaoDTO($objOperacao); | |
676 | - $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | |
677 | - $objAtributoAndamentoDTO->setStrNome('OPERACAO'); | |
678 | - | |
679 | - $objAtributoAndamentoDTO->setStrValor($objOperacaoDTO->getStrNome()); | |
680 | - $objAtributoAndamentoDTO->setStrValor($objOperacaoDTO->getDthOperacao()); | |
681 | - $objAtributoAndamentoDTO->setStrIdOrigem(null); | |
682 | - $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; | |
683 | - | |
684 | - $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | |
685 | - $objAtributoAndamentoDTO->setStrNome('COMPLEMENTO'); | |
686 | - $objAtributoAndamentoDTO->setStrValor($objOperacaoDTO->getStrComplemento()); | |
687 | - $objAtributoAndamentoDTO->setStrIdOrigem(null); | |
688 | - $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; | |
689 | - | |
690 | - $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | |
691 | - $objAtributoAndamentoDTO->setStrNome('PESSOA_NOME'); | |
692 | - $objAtributoAndamentoDTO->setStrValor($objOperacaoDTO->getStrIdentificacaoPessoaOrigem()); | |
693 | - $objAtributoAndamentoDTO->setStrIdOrigem($objOperacaoDTO->getStrIdentificacaoPessoaOrigem()); | |
694 | - $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; | |
695 | - | |
696 | - $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | |
697 | - $objAtributoAndamentoDTO->setStrNome('PESSOA_IDENTIFICACAO'); | |
698 | - $objAtributoAndamentoDTO->setStrValor($objOperacaoDTO->getStrNomePessoaOrigem()); | |
699 | - $objAtributoAndamentoDTO->setStrIdOrigem($objOperacaoDTO->getStrIdentificacaoPessoaOrigem()); | |
700 | - $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; | |
701 | - | |
702 | - | |
703 | - //TODO: Implementar tarefa específica para registrar andamentos gerados em processos externos | |
704 | - // $strOperacao = "Registro"; | |
705 | - | |
706 | - // $dthOperacao = $this->objProcessoEletronicoRN->converterDataSEI($objOperacao->dataHora); | |
707 | - // $strDescricao = $strOperacao . " em " . $dthOperacao; | |
708 | - | |
709 | - // if(isset($objOperacao->complemento)) { | |
710 | - // $strDescricao .= ':' . utf8_decode($objOperacao->complemento); | |
711 | - // } | |
712 | - | |
713 | - //TODO: Atribuir dados da pessoa relacionada à operação | |
714 | - //... | |
715 | - | |
716 | - //TODO: Salvar os dados da operação em campo próprio das tabelas do barramento | |
717 | - //... | |
718 | - | |
719 | - $objAtividadeDTO = new AtividadeDTO(); | |
720 | - $objAtividadeDTO->setDblIdProtocolo($parObjProcedimentoDTO->getDblIdProcedimento()); | |
721 | - $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | |
722 | - $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | |
723 | - $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO); | |
724 | - $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); | |
725 | - | |
726 | - //TODO: Avaliar com TRF4 a possibilidade de permitir a indicação de uma data específica para | |
727 | - //o andamento. Utilizada para registrar andamentos ocorridos externamente, antes do seu registro no sistema | |
728 | - $objAtividadeRN = new AtividadeRN(); | |
729 | - $objAtividadeRN->gerarInternaRN0727($objAtividadeDTO); | |
730 | - | |
731 | - | |
732 | - // $objPesquisaPendenciaDTO = new PesquisaPendenciaDTO(); | |
733 | - // $objPesquisaPendenciaDTO->setDblIdProtocolo(array($parObjProcedimentoDTO->getDblIdProcedimento())); | |
734 | - // $objPesquisaPendenciaDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); | |
735 | - // $objPesquisaPendenciaDTO->setNumIdUnidade($objUnidadeDTO->getNumIdUnidade()); | |
736 | - // $arrObjProcedimentoDTO = $objAtividadeRN->listarPendenciasRN0754($objPesquisaPendenciaDTO); | |
737 | - | |
738 | - // $arrObjAtividadeDTO = array(); | |
739 | - // foreach($arrObjProcedimentoDTO as $objProcedimentoDTO){ | |
740 | - // $arrObjAtividadeDTO = array_merge($arrObjAtividadeDTO,$objProcedimentoDTO->getArrObjAtividadeDTO()); | |
741 | - // } | |
742 | - | |
743 | - // $arrStrIdAtividade = InfraArray::converterArrInfraDTO($arrObjAtividadeDTO,'IdAtividade'); | |
744 | - | |
745 | - // $objAtualizarAndamentoDTO->setStrDescricao($strDescricao); | |
746 | - // $objAtualizarAndamentoDTO->setArrObjProtocoloDTO(InfraArray::gerarArrInfraDTO('ProtocoloDTO','IdProtocolo',array($parObjProcedimentoDTO->getDblIdProcedimento()))); | |
747 | - // $objAtualizarAndamentoDTO->setArrObjAtividadeDTO(InfraArray::gerarArrInfraDTO('AtividadeDTO','IdAtividade',$arrStrIdAtividade)); | |
748 | - | |
749 | - // $objAtividadeRN->atualizarAndamento($objAtualizarAndamentoDTO); | |
750 | - } | |
751 | - }*/ | |
752 | - } | |
753 | - } | |
754 | - | |
625 | + | |
755 | 626 | private function removerAndamentosProcedimento($parObjProtocoloDTO) |
756 | 627 | { |
757 | 628 | //TODO: Remover apenas as atividades geradas pelo recebimento do processo, não as atividades geradas anteriormente | ... | ... |
rn/ReceberReciboTramiteRN.php
... | ... | @@ -20,24 +20,24 @@ class ReceberReciboTramiteRN extends InfraRN |
20 | 20 | return BancoSEI::getInstance(); |
21 | 21 | } |
22 | 22 | |
23 | - protected function mudarEstadoProcedimentoBloqueado($objProcesso) { | |
23 | + protected function registrarRecebimentoRecibo($numIdProcedimento, $strProtocoloFormatado, $numIdTramite) { | |
24 | 24 | |
25 | - $objProtocoloDTO = new ProtocoloDTO(); | |
26 | - $objProtocoloDTO->setStrStaEstado(ProtocoloRN::$TE_BLOQUEADO); | |
27 | - $objProtocoloDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); | |
28 | - | |
29 | - $objProtocoloRN = new ProtocoloRN(); | |
30 | - $objProtocoloRN->alterarRN0203($objProtocoloDTO); | |
25 | + //REALIZA A CONCLUSÃO DO PROCESSO | |
26 | + $objEntradaConcluirProcessoAPI = new EntradaConcluirProcessoAPI(); | |
27 | + $objEntradaConcluirProcessoAPI->setIdProcedimento($numIdProcedimento); | |
28 | + | |
29 | + $objSeiRN = new SeiRN(); | |
30 | + $objSeiRN->concluirProcesso($objEntradaConcluirProcessoAPI); | |
31 | 31 | |
32 | 32 | $arrObjAtributoAndamentoDTO = array(); |
33 | 33 | |
34 | 34 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
35 | 35 | $objAtributoAndamentoDTO->setStrNome('PROTOCOLO_FORMATADO'); |
36 | - $objAtributoAndamentoDTO->setStrValor($objProcesso->strProtocoloFormatado); | |
37 | - $objAtributoAndamentoDTO->setStrIdOrigem($objProcesso->idProcedimentoSEI); | |
36 | + $objAtributoAndamentoDTO->setStrValor($strProtocoloFormatado); | |
37 | + $objAtributoAndamentoDTO->setStrIdOrigem($numIdProcedimento); | |
38 | 38 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; |
39 | 39 | |
40 | - $arrObjTramite = $this->objProcessoEletronicoRN->consultarTramites($objProcesso->idTramite); | |
40 | + $arrObjTramite = $this->objProcessoEletronicoRN->consultarTramites($numIdTramite); | |
41 | 41 | |
42 | 42 | $objTramite = array_pop($arrObjTramite); |
43 | 43 | |
... | ... | @@ -99,12 +99,11 @@ class ReceberReciboTramiteRN extends InfraRN |
99 | 99 | $arrObjAtributoAndamentoDTO[] = $objAtributoAndamentoDTO; |
100 | 100 | } |
101 | 101 | |
102 | - // Tramitação externa do processo @processo@ concluída com sucesso. Recebido na @UnidadeDestino@ - @hierarquia_superior@ -@repositório_de_estruturas@ | |
103 | 102 | $objAtividadeDTO = new AtividadeDTO(); |
104 | - $objAtividadeDTO->setDblIdProtocolo($objProcesso->idProcedimentoSEI); | |
103 | + $objAtividadeDTO->setDblIdProtocolo($numIdProcedimento); | |
105 | 104 | $objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
106 | 105 | $objAtividadeDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); |
107 | - $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO); | |
106 | + $objAtividadeDTO->setNumIdTarefa(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO)); | |
108 | 107 | $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTO); |
109 | 108 | |
110 | 109 | $objAtividadeRN = new AtividadeRN(); |
... | ... | @@ -167,18 +166,11 @@ class ReceberReciboTramiteRN extends InfraRN |
167 | 166 | $objProtocoloBD = new ProtocoloBD(BancoSEI::getInstance()); |
168 | 167 | $objProtocoloDTO = $objProtocoloBD->consultar($objProtocoloDTO); |
169 | 168 | |
170 | - //$objProtocoloDTO->setStrStaEstado(ProtocoloRN::$TE_BLOQUEADO); | |
171 | - //$objProtocoloBD->alterar($objProtocoloDTO); | |
172 | - // @join_tec US008.12 (#23092) | |
173 | - $this->objProcedimentoAndamentoRN->setOpts($objProcessoEletronicoDTO->getDblIdProcedimento(), $parNumIdTramite, ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO); | |
169 | + $this->objProcedimentoAndamentoRN->setOpts($objProcessoEletronicoDTO->getDblIdProcedimento(), $parNumIdTramite, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)); | |
174 | 170 | $this->objProcedimentoAndamentoRN->cadastrar(sprintf('Trâmite do processo %s foi concluído', $objProtocoloDTO->getStrProtocoloFormatado()), 'S'); |
175 | - | |
176 | - $objProcesso = new stdClass(); | |
177 | - $objProcesso->idProcedimentoSEI = $objProtocoloDTO->getDblIdProtocolo(); | |
178 | - $objProcesso->strProtocoloFormatado = $objProtocoloDTO->getStrProtocoloFormatado(); | |
179 | - $objProcesso->idTramite = $parNumIdTramite; | |
180 | 171 | |
181 | - $this->mudarEstadoProcedimentoBloqueado($objProcesso); | |
172 | + //Registra o recbimento do recibo no histórico e realiza a conclusão do processo | |
173 | + $this->registrarRecebimentoRecibo($objProtocoloDTO->getDblIdProtocolo(), $objProtocoloDTO->getStrProtocoloFormatado(), $parNumIdTramite); | |
182 | 174 | |
183 | 175 | } catch (Exception $e) { |
184 | 176 | ... | ... |
sei_atualizar_versao_modulo_pen.php
sip_atualizar_versao_modulo_pen.php
... | ... | @@ -30,7 +30,7 @@ class PenMetaBD extends InfraMetaBD { |
30 | 30 | |
31 | 31 | switch($strTableDrive) { |
32 | 32 | |
33 | - case 'InfraMySql': | |
33 | + case 'InfraMySqli': | |
34 | 34 | $strQuery = sprintf("ALTER TABLE `%s` ALTER COLUMN `%s` SET DEFAULT '%s'", $strNomeTabela, $strNomeColuna, $strValorPadrao); |
35 | 35 | break; |
36 | 36 | |
... | ... | @@ -82,7 +82,7 @@ class PenMetaBD extends InfraMetaBD { |
82 | 82 | |
83 | 83 | switch($strTableDrive) { |
84 | 84 | |
85 | - case 'InfraMySql': | |
85 | + case 'InfraMySqli': | |
86 | 86 | // Fix para bug de MySQL versão inferior ao 5.5 o default engine |
87 | 87 | // é MyISAM e não tem suporte a FOREING KEYS |
88 | 88 | $this->getObjInfraIBanco()->executarSql('SET STORAGE_ENGINE=InnoDB'); |
... | ... | @@ -130,7 +130,7 @@ class PenMetaBD extends InfraMetaBD { |
130 | 130 | |
131 | 131 | switch($strTableDrive) { |
132 | 132 | |
133 | - case 'InfraMySql': | |
133 | + case 'InfraMySqli': | |
134 | 134 | $this->getObjInfraIBanco()->executarSql('ALTER TABLE '.$strNomeTabela.' DROP PRIMARY KEY'); |
135 | 135 | break; |
136 | 136 | |
... | ... | @@ -152,7 +152,7 @@ class PenMetaBD extends InfraMetaBD { |
152 | 152 | |
153 | 153 | switch($strTableDrive) { |
154 | 154 | |
155 | - case 'InfraMySql': | |
155 | + case 'InfraMySqli': | |
156 | 156 | $strSql = " SELECT COUNT(CONSTRAINT_NAME) AS EXISTE |
157 | 157 | FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS |
158 | 158 | WHERE CONSTRAINT_SCHEMA = '".$objInfraBanco->getBanco()."' |
... | ... | @@ -197,7 +197,7 @@ class PenMetaBD extends InfraMetaBD { |
197 | 197 | |
198 | 198 | switch ($strTableDrive) { |
199 | 199 | |
200 | - case 'InfraMySql': | |
200 | + case 'InfraMySqli': | |
201 | 201 | $strQuery = sprintf("ALTER TABLE `%s` RENAME TO `%s`", $strNomeTabelaAtual, $strNomeTabelaNovo); |
202 | 202 | break; |
203 | 203 | |
... | ... | @@ -227,7 +227,7 @@ class PenMetaBD extends InfraMetaBD { |
227 | 227 | |
228 | 228 | switch($strTableDrive) { |
229 | 229 | |
230 | - case 'InfraMySql': | |
230 | + case 'InfraMySqli': | |
231 | 231 | $strSql = "SELECT COUNT(TABLE_NAME) AS EXISTE |
232 | 232 | FROM INFORMATION_SCHEMA.TABLES |
233 | 233 | WHERE TABLE_SCHEMA = '".$objInfraBanco->getBanco()."' |
... | ... | @@ -260,7 +260,7 @@ class PenMetaBD extends InfraMetaBD { |
260 | 260 | |
261 | 261 | switch($strTableDrive) { |
262 | 262 | |
263 | - case 'InfraMySql': | |
263 | + case 'InfraMySqli': | |
264 | 264 | $strSql = "SELECT COUNT(TABLE_NAME) AS EXISTE |
265 | 265 | FROM INFORMATION_SCHEMA.COLUMNS |
266 | 266 | WHERE TABLE_SCHEMA = '".$objInfraBanco->getBanco()."' | ... | ... |