fixes bug#21112
dev: Valdir qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@104544 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
e20ffaa318
commit
8b6ee06dd1
|
@ -51,6 +51,6 @@ public interface TramoDAO extends GenericDAO<Tramo, Integer> {
|
|||
|
||||
public List<Tramo> buscarListaPorIds(List<Integer> tramoIds);
|
||||
|
||||
public List<TramoVO> buscarListaPorIds(List<Integer> tramoIds, String chaveCorrida) throws Exception;
|
||||
public List<TramoVO> buscarListaPorIds(List<Integer> tramoIds, String chaveCorrida, boolean tarifaEmbarcada) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ public class TramoHibernateDAO extends GenericHibernateDAO<Tramo, Integer>
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<TramoVO> buscarListaPorIds(List<Integer> tramoIds, String chaveCorrida ) throws Exception {
|
||||
public List<TramoVO> buscarListaPorIds(List<Integer> tramoIds, String chaveCorrida, boolean tarifaEmbarcada ) throws Exception {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
|
||||
sql.append(" SELECT ");
|
||||
|
@ -227,11 +227,19 @@ public class TramoHibernateDAO extends GenericHibernateDAO<Tramo, Integer>
|
|||
sql.append(" and rc.ruta_id = co.ruta_id ");
|
||||
sql.append(" JOIN empresa emp ON emp.empresa_id = co.empresacorrida_id ");
|
||||
sql.append(" JOIN marca mar ON mar.empresa_id = emp.empresa_id AND mar.activo = 1 ");
|
||||
sql.append(" JOIN tarifa ta ON ta.marca_id = mar.marca_id ");
|
||||
sql.append(" AND ta.tramo_id = trm.tramo_id ");
|
||||
sql.append(" AND ta.ruta_id = rc.ruta_id ");
|
||||
sql.append(" AND ta.activo = 1 ");
|
||||
if (tarifaEmbarcada) {
|
||||
sql.append(" JOIN TARIFA_EMBARCADA ta ON ta.marca_id = mar.marca_id ");
|
||||
sql.append(" AND ta.tramo_id = trm.tramo_id ");
|
||||
sql.append(" AND ta.ruta_id = rc.ruta_id ");
|
||||
sql.append(" AND ta.activo = 1 ");
|
||||
} else {
|
||||
sql.append(" JOIN tarifa ta ON ta.marca_id = mar.marca_id ");
|
||||
sql.append(" AND ta.tramo_id = trm.tramo_id ");
|
||||
sql.append(" AND ta.ruta_id = rc.ruta_id ");
|
||||
sql.append(" AND ta.activo = 1 ");
|
||||
}
|
||||
sql.append(" JOIN vigencia_tarifa vt ON vt.vigenciatarifa_id = ta.vigenciatarifa_id AND vt.activo = 1 ");
|
||||
sql.append(" AND sysdate BETWEEN vt.feciniciovigencia AND vt.fecfinvigencia ");
|
||||
sql.append(" WHERE ");
|
||||
sql.append(" rc.activo = 1 ");
|
||||
sql.append(" AND coalesce(rc.indventa, 0) = 1 ");
|
||||
|
@ -247,8 +255,6 @@ public class TramoHibernateDAO extends GenericHibernateDAO<Tramo, Integer>
|
|||
sql.append(" WHERE x.corrida_id = co.corrida_id ");
|
||||
sql.append(" AND x.feccorrida = co.feccorrida ");
|
||||
sql.append(" ) ");
|
||||
sql.append(" AND ( sysdate BETWEEN vt.feciniciovigencia AND vt.fecfinvigencia ");
|
||||
sql.append(" AND vt.activo = 1 ) ");
|
||||
sql.append(" and trm.tramo_id in ( :tramoIds ) ");
|
||||
sql.append(" ORDER BY crt.numsecuencia ");
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ public class CorridaVO {
|
|||
private Integer rolOperativoId;
|
||||
private List<Integer> listTramos;
|
||||
private String chaveCorrida;
|
||||
private boolean tarifaEmbarcada;
|
||||
|
||||
public CorridaVO() {
|
||||
super();
|
||||
|
@ -53,6 +54,7 @@ public class CorridaVO {
|
|||
this.claseServicioId = corrida.getClaseServicio().getClaseservicioId();
|
||||
this.empresaId = corrida.getEmpresa().getEmpresaId();
|
||||
this.rutaId = corrida.getRuta().getRutaId();
|
||||
this.tarifaEmbarcada = corrida.getEmpresa().getIndTabelaPrecoEmbarcada();
|
||||
}
|
||||
|
||||
public CorridaVO(Integer corridaId, Integer numCorrida, String descServico, String fechorsalida,
|
||||
|
@ -259,5 +261,13 @@ public class CorridaVO {
|
|||
public void setChaveCorrida(String chaveCorrida) {
|
||||
this.chaveCorrida = chaveCorrida;
|
||||
}
|
||||
|
||||
public boolean isTarifaEmbarcada() {
|
||||
return tarifaEmbarcada;
|
||||
}
|
||||
|
||||
public void setTarifaEmbarcada(boolean tarifaEmbarcada) {
|
||||
this.tarifaEmbarcada = tarifaEmbarcada;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue