diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaPendenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaPendenciaServiceImpl.java index 094b7ffe2..95beec822 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaPendenciaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaPendenciaServiceImpl.java @@ -1,20 +1,23 @@ package com.rjconsultores.ventaboletos.service.impl; +import java.util.Date; 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.ConferenciaPendenciaDAO; import com.rjconsultores.ventaboletos.entidad.ConferenciaPendencia; import com.rjconsultores.ventaboletos.service.ConferenciaPendenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; @Service("conferenciaPendenciaService") public class ConferenciaPendenciaServiceImpl implements ConferenciaPendenciaService { - + @Autowired ConferenciaPendenciaDAO conferenciaPendenciaDAO; - + @Override public List obtenerTodos() { return conferenciaPendenciaDAO.obtenerTodos(); @@ -25,9 +28,14 @@ public class ConferenciaPendenciaServiceImpl implements ConferenciaPendenciaServ return conferenciaPendenciaDAO.obtenerID(id); } - @Override + @Transactional public ConferenciaPendencia suscribir(ConferenciaPendencia entidad) { - return conferenciaPendenciaDAO.suscribir(entidad); + entidad.setFecmodif(new Date()); + entidad.setUsuario(UsuarioLogado.getUsuarioLogado()); + if (entidad.getConferenciapendenciaId() == null) { + return conferenciaPendenciaDAO.suscribir(entidad); + } + return conferenciaPendenciaDAO.actualizacion(entidad); } @Override