From 0e994d6e590e41d80bfe6b70ba56484c2cb9fba6 Mon Sep 17 00:00:00 2001 From: valdevir Date: Fri, 25 Aug 2017 21:24:58 +0000 Subject: [PATCH] fixes bug #9684 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@73102 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/entidad/Ruta.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/entidad/Ruta.java b/src/com/rjconsultores/ventaboletos/entidad/Ruta.java index ece3071dd..9283b3d84 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Ruta.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Ruta.java @@ -125,7 +125,7 @@ public class Ruta implements Serializable, Comparable { @Column(name = "INDRUTAINTERNACIONAL") private Boolean indRutaInternacional; - + @OneToMany(mappedBy = "ruta", cascade = CascadeType.ALL) private List lsRutaEmbarqueDesembarque; @@ -294,12 +294,12 @@ public class Ruta implements Serializable, Comparable { public List getRutaSecuenciaList() { List rsList = new ArrayList(); - if(this.rutaSecuenciaList != null) - for (RutaSecuencia rs : this.rutaSecuenciaList) { - if (rs.getActivo() == Boolean.TRUE) { - rsList.add(rs); + if (this.rutaSecuenciaList != null) + for (RutaSecuencia rs : this.rutaSecuenciaList) { + if (rs.getActivo() == Boolean.TRUE) { + rsList.add(rs); + } } - } return rsList; } @@ -500,7 +500,15 @@ public class Ruta implements Serializable, Comparable { @Override public String toString() { if (getDescruta() != null || getRutaId() != null) { - return this.getDescruta() + " - " + this.getRutaId(); + if (getRutaId() != -1) { + String sentido = this.getIndSentidoIda() == null || Boolean.TRUE.equals(this.getIndSentidoIda()) ? "IDA" : "VOLTA"; + String numRuta = this.getNumRuta() != null ? this.getNumRuta() : "null"; + String descClaseServicio = this.getClaseServicio() != null ? this.getClaseServicio().getDescclase() : "null"; + String descLinha = numRuta + " - " + this.getDescruta() + " - " + descClaseServicio + " - " + this.getRutaId().toString() + " - " + sentido; + return descLinha; + } else { + return this.getRutaId() + " - " + this.getDescruta(); + } } return " "; }