fixes bug #6255
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@43709 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
5aa2fc192a
commit
17ad799471
|
@ -6,8 +6,6 @@ package com.rjconsultores.ventaboletos.service;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Session;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.text.Normalizer;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -329,11 +330,18 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
String cnpjEmpresaProtheus = Atributos.CNPJ_EMPRESA_PROTHEUS;
|
||||
|
||||
String nome = puntoVenta.getNombpuntoventa();
|
||||
nome = removerAcentosCaracteresEspeciais(nome);
|
||||
|
||||
String cgc = puntoVenta.getNumDoCPuntoVenta();
|
||||
|
||||
String endereco = puntoVenta.getDireccioncalle() + "," + ((puntoVenta.getDireccionnumero() == null) ? "" : puntoVenta.getDireccionnumero());
|
||||
endereco = removerAcentosCaracteresEspeciais(endereco);
|
||||
|
||||
String complemen = puntoVenta.getCompl() == null ? "" : puntoVenta.getCompl();
|
||||
complemen = removerAcentosCaracteresEspeciais(complemen);
|
||||
|
||||
String bairro = puntoVenta.getColonia() == null ? null : puntoVenta.getColonia().getDesccolonia();
|
||||
bairro = removerAcentosCaracteresEspeciais(bairro);
|
||||
|
||||
String codmun = puntoVenta.getColonia() == null ? null : puntoVenta.getColonia().getCiudad().getCodmunicipio().toString();
|
||||
codmun = (codmun == null) ? "" : StringUtils.leftPad(codmun, 5, '0');
|
||||
|
@ -457,5 +465,12 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
vlr = somenteNumeros(vlr);
|
||||
return vlr.length() > 11;
|
||||
}
|
||||
private String removerAcentosCaracteresEspeciais(String s){
|
||||
if (StringUtils.isBlank(s)){
|
||||
return s;
|
||||
}
|
||||
s = StringUtils.trim(s);
|
||||
return Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "").replaceAll("\\W", " ");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue