AdmMono/src/com/rjconsultores/ventaboletos/service/impl/RutaCasetaServiceImpl.java

40 lines
1.5 KiB
Java

package com.rjconsultores.ventaboletos.service.impl;
import java.util.Calendar;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.RutaCasetaDAO;
import com.rjconsultores.ventaboletos.dao.RutaDAO;
import com.rjconsultores.ventaboletos.entidad.ParadaSecuencia;
import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.entidad.RutaCaseta;
import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.service.RutaCasetaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@Service("rutaCasetaService")
public class RutaCasetaServiceImpl implements RutaCasetaService{
@Autowired
private RutaCasetaDAO rutaCasetaDAO;
@Transactional(rollbackFor = BusinessException.class)
public RutaCaseta suscribir(RutaCaseta entidad) throws BusinessException {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
entidad = rutaCasetaDAO.suscribir(entidad);
return entidad;
}
@Transactional(rollbackFor = BusinessException.class)
public void deletarRutaCasetasFromRutaSecuenciaId(Integer id) {
rutaCasetaDAO.deletarRutaCasetasFromRutaSecuenciaId(id);
}
}