From 1aa8a2fad64b61db8ee10a906fda729132347a0c Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 27 Jun 2024 19:25:12 -0300 Subject: [PATCH 1/2] AL-4280 --- .../dao/AsistenciaDeViajeEmpresaDAO.java | 8 + .../dao/ImpresionLayoutConfigDAO.java | 14 ++ .../ventaboletos/dao/TipoEventoExtraDAO.java | 2 + .../AsistenciaDeViajeEmpresaHibernateDAO.java | 37 +++++ .../ImpresionLayoutConfigHibernateDAO.java | 51 +++++++ .../TipoEventoExtraHibernateDAO.java | 10 ++ .../entidad/AsistenciaDeViajeEmpresa.java | 123 +++++++++++++++ .../entidad/ImpresionLayoutConfig.java | 140 ++++++++++++++++++ .../ventaboletos/entidad/PtoVtaSeguro.java | 24 +++ .../ventaboletos/entidad/TipoEventoExtra.java | 15 +- .../enums/EnumLinguagemImpresion.java | 33 +++++ .../AsistenciaDeViajeEmpresaService.java | 9 ++ .../service/ImpresionLayoutConfigService.java | 13 ++ .../service/TipoEventoExtraService.java | 2 + .../AsistenciaDeViajeEmpresaServiceImpl.java | 56 +++++++ .../ImpresionLayoutConfigServiceImpl.java | 64 ++++++++ .../impl/TipoEventoExtraServiceImpl.java | 5 + 17 files changed, 604 insertions(+), 2 deletions(-) create mode 100644 src/com/rjconsultores/ventaboletos/dao/AsistenciaDeViajeEmpresaDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/dao/ImpresionLayoutConfigDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/dao/hibernate/AsistenciaDeViajeEmpresaHibernateDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/dao/hibernate/ImpresionLayoutConfigHibernateDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/entidad/AsistenciaDeViajeEmpresa.java create mode 100644 src/com/rjconsultores/ventaboletos/entidad/ImpresionLayoutConfig.java create mode 100644 src/com/rjconsultores/ventaboletos/enums/EnumLinguagemImpresion.java create mode 100644 src/com/rjconsultores/ventaboletos/service/AsistenciaDeViajeEmpresaService.java create mode 100644 src/com/rjconsultores/ventaboletos/service/ImpresionLayoutConfigService.java create mode 100644 src/com/rjconsultores/ventaboletos/service/impl/AsistenciaDeViajeEmpresaServiceImpl.java create mode 100644 src/com/rjconsultores/ventaboletos/service/impl/ImpresionLayoutConfigServiceImpl.java diff --git a/src/com/rjconsultores/ventaboletos/dao/AsistenciaDeViajeEmpresaDAO.java b/src/com/rjconsultores/ventaboletos/dao/AsistenciaDeViajeEmpresaDAO.java new file mode 100644 index 000000000..d39bb8c82 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/AsistenciaDeViajeEmpresaDAO.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.AsistenciaDeViajeEmpresa; +import com.rjconsultores.ventaboletos.entidad.Empresa; + +public interface AsistenciaDeViajeEmpresaDAO extends GenericDAO { + public boolean existe(Empresa empresa); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ImpresionLayoutConfigDAO.java b/src/com/rjconsultores/ventaboletos/dao/ImpresionLayoutConfigDAO.java new file mode 100644 index 000000000..4e97e6ca6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ImpresionLayoutConfigDAO.java @@ -0,0 +1,14 @@ + +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ImpresionLayoutConfig; + +public interface ImpresionLayoutConfigDAO extends GenericDAO { + + List buscar(String descricao); + + List buscarLike(String descricao); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TipoEventoExtraDAO.java b/src/com/rjconsultores/ventaboletos/dao/TipoEventoExtraDAO.java index 6e3b7a7a7..be8ea9319 100644 --- a/src/com/rjconsultores/ventaboletos/dao/TipoEventoExtraDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/TipoEventoExtraDAO.java @@ -8,4 +8,6 @@ public interface TipoEventoExtraDAO extends GenericDAO { public List buscar(String descingreso); + + public List buscarLike(String descingreso); } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AsistenciaDeViajeEmpresaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AsistenciaDeViajeEmpresaHibernateDAO.java new file mode 100644 index 000000000..6cd5e945b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AsistenciaDeViajeEmpresaHibernateDAO.java @@ -0,0 +1,37 @@ +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.AsistenciaDeViajeEmpresaDAO; +import com.rjconsultores.ventaboletos.entidad.AsistenciaDeViajeEmpresa; +import com.rjconsultores.ventaboletos.entidad.Empresa; + +@Repository("asistenciaDeViajeEmpresaDAO") +public class AsistenciaDeViajeEmpresaHibernateDAO extends GenericHibernateDAO implements AsistenciaDeViajeEmpresaDAO { + + @Autowired + public AsistenciaDeViajeEmpresaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + public List obtenerTodos() { + Criteria c = makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public boolean existe(Empresa empresa){ + Criteria c = makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("empresa", empresa)); + return !c.list().isEmpty(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ImpresionLayoutConfigHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ImpresionLayoutConfigHibernateDAO.java new file mode 100644 index 000000000..5d3767a63 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ImpresionLayoutConfigHibernateDAO.java @@ -0,0 +1,51 @@ + +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.MatchMode; +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.ImpresionLayoutConfigDAO; +import com.rjconsultores.ventaboletos.entidad.ImpresionLayoutConfig; + +@Repository("impresionLayoutConfigDAO") +public class ImpresionLayoutConfigHibernateDAO extends GenericHibernateDAO + implements ImpresionLayoutConfigDAO { + + @Autowired + public ImpresionLayoutConfigHibernateDAO(@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 List buscar(String descricao) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.eq("descricao", descricao)); + + return c.list(); + } + + public List buscarLike(String descricao) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + c.add(Restrictions.like("descricao", descricao, MatchMode.ANYWHERE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEventoExtraHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEventoExtraHibernateDAO.java index dd3d95e90..0b2ae0eec 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEventoExtraHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TipoEventoExtraHibernateDAO.java @@ -4,6 +4,7 @@ import java.util.List; import org.hibernate.Criteria; import org.hibernate.SessionFactory; +import org.hibernate.criterion.MatchMode; import org.hibernate.criterion.Restrictions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -39,4 +40,13 @@ public class TipoEventoExtraHibernateDAO extends return c.list(); } + + @Override + public List buscarLike(String nombIngreso) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.like("descTipoEvento", nombIngreso, MatchMode.ANYWHERE)); + + return c.list(); + } } diff --git a/src/com/rjconsultores/ventaboletos/entidad/AsistenciaDeViajeEmpresa.java b/src/com/rjconsultores/ventaboletos/entidad/AsistenciaDeViajeEmpresa.java new file mode 100644 index 000000000..0cc74b088 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/AsistenciaDeViajeEmpresa.java @@ -0,0 +1,123 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +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.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "ASISTVIAJE_EMPRESA_SEQ", sequenceName = "ASISTVIAJE_EMPRESA_SEQ", allocationSize = 1) +@Table(name = "ASISTVIAJE_EMPRESA") +public class AsistenciaDeViajeEmpresa implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ASISTVIAJE_EMPRESA_SEQ") + @Column(name = "ASISTVIAJEEMPRESA_ID ") + private Integer asistenciaDeViajeEmpresaId; + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + @Column(name = "TARIFA") + private BigDecimal tarifa; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Integer getAsistenciaDeViajeEmpresaId() { + return asistenciaDeViajeEmpresaId; + } + + public void setAsistenciaDeViajeEmpresaId(Integer asistenciaDeViajeEmpresaId) { + this.asistenciaDeViajeEmpresaId = asistenciaDeViajeEmpresaId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public BigDecimal getTarifa() { + return tarifa; + } + + public void setTarifa(BigDecimal tarifa) { + this.tarifa = tarifa; + } + + 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 + ((asistenciaDeViajeEmpresaId == null) ? 0 : asistenciaDeViajeEmpresaId.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; + AsistenciaDeViajeEmpresa other = (AsistenciaDeViajeEmpresa) obj; + if (asistenciaDeViajeEmpresaId == null) { + if (other.asistenciaDeViajeEmpresaId != null) + return false; + } else if (!asistenciaDeViajeEmpresaId.equals(other.asistenciaDeViajeEmpresaId)) + return false; + return true; + } + + @Override + public String toString() { + return String.valueOf(this.getAsistenciaDeViajeEmpresaId()); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/ImpresionLayoutConfig.java b/src/com/rjconsultores/ventaboletos/entidad/ImpresionLayoutConfig.java new file mode 100644 index 000000000..6061742e2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ImpresionLayoutConfig.java @@ -0,0 +1,140 @@ +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.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.Parameter; +import org.hibernate.annotations.Type; + +import com.rjconsultores.ventaboletos.enums.EnumLinguagemImpresion; + +@Entity +@SequenceGenerator(name = "IMPRESION_LAYOUT_CONFIG_SEQ", sequenceName = "IMPRESION_LAYOUT_CONFIG_SEQ", allocationSize = 1) +@Table(name = "IMPRESION_LAYOUT_CONFIG") +public class ImpresionLayoutConfig implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "IMPRESION_LAYOUT_CONFIG_SEQ") + @Column(name = "IMPRESIONLAYOUTCONFIG_ID") + private Integer impresionLayoutConfigId; + @Column(name = "DESCRICAO") + private String descricao; + @Column(name = "TEXTO") + private String texto; + @Type(type = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate", parameters = { + @Parameter(name = "type", value = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate"), + @Parameter(name = "class", value = "com.rjconsultores.ventaboletos.enums.EnumLinguagemImpresion"), + @Parameter(name = "sqlType", value = "4")/* Types.INTEGER */, + @Parameter(name = "enumName", value = "false"), @Parameter(name = "enumMethod", value = "getLinguagemImpresionByValor") }) + @Column(name = "LINGUAGEM") + private EnumLinguagemImpresion linguagem; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public ImpresionLayoutConfig() { + } + + public Integer getImpresionLayoutConfigId() { + return impresionLayoutConfigId; + } + + public void setImpresionLayoutConfigId(Integer impresionLayoutConfigId) { + this.impresionLayoutConfigId = impresionLayoutConfigId; + } + + public String getDescricao() { + return descricao; + } + + public void setDescricao(String descricao) { + this.descricao = descricao; + } + + public String getTexto() { + return texto; + } + + public void setTexto(String texto) { + this.texto = texto; + } + + public EnumLinguagemImpresion getLinguagem() { + return linguagem; + } + + public void setLinguagem(EnumLinguagemImpresion linguagem) { + this.linguagem = linguagem; + } + + 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() { + int hash = 0; + hash += (impresionLayoutConfigId != null ? impresionLayoutConfigId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof ImpresionLayoutConfig)) { + return false; + } + ImpresionLayoutConfig other = (ImpresionLayoutConfig) object; + if ((this.impresionLayoutConfigId == null && other.impresionLayoutConfigId != null) + || (this.impresionLayoutConfigId != null + && !this.impresionLayoutConfigId.equals(other.impresionLayoutConfigId))) { + return false; + } + return true; + } + + @Override + public String toString() { + if (getDescricao() != null || getImpresionLayoutConfigId() != null) { + return this.getDescricao() + " - " + this.getLinguagem(); + } + return getDescricao(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PtoVtaSeguro.java b/src/com/rjconsultores/ventaboletos/entidad/PtoVtaSeguro.java index 8ed076e0f..935f1efae 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/PtoVtaSeguro.java +++ b/src/com/rjconsultores/ventaboletos/entidad/PtoVtaSeguro.java @@ -108,6 +108,14 @@ public class PtoVtaSeguro implements Serializable, Auditavel{ @Column(name = "INDTAXAEMBARQUEEMBARCADA") private Boolean indTaxaEmbarqueEmbarcada; + @Basic(optional = false) + @Column(name = "INDVENDASISTVIAJE") + private Boolean indVendeAsistenciaDeViaje; + + @Basic(optional = false) + @Column(name = "INDESTANASISTVIAJE") + private Boolean indEstanAsistenciaDeViaje; + @Transient @NaoAuditar private PtoVtaSeguro ptoVtaSeguroClone; @@ -280,6 +288,22 @@ public class PtoVtaSeguro implements Serializable, Auditavel{ this.indTaxaEmbarqueEmbarcada = indTaxaEmbarqueEmbarcada; } + public Boolean getIndVendeAsistenciaDeViaje() { + return indVendeAsistenciaDeViaje; + } + + public void setIndVendeAsistenciaDeViaje(Boolean indVendeAsistenciaDeViaje) { + this.indVendeAsistenciaDeViaje = indVendeAsistenciaDeViaje; + } + + public Boolean getIndEstanAsistenciaDeViaje() { + return indEstanAsistenciaDeViaje; + } + + public void setIndEstanAsistenciaDeViaje(Boolean indEstanAsistenciaDeViaje) { + this.indEstanAsistenciaDeViaje = indEstanAsistenciaDeViaje; + } + @Override public void clonar() throws CloneNotSupportedException { diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoEventoExtra.java b/src/com/rjconsultores/ventaboletos/entidad/TipoEventoExtra.java index 79cc6e394..024cfec30 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/TipoEventoExtra.java +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoEventoExtra.java @@ -21,6 +21,7 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; +import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Temporal; @@ -122,6 +123,10 @@ public class TipoEventoExtra implements Serializable { @Column(name = "INDVALIDAESTOQUE") private Boolean indValidarEstoque; + + @OneToOne + @JoinColumn(name = "IMPRESIONLAYOUTCONFIG_ID") + private ImpresionLayoutConfig impresionLayoutConfig; public TipoEventoExtraEmpresa addEmpresa(Empresa e) { TipoEventoExtraEmpresa t = new TipoEventoExtraEmpresa(); @@ -462,7 +467,13 @@ public class TipoEventoExtra implements Serializable { public void setIndEnviaExcessoDeBagagemSefaz(Boolean indEnviaExcessoDeBagagemSefaz) { this.indEnviaExcessoDeBagagemSefaz = indEnviaExcessoDeBagagemSefaz; } - - + + public ImpresionLayoutConfig getImpresionLayoutConfig() { + return impresionLayoutConfig; + } + + public void setImpresionLayoutConfig(ImpresionLayoutConfig impresionLayoutConfig) { + this.impresionLayoutConfig = impresionLayoutConfig; + } } diff --git a/src/com/rjconsultores/ventaboletos/enums/EnumLinguagemImpresion.java b/src/com/rjconsultores/ventaboletos/enums/EnumLinguagemImpresion.java new file mode 100644 index 000000000..2a3bc1acf --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/enums/EnumLinguagemImpresion.java @@ -0,0 +1,33 @@ +package com.rjconsultores.ventaboletos.enums; + +public enum EnumLinguagemImpresion { + HTML(0), + ZPL(1), + ; + + private Integer id; + + private EnumLinguagemImpresion(Integer id) { + this.id = id; + } + + public Integer getId() { + return this.id; + } + + public static EnumLinguagemImpresion getLinguagemImpresionByValor(Integer valor) { + + for (EnumLinguagemImpresion enumLinguagemImpresion : EnumLinguagemImpresion.values()) { + if (enumLinguagemImpresion.getId().equals(valor)) { + return enumLinguagemImpresion; + } + } + return null; + } + + @Override + public String toString() { + return this.name(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/AsistenciaDeViajeEmpresaService.java b/src/com/rjconsultores/ventaboletos/service/AsistenciaDeViajeEmpresaService.java new file mode 100644 index 000000000..38398b98e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/AsistenciaDeViajeEmpresaService.java @@ -0,0 +1,9 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.AsistenciaDeViajeEmpresa; +import com.rjconsultores.ventaboletos.entidad.Empresa; + +public interface AsistenciaDeViajeEmpresaService extends GenericService{ + public boolean existe(Empresa empresa); + +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/service/ImpresionLayoutConfigService.java b/src/com/rjconsultores/ventaboletos/service/ImpresionLayoutConfigService.java new file mode 100644 index 000000000..e3093872d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ImpresionLayoutConfigService.java @@ -0,0 +1,13 @@ + +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ImpresionLayoutConfig; + +public interface ImpresionLayoutConfigService extends GenericService { + + public List buscar(String descricao); + + public List buscarLike(String descricao); +} diff --git a/src/com/rjconsultores/ventaboletos/service/TipoEventoExtraService.java b/src/com/rjconsultores/ventaboletos/service/TipoEventoExtraService.java index 5328d56fe..2fd7c479b 100644 --- a/src/com/rjconsultores/ventaboletos/service/TipoEventoExtraService.java +++ b/src/com/rjconsultores/ventaboletos/service/TipoEventoExtraService.java @@ -9,6 +9,8 @@ import com.rjconsultores.ventaboletos.exception.ValidacionCampoException; public interface TipoEventoExtraService { public List buscar(String descingreso); + + public List buscarLike(String descingreso); public List obtenerTodos(); diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AsistenciaDeViajeEmpresaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AsistenciaDeViajeEmpresaServiceImpl.java new file mode 100644 index 000000000..a91db709a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/AsistenciaDeViajeEmpresaServiceImpl.java @@ -0,0 +1,56 @@ +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.AsistenciaDeViajeEmpresaDAO; +import com.rjconsultores.ventaboletos.entidad.AsistenciaDeViajeEmpresa; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.service.AsistenciaDeViajeEmpresaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("asistenciaDeViajeEmpresaService") +public class AsistenciaDeViajeEmpresaServiceImpl implements AsistenciaDeViajeEmpresaService { + + @Autowired + private AsistenciaDeViajeEmpresaDAO asistenciaDeViajeEmpresaDAO; + + public List obtenerTodos() { + return asistenciaDeViajeEmpresaDAO.obtenerTodos(); + } + + public AsistenciaDeViajeEmpresa obtenerID(Integer id) { + return asistenciaDeViajeEmpresaDAO.obtenerID(id); + } + + public boolean existe(Empresa empresa) { + return asistenciaDeViajeEmpresaDAO.existe(empresa); + } + + @Transactional + public AsistenciaDeViajeEmpresa suscribir(AsistenciaDeViajeEmpresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return asistenciaDeViajeEmpresaDAO.suscribir(entidad); + } + + @Transactional + public AsistenciaDeViajeEmpresa actualizacion(AsistenciaDeViajeEmpresa entidad) { + return asistenciaDeViajeEmpresaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(AsistenciaDeViajeEmpresa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + asistenciaDeViajeEmpresaDAO.borrar(entidad); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ImpresionLayoutConfigServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ImpresionLayoutConfigServiceImpl.java new file mode 100644 index 000000000..543a522f2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ImpresionLayoutConfigServiceImpl.java @@ -0,0 +1,64 @@ + +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.ImpresionLayoutConfigDAO; +import com.rjconsultores.ventaboletos.entidad.ImpresionLayoutConfig; +import com.rjconsultores.ventaboletos.service.ImpresionLayoutConfigService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("impresionLayoutConfigService") +public class ImpresionLayoutConfigServiceImpl implements ImpresionLayoutConfigService { + + @Autowired + private ImpresionLayoutConfigDAO impresionLayoutConfigDAO; + + public List obtenerTodos() { + return impresionLayoutConfigDAO.obtenerTodos(); + } + + public ImpresionLayoutConfig obtenerID(Integer id) { + return impresionLayoutConfigDAO.obtenerID(id); + } + + @Transactional + public ImpresionLayoutConfig suscribir(ImpresionLayoutConfig entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return impresionLayoutConfigDAO.suscribir(entidad); + } + + @Transactional + public ImpresionLayoutConfig actualizacion(ImpresionLayoutConfig entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return impresionLayoutConfigDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(ImpresionLayoutConfig entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + impresionLayoutConfigDAO.actualizacion(entidad); + } + + public List buscar(String descricao) { + return impresionLayoutConfigDAO.buscar(descricao); + } + + public List buscarLike(String descricao) { + return impresionLayoutConfigDAO.buscarLike(descricao); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/TipoEventoExtraServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/TipoEventoExtraServiceImpl.java index d26428287..c7f9203c5 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/TipoEventoExtraServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/TipoEventoExtraServiceImpl.java @@ -84,6 +84,11 @@ public class TipoEventoExtraServiceImpl implements TipoEventoExtraService { public List buscar(String descingreso) { return tipoEventoExtraDAO.buscar(descingreso); } + + @Override + public List buscarLike(String descingreso) { + return tipoEventoExtraDAO.buscarLike(descingreso); + } private void validaCampos(TipoEventoExtra entidad) throws ValidacionCampoException { From 9bc1928f5ae890dd435995fa420cc5bb42d92f78 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 27 Jun 2024 19:28:14 -0300 Subject: [PATCH 2/2] AL-4280 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5b2459264..d7feb7032 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 br.com.rjconsultores ModelWeb - 1.68.1 + 1.69.0