From b9e0a8b0ab266ccfa2b78a2b7389abae71db9376 Mon Sep 17 00:00:00 2001 From: "wallace.henrique" Date: Thu, 22 Aug 2024 19:27:22 -0300 Subject: [PATCH 1/3] fixes bug#AL-4822 --- pom.xml | 2 +- .../ventaboletos/dao/AliasClasseDAO.java | 2 ++ .../hibernate/AliasClasseHibernateDAO.java | 22 +++++++++++++++++++ .../service/impl/AliasClasseServiceImpl.java | 5 ++++- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 464a348ab..09e2599e4 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 br.com.rjconsultores ModelWeb - 1.98.0 + 1.98.1 diff --git a/src/com/rjconsultores/ventaboletos/dao/AliasClasseDAO.java b/src/com/rjconsultores/ventaboletos/dao/AliasClasseDAO.java index 5a1b0a0d6..9314d698a 100644 --- a/src/com/rjconsultores/ventaboletos/dao/AliasClasseDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/AliasClasseDAO.java @@ -9,5 +9,7 @@ import com.rjconsultores.ventaboletos.entidad.AliasClasse; public List buscar(Integer classe,Integer alias,Integer orgaoConcedente); public AliasClasse existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer aliasClasseId); + + public List buscar(Integer classe, Integer alias, Integer orgaoConcedente,Integer empresaId, Integer rutaId); } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AliasClasseHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AliasClasseHibernateDAO.java index 761aaeccc..ff9786a9b 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/AliasClasseHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AliasClasseHibernateDAO.java @@ -66,4 +66,26 @@ public class AliasClasseHibernateDAO extends GenericHibernateDAO buscar(Integer classe, Integer alias, Integer orgaoConcedente, Integer empresaId, Integer rutaId) { + Criteria c = makeCriteria(); + c.add(Restrictions.eq(ACTIVO, Boolean.TRUE)); + if( classe != null ) { + c.add(Restrictions.eq("classe.claseservicioId",classe)); + } + + if ( alias != null ) { + c.add(Restrictions.eq("alias.claseservicioId",alias)); + } + + if( orgaoConcedente != null ) { + c.add(Restrictions.eq("orgaoConcedente.orgaoConcedenteId", orgaoConcedente)); + } + + c.add(empresaId == null ? Restrictions.isNull("empresa.empresaId") : Restrictions.eq("empresa.empresaId", empresaId)); + c.add(rutaId == null ? Restrictions.isNull("ruta.rutaId") : Restrictions.eq("ruta.rutaId", rutaId)); + + return c.list(); + } + } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AliasClasseServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AliasClasseServiceImpl.java index d194e267c..adfd03bf2 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/AliasClasseServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/AliasClasseServiceImpl.java @@ -33,8 +33,11 @@ public class AliasClasseServiceImpl implements AliasClasseService { if ( (entidad.getClasse() == null) || (entidad.getAlias() == null) || (entidad.getOrgaoConcedente() == null) ){ throw new BusinessException("MSG.camposObrigatorios"); } + //manter a compatibilidade com os cadastros ja existentes + Integer empresaId = entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null; + Integer rutaId = entidad.getRuta() != null ? entidad.getRuta().getRutaId() : null; - List lsBusca = aliasClasseDAO.buscar(entidad.getClasse().getClaseservicioId(), null, entidad.getOrgaoConcedente().getOrgaoConcedenteId()); + List lsBusca = aliasClasseDAO.buscar(entidad.getClasse().getClaseservicioId(), entidad.getAlias().getClaseservicioId(), entidad.getOrgaoConcedente().getOrgaoConcedenteId(), empresaId, rutaId); if (!lsBusca.isEmpty()){ From ddaf04bef92f7b94352412d9384e758025a8b24d Mon Sep 17 00:00:00 2001 From: "valdir.cordeiro" Date: Fri, 23 Aug 2024 10:03:34 -0300 Subject: [PATCH 2/3] =?UTF-8?q?Bolivariano=20-=20Adequa=C3=A7=C3=B5es=20Co?= =?UTF-8?q?nex=C3=A3o=20entre=20linhas=20feat=20bug#AL-4465?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../entidad/ConexionRutaConf.java | 55 +++++++++++++++++++ .../ventaboletos/utilerias/CustomEnum.java | 9 ++- 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 09e2599e4..69570683a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 br.com.rjconsultores ModelWeb - 1.98.1 + 1.99.0 diff --git a/src/com/rjconsultores/ventaboletos/entidad/ConexionRutaConf.java b/src/com/rjconsultores/ventaboletos/entidad/ConexionRutaConf.java index 93198927b..a28146a72 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/ConexionRutaConf.java +++ b/src/com/rjconsultores/ventaboletos/entidad/ConexionRutaConf.java @@ -46,6 +46,21 @@ public class ConexionRutaConf implements Serializable { @Column(name = "DESCUENTO") private BigDecimal descuento; + @Column(name = "ISBLOQUEIOTRECHO_A") + private Boolean isBloqueioTrechoA; + + @Column(name = "ISBLOQUEIOTRECHO_B") + private Boolean isBloqueioTrechoB; + + @Column(name = "ISBLOQUEIOTRECHO_C") + private Boolean isBloqueioTrechoC; + + @Column(name = "PORCENTAGEM_OCUPACAO") + private Integer porcentagemOcupacao; + + @Column(name = "MINUTOS_ANTES_PARTIDA") + private Integer minutosAntesPartida; + public ConexionRutaConf() { super(); } @@ -144,4 +159,44 @@ public class ConexionRutaConf implements Serializable { public void setDescuento(BigDecimal descuento) { this.descuento = descuento; } + + public Boolean getIsBloqueioTrechoA() { + return isBloqueioTrechoA == null ? false: isBloqueioTrechoA; + } + + public void setIsBloqueioTrechoA(Boolean isBloqueioTrechoA) { + this.isBloqueioTrechoA = isBloqueioTrechoA; + } + + public Boolean getIsBloqueioTrechoB() { + return isBloqueioTrechoB == null ? false: isBloqueioTrechoB; + } + + public void setIsBloqueioTrechoB(Boolean isBloqueioTrechoB) { + this.isBloqueioTrechoB = isBloqueioTrechoB; + } + + public Boolean getIsBloqueioTrechoC() { + return isBloqueioTrechoC == null ? false: isBloqueioTrechoC; + } + + public void setIsBloqueioTrechoC(Boolean isBloqueioTrechoC) { + this.isBloqueioTrechoC = isBloqueioTrechoC; + } + + public Integer getPorcentagemOcupacao() { + return porcentagemOcupacao; + } + + public void setPorcentagemOcupacao(Integer porcentagemOcupacao) { + this.porcentagemOcupacao = porcentagemOcupacao; + } + + public Integer getMinutosAntesPartida() { + return minutosAntesPartida; + } + + public void setMinutosAntesPartida(Integer minutosAntesPartida) { + this.minutosAntesPartida = minutosAntesPartida; + } } diff --git a/src/com/rjconsultores/ventaboletos/utilerias/CustomEnum.java b/src/com/rjconsultores/ventaboletos/utilerias/CustomEnum.java index 03dbe8bdd..f5b92e98c 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/CustomEnum.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/CustomEnum.java @@ -157,7 +157,14 @@ public enum CustomEnum { VALIDA_ESTOQUE_SIMPLIFICADO("MODCLI_ValidaEstoqueSimplificado"), - IS_VENDA_SAFTAO("isVendaSaftao"); + IS_VENDA_SAFTAO("isVendaSaftao"), + + /** + * Ativa o Bloqueio de trecho por conexao. + * + * @return + */ + USA_BLOQUEIO_TRECHO_CONEXAO("usaBloqueioTrechoConexao"); private String descricao; From 7785c352e3f96556bc6c9f787cb8f3de5cb757c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aristides=20dos=20Reis=20J=C3=BAnior?= Date: Mon, 26 Aug 2024 16:39:19 -0300 Subject: [PATCH 3/3] bug #AL-4274 --- pom.xml | 2 +- .../dao/EmpresaNequiConfigDAO.java | 8 ++ .../EmpresaNequiConfigHibernateDAO.java | 39 ++++++ .../entidad/CampanhaCupomSorteado.java | 125 +++++++++++++++++ .../entidad/EmpresaNequiConfig.java | 127 ++++++++++++++++++ .../ventaboletos/enums/TipoFormapago.java | 1 + .../service/EmpresaNequiConfigService.java | 8 ++ .../impl/EmpresaNequiConfigServiceImpl.java | 60 +++++++++ 8 files changed, 369 insertions(+), 1 deletion(-) create mode 100644 src/com/rjconsultores/ventaboletos/dao/EmpresaNequiConfigDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaNequiConfigHibernateDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/entidad/CampanhaCupomSorteado.java create mode 100644 src/com/rjconsultores/ventaboletos/entidad/EmpresaNequiConfig.java create mode 100644 src/com/rjconsultores/ventaboletos/service/EmpresaNequiConfigService.java create mode 100644 src/com/rjconsultores/ventaboletos/service/impl/EmpresaNequiConfigServiceImpl.java diff --git a/pom.xml b/pom.xml index 69570683a..d526905a7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 br.com.rjconsultores ModelWeb - 1.99.0 + 1.100.0 diff --git a/src/com/rjconsultores/ventaboletos/dao/EmpresaNequiConfigDAO.java b/src/com/rjconsultores/ventaboletos/dao/EmpresaNequiConfigDAO.java new file mode 100644 index 000000000..2cccb2bbe --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EmpresaNequiConfigDAO.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.EmpresaNequiConfig; + +public interface EmpresaNequiConfigDAO extends GenericDAO { + + public EmpresaNequiConfig buscarByEmpresa(Integer empresaId); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaNequiConfigHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaNequiConfigHibernateDAO.java new file mode 100644 index 000000000..00abd6b02 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaNequiConfigHibernateDAO.java @@ -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 + implements EmpresaNequiConfigDAO { + + @Autowired + public EmpresaNequiConfigHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List 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(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/CampanhaCupomSorteado.java b/src/com/rjconsultores/ventaboletos/entidad/CampanhaCupomSorteado.java new file mode 100644 index 000000000..ccd493bf7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/CampanhaCupomSorteado.java @@ -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; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/EmpresaNequiConfig.java b/src/com/rjconsultores/ventaboletos/entidad/EmpresaNequiConfig.java new file mode 100644 index 000000000..abe59c691 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EmpresaNequiConfig.java @@ -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; + } + +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java b/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java index 06b8fee7b..47870a148 100644 --- a/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java +++ b/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java @@ -24,6 +24,7 @@ public enum TipoFormapago { ADYEN(17,Labels.getLabel("editarFormaPagoController.lblAdyen.label")), MERCADO_PAGO(18,Labels.getLabel("editarFormaPagoController.lblMercadoPago.label")), EMBARQUE_JA(19,Labels.getLabel("editarFormaPagoController.lblEmbarqueJa.label")), + NEQUI(19,Labels.getLabel("editarFormaPagoController.lblNequi.label")) ; private Integer valor; diff --git a/src/com/rjconsultores/ventaboletos/service/EmpresaNequiConfigService.java b/src/com/rjconsultores/ventaboletos/service/EmpresaNequiConfigService.java new file mode 100644 index 000000000..ba6bc572f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EmpresaNequiConfigService.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.EmpresaNequiConfig; + +public interface EmpresaNequiConfigService extends GenericService { + + public EmpresaNequiConfig buscarByEmpresa(Integer empresaId); +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EmpresaNequiConfigServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaNequiConfigServiceImpl.java new file mode 100644 index 000000000..d1431a2e6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaNequiConfigServiceImpl.java @@ -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 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); + } + +}