Totvs - WS Fornecedor / WS Cliente / WS Pedido Compra (bug #6127)

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@43030 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2015-04-11 18:54:37 +00:00
parent b81b36cf48
commit 1b113a2eec
1 changed files with 17 additions and 58 deletions

View File

@ -50,12 +50,6 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
private static Logger log = LoggerFactory.getLogger(PuntoVentaServiceImpl.class);
private static final int CANAL_VENTA_PROPRIAS = 11;
private static final int CANAL_VENTA_FRANQUEADAS = 12;
private static final int CANAL_VENTA_PRESTACAO_SERVICO = 13;
private static final int CANAL_VENTA_MOTORISTA = 14;
private static final int CANAL_VENTA_COBRADOR = 15;
@Autowired
private PuntoVentaDAO puntoVentaDAO;
@Autowired
@ -262,29 +256,6 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
return puntosVenta;
}
private boolean validaCanalVenta(Integer tipoptovtaId) {
boolean resp = false;
switch (tipoptovtaId) {
case CANAL_VENTA_PROPRIAS:
resp = true;
break;
case CANAL_VENTA_FRANQUEADAS:
resp = true;
break;
case CANAL_VENTA_MOTORISTA:
resp = true;
break;
case CANAL_VENTA_COBRADOR:
resp = true;
break;
default:
break;
}
return resp;
}
private void validaCampos(PuntoVenta puntoVenta) throws ValidacionCampoException {
if (puntoVenta.getNumDoCPuntoVenta() == null) {
@ -324,12 +295,6 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
validaCampos(puntoVenta);
boolean clienteValido = validaCanalVenta(puntoVenta.getTipoPuntoVenta().getTipoptovtaId().intValue());
boolean fornecedorValido = (puntoVenta.getTipoPuntoVenta().getTipoptovtaId() == CANAL_VENTA_PRESTACAO_SERVICO);
if (fornecedorValido)
clienteValido = true;
String endpointFornecedor = getEndpointFornecedor();
String endpointCliente = getEndpointCliente();
@ -405,24 +370,19 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
String resp = null;
Exception respEx = null;
if (fornecedorValido) {
try {
resp = TotvsService.cadastrarFornecedor(endpointFornecedor, bairro, cep, cgc, cnae, codmun, codpais, complemen, conta, ddd, email, endereco,
est, inscr, inscrm, naturez, nome, nreduz, simpnac, tel, tipoPessoa, tppessoa, cnpjEmpresaProtheus, xidsvp, agencia, banco,
est, inscr, inscrm, naturez, nreduz, nome, simpnac, tel, tipoPessoa, tppessoa, cnpjEmpresaProtheus, xidsvp, agencia, banco,
dgverag, ctacorr, dgverct);
} catch (Exception e) {
log.error("", e);
respEx = e;
}
}
String contrib = ContribuinteICMS.NAO.getValor();
String entid = TipoEntidade.TRANSPORTE_PASSAGEIRO.getValor();
String pais = "";// segundo orientação da TOTVS, passar em branco
String pais = puntoVenta.getColonia() == null ? null : puntoVenta.getColonia().getCiudad().getEstado().getPais().getNombpais();
pais = "";// segundo mateus, passar em branco, segundo orientação do mateus da totvs
if (clienteValido) {
try {
resp = TotvsService.cadastrarCliente(endpointCliente, bairro, cep, cgc, codmun, codpais, complemen, conta, contrib, ddd, email, cnpjEmpresaProtheus,
endereco, entid, fator, fax, inscr, inscrm, naturez, nome, nreduz, obs, pais, tppessoaCliente, tel, tipoPessoa, est, xidsvp);
@ -434,7 +394,6 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
if (respEx != null) {
throw respEx;
}
}
return resp;
}