Se agrega funcionalidad de configuracion productos #AL-4506
parent
b4d86177c1
commit
ae9b1c6f15
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ModelWeb</artifactId>
|
<artifactId>ModelWeb</artifactId>
|
||||||
<version>1.98.0</version>
|
<version>1.98.1</version>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProducto;
|
||||||
|
|
||||||
|
public interface ConfiguracionProductoDAO extends GenericDAO<ConfiguracionProducto, Long>{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProducto;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProductoParada;
|
||||||
|
|
||||||
|
public interface ConfiguracionProductoParadaDAO extends GenericDAO<ConfiguracionProductoParada, Long>{
|
||||||
|
|
||||||
|
public List<ConfiguracionProductoParada> buscarPorId(ConfiguracionProducto id);
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
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.ConfiguracionProductoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProducto;
|
||||||
|
|
||||||
|
@Repository("configuracionProductoDAO")
|
||||||
|
public class ConfiguracionProductoHibernateDAO extends GenericHibernateDAO<ConfiguracionProducto, Long> implements ConfiguracionProductoDAO{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ConfiguracionProductoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.ConfiguracionProductoParadaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProducto;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProductoParada;
|
||||||
|
|
||||||
|
@Repository("configuracionProductoParadaDAO")
|
||||||
|
public class ConfiguracionProductoParadaHibernateDAO extends GenericHibernateDAO<ConfiguracionProductoParada, Long> implements ConfiguracionProductoParadaDAO{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ConfiguracionProductoParadaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<ConfiguracionProductoParada> buscarPorId(ConfiguracionProducto id) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("configuracionProducto", id));
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
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 = "CONFIGURACION_PRODUCTO_SEQ", sequenceName = "CONFIGURACION_PRODUCTO_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "CONFIGURACION_PRODUCTO")
|
||||||
|
public class ConfiguracionProducto {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@Column(name = "CONFIGURACIONPRODUCTO_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONFIGURACION_PRODUCTO_SEQ")
|
||||||
|
private Long configuracionProductoId;
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "TIPOEVENTOEXTRA_ID")
|
||||||
|
private TipoEventoExtra tipoeventoextra;
|
||||||
|
@Column(name = "PRECIO")
|
||||||
|
private BigDecimal precio;
|
||||||
|
@Column(name = "FECVIGENCIAINICIAL")
|
||||||
|
@Temporal(TemporalType.DATE)
|
||||||
|
private Date fecVigenciaInicial;
|
||||||
|
@Column(name = "FECVIGENCIAFINAL")
|
||||||
|
@Temporal(TemporalType.DATE)
|
||||||
|
private Date fecVigenciaFinal;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public Long getConfiguracionProductoId() {
|
||||||
|
return configuracionProductoId;
|
||||||
|
}
|
||||||
|
public void setConfiguracionProductoId(Long configuracionProductoId) {
|
||||||
|
this.configuracionProductoId = configuracionProductoId;
|
||||||
|
}
|
||||||
|
public TipoEventoExtra getTipoeventoextra() {
|
||||||
|
return tipoeventoextra;
|
||||||
|
}
|
||||||
|
public void setTipoeventoextra(TipoEventoExtra tipoeventoextra) {
|
||||||
|
this.tipoeventoextra = tipoeventoextra;
|
||||||
|
}
|
||||||
|
public BigDecimal getPrecio() {
|
||||||
|
return precio;
|
||||||
|
}
|
||||||
|
public void setPrecio(BigDecimal precio) {
|
||||||
|
this.precio = precio;
|
||||||
|
}
|
||||||
|
public Date getFecVigenciaInicial() {
|
||||||
|
return fecVigenciaInicial;
|
||||||
|
}
|
||||||
|
public void setFecVigenciaInicial(Date fecVigenciaInicial) {
|
||||||
|
this.fecVigenciaInicial = fecVigenciaInicial;
|
||||||
|
}
|
||||||
|
public Date getFecVigenciaFinal() {
|
||||||
|
return fecVigenciaFinal;
|
||||||
|
}
|
||||||
|
public void setFecVigenciaFinal(Date fecVigenciaFinal) {
|
||||||
|
this.fecVigenciaFinal = fecVigenciaFinal;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
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 = "CONFIGURACION_PRODUCTO_PARADA_SEQ", sequenceName = "CONFIGURACION_PRODUCTO_PARADA_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "CONFIGURACION_PRODUCTO_PARADA")
|
||||||
|
public class ConfiguracionProductoParada {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@Column(name = "CONFIGURACION_PRODUCTO_PARADA_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONFIGURACION_PRODUCTO_PARADA_SEQ")
|
||||||
|
private Long configuracionProductoParadaId;
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "CONFIGURACIONPRODUCTO_ID")
|
||||||
|
private ConfiguracionProducto configuracionProducto;
|
||||||
|
@JoinColumn(name = "PARADA_ID", referencedColumnName = "PARADA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Parada paradaId;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
|
||||||
|
public Long getConfiguracionProductoParadaId() {
|
||||||
|
return configuracionProductoParadaId;
|
||||||
|
}
|
||||||
|
public void setConfiguracionProductoParadaId(Long configuracionProductoParadaId) {
|
||||||
|
this.configuracionProductoParadaId = configuracionProductoParadaId;
|
||||||
|
}
|
||||||
|
public ConfiguracionProducto getConfiguracionProducto() {
|
||||||
|
return configuracionProducto;
|
||||||
|
}
|
||||||
|
public void setConfiguracionProducto(ConfiguracionProducto configuracionProducto) {
|
||||||
|
this.configuracionProducto = configuracionProducto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getParadaId() {
|
||||||
|
return paradaId;
|
||||||
|
}
|
||||||
|
public void setParadaId(Parada paradaId) {
|
||||||
|
this.paradaId = paradaId;
|
||||||
|
}
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProducto;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProductoParada;
|
||||||
|
|
||||||
|
public interface ConfiguracionProductoParadaService extends GenericService<ConfiguracionProductoParada, Long>{
|
||||||
|
|
||||||
|
public List<ConfiguracionProductoParada> buscarPorId(ConfiguracionProducto id);
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProducto;
|
||||||
|
|
||||||
|
public interface ConfiguracionProductoService extends GenericService<ConfiguracionProducto, Long>{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
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.ConfiguracionProductoParadaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProducto;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProductoParada;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConfiguracionProductoParadaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("configuracionProductoParadaService")
|
||||||
|
public class ConfiguracionProductoParadaServiceImpl implements ConfiguracionProductoParadaService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConfiguracionProductoParadaDAO configuracionProductoParadaDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfiguracionProductoParada> obtenerTodos() {
|
||||||
|
return configuracionProductoParadaDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfiguracionProductoParada obtenerID(Long id) {
|
||||||
|
return configuracionProductoParadaDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public ConfiguracionProductoParada suscribir(ConfiguracionProductoParada entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
return configuracionProductoParadaDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public ConfiguracionProductoParada actualizacion(ConfiguracionProductoParada entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
// entidad.setActivo(Boolean.TRUE);
|
||||||
|
return configuracionProductoParadaDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(ConfiguracionProductoParada entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
configuracionProductoParadaDAO.borrar(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfiguracionProductoParada> buscarPorId(ConfiguracionProducto id) {
|
||||||
|
return configuracionProductoParadaDAO.buscarPorId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
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.ConfiguracionProductoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConfiguracionProducto;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConfiguracionProductoService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("configuracionProductoService")
|
||||||
|
public class ConfiguracionProductoServiceImpl implements ConfiguracionProductoService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConfiguracionProductoDAO configuracionProductoDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfiguracionProducto> obtenerTodos() {
|
||||||
|
return configuracionProductoDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfiguracionProducto obtenerID(Long id) {
|
||||||
|
return configuracionProductoDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public ConfiguracionProducto suscribir(ConfiguracionProducto entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
return configuracionProductoDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public ConfiguracionProducto actualizacion(ConfiguracionProducto entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
return configuracionProductoDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(ConfiguracionProducto entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
configuracionProductoDAO.borrar(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue