Skip to content

Commit

Permalink
Merge pull request #6 from anatelgovbr/correios_v2.4.0
Browse files Browse the repository at this point in the history
v2.4.0
  • Loading branch information
gustavolc84 authored Nov 29, 2024
2 parents ac5dead + e68d193 commit b653dfc
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 20 deletions.
48 changes: 42 additions & 6 deletions sei/scripts/sei_atualizar_versao_modulo_correios.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class MdCorAtualizadorSeiRN extends InfraRN
{

private $numSeg = 0;
private $versaoAtualDesteModulo = '2.3.0';
private $versaoAtualDesteModulo = '2.4.0';
private $nomeDesteModulo = 'MÓDULO CORREIOS';
private $nomeParametroModulo = 'VERSAO_MODULO_CORREIOS';
private $historicoVersoes = array('1.0.0', '2.0.0', '2.1.0','2.2.0','2.3.0');
private $historicoVersoes = array('1.0.0', '2.0.0', '2.1.0','2.2.0','2.3.0','2.4.0');

public function __construct()
{
Expand Down Expand Up @@ -75,12 +75,13 @@ protected function atualizarVersaoConectado()
//checando BDs suportados
if (!(BancoSEI::getInstance() instanceof InfraMySql) &&
!(BancoSEI::getInstance() instanceof InfraSqlServer) &&
!(BancoSEI::getInstance() instanceof InfraOracle)) {
!(BancoSEI::getInstance() instanceof InfraOracle) &&
!(BancoSEI::getInstance() instanceof InfraPostgreSql)) {
$this->finalizar('BANCO DE DADOS NÃO SUPORTADO: ' . get_parent_class(BancoSEI::getInstance()), true);
}

//testando versao do framework
$numVersaoInfraRequerida = '2.0.18';
$numVersaoInfraRequerida = '2.23.8';
if (version_compare(VERSAO_INFRA, $numVersaoInfraRequerida) < 0) {
$this->finalizar('VERSÃO DO FRAMEWORK PHP INCOMPATÍVEL (VERSÃO ATUAL ' . VERSAO_INFRA . ', SENDO REQUERIDA VERSÃO IGUAL OU SUPERIOR A ' . $numVersaoInfraRequerida . ')', true);
}
Expand Down Expand Up @@ -109,6 +110,8 @@ protected function atualizarVersaoConectado()
$this->instalarv220();
case '2.2.0':
$this->instalarv230();
case '2.3.0':
$this->instalarv240();
break;

default:
Expand Down Expand Up @@ -559,15 +562,19 @@ private function instalarv100()
$tarefaDTO1->setStrSinFecharAndamentosAbertos('S');
$tarefaDTO1->setStrSinLancarAndamentoFechado('N');
$tarefaDTO1->setStrSinPermiteProcessoFechado('N');
$tarefaDTO1->setStrSinConsultaProcessual('N');

if (BancoSEI::getInstance() instanceof InfraMySql) {
BancoSEI::getInstance()->executarSql(" DELETE FROM seq_tarefa");
BancoSEI::getInstance()->executarSql(" INSERT INTO seq_tarefa (id) VALUES (" . $numIdTarefaMax . ") ");
} elseif (BancoSEI::getInstance() instanceof InfraOracle) {
} elseif (BancoSEI::getInstance() instanceof InfraOracle ) {
BancoSEI::getInstance()->executarSql("drop sequence seq_tarefa");
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NOCACHE NOCYCLE");
} else if (BancoSEI::getInstance() instanceof InfraSqlServer) {
BancoSEI::getInstance()->executarSql("TRUNCATE TABLE seq_tarefa; SET IDENTITY_INSERT seq_tarefa ON; INSERT INTO seq_tarefa (id) VALUES (" . $numIdTarefaMax . "); SET IDENTITY_INSERT seq_tarefa OFF;");
} else if( BancoSEI::getInstance() instanceof InfraPostgreSql ){
BancoSEI::getInstance()->executarSql("drop sequence seq_tarefa");
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NO CYCLE");
}

$tarefaRN = new TarefaRN();
Expand All @@ -583,6 +590,7 @@ private function instalarv100()
$tarefaDTO2->setStrSinFecharAndamentosAbertos('S');
$tarefaDTO2->setStrSinLancarAndamentoFechado('N');
$tarefaDTO2->setStrSinPermiteProcessoFechado('N');
$tarefaDTO2->setStrSinConsultaProcessual('N');

$tarefaRN = new TarefaRN();
$tarefaRN->cadastrar($tarefaDTO2);
Expand All @@ -597,6 +605,9 @@ private function instalarv100()
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . ++$idMaxIdTarefa . " INCREMENT BY 1 NOCACHE NOCYCLE");
} else if (BancoSEI::getInstance() instanceof InfraSqlServer) {
BancoSEI::getInstance()->executarSql("TRUNCATE TABLE seq_tarefa; SET IDENTITY_INSERT seq_tarefa ON; INSERT INTO seq_tarefa (id) VALUES (" . ++$idMaxIdTarefa . "); SET IDENTITY_INSERT seq_tarefa OFF;");
} else if( BancoSEI::getInstance() instanceof InfraPostgreSql ){
BancoSEI::getInstance()->executarSql("drop sequence seq_tarefa");
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NO CYCLE");
}

$this->logar('CRIANDO A TABELA md_cor_adm_parametro_ar');
Expand Down Expand Up @@ -801,6 +812,7 @@ private function instalarv100()
$tarefaDTO1->setStrSinFecharAndamentosAbertos('S');
$tarefaDTO1->setStrSinLancarAndamentoFechado('N');
$tarefaDTO1->setStrSinPermiteProcessoFechado('S');
$tarefaDTO1->setStrSinConsultaProcessual('N');

if (BancoSEI::getInstance() instanceof InfraMySql) {
BancoSEI::getInstance()->executarSql(" DELETE FROM seq_tarefa");
Expand All @@ -812,6 +824,10 @@ private function instalarv100()
} else if (BancoSEI::getInstance() instanceof InfraSqlServer) {
BancoSEI::getInstance()->executarSql("TRUNCATE TABLE seq_tarefa; SET IDENTITY_INSERT seq_tarefa ON; INSERT INTO seq_tarefa (id) VALUES (" . $numIdTarefaMax . "); SET IDENTITY_INSERT seq_tarefa OFF;");
}
else if( BancoSEI::getInstance() instanceof InfraPostgreSql ){
BancoSEI::getInstance()->executarSql("drop sequence seq_tarefa");
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NO CYCLE");
}

$tarefaRN = new TarefaRN();
$tarefaRN->cadastrar($tarefaDTO1);
Expand Down Expand Up @@ -945,6 +961,7 @@ private function instalarv100()
$tarefaDTO1->setStrSinFecharAndamentosAbertos('S');
$tarefaDTO1->setStrSinLancarAndamentoFechado('N');
$tarefaDTO1->setStrSinPermiteProcessoFechado('N');
$tarefaDTO1->setStrSinConsultaProcessual('N');

if (BancoSEI::getInstance() instanceof InfraMySql) {
BancoSEI::getInstance()->executarSql(" DELETE FROM seq_tarefa");
Expand All @@ -956,6 +973,10 @@ private function instalarv100()
} else if (BancoSEI::getInstance() instanceof InfraSqlServer) {
BancoSEI::getInstance()->executarSql("TRUNCATE TABLE seq_tarefa; SET IDENTITY_INSERT seq_tarefa ON; INSERT INTO seq_tarefa (id) VALUES (" . $numIdTarefaMax . "); SET IDENTITY_INSERT seq_tarefa OFF;");
}
else if( BancoSEI::getInstance() instanceof InfraPostgreSql ){
BancoSEI::getInstance()->executarSql("drop sequence seq_tarefa");
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NO CYCLE");
}

$tarefaRN = new TarefaRN();
$tarefaRN->cadastrar($tarefaDTO1);
Expand Down Expand Up @@ -995,6 +1016,7 @@ private function instalarv100()
$tarefaDTO2->setStrSinFecharAndamentosAbertos('S');
$tarefaDTO2->setStrSinLancarAndamentoFechado('N');
$tarefaDTO2->setStrSinPermiteProcessoFechado('N');
$tarefaDTO2->setStrSinConsultaProcessual('N');

if (BancoSEI::getInstance() instanceof InfraMySql) {
BancoSEI::getInstance()->executarSql(" DELETE FROM seq_tarefa");
Expand All @@ -1005,6 +1027,9 @@ private function instalarv100()
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NOCACHE NOCYCLE");
} else if (BancoSEI::getInstance() instanceof InfraSqlServer) {
BancoSEI::getInstance()->executarSql("TRUNCATE TABLE seq_tarefa; SET IDENTITY_INSERT seq_tarefa ON; INSERT INTO seq_tarefa (id) VALUES (" . $numIdTarefaMax . "); SET IDENTITY_INSERT seq_tarefa OFF;");
} else if( BancoSEI::getInstance() instanceof InfraPostgreSql ){
BancoSEI::getInstance()->executarSql("drop sequence seq_tarefa");
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NO CYCLE");
}

$tarefaRN = new TarefaRN();
Expand Down Expand Up @@ -1159,6 +1184,7 @@ private function instalarv210()
$tarefaDTO1->setStrSinFecharAndamentosAbertos('S');
$tarefaDTO1->setStrSinLancarAndamentoFechado('N');
$tarefaDTO1->setStrSinPermiteProcessoFechado('N');
$tarefaDTO1->setStrSinConsultaProcessual('N');

if (BancoSEI::getInstance() instanceof InfraMySql) {
BancoSEI::getInstance()->executarSql(" DELETE FROM seq_tarefa");
Expand All @@ -1168,6 +1194,9 @@ private function instalarv210()
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NOCACHE NOCYCLE");
} else if (BancoSEI::getInstance() instanceof InfraSqlServer) {
BancoSEI::getInstance()->executarSql("TRUNCATE TABLE seq_tarefa; SET IDENTITY_INSERT seq_tarefa ON; INSERT INTO seq_tarefa (id) VALUES (" . $numIdTarefaMax . "); SET IDENTITY_INSERT seq_tarefa OFF;");
} else if( BancoSEI::getInstance() instanceof InfraPostgreSql ){
BancoSEI::getInstance()->executarSql("drop sequence seq_tarefa");
BancoSEI::getInstance()->executarSql("CREATE SEQUENCE seq_tarefa START WITH " . $numIdTarefaMax . " INCREMENT BY 1 NO CYCLE");
}

$tarefaRN = new TarefaRN();
Expand Down Expand Up @@ -1255,6 +1284,7 @@ protected function instalarv220(){
}

protected function instalarv230(){

$nmVersao = '2.3.0';
$objInfraParametro = new InfraParametro(BancoSEI::getInstance());
$this->logar('EXECUTANDO A INSTALAÇÃO/ATUALIZAÇÃO DA VERSAO '. $nmVersao .' DO ' . $this->nomeDesteModulo . ' NA BASE DO SEI');
Expand Down Expand Up @@ -1444,7 +1474,7 @@ protected function instalarv230(){

// Drop na tabela md_cor_parametro_rastreio
$this->logar('Remover a sequence e tabela md_cor_parametro_rastreio');
if (BancoSEI::getInstance() instanceof InfraOracle) {
if (BancoSEI::getInstance() instanceof InfraOracle || BancoSEI::getInstance() instanceof InfraPostgreSql ) {
BancoSEI::getInstance()->executarSql('drop sequence seq_md_cor_parametro_rastreio');
} else {
BancoSEI::getInstance()->executarSql('DROP TABLE seq_md_cor_parametro_rastreio');
Expand All @@ -1459,6 +1489,12 @@ protected function instalarv230(){
$this->atualizarNumeroVersao($nmVersao);
}

protected function instalarv240() {
$nmVersao = '2.4.0';
$this->logar('EXECUTANDO A INSTALAÇÃO/ATUALIZAÇÃO DA VERSAO '. $nmVersao .' DO ' . $this->nomeDesteModulo . ' NA BASE DO SEI');
$this->atualizarNumeroVersao($nmVersao);
}

protected function fixIndices(InfraMetaBD $objInfraMetaBD, $arrTabelas)
{
InfraDebug::getInstance()->setBolDebugInfra(true);
Expand Down
2 changes: 1 addition & 1 deletion sei/web/modulos/correios/CorreiosIntegracao.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function getNome()

public function getVersao()
{
return '2.3.0';
return '2.4.0';
}

public function getInstituicao()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@

$strLinkMontarArvore = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=procedimento_visualizar&acao_origem='.$_GET["acao"].'&montar_visualizacao=1&arvore=1&id_procedimento='.$arrObjProtocoloDTO[0]->getDblIdProcedimentoDocumento() .'&id_documento='.$_POST['id_doc']);
echo "<script>";
echo "window.parent.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.0.12
//echo "window.top.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.1.2
//echo "window.parent.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.0.12
echo "window.top.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.1.*
echo "</script>";
}

Expand Down Expand Up @@ -418,8 +418,8 @@
$strLinkMontarArvore = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=procedimento_visualizar&acao_origem='.$_GET["acao"].'&montar_visualizacao=1&arvore=1&id_procedimento='.$arrObjProtocoloDTO[0]->getDblIdProcedimentoDocumento() .'&id_documento='.$_POST['id_doc']);

echo "<script>";
echo "window.parent.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.0.12
//echo "window.top.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.1.2
//echo "window.parent.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.0.12
echo "window.top.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.1.*
echo "</script>";
break;

Expand Down Expand Up @@ -596,8 +596,8 @@
$arrObjProtocoloDTO = $objProtocoloRN->pesquisarRN0967($objPesquisaProtocoloDTO);
$strLinkMontarArvore = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=procedimento_visualizar&acao_origem='.$_GET["acao"].'&montar_visualizacao=1&arvore=1&id_procedimento='.$arrObjProtocoloDTO[0]->getDblIdProcedimentoDocumento() .'&id_documento='.$_POST['id_doc']);
echo "<script>";
echo "window.parent.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.0.12
//echo "window.top.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.1.2
//echo "window.parent.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.0.12
echo "window.top.document.getElementById('ifrArvore').src = '".$strLinkMontarArvore."';"; // 4.1.*
echo "</script>";

break;
Expand Down Expand Up @@ -720,8 +720,8 @@

echo "<script>";
echo "function atualizarTela() {";
echo "window.parent.document.getElementById('ifrArvore').src = '".$link."';"; // 4.0.12
//echo "window.top.document.getElementById('ifrArvore').src = '".$link."';"; // 4.1.2
//echo "window.parent.document.getElementById('ifrArvore').src = '".$link."';"; // 4.0.12
echo "window.top.document.getElementById('ifrArvore').src = '".$link."';"; // 4.1.*
echo "}";
echo "</script>";
}
Expand Down
2 changes: 1 addition & 1 deletion sei/web/modulos/correios/md_cor_retorno_ar_cadastro.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function verificarDocumentoExpedicao($numIdDocumentoPrincipal)
$objProtocoloDocPrincipalDTO = $objProtocoloDocPrincipalRN->consultarRN0186($objProtocoloDocPrincipalDTO);

$objInfraParametro = new InfraParametro(BancoSEI::getInstance());
$strValor = $objInfraParametro->getValor('MODULO_CORREIOS_ID_DOCUMENTO_EXPEDICAO');
$strValor = $objInfraParametro->getValor('MODULO_CORREIOS_ID_DOCUMENTO_EXPEDICAO',false);

if (!empty($strValor) && !is_null($objProtocoloDocPrincipalDTO)) {
$arrIdSerieDocumento = explode(',', $strValor);
Expand Down
18 changes: 14 additions & 4 deletions sip/scripts/sip_atualizar_versao_modulo_correios.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class MdCorAtualizadorSipRN extends InfraRN
{

private $numSeg = 0;
private $versaoAtualDesteModulo = '2.3.0';
private $versaoAtualDesteModulo = '2.4.0';
private $nomeDesteModulo = 'MÓDULO DOS CORREIOS';
private $nomeParametroModulo = 'VERSAO_MODULO_CORREIOS';
private $historicoVersoes = array('1.0.0', '2.0.0', '2.1.0','2.2.0','2.3.0');
private $historicoVersoes = array('1.0.0', '2.0.0', '2.1.0','2.2.0','2.3.0','2.4.0');

public function __construct()
{
Expand Down Expand Up @@ -75,12 +75,13 @@ protected function atualizarVersaoConectado()
//checando BDs suportados
if (!(BancoSip::getInstance() instanceof InfraMySql) &&
!(BancoSip::getInstance() instanceof InfraSqlServer) &&
!(BancoSip::getInstance() instanceof InfraOracle)) {
!(BancoSip::getInstance() instanceof InfraOracle) &&
!(BancoSip::getInstance() instanceof InfraPostgreSql)) {
$this->finalizar('BANCO DE DADOS NÃO SUPORTADO: ' . get_parent_class(BancoSip::getInstance()), true);
}

//testando versao do framework
$numVersaoInfraRequerida = '2.0.18';
$numVersaoInfraRequerida = '2.23.8';
if (version_compare(VERSAO_INFRA, $numVersaoInfraRequerida) < 0) {
$this->finalizar('VERSÃO DO FRAMEWORK PHP INCOMPATÍVEL (VERSÃO ATUAL ' . VERSAO_INFRA . ', SENDO REQUERIDA VERSÃO IGUAL OU SUPERIOR A ' . $numVersaoInfraRequerida . ')', true);
}
Expand Down Expand Up @@ -109,6 +110,8 @@ protected function atualizarVersaoConectado()
$this->instalarv220();
case '2.2.0':
$this->instalarv230();
case '2.3.0':
$this->instalarv240();
break;

default:
Expand Down Expand Up @@ -171,6 +174,7 @@ protected function instalarv100()
$objPerfilExpedicaoDTO->setStrDescricao($dsPerfilExpedicao);
$objPerfilExpedicaoDTO->setStrSinCoordenado('N');
$objPerfilExpedicaoDTO->setStrSinAtivo('S');
$objPerfilExpedicaoDTO->setStrSin2Fatores('N');
$objPerfilRN->cadastrar($objPerfilExpedicaoDTO);

$objPerfilDTO = new PerfilDTO();
Expand Down Expand Up @@ -805,6 +809,12 @@ protected function instalarv230(){
$this->atualizarNumeroVersao($nmVersao);
}

protected function instalarv240() {
$nmVersao = '2.4.0';
$this->logar('EXECUTANDO A INSTALAÇÃO/ATUALIZAÇÃO DA VERSÃO ' . $nmVersao . ' DO ' . $this->nomeDesteModulo . ' NA BASE DO SIP');
$this->atualizarNumeroVersao($nmVersao);
}

/**
* Atualiza o número de versão do módulo na tabela de parâmetro do sistema
*
Expand Down

0 comments on commit b653dfc

Please sign in to comment.