70 lines
2.0 KiB
Java
70 lines
2.0 KiB
Java
package com.rjconsultores.ventaboletos.service.impl;
|
|
|
|
import java.util.Calendar;
|
|
import java.util.List;
|
|
import java.util.Optional;
|
|
|
|
import com.rjconsultores.ventaboletos.dao.EmpresaIziPayDAO;
|
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|
import com.rjconsultores.ventaboletos.entidad.EmpresaIziPayConfig;
|
|
import com.rjconsultores.ventaboletos.service.EmpresaIziPayService;
|
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@Service("empresaIziPayService")
|
|
public class EmpresaIziPayServiceImpl implements EmpresaIziPayService {
|
|
|
|
@Autowired
|
|
private EmpresaIziPayDAO empresaIziPayService;
|
|
|
|
@Override
|
|
public List<EmpresaIziPayConfig> obtenerTodos() {
|
|
return empresaIziPayService.obtenerTodos();
|
|
}
|
|
|
|
@Override
|
|
public EmpresaIziPayConfig obtenerID(Integer id) {
|
|
return empresaIziPayService.obtenerID(id);
|
|
}
|
|
|
|
@Override
|
|
@Transactional
|
|
public EmpresaIziPayConfig suscribir(EmpresaIziPayConfig entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Boolean.TRUE);
|
|
|
|
return empresaIziPayService.suscribir(entidad);
|
|
}
|
|
|
|
@Override
|
|
@Transactional
|
|
public EmpresaIziPayConfig actualizacion(EmpresaIziPayConfig entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Boolean.TRUE);
|
|
|
|
return empresaIziPayService.actualizacion(entidad);
|
|
}
|
|
|
|
@Override
|
|
@Transactional
|
|
public void borrar(EmpresaIziPayConfig entidad) {
|
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
|
entidad.setActivo(Boolean.FALSE);
|
|
|
|
empresaIziPayService.actualizacion(entidad);
|
|
|
|
}
|
|
|
|
@Override
|
|
public Optional<EmpresaIziPayConfig> buscarPorEmpresa(Empresa empresa) {
|
|
return empresaIziPayService.buscarPorEmpresa(empresa);
|
|
}
|
|
|
|
}
|