wilian 2016-10-24 19:38:15 +00:00
parent 3ad21b7ee4
commit f5565f3956
8 changed files with 256 additions and 1 deletions

View File

@ -0,0 +1,11 @@
package com.rjconsultores.ventaboletos.dao;
import com.rjconsultores.ventaboletos.entidad.ConferenciaPendencia;
/**
*
* @author Wilian
*/
public interface ConferenciaPendenciaDAO extends GenericDAO<ConferenciaPendencia, Integer> {
}

View File

@ -566,13 +566,15 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
.append("SELECT LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", LOG.OBSERVACAO AS \"observacao\", LOG.PRECO AS \"preco\", ") .append("SELECT LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", LOG.OBSERVACAO AS \"observacao\", LOG.PRECO AS \"preco\", ")
.append("LOG.STATUS AS \"status\", B.NUMFOLIOSISTEMA AS \"numfoliosistema\", LOG.TIPO AS \"tipo\", ") .append("LOG.STATUS AS \"status\", B.NUMFOLIOSISTEMA AS \"numfoliosistema\", LOG.TIPO AS \"tipo\", ")
.append("O.NUMOPERACION AS \"numoperacion\", TEE.DESCTIPOEVENTO AS \"desctipoevento\", U.NOMBUSUARIO AS \"nombusuario\", ") .append("O.NUMOPERACION AS \"numoperacion\", TEE.DESCTIPOEVENTO AS \"desctipoevento\", U.NOMBUSUARIO AS \"nombusuario\", ")
.append("LOG.FECMODIF AS \"fecmodif\", LOG.INDCREDITO AS \"indcredito\", B.BOLETO_ID AS \"boletoId\", O.OCD_ID AS \"ocdId\", EE.EVENTOEXTRA_ID AS \"eventoextraId\", TI.DESCTIPO AS \"desctipoinformativo\" ") .append("LOG.FECMODIF AS \"fecmodif\", LOG.INDCREDITO AS \"indcredito\", B.BOLETO_ID AS \"boletoId\", O.OCD_ID AS \"ocdId\", EE.EVENTOEXTRA_ID AS \"eventoextraId\", TI.DESCTIPO AS \"desctipoinformativo\", ")
.append("CP.DESCPENDENCIA AS \"descpendencia\" ")
.append("FROM LOG_CONFERENCIA LOG ") .append("FROM LOG_CONFERENCIA LOG ")
.append("LEFT JOIN BOLETO B ON B.BOLETO_ID = LOG.BOLETO_ID ") .append("LEFT JOIN BOLETO B ON B.BOLETO_ID = LOG.BOLETO_ID ")
.append("LEFT JOIN EVENTO_EXTRA EE ON EE.EVENTOEXTRA_ID = LOG.EVENTOEXTRA_ID ") .append("LEFT JOIN EVENTO_EXTRA EE ON EE.EVENTOEXTRA_ID = LOG.EVENTOEXTRA_ID ")
.append("LEFT JOIN TIPO_EVENTO_EXTRA TEE ON TEE.TIPOEVENTOEXTRA_ID = EE.TIPOEVENTOEXTRA_ID ") .append("LEFT JOIN TIPO_EVENTO_EXTRA TEE ON TEE.TIPOEVENTOEXTRA_ID = EE.TIPOEVENTOEXTRA_ID ")
.append("LEFT JOIN OCD O ON O.OCD_ID = LOG.OCD_ID ") .append("LEFT JOIN OCD O ON O.OCD_ID = LOG.OCD_ID ")
.append("LEFT JOIN TIPO_INFORMATIVO TI ON TI.TIPOINFORMATIVO_ID = LOG.TIPOINFORMATIVOCOMISSAO_ID ") .append("LEFT JOIN TIPO_INFORMATIVO TI ON TI.TIPOINFORMATIVO_ID = LOG.TIPOINFORMATIVOCOMISSAO_ID ")
.append("LEFT JOIN CONFERENCIA_PENDENCIA CP ON CP.CONFERENCIAPENDENCIA_ID = LOG.CONFERENCIAPENDENCIA_ID ")
.append("JOIN USUARIO U ON U.USUARIO_ID = LOG.USUARIO_ID ") .append("JOIN USUARIO U ON U.USUARIO_ID = LOG.USUARIO_ID ")
.append("WHERE LOG.ACTIVO = 1 ") .append("WHERE LOG.ACTIVO = 1 ")
.append("AND LOG.CONFERENCIA_ID = :conferenciaId "); .append("AND LOG.CONFERENCIA_ID = :conferenciaId ");
@ -592,6 +594,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
.addScalar("boletoId", Hibernate.LONG).addScalar("ocdId", Hibernate.LONG) .addScalar("boletoId", Hibernate.LONG).addScalar("ocdId", Hibernate.LONG)
.addScalar("eventoextraId", Hibernate.LONG) .addScalar("eventoextraId", Hibernate.LONG)
.addScalar("desctipoinformativo", Hibernate.STRING) .addScalar("desctipoinformativo", Hibernate.STRING)
.addScalar("descpendencia", Hibernate.STRING)
.setResultTransformer(Transformers.aliasToBean(LogConferenciaVO.class)); .setResultTransformer(Transformers.aliasToBean(LogConferenciaVO.class));
qr.setParameter("conferenciaId", conferencia.getConferenciaId()); qr.setParameter("conferenciaId", conferencia.getConferenciaId());

