69 lines
2.1 KiB
Java
69 lines
2.1 KiB
Java
/*
|
|
* To change this template, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package com.rjconsultores.ventaboletos.service.impl;
|
|
|
|
import com.rjconsultores.ventaboletos.dao.PtovtaEstoqueDAO;
|
|
import com.rjconsultores.ventaboletos.entidad.PtovtaEstoque;
|
|
import com.rjconsultores.ventaboletos.service.PtovtaEstoqueService;
|
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|
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;
|
|
|
|
/**
|
|
*
|
|
* @author Desenvolvimento
|
|
*/
|
|
@Service("ptovtaEstoqueService")
|
|
public class PtovtaEstoqueServiceImpl implements PtovtaEstoqueService {
|
|
|
|
@Autowired
|
|
private PtovtaEstoqueDAO ptovtaEstoqueDAO;
|
|
|
|
public List<PtovtaEstoque> obtenerTodos() {
|
|
return ptovtaEstoqueDAO.obtenerTodos();
|
|
}
|
|
|
|
public PtovtaEstoque obtenerID(Integer id) {
|
|
return ptovtaEstoqueDAO.obtenerID(id);
|
|
}
|
|
|
|
@Transactional
|
|
public PtovtaEstoque suscribir(PtovtaEstoque entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Boolean.TRUE);
|
|
|
|
return ptovtaEstoqueDAO.suscribir(entidad);
|
|
}
|
|
|
|
@Transactional
|
|
public PtovtaEstoque actualizacion(PtovtaEstoque entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Boolean.TRUE);
|
|
|
|
return ptovtaEstoqueDAO.actualizacion(entidad);
|
|
}
|
|
|
|
@Transactional
|
|
public void borrar(PtovtaEstoque entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Boolean.FALSE);
|
|
|
|
ptovtaEstoqueDAO.actualizacion(entidad);
|
|
}
|
|
|
|
public List<PtovtaEstoque> buscar(int id) {
|
|
return ptovtaEstoqueDAO.buscar(id);
|
|
}
|
|
|
|
|
|
}
|