From 5f6cdee19030ed45865d5c9950827b64808423d2 Mon Sep 17 00:00:00 2001 From: wilian Date: Fri, 29 Sep 2017 18:07:10 +0000 Subject: [PATCH] fixes bug #9037 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@74361 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/entidad/CasetaPeaje.java | 1 + .../ventaboletos/service/CasetaPeajeService.java | 1 + .../service/impl/CasetaPeajeServiceImpl.java | 10 ++++++++++ .../service/impl/PrecioFixoPedagioServiceImpl.java | 7 ++++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/com/rjconsultores/ventaboletos/entidad/CasetaPeaje.java b/src/com/rjconsultores/ventaboletos/entidad/CasetaPeaje.java index 18666df4f..d35981357 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/CasetaPeaje.java +++ b/src/com/rjconsultores/ventaboletos/entidad/CasetaPeaje.java @@ -64,6 +64,7 @@ public class CasetaPeaje implements Serializable, Comparable, Clone @OneToMany(mappedBy = "pracaPedagioId", cascade=CascadeType.ALL) @LazyCollection(LazyCollectionOption.FALSE) + @Where(clause="ACTIVO=1") private List lsPrecoFixoPedagio; diff --git a/src/com/rjconsultores/ventaboletos/service/CasetaPeajeService.java b/src/com/rjconsultores/ventaboletos/service/CasetaPeajeService.java index b38e0d5d4..37b2bf111 100644 --- a/src/com/rjconsultores/ventaboletos/service/CasetaPeajeService.java +++ b/src/com/rjconsultores/ventaboletos/service/CasetaPeajeService.java @@ -10,4 +10,5 @@ public interface CasetaPeajeService extends GenericService public Boolean validarDescricaoCasetaPeaje(CasetaPeaje casetaPeaje); public List buscarTodosOrdenadoPorDescricao(); public void deletarVigencias(List cpes); + public CasetaPeaje suscribirOrActualizacion(CasetaPeaje casetaPeaje); } \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/service/impl/CasetaPeajeServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/CasetaPeajeServiceImpl.java index 89f9bfc0f..e40e377f7 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/CasetaPeajeServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/CasetaPeajeServiceImpl.java @@ -86,4 +86,14 @@ public class CasetaPeajeServiceImpl implements CasetaPeajeService { public void deletarVigencias(List cpes) { casetaPeajeDAO.deletarVigencias(cpes); } + + @Override + @Transactional + public CasetaPeaje suscribirOrActualizacion(CasetaPeaje casetaPeaje) { + if(casetaPeaje.getCasetaPeajeId() == null) { + return suscribir(casetaPeaje); + } else { + return actualizacion(casetaPeaje); + } + } } \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PrecioFixoPedagioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PrecioFixoPedagioServiceImpl.java index eba5aa0cf..06e111f04 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PrecioFixoPedagioServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PrecioFixoPedagioServiceImpl.java @@ -14,7 +14,9 @@ import com.rjconsultores.ventaboletos.dao.PrecioFixoPedagioDAO; import com.rjconsultores.ventaboletos.dao.hibernate.PrecioFixoPedagioHibernateDAO; import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.PrecioFixoPedagio; +import com.rjconsultores.ventaboletos.entidad.Usuario; import com.rjconsultores.ventaboletos.service.PrecioFixoPedagioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; /** * @@ -78,7 +80,10 @@ public class PrecioFixoPedagioServiceImpl implements PrecioFixoPedagioService { @Transactional public void borrar(PrecioFixoPedagio entidad) { - precioFixoPedagioDAO.borrar(entidad); + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(new java.util.Date()); + entidad.setActivo(false); + precioFixoPedagioDAO.actualizacion(entidad); } @Override