diff --git a/src/Cacic/CommonBundle/Entity/ComputadorColetaRepository.php b/src/Cacic/CommonBundle/Entity/ComputadorColetaRepository.php index b9c9eab..39f4df7 100644 --- a/src/Cacic/CommonBundle/Entity/ComputadorColetaRepository.php +++ b/src/Cacic/CommonBundle/Entity/ComputadorColetaRepository.php @@ -100,7 +100,7 @@ class ComputadorColetaRepository extends EntityRepository { $_dql = "SELECT c FROM CacicCommonBundle:Classe c - WHERE c.nmClassName NOT IN ('SoftwareList', 'Patrimonio') + WHERE c.nmClassName NOT IN ('SoftwareList') ORDER BY c.nmClassName"; $_dql = $this->getEntityManager()->createQuery( $_dql ); diff --git a/src/Cacic/WSBundle/Controller/ColetaController.php b/src/Cacic/WSBundle/Controller/ColetaController.php index 32a7d2d..4e6ef79 100644 --- a/src/Cacic/WSBundle/Controller/ColetaController.php +++ b/src/Cacic/WSBundle/Controller/ColetaController.php @@ -58,10 +58,18 @@ class ColetaController extends Controller //$ultimo_login = TagValueHelper::getValueFromTags( 'UserName' , $strComputerSystem); $grava_teste = ''; + // Caso não tenha encontrado, tenta pegar a variável da requisição + if (empty($te_node_address)) { + $te_node_adress = $request->get('te_node_address'); + } + //vefifica se existe SO coletado se não, insere novo SO $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->findOneBy( array('teSo'=>$te_so) ); $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->findOneBy( array('idSo'=>$so, 'teNodeAddress'=>$te_node_adress) ); $netmask = TagValueHelper::getValueFromTags( 'IPSubnet', $strNetworkAdapterConfiguration ); + if (empty($netmask)) { + $netmask = $request->get('netmask'); + } $ip_computador = $request->get('te_ip_computador'); if ( empty($ip_computador) ){ $ip_computador = TagValueHelper::getValueFromTags( 'IPAddress', $strNetworkAdapterConfiguration ); diff --git a/src/Cacic/WSBundle/Controller/DefaultController.php b/src/Cacic/WSBundle/Controller/DefaultController.php index b635f3a..310779b 100755 --- a/src/Cacic/WSBundle/Controller/DefaultController.php +++ b/src/Cacic/WSBundle/Controller/DefaultController.php @@ -96,6 +96,15 @@ class DefaultController extends Controller #$logger->debug("333333333333333333333333333333333333: $ip_computador"); $logger->debug("Teste de Conexão! Ip do computador: $ip_computador Máscara da rede: $netmask"); + // Caso não tenha encontrado, tenta pegar a variável da requisição + if (empty($te_node_address)) { + $te_node_address = $request->get('te_node_address'); + } + + if (empty($netmask)) { + $netmask = $request->get('netmask'); + } + //vefifica se existe SO coletado se não, insere novo SO $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->createIfNotExist( $te_so ); $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $ip_computador, $netmask ); @@ -181,6 +190,16 @@ class DefaultController extends Controller } $te_node_adress = TagValueHelper::getValueFromTags( 'MACAddress', OldCacicHelper::deCrypt( $request, $request->get('NetworkAdapterConfiguration'))); + + // Caso não tenha encontrado, tenta pegar a variável da requisição + if (empty($te_node_address)) { + $te_node_address = $request->get('te_node_address'); + } + + if (empty($netmask)) { + $netmask = $request->get('netmask'); + } + $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->findOneBy( array('teSo'=>$request->get( 'te_so' ))); $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $ip_computador, $netmask ); $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $request->get( 'te_so' ),$te_node_adress, $rede, $so, $ip_computador ); -- libgit2 0.21.2