PenRelHipoteseLegalRecebidoRN.php
2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
require_once dirname(__FILE__) . '/../../../SEI.php';
/**
* Description of PenRelHipoteseLegalEnvioRN
*
* @author michael
*/
class PenRelHipoteseLegalRecebidoRN extends PenRelHipoteseLegalRN {
public function listar(PenRelHipoteseLegalDTO $objDTO) {
SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebimento_listar', __METHOD__, $objDTO);
return parent::listarConectado($objDTO);
}
public function alterar(PenRelHipoteseLegalDTO $objDTO) {
SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebimento_alterar', __METHOD__, $objDTO);
return parent::alterarConectado($objDTO);
}
public function cadastrar(PenRelHipoteseLegalDTO $objDTO) {
SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebimento_cadastrar', __METHOD__, $objDTO);
return parent::cadastrarConectado($objDTO);
}
public function excluir(PenRelHipoteseLegalDTO $objDTO) {
SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebimento_excluir', __METHOD__, $objDTO);
return parent::excluirConectado($objDTO);
}
/**
* Pega o ID hipotese PEN para buscar o ID do SEI
* @param integer $numIdentificacao
* @return integer
*/
public function getIdHipoteseLegalSEI($numIdentificacao) {
$objBanco = BancoSEI::getInstance();
$objGenericoBD = new GenericoBD($objBanco);
$objPenHipoteseLegalDTO = new PenHipoteseLegalDTO();
$objPenHipoteseLegalDTO->setNumIdentificacao($numIdentificacao);
$objPenHipoteseLegalDTO->retNumIdHipoteseLegal();
$objPenHipoteseLegalDTO = $objGenericoBD->consultar($objPenHipoteseLegalDTO);
if ($objPenHipoteseLegalDTO) {
// Mapeamento da hipotese legal remota
$objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO();
$objPenRelHipoteseLegalDTO->setStrTipo('R');
$objPenRelHipoteseLegalDTO->retNumIdHipoteseLegal();
$objPenRelHipoteseLegalDTO->setNumIdBarramento($objPenHipoteseLegalDTO->getNumIdHipoteseLegal());
$objPenRelHipoteseLegal = $objGenericoBD->consultar($objPenRelHipoteseLegalDTO);
if ($objPenRelHipoteseLegal) {
return $objPenRelHipoteseLegal->getNumIdHipoteseLegal();
} else {
return null;
}
} else {
return null;
}
}
}