diff --git a/src/com/rjconsultores/ventaboletos/entidad/AsientoExclusivo.java b/src/com/rjconsultores/ventaboletos/entidad/AsientoExclusivo.java index 7f31c8e24..cac7ec89f 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/AsientoExclusivo.java +++ b/src/com/rjconsultores/ventaboletos/entidad/AsientoExclusivo.java @@ -40,6 +40,8 @@ public class AsientoExclusivo implements Serializable { private String numasiento; @Column(name = "VENDIBLE") private Boolean vendible; + @Column(name = "TIEMPOLIBERACION") + private Integer tiempoLiberacion; @Column(name = "ACTIVO") private Boolean activo; @Basic(optional = false) @@ -156,7 +158,15 @@ public class AsientoExclusivo implements Serializable { this.nodo = nodo; } - @Override + public Integer getTiempoLiberacion() { + return tiempoLiberacion; + } + + public void setTiempoLiberacion(Integer tiempoLiberacion) { + this.tiempoLiberacion = tiempoLiberacion; + } + + @Override public int hashCode() { int hash = 0; hash += (asientoexclusivoId != null ? asientoexclusivoId.hashCode() : 0); diff --git a/src/com/rjconsultores/ventaboletos/entidad/EsquemaAsiento.java b/src/com/rjconsultores/ventaboletos/entidad/EsquemaAsiento.java index 9ea4bbd78..c6ccd717c 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/EsquemaAsiento.java +++ b/src/com/rjconsultores/ventaboletos/entidad/EsquemaAsiento.java @@ -39,6 +39,8 @@ public class EsquemaAsiento implements Serializable { private String numasiento; @Column(name = "INDVENDIBLE") private Boolean indvendible; + @Column(name = "TIEMPOLIBERACION") + private Integer tiempoLiberacion; @Column(name = "ACTIVO") private Boolean activo; @Column(name = "FECMODIF") @@ -148,6 +150,14 @@ public class EsquemaAsiento implements Serializable { this.motivobloqueo = motivobloqueo; } + public Integer getTiempoLiberacion() { + return tiempoLiberacion; + } + + public void setTiempoLiberacion(Integer tiempoLiberacion) { + this.tiempoLiberacion = tiempoLiberacion; + } + @Override public int hashCode() { int hash = 0; diff --git a/src/com/rjconsultores/ventaboletos/service/EsquemaAsientoService.java b/src/com/rjconsultores/ventaboletos/service/EsquemaAsientoService.java index 12907a14f..3d3052cf3 100644 --- a/src/com/rjconsultores/ventaboletos/service/EsquemaAsientoService.java +++ b/src/com/rjconsultores/ventaboletos/service/EsquemaAsientoService.java @@ -33,7 +33,7 @@ public interface EsquemaAsientoService { * @param origenId * @return */ - public void bloqueoAsientoExclusivo(EsquemaCorrida esquemaCorrida, String asiento, Parada origen) throws BusinessException; + public void bloqueoAsientoExclusivo(EsquemaCorrida esquemaCorrida, String asiento, Parada origen, Integer tiempoLiberacion) throws BusinessException; /** * Hace la configuración de ocupación de bloqueo de asientos de acuerdo con el tramo informado (origen - destino).
diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java index b2a78b933..6eecac00b 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/CorridaServiceImpl.java @@ -642,6 +642,7 @@ public class CorridaServiceImpl implements CorridaService { asientoExclusivo.setNumasiento(ea.getNumasiento()); asientoExclusivo.setVendible(ea.getIndvendible()); asientoExclusivo.setParada(ea.getParada()); + asientoExclusivo.setTiempoLiberacion(ea.getTiempoLiberacion()); if (ea.getIndvendible()) { asientoExclusivo.setMotivobloqueo(null); } else { diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java index 890bcb699..70b0fba4c 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/EsquemaAsientoServiceImpl.java @@ -71,16 +71,16 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService { @Transactional(rollbackFor = BusinessException.class) @Override - public void bloqueoAsientoExclusivo(EsquemaCorrida esquemaCorrida, String strAsiento, Parada origen) throws BusinessException { + public void bloqueoAsientoExclusivo(EsquemaCorrida esquemaCorrida, String strAsiento, Parada origen, Integer tiempoLiberacion) throws BusinessException { if (origen == null) { throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.origenObligatoria"); } - hacerBloqueo(BLOQUEO_EXCLUSIVO, esquemaCorrida, strAsiento, origen, null, null); + hacerBloqueo(BLOQUEO_EXCLUSIVO, esquemaCorrida, strAsiento, origen, null, null, tiempoLiberacion); } - private boolean hacerBloqueo(String tipoBloqueo, EsquemaCorrida esquemaCorrida, String strAsiento, Parada origen, Parada destino, String motivoOcupacion) throws BusinessException { + private boolean hacerBloqueo(String tipoBloqueo, EsquemaCorrida esquemaCorrida, String strAsiento, Parada origen, Parada destino, String motivoOcupacion, Integer tiempoLiberacion) throws BusinessException { List asientos = cargarAsientos(strAsiento); DiagramaAutobus da = diagramaAutobusService.obtenerID(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId()); @@ -112,6 +112,7 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService { if (tipoBloqueo.equals(BLOQUEO_EXCLUSIVO)) { es.setIndvendible(Boolean.TRUE); es.setParada(origen); + es.setTiempoLiberacion(tiempoLiberacion); } else { es.setIndvendible(Boolean.FALSE); es.setParada(origen); @@ -168,7 +169,7 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService { throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.tramo"); } - hacerBloqueo(BLOQUEO_OCUPACION, esquemaCorrida, strAsiento, origen, destino, motivoOcupacion); + hacerBloqueo(BLOQUEO_OCUPACION, esquemaCorrida, strAsiento, origen, destino, motivoOcupacion, null); } /**