From be6c7ad7b268ad626a8cbf78723414ade3cee8c0 Mon Sep 17 00:00:00 2001 From: edgar Date: Thu, 3 Nov 2016 11:57:03 +0000 Subject: [PATCH] fixes bug #8165 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@62253 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../impl/ConferenciaPendenciaServiceImpl.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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