fixes bug #7975
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@60923 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
5a42085280
commit
60c232f973
|
@ -120,15 +120,15 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
respEx = new IntegracionException(Atributos.MSG_ERRO_GENERICA + e.getMessage());
|
||||
}
|
||||
}
|
||||
entidad = puntoVentaDAO.suscribir(entidad);
|
||||
|
||||
if (respEx != null) {
|
||||
if (respEx instanceof IntegracionException) {
|
||||
throw (IntegracionException) respEx;
|
||||
} else if (respEx instanceof ValidacionCampoException) {
|
||||
if (respEx instanceof ValidacionCampoException) {
|
||||
throw (ValidacionCampoException) respEx;
|
||||
} else if (respEx instanceof IntegracionException) {
|
||||
entidad = puntoVentaDAO.suscribir(entidad);
|
||||
throw (IntegracionException) respEx;
|
||||
}
|
||||
}
|
||||
entidad = puntoVentaDAO.suscribir(entidad);
|
||||
|
||||
return entidad;
|
||||
}
|
||||
|
@ -197,16 +197,16 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
|
||||
private boolean tienesEstacionEnPuntoVta(PuntoVenta entidad) {
|
||||
List<Estacion> lsEstaciones = estacionService.buscarEstaciones(entidad);
|
||||
if(lsEstaciones != null && lsEstaciones.size() > 0 ){
|
||||
if (lsEstaciones != null && lsEstaciones.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void borrar(PuntoVenta entidad) throws BusinessException{
|
||||
public void borrar(PuntoVenta entidad) throws BusinessException {
|
||||
|
||||
if(tienesEstacionEnPuntoVta(entidad)){
|
||||
if (tienesEstacionEnPuntoVta(entidad)) {
|
||||
throw new BusinessException("editarPuntoVentaController.MSG.estacionVinculadaAgenciaOnDelete");
|
||||
}
|
||||
|
||||
|
@ -289,7 +289,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
|
||||
String cpfOrCnpj = puntoVenta.getNumDoCPuntoVenta().replaceAll("[^0-9.]", "");
|
||||
|
||||
if (!CpfCnpj.isValid(cpfOrCnpj)){
|
||||
if (!CpfCnpj.isValid(cpfOrCnpj)) {
|
||||
throw new ValidacionCampoException("editarPuntoVentaController.erro.cpfCnpj");
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
String est = puntoVenta.getColonia() == null ? null : puntoVenta.getColonia().getCiudad().getEstado().getCveestado();
|
||||
String codpais = CodPaisBanco.BRASIL.getValor();
|
||||
|
||||
String cep = puntoVenta.getCodpostal() != null?puntoVenta.getCodpostal().toString():null;
|
||||
String cep = puntoVenta.getCodpostal() != null ? puntoVenta.getCodpostal().toString() : null;
|
||||
|
||||
String tel = puntoVenta.getNumtelefonouno();
|
||||
String ddd = null;
|
||||
|
@ -492,12 +492,14 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
*
|
||||
* link artigo:http://stackoverflow.com/questions/9710185/how-to-deal-with-invalid-characters-in-a-ws-output-when-using-cxf
|
||||
*
|
||||
* @param text The String to clean
|
||||
* @param replacement The string to be substituted for each match
|
||||
* @param text
|
||||
* The String to clean
|
||||
* @param replacement
|
||||
* The string to be substituted for each match
|
||||
* @return The resulting String
|
||||
*/
|
||||
private String removerCaracteresInvalidosXml(String s){
|
||||
if (s == null){
|
||||
private String removerCaracteresInvalidosXml(String s) {
|
||||
if (s == null) {
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@ -505,8 +507,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
|||
return s.replaceAll(re, "");
|
||||
}
|
||||
|
||||
private String removerAcentosCaracteresEspeciaisTotvs(String s){
|
||||
if (StringUtils.isBlank(s)){
|
||||
private String removerAcentosCaracteresEspeciaisTotvs(String s) {
|
||||
if (StringUtils.isBlank(s)) {
|
||||
return s;
|
||||
}
|
||||
s = StringUtils.trim(s);
|
||||
|
|
Loading…
Reference in New Issue