From 9ee4488271c406bc838e7bacb8c1a6d52f76be35 Mon Sep 17 00:00:00 2001 From: Marcelo Linhares Date: Tue, 3 Jul 2018 09:50:26 -0300 Subject: [PATCH] Modificando md_pen_tramite para md_pen_tram --- dto/ComponenteDigitalDTO.php | 6 +++--- dto/PenTramiteProcessadoDTO.php | 2 +- dto/TramiteDTO.php | 8 ++++---- dto/TramitePendenteDTO.php | 2 +- rn/PenAtualizarSeiRN.php | 36 ++++++++++++++++++------------------ rn/ProcessoExpedidoRN.php | 8 ++++---- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/dto/ComponenteDigitalDTO.php b/dto/ComponenteDigitalDTO.php index a650e7f..fe030ae 100644 --- a/dto/ComponenteDigitalDTO.php +++ b/dto/ComponenteDigitalDTO.php @@ -26,7 +26,7 @@ class ComponenteDigitalDTO extends InfraDTO { $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'Ordem', 'ordem'); $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'SinEnviar', 'sin_enviar'); - $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_NUM, 'TicketEnvioComponentes', 'ticket_envio_componentes', 'md_pen_tramite'); + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_NUM, 'TicketEnvioComponentes', 'ticket_envio_componentes', 'md_pen_tram'); $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'ConteudoAssinaturaDocumento', 'conteudo_assinatura', 'documento_conteudo'); $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'ProtocoloDocumentoFormatado', 'protocolo_formatado', 'protocolo'); $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'StaEstadoProtocolo', 'sta_estado', 'protocolo'); @@ -34,8 +34,8 @@ class ComponenteDigitalDTO extends InfraDTO { $this->configurarPK('NumeroRegistro', InfraDTO::$TIPO_PK_INFORMADO); $this->configurarPK('IdDocumento', InfraDTO::$TIPO_PK_INFORMADO); - $this->configurarFK('NumeroRegistro', 'md_pen_tramite', 'numero_registro', InfraDTO::$TIPO_FK_OBRIGATORIA); - $this->configurarFK('IdTramite', 'md_pen_tramite', 'id_tramite', InfraDTO::$TIPO_FK_OBRIGATORIA); + $this->configurarFK('NumeroRegistro', 'md_pen_tram', 'numero_registro', InfraDTO::$TIPO_FK_OBRIGATORIA); + $this->configurarFK('IdTramite', 'md_pen_tram', 'id_tramite', InfraDTO::$TIPO_FK_OBRIGATORIA); $this->configurarFK('IdDocumento', 'documento', 'id_documento', InfraDTO::$TIPO_FK_OBRIGATORIA); $this->configurarFK('IdDocumento', 'protocolo', 'id_protocolo', InfraDTO::$TIPO_FK_OBRIGATORIA); $this->configurarFK('IdDocumento', 'documento_conteudo', 'id_documento', InfraDTO::$TIPO_FK_OBRIGATORIA); diff --git a/dto/PenTramiteProcessadoDTO.php b/dto/PenTramiteProcessadoDTO.php index d42bfa4..eea5f5f 100644 --- a/dto/PenTramiteProcessadoDTO.php +++ b/dto/PenTramiteProcessadoDTO.php @@ -9,7 +9,7 @@ require_once dirname(__FILE__) . '/../../../SEI.php'; class PenTramiteProcessadoDTO extends InfraDTO { public function getStrNomeTabela() { - return 'md_pen_tramite_processado'; + return 'md_pen_tram_processado'; } public function montar() { diff --git a/dto/TramiteDTO.php b/dto/TramiteDTO.php index 7dd233e..71654dd 100644 --- a/dto/TramiteDTO.php +++ b/dto/TramiteDTO.php @@ -3,7 +3,7 @@ class TramiteDTO extends InfraDTO { public function getStrNomeTabela() { - return 'md_pen_tramite'; + return 'md_pen_tram'; } public function montar() { @@ -23,7 +23,7 @@ class TramiteDTO extends InfraDTO { $this->configurarPK('NumeroRegistro', InfraDTO::$TIPO_PK_INFORMADO); $this->configurarPK('IdTramite', InfraDTO::$TIPO_PK_INFORMADO); - $this->configurarFK('NumeroRegistro', 'md_pen_tramite', 'numero_registro', InfraDTO::$TIPO_FK_OBRIGATORIA); + $this->configurarFK('NumeroRegistro', 'md_pen_tram', 'numero_registro', InfraDTO::$TIPO_FK_OBRIGATORIA); $this->configurarFK('NumeroRegistro', 'md_pen_pr_elet pe', 'pe.numero_registro'); $this->configurarFK('IdUsuario', 'usuario u', 'u.id_usuario'); $this->configurarFK('IdUnidade', 'unidade u', 'u.id_unidade'); @@ -32,8 +32,8 @@ class TramiteDTO extends InfraDTO { } /* -drop table md_pen_tramite; -CREATE TABLE md_pen_tramite ( +drop table md_pen_tram; +CREATE TABLE md_pen_tram ( id_tramite BIGINT(20) NOT NULL, numero_registro VARCHAR(16) NOT NULL, ticket_envio_componentes BIGINT(20), diff --git a/dto/TramitePendenteDTO.php b/dto/TramitePendenteDTO.php index c25c1fc..a526283 100644 --- a/dto/TramitePendenteDTO.php +++ b/dto/TramitePendenteDTO.php @@ -5,7 +5,7 @@ require_once dirname(__FILE__).'/../../../SEI.php'; class TramitePendenteDTO extends InfraDTO { public function getStrNomeTabela() { - return 'md_pen_tramite_pendente'; + return 'md_pen_tram_pendente'; } diff --git a/rn/PenAtualizarSeiRN.php b/rn/PenAtualizarSeiRN.php index aaa0a52..5fb4e0c 100644 --- a/rn/PenAtualizarSeiRN.php +++ b/rn/PenAtualizarSeiRN.php @@ -109,7 +109,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { )); $objMetaBD->criarTabela(array( - 'tabela' => 'md_pen_tramite', + 'tabela' => 'md_pen_tram', 'cols' => array( 'numero_registro' => array($objMetaBD->tipoTextoFixo(16), PenMetaBD::NNULLO), 'id_tramite' => array($objMetaBD->tipoNumeroGrande(), PenMetaBD::NNULLO), @@ -139,7 +139,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { )); $objMetaBD->criarTabela(array( - 'tabela' => 'md_pen_tramite_pendente', + 'tabela' => 'md_pen_tram_pendente', 'cols' => array( 'id' => array($objMetaBD->tipoNumero(), PenMetaBD::NNULLO), 'numero_tramite' => array($objMetaBD->tipoTextoVariavel(255)), @@ -149,7 +149,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { )); $objMetaBD->criarTabela(array( - 'tabela' => 'md_pen_tramite_recibo_envio', + 'tabela' => 'md_pen_tram_recibo_envio', 'cols' => array( 'numero_registro' => array($objMetaBD->tipoTextoFixo(16), PenMetaBD::NNULLO), 'id_tramite' => array($objMetaBD->tipoNumeroGrande(), PenMetaBD::NNULLO), @@ -188,7 +188,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { )); /* $objMetaBD->criarTabela(array( - 'tabela' => 'md_pen_tramite_recusado', + 'tabela' => 'md_pen_tram_recusado', 'cols' => array( 'numero_registro'=> array($objMetaBD->tipoTextoFixo(16), PenMetaBD::NNULLO), 'id_tramite' => array($objMetaBD->tipoNumeroGrande(), PenMetaBD::NNULLO) @@ -207,7 +207,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { ), 'pk' => array('numero_registro', 'id_tramite'), 'fks' => array( - 'md_pen_tramite' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) + 'md_pen_tram' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) ) )); @@ -222,7 +222,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { ), 'pk' => array('numero_registro', 'id_tramite'), 'fks' => array( - 'md_pen_tramite' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) + 'md_pen_tram' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) ) )); @@ -236,7 +236,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { ), 'pk' => array('numero_registro', 'id_tramite', 'hash_assinatura'), 'fks' => array( - 'md_pen_tramite' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) + 'md_pen_tram' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) ) )); @@ -317,7 +317,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { 'documento' => array('id_documento', 'id_documento'), 'procedimento' => array('id_procedimento', 'id_procedimento'), 'md_pen_pr_elet' => array('numero_registro', 'numero_registro'), - 'md_pen_tramite' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) + 'md_pen_tram' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) ) )); @@ -343,9 +343,9 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { $objInfraSequencia->criarSequencia('md_pen_procedimento_andamento', '1', '1', '9999999999'); } - if (!$objInfraSequencia->verificarSequencia('md_pen_tramite_pendente')) { + if (!$objInfraSequencia->verificarSequencia('md_pen_tram_pendente')) { - $objInfraSequencia->criarSequencia('md_pen_tramite_pendente', '1', '1', '9999999999'); + $objInfraSequencia->criarSequencia('md_pen_tram_pendente', '1', '1', '9999999999'); } //---------------------------------------------------------------------- // Parâmetros @@ -657,7 +657,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { /* ---------- antigo método (instalarV002R003S000US024) ---------- */ $objMetaBD->criarTabela(array( - 'tabela' => 'md_pen_tramite_processado', + 'tabela' => 'md_pen_tram_processado', 'cols' => array( 'id_tramite' => array($objMetaBD->tipoNumeroGrande(), PenMetaBD::NNULLO), 'dth_ultimo_processamento' => array($objMetaBD->tipoDataHora(), PenMetaBD::NNULLO), @@ -702,15 +702,15 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { /* ---------- antigo método (instalarV002R003S001US035) ---------- */ $objMetaBanco = $this->inicializarObjMetaBanco(); - if (!$objMetaBanco->isColuna('md_pen_tramite_processado', 'tipo_tramite_processo')) { - $objMetaBanco->adicionarColuna('md_pen_tramite_processado', 'tipo_tramite_processo', 'CHAR(2)', PenMetaBD::NNULLO); - $objMetaBanco->adicionarValorPadraoParaColuna('md_pen_tramite_processado', 'tipo_tramite_processo', 'RP'); + if (!$objMetaBanco->isColuna('md_pen_tram_processado', 'tipo_tramite_processo')) { + $objMetaBanco->adicionarColuna('md_pen_tram_processado', 'tipo_tramite_processo', 'CHAR(2)', PenMetaBD::NNULLO); + $objMetaBanco->adicionarValorPadraoParaColuna('md_pen_tram_processado', 'tipo_tramite_processo', 'RP'); } - if ($objMetaBanco->isChaveExiste('md_pen_tramite_processado', 'pk_md_pen_tramite_processado')) { + if ($objMetaBanco->isChaveExiste('md_pen_tram_processado', 'pk_md_pen_tram_processado')) { - $objMetaBanco->removerChavePrimaria('md_pen_tramite_processado', 'pk_md_pen_tramite_processado'); - $objMetaBanco->adicionarChavePrimaria('md_pen_tramite_processado', 'pk_md_pen_tramite_processado', array('id_tramite', 'tipo_tramite_processo')); + $objMetaBanco->removerChavePrimaria('md_pen_tram_processado', 'pk_md_pen_tram_processado'); + $objMetaBanco->adicionarChavePrimaria('md_pen_tram_processado', 'pk_md_pen_tram_processado', array('id_tramite', 'tipo_tramite_processo')); } /* ---------- antigo método (instalarV003R003S003IW001) ---------- */ @@ -901,7 +901,7 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { ), 'pk' => array('id_tramite_hash'), 'fks' => array( - 'md_pen_tramite' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) + 'md_pen_tram' => array(array('numero_registro', 'id_tramite'), array('numero_registro', 'id_tramite')) ) )); diff --git a/rn/ProcessoExpedidoRN.php b/rn/ProcessoExpedidoRN.php index 8400b5b..2fd3b2c 100644 --- a/rn/ProcessoExpedidoRN.php +++ b/rn/ProcessoExpedidoRN.php @@ -31,14 +31,14 @@ class ProcessoExpedidoRN extends InfraRN { INNER JOIN atividade a ON a.id_protocolo = p.id_protocolo INNER JOIN atributo_andamento atd ON a.id_atividade = atd.id_atividade AND atd.nome = 'UNIDADE_DESTINO' INNER JOIN md_pen_pr_elet pe ON pe.id_procedimento = p.id_protocolo - INNER JOIN md_pen_tramite ptra ON ptra.numero_registro = pe.numero_registro + INNER JOIN md_pen_tram ptra ON ptra.numero_registro = pe.numero_registro INNER JOIN usuario us ON ptra.id_usuario = us.id_usuario WHERE p.sta_estado = " . $objProtocoloDTO->getStrStaEstado() . " AND a.id_tarefa = ". ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO) ." AND - ptra.dth_registro = (SELECT MAX(pt.dth_registro) dth_registro FROM md_pen_tramite pt WHERE pt.numero_registro = pe.numero_registro) + ptra.dth_registro = (SELECT MAX(pt.dth_registro) dth_registro FROM md_pen_tram pt WHERE pt.numero_registro = pe.numero_registro) AND NOT EXISTS ( SELECT at2.* FROM atividade as at2 @@ -54,14 +54,14 @@ class ProcessoExpedidoRN extends InfraRN { INNER JOIN atividade a ON a.id_protocolo = p.id_protocolo INNER JOIN atributo_andamento atd ON a.id_atividade = atd.id_atividade AND atd.nome = 'UNIDADE_DESTINO' INNER JOIN md_pen_pr_elet pe ON pe.id_procedimento = p.id_protocolo - INNER JOIN md_pen_tramite ptra ON ptra.numero_registro = pe.numero_registro + INNER JOIN md_pen_tram ptra ON ptra.numero_registro = pe.numero_registro INNER JOIN usuario us ON ptra.id_usuario = us.id_usuario WHERE p.sta_estado = " . $objProtocoloDTO->getStrStaEstado() . " AND a.id_tarefa = ". ProcessoEletronicoRN::obterIdTarefaModulo(ProcessoEletronicoRN::$TI_PROCESSO_ELETRONICO_PROCESSO_TRAMITE_EXTERNO) ." AND - ptra.dth_registro = (SELECT MAX(pt.dth_registro) dth_registro FROM md_pen_tramite pt WHERE pt.numero_registro = pe.numero_registro) + ptra.dth_registro = (SELECT MAX(pt.dth_registro) dth_registro FROM md_pen_tram pt WHERE pt.numero_registro = pe.numero_registro) AND NOT EXISTS ( SELECT at2.* FROM atividade as at2 -- libgit2 0.21.2