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;
@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);

View File

@ -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;

View File

@ -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). <br/>

View File

@ -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 {

View File

@ -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<String> 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);
}
/**