diff --git a/pom.xml b/pom.xml index b2cdc83af..2a0f2ec47 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 br.com.rjconsultores ModelWeb - 1.62.1 + 1.74.0 @@ -53,7 +53,7 @@ org.springframework spring-web - 3.0.6.RELEASE + 3.0.6.RELEASE @@ -216,6 +216,13 @@ jdk16 4.11.2 + + + org.projectlombok + lombok + 1.18.32 + + diff --git a/src/com/rjconsultores/ventaboletos/constantes/Constantes.java b/src/com/rjconsultores/ventaboletos/constantes/Constantes.java index 72c96a2a2..6a6ee5dd6 100644 --- a/src/com/rjconsultores/ventaboletos/constantes/Constantes.java +++ b/src/com/rjconsultores/ventaboletos/constantes/Constantes.java @@ -143,6 +143,9 @@ public class Constantes { public static final String CNPJ_OBRIGATORIO_ORDEN_SERVICO = "CNPJ_OBRIGATORIO_ORDEN_SERVICO"; + public static final String NUM_ASIENTO_CON_LETRA = "NUM_ASIENTO_CON_LETRA"; + public static final String DESATIVAR_OBR_CAM_EMPRESA_IMPOSTO = "DESATIVAR_OBR_CAM_EMPRESA_IMPOSTO"; + } 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/ClienteCorporativoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ClienteCorporativoDAO.java new file mode 100644 index 000000000..99d96c8fe --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ClienteCorporativoDAO.java @@ -0,0 +1,15 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClienteCorporativo; + + public interface ClienteCorporativoDAO extends GenericDAO{ + + public List buscar(Integer classe,Integer alias,Integer orgaoConcedente); + + public ClienteCorporativo existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer aliasClasseId); + + public List buscaLike(String strClienteCorporativo); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/ContratoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ContratoDAO.java new file mode 100644 index 000000000..7000e288b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ContratoDAO.java @@ -0,0 +1,15 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ContratoCorporativo; + + public interface ContratoDAO extends GenericDAO{ + + public List buscar(Integer classe,Integer alias,Integer orgaoConcedente); + + public ContratoCorporativo existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer aliasClasseId); + + public List buscaLike(String strContratoCorporativo); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/EmpresaDAO.java b/src/com/rjconsultores/ventaboletos/dao/EmpresaDAO.java index c088a3c8b..944a4cd8c 100644 --- a/src/com/rjconsultores/ventaboletos/dao/EmpresaDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/EmpresaDAO.java @@ -75,5 +75,7 @@ public interface EmpresaDAO { public List buscarEmpresaPtoVtaComissao(); public boolean isPrimeiraVezLicenca(); + + public String buscarNomeEmpresa(Integer empresaId); } diff --git a/src/com/rjconsultores/ventaboletos/dao/ExcecaoGrupoContratoDAO.java b/src/com/rjconsultores/ventaboletos/dao/ExcecaoGrupoContratoDAO.java new file mode 100644 index 000000000..f2ae9199b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/ExcecaoGrupoContratoDAO.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ExcecaoGrupoContrato; + +public interface ExcecaoGrupoContratoDAO extends GenericDAO{ + + public boolean gravarExcecoesGrupoContrato( List excecoes); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GrupoContratoDAO.java b/src/com/rjconsultores/ventaboletos/dao/GrupoContratoDAO.java new file mode 100644 index 000000000..75163c055 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GrupoContratoDAO.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GrupoContrato; + +public interface GrupoContratoDAO extends GenericDAO{ + + public List buscar(String nome); + +} 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/TarifaGrupoContratoDAO.java b/src/com/rjconsultores/ventaboletos/dao/TarifaGrupoContratoDAO.java new file mode 100644 index 000000000..91b273939 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/TarifaGrupoContratoDAO.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.TarifaGrupoContrato; + +public interface TarifaGrupoContratoDAO extends GenericDAO{ + + public boolean gravarTarifasGrupoContrato( List tarifas); + +} 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/ClienteCorporativoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ClienteCorporativoHibernateDAO.java new file mode 100644 index 000000000..a114fcfa4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ClienteCorporativoHibernateDAO.java @@ -0,0 +1,82 @@ +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.ClienteCorporativoDAO; +import com.rjconsultores.ventaboletos.entidad.ClienteCorporativo; + +@Repository("clienteCorporativoDAO") +@SuppressWarnings("unchecked") +public class ClienteCorporativoHibernateDAO extends GenericHibernateDAO + implements ClienteCorporativoDAO { + + @Autowired + public ClienteCorporativoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public ClienteCorporativo existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer aliasClasseId) { + 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)); + } + + if( aliasClasseId != null ) { + c.add(Restrictions.eq("aliasClasseId",aliasClasseId)); + } + + return (ClienteCorporativo) c.uniqueResult(); + } + + @Override + public List buscar(Integer classe, Integer alias, Integer orgaoConcedente) { + 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)); + } + + return c.list(); + } + + @Override + public List buscaLike(String nome) { + Criteria c = makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if( nome != null ) { + c.add(Restrictions.like("nomeClienteCorp", nome, MatchMode.ANYWHERE)); + } + + return c.list(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ContratoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ContratoHibernateDAO.java new file mode 100644 index 000000000..bd014c780 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ContratoHibernateDAO.java @@ -0,0 +1,80 @@ +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.ContratoDAO; +import com.rjconsultores.ventaboletos.entidad.ContratoCorporativo; + +@Repository("contratoDAO") +@SuppressWarnings("unchecked") +public class ContratoHibernateDAO extends GenericHibernateDAO implements ContratoDAO { + + @Autowired + public ContratoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public ContratoCorporativo existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer aliasClasseId) { + 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)); + } + + if( aliasClasseId != null ) { + c.add(Restrictions.eq("aliasClasseId",aliasClasseId)); + } + + return (ContratoCorporativo) c.uniqueResult(); + } + + @Override + public List buscar(Integer classe, Integer alias, Integer orgaoConcedente) { + 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)); + } + + return c.list(); + } + + @Override + public List buscaLike(String nome) { + Criteria c = makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + if( nome != null ) { + c.add(Restrictions.like("numContrato", "%"+nome+"%")); + } + + return c.list(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaHibernateDAO.java index a534383a0..6280300b9 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaHibernateDAO.java @@ -438,4 +438,11 @@ public class EmpresaHibernateDAO extends GenericHibernateDAO i return StringUtils.isNotBlank(result); } + @Override + public String buscarNomeEmpresa(Integer empresaId) { + Empresa empresa = obtenerID(empresaId); + + return empresa != null ? empresa.getNombempresa():""; + } + } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ExcecaoGrupoContratoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ExcecaoGrupoContratoHibernateDAO.java new file mode 100644 index 000000000..6637017fd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ExcecaoGrupoContratoHibernateDAO.java @@ -0,0 +1,45 @@ +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.ExcecaoGrupoContratoDAO; +import com.rjconsultores.ventaboletos.entidad.ExcecaoGrupoContrato; + +@SuppressWarnings("unchecked") +@Repository("excecaoGrupoContratoDAO") +public class ExcecaoGrupoContratoHibernateDAO extends GenericHibernateDAO implements ExcecaoGrupoContratoDAO { + + @Autowired + public ExcecaoGrupoContratoHibernateDAO(@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(); + } + + @Override + public boolean gravarExcecoesGrupoContrato(List excecoes) { + + for (ExcecaoGrupoContrato excecao : excecoes) { + if(excecao.getExcecaoGrupoContratoId() == null) { + suscribir(excecao); + }else { + actualizacion(excecao); + } + } + + return true; + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCategoriaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCategoriaHibernateDAO.java index d0464b336..f03342b0f 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCategoriaHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCategoriaHibernateDAO.java @@ -12,6 +12,7 @@ import org.springframework.stereotype.Repository; import com.rjconsultores.ventaboletos.dao.GrupoCategoriaDAO; import com.rjconsultores.ventaboletos.entidad.GrupoCategoria; +@SuppressWarnings("unchecked") @Repository("grupoCategoriaDAO") public class GrupoCategoriaHibernateDAO extends GenericHibernateDAO implements GrupoCategoriaDAO { @@ -28,7 +29,6 @@ public class GrupoCategoriaHibernateDAO extends GenericHibernateDAO buscar(String descricao) { Criteria c = getSession().createCriteria(getPersistentClass()); diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoContratoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoContratoHibernateDAO.java new file mode 100644 index 000000000..6b8353409 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoContratoHibernateDAO.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.GrupoContratoDAO; +import com.rjconsultores.ventaboletos.entidad.GrupoContrato; + +@SuppressWarnings("unchecked") +@Repository("grupoContratoDAO") +public class GrupoContratoHibernateDAO extends GenericHibernateDAO implements GrupoContratoDAO { + + @Autowired + public GrupoContratoHibernateDAO(@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 descgrupo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nomeGrupoContrato", descgrupo)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCortesiasHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCortesiasHibernateDAO.java index 51ebee4ec..4ac5ecebe 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCortesiasHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GrupoCortesiasHibernateDAO.java @@ -18,6 +18,7 @@ import org.springframework.stereotype.Repository; * * @author Shiro */ +@SuppressWarnings("unchecked") @Repository("grupoCortesiaDAO") public class GrupoCortesiasHibernateDAO extends GenericHibernateDAO implements GrupoCortesiasDAO { 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/LogDespesaReceitaDivHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/LogDespesaReceitaDivHibernateDAO.java index 8bf9c8fd3..219c7ef03 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/LogDespesaReceitaDivHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/LogDespesaReceitaDivHibernateDAO.java @@ -5,7 +5,6 @@ import java.util.List; import javax.sql.DataSource; -import org.apache.xmlbeans.impl.xb.xsdschema.RestrictionDocument.Restriction; import org.hibernate.Criteria; import org.hibernate.SessionFactory; import org.hibernate.criterion.Order; diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/ReceitaDespesaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReceitaDespesaHibernateDAO.java index 9cf2405e4..761beff25 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/ReceitaDespesaHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/ReceitaDespesaHibernateDAO.java @@ -50,7 +50,7 @@ public class ReceitaDespesaHibernateDAO implements ReceitaDespesaDAO { sql.append(" SELECT ") .append("LISTAGG(fp.cvepago||' /'||CAST(cfp.IMPORTE AS VARCHAR(10)),';') WITHIN GROUP( ORDER BY 1 DESC ) AS descpago,") .append(" C.FECHORVTA, P.PUNTOVENTA_ID, P.NOMBPUNTOVENTA, P.NUMPUNTOVENTA, TE.TIPOEVENTOEXTRA_ID, TE.DESCTIPOEVENTO, ") - .append(" C.NUMSERIEPREIMPRESA, C.NUMFOLIOPREIMPRESO, E.NUMDOCUMENTO,E.EVENTOEXTRA_ID, TE.CVETIPOEVENTO, E.BOLETO_ID ") + .append(" C.NUMSERIEPREIMPRESA, C.NUMFOLIOPREIMPRESO, E.NUMDOCUMENTO,E.EVENTOEXTRA_ID, TE.CVETIPOEVENTO, E.BOLETO_ID, E.DESCINFO ") .append(" FROM CAJA_DIVERSOS C ") .append(" JOIN EVENTO_EXTRA E ON E.EVENTOEXTRA_ID = C.EVENTOEXTRA_ID ") .append(" JOIN TIPO_EVENTO_EXTRA TE ON TE.TIPOEVENTOEXTRA_ID = E.TIPOEVENTOEXTRA_ID ") @@ -74,7 +74,8 @@ public class ReceitaDespesaHibernateDAO implements ReceitaDespesaDAO { .append("e.numdocumento, ") .append("e.eventoextra_id, ") .append("te.cvetipoevento, ") - .append("e.boleto_id "); + .append("e.boleto_id, ") + .append("e.descinfo "); sql.append("ORDER BY C.FECHORVTA, TE.DESCTIPOEVENTO, P.NOMBPUNTOVENTA, P.NUMPUNTOVENTA"); @@ -98,6 +99,7 @@ public class ReceitaDespesaHibernateDAO implements ReceitaDespesaDAO { bean.setNumSeriePreImpresa(resultSet.getString("NUMSERIEPREIMPRESA")); bean.setNumFolioPreImpreso(resultSet.getString("NUMFOLIOPREIMPRESO")); bean.setCveTipoEvento(resultSet.getString("CVETIPOEVENTO")); + bean.setDescricao(resultSet.getString("DESCINFO")); if (bean.getCveTipoEvento() != null && tiposEventosSubstituir.contains(bean.getCveTipoEvento())) { bean.setNumDocumento(resultSet.getString("BOLETO_ID")); diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaGrupoContratoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaGrupoContratoHibernateDAO.java new file mode 100644 index 000000000..25f2dd3a4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaGrupoContratoHibernateDAO.java @@ -0,0 +1,45 @@ +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.TarifaGrupoContratoDAO; +import com.rjconsultores.ventaboletos.entidad.TarifaGrupoContrato; + +@SuppressWarnings("unchecked") +@Repository("tarifaGrupoContratoDAO") +public class TarifaGrupoContratoHibernateDAO extends GenericHibernateDAO implements TarifaGrupoContratoDAO { + + @Autowired + public TarifaGrupoContratoHibernateDAO(@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(); + } + + @Override + public boolean gravarTarifasGrupoContrato(List tarifas) { + + for (TarifaGrupoContrato tarifa : tarifas) { + if(tarifa.getTarifaGrupoContratoId() == null) { + suscribir(tarifa); + }else { + actualizacion(tarifa); + } + } + + return true; + } +} 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/CategoriaDescuento.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java index 147591b45..1eb34dd34 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java @@ -266,6 +266,9 @@ public class CategoriaDescuento implements Serializable, Auditavel { @Column(name = "DESCCLASE") private String descclase; + @Column(name = "TIPOSERVICOBPE") private Integer tipoServicoBPe; + @Column(name = "ACTIVO") private Boolean activo; + @Basic(optional = false) @Column(name = "FECMODIF") @Temporal(TemporalType.TIMESTAMP) private Date fecmodif; + @Column(name = "USUARIO_ID") private Integer usuarioId; + @OneToMany(mappedBy = "claseServicio") private List categoriaClaseList; + @OneToMany(mappedBy = "claseServicio") private List reservacionClaseList; + @OneToMany(mappedBy = "claseServicio") private List tramoTiempoList; + @Column(name = "EQUIVALENCIA_ID") private String equivalenciaId; + @Column(name = "EQUIVALENCIAELEKTRA_ID") private String equivalenciaElektraId; + @OneToMany(mappedBy = "claseServicio") private List tarifaHistList; + @OneToMany(mappedBy = "claseServicio") private List corridaList; + @Column(name = "COEFICIENTETARIFA") private BigDecimal coeficiente; + @Column(name = "PORCPRICINGSEMELHANTE") private BigDecimal porcPricingSemelhante; diff --git a/src/com/rjconsultores/ventaboletos/entidad/ClienteCorporativo.java b/src/com/rjconsultores/ventaboletos/entidad/ClienteCorporativo.java new file mode 100644 index 000000000..ea681b70a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ClienteCorporativo.java @@ -0,0 +1,216 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; + +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; + +@Entity +@Table(name = "CLIENTE_CORPORATIVO") +@SequenceGenerator(name = "CLIENTE_CORPORATIVO_SEQ", sequenceName = "CLIENTE_CORPORATIVO_SEQ", allocationSize = 1) +public class ClienteCorporativo implements Serializable { + + private static final long serialVersionUID = -5338880268814582448L; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CLIENTE_CORPORATIVO_SEQ") + @Column(name = "CLIENTECORPORATIVO_ID") + private Long clienteCorporativoId; + + @Column(name = "EMPRESA_ID", nullable = false) + private Integer empresaId; + + @Column(name = "IDENTIFICACAO") + private Long identificacao; + + @Column(name = "NOMCLIENTECORP", length = 255) + private String nomeClienteCorp; + + @Column(name = "DATA_CRIACAO") + private Date dataCriacao; + + @Column(name = "LOGRADOURO", length = 255) + private String logradouro; + + @Column(name = "NUMERO", length = 6) + private String numero; + + @Column(name = "BAIRRO", length = 255) + private String bairro; + + @Column(name = "COMPLEMENTO", length = 100) + private String complemento; + + @Column(name = "CEP", length = 20) + private String cep; + + @Column(name = "TELEFONE", length = 20) + private String telefone; + + @Column(name = "EMAIL", length = 150) + private String email; + + @Column(name = "CIUDAD_ID") + private Integer ciudadId; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @Column(name = "ACTIVO") + private boolean activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecModif; + + private transient String nombEmpresa; + + public Long getClienteCorporativoId() { + return clienteCorporativoId; + } + + public void setClienteCorporativoId(Long clienteCorporativoId) { + this.clienteCorporativoId = clienteCorporativoId; + } + + public Integer getEmpresaId() { + return empresaId; + } + + public void setEmpresaId(Integer empresaId) { + this.empresaId = empresaId; + } + + public Long getIdentificacao() { + return identificacao; + } + + public void setIdentificacao(Long identificacao) { + this.identificacao = identificacao; + } + + public String getNomeClienteCorp() { + return nomeClienteCorp; + } + + public void setNomeClienteCorp(String nomeClienteCorp) { + this.nomeClienteCorp = nomeClienteCorp; + } + + public String getLogradouro() { + return logradouro; + } + + public void setLogradouro(String logradouro) { + this.logradouro = logradouro; + } + + public String getNumero() { + return numero; + } + + public void setNumero(String numero) { + this.numero = numero; + } + + public String getBairro() { + return bairro; + } + + public void setBairro(String bairro) { + this.bairro = bairro; + } + + public String getComplemento() { + return complemento; + } + + public void setComplemento(String complemento) { + this.complemento = complemento; + } + + public String getCep() { + return cep; + } + + public void setCep(String cep) { + this.cep = cep; + } + + public String getTelefone() { + return telefone; + } + + public void setTelefone(String telefone) { + this.telefone = telefone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Integer getCiudadId() { + return ciudadId; + } + + public void setCiudadId(Integer ciudadId) { + this.ciudadId = ciudadId; + } + + 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 getFecModif() { + return fecModif; + } + + public void setFecModif(Date fecModif) { + this.fecModif = fecModif; + } + + public Date getDataCriacao() { + return dataCriacao; + } + + public void setDataCriacao(Date dataCriacao) { + this.dataCriacao = dataCriacao; + } + + public String getNombEmpresa() { + return nombEmpresa; + } + + public void setNombEmpresa(String nombEmpresa) { + this.nombEmpresa = nombEmpresa; + } + + @Override + public String toString() { + return this.nomeClienteCorp; + } +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/entidad/ContratoCorporativo.java b/src/com/rjconsultores/ventaboletos/entidad/ContratoCorporativo.java new file mode 100644 index 000000000..3896c2e49 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ContratoCorporativo.java @@ -0,0 +1,133 @@ +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.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@Entity +@Table(name = "CONTRATO_CORPORATIVO") +public class ContratoCorporativo implements Serializable { + + private static final long serialVersionUID = 7463047540139255373L; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CONTRATO_CORPORATIVO_SEQ") + @SequenceGenerator(name = "CONTRATO_CORPORATIVO_SEQ", sequenceName = "CONTRATO_CORPORATIVO_SEQ", allocationSize = 1) + @Column(name = "CONTRATO_ID") + private Long contratoId; + + @Column(name = "CLIENTECORPORATIVO_ID") + private Long clienteCorporativoId; + + @Column(name = "NUMCONTRATO") + private String numContrato; + + @Column(name = "DATA_INICIAL") + private Date dataInicial; + + @Column(name = "DATA_FINAL") + private Date dataFinal; + + @Column(name = "VALOR_CONTRATO") + private BigDecimal valorContrato; + + @Column(name = "PERCENTUAL_BONUS") + private BigDecimal percentualBonus; + + @Column(name = "USUARIOREP_ID") + private Integer usuarioRepId; + + @Column(name = "TIPO_CALCULO") + private Integer tipoCalculo; + + @Column(name = "TIPO_TARIFA") + private Integer tipoTarifa; + + @Column(name = "TIPO_CONTRATO") + private Integer tipoContrato; + + @Column(name = "PUNTOVENTA_ID") + private Long puntoVentaId; + + @Column(name = "OBSERVACAO") + private String observacao; + + @Column(name = "DIVISAO") + private String divisao; + + @Column(name = "STATUS_CONTRATO") + private Integer statusContrato; + + @Column(name = "GRUPOCONTRATO_ID") + private Integer grupoContratoId; + + @Column(name = "DESCONTO_FATURA") + private BigDecimal descontoFatura; + + @Column(name = "IND_BILHETES_ABERTOS") + private boolean indBilhetesAbertos; + + @Column(name = "IND_BILHETES_CONFIRMADOS") + private boolean indBilhetesConfirmados; + + @Column(name = "IND_RESERVA_BILHETE") + private boolean indReservaBilhete; + + @Column(name = "IND_MANIPULA_BONUS") + private boolean indManipulaBonus; + + @Column(name = "IND_EXIGE_EXCEDENTE") + private boolean indExigeExcedente; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @Column(name = "ACTIVO") + private boolean activo; + + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecModif; + + private transient String nomeClienteCorp; + + private transient String nomeGrupoContrato; + + + public ContratoCorporativo(Long clienteCorporativoId) { + this(); + this.clienteCorporativoId = clienteCorporativoId; + } + + public ContratoCorporativo(Long clienteCorporativoId, String nomeClienteCorp) { + this(); + this.clienteCorporativoId = clienteCorporativoId; + this.nomeClienteCorp = nomeClienteCorp; + } + + public ContratoCorporativo(Long clienteCorporativoId, Date fecModif) { + this(); + this.clienteCorporativoId = clienteCorporativoId; + this.fecModif = fecModif; + } + +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/entidad/Empresa.java b/src/com/rjconsultores/ventaboletos/entidad/Empresa.java index d838a41e7..6ed42e6d4 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Empresa.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Empresa.java @@ -1,4 +1,5 @@ /* + * To change this template, choose Tools | Templates * and open the template in the editor. */ @@ -457,6 +458,11 @@ public class Empresa implements Serializable, Auditavel { @Column(name = "INDCUPOMEMBARQUESIMPLIFICADO") private Boolean indCupomEmbarqueSimplificado; + @Column(name = "INDBILHETEDEVPIXDINHEIRO") + private Boolean indBilheteDevPixDinheiro; + + @Column(name = "INDCALCGRATUISOBREDESCTOTAIS") + private Boolean indCalcGratuiSobreDescTotais; public Empresa() { @@ -1666,6 +1672,26 @@ public class Empresa implements Serializable, Auditavel { public void setIndCupomEmbarqueSimplificado(Boolean indCupomEmbarqueSimplificado) { this.indCupomEmbarqueSimplificado = indCupomEmbarqueSimplificado; } + + public Boolean getIndBilheteDevPixDinheiro() { + return indBilheteDevPixDinheiro==null?false:indBilheteDevPixDinheiro; + } + + public void setIndBilheteDevPixDinheiro(Boolean indBilheteDevPixDinheiro) { + this.indBilheteDevPixDinheiro = indBilheteDevPixDinheiro; + } + + public Boolean getIndCalcGratuiSobreDescTotais() { + return indCalcGratuiSobreDescTotais; + } + + public void setIndCalcGratuiSobreDescTotais(Boolean indCalcGratuiSobreDescTotais) { + this.indCalcGratuiSobreDescTotais = indCalcGratuiSobreDescTotais; + } + + + + } diff --git a/src/com/rjconsultores/ventaboletos/entidad/ExcecaoGrupoContrato.java b/src/com/rjconsultores/ventaboletos/entidad/ExcecaoGrupoContrato.java new file mode 100644 index 000000000..5bfe2d3c5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/ExcecaoGrupoContrato.java @@ -0,0 +1,158 @@ +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.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@Table(name = "EXCECAO_GRUPO_CONTRATO") +public class ExcecaoGrupoContrato implements Serializable{ + + private static final long serialVersionUID = -8044552223526401469L; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EXCECAO_GRUPO_CONTRATO_SEQ") + @SequenceGenerator(name = "EXCECAO_GRUPO_CONTRATO_SEQ", sequenceName = "EXCECAO_GRUPO_CONTRATO_SEQ", allocationSize = 1) + @Column(name = "EXCECAOGRUPOCONTRATO_ID") + private Integer excecaoGrupoContratoId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "GRUPOCONTRATO_ID") + private GrupoContrato grupoContrato; + + @OneToOne + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + private Parada origem; + + @OneToOne + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + private Parada destino; + + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID") + private ClaseServicio claseServicio; + + @Column(name = "DATA_INICIAL") + private Date dataInicial; + + @Column(name = "DATA_FINAL") + private Date dataFinal; + + @Column(name = "TARIFA") + private BigDecimal tarifa; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @Column(name = "ACTIVO") + private boolean activo; + + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecModif; + + public Integer getExcecaoGrupoContratoId() { + return excecaoGrupoContratoId; + } + + public void setExcecaoGrupoContratoId(Integer excecaoGrupoContratoId) { + this.excecaoGrupoContratoId = excecaoGrupoContratoId; + } + + public GrupoContrato getGrupoContrato() { + return grupoContrato; + } + + public void setGrupoContrato(GrupoContrato grupoContrato) { + this.grupoContrato = grupoContrato; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public Date getDataInicial() { + return dataInicial; + } + + public void setDataInicial(Date dataInicial) { + this.dataInicial = dataInicial; + } + + public Date getDataFinal() { + return dataFinal; + } + + public void setDataFinal(Date dataFinal) { + this.dataFinal = dataFinal; + } + + public BigDecimal getTarifa() { + return tarifa; + } + + public void setTarifa(BigDecimal tarifa) { + this.tarifa = tarifa; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public boolean isActivo() { + return activo; + } + + public void setActivo(boolean activo) { + this.activo = activo; + } + + public Date getFecModif() { + return fecModif; + } + + public void setFecModif(Date fecModif) { + this.fecModif = fecModif; + } + +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/entidad/GrupoContrato.java b/src/com/rjconsultores/ventaboletos/entidad/GrupoContrato.java new file mode 100644 index 000000000..be738be82 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GrupoContrato.java @@ -0,0 +1,88 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.Where; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Entity +@SequenceGenerator(name = "GRUPO_CONTRATO_SEQ", sequenceName = "GRUPO_CONTRATO_SEQ", allocationSize = 1) +@Table(name = "GRUPO_CONTRATO") +public class GrupoContrato implements Serializable { + + private static final long serialVersionUID = -3684489881654368314L; + + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GRUPO_CONTRATO_SEQ") + @Column(name = "GRUPOCONTRATO_ID") + private Integer grupoContratoId; + + @Column(name = "NOMEGRUPOCONTRATO") + private String nomeGrupoContrato; + + @OneToMany(mappedBy = "grupoContrato", cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @Where(clause = "ACTIVO=1") + private List tarifasGrupoContrato; + + @OneToMany(mappedBy = "grupoContrato", cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @Where(clause = "ACTIVO=1") + private List excecoesGrupoContrato; + + @Column(name = "ACTIVO") + private Boolean activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + + final GrupoContrato other = (GrupoContrato) obj; + return this.getGrupoContratoId().equals(other.getGrupoContratoId()); + } + + @Override + public int hashCode() { + int hash = 7; + hash = 59 * hash + (this.getGrupoContratoId() != null ? this.getGrupoContratoId().hashCode() : 0); + return hash; + } + + @Override + public String toString() { + return this.getNomeGrupoContrato(); + } + +} 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/ParamRecoleccion.java b/src/com/rjconsultores/ventaboletos/entidad/ParamRecoleccion.java index 4a2b3157d..3ce1e87dc 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/ParamRecoleccion.java +++ b/src/com/rjconsultores/ventaboletos/entidad/ParamRecoleccion.java @@ -1,5 +1,5 @@ /* - * To change this template, choose Tools | Templates + * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.rjconsultores.ventaboletos.entidad; @@ -47,6 +47,8 @@ public class ParamRecoleccion 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/TarifaGrupoContrato.java b/src/com/rjconsultores/ventaboletos/entidad/TarifaGrupoContrato.java new file mode 100644 index 000000000..2d3be3121 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/TarifaGrupoContrato.java @@ -0,0 +1,147 @@ +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.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@Table(name = "TARIFA_GRUPO_CONTRATO") +public class TarifaGrupoContrato implements Serializable{ + + private static final long serialVersionUID = -8044552223526401469L; + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TARIFA_GRUPO_CONTRATO_SEQ") + @SequenceGenerator(name = "TARIFA_GRUPO_CONTRATO_SEQ", sequenceName = "TARIFA_GRUPO_CONTRATO_SEQ", allocationSize = 1) + @Column(name = "TARIFAGRUPOCONTRATO_ID") + private Integer tarifaGrupoContratoId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "GRUPOCONTRATO_ID") + private GrupoContrato grupoContrato; + + @OneToOne + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + private Parada origem; + + @OneToOne + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + private Parada destino; + + @OneToOne + @JoinColumn(name = "CLASESERVICIO_ID") + private ClaseServicio claseServicio; + + @Column(name = "TARIFA") + private BigDecimal tarifa; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @Column(name = "INDCOBERTURA") + private boolean indCobertura; + + @Column(name = "ACTIVO") + private boolean activo; + + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecModif; + + public Integer getTarifaGrupoContratoId() { + return tarifaGrupoContratoId; + } + + public void setTarifaGrupoContratoId(Integer tarifaGrupoContratoId) { + this.tarifaGrupoContratoId = tarifaGrupoContratoId; + } + + public GrupoContrato getGrupoContrato() { + return grupoContrato; + } + + public void setGrupoContrato(GrupoContrato grupoContrato) { + this.grupoContrato = grupoContrato; + } + + public Parada getOrigem() { + return origem; + } + + public void setOrigem(Parada origem) { + this.origem = origem; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public BigDecimal getTarifa() { + return tarifa; + } + + public void setTarifa(BigDecimal tarifa) { + this.tarifa = tarifa; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public boolean isIndCobertura() { + return indCobertura; + } + + public void setIndCobertura(boolean indCobertura) { + this.indCobertura = indCobertura; + } + + public boolean isActivo() { + return activo; + } + + public void setActivo(boolean activo) { + this.activo = activo; + } + + public Date getFecModif() { + return fecModif; + } + + public void setFecModif(Date fecModif) { + this.fecModif = fecModif; + } + +} \ No newline at end of file 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/entidad/Usuario.java b/src/com/rjconsultores/ventaboletos/entidad/Usuario.java index dc20f17fe..873ed9a67 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Usuario.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Usuario.java @@ -91,15 +91,19 @@ public class Usuario implements Serializable, UserDetails, Auditavel { private String claveUsuario; @Column(name = "DESCCORREO") private String descCorreo; - @OneToMany(mappedBy = "usuario", cascade = CascadeType.ALL, fetch = FetchType.EAGER) + + @OneToMany(mappedBy = "usuario", cascade = CascadeType.ALL, fetch = FetchType.LAZY) @Fetch(FetchMode.SELECT) @AuditarLista(auditarEntidades = true, nome = "Perfil") private List usuarioPerfilList; + @Column(name = "INDCORTEAUTOMATICO") private Boolean indCorteAutomatico; - @OneToOne + + @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "EMPLEADO_ID") private Empleado empleado; + @OneToMany(mappedBy = "usuarioLog", cascade = CascadeType.ALL, fetch = FetchType.EAGER) @Fetch(FetchMode.SELECT) @NaoAuditar 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/enums/TipoIdentificacionDoc.java b/src/com/rjconsultores/ventaboletos/enums/TipoIdentificacionDoc.java index 1384e5904..43a12b97f 100644 --- a/src/com/rjconsultores/ventaboletos/enums/TipoIdentificacionDoc.java +++ b/src/com/rjconsultores/ventaboletos/enums/TipoIdentificacionDoc.java @@ -17,6 +17,13 @@ public enum TipoIdentificacionDoc { RNE(24), DOC_IDOSO(25), DNI(26), + RE_PM(27), + D_FISICO(28), + J_CARENTE(29), + GRATUIDADE(30), + NIC(31), + PASSE_LIVRE(32), + ID_JOVEM(33), TODOS(0); private Integer id; @@ -68,6 +75,15 @@ public enum TipoIdentificacionDoc { case 26: tmp = TipoIdentificacionDoc.DNI; break; + case 31: + tmp = TipoIdentificacionDoc.NIC; + break; + case 32: + tmp = TipoIdentificacionDoc.PASSE_LIVRE; + break; + case 33: + tmp = TipoIdentificacionDoc.ID_JOVEM; + break; default: break; @@ -86,7 +102,14 @@ public enum TipoIdentificacionDoc { TipoIdentificacionDoc.CN, TipoIdentificacionDoc.RNE, TipoIdentificacionDoc.DOC_IDOSO, - TipoIdentificacionDoc.DNI + TipoIdentificacionDoc.DNI, + TipoIdentificacionDoc.RE_PM, + TipoIdentificacionDoc.D_FISICO, + TipoIdentificacionDoc.J_CARENTE, + TipoIdentificacionDoc.GRATUIDADE, + TipoIdentificacionDoc.NIC, + TipoIdentificacionDoc.PASSE_LIVRE, + TipoIdentificacionDoc.ID_JOVEM }; } @@ -119,6 +142,12 @@ public enum TipoIdentificacionDoc { return "DOC_IDOSO"; case 26: return "DNI"; + case 31: + return "NIC"; + case 32: + return "PASSE_LIVRE"; + case 33: + return "ID_JOVEM"; default: return ""; } @@ -134,7 +163,11 @@ public enum TipoIdentificacionDoc { TipoIdentificacionDoc.CN, TipoIdentificacionDoc.RNE, TipoIdentificacionDoc.DOC_IDOSO, - TipoIdentificacionDoc.DNI + TipoIdentificacionDoc.DNI, + TipoIdentificacionDoc.RE_PM, + TipoIdentificacionDoc.NIC, + TipoIdentificacionDoc.PASSE_LIVRE, + TipoIdentificacionDoc.ID_JOVEM }; } @@ -162,6 +195,14 @@ public enum TipoIdentificacionDoc { return TipoIdentificacionDoc.DOC_IDOSO; } else if(descTipoDoc.equals("DNI")) { return TipoIdentificacionDoc.DNI; + }else if(descTipoDoc.equals("RE_PM")) { + return TipoIdentificacionDoc.RE_PM; + }else if(descTipoDoc.equals("NIC")) { + return TipoIdentificacionDoc.NIC; + }else if(descTipoDoc.equals("PASSE_LIVRE")) { + return TipoIdentificacionDoc.PASSE_LIVRE; + }else if(descTipoDoc.equals("ID_JOVEM")) { + return TipoIdentificacionDoc.ID_JOVEM; }else { return null; } @@ -235,4 +276,22 @@ public enum TipoIdentificacionDoc { return true; } + + public static TipoIdentificacionDoc[] buscarComboSegundoTipoDocumentoRemovendoDocumentoSelecionadoTipoIdentificacionDoc(TipoIdentificacionDoc tipoIdentificacionDoc) { + + if (tipoIdentificacionDoc == null) { + return null; + } + + TipoIdentificacionDoc[] tipoIdentificacionDocs = new TipoIdentificacionDoc[TipoIdentificacionDoc.values().length-1]; + int j = 0; + for (int i = 0 ; i < TipoIdentificacionDoc.values().length ; i ++) { + if(tipoIdentificacionDoc.getId().equals(TipoIdentificacionDoc.values()[i].getId())) { + continue; + } + tipoIdentificacionDocs[j] = TipoIdentificacionDoc.values()[i]; + j++; + } + return tipoIdentificacionDocs; + } } diff --git a/src/com/rjconsultores/ventaboletos/relatorios/receitaDespesa/RelatorioFinanceiroReceitasDespesasBean.java b/src/com/rjconsultores/ventaboletos/relatorios/receitaDespesa/RelatorioFinanceiroReceitasDespesasBean.java index 1a5abf23c..c680ea8f7 100644 --- a/src/com/rjconsultores/ventaboletos/relatorios/receitaDespesa/RelatorioFinanceiroReceitasDespesasBean.java +++ b/src/com/rjconsultores/ventaboletos/relatorios/receitaDespesa/RelatorioFinanceiroReceitasDespesasBean.java @@ -30,6 +30,7 @@ public class RelatorioFinanceiroReceitasDespesasBean { private BigDecimal ValorFormaPagamento3; private String cveTipoEvento; private String boletoId; + private String descricao; public Date getFecHorVta() { return fecHorVta; @@ -221,4 +222,13 @@ public class RelatorioFinanceiroReceitasDespesasBean { public void setBoletoId(String boletoId) { this.boletoId = boletoId; } + + public String getDescricao() { + return descricao; + } + + public void setDescricao(String descricao) { + this.descricao = descricao; + } + } 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/ClienteCorporativoService.java b/src/com/rjconsultores/ventaboletos/service/ClienteCorporativoService.java new file mode 100644 index 000000000..97dee5a1a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ClienteCorporativoService.java @@ -0,0 +1,23 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClienteCorporativo; +import com.rjconsultores.ventaboletos.exception.BusinessException; + +public interface ClienteCorporativoService{ + + public List obtenerTodos(); + + public ClienteCorporativo obtenerID(Long id); + + public ClienteCorporativo suscribirActualizar(ClienteCorporativo entidad) throws BusinessException; + + public void borrar(ClienteCorporativo entidad); + + public ClienteCorporativo existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer aliasClasseId); + + public List buscar(Integer classe,Integer alias,Integer orgaoConcedente); + + public List buscaLike(String strClienteCorporativo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/ConstanteService.java b/src/com/rjconsultores/ventaboletos/service/ConstanteService.java index 155eabebd..0006c005c 100644 --- a/src/com/rjconsultores/ventaboletos/service/ConstanteService.java +++ b/src/com/rjconsultores/ventaboletos/service/ConstanteService.java @@ -32,4 +32,6 @@ public interface ConstanteService extends GenericService { public String buscarURLAPIEmb(); public List BuscarTipoOcupacaoSemValidacao(); + + public Boolean buscarValorConstantePorNomeConstanteBoolean(String nomeConstante); } diff --git a/src/com/rjconsultores/ventaboletos/service/ContratoService.java b/src/com/rjconsultores/ventaboletos/service/ContratoService.java new file mode 100644 index 000000000..4983fecd1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/ContratoService.java @@ -0,0 +1,23 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ContratoCorporativo; +import com.rjconsultores.ventaboletos.exception.BusinessException; + +public interface ContratoService{ + + public List obtenerTodos(); + + public ContratoCorporativo obtenerID(Long id); + + public ContratoCorporativo suscribirActualizar(ContratoCorporativo entidad) throws BusinessException; + + public void borrar(ContratoCorporativo entidad); + + public ContratoCorporativo existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer aliasClasseId); + + public List buscar(Integer classe,Integer alias,Integer orgaoConcedente); + + public List buscaLike(String numContrato); +} diff --git a/src/com/rjconsultores/ventaboletos/service/EmpresaService.java b/src/com/rjconsultores/ventaboletos/service/EmpresaService.java index 8f89ebfe3..02adea723 100644 --- a/src/com/rjconsultores/ventaboletos/service/EmpresaService.java +++ b/src/com/rjconsultores/ventaboletos/service/EmpresaService.java @@ -64,11 +64,6 @@ public interface EmpresaService { public List buscarEmpresaPtoVtaComissao(); - /** - * Atualiza se necessário as licenças no primeiro acesso - * - * @return A quantidade de empresas atualizadas - */ public Integer atualizarLicencaEmpresasPrimeiraVez(); public List filtrarApenasEmpresasLicencaValida(List lsEmpresa); @@ -76,5 +71,7 @@ public interface EmpresaService { public String token(Empresa empresa); public String validarTokenLicensa(Empresa empresa, String tokenLicenca); + + public String buscarNomeEmpresa(Integer empresaId); } diff --git a/src/com/rjconsultores/ventaboletos/service/GrupoContratoService.java b/src/com/rjconsultores/ventaboletos/service/GrupoContratoService.java new file mode 100644 index 000000000..e8ba8e3e7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GrupoContratoService.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ExcecaoGrupoContrato; +import com.rjconsultores.ventaboletos.entidad.GrupoContrato; +import com.rjconsultores.ventaboletos.entidad.TarifaGrupoContrato; + +public interface GrupoContratoService extends GenericService { + + public List buscar(String descgrupo); + + public boolean gravarTarifasGrupoContrato( List tarifas); + + public boolean gravarExcecoesGrupoContrato( List excecoes); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GrupoCortesiasService.java b/src/com/rjconsultores/ventaboletos/service/GrupoCortesiasService.java index 4747d06a9..683291061 100644 --- a/src/com/rjconsultores/ventaboletos/service/GrupoCortesiasService.java +++ b/src/com/rjconsultores/ventaboletos/service/GrupoCortesiasService.java @@ -1,16 +1,8 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ package com.rjconsultores.ventaboletos.service; import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; import java.util.List; -/** - * - * @author Shiro - */ public interface GrupoCortesiasService extends GenericService { public List buscar(String descgrupo); 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/ClienteCorporativoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ClienteCorporativoServiceImpl.java new file mode 100644 index 000000000..895290139 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ClienteCorporativoServiceImpl.java @@ -0,0 +1,74 @@ +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.ClienteCorporativoDAO; +import com.rjconsultores.ventaboletos.entidad.ClienteCorporativo; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.ClienteCorporativoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("clienteCorpService") +public class ClienteCorporativoServiceImpl implements ClienteCorporativoService { + + @Autowired + private ClienteCorporativoDAO clienteCorpDAO; + + public List obtenerTodos() { + return clienteCorpDAO.obtenerTodos(); + } + + public ClienteCorporativo obtenerID(Long id) { + return clienteCorpDAO.obtenerID(id); + } + + @Transactional + public ClienteCorporativo suscribirActualizar(ClienteCorporativo entidad) throws BusinessException { + + if ( entidad.getEmpresaId() == null || + entidad.getNomeClienteCorp() == null || + entidad.getIdentificacao() == null || + entidad.getDataCriacao() == null ){ + throw new BusinessException("editarClienteCorporativoController.MSG.camposObrigatorios"); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecModif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + if (entidad.getClienteCorporativoId() == null){ + return clienteCorpDAO.suscribir(entidad); + }else{ + return clienteCorpDAO.actualizacion(entidad); + } + } + + @Transactional + public void borrar(ClienteCorporativo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecModif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + clienteCorpDAO.actualizacion(entidad); + } + + @Override + public ClienteCorporativo existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer clienteCorpId) { + return clienteCorpDAO.existe(classe, alias, orgaoConcedente, clienteCorpId); + } + + @Override + public List buscar(Integer classe, Integer alias, Integer orgaoConcedente) { + return clienteCorpDAO.buscar(classe, alias, orgaoConcedente); + } + + @Override + public List buscaLike(String strClienteCorporativo) { + return clienteCorpDAO.buscaLike( strClienteCorporativo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConstanteServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConstanteServiceImpl.java index 23bed64ac..2b9a0a5f4 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/ConstanteServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConstanteServiceImpl.java @@ -8,7 +8,10 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.List; +import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; @@ -28,6 +31,9 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; */ @Service("constanteService") public class ConstanteServiceImpl implements ConstanteService { + + private static final Logger log = LogManager.getLogger(ConstanteServiceImpl.class); + @Autowired private ConstanteDAO constanteDAO; @@ -193,4 +199,17 @@ public class ConstanteServiceImpl implements ConstanteService { return null; } } + + @Override + public Boolean buscarValorConstantePorNomeConstanteBoolean(String nomeConstante) { + try { + Constante constante = buscarPorNomeConstante(nomeConstante); + if (constante != null) { + return BooleanUtils.toBoolean(constante.getValorconstante()); + } + } catch (Exception e) { + log.error("", e); + } + return false; + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ContratoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ContratoServiceImpl.java new file mode 100644 index 000000000..a1cfefa77 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/ContratoServiceImpl.java @@ -0,0 +1,76 @@ +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.ContratoDAO; +import com.rjconsultores.ventaboletos.entidad.ContratoCorporativo; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.ContratoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("contratoService") +public class ContratoServiceImpl implements ContratoService { + + @Autowired + private ContratoDAO contratoDAO; + + public List obtenerTodos() { + return contratoDAO.obtenerTodos(); + } + + public ContratoCorporativo obtenerID(Long id) { + return contratoDAO.obtenerID(id); + } + + @Transactional + public ContratoCorporativo suscribirActualizar(ContratoCorporativo entidad) throws BusinessException { + + if ( entidad.getClienteCorporativoId() == null || + entidad.getGrupoContratoId() == null || + entidad.getNumContrato() == null || + entidad.getDataFinal() == null || + entidad.getDataInicial() == null ){ + throw new BusinessException("editarContratoController.MSG.camposObrigatorios"); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecModif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + if (entidad.getContratoId() == null){ + entidad.setStatusContrato(1); + return contratoDAO.suscribir(entidad); + }else{ + return contratoDAO.actualizacion(entidad); + } + } + + @Transactional + public void borrar(ContratoCorporativo entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecModif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + contratoDAO.actualizacion(entidad); + } + + @Override + public ContratoCorporativo existe(Integer classe, Integer alias, Integer orgaoConcedente, Integer clienteCorpId) { + return contratoDAO.existe(classe, alias, orgaoConcedente, clienteCorpId); + } + + @Override + public List buscar(Integer classe, Integer alias, Integer orgaoConcedente) { + return contratoDAO.buscar(classe, alias, orgaoConcedente); + } + + @Override + public List buscaLike(String strContratoCorporativo) { + return contratoDAO.buscaLike( strContratoCorporativo); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EmpresaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaServiceImpl.java index ec8a9a670..c5751ccdb 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/EmpresaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaServiceImpl.java @@ -155,11 +155,6 @@ public class EmpresaServiceImpl implements EmpresaService { return empresaDAO.obtenerIndTipo2(); } - /* - * (non-Javadoc) - * - * @see com.rjconsultores.ventaboletos.service.EmpresaService#buscarNotInPuntoVtaComissao(com.rjconsultores.ventaboletos.entidad.PuntoVenta) - */ @Override public List buscarNotInPuntoVtaComissao(PuntoVenta puntoVenta) { return empresaDAO.buscarNotInPuntoVtaComissao(puntoVenta); @@ -329,4 +324,9 @@ public class EmpresaServiceImpl implements EmpresaService { return cantEmpresasAtualizadas; } + + @Override + public String buscarNomeEmpresa(Integer empresaId) { + return empresaDAO.buscarNomeEmpresa(empresaId); + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GrupoContratoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GrupoContratoServiceImpl.java new file mode 100644 index 000000000..9dfa688e1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GrupoContratoServiceImpl.java @@ -0,0 +1,80 @@ +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.ExcecaoGrupoContratoDAO; +import com.rjconsultores.ventaboletos.dao.GrupoContratoDAO; +import com.rjconsultores.ventaboletos.dao.TarifaGrupoContratoDAO; +import com.rjconsultores.ventaboletos.entidad.ExcecaoGrupoContrato; +import com.rjconsultores.ventaboletos.entidad.GrupoContrato; +import com.rjconsultores.ventaboletos.entidad.TarifaGrupoContrato; +import com.rjconsultores.ventaboletos.service.GrupoContratoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + + +@Service("grupoContratoService") +public class GrupoContratoServiceImpl implements GrupoContratoService { + + @Autowired + private GrupoContratoDAO grupoContratoDAO; + + @Autowired + private TarifaGrupoContratoDAO tarifaGrupoContratoDAO; + + @Autowired + private ExcecaoGrupoContratoDAO excecaoGrupoContratoDAO; + + public List obtenerTodos() { + return grupoContratoDAO.obtenerTodos(); + } + + public GrupoContrato obtenerID(Integer id) { + return grupoContratoDAO.obtenerID(id); + } + + @Transactional + public GrupoContrato suscribir(GrupoContrato entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return grupoContratoDAO.suscribir(entidad); + } + + @Transactional + public GrupoContrato actualizacion(GrupoContrato entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return grupoContratoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GrupoContrato entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + grupoContratoDAO.actualizacion(entidad); + } + + public List buscar(String descgrupo) { + return grupoContratoDAO.buscar(descgrupo); + } + + @Transactional + public boolean gravarTarifasGrupoContrato(List tarifas) { + return tarifaGrupoContratoDAO.gravarTarifasGrupoContrato(tarifas); + } + + @Transactional + public boolean gravarExcecoesGrupoContrato(List excecoes) { + return excecaoGrupoContratoDAO.gravarExcecoesGrupoContrato(excecoes); + } +} 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 { diff --git a/src/com/rjconsultores/ventaboletos/utilerias/StringHelper.java b/src/com/rjconsultores/ventaboletos/utilerias/StringHelper.java index 2bcbaa748..84a4d3338 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/StringHelper.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/StringHelper.java @@ -20,18 +20,18 @@ public class StringHelper { private static void compilePatterns() { PATTERNS = new Pattern[REPLACES.length]; - PATTERNS[0] = Pattern.compile("[]"); - PATTERNS[1] = Pattern.compile("[]"); - PATTERNS[2] = Pattern.compile("[]"); - PATTERNS[3] = Pattern.compile("[]"); - PATTERNS[4] = Pattern.compile("[]"); - PATTERNS[5] = Pattern.compile("[]"); - PATTERNS[6] = Pattern.compile("[]"); - PATTERNS[7] = Pattern.compile("[]"); - PATTERNS[8] = Pattern.compile("[]"); - PATTERNS[9] = Pattern.compile("[]"); - PATTERNS[10] = Pattern.compile("[]"); - PATTERNS[11] = Pattern.compile("[]"); + PATTERNS[0] = Pattern.compile("[âãáàä]"); + PATTERNS[1] = Pattern.compile("[éèêë]"); + PATTERNS[2] = Pattern.compile("[íìîï]"); + PATTERNS[3] = Pattern.compile("[óòôõö]"); + PATTERNS[4] = Pattern.compile("[úùûü]"); + PATTERNS[5] = Pattern.compile("[ç]"); + PATTERNS[6] = Pattern.compile("[ÂÃÁÀÄ]"); + PATTERNS[7] = Pattern.compile("[ÉÈÊË]"); + PATTERNS[8] = Pattern.compile("[ÍÌÎÏ]"); + PATTERNS[9] = Pattern.compile("[ÓÒÔÕÖ]"); + PATTERNS[10] = Pattern.compile("[ÚÙÛÜ]"); + PATTERNS[11] = Pattern.compile("[Ç]"); } public static String replaceAcento(String text) { diff --git a/src/com/rjconsultores/ventaboletos/utilerias/spring/MyAnnotationSessionFactoryBean.java b/src/com/rjconsultores/ventaboletos/utilerias/spring/MyAnnotationSessionFactoryBean.java index e97526a24..9aad51041 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/spring/MyAnnotationSessionFactoryBean.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/spring/MyAnnotationSessionFactoryBean.java @@ -17,7 +17,6 @@ public class MyAnnotationSessionFactoryBean extends AnnotationSessionFactoryBean super.setEntityInterceptor(new AuditInterceptor()); } - @Override protected void postProcessAnnotationConfiguration(AnnotationConfiguration config) throws HibernateException { config.addSqlFunction("FN_ARREDONDAMENTO_TARIFA", new FnArredondamentoTarifa()); } diff --git a/src/com/rjconsultores/ventaboletos/utilerias/spring/security/MiPasswordEncoder.java b/src/com/rjconsultores/ventaboletos/utilerias/spring/security/MiPasswordEncoder.java index 302ba16f3..2ec3aaca0 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/spring/security/MiPasswordEncoder.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/spring/security/MiPasswordEncoder.java @@ -7,14 +7,11 @@ import com.rjconsultores.ventaboletos.utilerias.seguridad.ContrasenaUtileria; public class MiPasswordEncoder implements PasswordEncoder { - @Override public String encodePassword(String pwd, Object salt) throws DataAccessException { - return ContrasenaUtileria.encriptarContrasena(pwd); } - @Override public boolean isPasswordValid(String encPass, String pwd, Object salt) throws DataAccessException { return encodePassword(pwd, salt).equals(encPass); }