From b22a52953d32a9c8b736f108c98ca2a403088d9a Mon Sep 17 00:00:00 2001 From: leonardo Date: Tue, 22 Mar 2016 14:38:13 +0000 Subject: [PATCH] fixes bug #7237 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@54125 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/entidad/EsquemaCorrida.java | 81 ++++++++++++++++++- .../impl/EsquemaCorridaServiceImpl.java | 1 - 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java b/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java index 9ac10ddc2..8f12c316d 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java +++ b/src/com/rjconsultores/ventaboletos/entidad/EsquemaCorrida.java @@ -469,7 +469,86 @@ public class EsquemaCorrida implements Serializable { public void setIndCorridaExtra(Boolean indCorridaExtra) { this.indCorridaExtra = indCorridaExtra; } - + + public void clone(EsquemaCorrida other){ + this.activo = other.activo; + this.cantDiasGeneracion = other.cantDiasGeneracion; + this.cantparados = other.cantparados; + this.claseServicio = other.claseServicio; + this.claseServicio2 = other.claseServicio2; + this.diagramaAutobusId = other.diagramaAutobusId; + this.division = other.division; + this.empresa = other.empresa; + this.empresa1 = other.empresa1; + this.esquemaAgrupacionId = other.esquemaAgrupacionId; + this.esquemacorridaId = null; + this.esquemaCorridaRebote = other.esquemaCorridaRebote; + this.esquemaOperacional = other.esquemaOperacional; + this.fecmodif = other.fecmodif; + this.horasalida = other.horasalida; + this.indCorridaExtra = other.indCorridaExtra; + this.indDiaSimDiaNao = other.indDiaSimDiaNao; + this.inddomingo = other.inddomingo; + this.indGeneraFeriado = other.indGeneraFeriado; + this.indjueves = other.indjueves; + this.indlunes = other.indlunes; + this.indmartes = other.indmartes; + this.indmiercoles = other.indmiercoles; + this.indsabado = other.indsabado; + this.indviernes = other.indviernes; + this.infoCorrida = other.infoCorrida; + this.marca = other.marca; + this.numCorrida = other.numCorrida; + this.numCorridaPisoExtra = other.numCorridaPisoExtra; + this.pisoExtra = other.pisoExtra; + this.rolOperativo = other.rolOperativo; + this.rolOperativo2 = other.rolOperativo2; + this.ruta = other.ruta; + this.statusCorrida = other.statusCorrida; + this.tipocorrida = other.tipocorrida; + this.usuarioId = other.usuarioId; + + //this.esquemaAsientoList; + //this.esquemaTramoList; + + for (EsquemaTramo old : other.esquemaTramoList){ + EsquemaTramo et = new EsquemaTramo(); + et.setActivo(old.getActivo()); + et.setEsquemaCorrida(this); + et.setExcepcionRecorrido(old.getExcepcionRecorrido()); + et.setFecmodif(old.getFecmodif()); + et.setNumsecuencia(old.getNumsecuencia()); + et.setPlataforma(old.getPlataforma()); + et.setTiempoEstancia(old.getTiempoEstancia()); + et.setTramo(old.getTramo()); + et.setUsuarioId(old.getUsuarioId()); + if (esquemaTramoList == null){ + esquemaTramoList = new ArrayList(); + } + esquemaTramoList.add(et); + } + + for (EsquemaAsiento old : other.esquemaAsientoList){ + EsquemaAsiento a = new EsquemaAsiento(); + a.setActivo(old.getActivo()); + a.setDestino(old.getDestino()); + a.setEsquemaasientoId(null); + a.setEsquemaCorrida(this); + a.setFecmodif(old.getFecmodif()); + a.setIndvendible(old.getIndvendible()); + a.setMotivobloqueo(old.getMotivobloqueo()); + a.setNumasiento(old.getNumasiento()); + a.setParada(old.getParada()); + a.setTiempoLiberacion(old.getTiempoLiberacion()); + a.setUsuarioId(old.getUsuarioId()); + if (esquemaAsientoList == null){ + esquemaAsientoList = new ArrayList(); + } + esquemaAsientoList.add(a); + } + + } + public Boolean getIndDiaSimDiaNao() { return indDiaSimDiaNao; } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaCorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaCorridaServiceImpl.java index 021660692..64c73c3ef 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaCorridaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaCorridaServiceImpl.java @@ -120,7 +120,6 @@ public class EsquemaCorridaServiceImpl implements EsquemaCorridaService { et.setActivo(Boolean.FALSE); et.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); et.setFecmodif(Calendar.getInstance().getTime()); - esquemaTramoDAO.actualizacion(et); } }