diff --git a/rn/ExpedirProcedimentoRN.php b/rn/ExpedirProcedimentoRN.php index 7d39d5d..68d290f 100644 --- a/rn/ExpedirProcedimentoRN.php +++ b/rn/ExpedirProcedimentoRN.php @@ -395,11 +395,11 @@ class ExpedirProcedimentoRN extends InfraRN { $objProcesso->descricao = utf8_encode($objProcedimentoDTO->getStrDescricaoProtocolo()); $objProcesso->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($objProcedimentoDTO->getDtaGeracaoProtocolo()); - if($this->obterNivelSigiloPEN($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo()) == self::$STA_SIGILO_RESTRITO){ + if($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_RESTRITO){ $objProcesso->hipoteseLegal = new stdClass(); $objProcesso->hipoteseLegal->identificacao = $objPenRelHipoteseLegalRN->getIdHipoteseLegalPEN($objProcedimentoDTO->getNumIdHipoteseLegalProtocolo()); - $objProcesso->hipoteseLegal->nome = 'Nomee'; - $objProcesso->hipoteseLegal->baseLegal = 'Base Legall'; + // $objProcesso->hipoteseLegal->nome = 'Nomee'; + // $objProcesso->hipoteseLegal->baseLegal = 'Base Legall'; } @@ -851,15 +851,16 @@ class ExpedirProcedimentoRN extends InfraRN { $documento->ordem = $ordemDocumento++; $documento->descricao = utf8_encode($strDescricaoDocumento); $documento->nivelDeSigilo = $this->obterNivelSigiloPEN($documentoDTO->getStrStaNivelAcessoLocalProtocolo()); - $documento->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($documentoDTO->getDtaGeracaoProtocolo()); - - if($this->obterNivelSigiloPEN($documentoDTO->getStrStaNivelAcessoLocalProtocolo()) == self::$STA_SIGILO_RESTRITO){ + + if($documentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ + $documento->hipoteseLegal = new stdClass(); $documento->hipoteseLegal->identificacao = $objPenRelHipoteseLegalRN->getIdHipoteseLegalPEN($documentoDTO->getNumIdHipoteseLegalProtocolo()); - $documento->hipoteseLegal->nome = 'Nomee'; - $documento->hipoteseLegal->baseLegal = 'Base Legall'; + // $documento->hipoteseLegal->nome = 'Nomee'; + // $documento->hipoteseLegal->baseLegal = 'Base Legall'; } - + $documento->dataHoraDeProducao = $this->objProcessoEletronicoRN->converterDataWebService($documentoDTO->getDtaGeracaoProtocolo()); + $usuarioDTO = $this->consultarUsuario($documentoDTO->getNumIdUsuarioGeradorProtocolo()); if(isset($usuarioDTO)) { $documento->produtor = new stdClass(); diff --git a/rn/ReceberProcedimentoRN.php b/rn/ReceberProcedimentoRN.php index e24a857..1e24643 100644 --- a/rn/ReceberProcedimentoRN.php +++ b/rn/ReceberProcedimentoRN.php @@ -581,12 +581,19 @@ class ReceberProcedimentoRN extends InfraRN if($this->obterNivelSigiloSEI($objProcesso->nivelDeSigilo) == ProtocoloRN::$NA_RESTRITO){ $objHipoteseLegalRecebido = new PenRelHipoteseLegalRecebidoRN(); - $numIdHipoteseLegal = $objHipoteseLegalRecebido->getIdHipoteseLegalSEI($objProcesso->hipoteseLegal->identificacao); - if (empty($numIdHipoteseLegal)) { - $objPenParametroRN = new PenParametroRN(); - $objProtocoloDTO->setNumIdHipoteseLegal($objPenParametroRN->getParametro('HIPOTESE_LEGAL_PADRAO')); + $objPenParametroRN = new PenParametroRN(); + $numIdHipoteseLegalPadrao = $objPenParametroRN->getParametro('HIPOTESE_LEGAL_PADRAO'); + + if (!isset($objProcesso->hipoteseLegal) || (isset($objProcesso->hipoteseLegal) && empty($objProcesso->hipoteseLegal->identificacao))) { + $objProtocoloDTO->setNumIdHipoteseLegal($numIdHipoteseLegalPadrao); } else { - $objProtocoloDTO->setNumIdHipoteseLegal($numIdHipoteseLegal); + + $numIdHipoteseLegal = $objHipoteseLegalRecebido->getIdHipoteseLegalSEI($objProcesso->hipoteseLegal->identificacao); + if (empty($numIdHipoteseLegal)) { + $objProtocoloDTO->setNumIdHipoteseLegal($numIdHipoteseLegalPadrao); + } else { + $objProtocoloDTO->setNumIdHipoteseLegal($numIdHipoteseLegal); + } } } @@ -1117,12 +1124,19 @@ class ReceberProcedimentoRN extends InfraRN if ($this->obterNivelSigiloSEI($objDocumento->nivelDeSigilo) == ProtocoloRN::$NA_RESTRITO) { $objHipoteseLegalRecebido = new PenRelHipoteseLegalRecebidoRN(); - $numIdHipoteseLegal = $objHipoteseLegalRecebido->getIdHipoteseLegalSEI($objDocumento->hipoteseLegal->identificacao); - if (empty($numIdHipoteseLegal)) { - $objPenParametroRN = new PenParametroRN(); - $objDocumentoDTO->getObjProtocoloDTO()->setNumIdHipoteseLegal($objPenParametroRN->getParametro('HIPOTESE_LEGAL_PADRAO')); + $objPenParametroRN = new PenParametroRN(); + $numIdHipoteseLegalPadrao = $objPenParametroRN->getParametro('HIPOTESE_LEGAL_PADRAO'); + + if (!isset($objDocumento->hipoteseLegal) || (isset($objDocumento->hipoteseLegal) && empty($objDocumento->hipoteseLegal->identificacao))) { + $objDocumentoDTO->getObjProtocoloDTO()->setNumIdHipoteseLegal($numIdHipoteseLegalPadrao); } else { - $objDocumentoDTO->getObjProtocoloDTO()->setNumIdHipoteseLegal($numIdHipoteseLegal); + + $numIdHipoteseLegal = $objHipoteseLegalRecebido->getIdHipoteseLegalSEI($objDocumento->hipoteseLegal->identificacao); + if (empty($numIdHipoteseLegal)) { + $objDocumentoDTO->getObjProtocoloDTO()->setNumIdHipoteseLegal($numIdHipoteseLegalPadrao); + } else { + $objDocumentoDTO->getObjProtocoloDTO()->setNumIdHipoteseLegal($numIdHipoteseLegal); + } } } -- libgit2 0.21.2