Commit aabdb47d87f25f78fd124de3d37e731912eb944e
1 parent
31a453ac
Exists in
master
and in
1 other branch
Correção de erro em histórico de recibo de trâmite
Showing
12 changed files
with
219 additions
and
540 deletions
Show diff stats
PENIntegracao.php
README.md
| ... | ... | @@ -31,14 +31,14 @@ Procedimentos de instalação do módulo nos servidores de aplicação e atualiz |
| 31 | 31 | - **SEI versão 3.0.5 ou superior instalada, exceto a versão 3.0.10.** |
| 32 | 32 | - Usuário de acesso ao banco de dados do SEI e SIP com permissões para criar novas estruturas no banco de dados. |
| 33 | 33 | |
| 34 | -Para iniciar os procedimentos de configuração do módulo, será necessário registrar no **ConectaGov** as unidades administrativas que poderão realizar o envio e recebimento de processos/documentos externo no SEI. Este procedimento precisa ser realizado pelo **Gestor de Protocolo** previamente habilitado no portal do **ConectaGov**. Os testes devem ser feitos primeiro em um ambiente de desenvolvimento/homologação. | |
| 34 | +Para iniciar os procedimentos de configuração do módulo, será necessário registrar no **ConectaGov** as unidades administrativas que poderão realizar o envio e recebimento de processos/documentos externo no SEI. Este procedimento precisa ser realizado pelo **Gestor de Protocolo** previamente habilitado no portal do **ConectaGov-PEN**. Os testes devem ser feitos primeiro em um ambiente de desenvolvimento/homologação. | |
| 35 | 35 | Para solicitação de acesso aos ambientes, acesse os seguintes endereços: |
| 36 | 36 | |
| 37 | 37 | - Desenvolvimento [http://pen-portal.trafficmanager.net/solicitarCadastroComite](http://pen-portal.trafficmanager.net/solicitarCadastroComite "DESENVOLVIMENTO: Portal de Administração ConectaGov PEN - Cadastro de Comitê") |
| 38 | 38 | - Homologação [http://homolog.pen.portal.trafficmanager.net/solicitarCadastroComite](http://homolog.pen.portal.trafficmanager.net/solicitarCadastroComite "HOMOLOGAÇÃO: Portal de Administração ConectaGov PEN - Cadastro de Comitê") |
| 39 | 39 | - Produção [http://conectagov.processoeletronico.gov.br/solicitarCadastroComite](http://conectagov.processoeletronico.gov.br/solicitarCadastroComite "PRODUÇÃO: Portal de Administração ConectaGov PEN - Cadastro de Comitê") |
| 40 | 40 | |
| 41 | - Para maiores informações, entre em contato pelo e-mail processo.eletronico@planejamento.gov.br | |
| 41 | + Para maiores informações, entre em contato pelo telefone 0800 978-9005 ou diretamente pela Central de Serviços do PEN, endereço https://portaldeservicos.planejamento.gov.br | |
| 42 | 42 | |
| 43 | 43 | ### Procedimentos |
| 44 | 44 | ... | ... |
dto/ProcedimentoAndamentoDTO.php
| ... | ... | @@ -4,7 +4,7 @@ require_once dirname(__FILE__) . '/../../../SEI.php'; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Persistência de dados no banco de dados |
| 7 | - * | |
| 7 | + * | |
| 8 | 8 | * @autor Join Tecnologia |
| 9 | 9 | */ |
| 10 | 10 | class ProcedimentoAndamentoDTO extends InfraDTO { |
| ... | ... | @@ -14,7 +14,7 @@ class ProcedimentoAndamentoDTO extends InfraDTO { |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function montar() { |
| 17 | - | |
| 17 | + | |
| 18 | 18 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_DBL, 'IdAndamento', 'id_andamento'); |
| 19 | 19 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_DBL, 'IdProcedimento', 'id_procedimento'); |
| 20 | 20 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_DBL, 'IdTramite', 'id_tramite'); |
| ... | ... | @@ -23,7 +23,13 @@ class ProcedimentoAndamentoDTO extends InfraDTO { |
| 23 | 23 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Mensagem', 'mensagem'); |
| 24 | 24 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Hash', 'hash'); |
| 25 | 25 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'Tarefa', 'id_tarefa'); |
| 26 | - | |
| 26 | + | |
| 27 | + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_NUM, 'IdRepositorioOrigem', 'id_repositorio_origem', 'md_pen_tramite'); | |
| 28 | + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_NUM, 'IdEstruturaOrigem', 'id_estrutura_origem', 'md_pen_tramite'); | |
| 29 | + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_NUM, 'IdRepositorioDestino', 'id_repositorio_destino', 'md_pen_tramite'); | |
| 30 | + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_NUM, 'IdEstruturaDestino', 'id_estrutura_destino', 'md_pen_tramite'); | |
| 31 | + | |
| 27 | 32 | $this->configurarPK('IdAndamento', InfraDTO::$TIPO_PK_SEQUENCIAL); |
| 33 | + $this->configurarFK('IdTramite', 'md_pen_tramite', 'id_tramite', InfraDTO::$TIPO_FK_OPCIONAL); | |
| 28 | 34 | } |
| 29 | -} | |
| 30 | 35 | \ No newline at end of file |
| 36 | +} | ... | ... |
dto/TramiteDTO.php
| ... | ... | @@ -14,12 +14,17 @@ class TramiteDTO extends InfraDTO { |
| 14 | 14 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdAndamento', 'id_andamento'); |
| 15 | 15 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdUsuario', 'id_usuario'); |
| 16 | 16 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdUnidade', 'id_unidade'); |
| 17 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdRepositorioOrigem', 'id_repositorio_origem'); | |
| 18 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdEstruturaOrigem', 'id_estrutura_origem'); | |
| 19 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdRepositorioDestino', 'id_repositorio_destino'); | |
| 20 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdEstruturaDestino', 'id_estrutura_destino'); | |
| 21 | + | |
| 17 | 22 | $this->adicionarAtributo(InfraDTO::$PREFIXO_ARR, 'ObjComponenteDigitalDTO'); |
| 18 | - | |
| 23 | + | |
| 19 | 24 | $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'NomeUsuario', 'nome', 'usuario'); |
| 20 | 25 | $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'NomeUnidade', 'nome', 'unidade'); |
| 21 | 26 | $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_NUM, 'IdProcedimento', 'id_procedimento', 'md_pen_processo_eletronico'); |
| 22 | - | |
| 27 | + | |
| 23 | 28 | $this->configurarPK('NumeroRegistro', InfraDTO::$TIPO_PK_INFORMADO); |
| 24 | 29 | $this->configurarPK('IdTramite', InfraDTO::$TIPO_PK_INFORMADO); |
| 25 | 30 | |
| ... | ... | @@ -30,16 +35,3 @@ class TramiteDTO extends InfraDTO { |
| 30 | 35 | } |
| 31 | 36 | |
| 32 | 37 | } |
| 33 | - | |
| 34 | -/* | |
| 35 | -drop table md_pen_tramite; | |
| 36 | -CREATE TABLE md_pen_tramite ( | |
| 37 | - id_tramite BIGINT(20) NOT NULL, | |
| 38 | - numero_registro VARCHAR(16) NOT NULL, | |
| 39 | - ticket_envio_componentes BIGINT(20), | |
| 40 | - dth_registro DATETIME NOT NULL, | |
| 41 | - | |
| 42 | - PRIMARY KEY (id_tramite, numero_registro), | |
| 43 | - CONSTRAINT `fk_tramite_processo_eletronico` FOREIGN KEY (`numero_registro`) REFERENCES `md_pen_processo_eletronico` (`numero_registro`) ON DELETE CASCADE ON UPDATE NO ACTION | |
| 44 | -); | |
| 45 | - */ | ... | ... |
pen_procedimento_estado.php
| ... | ... | @@ -4,12 +4,12 @@ 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 | try { |
| 11 | - | |
| 12 | - | |
| 11 | + | |
| 12 | + | |
| 13 | 13 | session_start(); |
| 14 | 14 | |
| 15 | 15 | InfraDebug::getInstance()->setBolLigado(false); |
| ... | ... | @@ -17,59 +17,59 @@ try { |
| 17 | 17 | InfraDebug::getInstance()->limpar(); |
| 18 | 18 | |
| 19 | 19 | $objSessaoSEI = SessaoSEI::getInstance(); |
| 20 | - | |
| 20 | + | |
| 21 | 21 | //$objSessaoSEI->validarLink(); |
| 22 | 22 | $objSessaoSEI->validarPermissao('pen_procedimento_expedir'); |
| 23 | 23 | $objGenericoBD = new GenericoBD(BancoSEI::getInstance()); |
| 24 | - | |
| 24 | + | |
| 25 | 25 | if(array_key_exists('metodo', $_GET)) { |
| 26 | - | |
| 26 | + | |
| 27 | 27 | ob_clean(); |
| 28 | 28 | header('Content-type: text/xml'); |
| 29 | - | |
| 29 | + | |
| 30 | 30 | |
| 31 | 31 | switch ($_GET['metodo']){ |
| 32 | - | |
| 32 | + | |
| 33 | 33 | // @join_tec US008.02 (#23092) |
| 34 | 34 | case 'baixarReciboEnvio': |
| 35 | - | |
| 35 | + | |
| 36 | 36 | header('Content-Disposition: attachment; filename="recibo_de_envio_do_tramite.xml"'); |
| 37 | 37 | // print '<?xml version="1.0" encoding="UTF-8" ? >'.PHP_EOL; |
| 38 | 38 | $objBancoSEI = BancoSEI::getInstance(); |
| 39 | 39 | $objBancoSEI->abrirConexao(); |
| 40 | - | |
| 40 | + | |
| 41 | 41 | try { |
| 42 | - | |
| 43 | - | |
| 42 | + | |
| 43 | + | |
| 44 | 44 | if(array_key_exists('id_tramite', $_GET) && array_key_exists('id_tarefa', $_GET)) { |
| 45 | - | |
| 45 | + | |
| 46 | 46 | $objReciboTramiteRN = new ReciboTramiteRN(); |
| 47 | 47 | $arrObjReciboTramiteDTO = $objReciboTramiteRN->downloadReciboEnvio($_GET['id_tramite']); |
| 48 | 48 | |
| 49 | 49 | if(empty($arrObjReciboTramiteDTO)) { |
| 50 | 50 | throw new InfraException('O recibo ainda não foi recebido.'); |
| 51 | 51 | } |
| 52 | - | |
| 52 | + | |
| 53 | 53 | $objReciboTramiteHashDTO = new ReciboTramiteHashDTO(); |
| 54 | 54 | $objReciboTramiteHashDTO->setNumIdTramite($_GET['id_tramite']); |
| 55 | 55 | $objReciboTramiteHashDTO->setStrTipoRecibo(ProcessoEletronicoRN::$STA_TIPO_RECIBO_ENVIO); |
| 56 | 56 | $objReciboTramiteHashDTO->retStrHashComponenteDigital(); |
| 57 | - | |
| 57 | + | |
| 58 | 58 | $arrObjReciboTramiteHashDTO = $objGenericoBD->listar($objReciboTramiteHashDTO); |
| 59 | - | |
| 59 | + | |
| 60 | 60 | foreach($arrObjReciboTramiteDTO as $objReciboTramiteDTO) { |
| 61 | 61 | |
| 62 | 62 | $dthTimeStamp = InfraData::getTimestamp($objReciboTramiteDTO->getDthRecebimento()); |
| 63 | - | |
| 63 | + | |
| 64 | 64 | print '<reciboDeEnvio>'; |
| 65 | 65 | print '<IDT>'.$objReciboTramiteDTO->getNumIdTramite().'</IDT>'; |
| 66 | 66 | print '<NRE>'.$objReciboTramiteDTO->getStrNumeroRegistro().'</NRE>'; |
| 67 | 67 | print '<dataDeRecebimentoDoUltimoComponenteDigital>'.date('c', $dthTimeStamp).'</dataDeRecebimentoDoUltimoComponenteDigital>'; |
| 68 | - | |
| 68 | + | |
| 69 | 69 | if($arrObjReciboTramiteHashDTO && is_array($arrObjReciboTramiteHashDTO)){ |
| 70 | 70 | $arrObjReciboTramiteHashDTO = InfraArray::converterArrInfraDTO($arrObjReciboTramiteHashDTO, 'HashComponenteDigital'); |
| 71 | 71 | ksort($arrObjReciboTramiteHashDTO); |
| 72 | - | |
| 72 | + | |
| 73 | 73 | foreach($arrObjReciboTramiteHashDTO as $hash){ |
| 74 | 74 | print '<hashDoComponenteDigital>'.$hash.'</hashDoComponenteDigital>'; |
| 75 | 75 | } |
| ... | ... | @@ -82,68 +82,68 @@ try { |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | catch(InfraException $e){ |
| 85 | - | |
| 85 | + | |
| 86 | 86 | ob_clean(); |
| 87 | 87 | print '<?xml version="1.0" encoding="UTF-8" ? >'.PHP_EOL; |
| 88 | 88 | print '<erro>'; |
| 89 | 89 | print '<mensagem>'.$e->getStrDescricao().'</mensagem>'; |
| 90 | 90 | print '</erro>'; |
| 91 | 91 | } |
| 92 | - | |
| 92 | + | |
| 93 | 93 | break; |
| 94 | - | |
| 94 | + | |
| 95 | 95 | // @join_tec US008.03 (#23092) |
| 96 | 96 | case 'baixarReciboRecebimento': |
| 97 | 97 | header('Content-Disposition: attachment; filename="recibo_de_conclusao_do_tramite.xml"'); |
| 98 | 98 | // print '<?xml version="1.0" encoding="UTF-8" ? >'.PHP_EOL; |
| 99 | 99 | $objBancoSEI = BancoSEI::getInstance(); |
| 100 | 100 | $objBancoSEI->abrirConexao(); |
| 101 | - | |
| 101 | + | |
| 102 | 102 | try { |
| 103 | 103 | |
| 104 | 104 | if(array_key_exists('id_tramite', $_GET) && array_key_exists('id_tarefa', $_GET)) { |
| 105 | - | |
| 105 | + | |
| 106 | 106 | $objReciboTramiteRN = new ReciboTramiteRN(); |
| 107 | 107 | $arrObjReciboTramiteDTO = $objReciboTramiteRN->listarPorAtividade($_GET['id_tramite'], $_GET['id_tarefa']); |
| 108 | - | |
| 108 | + | |
| 109 | 109 | if(empty($arrObjReciboTramiteDTO)) { |
| 110 | 110 | throw new InfraException('O recibo ainda não foi recebido.'); |
| 111 | 111 | } |
| 112 | - | |
| 112 | + | |
| 113 | 113 | $objReciboTramiteHashDTO = new ReciboTramiteHashDTO(); |
| 114 | 114 | $objReciboTramiteHashDTO->setNumIdTramite($_GET['id_tramite']); |
| 115 | 115 | $objReciboTramiteHashDTO->retStrHashComponenteDigital(); |
| 116 | - | |
| 116 | + | |
| 117 | 117 | if($_GET['id_tarefa'] == ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)){ |
| 118 | 118 | $objReciboTramiteHashDTO->setStrTipoRecibo(ProcessoEletronicoRN::$STA_TIPO_RECIBO_CONCLUSAO_RECEBIDO); |
| 119 | - | |
| 119 | + | |
| 120 | 120 | }else{ |
| 121 | 121 | $objReciboTramiteHashDTO->setStrTipoRecibo(ProcessoEletronicoRN::$STA_TIPO_RECIBO_CONCLUSAO_ENVIADO); |
| 122 | - | |
| 122 | + | |
| 123 | 123 | } |
| 124 | - | |
| 124 | + | |
| 125 | 125 | $arrObjReciboTramiteHashDTO = $objGenericoBD->listar($objReciboTramiteHashDTO); |
| 126 | 126 | |
| 127 | 127 | foreach($arrObjReciboTramiteDTO as $objReciboTramiteDTO) { |
| 128 | 128 | |
| 129 | 129 | $dthTimeStamp = InfraData::getTimestamp($objReciboTramiteDTO->getDthRecebimento()); |
| 130 | - | |
| 130 | + | |
| 131 | 131 | print '<recibo>'; |
| 132 | 132 | print '<IDT>'.$objReciboTramiteDTO->getNumIdTramite().'</IDT>'; |
| 133 | 133 | print '<NRE>'.$objReciboTramiteDTO->getStrNumeroRegistro().'</NRE>'; |
| 134 | 134 | print '<dataDeRecebimento>'.date('c', $dthTimeStamp).'</dataDeRecebimento>'; |
| 135 | - | |
| 135 | + | |
| 136 | 136 | $strHashAssinatura = $objReciboTramiteDTO->getStrHashAssinatura(); |
| 137 | - | |
| 137 | + | |
| 138 | 138 | if($arrObjReciboTramiteHashDTO && is_array($arrObjReciboTramiteHashDTO)){ |
| 139 | 139 | $arrObjReciboTramiteHashDTO = InfraArray::converterArrInfraDTO($arrObjReciboTramiteHashDTO, 'HashComponenteDigital'); |
| 140 | 140 | ksort($arrObjReciboTramiteHashDTO); |
| 141 | - | |
| 141 | + | |
| 142 | 142 | foreach($arrObjReciboTramiteHashDTO as $hash){ |
| 143 | 143 | print '<hashDoComponenteDigital>'.$hash.'</hashDoComponenteDigital>'; |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | - | |
| 146 | + | |
| 147 | 147 | print '</recibo>'; |
| 148 | 148 | print '<cadeiaDoCertificado>'.$objReciboTramiteDTO->getStrCadeiaCertificado().'</cadeiaDoCertificado>'; |
| 149 | 149 | print '<hashDaAssinatura>'.$objReciboTramiteDTO->getStrHashAssinatura().'</hashDaAssinatura>'; |
| ... | ... | @@ -152,7 +152,7 @@ try { |
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | catch(InfraException $e){ |
| 155 | - | |
| 155 | + | |
| 156 | 156 | ob_clean(); |
| 157 | 157 | print '<?xml version="1.0" encoding="UTF-8" ? >'.PHP_EOL; |
| 158 | 158 | print '<erro>'; |
| ... | ... | @@ -161,33 +161,34 @@ try { |
| 161 | 161 | } |
| 162 | 162 | break; |
| 163 | 163 | } |
| 164 | - | |
| 164 | + | |
| 165 | 165 | exit(0); |
| 166 | 166 | } |
| 167 | - | |
| 167 | + | |
| 168 | 168 | $strProprioLink = 'controlador.php?acao='.$_GET['acao'].'&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_retorno'].'&id_procedimento='.$_GET['id_procedimento']; |
| 169 | 169 | $strTitulo = 'Consultar Recibos'; |
| 170 | - | |
| 170 | + | |
| 171 | 171 | //$arrComandos = array(); |
| 172 | 172 | //$arrComandos[] = '<button type="button" accesskey="P" onclick="pesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>'; |
| 173 | 173 | //$arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton"><span class="infraTeclaAtalho">I</span>mprimir</button>'; |
| 174 | - | |
| 174 | + | |
| 175 | 175 | if(!array_key_exists('id_procedimento', $_GET) || empty($_GET['id_procedimento'])) { |
| 176 | 176 | |
| 177 | 177 | throw new InfraException('Código do procedimento não foi informado'); |
| 178 | 178 | } |
| 179 | - | |
| 179 | + | |
| 180 | 180 | $objProcedimentoAndamentoDTO = new ProcedimentoAndamentoDTO(); |
| 181 | 181 | $objProcedimentoAndamentoDTO->retTodos(); |
| 182 | + $objProcedimentoAndamentoDTO->retNumIdEstruturaDestino(); | |
| 183 | + $objProcedimentoAndamentoDTO->retNumIdEstruturaOrigem(); | |
| 182 | 184 | $objProcedimentoAndamentoDTO->setOrdDblIdTramite(InfraDTO::$TIPO_ORDENACAO_ASC); |
| 183 | 185 | $objProcedimentoAndamentoDTO->setOrdDthData(InfraDTO::$TIPO_ORDENACAO_ASC); |
| 184 | 186 | $objProcedimentoAndamentoDTO->setDblIdProcedimento($_GET['id_procedimento']); |
| 185 | - | |
| 187 | + | |
| 186 | 188 | if(array_key_exists('txtTextoPesquisa', $_POST) && !empty($_POST['txtTextoPesquisa'])) { |
| 187 | - | |
| 188 | 189 | $objProcedimentoAndamentoDTO->setStrMensagem('%'.$_POST['txtTextoPesquisa'].'%', InfraDTO::$OPER_LIKE); |
| 189 | - } | |
| 190 | - | |
| 190 | + } | |
| 191 | + | |
| 191 | 192 | $objPaginaSEI = PaginaSEI::getInstance(); |
| 192 | 193 | $objPaginaSEI->setTipoPagina(InfraPagina::$TIPO_PAGINA_SIMPLES); |
| 193 | 194 | //$objPaginaSEI->prepararOrdenacao($objProcedimentoAndamentoDTO, 'IdProcedimento', InfraDTO::$TIPO_ORDENACAO_ASC); |
| ... | ... | @@ -195,7 +196,7 @@ try { |
| 195 | 196 | |
| 196 | 197 | $objBancoSEI = BancoSEI::getInstance(); |
| 197 | 198 | $objBancoSEI->abrirConexao(); |
| 198 | - | |
| 199 | + | |
| 199 | 200 | $objProcedimentoAndamentoBD = new ProcedimentoAndamentoBD($objBancoSEI); |
| 200 | 201 | $arrObjProcedimentoAndamentoDTO = $objProcedimentoAndamentoBD->listar($objProcedimentoAndamentoDTO); |
| 201 | 202 | |
| ... | ... | @@ -204,19 +205,19 @@ try { |
| 204 | 205 | $numRegistros = count($arrObjProcedimentoAndamentoDTO); |
| 205 | 206 | |
| 206 | 207 | if(!empty($arrObjProcedimentoAndamentoDTO)){ |
| 207 | - | |
| 208 | - | |
| 208 | + | |
| 209 | 209 | $arrAgruparProcedimentoAndamentoDTO = array(); |
| 210 | - | |
| 211 | 210 | foreach($arrObjProcedimentoAndamentoDTO as &$objProcedimentoAndamentoDTO){ |
| 211 | + if(ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO) == $objProcedimentoAndamentoDTO->getNumTarefa()) | |
| 212 | + $numIdEstrutura = $objProcedimentoAndamentoDTO->getNumIdEstruturaDestino(); | |
| 213 | + elseif (ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO) == $objProcedimentoAndamentoDTO->getNumTarefa()) | |
| 214 | + $numIdEstrutura = $objProcedimentoAndamentoDTO->getNumIdEstruturaOrigem(); | |
| 212 | 215 | |
| 213 | - $key = $objProcedimentoAndamentoDTO->getDblIdTramite() . '-' . $objProcedimentoAndamentoDTO->getNumTarefa(); | |
| 214 | - | |
| 216 | + $key = $objProcedimentoAndamentoDTO->getDblIdTramite() . '-' . $numIdEstrutura . '-' . $objProcedimentoAndamentoDTO->getNumTarefa(); | |
| 215 | 217 | $arrAgruparProcedimentoAndamentoDTO[$key][] = $objProcedimentoAndamentoDTO; |
| 216 | 218 | } |
| 217 | - | |
| 218 | - $strResultado = ''; | |
| 219 | 219 | |
| 220 | + $strResultado = ''; | |
| 220 | 221 | $strResultado .= '<table width="99%" class="infraTable">'."\n"; |
| 221 | 222 | //$strResultado .= '<caption class="infraCaption">'.$objPaginaSEI->gerarCaptionTabela('estados do processo', $numRegistros).'</caption>'; |
| 222 | 223 | |
| ... | ... | @@ -227,24 +228,21 @@ try { |
| 227 | 228 | $strResultado .= '<th class="infraTh" width="15%">Situação</th>'."\n"; |
| 228 | 229 | $strResultado .= '</tr>'."\n"; |
| 229 | 230 | $strCssTr = ''; |
| 230 | - | |
| 231 | + | |
| 231 | 232 | $idCount = 1; |
| 232 | 233 | foreach($arrAgruparProcedimentoAndamentoDTO as $key => $arrObjProcedimentoAndamentoDTO) { |
| 233 | - | |
| 234 | - | |
| 235 | - list($dblIdTramite, $numTarefa) = explode('-', $key); | |
| 236 | - | |
| 237 | - $objReturn = PenAtividadeRN::retornaAtividadeDoTramiteFormatado($dblIdTramite, $numTarefa); | |
| 238 | - | |
| 239 | - | |
| 234 | + | |
| 235 | + list($dblIdTramite, $numIdEstrutura, $numTarefa) = explode('-', $key); | |
| 236 | + | |
| 237 | + $objReturn = PenAtividadeRN::retornaAtividadeDoTramiteFormatado($dblIdTramite, $numIdEstrutura, $numTarefa); | |
| 238 | + | |
| 240 | 239 | $strResultado .= '<tr>'; |
| 241 | 240 | $strResultado .= '<td valign="middle" colspan="2">' |
| 242 | 241 | . '<img class="imagPlus" align="absbottom" src="/infra_js/arvore/plus.gif" onclick="toggleTr('.$idCount.', this)" title="Maximizar" />' |
| 243 | 242 | . ''.$objReturn->strMensagem.'</td>'; |
| 244 | 243 | $strResultado .= '<td valign="middle" align="center">'; |
| 245 | - | |
| 244 | + | |
| 246 | 245 | // @join_tec US008.03 (#23092) | @join_tec US008.13 (#23092) |
| 247 | - | |
| 248 | 246 | if($numTarefa == ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)){ |
| 249 | 247 | $strResultado .= '<a href="'.$objSessaoSEI->assinarLink($strProprioLink.'&metodo=baixarReciboEnvio&id_tarefa='.$numTarefa.'&id_tramite='.$dblIdTramite).'"><img class="infraImg" src="'.PENIntegracao::getDiretorio().'/imagens/page_red.png" alt="Recibo de Confirmação de Envio" title="Recibo de Confirmação de Envio" /></a>'; |
| 250 | 248 | } |
| ... | ... | @@ -254,13 +252,11 @@ try { |
| 254 | 252 | } |
| 255 | 253 | $strResultado .= '</td>'; |
| 256 | 254 | $strResultado .= '<tr>'; |
| 257 | - | |
| 255 | + | |
| 258 | 256 | foreach($arrObjProcedimentoAndamentoDTO as $objProcedimentoAndamentoDTO) { |
| 259 | - | |
| 260 | - $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; | |
| 261 | 257 | |
| 258 | + $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; | |
| 262 | 259 | $strResultado .= '<tr class="'.$strCssTr.' extra_hidden_'.$idCount.'" style="display:none;">'; |
| 263 | - //$strResultado .= '<td>'.$objPaginaSEI->getTrCheck($i, $objProcedimentoAndamentoDTO->getDblIdAndamento(), '').'</td>'; | |
| 264 | 260 | $strResultado .= '<td align="center">'.$objProcedimentoAndamentoDTO->getDthData().'</td>'; |
| 265 | 261 | $strResultado .= '<td>'.$objProcedimentoAndamentoDTO->getStrMensagem().'</td>'; |
| 266 | 262 | $strResultado .= '<td align="center">'; |
| ... | ... | @@ -269,10 +265,10 @@ try { |
| 269 | 265 | $strResultado .= '<img src="'.PENIntegracao::getDiretorio().'/imagens/estado_sucesso.png" title="Concluído" alt="Concluído" />'; |
| 270 | 266 | } |
| 271 | 267 | else { |
| 272 | - $strResultado .= '<img src="'.PENIntegracao::getDiretorio().'/imagens/estado_falhou.png" title="Falhou" alt="Falhou" />'; | |
| 268 | + $strResultado .= '<img src="'.PENIntegracao::getDiretorio().'/imagens/estado_falhou.png" title="Falhou" alt="Falhou" />'; | |
| 273 | 269 | } |
| 274 | 270 | |
| 275 | - $strResultado .= '</td>'; | |
| 271 | + $strResultado .= '</td>'; | |
| 276 | 272 | $strResultado .= '</tr>'."\n"; |
| 277 | 273 | |
| 278 | 274 | $i++; |
| ... | ... | @@ -284,7 +280,7 @@ try { |
| 284 | 280 | } |
| 285 | 281 | catch(Exception $e){ |
| 286 | 282 | $objPaginaSEI->processarExcecao($e); |
| 287 | -} | |
| 283 | +} | |
| 288 | 284 | |
| 289 | 285 | |
| 290 | 286 | $objPaginaSEI->montarDocType(); | ... | ... |
rn/EnviarReciboTramiteRN.php
| ... | ... | @@ -78,16 +78,12 @@ class EnviarReciboTramiteRN extends InfraRN |
| 78 | 78 | $objReciboTramiteHashDTO->setNumIdTramite($parNumIdTramite); |
| 79 | 79 | $objReciboTramiteHashDTO->setStrHashComponenteDigital($strHashComponenteDigital); |
| 80 | 80 | $objReciboTramiteHashDTO->setStrTipoRecibo(ProcessoEletronicoRN::$STA_TIPO_RECIBO_CONCLUSAO_ENVIADO); |
| 81 | - | |
| 82 | 81 | $objBD->cadastrar($objReciboTramiteHashDTO); |
| 83 | 82 | } |
| 84 | - | |
| 85 | - | |
| 86 | 83 | } |
| 87 | 84 | |
| 88 | 85 | public function enviarReciboTramiteProcesso($parNumIdTramite, $parArrayHash = null, $parDthRecebimento = null) |
| 89 | 86 | { |
| 90 | - | |
| 91 | 87 | date_default_timezone_set('America/Sao_Paulo'); |
| 92 | 88 | |
| 93 | 89 | if(!isset($parNumIdTramite) || $parNumIdTramite == 0) { | ... | ... |
rn/ExpedirProcedimentoRN.php
| ... | ... | @@ -153,10 +153,10 @@ class ExpedirProcedimentoRN extends InfraRN { |
| 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 | - //Construo dos cabecalho para envio do processo | |
| 156 | + //Construo dos cabecalho para envio do processo | |
| 157 | 157 | $objCabecalho = $this->construirCabecalho($objExpedirProcedimentoDTO); |
| 158 | 158 | |
| 159 | - //Construo do processo para envio | |
| 159 | + //Construo do processo para envio | |
| 160 | 160 | $objProcesso = $this->construirProcesso($dblIdProcedimento, $objExpedirProcedimentoDTO->getArrIdProcessoApensado()); |
| 161 | 161 | |
| 162 | 162 | try { |
| ... | ... | @@ -171,30 +171,27 @@ class ExpedirProcedimentoRN extends InfraRN { |
| 171 | 171 | throw new InfraException("Error Processing Request", $e); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - | |
| 175 | - | |
| 176 | 174 | $this->atualizarPenProtocolo($dblIdProcedimento); |
| 177 | 175 | |
| 178 | 176 | if (isset($novoTramite->dadosTramiteDeProcessoCriado)) { |
| 179 | - | |
| 180 | 177 | $objTramite = $novoTramite->dadosTramiteDeProcessoCriado; |
| 181 | - | |
| 182 | 178 | $this->objProcedimentoAndamentoRN->setOpts($dblIdProcedimento, $objTramite->IDT, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO)); |
| 183 | 179 | try { |
| 184 | - | |
| 185 | - $this->objProcedimentoAndamentoRN->cadastrar('Envio do metadados do processo', 'S'); | |
| 186 | - | |
| 187 | - $idAtividadeExpedicao = $this->bloquearProcedimentoExpedicao($objExpedirProcedimentoDTO, $objProcesso->idProcedimentoSEI); | |
| 188 | - //$this->registrarAndamentoExpedicaoProcesso($objExpedirProcedimentoDTO, $objProcesso); | |
| 189 | - | |
| 190 | - | |
| 191 | - $this->objProcessoEletronicoRN->cadastrarTramiteDeProcesso( | |
| 192 | - $objProcesso->idProcedimentoSEI, | |
| 193 | - $objTramite->NRE, | |
| 194 | - $objTramite->IDT, | |
| 195 | - $objTramite->dataHoraDeRegistroDoTramite, $objProcesso, | |
| 196 | - $objTramite->ticketParaEnvioDeComponentesDigitais, | |
| 197 | - $objTramite->componentesDigitaisSolicitados); | |
| 180 | + $this->objProcedimentoAndamentoRN->cadastrar('Envio do metadados do processo', 'S'); | |
| 181 | + $idAtividadeExpedicao = $this->bloquearProcedimentoExpedicao($objExpedirProcedimentoDTO, $objProcesso->idProcedimentoSEI); | |
| 182 | + | |
| 183 | + $this->objProcessoEletronicoRN->cadastrarTramiteDeProcesso( | |
| 184 | + $objProcesso->idProcedimentoSEI, | |
| 185 | + $objTramite->NRE, | |
| 186 | + $objTramite->IDT, | |
| 187 | + $objTramite->dataHoraDeRegistroDoTramite, | |
| 188 | + $objExpedirProcedimentoDTO->getNumIdRepositorioOrigem(), | |
| 189 | + $objExpedirProcedimentoDTO->getNumIdUnidadeOrigem(), | |
| 190 | + $objExpedirProcedimentoDTO->getNumIdRepositorioDestino(), | |
| 191 | + $objExpedirProcedimentoDTO->getNumIdUnidadeDestino(), | |
| 192 | + $objProcesso, | |
| 193 | + $objTramite->ticketParaEnvioDeComponentesDigitais, | |
| 194 | + $objTramite->componentesDigitaisSolicitados); | |
| 198 | 195 | |
| 199 | 196 | |
| 200 | 197 | $this->objProcessoEletronicoRN->cadastrarTramitePendente($objTramite->IDT, $idAtividadeExpedicao); |
| ... | ... | @@ -802,8 +799,6 @@ class ExpedirProcedimentoRN extends InfraRN { |
| 802 | 799 | $ordemDocumento = 1; |
| 803 | 800 | $objProcesso->documento = array(); |
| 804 | 801 | |
| 805 | - | |
| 806 | - | |
| 807 | 802 | foreach ($arrDocumentosDTO as $documentoDTO) { |
| 808 | 803 | |
| 809 | 804 | //$protocoloDocumentoDTO = $this->consultarProtocoloDocumento($documeto->getDblIdProcedimento()); |
| ... | ... | @@ -845,13 +840,11 @@ class ExpedirProcedimentoRN extends InfraRN { |
| 845 | 840 | $documento->nivelDeSigilo = $this->obterNivelSigiloPEN($documentoDTO->getStrStaNivelAcessoLocalProtocolo()); |
| 846 | 841 | |
| 847 | 842 | if($documentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ |
| 848 | - | |
| 849 | 843 | $documento->hipoteseLegal = new stdClass(); |
| 850 | 844 | $documento->hipoteseLegal->identificacao = $objPenRelHipoteseLegalRN->getIdHipoteseLegalPEN($documentoDTO->getNumIdHipoteseLegalProtocolo()); |
| 851 | - // $documento->hipoteseLegal->nome = 'Nomee'; | |
| 852 | - // $documento->hipoteseLegal->baseLegal = 'Base Legall'; | |
| 853 | 845 | } |
| 854 | - $documento->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($documentoDTO->getDtaGeracaoProtocolo()); | |
| 846 | + | |
| 847 | + $documento->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($documentoDTO->getDtaGeracaoProtocolo()); | |
| 855 | 848 | |
| 856 | 849 | $usuarioDTO = $this->consultarUsuario($documentoDTO->getNumIdUsuarioGeradorProtocolo()); |
| 857 | 850 | if(isset($usuarioDTO)) { | ... | ... |
rn/PenAtividadeRN.php
| ... | ... | @@ -7,370 +7,37 @@ require_once dirname(__FILE__) . '/../../../SEI.php'; |
| 7 | 7 | class PenAtividadeRN extends AtividadeRN { |
| 8 | 8 | |
| 9 | 9 | private $statusPesquisa = true; |
| 10 | - | |
| 10 | + | |
| 11 | 11 | public function setStatusPesquisa($statusPesquisa) { |
| 12 | - | |
| 12 | + | |
| 13 | 13 | $this->statusPesquisa = $statusPesquisa; |
| 14 | 14 | } |
| 15 | - /* | |
| 16 | - protected function listarPendenciasRN0754Conectado(PesquisaPendenciaDTO $objPesquisaPendenciaDTO) { | |
| 17 | - | |
| 18 | - if ($this->statusPesquisa) { | |
| 19 | - if (!$objPesquisaPendenciaDTO->isSetStrStaEstadoProcedimento()) { | |
| 20 | - $objPesquisaPendenciaDTO->setStrStaEstadoProcedimento(ProtocoloRN::$TE_NORMAL); | |
| 21 | - } | |
| 22 | - } | |
| 23 | - | |
| 24 | - if (!$objPesquisaPendenciaDTO->isSetStrStaTipoAtribuicao()) { | |
| 25 | - $objPesquisaPendenciaDTO->setStrStaTipoAtribuicao(self::$TA_TODAS); | |
| 26 | - } | |
| 27 | - | |
| 28 | - if (!$objPesquisaPendenciaDTO->isSetNumIdUsuarioAtribuicao()) { | |
| 29 | - $objPesquisaPendenciaDTO->setNumIdUsuarioAtribuicao(null); | |
| 30 | - } | |
| 31 | - | |
| 32 | - if (!$objPesquisaPendenciaDTO->isSetStrSinMontandoArvore()) { | |
| 33 | - $objPesquisaPendenciaDTO->setStrSinMontandoArvore('N'); | |
| 34 | - } | |
| 35 | - | |
| 36 | - if (!$objPesquisaPendenciaDTO->isSetStrSinDocTodos()) { | |
| 37 | - $objPesquisaPendenciaDTO->setStrSinDocTodos('N'); | |
| 38 | - } | |
| 39 | - | |
| 40 | - if (!$objPesquisaPendenciaDTO->isSetStrSinDocAnexos()) { | |
| 41 | - $objPesquisaPendenciaDTO->setStrSinDocAnexos('N'); | |
| 42 | - } | |
| 43 | - | |
| 44 | - if (!$objPesquisaPendenciaDTO->isSetStrSinDocConteudo()) { | |
| 45 | - $objPesquisaPendenciaDTO->setStrSinDocConteudo('N'); | |
| 46 | - } | |
| 47 | - | |
| 48 | - if (!$objPesquisaPendenciaDTO->isSetStrSinAnotacoes()) { | |
| 49 | - $objPesquisaPendenciaDTO->setStrSinAnotacoes('N'); | |
| 50 | - } | |
| 51 | - | |
| 52 | - if (!$objPesquisaPendenciaDTO->isSetStrSinInteressados()) { | |
| 53 | - $objPesquisaPendenciaDTO->setStrSinInteressados('N'); | |
| 54 | - } | |
| 55 | - | |
| 56 | - if (!$objPesquisaPendenciaDTO->isSetStrSinRetornoProgramado()) { | |
| 57 | - $objPesquisaPendenciaDTO->setStrSinRetornoProgramado('N'); | |
| 58 | - } | |
| 59 | - | |
| 60 | - if (!$objPesquisaPendenciaDTO->isSetStrSinCredenciais()) { | |
| 61 | - $objPesquisaPendenciaDTO->setStrSinCredenciais('N'); | |
| 62 | - } | |
| 63 | - | |
| 64 | - if (!$objPesquisaPendenciaDTO->isSetStrSinProcAnexados()) { | |
| 65 | - $objPesquisaPendenciaDTO->setStrSinProcAnexados('N'); | |
| 66 | - } | |
| 67 | - | |
| 68 | - if (!$objPesquisaPendenciaDTO->isSetStrSinHoje()) { | |
| 69 | - $objPesquisaPendenciaDTO->setStrSinHoje('N'); | |
| 70 | - } | |
| 71 | - | |
| 72 | - | |
| 73 | - $objAtividadeDTO = new AtividadeDTO(); | |
| 74 | - $objAtividadeDTO->retNumIdAtividade(); | |
| 75 | - $objAtividadeDTO->retNumIdTarefa(); | |
| 76 | - $objAtividadeDTO->retNumIdUsuarioAtribuicao(); | |
| 77 | - $objAtividadeDTO->retNumIdUsuarioVisualizacao(); | |
| 78 | - $objAtividadeDTO->retNumTipoVisualizacao(); | |
| 79 | - $objAtividadeDTO->retNumIdUnidade(); | |
| 80 | - $objAtividadeDTO->retDthConclusao(); | |
| 81 | - $objAtividadeDTO->retDblIdProtocolo(); | |
| 82 | - $objAtividadeDTO->retStrSiglaUnidade(); | |
| 83 | - $objAtividadeDTO->retStrSinInicial(); | |
| 84 | - $objAtividadeDTO->retNumIdUsuarioAtribuicao(); | |
| 85 | - $objAtividadeDTO->retStrSiglaUsuarioAtribuicao(); | |
| 86 | - $objAtividadeDTO->retStrNomeUsuarioAtribuicao(); | |
| 87 | - | |
| 88 | - $objAtividadeDTO->setNumIdUnidade($objPesquisaPendenciaDTO->getNumIdUnidade()); | |
| 89 | - | |
| 90 | - if ($objPesquisaPendenciaDTO->getStrSinHoje() == 'N') { | |
| 91 | - $objAtividadeDTO->setDthConclusao(null); | |
| 92 | - } else { | |
| 93 | - $objAtividadeDTO->adicionarCriterio(array('Conclusao', 'Conclusao'), array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_MAIOR_IGUAL), array(null, InfraData::getStrDataAtual() . ' 00:00:00'), array(InfraDTO::$OPER_LOGICO_OR)); | |
| 94 | - } | |
| 95 | - | |
| 96 | - $objAtividadeDTO->adicionarCriterio(array('StaNivelAcessoGlobalProtocolo'), array(InfraDTO::$OPER_DIFERENTE), array(ProtocoloRN::$NA_SIGILOSO), array(), 'criterioRestritosPublicos'); | |
| 97 | - | |
| 98 | - $objAtividadeDTO->adicionarCriterio(array('StaNivelAcessoGlobalProtocolo', 'IdUsuario'), array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IGUAL), array(ProtocoloRN::$NA_SIGILOSO, $objPesquisaPendenciaDTO->getNumIdUsuario()), array(InfraDTO::$OPER_LOGICO_AND), 'criterioSigilosos'); | |
| 99 | - | |
| 100 | - $objAtividadeDTO->agruparCriterios(array('criterioRestritosPublicos', 'criterioSigilosos'), array(InfraDTO::$OPER_LOGICO_OR)); | |
| 101 | - | |
| 102 | - if ($objPesquisaPendenciaDTO->getStrStaTipoAtribuicao() == self::$TA_MINHAS) { | |
| 103 | - $objAtividadeDTO->setNumIdUsuarioAtribuicao($objPesquisaPendenciaDTO->getNumIdUsuario()); | |
| 104 | - } else if ($objPesquisaPendenciaDTO->getStrStaTipoAtribuicao() == self::$TA_DEFINIDAS) { | |
| 105 | - $objAtividadeDTO->setNumIdUsuarioAtribuicao(null, InfraDTO::$OPER_DIFERENTE); | |
| 106 | - } else if ($objPesquisaPendenciaDTO->getStrStaTipoAtribuicao() == self::$TA_ESPECIFICAS) { | |
| 107 | - $objAtividadeDTO->setNumIdUsuarioAtribuicao($objPesquisaPendenciaDTO->getNumIdUsuarioAtribuicao()); | |
| 108 | - } | |
| 109 | - | |
| 110 | - if ($objPesquisaPendenciaDTO->isSetDblIdProtocolo()) { | |
| 111 | - if (!is_array($objPesquisaPendenciaDTO->getDblIdProtocolo())) { | |
| 112 | - $objAtividadeDTO->setDblIdProtocolo($objPesquisaPendenciaDTO->getDblIdProtocolo()); | |
| 113 | - } else { | |
| 114 | - $objAtividadeDTO->setDblIdProtocolo($objPesquisaPendenciaDTO->getDblIdProtocolo(), InfraDTO::$OPER_IN); | |
| 115 | - } | |
| 116 | - } | |
| 117 | - | |
| 118 | - if ($objPesquisaPendenciaDTO->isSetStrStaEstadoProcedimento()) { | |
| 119 | - if (is_array($objPesquisaPendenciaDTO->getStrStaEstadoProcedimento())) { | |
| 120 | - $objAtividadeDTO->setStrStaEstadoProtocolo($objPesquisaPendenciaDTO->getStrStaEstadoProcedimento(), InfraDTO::$OPER_IN); | |
| 121 | - } else { | |
| 122 | - $objAtividadeDTO->setStrStaEstadoProtocolo($objPesquisaPendenciaDTO->getStrStaEstadoProcedimento()); | |
| 123 | - } | |
| 124 | - } | |
| 125 | - | |
| 126 | - //ordenar pela data de abertura descendente | |
| 127 | - $objAtividadeDTO->setOrdDthAbertura(InfraDTO::$TIPO_ORDENACAO_DESC); | |
| 128 | - | |
| 129 | - | |
| 130 | - //paginação | |
| 131 | - $objAtividadeDTO->setNumMaxRegistrosRetorno($objPesquisaPendenciaDTO->getNumMaxRegistrosRetorno()); | |
| 132 | - $objAtividadeDTO->setNumPaginaAtual($objPesquisaPendenciaDTO->getNumPaginaAtual()); | |
| 133 | - | |
| 134 | - $arrAtividadeDTO = $this->listarRN0036($objAtividadeDTO); | |
| 135 | - | |
| 136 | - //paginação | |
| 137 | - $objPesquisaPendenciaDTO->setNumTotalRegistros($objAtividadeDTO->getNumTotalRegistros()); | |
| 138 | - $objPesquisaPendenciaDTO->setNumRegistrosPaginaAtual($objAtividadeDTO->getNumRegistrosPaginaAtual()); | |
| 139 | - | |
| 140 | - $arrProcedimentos = array(); | |
| 141 | - | |
| 142 | - //Se encontrou pelo menos um registro | |
| 143 | - if (count($arrAtividadeDTO) > 0) { | |
| 144 | - | |
| 145 | - $objProcedimentoDTO = new ProcedimentoDTO(); | |
| 146 | - | |
| 147 | - $objProcedimentoDTO->retDblIdProcedimento(); | |
| 148 | - $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado(); | |
| 149 | - $objProcedimentoDTO->retStrNomeTipoProcedimento(); | |
| 150 | - $objProcedimentoDTO->retNumIdUnidadeGeradoraProtocolo(); | |
| 151 | - $objProcedimentoDTO->retStrStaEstadoProtocolo(); | |
| 152 | - $objProcedimentoDTO->retStrDescricaoProtocolo(); | |
| 153 | - $objProcedimentoDTO->retArrObjDocumentoDTO(); | |
| 154 | - | |
| 155 | - | |
| 156 | - $arrProtocolosAtividades = array_unique(InfraArray::converterArrInfraDTO($arrAtividadeDTO, 'IdProtocolo')); | |
| 157 | - $objProcedimentoDTO->setDblIdProcedimento($arrProtocolosAtividades, InfraDTO::$OPER_IN); | |
| 158 | - | |
| 159 | - if ($objPesquisaPendenciaDTO->getStrSinMontandoArvore() == 'S') { | |
| 160 | - $objProcedimentoDTO->setStrSinMontandoArvore('S'); | |
| 161 | - } | |
| 162 | - | |
| 163 | - if ($objPesquisaPendenciaDTO->getStrSinDocTodos() == 'S') { | |
| 164 | - $objProcedimentoDTO->setStrSinDocTodos('S'); | |
| 165 | - } | |
| 166 | - | |
| 167 | - if ($objPesquisaPendenciaDTO->getStrSinDocAnexos() == 'S') { | |
| 168 | - $objProcedimentoDTO->setStrSinDocAnexos('S'); | |
| 169 | - } | |
| 170 | - | |
| 171 | - if ($objPesquisaPendenciaDTO->getStrSinDocConteudo() == 'S') { | |
| 172 | - $objProcedimentoDTO->setStrSinDocConteudo('S'); | |
| 173 | - } | |
| 174 | - | |
| 175 | - if ($objPesquisaPendenciaDTO->getStrSinProcAnexados() == 'S') { | |
| 176 | - $objProcedimentoDTO->setStrSinProcAnexados('S'); | |
| 177 | - } | |
| 178 | - | |
| 179 | - if ($objPesquisaPendenciaDTO->isSetDblIdDocumento()) { | |
| 180 | - $objProcedimentoDTO->setArrDblIdProtocoloAssociado(array($objPesquisaPendenciaDTO->getDblIdDocumento())); | |
| 181 | - } | |
| 182 | - | |
| 183 | - $objProcedimentoRN = new ProcedimentoRN(); | |
| 184 | - | |
| 185 | - $arr = InfraArray::indexarArrInfraDTO($objProcedimentoRN->listarCompleto($objProcedimentoDTO), 'IdProcedimento'); | |
| 186 | - | |
| 187 | - $arrObjAnotacaoDTO = null; | |
| 188 | - if ($objPesquisaPendenciaDTO->getStrSinAnotacoes() == 'S') { | |
| 189 | - $objAnotacaoDTO = new AnotacaoDTO(); | |
| 190 | - $objAnotacaoDTO->retDblIdProtocolo(); | |
| 191 | - $objAnotacaoDTO->retStrDescricao(); | |
| 192 | - $objAnotacaoDTO->retStrSiglaUsuario(); | |
| 193 | - $objAnotacaoDTO->retStrNomeUsuario(); | |
| 194 | - $objAnotacaoDTO->retStrSinPrioridade(); | |
| 195 | - $objAnotacaoDTO->retNumIdUsuario(); | |
| 196 | - $objAnotacaoDTO->retStrStaAnotacao(); | |
| 197 | - $objAnotacaoDTO->setNumIdUnidade($objPesquisaPendenciaDTO->getNumIdUnidade()); | |
| 198 | - $objAnotacaoDTO->setDblIdProtocolo($arrProtocolosAtividades, InfraDTO::$OPER_IN); | |
| 199 | - | |
| 200 | - $objAnotacaoRN = new AnotacaoRN(); | |
| 201 | - $arrObjAnotacaoDTO = InfraArray::indexarArrInfraDTO($objAnotacaoRN->listar($objAnotacaoDTO), 'IdProtocolo', true); | |
| 202 | - } | |
| 203 | - | |
| 204 | - | |
| 205 | - $arrObjParticipanteDTO = null; | |
| 206 | - if ($objPesquisaPendenciaDTO->getStrSinInteressados() == 'S') { | |
| 207 | - | |
| 208 | - $arrObjParticipanteDTO = array(); | |
| 209 | - | |
| 210 | - $objParticipanteDTO = new ParticipanteDTO(); | |
| 211 | - $objParticipanteDTO->retDblIdProtocolo(); | |
| 212 | - $objParticipanteDTO->retStrSiglaContato(); | |
| 213 | - $objParticipanteDTO->retStrNomeContato(); | |
| 214 | - $objParticipanteDTO->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO); | |
| 215 | - $objParticipanteDTO->setDblIdProtocolo($arrProtocolosAtividades, InfraDTO::$OPER_IN); | |
| 216 | - | |
| 217 | - $objParticipanteRN = new ParticipanteRN(); | |
| 218 | - $arrTemp = $objParticipanteRN->listarRN0189($objParticipanteDTO); | |
| 219 | - | |
| 220 | - foreach ($arrTemp as $objParticipanteDTO) { | |
| 221 | - if (!isset($arrObjParticipanteDTO[$objParticipanteDTO->getDblIdProtocolo()])) { | |
| 222 | - $arrObjParticipanteDTO[$objParticipanteDTO->getDblIdProtocolo()] = array($objParticipanteDTO); | |
| 223 | - } else { | |
| 224 | - $arrObjParticipanteDTO[$objParticipanteDTO->getDblIdProtocolo()][] = $objParticipanteDTO; | |
| 225 | - } | |
| 226 | - } | |
| 227 | - } | |
| 228 | - | |
| 229 | - $arrObjRetornoProgramadoDTO = null; | |
| 230 | - if ($objPesquisaPendenciaDTO->getStrSinRetornoProgramado() == 'S') { | |
| 231 | - $objRetornoProgramadoDTO = new RetornoProgramadoDTO(); | |
| 232 | - $objRetornoProgramadoDTO->retDblIdProtocoloAtividadeEnvio(); | |
| 233 | - $objRetornoProgramadoDTO->retStrSiglaUnidadeOrigemAtividadeEnvio(); | |
| 234 | - $objRetornoProgramadoDTO->retDtaProgramada(); | |
| 235 | - $objRetornoProgramadoDTO->setNumIdUnidadeAtividadeEnvio($objPesquisaPendenciaDTO->getNumIdUnidade()); | |
| 236 | - $objRetornoProgramadoDTO->setDblIdProtocoloAtividadeEnvio($arrProtocolosAtividades, InfraDTO::$OPER_IN); | |
| 237 | - $objRetornoProgramadoDTO->setNumIdAtividadeRetorno(null); | |
| 238 | - | |
| 239 | - $objRetornoProgramadoRN = new RetornoProgramadoRN(); | |
| 240 | - $arrObjRetornoProgramadoDTO = InfraArray::indexarArrInfraDTO($objRetornoProgramadoRN->listar($objRetornoProgramadoDTO), 'IdProtocoloAtividadeEnvio', true); | |
| 241 | - } | |
| 242 | - | |
| 243 | - | |
| 244 | - //Manter ordem obtida na listagem das atividades | |
| 245 | - $arrAdicionados = array(); | |
| 246 | - $arrIdProcedimentoSigiloso = array(); | |
| 247 | - | |
| 248 | - foreach ($arrAtividadeDTO as $objAtividadeDTO) { | |
| 249 | - | |
| 250 | - $objProcedimentoDTO = $arr[$objAtividadeDTO->getDblIdProtocolo()]; | |
| 251 | - | |
| 252 | - //pode não existir se o procedimento foi excluído | |
| 253 | - if ($objProcedimentoDTO != null) { | |
| 254 | - | |
| 255 | - $dblIdProcedimento = $objProcedimentoDTO->getDblIdProcedimento(); | |
| 256 | - | |
| 257 | - if ($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO) { | |
| 258 | - | |
| 259 | - $objProcedimentoDTO->setStrSinCredencialProcesso('N'); | |
| 260 | - $objProcedimentoDTO->setStrSinCredencialAssinatura('N'); | |
| 261 | - | |
| 262 | - $arrIdProcedimentoSigiloso[] = $dblIdProcedimento; | |
| 263 | - } | |
| 264 | - | |
| 265 | - if (!isset($arrAdicionados[$dblIdProcedimento])) { | |
| 266 | - $objProcedimentoDTO->setArrObjAtividadeDTO(array($objAtividadeDTO)); | |
| 267 | - | |
| 268 | - if (is_array($arrObjAnotacaoDTO)) { | |
| 269 | - | |
| 270 | - $objProcedimentoDTO->setObjAnotacaoDTO(null); | |
| 271 | - | |
| 272 | - if (isset($arrObjAnotacaoDTO[$dblIdProcedimento])) { | |
| 273 | - | |
| 274 | - foreach ($arrObjAnotacaoDTO[$dblIdProcedimento] as $objAnotacaoDTO) { | |
| 275 | - if ($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO) { | |
| 276 | - if ($objAnotacaoDTO->getNumIdUsuario() == $objPesquisaPendenciaDTO->getNumIdUsuario() && $objAnotacaoDTO->getStrStaAnotacao() == AnotacaoRN::$TA_INDIVIDUAL) { | |
| 277 | - $objProcedimentoDTO->setObjAnotacaoDTO($objAnotacaoDTO); | |
| 278 | - break; | |
| 279 | - } | |
| 280 | - } else { | |
| 281 | - if ($objAnotacaoDTO->getStrStaAnotacao() == AnotacaoRN::$TA_UNIDADE) { | |
| 282 | - $objProcedimentoDTO->setObjAnotacaoDTO($objAnotacaoDTO); | |
| 283 | - break; | |
| 284 | - } | |
| 285 | - } | |
| 286 | - } | |
| 287 | - } | |
| 288 | - } | |
| 289 | - | |
| 290 | - if (is_array($arrObjParticipanteDTO)) { | |
| 291 | - if (isset($arrObjParticipanteDTO[$dblIdProcedimento])) { | |
| 292 | - $objProcedimentoDTO->setArrObjParticipanteDTO($arrObjParticipanteDTO[$dblIdProcedimento]); | |
| 293 | - } else { | |
| 294 | - $objProcedimentoDTO->setArrObjParticipanteDTO(null); | |
| 295 | - } | |
| 296 | - } | |
| 297 | - | |
| 298 | - if (is_array($arrObjRetornoProgramadoDTO)) { | |
| 299 | - if (isset($arrObjRetornoProgramadoDTO[$dblIdProcedimento])) { | |
| 300 | - $objProcedimentoDTO->setArrObjRetornoProgramadoDTO($arrObjRetornoProgramadoDTO[$dblIdProcedimento]); | |
| 301 | - } else { | |
| 302 | - $objProcedimentoDTO->setArrObjRetornoProgramadoDTO(null); | |
| 303 | - } | |
| 304 | - } | |
| 305 | - | |
| 306 | - $arrProcedimentos[] = $objProcedimentoDTO; | |
| 307 | - $arrAdicionados[$dblIdProcedimento] = 0; | |
| 308 | - } else { | |
| 309 | - $arrAtividadeDTOProcedimento = $objProcedimentoDTO->getArrObjAtividadeDTO(); | |
| 310 | - $arrAtividadeDTOProcedimento[] = $objAtividadeDTO; | |
| 311 | - $objProcedimentoDTO->setArrObjAtividadeDTO($arrAtividadeDTOProcedimento); | |
| 312 | - } | |
| 313 | - } | |
| 314 | - } | |
| 315 | - | |
| 316 | - if ($objPesquisaPendenciaDTO->getStrSinCredenciais() == 'S' && count($arrIdProcedimentoSigiloso)) { | |
| 317 | - | |
| 318 | - $objAcessoDTO = new AcessoDTO(); | |
| 319 | - $objAcessoDTO->retDblIdProtocolo(); | |
| 320 | - $objAcessoDTO->retStrStaTipo(); | |
| 321 | - $objAcessoDTO->setNumIdUsuario($objPesquisaPendenciaDTO->getNumIdUsuario()); | |
| 322 | - $objAcessoDTO->setNumIdUnidade($objPesquisaPendenciaDTO->getNumIdUnidade()); | |
| 323 | - $objAcessoDTO->setStrStaTipo(array(AcessoRN::$TA_CREDENCIAL_PROCESSO, AcessoRN::$TA_CREDENCIAL_ASSINATURA_PROCESSO), InfraDTO::$OPER_IN); | |
| 324 | - $objAcessoDTO->setDblIdProtocolo($arrIdProcedimentoSigiloso, InfraDTO::$OPER_IN); | |
| 325 | - | |
| 326 | - $objAcessoRN = new AcessoRN(); | |
| 327 | - $arrObjAcessoDTO = $objAcessoRN->listar($objAcessoDTO); | |
| 328 | - | |
| 329 | - /* | |
| 330 | - foreach($arr as $objProcedimentoDTO){ | |
| 331 | - $objProcedimentoDTO->setStrSinCredencialProcesso('N'); | |
| 332 | - $objProcedimentoDTO->setStrSinCredencialAssinatura('N'); | |
| 333 | - } | |
| 334 | - */ | |
| 335 | - | |
| 336 | - /* foreach ($arrObjAcessoDTO as $objAcessoDTO) { | |
| 337 | - if ($objAcessoDTO->getStrStaTipo() == AcessoRN::$TA_CREDENCIAL_PROCESSO) { | |
| 338 | - $arr[$objAcessoDTO->getDblIdProtocolo()]->setStrSinCredencialProcesso('S'); | |
| 339 | - } else if ($objAcessoDTO->getStrStaTipo() == AcessoRN::$TA_CREDENCIAL_ASSINATURA_PROCESSO) { | |
| 340 | - $arr[$objAcessoDTO->getDblIdProtocolo()]->setStrSinCredencialAssinatura('S'); | |
| 341 | - } | |
| 342 | - } | |
| 343 | - } | |
| 344 | - } | |
| 345 | - | |
| 346 | - return $arrProcedimentos; | |
| 347 | - }*/ | |
| 348 | 15 | |
| 349 | 16 | /** |
| 350 | 17 | * Retorna a atividade da ação do tramite, ou seja, se estava enviando |
| 351 | 18 | * ou recebendo um tramite |
| 352 | - * | |
| 19 | + * | |
| 353 | 20 | * @param int $numIdTramite |
| 354 | 21 | * @return object (bool bolReciboExiste, string mensagem) |
| 355 | 22 | */ |
| 356 | - public static function retornaAtividadeDoTramiteFormatado($numIdTramite = 0, $numIdTarefa = 501){ | |
| 357 | - | |
| 23 | + public static function retornaAtividadeDoTramiteFormatado($numIdTramite, $numIdEstrutura, $numIdTarefa){ | |
| 24 | + | |
| 358 | 25 | $objReturn = (object)array( |
| 359 | 26 | 'strMensagem' => '', |
| 360 | 27 | 'bolReciboExiste' => false |
| 361 | 28 | ); |
| 362 | - | |
| 29 | + | |
| 363 | 30 | $objBancoSEI = BancoSEI::getInstance(); |
| 364 | - | |
| 31 | + | |
| 365 | 32 | $objTramiteDTO = new TramiteDTO(); |
| 366 | 33 | $objTramiteDTO->setNumIdTramite($numIdTramite); |
| 367 | 34 | $objTramiteDTO->retStrNumeroRegistro(); |
| 368 | - | |
| 35 | + | |
| 369 | 36 | $objTramiteBD = new TramiteBD($objBancoSEI); |
| 370 | 37 | $objTramiteDTO = $objTramiteBD->consultar($objTramiteDTO); |
| 371 | - | |
| 38 | + | |
| 372 | 39 | if(!empty($objTramiteDTO)) { |
| 373 | - | |
| 40 | + | |
| 374 | 41 | $objProcessoEletronicoDTO = new ProcessoEletronicoDTO(); |
| 375 | 42 | $objProcessoEletronicoDTO->setStrNumeroRegistro($objTramiteDTO->getStrNumeroRegistro()); |
| 376 | 43 | $objProcessoEletronicoDTO->retDblIdProcedimento(); |
| ... | ... | @@ -380,70 +47,66 @@ class PenAtividadeRN extends AtividadeRN { |
| 380 | 47 | |
| 381 | 48 | $objAtividadeDTO = new AtividadeDTO(); |
| 382 | 49 | $objAtividadeDTO->setDblIdProtocolo($objProcessoEletronicoDTO->getDblIdProcedimento()); |
| 383 | - $objAtividadeDTO->setDblIdProtocolo($objProcessoEletronicoDTO->getDblIdProcedimento()); | |
| 384 | - $objAtividadeDTO->setNumIdTarefa($numIdTarefa); | |
| 50 | + $objAtividadeDTO->setNumIdTarefa($numIdTarefa); | |
| 385 | 51 | $objAtividadeDTO->retNumIdAtividade(); |
| 386 | - | |
| 52 | + | |
| 387 | 53 | $objAtividadeBD = new AtividadeBD($objBancoSEI); |
| 388 | 54 | $arrObjAtividadeDTO = $objAtividadeBD->listar($objAtividadeDTO); |
| 389 | - | |
| 55 | + | |
| 390 | 56 | if(!empty($arrObjAtividadeDTO)) { |
| 391 | 57 | |
| 392 | - $arrNumAtividade = array(); | |
| 393 | - | |
| 394 | - foreach($arrObjAtividadeDTO as $objAtividadeDTO) { | |
| 395 | - | |
| 396 | - $arrNumAtividade[] = $objAtividadeDTO->getNumIdAtividade(); | |
| 397 | - } | |
| 398 | - | |
| 58 | + $arrNumAtividade = InfraArray::converterArrInfraDTO($arrObjAtividadeDTO, 'IdAtividade', 'IdAtividade'); | |
| 59 | + | |
| 399 | 60 | switch($numIdTarefa){ |
| 400 | 61 | case ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_EXPEDIDO): |
| 401 | 62 | $strMensagem = 'Trâmite externo do Processo %s para %s'; |
| 402 | 63 | $strNome = 'UNIDADE_DESTINO'; |
| 403 | - | |
| 64 | + | |
| 404 | 65 | $objReciboTramiteDTO = new ReciboTramiteDTO(); |
| 405 | 66 | $objReciboTramiteDTO->setNumIdTramite($numIdTramite); |
| 406 | 67 | $objReciboTramiteDTO->retNumIdTramite(); |
| 407 | 68 | |
| 408 | 69 | $objReciboTramiteBD = new ReciboTramiteBD($objBancoSEI); |
| 409 | - $objReturn->bolReciboExiste = ($objReciboTramiteBD->contar($objReciboTramiteDTO) > 0) ? true : false; | |
| 70 | + $objReturn->bolReciboExiste = ($objReciboTramiteBD->contar($objReciboTramiteDTO) > 0) ? true : false; | |
| 410 | 71 | break; |
| 411 | - | |
| 72 | + | |
| 412 | 73 | case ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO): |
| 413 | 74 | $strMensagem = 'Recebimento do Processo %s remetido por %s'; |
| 414 | 75 | $strNome = 'ENTIDADE_ORIGEM'; |
| 415 | - | |
| 76 | + | |
| 416 | 77 | $objReciboTramiteDTO = new ReciboTramiteRecebidoDTO(); |
| 417 | 78 | $objReciboTramiteDTO->setNumIdTramite($numIdTramite); |
| 418 | - $objReciboTramiteDTO->retNumIdTramite(); | |
| 419 | 79 | |
| 420 | 80 | $objReciboTramiteBD = new ReciboTramiteRecebidoBD($objBancoSEI); |
| 421 | 81 | $objReturn->bolReciboExiste = ($objReciboTramiteBD->contar($objReciboTramiteDTO) > 0) ? true : false; |
| 422 | 82 | break; |
| 423 | - } | |
| 424 | - | |
| 83 | + } | |
| 84 | + | |
| 425 | 85 | $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); |
| 426 | 86 | $objAtributoAndamentoDTO->setNumIdAtividade($arrNumAtividade, InfraDTO::$OPER_IN); |
| 427 | 87 | $objAtributoAndamentoDTO->setStrNome($strNome); |
| 88 | + $objAtributoAndamentoDTO->setStrIdOrigem($numIdEstrutura); | |
| 428 | 89 | $objAtributoAndamentoDTO->retStrValor(); |
| 429 | - | |
| 90 | + | |
| 430 | 91 | $objAtributoAndamentoBD = new AtributoAndamentoBD($objBancoSEI); |
| 431 | 92 | $arrAtributoAndamentoDTO = $objAtributoAndamentoBD->listar($objAtributoAndamentoDTO); |
| 432 | 93 | |
| 433 | - $objAtributoAndamentoDTO = current($arrAtributoAndamentoDTO); | |
| 94 | + //$objAtributoAndamentoDTO = current($arrAtributoAndamentoDTO); | |
| 95 | + $objAtributoAndamentoDTO = $arrAtributoAndamentoDTO[0]; | |
| 96 | + //print_r($objAtributoAndamentoDTO); | |
| 434 | 97 | |
| 98 | + //echo "objAtributoAndamentoDTO->getStrValor(): " . $objAtributoAndamentoDTO->getStrValor(); | |
| 99 | + //die(); | |
| 435 | 100 | $obProtocoloDTO = new ProtocoloDTO(); |
| 436 | 101 | $obProtocoloDTO->setDblIdProtocolo($objProcessoEletronicoDTO->getDblIdProcedimento()); |
| 437 | 102 | $obProtocoloDTO->retStrProtocoloFormatado(); |
| 438 | - | |
| 439 | - | |
| 103 | + | |
| 440 | 104 | $objProtocoloBD = new ProtocoloBD($objBancoSEI); |
| 441 | 105 | $obProtocoloDTO = $objProtocoloBD->consultar($obProtocoloDTO); |
| 442 | - | |
| 443 | - $objReturn->strMensagem = sprintf($strMensagem, $obProtocoloDTO->getStrProtocoloFormatado(), $objAtributoAndamentoDTO->getStrValor()); | |
| 106 | + $objReturn->strMensagem = sprintf($strMensagem, $obProtocoloDTO->getStrProtocoloFormatado(), $objAtributoAndamentoDTO->getStrValor()); | |
| 444 | 107 | } |
| 445 | 108 | } |
| 446 | - | |
| 109 | + | |
| 447 | 110 | return $objReturn; |
| 448 | - } | |
| 449 | -} | |
| 450 | 111 | \ No newline at end of file |
| 112 | + } | |
| 113 | +} | ... | ... |
rn/PenAtualizarSeiRN.php
| ... | ... | @@ -49,6 +49,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
| 49 | 49 | case '1.1.4': //Não houve atualização no banco de dados |
| 50 | 50 | case '1.1.5': //Não houve atualização no banco de dados |
| 51 | 51 | case '1.1.6': $this->instalarV117(); |
| 52 | + case '1.1.7': $this->instalarV118(); | |
| 52 | 53 | |
| 53 | 54 | break; |
| 54 | 55 | default: |
| ... | ... | @@ -1107,8 +1108,6 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
| 1107 | 1108 | /* Contem atualizações da versao 1.1.7 do módulo */ |
| 1108 | 1109 | protected function instalarV117() { |
| 1109 | 1110 | |
| 1110 | - $objInfraMetaBD = new InfraMetaBD($this->objInfraBanco); | |
| 1111 | - | |
| 1112 | 1111 | /* Cadastramento de novas espécies documentais */ |
| 1113 | 1112 | $objEspecieDocumentalBD = new GenericoBD($this->inicializarObjInfraIBanco()); |
| 1114 | 1113 | $objEspecieDocumentalDTO = new EspecieDocumentalDTO(); |
| ... | ... | @@ -1134,22 +1133,34 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { |
| 1134 | 1133 | $fnCadastrar(186, 'Estudo', 'Podendo ser complementado com "Técnico Preliminar da Contratação"; "Técnico".'); |
| 1135 | 1134 | $fnCadastrar(999, 'Outra', 'Outras espécies documentais não identificadas.'); |
| 1136 | 1135 | |
| 1137 | - // if($this->isTabelaExiste('md_pen_rel_tipo_documento_mapeamento_recebido')) { | |
| 1138 | - // if (BancoSEI::getInstance() instanceof InfraSqlServer) { | |
| 1139 | - // BancoSEI::getInstance()->executarSql("sp_rename 'md_pen_rel_tipo_documento_mapeamento_recebido', 'md_pen_rel_tipo_doc_map_rec'"); | |
| 1140 | - // } else { | |
| 1141 | - // BancoSEI::getInstance()->executarSql("ALTER TABLE 'md_pen_rel_tipo_documento_mapeamento_recebido' RENAME TO 'md_pen_rel_tipo_doc_map_rec'"); | |
| 1142 | - // } | |
| 1143 | - // } | |
| 1136 | + //altera o parâmetro da versão de banco | |
| 1137 | + $objInfraParametroBD = new InfraParametroBD($this->inicializarObjInfraIBanco()); | |
| 1138 | + $objInfraParametroDTO = new InfraParametroDTO(); | |
| 1139 | + $objInfraParametroDTO->setStrNome(self::PARAMETRO_VERSAO_MODULO); | |
| 1140 | + $objInfraParametroDTO->setStrValor('1.1.7'); | |
| 1141 | + $objInfraParametroBD->alterar($objInfraParametroDTO); | |
| 1142 | + } | |
| 1143 | + | |
| 1144 | + /* Contem atualizações da versao 1.1.8 do módulo */ | |
| 1145 | + protected function instalarV118() { | |
| 1144 | 1146 | |
| 1147 | + $objInfraMetaBD = new InfraMetaBD($this->objInfraBanco); | |
| 1148 | + | |
| 1149 | + //Correção de chave primária para considerar campo de tipo de recibo | |
| 1145 | 1150 | $objInfraMetaBD->excluirChavePrimaria('md_pen_tramite_processado','pk_md_pen_tramite_processado'); |
| 1146 | 1151 | $objInfraMetaBD->adicionarChavePrimaria('md_pen_tramite_processado','pk_md_pen_tramite_processado',array('id_tramite','tipo_tramite_processo')); |
| 1147 | 1152 | |
| 1153 | + //Atribuição de dados da unidade de origem e destino no trâmite | |
| 1154 | + $objInfraMetaBD->adicionarColuna('md_pen_tramite','id_repositorio_origem', $objInfraMetaBD->tipoNumero(16), 'null'); | |
| 1155 | + $objInfraMetaBD->adicionarColuna('md_pen_tramite','id_estrutura_origem', $objInfraMetaBD->tipoNumero(16), 'null'); | |
| 1156 | + $objInfraMetaBD->adicionarColuna('md_pen_tramite','id_repositorio_destino', $objInfraMetaBD->tipoNumero(16), 'null'); | |
| 1157 | + $objInfraMetaBD->adicionarColuna('md_pen_tramite','id_estrutura_destino', $objInfraMetaBD->tipoNumero(16), 'null'); | |
| 1158 | + | |
| 1148 | 1159 | //altera o parâmetro da versão de banco |
| 1149 | 1160 | $objInfraParametroBD = new InfraParametroBD($this->inicializarObjInfraIBanco()); |
| 1150 | 1161 | $objInfraParametroDTO = new InfraParametroDTO(); |
| 1151 | 1162 | $objInfraParametroDTO->setStrNome(self::PARAMETRO_VERSAO_MODULO); |
| 1152 | - $objInfraParametroDTO->setStrValor('1.1.7'); | |
| 1163 | + $objInfraParametroDTO->setStrValor('1.1.8'); | |
| 1153 | 1164 | $objInfraParametroBD->alterar($objInfraParametroDTO); |
| 1154 | 1165 | } |
| 1155 | 1166 | } | ... | ... |
rn/ProcedimentoAndamentoRN.php
| ... | ... | @@ -4,89 +4,89 @@ require_once dirname(__FILE__) . '/../../../SEI.php'; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Controla o log de estados da expadição de um procedimento pelo modulo SEI |
| 7 | - * | |
| 7 | + * | |
| 8 | 8 | * @autor Join Tecnologia |
| 9 | 9 | */ |
| 10 | 10 | class ProcedimentoAndamentoRN extends InfraRN { |
| 11 | - | |
| 11 | + | |
| 12 | 12 | protected $isSetOpts = false; |
| 13 | 13 | protected $dblIdProcedimento; |
| 14 | 14 | protected $dblIdTramit; |
| 15 | - protected $numTarefa; | |
| 15 | + protected $numTarefa; | |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Instância do driver de conexão com o banco de dados |
| 19 | - * | |
| 19 | + * | |
| 20 | 20 | * @var Infra[Driver] |
| 21 | 21 | */ |
| 22 | 22 | protected $bancoSEI = null; |
| 23 | - | |
| 23 | + | |
| 24 | 24 | public function __destruct() { |
| 25 | - | |
| 25 | + | |
| 26 | 26 | if(!empty($this->bancoSEI)) { |
| 27 | - | |
| 27 | + | |
| 28 | 28 | $this->bancoSEI->fecharConexao(); |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | - | |
| 31 | + | |
| 32 | 32 | /** |
| 33 | 33 | * Invés de aproveitar o singleton do BancoSEI criamos uma nova instância para |
| 34 | 34 | * não ser afetada pelo transation |
| 35 | - * | |
| 35 | + * | |
| 36 | 36 | * @return Infra[Driver] |
| 37 | 37 | */ |
| 38 | 38 | protected function inicializarObjInfraIBanco() { |
| 39 | - | |
| 39 | + | |
| 40 | 40 | if(empty($this->bancoSEI)) { |
| 41 | - | |
| 41 | + | |
| 42 | 42 | $this->bancoSEI = new BancoSEI(); |
| 43 | 43 | $this->bancoSEI->abrirConexao(); |
| 44 | 44 | } |
| 45 | - | |
| 45 | + | |
| 46 | 46 | return $this->bancoSEI; |
| 47 | 47 | } |
| 48 | - | |
| 49 | - | |
| 48 | + | |
| 49 | + | |
| 50 | 50 | public function setOpts($dblIdProcedimento = 0, $dblIdTramit = 0, $numTarefa){ |
| 51 | - | |
| 51 | + | |
| 52 | 52 | $this->dblIdProcedimento = $dblIdProcedimento; |
| 53 | 53 | $this->dblIdTramit = $dblIdTramit; |
| 54 | 54 | $this->numTarefa = $numTarefa; |
| 55 | 55 | $this->isSetOpts = true; |
| 56 | 56 | } |
| 57 | - | |
| 57 | + | |
| 58 | 58 | /** |
| 59 | 59 | * Adiciona um novo andamento à um procedimento que esta sendo expedido para outra unidade |
| 60 | - * | |
| 60 | + * | |
| 61 | 61 | * @param string $strMensagem |
| 62 | 62 | * @param string $strSituacao Tipo ENUM(S,N) |
| 63 | 63 | * @return null |
| 64 | 64 | */ |
| 65 | 65 | public function cadastrar($strMensagem = 'Não informado', $strSituacao = 'N'){ |
| 66 | - | |
| 66 | + | |
| 67 | 67 | if($this->isSetOpts === false) { |
| 68 | 68 | throw new InfraException('Log do cadastro de procedimento não foi configurado'); |
| 69 | 69 | } |
| 70 | - | |
| 70 | + | |
| 71 | 71 | $objInfraIBanco = $this->inicializarObjInfraIBanco(); |
| 72 | 72 | |
| 73 | 73 | $objInfraIBanco->abrirTransacao(); |
| 74 | - | |
| 74 | + | |
| 75 | 75 | $hash = md5($this->dblIdProcedimento.$strMensagem); |
| 76 | - | |
| 76 | + | |
| 77 | 77 | $objProcedimentoAndamentoDTO = new ProcedimentoAndamentoDTO(); |
| 78 | 78 | $objProcedimentoAndamentoDTO->setStrSituacao($strSituacao); |
| 79 | - $objProcedimentoAndamentoDTO->setDthData(date('d/m/Y H:i:s')); | |
| 79 | + $objProcedimentoAndamentoDTO->setDthData(date('d/m/Y H:i:s')); | |
| 80 | 80 | $objProcedimentoAndamentoDTO->setDblIdProcedimento($this->dblIdProcedimento); |
| 81 | 81 | $objProcedimentoAndamentoDTO->setDblIdTramite($this->dblIdTramit); |
| 82 | 82 | $objProcedimentoAndamentoDTO->setStrSituacao($strSituacao); |
| 83 | 83 | $objProcedimentoAndamentoDTO->setStrMensagem($strMensagem); |
| 84 | 84 | $objProcedimentoAndamentoDTO->setStrHash($hash); |
| 85 | 85 | $objProcedimentoAndamentoDTO->setNumTarefa($this->numTarefa); |
| 86 | - | |
| 86 | + | |
| 87 | 87 | $objProcedimentoAndamentoBD = new ProcedimentoAndamentoBD($objInfraIBanco); |
| 88 | 88 | $objProcedimentoAndamentoBD->cadastrar($objProcedimentoAndamentoDTO); |
| 89 | - | |
| 90 | - $objInfraIBanco->confirmarTransacao(); | |
| 89 | + | |
| 90 | + $objInfraIBanco->confirmarTransacao(); | |
| 91 | 91 | } |
| 92 | 92 | } | ... | ... |
rn/ProcessoEletronicoRN.php
| ... | ... | @@ -568,7 +568,8 @@ class ProcessoEletronicoRN extends InfraRN { |
| 568 | 568 | |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | - public function cadastrarTramiteDeProcesso($parDblIdProcedimento, $parStrNumeroRegistro, $parNumIdentificacaoTramite, $parDthRegistroTramite, $parObjProcesso, $parNumTicketComponentesDigitais = null, $parObjComponentesDigitaisSolicitados = null) | |
| 571 | + public function cadastrarTramiteDeProcesso($parDblIdProcedimento, $parStrNumeroRegistro, $parNumIdentificacaoTramite, $parDthRegistroTramite, $parNumIdRepositorioOrigem, | |
| 572 | + $parNumIdEstruturaOrigem, $parNumIdRepositorioDestino, $parNumIdEstruturaDestino, $parObjProcesso, $parNumTicketComponentesDigitais = null, $parObjComponentesDigitaisSolicitados = null) | |
| 572 | 573 | { |
| 573 | 574 | if(!isset($parDblIdProcedimento) || $parDblIdProcedimento == 0) { |
| 574 | 575 | throw new InfraException('Parâmetro $parDblIdProcedimento não informado.'); |
| ... | ... | @@ -582,6 +583,22 @@ class ProcessoEletronicoRN extends InfraRN { |
| 582 | 583 | throw new InfraException('Parâmetro $parStrNumeroRegistro não informado.'); |
| 583 | 584 | } |
| 584 | 585 | |
| 586 | + if(!isset($parNumIdRepositorioOrigem) || $parNumIdRepositorioOrigem == 0) { | |
| 587 | + throw new InfraException('Parâmetro $parNumIdRepositorioOrigem não informado.'); | |
| 588 | + } | |
| 589 | + | |
| 590 | + if(!isset($parNumIdEstruturaOrigem) || $parNumIdEstruturaOrigem == 0) { | |
| 591 | + throw new InfraException('Parâmetro $parNumIdEstruturaOrigem não informado.'); | |
| 592 | + } | |
| 593 | + | |
| 594 | + if(!isset($parNumIdRepositorioDestino) || $parNumIdRepositorioDestino == 0) { | |
| 595 | + throw new InfraException('Parâmetro $parNumIdRepositorioDestino não informado.'); | |
| 596 | + } | |
| 597 | + | |
| 598 | + if(!isset($parNumIdEstruturaDestino) || $parNumIdEstruturaDestino == 0) { | |
| 599 | + throw new InfraException('Parâmetro $parNumIdEstruturaDestino não informado.'); | |
| 600 | + } | |
| 601 | + | |
| 585 | 602 | if(!isset($parObjProcesso)) { |
| 586 | 603 | throw new InfraException('Parâmetro $objProcesso não informado.'); |
| 587 | 604 | } |
| ... | ... | @@ -618,6 +635,11 @@ class ProcessoEletronicoRN extends InfraRN { |
| 618 | 635 | $objTramiteDTO->setDthRegistro($this->converterDataSEI($parDthRegistroTramite)); |
| 619 | 636 | $objTramiteDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
| 620 | 637 | $objTramiteDTO->setNumIdUsuario(SessaoSEI::getInstance()->getNumIdUsuario()); |
| 638 | + $objTramiteDTO->setNumIdRepositorioOrigem($parNumIdRepositorioOrigem); | |
| 639 | + $objTramiteDTO->setNumIdEstruturaOrigem($parNumIdEstruturaOrigem); | |
| 640 | + $objTramiteDTO->setNumIdRepositorioDestino($parNumIdRepositorioDestino); | |
| 641 | + $objTramiteDTO->setNumIdEstruturaDestino($parNumIdEstruturaDestino); | |
| 642 | + | |
| 621 | 643 | $objProcessoEletronicoDTO->setArrObjTramiteDTO(array($objTramiteDTO)); |
| 622 | 644 | |
| 623 | 645 | //Monta dados dos componentes digitais |
| ... | ... | @@ -651,25 +673,20 @@ class ProcessoEletronicoRN extends InfraRN { |
| 651 | 673 | $objProcessoEletronicoDTO = $objProcessoEletronicoBD->consultar($objProcessoEletronicoDTOFiltro); |
| 652 | 674 | |
| 653 | 675 | if(empty($objProcessoEletronicoDTO)) { |
| 654 | - | |
| 655 | 676 | $objProcessoEletronicoDTO = $objProcessoEletronicoBD->cadastrar($objProcessoEletronicoDTOFiltro); |
| 656 | 677 | } |
| 657 | 678 | |
| 658 | 679 | //Registrar processos apensados |
| 659 | 680 | if($parObjProcessoEletronicoDTO->isSetArrObjRelProcessoEletronicoApensado()) { |
| 660 | - | |
| 661 | 681 | $objRelProcessoEletronicoApensadoBD = new RelProcessoEletronicoApensadoBD($this->getObjInfraIBanco()); |
| 662 | - | |
| 663 | 682 | foreach ($parObjProcessoEletronicoDTO->getArrObjRelProcessoEletronicoApensado() as $objRelProcessoEletronicoApensadoDTOFiltro) { |
| 664 | - | |
| 665 | 683 | if($objRelProcessoEletronicoApensadoBD->contar($objRelProcessoEletronicoApensadoDTOFiltro) < 1){ |
| 666 | - | |
| 667 | 684 | $objRelProcessoEletronicoApensadoBD->cadastrar($objRelProcessoEletronicoApensadoDTOFiltro); |
| 668 | 685 | } |
| 669 | 686 | } |
| 670 | 687 | } |
| 671 | 688 | |
| 672 | - //Registrar informações sobre o trâmite do processo | |
| 689 | + //Registrar informações sobre o trâmite do processo | |
| 673 | 690 | $arrObjTramiteDTO = $parObjProcessoEletronicoDTO->getArrObjTramiteDTO(); |
| 674 | 691 | $parObjTramiteDTO = $arrObjTramiteDTO[0]; |
| 675 | 692 | ... | ... |
rn/ReceberProcedimentoRN.php
| ... | ... | @@ -101,7 +101,7 @@ class ReceberProcedimentoRN extends InfraRN |
| 101 | 101 | if (isset($objMetadadosProcedimento->metadados->unidadeReceptora)) { |
| 102 | 102 | $numUnidadeReceptora = $objMetadadosProcedimento->metadados->unidadeReceptora; |
| 103 | 103 | $this->destinatarioReal = $objMetadadosProcedimento->metadados->destinatario; |
| 104 | - $objMetadadosProcedimento->metadados->destinatario = $numUnidadeReceptora; | |
| 104 | + $objMetadadosProcedimento->metadados->destinatario->numeroDeIdentificacaoDaEstrutura = $numUnidadeReceptora; | |
| 105 | 105 | $this->gravarLogDebug("Atribuindo unidade receptora $numUnidadeReceptora para o trâmite $parNumIdentificacaoTramite", 4); |
| 106 | 106 | } |
| 107 | 107 | |
| ... | ... | @@ -114,7 +114,6 @@ class ReceberProcedimentoRN extends InfraRN |
| 114 | 114 | //Comentando o trecho abaixo funciona, mas o processo fica aberto na unidade de destino |
| 115 | 115 | if($this->tramiteRegistrado($strNumeroRegistro, $parNumIdentificacaoTramite)) { |
| 116 | 116 | $this->gravarLogDebug("Trâmite $parNumIdentificacaoTramite já para o processo " . $objProcesso->protocolo, 4); |
| 117 | - // return ; | |
| 118 | 117 | } |
| 119 | 118 | |
| 120 | 119 | // Validação dos dados do processo recebido |
| ... | ... | @@ -185,15 +184,22 @@ class ReceberProcedimentoRN extends InfraRN |
| 185 | 184 | $this->gravarLogDebug("Persistindo/atualizando dados do processo com NRE " . $strNumeroRegistro, 4); |
| 186 | 185 | $objProcedimentoDTO = $this->registrarProcesso($strNumeroRegistro, $parNumIdentificacaoTramite, $objProcesso, $objMetadadosProcedimento); |
| 187 | 186 | |
| 188 | - | |
| 189 | 187 | // @join_tec US008.08 (#23092) |
| 190 | 188 | $this->objProcedimentoAndamentoRN->setOpts($objProcedimentoDTO->getDblIdProcedimento(), $parNumIdentificacaoTramite, ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_RECEBIDO)); |
| 191 | 189 | $this->objProcedimentoAndamentoRN->cadastrar('Obtendo metadados do processo', 'S'); |
| 192 | 190 | |
| 193 | 191 | |
| 194 | 192 | $this->gravarLogDebug("Registrando trâmite externo do processo", 4); |
| 195 | - $objProcessoEletronicoDTO = $this->objProcessoEletronicoRN->cadastrarTramiteDeProcesso($objProcedimentoDTO->getDblIdProcedimento(), | |
| 196 | - $strNumeroRegistro, $parNumIdentificacaoTramite, null, $objProcesso); | |
| 193 | + $objProcessoEletronicoDTO = $this->objProcessoEletronicoRN->cadastrarTramiteDeProcesso( | |
| 194 | + $objProcedimentoDTO->getDblIdProcedimento(), | |
| 195 | + $strNumeroRegistro, | |
| 196 | + $parNumIdentificacaoTramite, | |
| 197 | + null, | |
| 198 | + $objMetadadosProcedimento->metadados->remetente->identificacaoDoRepositorioDeEstruturas, | |
| 199 | + $objMetadadosProcedimento->metadados->remetente->numeroDeIdentificacaoDaEstrutura, | |
| 200 | + $objMetadadosProcedimento->metadados->destinatario->identificacaoDoRepositorioDeEstruturas, | |
| 201 | + $objMetadadosProcedimento->metadados->destinatario->numeroDeIdentificacaoDaEstrutura, | |
| 202 | + $objProcesso); | |
| 197 | 203 | |
| 198 | 204 | //Verifica se o tramite se encontra na situação correta |
| 199 | 205 | $arrObjTramite = $this->objProcessoEletronicoRN->consultarTramites($parNumIdentificacaoTramite); |
| ... | ... | @@ -201,7 +207,6 @@ class ReceberProcedimentoRN extends InfraRN |
| 201 | 207 | throw new InfraException("Trâmite não pode ser localizado pelo identificado $parNumIdentificacaoTramite."); |
| 202 | 208 | } |
| 203 | 209 | |
| 204 | - | |
| 205 | 210 | $objTramite = $arrObjTramite[0]; |
| 206 | 211 | if($objTramite->situacaoAtual != ProcessoEletronicoRN::$STA_SITUACAO_TRAMITE_COMPONENTES_RECEBIDOS_DESTINATARIO) { |
| 207 | 212 | $this->gravarLogDebug("Desconsiderando recebimento do processo devido a situação de trâmite inconsistente: " . $objTramite->situacaoAtual, 4); | ... | ... |