0004983: Exportação SISDAP
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@34089 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
e91b8d812d
commit
5628b12df7
|
@ -0,0 +1,6 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.GrupoCategoria;
|
||||
|
||||
public interface GrupoCategoriaDAO extends GenericDAO<GrupoCategoria, Integer> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface SisdapDAO {
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal);
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
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.GrupoCategoriaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.GrupoCategoria;
|
||||
|
||||
@Repository("grupoCategoriaDAO")
|
||||
public class GrupoCategoriaHibernateDAO extends GenericHibernateDAO<GrupoCategoria, Integer>
|
||||
implements GrupoCategoriaDAO {
|
||||
|
||||
@Autowired
|
||||
public GrupoCategoriaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GrupoCategoria> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,256 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.zkoss.zkplus.hibernate.HibernateUtil;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.SisdapDAO;
|
||||
|
||||
@Repository("sisdapDAO")
|
||||
public class SisdapHibernateDAO extends HibernateDaoSupport implements SisdapDAO {
|
||||
|
||||
@Autowired
|
||||
public SisdapHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal) {
|
||||
List<String> movimentoLinhas = new ArrayList<String>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
StringBuilder qry = new StringBuilder();
|
||||
qry.append("SELECT DISTINCT e.codantt, ");
|
||||
qry.append(" r.prefixo, ");
|
||||
qry.append(" (SELECT Count(DISTINCT bi.origen_id) ");
|
||||
qry.append(" FROM boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" ON ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" WHERE bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" AND bi.motivocancelacion_id IS NULL ");
|
||||
qry.append(" AND NOT bi.numasiento IS NULL ");
|
||||
qry.append(" AND ri.indsentidoida = 1 ");
|
||||
qry.append(" AND bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY')) AS ");
|
||||
qry.append(" viagens_ida, ");
|
||||
qry.append(" (SELECT Count(DISTINCT bv.origen_id) ");
|
||||
qry.append(" FROM boleto bv ");
|
||||
qry.append(" join ruta rv ");
|
||||
qry.append(" ON rv.ruta_id = bv.ruta_id ");
|
||||
qry.append(" WHERE bv.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" AND bv.motivocancelacion_id IS NULL ");
|
||||
qry.append(" AND NOT bv.numasiento IS NULL ");
|
||||
qry.append(" AND rv.indsentidoida = 0 ");
|
||||
qry.append(" AND bv.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY')) AS ");
|
||||
qry.append(" viagens_volta, ");
|
||||
qry.append(" (SELECT Nvl(SUM(d.cantasientos), SUM(d2.cantasientos)) ");
|
||||
qry.append(" FROM boleto bi ");
|
||||
qry.append(" join ruta rv ");
|
||||
qry.append(" ON rv.ruta_id = bi.ruta_id ");
|
||||
qry.append(" join corrida c ");
|
||||
qry.append(" ON bi.corrida_id = c.corrida_id ");
|
||||
qry.append(" left join diagrama_autobus d ");
|
||||
qry.append(" ON d.diagramaautobus_id = c.diagramaautobus_id ");
|
||||
qry.append(" left join rol_operativo ro ");
|
||||
qry.append(" ON c.roloperativo_id = ro.roloperativo_id ");
|
||||
qry.append(" left join diagrama_autobus d2 ");
|
||||
qry.append(" ON d2.diagramaautobus_id = ro.diagramaautobus_id ");
|
||||
qry.append(" WHERE bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" AND bi.motivocancelacion_id IS NULL ");
|
||||
qry.append(" AND rv.indsentidoida = 1 ");
|
||||
qry.append(" AND NOT bi.numasiento IS NULL ");
|
||||
qry.append(" AND bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY')) AS ");
|
||||
qry.append(" lugares_ida, ");
|
||||
qry.append(" (SELECT Nvl(SUM(d.cantasientos), SUM(d2.cantasientos)) ");
|
||||
qry.append(" FROM boleto bv ");
|
||||
qry.append(" join ruta rv ");
|
||||
qry.append(" ON rv.ruta_id = bv.ruta_id ");
|
||||
qry.append(" join corrida c ");
|
||||
qry.append(" ON bv.corrida_id = c.corrida_id ");
|
||||
qry.append(" left join diagrama_autobus d ");
|
||||
qry.append(" ON d.diagramaautobus_id = c.diagramaautobus_id ");
|
||||
qry.append(" left join rol_operativo ro ");
|
||||
qry.append(" ON c.roloperativo_id = ro.roloperativo_id ");
|
||||
qry.append(" left join diagrama_autobus d2 ");
|
||||
qry.append(" ON d2.diagramaautobus_id = ro.diagramaautobus_id ");
|
||||
qry.append(" WHERE bv.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" AND bv.motivocancelacion_id IS NULL ");
|
||||
qry.append(" AND NOT bv.numasiento IS NULL ");
|
||||
qry.append(" AND rv.indsentidoida = 0 ");
|
||||
qry.append(" AND bv.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY')) AS ");
|
||||
qry.append(" lugares_volta ");
|
||||
qry.append("FROM boleto b ");
|
||||
qry.append(" join ruta r ");
|
||||
qry.append(" ON r.ruta_id = b.ruta_id ");
|
||||
qry.append(" join empresa e on e.empresa_id = b.empresacorrida_id ");
|
||||
qry.append("WHERE b.motivocancelacion_id IS NULL ");
|
||||
qry.append(" AND NOT b.numasiento IS NULL ");
|
||||
qry.append(" AND NOT e.codantt IS NULL ");
|
||||
qry.append(" AND b.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY') ");
|
||||
|
||||
Query query = getSession().createSQLQuery(qry.toString())
|
||||
.setParameter("fecInicio", sdf.format(fecInicio))
|
||||
.setParameter("fecFinal", sdf.format(fecFinal));
|
||||
List<Object[]> result = query.list();
|
||||
|
||||
movimentoLinhas.add("empresa;prefixo;mes;ano;viagem_ida;viagem_volta;lugar_ida;lugar_volta");
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(fecInicio);
|
||||
int month = cal.get(Calendar.MONTH) + 1; // o mês na classe Calendar é zero based
|
||||
int year = cal.get(Calendar.YEAR);
|
||||
|
||||
for (Object[] row : result){
|
||||
movimentoLinhas.add(row[0].toString() + ";"
|
||||
+ row[1].toString() + ";" +
|
||||
+ month + ";"
|
||||
+ year + ";"
|
||||
+ row[2].toString() + ";"
|
||||
+ row[3].toString() + ";"
|
||||
+ row[4].toString() + ";"
|
||||
+ row[5].toString());
|
||||
}
|
||||
return movimentoLinhas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal) {
|
||||
List<String> movimentoSecoes = new ArrayList<String>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
StringBuilder qry = new StringBuilder();
|
||||
qry.append("select distinct e.codantt, ");
|
||||
qry.append(" r.prefixo, ");
|
||||
qry.append(" po.codantt as Local_Origem, ");
|
||||
qry.append(" pd.codantt as Local_Destino, ");
|
||||
qry.append(" (select count(bi.boleto_id) ");
|
||||
qry.append(" from boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" on ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" where bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" and bi.motivocancelacion_id is null ");
|
||||
qry.append(" and not bi.numasiento is null ");
|
||||
qry.append(" and ri.indsentidoida = 1 ");
|
||||
qry.append(" and bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY')) as passageiros_ida, ");
|
||||
qry.append(" (select count(bi.boleto_id) ");
|
||||
qry.append(" from boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" on ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" where bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" and bi.motivocancelacion_id is null ");
|
||||
qry.append(" and not bi.numasiento is null ");
|
||||
qry.append(" and ri.indsentidoida = 0 ");
|
||||
qry.append(" and bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY')) as passageiros_volta, ");
|
||||
qry.append(" (select nvl(sum(bi.categoria_id), 0) ");
|
||||
qry.append(" from boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" on ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" where bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" and bi.motivocancelacion_id is null ");
|
||||
qry.append(" and not bi.numasiento is null ");
|
||||
qry.append(" and ri.indsentidoida = 1 ");
|
||||
qry.append(" and bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY') ");
|
||||
qry.append(" and bi.categoria_id = 2) as gratuidade_passe_livre_ida, ");
|
||||
qry.append(" (select nvl(sum(bi.categoria_id), 0) ");
|
||||
qry.append(" from boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" on ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" where bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" and bi.motivocancelacion_id is null ");
|
||||
qry.append(" and not bi.numasiento is null ");
|
||||
qry.append(" and ri.indsentidoida = 0 ");
|
||||
qry.append(" and bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY') ");
|
||||
qry.append(" and bi.categoria_id = 2) as gratuidade_passe_livre_volta, ");
|
||||
qry.append(" (select nvl(sum(bi.categoria_id), 0) ");
|
||||
qry.append(" from boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" on ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" where bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" and bi.motivocancelacion_id is null ");
|
||||
qry.append(" and not bi.numasiento is null ");
|
||||
qry.append(" and ri.indsentidoida = 1 ");
|
||||
qry.append(" and bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY') ");
|
||||
qry.append(" and bi.categoria_id = 1) as gratuidade_idoso_ida, ");
|
||||
qry.append(" (select nvl(sum(bi.categoria_id), 0) ");
|
||||
qry.append(" from boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" on ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" where bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" and bi.motivocancelacion_id is null ");
|
||||
qry.append(" and not bi.numasiento is null ");
|
||||
qry.append(" and ri.indsentidoida = 0 ");
|
||||
qry.append(" and bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY') ");
|
||||
qry.append(" and bi.categoria_id = 1) as gratuidade_idoso_volta, ");
|
||||
qry.append(" (select nvl(sum(bi.categoria_id), 0) ");
|
||||
qry.append(" from boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" on ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" where bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" and bi.motivocancelacion_id is null ");
|
||||
qry.append(" and not bi.numasiento is null ");
|
||||
qry.append(" and ri.indsentidoida = 1 ");
|
||||
qry.append(" and bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY') ");
|
||||
qry.append(" and bi.categoria_id = 3) as desconto_idoso_ida, ");
|
||||
qry.append(" (select nvl(sum(bi.categoria_id), 0) ");
|
||||
qry.append(" from boleto bi ");
|
||||
qry.append(" join ruta ri ");
|
||||
qry.append(" on ri.ruta_id = bi.ruta_id ");
|
||||
qry.append(" where bi.empresacorrida_id = b.empresacorrida_id ");
|
||||
qry.append(" and bi.motivocancelacion_id is null ");
|
||||
qry.append(" and not bi.numasiento is null ");
|
||||
qry.append(" and ri.indsentidoida = 0 ");
|
||||
qry.append(" and bi.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY') ");
|
||||
qry.append(" and bi.categoria_id = 3) as desconto_idoso_volta ");
|
||||
qry.append("from boleto b ");
|
||||
qry.append(" join ruta r ");
|
||||
qry.append(" on r.ruta_id = b.ruta_id ");
|
||||
qry.append(" join parada po ");
|
||||
qry.append(" on po.parada_id = b.origen_id ");
|
||||
qry.append(" join parada pd ");
|
||||
qry.append(" on pd.parada_id = b.destino_id ");
|
||||
qry.append(" join empresa e on e.empresa_id = b.empresacorrida_id ");
|
||||
qry.append("where b.motivocancelacion_id is null ");
|
||||
qry.append(" and not b.numasiento is null ");
|
||||
qry.append(" AND NOT e.codantt IS NULL ");
|
||||
qry.append(" and b.feccorrida between To_date(:fecInicio, 'DD/MM/YYYY') AND To_date(:fecFinal, 'DD/MM/YYYY') ");
|
||||
|
||||
Query query = getSession().createSQLQuery(qry.toString())
|
||||
.setParameter("fecInicio", sdf.format(fecInicio))
|
||||
.setParameter("fecFinal", sdf.format(fecFinal));
|
||||
List<Object[]> result = query.list();
|
||||
|
||||
movimentoSecoes.add("empresa;prefixo;local_origem;local_destino;mes;ano;passageiro_ida;passageiro_volta;gratuidade_ida"+
|
||||
";gratuidade_volta;idoso_ida;idoso_volta;desconto_ida;desconto_volta ");
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(fecInicio);
|
||||
int month = cal.get(Calendar.MONTH) + 1; // o mês na classe Calendar é zero based
|
||||
int year = cal.get(Calendar.YEAR);
|
||||
|
||||
for (Object[] row : result){
|
||||
movimentoSecoes.add(row[0].toString() + ";"
|
||||
+ row[1].toString() + ";"
|
||||
+ row[2].toString() + ";"
|
||||
+ row[3].toString() + ";"
|
||||
+ month + ";"
|
||||
+ year + ";"
|
||||
+ row[4].toString() + ";"
|
||||
+ row[5].toString() + ";"
|
||||
+ row[6].toString() + ";"
|
||||
+ row[7].toString() + ";"
|
||||
+ row[8].toString() + ";"
|
||||
+ row[9].toString() + ";"
|
||||
+ row[10].toString() + ";"
|
||||
+ row[11].toString());
|
||||
}
|
||||
|
||||
return movimentoSecoes;
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import java.io.Serializable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
|
@ -15,11 +16,13 @@ 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.OneToMany;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -54,7 +57,11 @@ public class Categoria implements Serializable {
|
|||
private List<CategoriaDescuento> categoriaDescuentoList;
|
||||
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
|
||||
private List<ReservacionCategoria> reservacionCategoriaList;
|
||||
|
||||
|
||||
@JoinColumn(name = "GRUPOCATEGORIA_ID", referencedColumnName = "GRUPOCATEGORIA_ID")
|
||||
@ManyToOne()
|
||||
private GrupoCategoria grupoCategoria;
|
||||
|
||||
public Categoria() {
|
||||
}
|
||||
|
||||
|
@ -102,6 +109,14 @@ public class Categoria implements Serializable {
|
|||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public GrupoCategoria getGrupoCategoria() {
|
||||
return grupoCategoria;
|
||||
}
|
||||
|
||||
public void setGrupoCategoria(GrupoCategoria grupoCategoria) {
|
||||
this.grupoCategoria = grupoCategoria;
|
||||
}
|
||||
|
||||
public List<CategoriaDescuento> getCategoriaDescuentoList() {
|
||||
// return categoriaDescuentoList;
|
||||
List<CategoriaDescuento> rcList = new ArrayList<CategoriaDescuento>();
|
||||
|
|
|
@ -78,6 +78,8 @@ public class Empresa implements Serializable {
|
|||
private String cep;
|
||||
@Column(name = "BAIRRO")
|
||||
private String bairro;
|
||||
@Column(name = "CODANTT")
|
||||
private String codantt;
|
||||
@OneToOne(cascade = CascadeType.MERGE)
|
||||
@JoinColumn(name = "CIUDAD_ID")
|
||||
private Ciudad cidade;
|
||||
|
@ -273,6 +275,14 @@ public class Empresa implements Serializable {
|
|||
this.empresaImpostoList = empresaImpostoList;
|
||||
}
|
||||
|
||||
public String getCodantt() {
|
||||
return codantt;
|
||||
}
|
||||
|
||||
public void setCodantt(String codantt) {
|
||||
this.codantt = codantt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
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.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(name = "GRUPO_CATEGORIA_SEQ", sequenceName = "GRUPO_CATEGORIA_SEQ", allocationSize = 1)
|
||||
@Table(name = "GRUPO_CATEGORIA")
|
||||
public class GrupoCategoria {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "GRUPO_CATEGORIA_SEQ")
|
||||
@Column(name = "GRUPOCATEGORIA_ID")
|
||||
private Integer grupoCategoriaId;
|
||||
@Column(name = "DESCGRUPO")
|
||||
private String descGrupo;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
hash += (grupoCategoriaId != null ? grupoCategoriaId.hashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
// TODO: Warning - this method won't work in the case the id fields are
|
||||
// not set
|
||||
if (!(object instanceof Categoria)) {
|
||||
return false;
|
||||
}
|
||||
GrupoCategoria other = (GrupoCategoria) object;
|
||||
if ((this.grupoCategoriaId == null && other.grupoCategoriaId != null) || (this.grupoCategoriaId != null && !this.grupoCategoriaId.equals(other.grupoCategoriaId))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getDescGrupo();
|
||||
}
|
||||
|
||||
public Integer getGrupoCategoriaId() {
|
||||
return grupoCategoriaId;
|
||||
}
|
||||
|
||||
public void setGrupoCategoriaId(Integer grupoCategoriaId) {
|
||||
this.grupoCategoriaId = grupoCategoriaId;
|
||||
}
|
||||
|
||||
public String getDescGrupo() {
|
||||
return descGrupo;
|
||||
}
|
||||
|
||||
public void setDescGrupo(String descGrupo) {
|
||||
this.descGrupo = descGrupo;
|
||||
}
|
||||
|
||||
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,6 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.GrupoCategoria;
|
||||
|
||||
public interface GrupoCategoriaService extends GenericService<GrupoCategoria, Integer> {
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface SisdapService {
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal);
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal);
|
||||
}
|
|
@ -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.GrupoCategoriaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.GrupoCategoria;
|
||||
import com.rjconsultores.ventaboletos.service.GrupoCategoriaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("grupoCategoriaService")
|
||||
public class GrupoCategoriaServiceImpl implements GrupoCategoriaService {
|
||||
|
||||
@Autowired
|
||||
private GrupoCategoriaDAO grupoCategoriaDAO;
|
||||
|
||||
public List<GrupoCategoria> obtenerTodos() {
|
||||
return grupoCategoriaDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public GrupoCategoria obtenerID(Integer id) {
|
||||
return grupoCategoriaDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public GrupoCategoria suscribir(GrupoCategoria entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return grupoCategoriaDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public GrupoCategoria actualizacion(GrupoCategoria entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return grupoCategoriaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void borrar(GrupoCategoria entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
grupoCategoriaDAO.actualizacion(entidad);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
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 com.rjconsultores.ventaboletos.dao.SisdapDAO;
|
||||
import com.rjconsultores.ventaboletos.service.SisdapService;
|
||||
|
||||
@Service("sisdapService")
|
||||
public class SisdapServiceImpl implements SisdapService{
|
||||
|
||||
@Autowired
|
||||
private SisdapDAO sisdapDAO;
|
||||
|
||||
@Override
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal) {
|
||||
return sisdapDAO.getMovimentoLinhas(fecInicio, fecFinal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal) {
|
||||
return sisdapDAO.getMovimentoSecoes(fecInicio, fecFinal);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue