bug#12282
dev:lucas qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@86923 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
be1f262059
commit
06613080c6
|
@ -0,0 +1,14 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig;
|
||||||
|
|
||||||
|
public interface EmpresaEmailConfigDAO extends GenericDAO<EmpresaEmailConfig, Integer> {
|
||||||
|
|
||||||
|
public List<EmpresaEmailConfig> obtenerTodos();
|
||||||
|
|
||||||
|
public EmpresaEmailConfig buscarPorEmpresa(Empresa empresa);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmail;
|
||||||
|
|
||||||
|
public interface EmpresaEmailDAO extends GenericDAO<EmpresaEmail, Integer> {
|
||||||
|
|
||||||
|
public List<EmpresaEmail> obtenerTodos();
|
||||||
|
|
||||||
|
public EmpresaEmail buscarPorEmpresa(Empresa empresa);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.EmpresaEmailConfigDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig;
|
||||||
|
|
||||||
|
@Repository("empresaEmailConfigDAO")
|
||||||
|
public class EmpresaEmailConfigHibernateDAO extends GenericHibernateDAO<EmpresaEmailConfig, Integer>
|
||||||
|
implements EmpresaEmailConfigDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public EmpresaEmailConfigHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmpresaEmailConfig> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmpresaEmailConfig buscarPorEmpresa(Empresa empresa) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("empresa", empresa));
|
||||||
|
|
||||||
|
return (EmpresaEmailConfig) c.uniqueResult();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.EmpresaEmailDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmail;
|
||||||
|
|
||||||
|
@Repository("empresaEmailDAO")
|
||||||
|
public class EmpresaEmailHibernateDAO extends GenericHibernateDAO<EmpresaEmail, Integer>
|
||||||
|
implements EmpresaEmailDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public EmpresaEmailHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmpresaEmail> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmpresaEmail buscarPorEmpresa(Empresa empresa) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("empresa", empresa));
|
||||||
|
|
||||||
|
return (EmpresaEmail) c.uniqueResult();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,156 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "EMPRESA_EMAIL_SEQ", sequenceName = "EMPRESA_EMAIL_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "EMPRESA_EMAIL")
|
||||||
|
public class EmpresaEmail implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_EMAIL_SEQ")
|
||||||
|
@Column(name = "EMPRESAEMAIL_ID")
|
||||||
|
private Integer empresaEmailId;
|
||||||
|
@Column(name = "TEXTOEMAIL")
|
||||||
|
private String textoEmail;
|
||||||
|
@Column(name = "TEXTOCUPOMEMBARQUE")
|
||||||
|
private String textoCupomEmbarque;
|
||||||
|
@Column(name = "ASSUNTO")
|
||||||
|
private String assunto;
|
||||||
|
@Column(name = "EMAILDE")
|
||||||
|
private String emailDe;
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "EMPRESA_ID")
|
||||||
|
private Empresa empresa;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public EmpresaEmail() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getEmpresaEmailId() {
|
||||||
|
return empresaEmailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresaEmailId(Integer empresaEmailId) {
|
||||||
|
this.empresaEmailId = empresaEmailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTextoEmail() {
|
||||||
|
return textoEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextoEmail(String textoEmail) {
|
||||||
|
this.textoEmail = textoEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTextoCupomEmbarque() {
|
||||||
|
return textoCupomEmbarque;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTextoCupomEmbarque(String textoCupomEmbarque) {
|
||||||
|
this.textoCupomEmbarque = textoCupomEmbarque;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAssunto() {
|
||||||
|
return assunto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssunto(String assunto) {
|
||||||
|
this.assunto = assunto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmailDe() {
|
||||||
|
return emailDe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmailDe(String emailDe) {
|
||||||
|
this.emailDe = emailDe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result
|
||||||
|
+ ((empresaEmailId == null) ? 0 : empresaEmailId.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
EmpresaEmail other = (EmpresaEmail) obj;
|
||||||
|
if (empresaEmailId == null) {
|
||||||
|
if (other.empresaEmailId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!empresaEmailId.equals(other.empresaEmailId))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(this.getEmpresaEmailId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,156 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "EMPRESA_EMAIL_CONFIG_SEQ", sequenceName = "EMPRESA_EMAIL_CONFIG_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "EMPRESA_EMAIL_CONFIG")
|
||||||
|
public class EmpresaEmailConfig implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_EMAIL_CONFIG_SEQ")
|
||||||
|
@Column(name = "EMPRESAEMAILCONFIG_ID")
|
||||||
|
private Integer empresaEmailConfigId;
|
||||||
|
@Column(name = "SMTP")
|
||||||
|
private String smtp;
|
||||||
|
@Column(name = "SENHA")
|
||||||
|
private String senha;
|
||||||
|
@Column(name = "SMTPPORTA")
|
||||||
|
private String smtpPorta;
|
||||||
|
@Column(name = "SMTPEMAIL")
|
||||||
|
private String smtpEmail;
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "EMPRESA_ID")
|
||||||
|
private Empresa empresa;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public EmpresaEmailConfig() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getEmpresaEmailConfigId() {
|
||||||
|
return empresaEmailConfigId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresaEmailConfigId(Integer empresaEmailConfigId) {
|
||||||
|
this.empresaEmailConfigId = empresaEmailConfigId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSmtp() {
|
||||||
|
return smtp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSmtp(String smtp) {
|
||||||
|
this.smtp = smtp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSenha() {
|
||||||
|
return senha;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSenha(String senha) {
|
||||||
|
this.senha = senha;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSmtpPorta() {
|
||||||
|
return smtpPorta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSmtpPorta(String smtpPorta) {
|
||||||
|
this.smtpPorta = smtpPorta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSmtpEmail() {
|
||||||
|
return smtpEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSmtpEmail(String smtpEmail) {
|
||||||
|
this.smtpEmail = smtpEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result
|
||||||
|
+ ((empresaEmailConfigId == null) ? 0 : empresaEmailConfigId.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (getClass() != obj.getClass())
|
||||||
|
return false;
|
||||||
|
EmpresaEmailConfig other = (EmpresaEmailConfig) obj;
|
||||||
|
if (empresaEmailConfigId == null) {
|
||||||
|
if (other.empresaEmailConfigId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!empresaEmailConfigId.equals(other.empresaEmailConfigId))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.valueOf(this.getEmpresaEmailConfigId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig;
|
||||||
|
|
||||||
|
public interface EmpresaEmailConfigService extends GenericService<EmpresaEmailConfig, Integer> {
|
||||||
|
|
||||||
|
public EmpresaEmailConfig buscarPorEmpresa(Empresa empresa);
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmail;
|
||||||
|
|
||||||
|
public interface EmpresaEmailService extends GenericService<EmpresaEmail, Integer> {
|
||||||
|
|
||||||
|
public EmpresaEmail buscarPorEmpresa(Empresa empresa);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.EmpresaEmailConfigDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EmpresaEmailConfigService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("empresaEmailConfigService")
|
||||||
|
public class EmpresaEmailConfigServiceImpl implements EmpresaEmailConfigService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmpresaEmailConfigDAO empresaEmailConfigDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmpresaEmailConfig> obtenerTodos() {
|
||||||
|
return empresaEmailConfigDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmpresaEmailConfig obtenerID(Integer id) {
|
||||||
|
return empresaEmailConfigDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public EmpresaEmailConfig suscribir(EmpresaEmailConfig entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return empresaEmailConfigDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public EmpresaEmailConfig actualizacion(EmpresaEmailConfig entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return empresaEmailConfigDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void borrar(EmpresaEmailConfig entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
empresaEmailConfigDAO.actualizacion(entidad);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmpresaEmailConfig buscarPorEmpresa(Empresa empresa) {
|
||||||
|
return empresaEmailConfigDAO.buscarPorEmpresa(empresa);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.EmpresaEmailDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaEmail;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EmpresaEmailService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("empresaEmailService")
|
||||||
|
public class EmpresaEmailServiceImpl implements EmpresaEmailService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmpresaEmailDAO empresaEmailDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmpresaEmail> obtenerTodos() {
|
||||||
|
return empresaEmailDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmpresaEmail obtenerID(Integer id) {
|
||||||
|
return empresaEmailDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public EmpresaEmail suscribir(EmpresaEmail entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return empresaEmailDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public EmpresaEmail actualizacion(EmpresaEmail entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return empresaEmailDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void borrar(EmpresaEmail entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
empresaEmailDAO.actualizacion(entidad);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EmpresaEmail buscarPorEmpresa(Empresa empresa) {
|
||||||
|
return empresaEmailDAO.buscarPorEmpresa(empresa);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue