Skip to content

Commit

Permalink
348 criar críticas para impedir desativar ou excluir tipos de hipotes…
Browse files Browse the repository at this point in the history
…es legais (#521)

* refactor: adicionando travas de exclusao nos mapeamentos de hipotese legal do modulo PEN

* feat: corrigido consulta de uso da hipotese; adicionado tratamento pra hipotese de envio e recebimento

* feat: critica para hipotese legal

Criatica para não desativar ou excluir hipotese legal vinculada ao tramita

* feat: correção de query hipostes legais

* feat: correção teste funcional e pen_expedir_lote para bloco

---------

Co-authored-by: Paul Richard <[email protected]>
Co-authored-by: Mauro Costa <[email protected]>
  • Loading branch information
3 people authored Jun 20, 2024
1 parent c5691bc commit c391e2f
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/pen_map_unidade_cadastrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
<?php print InfraINT::montarSelectArray('', 'Selecione', $objPenUnidadeDTO->getNumIdUnidade(), $arrMapIdUnidade); ?>
</select>

<label id="lblUnidadePen" for="txtUnidadePen" class="infraLabelObrigatorio">Unidades do PEN (Estruturas Organizacionais):</label>
<label id="lblUnidadePen" for="txtUnidadePen" class="infraLabelObrigatorio">Unidades do Tramita GOV.BR (Estruturas Organizacionais):</label>
<input type="text" id="txtUnidadePen" name="txtUnidadePen" class="infraText infraReadOnly <?php echo $classMarcacao; ?>" value="<?= PaginaSEI::tratarHTML($strNomeUnidadeSelecionada); ?>" tabindex=""/>
<button id="btnUnidadeRh2" type="button" class="infraButton">Pesquisar</button>
<input type="hidden" id="hdnUnidadeRh" name="id_unidade_rh" value="<?php echo PaginaSEI::tratarHTML($objPenUnidadeDTO->getNumIdUnidadeRH()); ?>" />
Expand Down
2 changes: 1 addition & 1 deletion src/rn/PenBlocoProcessoRN.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function obterPendenciasLoteControlado(PenBlocoProcessoDTO $objPenLote
try {

//Valida PermissãoTipo
SessaoSEI::getInstance()->validarAuditarPermissao('pen_expedir_lote', __METHOD__, $objPenLoteProcedimentoDTO);
SessaoSEI::getInstance()->validarAuditarPermissao('pen_expedir_bloco', __METHOD__, $objPenLoteProcedimentoDTO);

//Obter todos os processos pendentes antes de iniciar o monitoramento
$arrObjPendenciasLoteDTO = $this->listar($objPenLoteProcedimentoDTO) ?: array();
Expand Down
2 changes: 1 addition & 1 deletion src/rn/PenExpedirLoteRN.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function cadastrarLoteControlado(PenBlocoProcessoDTO $objPenBlocoProce
{
try {
//Valida Permissão
SessaoSEI::getInstance()->validarAuditarPermissao('pen_expedir_lote', __METHOD__, $objPenBlocoProcessoDTO);
SessaoSEI::getInstance()->validarAuditarPermissao('pen_expedir_bloco', __METHOD__, $objPenBlocoProcessoDTO);

$this->barraProgresso->exibir();
$this->barraProgresso->setStrRotulo(ProcessoEletronicoINT::TEE_EXPEDICAO_ETAPA_VALIDACAO);
Expand Down
17 changes: 0 additions & 17 deletions src/rn/PenHipoteseLegalRN.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,6 @@ protected function listarConectado(PenHipoteseLegalDTO $objDTO)
}
}

/**
* Consultar hipotese legal
*
* @param PenHipoteseLegalDTO $objDTO
* @return PenHipoteseLegalDTO
* @throws InfraException
*/
protected function consultarControlado(PenHipoteseLegalDTO $objDTO)
{
try {
$objBD = new GenericoBD($this->inicializarObjInfraIBanco());
return $objBD->consultar($objDTO);
} catch (Exception $e) {
throw new InfraException('Erro consultando hipotese legal.', $e);
}
}

protected function consultarConectado(PenHipoteseLegalDTO $objDTO)
{
try {
Expand Down
1 change: 1 addition & 0 deletions src/scripts/sip_atualizar_versao_modulo_pen.php
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,7 @@ protected function instalarV3070()
$idMenuProcessoTramitadosExterno = $this->criarMenu('Processos em Tramitação Externa', 57, $idMenuTramita, $numIdMenu, $numIdRecurso, $numIdSistema);
$this->cadastrarRelPergilItemMenu($idPerfilAdm, $numIdRecurso, $numIdMenu, $idMenuProcessoTramitadosExterno);

$this->renomearRecurso($numIdSistema, 'pen_expedir_lote', 'pen_expedir_bloco');

$this->atualizarNumeroVersao("3.7.0");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,24 @@ public function test_tramitar_processo_anexado_da_origem()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(10);
} else {
Expand Down
19 changes: 18 additions & 1 deletion tests_sei4/funcional/tests/TramiteBlocoExternoLimiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,24 @@ public function teste_tramite_bloco_externo()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(5);

Expand Down
19 changes: 18 additions & 1 deletion tests_sei4/funcional/tests/TramiteBlocoExternoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,24 @@ public function teste_tramite_bloco_externo()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,24 @@ public function test_tramitar_processo_anexado_da_origem()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(10);
} else {
Expand Down
19 changes: 18 additions & 1 deletion tests_sei41/funcional/tests/TramiteBlocoExternoLimiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,24 @@ public function teste_tramite_bloco_externo()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(5);

Expand Down
19 changes: 18 additions & 1 deletion tests_sei41/funcional/tests/TramiteBlocoExternoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,24 @@ public function teste_tramite_bloco_externo()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,24 @@ public function test_tramitar_processo_anexado_da_origem()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(10);
} else {
Expand Down
19 changes: 18 additions & 1 deletion tests_super/funcional/tests/TramiteBlocoExternoLimiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,24 @@ public function teste_tramite_bloco_externo()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(5);

Expand Down
19 changes: 18 additions & 1 deletion tests_super/funcional/tests/TramiteBlocoExternoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,24 @@ public function teste_tramite_bloco_externo()
$this->paginaCadastrarProcessoEmBloco->bntTramitarBloco();
$this->paginaCadastrarProcessoEmBloco->tramitarProcessoExternamente(
self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'],
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false
self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false,
function ($testCase) {
try {
$testCase->frame('ifrEnvioProcesso');
$mensagemSucesso = utf8_encode('Processo(s) aguardando envio. Favor acompanhar a tramitação por meio do bloco, na funcionalidade \'Blocos de Trâmite Externo\'');
$testCase->assertStringContainsString($mensagemSucesso, $testCase->byCssSelector('body')->text());
$btnFechar = $testCase->byXPath("//input[@id='btnFechar']");
$btnFechar->click();
} finally {
try {
$testCase->frame(null);
$testCase->frame("ifrVisualizacao");
} catch (Exception $e) {
}
}

return true;
}
);
sleep(10);

Expand Down

0 comments on commit c391e2f

Please sign in to comment.