104 lines
3.7 KiB
Java
104 lines
3.7 KiB
Java
package com.rjconsultores.ventaboletos.service.impl;
|
|
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
import org.apache.log4j.Logger;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import com.rjconsultores.ventaboletos.dao.FechamentoParamptovtaDAO;
|
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
|
import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta;
|
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
|
import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService;
|
|
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
|
|
|
@Service("fechamentoParamptovtaService")
|
|
public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaService {
|
|
|
|
@Autowired
|
|
private FechamentoParamptovtaDAO fechamentoParamptovtaDAO;
|
|
@Autowired
|
|
private LogAuditoriaService logAuditoriaService;
|
|
private static Logger log = Logger.getLogger(FechamentoParamptovtaServiceImpl.class);
|
|
|
|
|
|
@Override
|
|
public List<FechamentoParamptovta> obtenerTodos() {
|
|
return fechamentoParamptovtaDAO.obtenerTodos();
|
|
}
|
|
|
|
@Override
|
|
public FechamentoParamptovta obtenerID(Long id) {
|
|
|
|
return fechamentoParamptovtaDAO.obtenerID(id);
|
|
|
|
}
|
|
|
|
@Override
|
|
@Transactional
|
|
public FechamentoParamptovta suscribir(FechamentoParamptovta entidad) {
|
|
|
|
fechamentoParamptovtaDAO.suscribir(entidad);
|
|
logAuditoriaService.auditar(null, entidad, entidad.getEmpresa() != null && entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
|
return entidad;
|
|
}
|
|
|
|
@Override
|
|
@Transactional
|
|
public FechamentoParamptovta actualizacion(FechamentoParamptovta entidad) {
|
|
entidad.setFecmodif(new Date());
|
|
FechamentoParamptovta originalClone = null;
|
|
fechamentoParamptovtaDAO.actualizacion(entidad);
|
|
logAuditoriaService.auditar(originalClone, entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
|
return entidad;
|
|
}
|
|
|
|
@Override
|
|
@Transactional
|
|
public void borrar(FechamentoParamptovta entidad) {
|
|
|
|
fechamentoParamptovtaDAO.borrar(entidad);
|
|
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null && entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
|
}
|
|
|
|
|
|
public Long count(String campo, Object o) {
|
|
return fechamentoParamptovtaDAO.count(campo, o);
|
|
}
|
|
|
|
@Override
|
|
public List<FechamentoParamptovta> buscaParametrosPorEmpresas(List<Integer> empresasId) {
|
|
return fechamentoParamptovtaDAO.buscaParametrosPorEmpresas(empresasId);
|
|
}
|
|
|
|
@Override
|
|
public List<FechamentoParamptovta> buscaParametrosPorEmpresa(Integer empresasId) {
|
|
return fechamentoParamptovtaDAO.buscaParametrosPorEmpresa(empresasId);
|
|
}
|
|
|
|
@Override
|
|
@Transactional
|
|
public FechamentoParamptovta suscribirOrActualizacion(FechamentoParamptovta FechamentoParamptovta) {
|
|
if(FechamentoParamptovta != null && FechamentoParamptovta.getFechamentoparamptovtaId() == null) {
|
|
return suscribir(FechamentoParamptovta);
|
|
} else if(FechamentoParamptovta != null && FechamentoParamptovta.getFechamentoparamptovtaId() != null) {
|
|
return actualizacion(FechamentoParamptovta);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public List<FechamentoParamptovta> buscaParametrosPorPuntoventa(PuntoVenta puntoventa) {
|
|
List<FechamentoParamptovta> params = fechamentoParamptovtaDAO.buscaParametrosPorPuntoventa(puntoventa);
|
|
return params;
|
|
}
|
|
|
|
@Override
|
|
public FechamentoParamptovta buscaParametrosPorPuntoventaEmpresa(PuntoVenta puntoventa, Empresa empresa) {
|
|
return fechamentoParamptovtaDAO.buscaParametrosPorPuntoventa(puntoventa, empresa);
|
|
}
|
|
}
|