13559: ADM – Geração de informações RecDespDiv e DepBco (parte 2)
fixes bug#13559 dev:valdevir qua:Juliane git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@90970 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
4e354957a7
commit
93328521c0
|
@ -0,0 +1,11 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.LogDespesaReceitaDiversa;
|
||||||
|
|
||||||
|
public interface LogDespesaReceitaDivDAO extends GenericDAO<LogDespesaReceitaDiversa, Long> {
|
||||||
|
List<LogDespesaReceitaDiversa> obterPorPeriodo(Date inicio, Date fim);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.apache.xmlbeans.impl.xb.xsdschema.RestrictionDocument.Restriction;
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Order;
|
||||||
|
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.LogDespesaReceitaDivDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.LogDespesaReceitaDiversa;
|
||||||
|
|
||||||
|
@Repository("logDespesaReceitaDivDAO")
|
||||||
|
public class LogDespesaReceitaDivHibernateDAO extends GenericHibernateDAO<LogDespesaReceitaDiversa, Long> implements LogDespesaReceitaDivDAO {
|
||||||
|
@Autowired
|
||||||
|
private DataSource dataSource;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public LogDespesaReceitaDivHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LogDespesaReceitaDiversa> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.addOrder(Order.desc("dataExecucao"));
|
||||||
|
|
||||||
|
return (List<LogDespesaReceitaDiversa>) c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<LogDespesaReceitaDiversa> obterPorPeriodo(Date inicio, Date fim){
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("dataInicio", inicio));
|
||||||
|
c.add(Restrictions.eq("dataFim", fim));
|
||||||
|
c.addOrder(Order.desc("dataExecucao"));
|
||||||
|
|
||||||
|
return (List<LogDespesaReceitaDiversa>) c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LogDespesaReceitaDiversa suscribir(LogDespesaReceitaDiversa entity) throws RuntimeException {
|
||||||
|
|
||||||
|
entity = super.suscribir(entity);
|
||||||
|
|
||||||
|
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "LOG_DESPESAS_RECEITAS_DIV_SEQ", sequenceName = "LOG_DESPESAS_RECEITAS_DIV_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "LOG_DESPESAS_RECEITAS_DIV")
|
||||||
|
public class LogDespesaReceitaDiversa {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "LOG_DESPESAS_RECEITAS_DIV_SEQ")
|
||||||
|
@Column(name = "DESPESASRECEITASDIV_ID")
|
||||||
|
private Long despesaReceitaDivId;
|
||||||
|
@JoinColumn(name = "USUARIO_ID", referencedColumnName = "USUARIO_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Usuario usuario;
|
||||||
|
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Empresa empresa;
|
||||||
|
@Column(name = "DATA_EXEC")
|
||||||
|
private Date dataExecucao;
|
||||||
|
@Column(name = "DATA_INICIO")
|
||||||
|
private Date dataInicio;
|
||||||
|
@Column(name = "DATA_FIM")
|
||||||
|
private Date dataFim;
|
||||||
|
@Column(name = "PROCESSADO")
|
||||||
|
private Boolean indProcessado;
|
||||||
|
|
||||||
|
public Long getDespesaReceitaDivId() {
|
||||||
|
return despesaReceitaDivId;
|
||||||
|
}
|
||||||
|
public void setDespesaReceitaDivId(Long despesaReceitaDivId) {
|
||||||
|
this.despesaReceitaDivId = despesaReceitaDivId;
|
||||||
|
}
|
||||||
|
public Usuario getUsuario() {
|
||||||
|
return usuario;
|
||||||
|
}
|
||||||
|
public void setUsuario(Usuario usuarioId) {
|
||||||
|
this.usuario = usuarioId;
|
||||||
|
}
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
public void setEmpresa(Empresa empresaId) {
|
||||||
|
this.empresa = empresaId;
|
||||||
|
}
|
||||||
|
public Date getDataExecucao() {
|
||||||
|
return dataExecucao;
|
||||||
|
}
|
||||||
|
public void setDataExecucao(Date dataExecucao) {
|
||||||
|
this.dataExecucao = dataExecucao;
|
||||||
|
}
|
||||||
|
public Date getDataInicio() {
|
||||||
|
return dataInicio;
|
||||||
|
}
|
||||||
|
public void setDataInicio(Date dataInicio) {
|
||||||
|
this.dataInicio = dataInicio;
|
||||||
|
}
|
||||||
|
public Date getDataFim() {
|
||||||
|
return dataFim;
|
||||||
|
}
|
||||||
|
public void setDataFim(Date dataFim) {
|
||||||
|
this.dataFim = dataFim;
|
||||||
|
}
|
||||||
|
public Boolean getIndProcessado() {
|
||||||
|
return indProcessado;
|
||||||
|
}
|
||||||
|
public void setIndProcessado(Boolean indProcessado) {
|
||||||
|
this.indProcessado = indProcessado;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.LogDespesaReceitaDiversa;
|
||||||
|
|
||||||
|
public interface LogDespesasReceitasDivService extends GenericService<LogDespesaReceitaDiversa, Long> {
|
||||||
|
public List<LogDespesaReceitaDiversa> obterPorPeriodo(Date inicio, Date fim);
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
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.LogDespesaReceitaDivDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.LogDespesaReceitaDiversa;
|
||||||
|
import com.rjconsultores.ventaboletos.service.LogDespesasReceitasDivService;
|
||||||
|
|
||||||
|
@Service("logDespesasReceitasDivService")
|
||||||
|
public class LogDespesasReceitasDivServiceImpl implements LogDespesasReceitasDivService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LogDespesaReceitaDivDAO logDespesaReceitaDivDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LogDespesaReceitaDiversa> obtenerTodos() {
|
||||||
|
return logDespesaReceitaDivDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LogDespesaReceitaDiversa> obterPorPeriodo(Date inicio, Date fim){
|
||||||
|
return logDespesaReceitaDivDAO.obterPorPeriodo(inicio, fim);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LogDespesaReceitaDiversa obtenerID(Long id) {
|
||||||
|
return logDespesaReceitaDivDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public LogDespesaReceitaDiversa suscribir(LogDespesaReceitaDiversa entidad) {
|
||||||
|
return logDespesaReceitaDivDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public LogDespesaReceitaDiversa actualizacion(LogDespesaReceitaDiversa entidad) {
|
||||||
|
return logDespesaReceitaDivDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void borrar(LogDespesaReceitaDiversa entidad) {
|
||||||
|
logDespesaReceitaDivDAO.borrar(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue