diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java index 8540e5443..57fd5b4ad 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PuntoVentaServiceImpl.java @@ -162,12 +162,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { DaoAG.getInstance().setDBConnection(dataSource.getConnection()); IAG iag = service.getIAGPort(new URL(DaoAG.getInstance().obterConstante(Constantes.URL_WS_AG))); TFornecedor fornecedor = null; + String strFornecedor = ""; try{ - fornecedor = iag.getObjetoFornecedorPorCNPJCPF(entidad.getNumDoCPuntoVenta()); + strFornecedor = iag.getCodigoFornecedorWithIDWS(entidad.getPuntoventaId().toString()); } catch (RemoteException e) { log.error("", e.toString()); } - if (fornecedor != null){ + if (!strFornecedor.isEmpty()){ // retornar msg a informação de registro já cadastrado entidad.setIndIntegradoAG(false); entidad.setMotivoNaoIntegradoAG("Fornecedor já cadastrado"); @@ -232,12 +233,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService { DaoAG.getInstance().setDBConnection(dataSource.getConnection()); IAG iag = service.getIAGPort(new URL(DaoAG.getInstance().obterConstante(Constantes.URL_WS_AG))); TCliente cli = null; + String cliStr = ""; try{ - cli = iag.getObjetoClienteCPFCNPJ(entidad.getNumDoCPuntoVenta()); + cliStr = iag.getClienteWithIDWS(entidad.getPuntoventaId().toString()); } catch (RemoteException e) { log.error("", e.toString()); } - if (cli != null){ + if (!cliStr.isEmpty()){ // retornar msg a informação de registro já cadastrado entidad.setIndIntegradoAG(false); entidad.setMotivoNaoIntegradoAG("Cliente já cadastrado");