bug #7788
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@66737 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ed2b6f1e1f
commit
4d2d0c3a04
|
@ -155,19 +155,28 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG");
|
Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG");
|
||||||
if (empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) {
|
if (empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) {
|
||||||
log.debug("iniciando integração com AG");
|
log.debug("iniciando integração com AG");
|
||||||
integrarClienteAG(entidad);
|
integraAG(entidad);
|
||||||
if (!entidad.getIndIntegradoAG()){
|
|
||||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
|
||||||
}
|
|
||||||
integrarFornecedorAG(entidad);
|
|
||||||
if (!entidad.getIndIntegradoAG()){
|
|
||||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
|
||||||
}
|
|
||||||
log.debug("fim da integração com AG");
|
log.debug("fim da integração com AG");
|
||||||
}
|
}
|
||||||
return entidad;
|
return entidad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void integraAG(PuntoVenta entidad) throws IntegracionException{
|
||||||
|
String motivoNaoIntegrado = "";
|
||||||
|
integrarClienteAG(entidad);
|
||||||
|
if (!entidad.getIndIntegradoAG()){
|
||||||
|
motivoNaoIntegrado += "Cliente: " + entidad.getMotivoNaoIntegradoAG();
|
||||||
|
}
|
||||||
|
integrarFornecedorAG(entidad);
|
||||||
|
if (!entidad.getIndIntegradoAG()){
|
||||||
|
motivoNaoIntegrado += "Fornecedor: " + entidad.getMotivoNaoIntegradoAG();
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!motivoNaoIntegrado.isEmpty()){
|
||||||
|
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void integrarFornecedorAG(PuntoVenta entidad) {
|
private void integrarFornecedorAG(PuntoVenta entidad) {
|
||||||
|
|
||||||
Connection connection = null;
|
Connection connection = null;
|
||||||
|
@ -417,14 +426,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG");
|
Constante empresasIntegraAG = constanteService.buscarPorNomeConstante("EMPRESAS_INTEGRACAO_AG");
|
||||||
if (empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) {
|
if (empresasIntegraAG != null && empresasIntegraAG.getValorconstante() != null && empresasIntegraAG.getValorconstante().contains(entidad.getEmpresa().getEmpresaId().toString())) {
|
||||||
log.debug("iniciando integração com AG");
|
log.debug("iniciando integração com AG");
|
||||||
integrarClienteAG(entidad);
|
integraAG(entidad);
|
||||||
if (!entidad.getIndIntegradoAG()){
|
|
||||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
|
||||||
}
|
|
||||||
integrarFornecedorAG(entidad);
|
|
||||||
if (!entidad.getIndIntegradoAG()){
|
|
||||||
throw new IntegracionException(entidad.getMotivoNaoIntegradoAG());
|
|
||||||
}
|
|
||||||
log.debug("fim da integração com AG");
|
log.debug("fim da integração com AG");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue