AL-1231
parent
f55b581bd8
commit
3f6da882eb
|
@ -0,0 +1,14 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaAdyenConfig;
|
||||
|
||||
public interface EmpresaAdyenConfigDAO extends GenericDAO<EmpresaAdyenConfig, Integer> {
|
||||
|
||||
public List<EmpresaAdyenConfig> obtenerTodos();
|
||||
|
||||
public EmpresaAdyenConfig 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.EmpresaAdyenConfigDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaAdyenConfig;
|
||||
|
||||
@Repository("empresaAdyenConfigDAO")
|
||||
public class EmpresaAdyenConfigHibernateDAO extends GenericHibernateDAO<EmpresaAdyenConfig, Integer>
|
||||
implements EmpresaAdyenConfigDAO {
|
||||
|
||||
@Autowired
|
||||
public EmpresaAdyenConfigHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmpresaAdyenConfig> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmpresaAdyenConfig buscarPorEmpresa(Empresa empresa) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.eq("empresa", empresa));
|
||||
|
||||
return (EmpresaAdyenConfig) c.uniqueResult();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
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;
|
||||
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(name = "EMPRESA_ADYEN_CONFIG_SEQ", sequenceName = "EMPRESA_ADYEN_CONFIG_SEQ", allocationSize = 1)
|
||||
@Table(name = "EMPRESA_ADYEN_CONFIG")
|
||||
public class EmpresaAdyenConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_ADYEN_CONFIG_SEQ")
|
||||
@Column(name = "EMPRESAADYENCONFIG_ID")
|
||||
private Integer empresaAdyenConfigId;
|
||||
@OneToOne
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
private Empresa empresa;
|
||||
@Column(name = "APIKEY")
|
||||
private String apiKey;
|
||||
@Column(name = "INDPRODUCAO")
|
||||
private Boolean indProducao;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
public EmpresaAdyenConfig() {
|
||||
|
||||
}
|
||||
|
||||
public Integer getEmpresaAdyenConfigId() {
|
||||
return empresaAdyenConfigId;
|
||||
}
|
||||
|
||||
public void setEmpresaAdyenConfigId(Integer empresaAdyenConfigId) {
|
||||
this.empresaAdyenConfigId = empresaAdyenConfigId;
|
||||
}
|
||||
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
public String getApiKey() {
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
public void setApiKey(String apiKey) {
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
public Boolean getIndProducao() {
|
||||
return indProducao;
|
||||
}
|
||||
|
||||
public void setIndProducao(Boolean indProducao) {
|
||||
this.indProducao = indProducao;
|
||||
}
|
||||
|
||||
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 + ((empresaAdyenConfigId == null) ? 0 : empresaAdyenConfigId.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;
|
||||
EmpresaAdyenConfig other = (EmpresaAdyenConfig) obj;
|
||||
if (empresaAdyenConfigId == null) {
|
||||
if (other.empresaAdyenConfigId != null)
|
||||
return false;
|
||||
} else if (!empresaAdyenConfigId.equals(other.empresaAdyenConfigId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(this.getEmpresaAdyenConfigId());
|
||||
}
|
||||
|
||||
}
|
|
@ -70,6 +70,12 @@ public class EstacionSitef implements Serializable {
|
|||
@Column(name = "CNPJ")
|
||||
private String cnpj;
|
||||
|
||||
@Column(name = "NUMERODESERIE")
|
||||
private String numeroDeSerie;
|
||||
|
||||
@Column(name = "DESCRICAO")
|
||||
private String descricao;
|
||||
|
||||
public EstacionSitef() {
|
||||
}
|
||||
|
||||
|
@ -206,4 +212,20 @@ public class EstacionSitef implements Serializable {
|
|||
public void setSenhaConfig(String senhaConfig) {
|
||||
this.senhaConfig = senhaConfig;
|
||||
}
|
||||
|
||||
public String getNumeroDeSerie() {
|
||||
return numeroDeSerie;
|
||||
}
|
||||
|
||||
public void setNumeroDeSerie(String numeroDeSerie) {
|
||||
this.numeroDeSerie = numeroDeSerie;
|
||||
}
|
||||
|
||||
public String getDescricao() {
|
||||
return descricao;
|
||||
}
|
||||
|
||||
public void setDescricao(String descricao) {
|
||||
this.descricao = descricao;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,8 @@ public class Moneda implements Serializable {
|
|||
private List<PuntoVenta> puntoVentaList;
|
||||
@Column(name = "EQUIVALENCIA_ID")
|
||||
private String equivalenciaId;
|
||||
@Column(name = "SIGLA")
|
||||
private String sigla;
|
||||
|
||||
public Moneda() {
|
||||
}
|
||||
|
@ -156,4 +158,13 @@ public class Moneda implements Serializable {
|
|||
public void setSimbolo(String simbolo) {
|
||||
this.simbolo = simbolo;
|
||||
}
|
||||
|
||||
public String getSigla() {
|
||||
return sigla;
|
||||
}
|
||||
|
||||
public void setSigla(String sigla) {
|
||||
this.sigla = sigla;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,9 @@ public enum TipoFormapago {
|
|||
SMART_CARD(13,Labels.getLabel("editarFormaPagoController.lblSmartCard.label")),
|
||||
LOGPAY(14,Labels.getLabel("editarFormaPagoController.lblLogpay.label")),
|
||||
TPI(15, Labels.getLabel("editarFormaPagoController.lblTPI.label")),
|
||||
MOBIPIX(16,Labels.getLabel("editarFormaPagoController.lblMobiPix.label"));
|
||||
MOBIPIX(16,Labels.getLabel("editarFormaPagoController.lblMobiPix.label")),
|
||||
ADYEN(17,Labels.getLabel("editarFormaPagoController.lblAdyen.label")),
|
||||
;
|
||||
|
||||
private Integer valor;
|
||||
private String descricao;
|
||||
|
|
|
@ -8,6 +8,7 @@ public enum TipoIntegracaoTEF {
|
|||
SITEF("Sitef"),
|
||||
PAYGO("PayGo"),
|
||||
GRANITO("Granito"),
|
||||
ADYEN("Adyen"),
|
||||
;
|
||||
|
||||
private String descricao;
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaAdyenConfig;
|
||||
|
||||
public interface EmpresaAdyenConfigService extends GenericService<EmpresaAdyenConfig, Integer> {
|
||||
|
||||
public EmpresaAdyenConfig buscarPorEmpresa(Empresa empresa);
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
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.EmpresaAdyenConfigDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaAdyenConfig;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaAdyenConfigService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("empresaAdyenConfigService")
|
||||
public class EmpresaAdyenConfigServiceImpl implements EmpresaAdyenConfigService {
|
||||
|
||||
@Autowired
|
||||
private EmpresaAdyenConfigDAO empresaAdyenConfigDAO;
|
||||
|
||||
@Override
|
||||
public List<EmpresaAdyenConfig> obtenerTodos() {
|
||||
return empresaAdyenConfigDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmpresaAdyenConfig obtenerID(Integer id) {
|
||||
return empresaAdyenConfigDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public EmpresaAdyenConfig suscribir(EmpresaAdyenConfig entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return empresaAdyenConfigDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public EmpresaAdyenConfig actualizacion(EmpresaAdyenConfig entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return empresaAdyenConfigDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void borrar(EmpresaAdyenConfig entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
empresaAdyenConfigDAO.actualizacion(entidad);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmpresaAdyenConfig buscarPorEmpresa(Empresa empresa) {
|
||||
return empresaAdyenConfigDAO.buscarPorEmpresa(empresa);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue