wilian 2017-09-29 18:07:10 +00:00
parent 2f37fdd2ff
commit 5f6cdee190
4 changed files with 18 additions and 1 deletions

View File

@ -64,6 +64,7 @@ public class CasetaPeaje implements Serializable, Comparable<CasetaPeaje>, Clone
@OneToMany(mappedBy = "pracaPedagioId", cascade=CascadeType.ALL)
@LazyCollection(LazyCollectionOption.FALSE)
@Where(clause="ACTIVO=1")
private List<PrecioFixoPedagio> lsPrecoFixoPedagio;

View File

@ -10,4 +10,5 @@ public interface CasetaPeajeService extends GenericService<CasetaPeaje, Integer>
public Boolean validarDescricaoCasetaPeaje(CasetaPeaje casetaPeaje);
public List<CasetaPeaje> buscarTodosOrdenadoPorDescricao();
public void deletarVigencias(List<CasetaPeajeExcepcion> cpes);
public CasetaPeaje suscribirOrActualizacion(CasetaPeaje casetaPeaje);
}

View File

@ -86,4 +86,14 @@ public class CasetaPeajeServiceImpl implements CasetaPeajeService {
public void deletarVigencias(List<CasetaPeajeExcepcion> cpes) {
casetaPeajeDAO.deletarVigencias(cpes);
}
@Override
@Transactional
public CasetaPeaje suscribirOrActualizacion(CasetaPeaje casetaPeaje) {
if(casetaPeaje.getCasetaPeajeId() == null) {
return suscribir(casetaPeaje);
} else {
return actualizacion(casetaPeaje);
}
}
}

View File

@ -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