0004983: Exportação SISDAP
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@34340 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
8e0327e4c3
commit
c04fccec55
|
@ -3,7 +3,9 @@ package com.rjconsultores.ventaboletos.dao;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
|
||||
public interface SisdapDAO {
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal);
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal);
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal, Integer empresaId);
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal, Integer empresaId);
|
||||
}
|
||||
|
|
|
@ -12,9 +12,9 @@ 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;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
|
||||
@Repository("sisdapDAO")
|
||||
public class SisdapHibernateDAO extends HibernateDaoSupport implements SisdapDAO {
|
||||
|
@ -25,7 +25,7 @@ public class SisdapHibernateDAO extends HibernateDaoSupport implements SisdapDAO
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal) {
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal, Integer empresaId) {
|
||||
List<String> movimentoLinhas = new ArrayList<String>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
StringBuilder qry = new StringBuilder();
|
||||
|
@ -92,13 +92,15 @@ public class SisdapHibernateDAO extends HibernateDaoSupport implements SisdapDAO
|
|||
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.numasiento IS NOT NULL ");
|
||||
qry.append(" AND e.codantt IS NOT NULL ");
|
||||
qry.append(" AND e.empresa_id = :empresa_id ");
|
||||
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));
|
||||
.setParameter("fecFinal", sdf.format(fecFinal))
|
||||
.setParameter("empresa_id", empresaId);
|
||||
List<Object[]> result = query.list();
|
||||
|
||||
movimentoLinhas.add("empresa;prefixo;mes;ano;viagem_ida;viagem_volta;lugar_ida;lugar_volta");
|
||||
|
@ -122,7 +124,7 @@ public class SisdapHibernateDAO extends HibernateDaoSupport implements SisdapDAO
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal) {
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal, Integer empresaId) {
|
||||
List<String> movimentoSecoes = new ArrayList<String>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
StringBuilder qry = new StringBuilder();
|
||||
|
@ -217,13 +219,15 @@ public class SisdapHibernateDAO extends HibernateDaoSupport implements SisdapDAO
|
|||
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.numasiento IS NOT NULL ");
|
||||
qry.append(" AND e.codantt IS NOT NULL ");
|
||||
qry.append(" AND e.empresa_id = :empresa_id ");
|
||||
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));
|
||||
.setParameter("fecFinal", sdf.format(fecFinal))
|
||||
.setParameter("empresa_id", empresaId);
|
||||
List<Object[]> result = query.list();
|
||||
|
||||
movimentoSecoes.add("empresa;prefixo;local_origem;local_destino;mes;ano;passageiro_ida;passageiro_volta;gratuidade_ida"+
|
||||
|
|
|
@ -3,7 +3,9 @@ package com.rjconsultores.ventaboletos.service;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
|
||||
public interface SisdapService {
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal);
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal);
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal, Integer empresaId);
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal, Integer empresaId);
|
||||
}
|
||||
|
|
|
@ -16,13 +16,13 @@ public class SisdapServiceImpl implements SisdapService{
|
|||
private SisdapDAO sisdapDAO;
|
||||
|
||||
@Override
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal) {
|
||||
return sisdapDAO.getMovimentoLinhas(fecInicio, fecFinal);
|
||||
public List<String> getMovimentoLinhas(Date fecInicio, Date fecFinal, Integer empresaId) {
|
||||
return sisdapDAO.getMovimentoLinhas(fecInicio, fecFinal, empresaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal) {
|
||||
return sisdapDAO.getMovimentoSecoes(fecInicio, fecFinal);
|
||||
public List<String> getMovimentoSecoes(Date fecInicio, Date fecFinal, Integer empresaId) {
|
||||
return sisdapDAO.getMovimentoSecoes(fecInicio, fecFinal, empresaId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue