0004987: Cotas - Tempo Liberação Poltrona Exlusiva

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@34061 d1611594-4594-4d17-8e1d-87c2c4800839
master
leonardo 2014-03-11 19:12:02 +00:00
parent ae01f70fce
commit 3f6f782d6f
5 changed files with 28 additions and 6 deletions

View File

@ -40,6 +40,8 @@ public class AsientoExclusivo implements Serializable {
private String numasiento; private String numasiento;
@Column(name = "VENDIBLE") @Column(name = "VENDIBLE")
private Boolean vendible; private Boolean vendible;
@Column(name = "TIEMPOLIBERACION")
private Integer tiempoLiberacion;
@Column(name = "ACTIVO") @Column(name = "ACTIVO")
private Boolean activo; private Boolean activo;
@Basic(optional = false) @Basic(optional = false)
@ -156,7 +158,15 @@ public class AsientoExclusivo implements Serializable {
this.nodo = nodo; this.nodo = nodo;
} }
@Override public Integer getTiempoLiberacion() {
return tiempoLiberacion;
}
public void setTiempoLiberacion(Integer tiempoLiberacion) {
this.tiempoLiberacion = tiempoLiberacion;
}
@Override
public int hashCode() { public int hashCode() {
int hash = 0; int hash = 0;
hash += (asientoexclusivoId != null ? asientoexclusivoId.hashCode() : 0); hash += (asientoexclusivoId != null ? asientoexclusivoId.hashCode() : 0);

View File

@ -39,6 +39,8 @@ public class EsquemaAsiento implements Serializable {
private String numasiento; private String numasiento;
@Column(name = "INDVENDIBLE") @Column(name = "INDVENDIBLE")
private Boolean indvendible; private Boolean indvendible;
@Column(name = "TIEMPOLIBERACION")
private Integer tiempoLiberacion;
@Column(name = "ACTIVO") @Column(name = "ACTIVO")
private Boolean activo; private Boolean activo;
@Column(name = "FECMODIF") @Column(name = "FECMODIF")
@ -148,6 +150,14 @@ public class EsquemaAsiento implements Serializable {
this.motivobloqueo = motivobloqueo; this.motivobloqueo = motivobloqueo;
} }
public Integer getTiempoLiberacion() {
return tiempoLiberacion;
}
public void setTiempoLiberacion(Integer tiempoLiberacion) {
this.tiempoLiberacion = tiempoLiberacion;
}
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 0; int hash = 0;

View File

@ -33,7 +33,7 @@ public interface EsquemaAsientoService {
* @param origenId * @param origenId
* @return * @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). <br/> * Hace la configuración de ocupación de bloqueo de asientos de acuerdo con el tramo informado (origen - destino). <br/>

View File

@ -642,6 +642,7 @@ public class CorridaServiceImpl implements CorridaService {
asientoExclusivo.setNumasiento(ea.getNumasiento()); asientoExclusivo.setNumasiento(ea.getNumasiento());
asientoExclusivo.setVendible(ea.getIndvendible()); asientoExclusivo.setVendible(ea.getIndvendible());
asientoExclusivo.setParada(ea.getParada()); asientoExclusivo.setParada(ea.getParada());
asientoExclusivo.setTiempoLiberacion(ea.getTiempoLiberacion());
if (ea.getIndvendible()) { if (ea.getIndvendible()) {
asientoExclusivo.setMotivobloqueo(null); asientoExclusivo.setMotivobloqueo(null);
} else { } else {

View File

@ -71,16 +71,16 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService {
@Transactional(rollbackFor = BusinessException.class) @Transactional(rollbackFor = BusinessException.class)
@Override @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) { if (origen == null) {
throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.origenObligatoria"); 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<String> asientos = cargarAsientos(strAsiento); List<String> asientos = cargarAsientos(strAsiento);
DiagramaAutobus da = diagramaAutobusService.obtenerID(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId()); DiagramaAutobus da = diagramaAutobusService.obtenerID(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId());
@ -112,6 +112,7 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService {
if (tipoBloqueo.equals(BLOQUEO_EXCLUSIVO)) { if (tipoBloqueo.equals(BLOQUEO_EXCLUSIVO)) {
es.setIndvendible(Boolean.TRUE); es.setIndvendible(Boolean.TRUE);
es.setParada(origen); es.setParada(origen);
es.setTiempoLiberacion(tiempoLiberacion);
} else { } else {
es.setIndvendible(Boolean.FALSE); es.setIndvendible(Boolean.FALSE);
es.setParada(origen); es.setParada(origen);
@ -168,7 +169,7 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService {
throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.tramo"); throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.tramo");
} }
hacerBloqueo(BLOQUEO_OCUPACION, esquemaCorrida, strAsiento, origen, destino, motivoOcupacion); hacerBloqueo(BLOQUEO_OCUPACION, esquemaCorrida, strAsiento, origen, destino, motivoOcupacion, null);
} }
/** /**