#7212 - desenvolvimento parcial Modificação Massiva Alias, exportação ok, importação em desenvolvimento
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@53855 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2871b4d18c
commit
c6480c741d
|
@ -3,6 +3,8 @@ package com.rjconsultores.ventaboletos.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
|
|
||||||
public interface AliasServicoDAO extends GenericDAO<AliasServico, Integer>{
|
public interface AliasServicoDAO extends GenericDAO<AliasServico, Integer>{
|
||||||
|
|
||||||
|
@ -26,4 +28,13 @@ public interface AliasServicoDAO extends GenericDAO<AliasServico, Integer>{
|
||||||
*/
|
*/
|
||||||
public List<AliasServico> buscar(Integer origenId,Integer destinoId,Integer rutaId,Integer corridaId);
|
public List<AliasServico> buscar(Integer origenId,Integer destinoId,Integer rutaId,Integer corridaId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Realiza a busca com os filtro informados.
|
||||||
|
* @param linas
|
||||||
|
* @param empresas
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<AliasServico> buscarPorLinhaEmpresa(List<Ruta> linhas, List<Empresa> empresas);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -11,6 +12,8 @@ import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.AliasServicoDAO;
|
import com.rjconsultores.ventaboletos.dao.AliasServicoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
|
|
||||||
@Repository("aliasServicoDAO")
|
@Repository("aliasServicoDAO")
|
||||||
public class AliasServicoHibernateDAO extends GenericHibernateDAO<AliasServico, Integer>
|
public class AliasServicoHibernateDAO extends GenericHibernateDAO<AliasServico, Integer>
|
||||||
|
@ -45,4 +48,38 @@ public class AliasServicoHibernateDAO extends GenericHibernateDAO<AliasServico,
|
||||||
|
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public List<AliasServico> buscarPorLinhaEmpresa(List<Ruta> linhas, List<Empresa> empresas) {
|
||||||
|
|
||||||
|
StringBuilder hql = new StringBuilder();
|
||||||
|
hql.append("SELECT DISTINCT alias ");
|
||||||
|
hql.append("FROM AliasServico alias ");
|
||||||
|
hql.append("INNER JOIN alias.ruta.lsRutaEmpresa as re ");
|
||||||
|
hql.append(" WHERE (1 = 1) ");
|
||||||
|
|
||||||
|
if (!linhas.isEmpty()) {
|
||||||
|
hql.append(" AND alias.ruta.rutaId IN (");
|
||||||
|
for (Ruta r : linhas) {
|
||||||
|
hql.append(r.getRutaId() + ",");
|
||||||
|
}
|
||||||
|
hql.deleteCharAt(hql.length() - 1);
|
||||||
|
hql.append(")");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empresas.isEmpty()) {
|
||||||
|
hql.append(" AND re.empresa.empresaId IN (");
|
||||||
|
for (Empresa e : empresas) {
|
||||||
|
hql.append(e.getEmpresaId() + ",");
|
||||||
|
}
|
||||||
|
hql.deleteCharAt(hql.length() - 1);
|
||||||
|
hql.append(")");
|
||||||
|
}
|
||||||
|
|
||||||
|
Query query = getSession().createQuery(hql.toString());
|
||||||
|
|
||||||
|
return query.list();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ package com.rjconsultores.ventaboletos.service;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
|
|
||||||
public interface AliasServicoService{
|
public interface AliasServicoService{
|
||||||
|
@ -14,4 +16,6 @@ public interface AliasServicoService{
|
||||||
public AliasServico suscribirActualizar(AliasServico entidad) throws BusinessException;
|
public AliasServico suscribirActualizar(AliasServico entidad) throws BusinessException;
|
||||||
|
|
||||||
public void borrar(AliasServico entidad);
|
public void borrar(AliasServico entidad);
|
||||||
|
|
||||||
|
public List<AliasServico> buscarPorLinhaEmpresa(List<Ruta> linhas, List<Empresa> empresas);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.AliasServicoDAO;
|
import com.rjconsultores.ventaboletos.dao.AliasServicoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.AliasServicoService;
|
import com.rjconsultores.ventaboletos.service.AliasServicoService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
@ -78,4 +80,9 @@ public class AliasServicoServiceImpl implements AliasServicoService {
|
||||||
|
|
||||||
aliasServicoDAO.actualizacion(entidad);
|
aliasServicoDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AliasServico> buscarPorLinhaEmpresa(List<Ruta> linhas, List<Empresa> empresas) {
|
||||||
|
return aliasServicoDAO.buscarPorLinhaEmpresa(linhas, empresas);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -728,7 +728,7 @@ public class CorridaServiceImpl implements CorridaService {
|
||||||
tiempoOrigen += estadoOrigen.getTiempoHorVerano();
|
tiempoOrigen += estadoOrigen.getTiempoHorVerano();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//21688
|
||||||
Estado estadoDestino = esquemaTramo.getTramo().getDestino().getCiudad().getEstado();
|
Estado estadoDestino = esquemaTramo.getTramo().getDestino().getCiudad().getEstado();
|
||||||
int tiempoDestino = 0;
|
int tiempoDestino = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue