P3 - Bloqueio por tipo de Passagem (fixed bug #5381)
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@36227 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2b56a20195
commit
db5f99a2ea
|
@ -0,0 +1,6 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaCatInd;
|
||||||
|
|
||||||
|
public interface PtovtaCatIndDAO extends GenericDAO<PtovtaCatInd, Integer> {
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.PtovtaCatIndDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaCatInd;
|
||||||
|
|
||||||
|
@Repository("ptovtaCatIndDAO")
|
||||||
|
public class PtovtaCatIndHibernateDAO extends GenericHibernateDAO<PtovtaCatInd, Integer>
|
||||||
|
implements PtovtaCatIndDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public PtovtaCatIndHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,147 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "PTOVTA_CAT_IND_SEQ", sequenceName = "PTOVTA_CAT_IND_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "PTOVTA_CAT_IND")
|
||||||
|
public class PtovtaCatInd implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PTOVTA_CAT_IND_SEQ")
|
||||||
|
@Column(name = "PTOVTACATEGORIA_ID")
|
||||||
|
private Integer ptovtaCategoriaId;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Categoria categoria;
|
||||||
|
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private PuntoVenta puntoVenta;
|
||||||
|
|
||||||
|
public Integer getPtovtaCategoriaId() {
|
||||||
|
return ptovtaCategoriaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPtovtaCategoriaId(Integer ptovtaCategoriaId) {
|
||||||
|
this.ptovtaCategoriaId = ptovtaCategoriaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Categoria getCategoria() {
|
||||||
|
return categoria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoria(Categoria categoria) {
|
||||||
|
this.categoria = categoria;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PuntoVenta getPuntoVenta() {
|
||||||
|
return puntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPuntoVenta(PuntoVenta puntoVenta) {
|
||||||
|
this.puntoVenta = puntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((activo == null) ? 0 : activo.hashCode());
|
||||||
|
result = prime * result + ((categoria == null) ? 0 : categoria.hashCode());
|
||||||
|
result = prime * result + ((fecmodif == null) ? 0 : fecmodif.hashCode());
|
||||||
|
result = prime * result + ((ptovtaCategoriaId == null) ? 0 : ptovtaCategoriaId.hashCode());
|
||||||
|
result = prime * result + ((puntoVenta == null) ? 0 : puntoVenta.hashCode());
|
||||||
|
result = prime * result + ((usuarioId == null) ? 0 : usuarioId.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
PtovtaCatInd other = (PtovtaCatInd) obj;
|
||||||
|
if (activo == null) {
|
||||||
|
if (other.activo != null)
|
||||||
|
return false;
|
||||||
|
} else if (!activo.equals(other.activo))
|
||||||
|
return false;
|
||||||
|
if (categoria == null) {
|
||||||
|
if (other.categoria != null)
|
||||||
|
return false;
|
||||||
|
} else if (!categoria.equals(other.categoria))
|
||||||
|
return false;
|
||||||
|
if (fecmodif == null) {
|
||||||
|
if (other.fecmodif != null)
|
||||||
|
return false;
|
||||||
|
} else if (!fecmodif.equals(other.fecmodif))
|
||||||
|
return false;
|
||||||
|
if (ptovtaCategoriaId == null) {
|
||||||
|
if (other.ptovtaCategoriaId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!ptovtaCategoriaId.equals(other.ptovtaCategoriaId))
|
||||||
|
return false;
|
||||||
|
if (puntoVenta == null) {
|
||||||
|
if (other.puntoVenta != null)
|
||||||
|
return false;
|
||||||
|
} else if (!puntoVenta.equals(other.puntoVenta))
|
||||||
|
return false;
|
||||||
|
if (usuarioId == null) {
|
||||||
|
if (other.usuarioId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!usuarioId.equals(other.usuarioId))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -170,6 +170,10 @@ public class PuntoVenta implements Serializable {
|
||||||
@LazyCollection(LazyCollectionOption.FALSE)
|
@LazyCollection(LazyCollectionOption.FALSE)
|
||||||
private List<PtoVtaSeguro> ptovtaSeguroList;
|
private List<PtoVtaSeguro> ptovtaSeguroList;
|
||||||
|
|
||||||
|
@OneToMany(cascade = CascadeType.ALL, mappedBy = "puntoVenta")
|
||||||
|
@LazyCollection(LazyCollectionOption.FALSE)
|
||||||
|
private List<PtovtaCatInd> ptovtaCatIndList;
|
||||||
|
|
||||||
public PtovtaEmpresaBloqueada addEmpresaBloqueada(Empresa e) {
|
public PtovtaEmpresaBloqueada addEmpresaBloqueada(Empresa e) {
|
||||||
PtovtaEmpresaBloqueada eb = new PtovtaEmpresaBloqueada();
|
PtovtaEmpresaBloqueada eb = new PtovtaEmpresaBloqueada();
|
||||||
eb.setEmpresa(e);
|
eb.setEmpresa(e);
|
||||||
|
@ -737,4 +741,31 @@ public class PuntoVenta implements Serializable {
|
||||||
this.ptovtaSeguroList.remove(pto);
|
this.ptovtaSeguroList.remove(pto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<PtovtaCatInd> getPtovtaCatIndList() {
|
||||||
|
List<PtovtaCatInd> lista = new ArrayList<PtovtaCatInd>();
|
||||||
|
for (PtovtaCatInd ck : ptovtaCatIndList) {
|
||||||
|
if (ck.getActivo()) {
|
||||||
|
lista.add(ck);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lista;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPtovtaCatIndList(List<PtovtaCatInd> ptovtaCatIndList) {
|
||||||
|
this.ptovtaCatIndList = ptovtaCatIndList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PtovtaCatInd addPtovtaCatInd(PtovtaCatInd pto) {
|
||||||
|
pto.setActivo(Boolean.TRUE);
|
||||||
|
pto.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
pto.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
|
||||||
|
this.ptovtaCatIndList.add(pto);
|
||||||
|
return pto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removePtovtaCatInd(PtovtaCatInd pto) {
|
||||||
|
this.ptovtaCatIndList.remove(pto);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaCatInd;
|
||||||
|
|
||||||
|
public interface PtovtaCatIndService extends GenericService<PtovtaCatInd, Integer> {
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.PtovtaCatIndDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PtovtaCatInd;
|
||||||
|
import com.rjconsultores.ventaboletos.service.PtovtaCatIndService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("ptovtaCatIndService")
|
||||||
|
public class PtovtaCatIndServiceImpl implements PtovtaCatIndService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PtovtaCatIndDAO ptovtaCatIndDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PtovtaCatInd> obtenerTodos() {
|
||||||
|
return ptovtaCatIndDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PtovtaCatInd obtenerID(Integer id) {
|
||||||
|
return ptovtaCatIndDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PtovtaCatInd suscribir(PtovtaCatInd entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
return ptovtaCatIndDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public PtovtaCatInd actualizacion(PtovtaCatInd entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
return ptovtaCatIndDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void borrar(PtovtaCatInd entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
ptovtaCatIndDAO.actualizacion(entidad);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.EstacionDAO;
|
|
||||||
import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO;
|
import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.UsuarioUbicacionDAO;
|
import com.rjconsultores.ventaboletos.dao.UsuarioUbicacionDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
@ -20,7 +19,6 @@ import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||||
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
|
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
|
||||||
import com.rjconsultores.ventaboletos.service.UsuarioUbicacionService;
|
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue