Commit f20f64518d51f54119417267b58c2b0e61f2eebe
1 parent
eb2672ac
Exists in
master
and in
1 other branch
Tratando parametro vazio na busca do retorno programado
Showing
1 changed file
with
17 additions
and
15 deletions
Show diff stats
rn/MdWsSeiProcedimentoRN.php
... | ... | @@ -426,24 +426,26 @@ class MdWsSeiProcedimentoRN extends InfraRN { |
426 | 426 | return $result; |
427 | 427 | } |
428 | 428 | |
429 | - private function checaRetornoProgramado($atividade){ | |
429 | + private function checaRetornoProgramado($atividade=null){ | |
430 | 430 | $retProgramado = 'N'; |
431 | 431 | $expirado = 'N'; |
432 | 432 | |
433 | - if ($atividade instanceof AtividadeDTO) { | |
434 | - $retornoProgramadoRN = new RetornoProgramadoRN(); | |
435 | - $retornoProgramadoDTO = new RetornoProgramadoDTO(); | |
436 | - $retornoProgramadoDTO->adicionarCriterio( | |
437 | - array('IdAtividadeEnvio', 'IdAtividadeRetorno'), | |
438 | - array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IGUAL), | |
439 | - array($atividade->getNumIdAtividade(), null) | |
440 | - ); | |
441 | - $retornoProgramadoDTO = $retornoProgramadoRN->consultar($retornoProgramadoDTO); | |
442 | - | |
443 | - if ($retornoProgramadoDTO) { | |
444 | - echo 556; | |
445 | - $expirado = ($retornoProgramadoDTO->getDtaProgramada() < new Datetime()); | |
446 | - $retProgramado = 'S'; | |
433 | + if(isset($atividade) && !empty($atividade)) { | |
434 | + if ($atividade instanceof AtividadeDTO) { | |
435 | + $retornoProgramadoRN = new RetornoProgramadoRN(); | |
436 | + $retornoProgramadoDTO = new RetornoProgramadoDTO(); | |
437 | + $retornoProgramadoDTO->adicionarCriterio( | |
438 | + array('IdAtividadeEnvio', 'IdAtividadeRetorno'), | |
439 | + array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IGUAL), | |
440 | + array($atividade->getNumIdAtividade(), null) | |
441 | + ); | |
442 | + $retornoProgramadoDTO = $retornoProgramadoRN->consultar($retornoProgramadoDTO); | |
443 | + | |
444 | + if ($retornoProgramadoDTO) { | |
445 | + echo 556; | |
446 | + $expirado = ($retornoProgramadoDTO->getDtaProgramada() < new Datetime()); | |
447 | + $retProgramado = 'S'; | |
448 | + } | |
447 | 449 | } |
448 | 450 | } |
449 | 451 | ... | ... |