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-87c2c4800839master
parent
b81b36cf48
commit
1b113a2eec
|
@ -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,35 +370,29 @@ 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,
|
||||
dgverag, ctacorr, dgverct);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
respEx = e;
|
||||
}
|
||||
try {
|
||||
resp = TotvsService.cadastrarFornecedor(endpointFornecedor, bairro, cep, cgc, cnae, codmun, codpais, complemen, conta, ddd, email, endereco,
|
||||
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
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
respEx = e;
|
||||
}
|
||||
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
respEx = e;
|
||||
}
|
||||
|
||||
if (respEx != null) {
|
||||
throw respEx;
|
||||
}
|
||||
if (respEx != null) {
|
||||
throw respEx;
|
||||
}
|
||||
|
||||
return resp;
|
||||
|
|
Loading…
Reference in New Issue