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-87c2c4800839master
parent
bb664b6f46
commit
4e69777fc9
|
@ -25,114 +25,111 @@ 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 {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
@Basic(optional = false)
|
@Basic(optional = false)
|
||||||
@Column(name = "ESQUEMAASIENTO_ID")
|
@Column(name = "ESQUEMAASIENTO_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "ESQUEMA_ASIENTO_SEQ")
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "ESQUEMA_ASIENTO_SEQ")
|
||||||
private Integer esquemaasientoId;
|
private Integer esquemaasientoId;
|
||||||
@Column(name = "NUMASIENTO")
|
@Column(name = "NUMASIENTO")
|
||||||
private String numasiento;
|
private String numasiento;
|
||||||
@Column(name = "INDVENDIBLE")
|
@Column(name = "INDVENDIBLE")
|
||||||
private Boolean indvendible;
|
private Boolean indvendible;
|
||||||
@Column(name = "TIEMPOLIBERACION")
|
@Column(name = "TIEMPOLIBERACION")
|
||||||
private Integer tiempoLiberacion;
|
private Integer tiempoLiberacion;
|
||||||
@Column(name = "ACTIVO")
|
@Column(name = "ACTIVO")
|
||||||
private Boolean activo;
|
private Boolean activo;
|
||||||
@Column(name = "FECMODIF")
|
@Column(name = "FECMODIF")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date fecmodif;
|
private Date fecmodif;
|
||||||
@Column(name = "USUARIO_ID")
|
@Column(name = "USUARIO_ID")
|
||||||
private Integer usuarioId;
|
private Integer usuarioId;
|
||||||
@JoinColumn(name = "PARADA_ID", referencedColumnName = "PARADA_ID")
|
@JoinColumn(name = "PARADA_ID", referencedColumnName = "PARADA_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Parada parada;
|
private Parada parada;
|
||||||
@JoinColumn(name = "ESQUEMACORRIDA_ID", referencedColumnName = "ESQUEMACORRIDA_ID")
|
@JoinColumn(name = "ESQUEMACORRIDA_ID", referencedColumnName = "ESQUEMACORRIDA_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private EsquemaCorrida esquemaCorrida;
|
private EsquemaCorrida esquemaCorrida;
|
||||||
@Column(name = "MOTIVOBLOQUEO")
|
@Column(name = "MOTIVOBLOQUEO")
|
||||||
private String motivobloqueo;
|
private String motivobloqueo;
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID")
|
@JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID")
|
||||||
private Parada destino;
|
private Parada destino;
|
||||||
|
|
||||||
|
public EsquemaAsiento() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public EsquemaAsiento(Integer esquemaasientoId) {
|
||||||
|
this.esquemaasientoId = esquemaasientoId;
|
||||||
|
}
|
||||||
|
|
||||||
public EsquemaAsiento() {
|
public Integer getEsquemaasientoId() {
|
||||||
}
|
return esquemaasientoId;
|
||||||
|
}
|
||||||
|
|
||||||
public EsquemaAsiento(Integer esquemaasientoId) {
|
public void setEsquemaasientoId(Integer esquemaasientoId) {
|
||||||
this.esquemaasientoId = esquemaasientoId;
|
this.esquemaasientoId = esquemaasientoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getEsquemaasientoId() {
|
public String getNumasiento() {
|
||||||
return esquemaasientoId;
|
return numasiento;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEsquemaasientoId(Integer esquemaasientoId) {
|
public void setNumasiento(String numasiento) {
|
||||||
this.esquemaasientoId = esquemaasientoId;
|
this.numasiento = numasiento;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNumasiento() {
|
public Boolean getIndvendible() {
|
||||||
return numasiento;
|
return indvendible;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNumasiento(String numasiento) {
|
public void setIndvendible(Boolean indvendible) {
|
||||||
this.numasiento = numasiento;
|
this.indvendible = indvendible;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getIndvendible() {
|
public Boolean getActivo() {
|
||||||
return indvendible;
|
return activo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIndvendible(Boolean indvendible) {
|
public void setActivo(Boolean activo) {
|
||||||
this.indvendible = indvendible;
|
this.activo = activo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getActivo() {
|
public Date getFecmodif() {
|
||||||
return activo;
|
return fecmodif;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivo(Boolean activo) {
|
public void setFecmodif(Date fecmodif) {
|
||||||
this.activo = activo;
|
this.fecmodif = fecmodif;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getFecmodif() {
|
public Integer getUsuarioId() {
|
||||||
return fecmodif;
|
return usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFecmodif(Date fecmodif) {
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
this.fecmodif = fecmodif;
|
this.usuarioId = usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getUsuarioId() {
|
public Parada getParada() {
|
||||||
return usuarioId;
|
return parada;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsuarioId(Integer usuarioId) {
|
public void setParada(Parada parada) {
|
||||||
this.usuarioId = usuarioId;
|
this.parada = parada;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Parada getParada() {
|
public EsquemaCorrida getEsquemaCorrida() {
|
||||||
return parada;
|
return esquemaCorrida;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParada(Parada parada) {
|
|
||||||
this.parada = parada;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EsquemaCorrida getEsquemaCorrida() {
|
|
||||||
return esquemaCorrida;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEsquemaCorrida(EsquemaCorrida esquemaCorrida) {
|
|
||||||
this.esquemaCorrida = esquemaCorrida;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public void setEsquemaCorrida(EsquemaCorrida esquemaCorrida) {
|
||||||
|
this.esquemaCorrida = esquemaCorrida;
|
||||||
|
}
|
||||||
|
|
||||||
public Parada getDestino() {
|
public Parada getDestino() {
|
||||||
return destino;
|
return destino;
|
||||||
|
@ -159,27 +156,27 @@ public class EsquemaAsiento implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
hash += (esquemaasientoId != null ? esquemaasientoId.hashCode() : 0);
|
hash += (esquemaasientoId != null ? esquemaasientoId.hashCode() : 0);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
// TODO: Warning - this method won't work in the case the id fields are not set
|
||||||
if (!(object instanceof EsquemaAsiento)) {
|
if (!(object instanceof EsquemaAsiento)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
EsquemaAsiento other = (EsquemaAsiento) object;
|
EsquemaAsiento other = (EsquemaAsiento) object;
|
||||||
if ((this.esquemaasientoId == null && other.esquemaasientoId != null) || (this.esquemaasientoId != null && !this.esquemaasientoId.equals(other.esquemaasientoId))) {
|
if ((this.esquemaasientoId == null && other.esquemaasientoId != null) || (this.esquemaasientoId != null && !this.esquemaasientoId.equals(other.esquemaasientoId))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.test.EsquemaAsiento[esquemaasientoId=" + esquemaasientoId + "]";
|
return "com.rjconsultores.ventaboletos.entidad.test.EsquemaAsiento[esquemaasientoId=" + esquemaasientoId + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue