bug#10974
dev:thiago qua:junia git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@81328 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
deb5aff6a5
commit
67e6bb068e
|
@ -13,6 +13,8 @@ import javax.persistence.Basic;
|
||||||
import javax.persistence.CascadeType;
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.EnumType;
|
||||||
|
import javax.persistence.Enumerated;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
@ -24,6 +26,8 @@ import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.enums.TipoDescontoMonitrip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
|
@ -83,6 +87,10 @@ public class Categoria implements Serializable {
|
||||||
@Column(name = "CVESISTEMA")
|
@Column(name = "CVESISTEMA")
|
||||||
private String cvesistema;
|
private String cvesistema;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
@Column(name = "desconto_monitrip")
|
||||||
|
private TipoDescontoMonitrip tipoDescontoMonitrip;
|
||||||
|
|
||||||
public Categoria() {
|
public Categoria() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,4 +257,12 @@ public class Categoria implements Serializable {
|
||||||
public void setCvesistema(String cvesistema) {
|
public void setCvesistema(String cvesistema) {
|
||||||
this.cvesistema = cvesistema;
|
this.cvesistema = cvesistema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TipoDescontoMonitrip getTipoDescontoMonitrip() {
|
||||||
|
return tipoDescontoMonitrip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoDescontoMonitrip(TipoDescontoMonitrip tipoDescontoMonitrip) {
|
||||||
|
this.tipoDescontoMonitrip = tipoDescontoMonitrip;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.rjconsultores.ventaboletos.enums;
|
||||||
|
|
||||||
|
public enum TipoDescontoMonitrip {
|
||||||
|
|
||||||
|
NORMAL(1,"Tarifa Normal – sem desconto"),
|
||||||
|
TARIFA_PROMOCIONAL(2, "Tarifa Promocional"),
|
||||||
|
IDOSO_100(5, "Bilhete de Viagem do Idoso 100%"),
|
||||||
|
IDOSO_50(6, "Bilhete de Viagem do Idoso 50%"),
|
||||||
|
AUT_VIAGEM_LIVRE(7, "Autorização de Viagem - Passe Livre"),
|
||||||
|
AUDITORES_AGENTES(8, "Passe Livre Auditores e Agentes do Trabalho"),
|
||||||
|
GRATUIDADE_CRIANCA(9, "Gratuidade de Criança"),
|
||||||
|
JOVEM_BAIXA_RENDA_100(10, "Gratuidade Jovem de Baixa Renda 100%"),
|
||||||
|
JOVEM_BAIXA_RENDA_50(11, "Gratuidade Jovem de Baixa Renda 50%"),
|
||||||
|
AUT_VIAGEM_ACOMP(12, "Autorização de Viagem - Passe Livre Acompanhante");
|
||||||
|
|
||||||
|
private Integer valor;
|
||||||
|
private String descricao;
|
||||||
|
|
||||||
|
private TipoDescontoMonitrip(Integer valor, String descricao) {
|
||||||
|
this.valor = valor;
|
||||||
|
this.descricao = descricao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getValor() {
|
||||||
|
return valor;
|
||||||
|
}
|
||||||
|
public String getDescricao() {
|
||||||
|
return descricao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TipoDescontoMonitrip geTipoDescontoMonitrip(Integer valor) {
|
||||||
|
if(NORMAL.getValor().equals(valor)) {
|
||||||
|
return NORMAL;
|
||||||
|
} else if(TARIFA_PROMOCIONAL.getValor().equals(valor)) {
|
||||||
|
return TARIFA_PROMOCIONAL;
|
||||||
|
} else if(IDOSO_100.getValor().equals(valor)) {
|
||||||
|
return IDOSO_100;
|
||||||
|
} else if(IDOSO_50.getValor().equals(valor)) {
|
||||||
|
return IDOSO_50;
|
||||||
|
} else if(AUT_VIAGEM_LIVRE.getValor().equals(valor)) {
|
||||||
|
return AUT_VIAGEM_LIVRE;
|
||||||
|
} else if(AUDITORES_AGENTES.getValor().equals(valor)) {
|
||||||
|
return AUDITORES_AGENTES;
|
||||||
|
} else if(GRATUIDADE_CRIANCA.getValor().equals(valor)) {
|
||||||
|
return GRATUIDADE_CRIANCA;
|
||||||
|
} else if(JOVEM_BAIXA_RENDA_100.getValor().equals(valor)) {
|
||||||
|
return JOVEM_BAIXA_RENDA_100;
|
||||||
|
} else if(JOVEM_BAIXA_RENDA_50.getValor().equals(valor)) {
|
||||||
|
return JOVEM_BAIXA_RENDA_50;
|
||||||
|
} else if(AUT_VIAGEM_ACOMP.getValor().equals(valor)) {
|
||||||
|
return AUT_VIAGEM_ACOMP;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NORMAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return this.descricao;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue