fixes bug #AL-3735
parent
207cef34e6
commit
2529d46e56
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ModelWeb</artifactId>
|
||||
<version>1.32.0</version>
|
||||
<version>1.32.1</version>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
|
|
|
@ -283,11 +283,12 @@ public class TarifaHibernateDAO extends GenericHibernateDAO<Tarifa, Integer> imp
|
|||
public void excluirTodasTarifas(Moneda moneda, Marca marca, ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa, Parada origem,
|
||||
Parada destino, Categoria categoria, TipoPuntoVenta tipoPuntoVenta, Ruta ruta, Via via, Boolean vende, Integer usuarioModifId) {
|
||||
StringBuilder hql = new StringBuilder();
|
||||
hql.append(" update Tarifa set activo = 0, fecmodif = sysdate(), usuarioId = ").append(usuarioModifId).append(" where tarifaId in (");
|
||||
hql.append(" select t.tarifaId from Tarifa t ");
|
||||
try {
|
||||
hql.append(" update Tarifa tb set activo = 0, fecmodif = sysdate(), usuarioId = ").append(usuarioModifId).append(" where tarifaId in (");
|
||||
hql.append(" select tb.tarifaId from Tarifa t ");
|
||||
|
||||
if (vende != null) {
|
||||
hql.append(" inner join t.ruta.rutaCombinacionList AS rutaCombinacionList" );
|
||||
hql.append(" inner join tb.ruta.rutaCombinacionList AS rutaCombinacionList" );
|
||||
}
|
||||
|
||||
if (categoria == null && tipoPuntoVenta == null) {
|
||||
|
@ -295,12 +296,12 @@ public class TarifaHibernateDAO extends GenericHibernateDAO<Tarifa, Integer> imp
|
|||
}
|
||||
|
||||
if (categoria != null) {
|
||||
hql.append(" inner join t.lsTarifaCategoria as tarifascategoria ");
|
||||
hql.append(" inner join tb.lsTarifaCategoria as tarifascategoria ");
|
||||
hql.append(" where 0 = 0 and tarifascategoria.categoria.categoriaId = " + categoria.getCategoriaId());
|
||||
}
|
||||
|
||||
if (tipoPuntoVenta != null) {
|
||||
hql.append(" inner join t.lsTarifaTipoptovta as tarifastipoptovta ");
|
||||
hql.append(" inner join tb.lsTarifaTipoptovta as tarifastipoptovta ");
|
||||
if (categoria == null) {
|
||||
hql.append(" where 0 = 0 and tarifastipoptovta.tipoPuntoVenta.tipoptovtaId = " + tipoPuntoVenta.getTipoptovtaId());
|
||||
} else {
|
||||
|
@ -309,35 +310,35 @@ public class TarifaHibernateDAO extends GenericHibernateDAO<Tarifa, Integer> imp
|
|||
}
|
||||
|
||||
if (moneda != null) {
|
||||
hql.append(" and t.moneda.monedaId = " + moneda.getMonedaId());
|
||||
hql.append(" and tb.moneda.monedaId = " + moneda.getMonedaId());
|
||||
}
|
||||
|
||||
if (marca != null) {
|
||||
hql.append(" and t.marca.marcaId = " + marca.getMarcaId());
|
||||
hql.append(" and tb.marca.marcaId = " + marca.getMarcaId());
|
||||
}
|
||||
|
||||
if (claseServicio != null) {
|
||||
hql.append(" and t.claseServicio.claseservicioId = " + claseServicio.getClaseservicioId());
|
||||
hql.append(" and tb.claseServicio.claseservicioId = " + claseServicio.getClaseservicioId());
|
||||
}
|
||||
|
||||
if (vigenciaTarifa != null) {
|
||||
hql.append(" and t.vigenciaTarifa.vigenciatarifaId = " + vigenciaTarifa.getVigenciatarifaId());
|
||||
hql.append(" and tb.vigenciaTarifa.vigenciatarifaId = " + vigenciaTarifa.getVigenciatarifaId());
|
||||
}
|
||||
|
||||
if (origem != null) {
|
||||
hql.append(" and t.origen.paradaId = " + origem.getParadaId());
|
||||
hql.append(" and tb.origen.paradaId = " + origem.getParadaId());
|
||||
}
|
||||
|
||||
if (destino != null) {
|
||||
hql.append(" and t.destino.paradaId = " + destino.getParadaId());
|
||||
hql.append(" and tb.destino.paradaId = " + destino.getParadaId());
|
||||
}
|
||||
|
||||
if (ruta != null) {
|
||||
hql.append(" and t.ruta.rutaId = " + ruta.getRutaId());
|
||||
hql.append(" and tb.ruta.rutaId = " + ruta.getRutaId());
|
||||
}
|
||||
|
||||
if (via != null) {
|
||||
hql.append(" and t.tramo.via.viaId = " + via.getViaId());
|
||||
hql.append(" and tb.tramo.via.viaId = " + via.getViaId());
|
||||
}
|
||||
|
||||
if (vende != null) {
|
||||
|
@ -348,6 +349,14 @@ public class TarifaHibernateDAO extends GenericHibernateDAO<Tarifa, Integer> imp
|
|||
|
||||
Query sq = getSession().createQuery(hql.toString());
|
||||
sq.executeUpdate();
|
||||
getSession().flush();
|
||||
}catch (Exception e) {
|
||||
String mensagem = "Erro ao excluir Tarifas para origemId:" + ( origem!=null ? origem.getParadaId() : "null") +
|
||||
" destinoId:" + (destino !=null ? destino.getParadaId() : "null") +
|
||||
" marcaId:" + (marca!=null ? marca.getMarcaId() : "null") +
|
||||
" rutaId:" + (ruta !=null ? ruta.getRutaId() : "null");
|
||||
log.error(mensagem, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue