Merge pull request 'bug #AL-4274' (!260) from AL-4274 into master
Reviewed-on: adm/ModelWeb#260 Reviewed-by: Célio de Souza Ribeiro JR <celio@rjconsultores.com.br> Reviewed-by: Gleison da Cruz <gleison.cruz@totvs.com.br>master
commit
a200fadfbf
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ModelWeb</artifactId>
|
<artifactId>ModelWeb</artifactId>
|
||||||
<version>1.99.0</version>
|
<version>1.100.0</version>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaNequiConfig;
|
||||||
|
|
||||||
|
public interface EmpresaNequiConfigDAO extends GenericDAO<EmpresaNequiConfig, Integer> {
|
||||||
|
|
||||||
|
public EmpresaNequiConfig buscarByEmpresa(Integer empresaId);
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
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.EmpresaNequiConfigDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaNequiConfig;
|
||||||
|
|
||||||
|
@Repository("empresaNequiConfigDAO")
|
||||||
|
public class EmpresaNequiConfigHibernateDAO extends GenericHibernateDAO<EmpresaNequiConfig, Integer>
|
||||||
|
implements EmpresaNequiConfigDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public EmpresaNequiConfigHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EmpresaNequiConfig> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq(ACTIVO, Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EmpresaNequiConfig buscarByEmpresa(Integer empresaId) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq(ACTIVO, Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("empresa.empresaId", empresaId));
|
||||||
|
|
||||||
|
return (EmpresaNequiConfig) c.uniqueResult();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,125 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
|
||||||
|
public class CampanhaCupomSorteado {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "CONVENIOCUPOMSORTEADO_ID")
|
||||||
|
private Integer campanhaCupomSorteadoId;
|
||||||
|
@JoinColumn(name = "CONVENIO_ID", referencedColumnName = "CONVENIO_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Convenio convenio;
|
||||||
|
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Empresa empresa;
|
||||||
|
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private PuntoVenta puntoVenta;
|
||||||
|
@JoinColumn(name = "BOLETOSORTEADO_ID", referencedColumnName = "BOLETO_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Boleto boletoSorteado;
|
||||||
|
@JoinColumn(name = "BOLETOCUPOM_ID", referencedColumnName = "BOLETO_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Boleto boletoCupom;
|
||||||
|
private String codigoCupom;
|
||||||
|
|
||||||
|
private Date fecmodif;
|
||||||
|
private Integer usuarioId;
|
||||||
|
private Boolean activo;
|
||||||
|
private Date feccreacion;
|
||||||
|
|
||||||
|
public Integer getCampanhaCupomSorteadoId() {
|
||||||
|
return campanhaCupomSorteadoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCampanhaCupomSorteadoId(Integer campanhaCupomSorteadoId) {
|
||||||
|
this.campanhaCupomSorteadoId = campanhaCupomSorteadoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Convenio getConvenio() {
|
||||||
|
return convenio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConvenio(Convenio convenio) {
|
||||||
|
this.convenio = convenio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PuntoVenta getPuntoVenta() {
|
||||||
|
return puntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPuntoVenta(PuntoVenta puntoVenta) {
|
||||||
|
this.puntoVenta = puntoVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boleto getBoletoSorteado() {
|
||||||
|
return boletoSorteado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBoletoSorteado(Boleto boletoSorteado) {
|
||||||
|
this.boletoSorteado = boletoSorteado;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boleto getBoletoCupom() {
|
||||||
|
return boletoCupom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBoletoCupom(Boleto boletoCupom) {
|
||||||
|
this.boletoCupom = boletoCupom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodigoCupom() {
|
||||||
|
return codigoCupom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodigoCupom(String codigoCupom) {
|
||||||
|
this.codigoCupom = codigoCupom;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFeccreacion() {
|
||||||
|
return feccreacion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFeccreacion(Date feccreacion) {
|
||||||
|
this.feccreacion = feccreacion;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,127 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "EMP_NEQUI_CONFIG_SEQ", sequenceName = "EMP_NEQUI_CONFIG_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "EMPRESA_NEQUI_CONFIG")
|
||||||
|
public class EmpresaNequiConfig implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMP_NEQUI_CONFIG_SEQ")
|
||||||
|
@Column(name = "EMPRESANEQUICONFIG_ID")
|
||||||
|
private Integer empresaNequiConfigId;
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "EMPRESA_ID")
|
||||||
|
private Empresa empresa;
|
||||||
|
@Column(name = "CLIENTID_NEQUI")
|
||||||
|
private String clienteIdNequi;
|
||||||
|
@Column(name = "HASH")
|
||||||
|
private String hash;
|
||||||
|
@Column(name = "API_KEY_NEQUI")
|
||||||
|
private String apiKey;
|
||||||
|
@Column(name = "URL")
|
||||||
|
private String url;
|
||||||
|
@Column(name = "CODE")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private Boolean activo;
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public Integer getEmpresaNequiConfigId() {
|
||||||
|
return empresaNequiConfigId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresaNequiConfigId(Integer empresaNequiConfigId) {
|
||||||
|
this.empresaNequiConfigId = empresaNequiConfigId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClienteIdNequi() {
|
||||||
|
return clienteIdNequi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClienteIdNequi(String clienteIdNequi) {
|
||||||
|
this.clienteIdNequi = clienteIdNequi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHash() {
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHash(String hash) {
|
||||||
|
this.hash = hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApiKey() {
|
||||||
|
return apiKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiKey(String apiKey) {
|
||||||
|
this.apiKey = apiKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -24,6 +24,7 @@ public enum TipoFormapago {
|
||||||
ADYEN(17,Labels.getLabel("editarFormaPagoController.lblAdyen.label")),
|
ADYEN(17,Labels.getLabel("editarFormaPagoController.lblAdyen.label")),
|
||||||
MERCADO_PAGO(18,Labels.getLabel("editarFormaPagoController.lblMercadoPago.label")),
|
MERCADO_PAGO(18,Labels.getLabel("editarFormaPagoController.lblMercadoPago.label")),
|
||||||
EMBARQUE_JA(19,Labels.getLabel("editarFormaPagoController.lblEmbarqueJa.label")),
|
EMBARQUE_JA(19,Labels.getLabel("editarFormaPagoController.lblEmbarqueJa.label")),
|
||||||
|
NEQUI(19,Labels.getLabel("editarFormaPagoController.lblNequi.label"))
|
||||||
;
|
;
|
||||||
|
|
||||||
private Integer valor;
|
private Integer valor;
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaNequiConfig;
|
||||||
|
|
||||||
|
public interface EmpresaNequiConfigService extends GenericService<EmpresaNequiConfig, Integer> {
|
||||||
|
|
||||||
|
public EmpresaNequiConfig buscarByEmpresa(Integer empresaId);
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
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.EmpresaNequiConfigDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EmpresaNequiConfig;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EmpresaNequiConfigService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("empresaNequiConfigService")
|
||||||
|
public class EmpresaNequiConfigServiceImpl implements EmpresaNequiConfigService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmpresaNequiConfigDAO empresaNequiConfigDAO;
|
||||||
|
|
||||||
|
public List<EmpresaNequiConfig> obtenerTodos() {
|
||||||
|
return empresaNequiConfigDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EmpresaNequiConfig obtenerID(Integer id) {
|
||||||
|
return empresaNequiConfigDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public EmpresaNequiConfig suscribir(EmpresaNequiConfig entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return empresaNequiConfigDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public EmpresaNequiConfig actualizacion(EmpresaNequiConfig entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return empresaNequiConfigDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(EmpresaNequiConfig entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
empresaNequiConfigDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EmpresaNequiConfig buscarByEmpresa(Integer empresaId) {
|
||||||
|
return empresaNequiConfigDAO.buscarByEmpresa(empresaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue