cadastro de grupo de contrato feat bug#AL-4276
parent
9058d967f3
commit
a3526e1dee
11
pom.xml
11
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ModelWeb</artifactId>
|
||||
<version>1.64.0</version>
|
||||
<version>1.65.0</version>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
|
@ -53,7 +53,7 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>3.0.6.RELEASE</version>
|
||||
<version>3.0.6.RELEASE</version><!-- TODO verificar upgrade pra 5.3.37-->
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -216,6 +216,13 @@
|
|||
<classifier>jdk16</classifier>
|
||||
<version>4.11.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.32</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
</dependencyManagement>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ExcecaoGrupoContrato;
|
||||
|
||||
public interface ExcecaoGrupoContratoDAO extends GenericDAO<ExcecaoGrupoContrato, Integer>{
|
||||
|
||||
public boolean gravarExcecoesGrupoContrato( List<ExcecaoGrupoContrato> excecoes);
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.GrupoContrato;
|
||||
|
||||
public interface GrupoContratoDAO extends GenericDAO<GrupoContrato, Integer>{
|
||||
|
||||
public List<GrupoContrato> buscar(String nome);
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaGrupoContrato;
|
||||
|
||||
public interface TarifaGrupoContratoDAO extends GenericDAO<TarifaGrupoContrato, Integer>{
|
||||
|
||||
public boolean gravarTarifasGrupoContrato( List<TarifaGrupoContrato> tarifas);
|
||||
|
||||
}
|
|
@ -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<ExcecaoGrupoContrato, Integer> implements ExcecaoGrupoContratoDAO {
|
||||
|
||||
@Autowired
|
||||
public ExcecaoGrupoContratoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExcecaoGrupoContrato> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean gravarExcecoesGrupoContrato(List<ExcecaoGrupoContrato> excecoes) {
|
||||
|
||||
for (ExcecaoGrupoContrato excecao : excecoes) {
|
||||
if(excecao.getExcecaoGrupoContratoId() == null) {
|
||||
suscribir(excecao);
|
||||
}else {
|
||||
actualizacion(excecao);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -115,7 +115,7 @@ public class GenericHibernateDAO<T, ID extends Serializable> extends HibernateDa
|
|||
}
|
||||
|
||||
public void suscribirTodos(Collection<T> entidades) {
|
||||
getHibernateTemplate().saveOrUpdateAll(entidades);
|
||||
getHibernateTemplate().saveOrUpdate(entidades);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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<GrupoCategoria, Integer>
|
||||
implements GrupoCategoriaDAO {
|
||||
|
@ -28,7 +29,6 @@ public class GrupoCategoriaHibernateDAO extends GenericHibernateDAO<GrupoCategor
|
|||
return c.list();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<GrupoCategoria> buscar(String descricao) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
|
|
|
@ -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<GrupoContrato, Integer> implements GrupoContratoDAO {
|
||||
|
||||
@Autowired
|
||||
public GrupoContratoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GrupoContrato> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
public List<GrupoContrato> buscar(String descgrupo) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.eq("nomeGrupoContrato", descgrupo));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ import org.springframework.stereotype.Repository;
|
|||
*
|
||||
* @author Shiro
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Repository("grupoCortesiaDAO")
|
||||
public class GrupoCortesiasHibernateDAO extends GenericHibernateDAO<GrupoCortesia, Integer>
|
||||
implements GrupoCortesiasDAO {
|
||||
|
|
|
@ -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<TarifaGrupoContrato, Integer> implements TarifaGrupoContratoDAO {
|
||||
|
||||
@Autowired
|
||||
public TarifaGrupoContratoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TarifaGrupoContrato> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean gravarTarifasGrupoContrato(List<TarifaGrupoContrato> tarifas) {
|
||||
|
||||
for (TarifaGrupoContrato tarifa : tarifas) {
|
||||
if(tarifa.getTarifaGrupoContratoId() == null) {
|
||||
suscribir(tarifa);
|
||||
}else {
|
||||
actualizacion(tarifa);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -54,32 +54,45 @@ public class ClaseServicio implements Serializable, Auditavel<ClaseServicio> {
|
|||
|
||||
@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<CategoriaClase> categoriaClaseList;
|
||||
|
||||
@OneToMany(mappedBy = "claseServicio")
|
||||
private List<ReservacionClase> reservacionClaseList;
|
||||
|
||||
@OneToMany(mappedBy = "claseServicio")
|
||||
private List<TramoTiempo> tramoTiempoList;
|
||||
|
||||
@Column(name = "EQUIVALENCIA_ID")
|
||||
private String equivalenciaId;
|
||||
|
||||
@Column(name = "EQUIVALENCIAELEKTRA_ID")
|
||||
private String equivalenciaElektraId;
|
||||
|
||||
@OneToMany(mappedBy = "claseServicio")
|
||||
private List<TarifaHist> tarifaHistList;
|
||||
|
||||
@OneToMany(mappedBy = "claseServicio")
|
||||
private List<Corrida> corridaList;
|
||||
|
||||
@Column(name = "COEFICIENTETARIFA")
|
||||
private BigDecimal coeficiente;
|
||||
|
||||
@Column(name = "PORCPRICINGSEMELHANTE")
|
||||
private BigDecimal porcPricingSemelhante;
|
||||
|
||||
|
|
|
@ -0,0 +1,360 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@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_INICIO")
|
||||
private Date dataInicio;
|
||||
|
||||
@Column(name = "DATA_FIM")
|
||||
private Date dataFim;
|
||||
|
||||
@Column(name = "VALOR_CONTRATO")
|
||||
private BigDecimal valorContrato;
|
||||
|
||||
@Column(name = "PERCENTUAL_BONUS")
|
||||
private BigDecimal percentualBonus;
|
||||
|
||||
@Column(name = "USUARIOREP_ID")
|
||||
private Long usuarioRepId;
|
||||
|
||||
@Column(name = "TIPO_CALCULO")
|
||||
private Long tipoCalculo;
|
||||
|
||||
@Column(name = "TIPO_TARIFA")
|
||||
private Long tipoTarifa;
|
||||
|
||||
@Column(name = "TIPO_CONTRATO")
|
||||
private Long tipoContrato;
|
||||
|
||||
@Column(name = "PUNTOVENTA_ID")
|
||||
private Long puntoVentaId;
|
||||
|
||||
@Column(name = "CIUDAD_ID")
|
||||
private Long ciudadId;
|
||||
|
||||
@Column(name = "LOGRADOURO")
|
||||
private String logradouro;
|
||||
|
||||
@Column(name = "NUMERO")
|
||||
private String numero;
|
||||
|
||||
@Column(name = "COMPLEMENTO")
|
||||
private String complemento;
|
||||
|
||||
@Column(name = "BAIRRO")
|
||||
private String bairro;
|
||||
|
||||
@Column(name = "CEP")
|
||||
private String cep;
|
||||
|
||||
@Column(name = "TELEFONE")
|
||||
private String telefone;
|
||||
|
||||
@Column(name = "EMAIL")
|
||||
private String email;
|
||||
|
||||
@Column(name = "OBSERVACAO")
|
||||
private String observacao;
|
||||
|
||||
@Column(name = "DIVISAO")
|
||||
private String divisao;
|
||||
|
||||
@Column(name = "STATUS_CONTRATO")
|
||||
private Long statusContrato;
|
||||
|
||||
@Column(name = "DESCONTO_FATURA")
|
||||
private BigDecimal descontoFatura;
|
||||
|
||||
@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 Long usuarioId;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private Integer activo;
|
||||
|
||||
@Basic(optional = false)
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecModif;
|
||||
|
||||
|
||||
public Long getContratoId() {
|
||||
return contratoId;
|
||||
}
|
||||
|
||||
public void setContratoId(Long contratoId) {
|
||||
this.contratoId = contratoId;
|
||||
}
|
||||
|
||||
public Long getClienteCorporativoId() {
|
||||
return clienteCorporativoId;
|
||||
}
|
||||
|
||||
public void setClienteCorporativoId(Long clienteCorporativoId) {
|
||||
this.clienteCorporativoId = clienteCorporativoId;
|
||||
}
|
||||
|
||||
public String getNumContrato() {
|
||||
return numContrato;
|
||||
}
|
||||
|
||||
public void setNumContrato(String numContrato) {
|
||||
this.numContrato = numContrato;
|
||||
}
|
||||
|
||||
public Date getDataInicio() {
|
||||
return dataInicio;
|
||||
}
|
||||
|
||||
public void setDataInicio(Date dataInicio) {
|
||||
this.dataInicio = dataInicio;
|
||||
}
|
||||
|
||||
public Date getDataFim() {
|
||||
return dataFim;
|
||||
}
|
||||
|
||||
public void setDataFim(Date dataFim) {
|
||||
this.dataFim = dataFim;
|
||||
}
|
||||
|
||||
public BigDecimal getValorContrato() {
|
||||
return valorContrato;
|
||||
}
|
||||
|
||||
public void setValorContrato(BigDecimal valorContrato) {
|
||||
this.valorContrato = valorContrato;
|
||||
}
|
||||
|
||||
public BigDecimal getPercentualBonus() {
|
||||
return percentualBonus;
|
||||
}
|
||||
|
||||
public void setPercentualBonus(BigDecimal percentualBonus) {
|
||||
this.percentualBonus = percentualBonus;
|
||||
}
|
||||
|
||||
public Long getUsuarioRepId() {
|
||||
return usuarioRepId;
|
||||
}
|
||||
|
||||
public void setUsuarioRepId(Long usuarioRepId) {
|
||||
this.usuarioRepId = usuarioRepId;
|
||||
}
|
||||
|
||||
public Long getTipoCalculo() {
|
||||
return tipoCalculo;
|
||||
}
|
||||
|
||||
public void setTipoCalculo(Long tipoCalculo) {
|
||||
this.tipoCalculo = tipoCalculo;
|
||||
}
|
||||
|
||||
public Long getTipoTarifa() {
|
||||
return tipoTarifa;
|
||||
}
|
||||
|
||||
public void setTipoTarifa(Long tipoTarifa) {
|
||||
this.tipoTarifa = tipoTarifa;
|
||||
}
|
||||
|
||||
public Long getTipoContrato() {
|
||||
return tipoContrato;
|
||||
}
|
||||
|
||||
public void setTipoContrato(Long tipoContrato) {
|
||||
this.tipoContrato = tipoContrato;
|
||||
}
|
||||
|
||||
public Long getPuntoVentaId() {
|
||||
return puntoVentaId;
|
||||
}
|
||||
|
||||
public void setPuntoVentaId(Long puntoVentaId) {
|
||||
this.puntoVentaId = puntoVentaId;
|
||||
}
|
||||
|
||||
public Long getCiudadId() {
|
||||
return ciudadId;
|
||||
}
|
||||
|
||||
public void setCiudadId(Long ciudadId) {
|
||||
this.ciudadId = ciudadId;
|
||||
}
|
||||
|
||||
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 getComplemento() {
|
||||
return complemento;
|
||||
}
|
||||
|
||||
public void setComplemento(String complemento) {
|
||||
this.complemento = complemento;
|
||||
}
|
||||
|
||||
public String getBairro() {
|
||||
return bairro;
|
||||
}
|
||||
|
||||
public void setBairro(String bairro) {
|
||||
this.bairro = bairro;
|
||||
}
|
||||
|
||||
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 String getObservacao() {
|
||||
return observacao;
|
||||
}
|
||||
|
||||
public void setObservacao(String observacao) {
|
||||
this.observacao = observacao;
|
||||
}
|
||||
|
||||
public String getDivisao() {
|
||||
return divisao;
|
||||
}
|
||||
|
||||
public void setDivisao(String divisao) {
|
||||
this.divisao = divisao;
|
||||
}
|
||||
|
||||
public Long getStatusContrato() {
|
||||
return statusContrato;
|
||||
}
|
||||
|
||||
public void setStatusContrato(Long statusContrato) {
|
||||
this.statusContrato = statusContrato;
|
||||
}
|
||||
|
||||
public BigDecimal getDescontoFatura() {
|
||||
return descontoFatura;
|
||||
}
|
||||
|
||||
public void setDescontoFatura(BigDecimal descontoFatura) {
|
||||
this.descontoFatura = descontoFatura;
|
||||
}
|
||||
|
||||
public Boolean getIndBilhetesConfirmados() {
|
||||
return indBilhetesConfirmados;
|
||||
}
|
||||
|
||||
public void setIndBilhetesConfirmados(Boolean indBilhetesConfirmados) {
|
||||
this.indBilhetesConfirmados = indBilhetesConfirmados;
|
||||
}
|
||||
|
||||
public Boolean getIndReservaBilhete() {
|
||||
return indReservaBilhete;
|
||||
}
|
||||
|
||||
public void setIndReservaBilhete(Boolean indReservaBilhete) {
|
||||
this.indReservaBilhete = indReservaBilhete;
|
||||
}
|
||||
|
||||
public Boolean getIndManipulaBonus() {
|
||||
return indManipulaBonus;
|
||||
}
|
||||
|
||||
public void setIndManipulaBonus(Boolean indManipulaBonus) {
|
||||
this.indManipulaBonus = indManipulaBonus;
|
||||
}
|
||||
|
||||
public Boolean getIndExigeExcedente() {
|
||||
return indExigeExcedente;
|
||||
}
|
||||
|
||||
public void setIndExigeExcedente(Boolean indExigeExcedente) {
|
||||
this.indExigeExcedente = indExigeExcedente;
|
||||
}
|
||||
|
||||
public Long getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Long usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public Integer getActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(Integer activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Date getFecModif() {
|
||||
return fecModif;
|
||||
}
|
||||
|
||||
public void setFecModif(Date fecmodif) {
|
||||
this.fecModif = fecmodif;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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<TarifaGrupoContrato> tarifasGrupoContrato;
|
||||
|
||||
@OneToMany(mappedBy = "grupoContrato", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
@Where(clause = "ACTIVO=1")
|
||||
private List<ExcecaoGrupoContrato> 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();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
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 = "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 isActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Date getFecModif() {
|
||||
return fecModif;
|
||||
}
|
||||
|
||||
public void setFecModif(Date fecModif) {
|
||||
this.fecModif = fecModif;
|
||||
}
|
||||
|
||||
}
|
|
@ -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<GrupoContrato, Integer> {
|
||||
|
||||
public List<GrupoContrato> buscar(String descgrupo);
|
||||
|
||||
public boolean gravarTarifasGrupoContrato( List<TarifaGrupoContrato> tarifas);
|
||||
|
||||
public boolean gravarExcecoesGrupoContrato( List<ExcecaoGrupoContrato> excecoes);
|
||||
}
|
|
@ -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<GrupoCortesia, Integer> {
|
||||
|
||||
public List<GrupoCortesia> buscar(String descgrupo);
|
||||
|
|
|
@ -34,7 +34,7 @@ public class ClienteCorporativoServiceImpl implements ClienteCorporativoService
|
|||
entidad.getNomeClienteCorp() == null ||
|
||||
entidad.getIdentificacao() == null ||
|
||||
entidad.getDataCriacao() == null ){
|
||||
throw new BusinessException("MSG.camposObrigatorios");
|
||||
throw new BusinessException("editarClienteCorporativoController.MSG.camposObrigatorios");
|
||||
}
|
||||
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
|
|
|
@ -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<GrupoContrato> 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<GrupoContrato> buscar(String descgrupo) {
|
||||
return grupoContratoDAO.buscar(descgrupo);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean gravarTarifasGrupoContrato(List<TarifaGrupoContrato> tarifas) {
|
||||
return tarifaGrupoContratoDAO.gravarTarifasGrupoContrato(tarifas);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean gravarExcecoesGrupoContrato(List<ExcecaoGrupoContrato> excecoes) {
|
||||
return excecaoGrupoContratoDAO.gravarExcecoesGrupoContrato(excecoes);
|
||||
}
|
||||
}
|
|
@ -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) {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue