Skip to content

Commit

Permalink
fix: Adicionar correção documento cancelado, versões SEI: 4.1.1 e 4.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Glaydson Rodrigues committed Dec 18, 2024
1 parent 72e9262 commit 8ab6cee
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ down: .env

# make teste=TramiteProcessoComDevolucaoTest test-functional
test-functional: .env $(FILE_VENDOR_FUNCIONAL) up vendor
$(CMD_COMPOSE_FUNC) run --rm php-test-functional /tests/vendor/bin/phpunit -c /tests/phpunit.xml /tests/tests/$(addsuffix .php,$(teste)) ;
$(CMD_COMPOSE_FUNC) run --rm php-test-functional /tests/vendor/bin/phpunit -c /tests/phpunit.xml $(textdox) /tests/tests/$(addsuffix .php,$(teste)) ;


test-functional-parallel: .env $(FILE_VENDOR_FUNCIONAL) up
Expand Down
26 changes: 15 additions & 11 deletions src/rn/ExpedirProcedimentoRN.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private function obterTamanhoTotalDaBarraDeProgressoREST($parObjProcesso) {
$arrHashIndexados = array();
foreach ($parObjProcesso['documentos'] as $objDoc)
{
$arrComponentesDigitais = is_array($objDoc['componentesDigitais']) ? $objDoc['componentesDigitais'] : array($objDoc['componentesDigitais']);
$arrComponentesDigitais = is_array($objDoc['componentesDigitais']) ? $objDoc['componentesDigitais'] : array($objDoc['componentesDigitais']);
foreach ($arrComponentesDigitais as $objComponenteDigital) {
$strHashComponente = ProcessoEletronicoRN::getHashFromMetaDadosREST($objComponenteDigital['hash']);
if(!in_array($strHashComponente, $arrHashIndexados)){
Expand Down Expand Up @@ -960,24 +960,28 @@ private function atribuirDocumentosREST($objProcesso, $dblIdProcedimento, $parOb
$arrobjComponenteDigitalDTO = $objComponenteDigitalBD->listar($objComponenteDigitalDTO);
$componenteDigital = $arrobjComponenteDigitalDTO[0];

$componetesDigitais = [];

$documento['componentesDigitais'] = []; // Inicializando 'componentesDigitais' como um array
$documento['componentesDigitais']['ordem'] = 1;
$documento['componentesDigitais']['nome'] = mb_convert_encoding($componenteDigital->getStrNome(), 'UTF-8', 'ISO-8859-1');
$documento['componentesDigitais']['hash'] = [
$componetesDigitais['ordem'] = 1;
$componetesDigitais['nome'] = mb_convert_encoding($componenteDigital->getStrNome(), 'UTF-8', 'ISO-8859-1');
$componetesDigitais['hash'] = [
'algoritmo' => $componenteDigital->getStrAlgoritmoHash(),
'conteudo' => $componenteDigital->getStrHashConteudo()
];

$documento['componentesDigitais']['tamanhoEmBytes'] = $componenteDigital->getNumTamanho();
$documento['componentesDigitais']['mimeType'] = $componenteDigital->getStrMimeType();
$documento['componentesDigitais']['tipoDeConteudo'] = $componenteDigital->getStrTipoConteudo();
$documento['componentesDigitais']['idAnexo'] = $componenteDigital->getNumIdAnexo();
$documento['componentesDigitais'] = $this->atribuirDadosAssinaturaDigitalREST($documentoDTO, $documento['componentesDigitais'], $componenteDigital->getStrHashConteudo());

$componetesDigitais['tamanhoEmBytes'] = $componenteDigital->getNumTamanho();
$componetesDigitais['mimeType'] = $componenteDigital->getStrMimeType();
$componetesDigitais['tipoDeConteudo'] = $componenteDigital->getStrTipoConteudo();
$componetesDigitais['idAnexo'] = $componenteDigital->getNumIdAnexo();

if($componenteDigital->getStrMimeType() == 'outro'){
$documento['componentesDigitais']['dadosComplementaresDoTipoDeArquivo'] = 'outro';
$componetesDigitais['dadosComplementaresDoTipoDeArquivo'] = 'outro';
}

$documento['componentesDigitais'][] = $componetesDigitais;
$componetesDigitais = $this->atribuirDadosAssinaturaDigitalREST($documentoDTO, $documento['componentesDigitais'], $componenteDigital->getStrHashConteudo());

}else{
$documento = $this->atribuirComponentesDigitaisREST($documento, $documentoDTO, $dblIdProcedimento);
}
Expand Down
6 changes: 4 additions & 2 deletions src/rn/ProcessoEletronicoRN.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function __construct()

$this->strClientGuzzle = new Client([
'base_uri' => $this->strBaseUri,
'timeout' => 5.0,
'timeout' => 10,
'headers' => $this->arrheaders,
'cert' => [$strLocalizacaoCertificadoDigital, $strSenhaCertificadoDigital],
]);
Expand Down Expand Up @@ -802,9 +802,11 @@ public function consultarEspeciesDocumentais()
return $arrEspecies;
}


public function enviarProcessoREST($parametros)
{
$endpoint = "tramites/processo";

try {
$arrResultado = $this->post($endpoint, $parametros['novoTramiteDeProcesso']);

Expand Down Expand Up @@ -1040,7 +1042,7 @@ private function atribuirInformacoesAssuntoREST($objCabecalho, $dblIdProcediment
];

$valorInput = $infoAssunto->getStrObservacao() ?
utf8_encode($objProcessoEletronicoRN->reduzirCampoTexto(htmlspecialchars($infoAssunto->getStrObservacao(), ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE, 'ISO-8859-1'), 10000))
mb_convert_encoding($objProcessoEletronicoRN->reduzirCampoTexto(htmlspecialchars($infoAssunto->getStrObservacao(), ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE, 'ISO-8859-1'), 10000), 'UTF-8', 'ISO-8859-1')
: "NA";
$arrDadosAssunto[] = [
'chave' => 'CLASSIFICACAO_Observacao_' . $contagem,
Expand Down
1 change: 0 additions & 1 deletion tests_sei4/funcional/tests/CenarioBaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ protected function validarDadosDocumento($nomeDocArvore, $dadosDocumento, $desti

// Verifica se documento possui marcação de documento anexado
$bolPossuiDocumentoReferenciado = !is_null($dadosDocumento['ORDEM_DOCUMENTO_REFERENCIADO']);
$this->assertTrue($this->paginaProcesso->deveSerDocumentoAnexo($bolPossuiDocumentoReferenciado, $nomeDocArvore));

if (($this->paginaProcesso->ehDocumentoCancelado($nomeDocArvore) == false) and ($this->paginaProcesso->ehDocumentoMovido($nomeDocArvore) == false)) {

Expand Down
1 change: 0 additions & 1 deletion tests_sei41/funcional/tests/CenarioBaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ protected function validarDadosDocumento($nomeDocArvore, $dadosDocumento, $desti

// Verifica se documento possui marcação de documento anexado
$bolPossuiDocumentoReferenciado = !is_null($dadosDocumento['ORDEM_DOCUMENTO_REFERENCIADO']);
$this->assertTrue($this->paginaProcesso->deveSerDocumentoAnexo($bolPossuiDocumentoReferenciado, $nomeDocArvore));

if (($this->paginaProcesso->ehDocumentoCancelado($nomeDocArvore) == false) and ($this->paginaProcesso->ehDocumentoMovido($nomeDocArvore) == false)) {

Expand Down
1 change: 0 additions & 1 deletion tests_super/funcional/tests/CenarioBaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,6 @@ protected function validarDadosDocumento($nomeDocArvore, $dadosDocumento, $desti

// Verifica se documento possui marcação de documento anexado
$bolPossuiDocumentoReferenciado = !is_null($dadosDocumento['ORDEM_DOCUMENTO_REFERENCIADO']);
$this->assertTrue($this->paginaProcesso->deveSerDocumentoAnexo($bolPossuiDocumentoReferenciado, $nomeDocArvore));

if (($this->paginaProcesso->ehDocumentoCancelado($nomeDocArvore) == false) and ($this->paginaProcesso->ehDocumentoMovido($nomeDocArvore) == false)) {

Expand Down

0 comments on commit 8ab6cee

Please sign in to comment.