Cotas - Poltronas ocupadas (fixed bug #5042)

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@34436 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2014-03-28 14:55:19 +00:00
parent bb664b6f46
commit 4e69777fc9
3 changed files with 111 additions and 113 deletions

View File

@ -25,7 +25,7 @@ import javax.persistence.TemporalType;
* @author Rafius * @author Rafius
*/ */
@Entity @Entity
@SequenceGenerator(name = "ESQUEMA_ASIENTO_SEQ", sequenceName = "ESQUEMA_ASIENTO_SEQ",allocationSize=1) @SequenceGenerator(name = "ESQUEMA_ASIENTO_SEQ", sequenceName = "ESQUEMA_ASIENTO_SEQ", allocationSize = 1)
@Table(name = "ESQUEMA_ASIENTO") @Table(name = "ESQUEMA_ASIENTO")
public class EsquemaAsiento implements Serializable { public class EsquemaAsiento implements Serializable {
@ -60,8 +60,6 @@ public class EsquemaAsiento implements Serializable {
@JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID")
private Parada destino; private Parada destino;
public EsquemaAsiento() { public EsquemaAsiento() {
} }
@ -133,7 +131,6 @@ public class EsquemaAsiento implements Serializable {
this.esquemaCorrida = esquemaCorrida; this.esquemaCorrida = esquemaCorrida;
} }
public Parada getDestino() { public Parada getDestino() {
return destino; return destino;
} }

View File

@ -45,5 +45,5 @@ public interface EsquemaAsientoService {
* @param motivoOcupacion * @param motivoOcupacion
* @return * @return
*/ */
public void bloqueoAsientoOcupacion(EsquemaCorrida esquemaCorrida, String asiento, Parada origen, Parada destino, String motivoOcupacion) throws BusinessException; public void bloqueoAsientoOcupacion(EsquemaCorrida esquemaCorrida, String asiento, Parada origen, Parada destino, Integer tiempoLiberacion, String motivoOcupacion) throws BusinessException;
} }

View File

@ -108,11 +108,11 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService {
es.setFecmodif(Calendar.getInstance().getTime()); es.setFecmodif(Calendar.getInstance().getTime());
es.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); es.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
es.setNumasiento(asiento.toString()); es.setNumasiento(asiento.toString());
es.setTiempoLiberacion(tiempoLiberacion);
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);
@ -130,6 +130,7 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService {
if (tipoBloqueo.equals(BLOQUEO_EXCLUSIVO)) { if (tipoBloqueo.equals(BLOQUEO_EXCLUSIVO)) {
if (!(es.getIndvendible() && (es.getParada() != null) && (es.getDestino() == null))) { if (!(es.getIndvendible() && (es.getParada() != null) && (es.getDestino() == null))) {
throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.validacionGrabacion"); throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.validacionGrabacion");
} }
@ -153,7 +154,7 @@ public class EsquemaAsientoServiceImpl implements EsquemaAsientoService {
@Transactional(rollbackFor = BusinessException.class) @Transactional(rollbackFor = BusinessException.class)
@Override @Override
public void bloqueoAsientoOcupacion(EsquemaCorrida esquemaCorrida, String strAsiento, Parada origen, Parada destino, String motivoOcupacion) throws BusinessException { public void bloqueoAsientoOcupacion(EsquemaCorrida esquemaCorrida, String strAsiento, Parada origen, Parada destino, Integer tiempoLiberacion, String motivoOcupacion) throws BusinessException {
if (origen == null) { if (origen == null) {
throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.origenObligatoria"); throw new BusinessException("editarConfiguracionCorridaAsientoController.MSG.origenObligatoria");
@ -169,7 +170,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, null); hacerBloqueo(BLOQUEO_OCUPACION, esquemaCorrida, strAsiento, origen, destino, motivoOcupacion, tiempoLiberacion);
} }
/** /**