View File

@ -0,0 +1,35 @@
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.ConferenciaPendenciaDAO;
import com.rjconsultores.ventaboletos.entidad.ConferenciaPendencia;
/**
*
* @author Wilian
*/
@Repository("conferenciaPendenteDAO")
public class ConferenciaPendenciaHibernateDAO extends GenericHibernateDAO<ConferenciaPendencia, Integer>
implements ConferenciaPendenciaDAO {
@Autowired
public ConferenciaPendenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
setSessionFactory(factory);
}
@Override
@SuppressWarnings("unchecked")
public List<ConferenciaPendencia> obtenerTodos() {
Criteria c = getSession().createCriteria(getPersistentClass());
c.add(Restrictions.eq("activo", Boolean.TRUE));
return c.list();
}
}

View File

@ -0,0 +1,127 @@
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.FetchType;
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
@Table(name = "CONFERENCIA_PENDENCIA")
@SequenceGenerator(name = "CONFERENCIA_PENDENCIA_SEQ", sequenceName = "CONFERENCIA_PENDENCIA_SEQ", allocationSize = 1)
public class ConferenciaPendencia implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONFERENCIA_PENDENCIA_SEQ")
@Column(name = "CONFERENCIAPENDENCIA_ID")
private Integer conferenciapendenciaId;
@Column(name = "DESCPENDENCIA")
private String descpendencia;
@Column(name = "ACTIVO")
private boolean activo;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "FECMODIF")
private Date fecmodif;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "USUARIO_ID")
private Usuario usuario;
public ConferenciaPendencia() {
super();
}
public ConferenciaPendencia(Integer conferenciapendenciaId, String descpendencia) {
this();
this.conferenciapendenciaId = conferenciapendenciaId;
this.descpendencia = descpendencia;
}
public Integer getConferenciapendenciaId() {
return conferenciapendenciaId;
}
public void setConferenciapendenciaId(Integer conferenciapendenciaId) {
this.conferenciapendenciaId = conferenciapendenciaId;
}
public String getDescpendencia() {
return descpendencia;
}
public void setDescpendencia(String descpendencia) {
this.descpendencia = descpendencia;
}
public boolean isActivo() {
return activo;
}
public void setActivo(boolean activo) {
this.activo = activo;
}
public Date getFecmodif() {
return fecmodif;
}
public void setFecmodif(Date fecmodif) {
this.fecmodif = fecmodif;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((conferenciapendenciaId == null) ? 0 : conferenciapendenciaId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof ConferenciaPendencia))
return false;
ConferenciaPendencia other = (ConferenciaPendencia) obj;
if (getConferenciapendenciaId() == null) {
if (other.getConferenciapendenciaId() != null)
return false;
} else if (!getConferenciapendenciaId().equals(other.getConferenciapendenciaId()))
return false;
return true;
}
@Override
public String toString() {
return getDescpendencia();
}
}

