fixed bug #7577
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@58650 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ec59a79660
commit
01ac16b02f
|
@ -56,7 +56,8 @@ public interface RutaDAO extends GenericDAO<Ruta, Integer> {
|
||||||
|
|
||||||
public List<Ruta> buscaRutasFromOrgao(OrgaoConcedente orgao);
|
public List<Ruta> buscaRutasFromOrgao(OrgaoConcedente orgao);
|
||||||
|
|
||||||
|
|
||||||
public List<Ruta> buscarPorRutaPorEmpresas(List<Empresa> lsEmpresas);
|
public List<Ruta> buscarPorRutaPorEmpresas(List<Empresa> lsEmpresas);
|
||||||
|
|
||||||
|
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,6 +15,8 @@ import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
public interface RutaEmpresaDAO extends GenericDAO<RutaEmpresa, Integer> {
|
public interface RutaEmpresaDAO extends GenericDAO<RutaEmpresa, Integer> {
|
||||||
|
|
||||||
public List<RutaEmpresa> obtenerPorEmpresa(Empresa empresa);
|
public List<RutaEmpresa> obtenerPorEmpresa(Empresa empresa);
|
||||||
|
|
||||||
|
public List<RutaEmpresa> obtenerPorRuta(Ruta ruta);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.RutaEmpresaDAO;
|
import com.rjconsultores.ventaboletos.dao.RutaEmpresaDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,4 +41,12 @@ public class RutaEmpresaHibernateDAO extends GenericHibernateDAO<RutaEmpresa, In
|
||||||
|
|
||||||
return qry.list();
|
return qry.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<RutaEmpresa> obtenerPorRuta(Ruta ruta) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("ruta", ruta));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,5 +205,24 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
|
||||||
List<Ruta> lsRuta = sq.list();
|
List<Ruta> lsRuta = sq.list();
|
||||||
return lsRuta;
|
return lsRuta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.ne("rutaId", -1));
|
||||||
|
|
||||||
|
if (empresa != null && empresa.getEmpresaId() != -1) {
|
||||||
|
c.createCriteria("lsRutaEmpresa").add(Restrictions.eq("empresa", empresa));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orgao != null && orgao.getOrgaoConcedenteId() != -1) {
|
||||||
|
c.add(Restrictions.eq("orgaoConcedente", orgao));
|
||||||
|
}
|
||||||
|
|
||||||
|
c.addOrder(Order.asc("descruta"));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.service;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,4 +17,6 @@ import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
||||||
public interface RutaEmpresaService extends GenericService<RutaEmpresa, Integer> {
|
public interface RutaEmpresaService extends GenericService<RutaEmpresa, Integer> {
|
||||||
|
|
||||||
public List<RutaEmpresa> obtenerPorEmpresa(Empresa empresa);
|
public List<RutaEmpresa> obtenerPorEmpresa(Empresa empresa);
|
||||||
|
|
||||||
|
public List<RutaEmpresa> obtenerPorRuta(Ruta ruta);
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,4 +104,6 @@ public interface RutaService {
|
||||||
*/
|
*/
|
||||||
public List<ParadaSecuenciaCombinacaoLinha> verificarSeqRutaNaoGerada(Ruta ruta, List<ParadaSecuencia> lsParadasSequencia);
|
public List<ParadaSecuenciaCombinacaoLinha> verificarSeqRutaNaoGerada(Ruta ruta, List<ParadaSecuencia> lsParadasSequencia);
|
||||||
|
|
||||||
|
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.RutaEmpresaDAO;
|
import com.rjconsultores.ventaboletos.dao.RutaEmpresaDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaEmpresaService;
|
import com.rjconsultores.ventaboletos.service.RutaEmpresaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
@ -66,4 +67,10 @@ public class RutaEmpresaServiceImpl implements RutaEmpresaService {
|
||||||
public List<RutaEmpresa> obtenerPorEmpresa(Empresa empresa) {
|
public List<RutaEmpresa> obtenerPorEmpresa(Empresa empresa) {
|
||||||
return rutaEmpresaDAO.obtenerPorEmpresa(empresa);
|
return rutaEmpresaDAO.obtenerPorEmpresa(empresa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RutaEmpresa> obtenerPorRuta(Ruta ruta) {
|
||||||
|
return rutaEmpresaDAO.obtenerPorRuta(ruta);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -405,4 +405,9 @@ public class RutaServiceImpl implements RutaService {
|
||||||
|
|
||||||
return sequencias;
|
return sequencias;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Ruta> buscarRutasPorEmpresaOrgaoConcedente(Empresa empresa, OrgaoConcedente orgao) {
|
||||||
|
return rutaDAO.buscarRutasPorEmpresaOrgaoConcedente(empresa, orgao);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue