bug #7788
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@64301 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a7a2ac19a5
commit
8da406f4c1
|
@ -162,12 +162,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
||||||
IAG iag = service.getIAGPort(new URL(DaoAG.getInstance().obterConstante(Constantes.URL_WS_AG)));
|
IAG iag = service.getIAGPort(new URL(DaoAG.getInstance().obterConstante(Constantes.URL_WS_AG)));
|
||||||
TFornecedor fornecedor = null;
|
TFornecedor fornecedor = null;
|
||||||
|
String strFornecedor = "";
|
||||||
try{
|
try{
|
||||||
fornecedor = iag.getObjetoFornecedorPorCNPJCPF(entidad.getNumDoCPuntoVenta());
|
strFornecedor = iag.getCodigoFornecedorWithIDWS(entidad.getPuntoventaId().toString());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
log.error("", e.toString());
|
log.error("", e.toString());
|
||||||
}
|
}
|
||||||
if (fornecedor != null){
|
if (!strFornecedor.isEmpty()){
|
||||||
// retornar msg a informação de registro já cadastrado
|
// retornar msg a informação de registro já cadastrado
|
||||||
entidad.setIndIntegradoAG(false);
|
entidad.setIndIntegradoAG(false);
|
||||||
entidad.setMotivoNaoIntegradoAG("Fornecedor já cadastrado");
|
entidad.setMotivoNaoIntegradoAG("Fornecedor já cadastrado");
|
||||||
|
@ -232,12 +233,13 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
DaoAG.getInstance().setDBConnection(dataSource.getConnection());
|
||||||
IAG iag = service.getIAGPort(new URL(DaoAG.getInstance().obterConstante(Constantes.URL_WS_AG)));
|
IAG iag = service.getIAGPort(new URL(DaoAG.getInstance().obterConstante(Constantes.URL_WS_AG)));
|
||||||
TCliente cli = null;
|
TCliente cli = null;
|
||||||
|
String cliStr = "";
|
||||||
try{
|
try{
|
||||||
cli = iag.getObjetoClienteCPFCNPJ(entidad.getNumDoCPuntoVenta());
|
cliStr = iag.getClienteWithIDWS(entidad.getPuntoventaId().toString());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
log.error("", e.toString());
|
log.error("", e.toString());
|
||||||
}
|
}
|
||||||
if (cli != null){
|
if (!cliStr.isEmpty()){
|
||||||
// retornar msg a informação de registro já cadastrado
|
// retornar msg a informação de registro já cadastrado
|
||||||
entidad.setIndIntegradoAG(false);
|
entidad.setIndIntegradoAG(false);
|
||||||
entidad.setMotivoNaoIntegradoAG("Cliente já cadastrado");
|
entidad.setMotivoNaoIntegradoAG("Cliente já cadastrado");
|
||||||
|
|
Loading…
Reference in New Issue