View File

@ -85,6 +85,10 @@ public class LogConferencia implements Serializable {
@JoinColumn(name = "TIPOINFORMATIVOCOMISSAO_ID") @JoinColumn(name = "TIPOINFORMATIVOCOMISSAO_ID")
private TipoInformativoComissao tipoInformativoComissao; private TipoInformativoComissao tipoInformativoComissao;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CONFERENCIAPENDENCIA_ID")
private ConferenciaPendencia conferenciaPendencia;
public Long getLogconferenciaId() { public Long getLogconferenciaId() {
return logconferenciaId; return logconferenciaId;
} }
@ -233,4 +237,16 @@ public class LogConferencia implements Serializable {
this.tipoInformativoComissao = tipoInformativoComissao; this.tipoInformativoComissao = tipoInformativoComissao;
} }
public ConferenciaPendencia getConferenciaPendencia() {
return conferenciaPendencia;
}
public void setConferenciaPendencia(ConferenciaPendencia conferenciaPendencia) {
this.conferenciaPendencia = conferenciaPendencia;
}
public Short getIndcredito() {
return indcredito;
}
} }

View File

@ -0,0 +1,11 @@
package com.rjconsultores.ventaboletos.service;
import com.rjconsultores.ventaboletos.entidad.ConferenciaPendencia;
/**
*
* @author Wilian
*/
public interface ConferenciaPendenciaService extends GenericService<ConferenciaPendencia, Integer> {
}

View File

@ -0,0 +1,43 @@
package com.rjconsultores.ventaboletos.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rjconsultores.ventaboletos.dao.ConferenciaPendenciaDAO;
import com.rjconsultores.ventaboletos.entidad.ConferenciaPendencia;
import com.rjconsultores.ventaboletos.service.ConferenciaPendenciaService;
@Service("conferenciaPendenciaService")
public class ConferenciaPendenciaServiceImpl implements ConferenciaPendenciaService {
@Autowired
ConferenciaPendenciaDAO conferenciaPendenciaDAO;
@Override
public List<ConferenciaPendencia> obtenerTodos() {
return conferenciaPendenciaDAO.obtenerTodos();
}
@Override
public ConferenciaPendencia obtenerID(Integer id) {
return conferenciaPendenciaDAO.obtenerID(id);
}
@Override
public ConferenciaPendencia suscribir(ConferenciaPendencia entidad) {
return conferenciaPendenciaDAO.suscribir(entidad);
}
@Override
public ConferenciaPendencia actualizacion(ConferenciaPendencia entidad) {
return conferenciaPendenciaDAO.actualizacion(entidad);
}
@Override
public void borrar(ConferenciaPendencia entidad) {
conferenciaPendenciaDAO.borrar(entidad);
}
}

View File

@ -30,6 +30,7 @@ public class LogConferenciaVO {
private Integer tipoventa; private Integer tipoventa;
private String descinfoevento; private String descinfoevento;
private String desctipoinformativo; private String desctipoinformativo;
private String descpendencia;
public LogConferenciaVO() { public LogConferenciaVO() {
super(); super();
@ -268,4 +269,12 @@ public class LogConferenciaVO {
this.desctipoinformativo = desctipoinformativo; this.desctipoinformativo = desctipoinformativo;
} }
public String getDescpendencia() {
return descpendencia;
}
public void setDescpendencia(String descpendencia) {
this.descpendencia = descpendencia;
}
} }