133 lines
3.3 KiB
Java
133 lines
3.3 KiB
Java
package com.rjconsultores.ventaboletos.vo.configuracioneccomerciales;
|
|
|
|
import java.io.Serializable;
|
|
import java.math.BigDecimal;
|
|
import java.util.Date;
|
|
|
|
import javax.persistence.Temporal;
|
|
import javax.persistence.TemporalType;
|
|
|
|
import com.rjconsultores.ventaboletos.anotacao.Renderizado;
|
|
import com.rjconsultores.ventaboletos.entidad.ContratoCorporativo;
|
|
import com.rjconsultores.ventaboletos.entidad.Transportadora;
|
|
import com.rjconsultores.ventaboletos.entidad.Voucher;
|
|
import com.rjconsultores.ventaboletos.enums.SituacaoVoucher;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Getter;
|
|
import lombok.NoArgsConstructor;
|
|
import lombok.Setter;
|
|
|
|
@Getter
|
|
@Setter
|
|
@AllArgsConstructor
|
|
@NoArgsConstructor
|
|
public class VoucherVO implements Serializable {
|
|
|
|
private static final long serialVersionUID = -2339597073156311073L;
|
|
|
|
@Renderizado( posicao = 1)
|
|
private Long voucherId;
|
|
|
|
@Renderizado( posicao = 2)
|
|
private ContratoCorporativo contrato;
|
|
|
|
private String nomePassageiro;
|
|
|
|
private String numFatura;
|
|
|
|
@Renderizado( posicao = 5 )
|
|
private BigDecimal valorLicitado;
|
|
|
|
@Renderizado( posicao = 6)
|
|
private BigDecimal valorLegalizado;
|
|
|
|
@Renderizado( posicao = 4)
|
|
private Date dataValidade;
|
|
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date dataInclusao;
|
|
|
|
private Integer origenId;
|
|
|
|
private Integer destinoId;
|
|
|
|
private Long claseServicioId;
|
|
|
|
@Renderizado( conversor = SituacaoVoucher.class, posicao = 3)
|
|
private Integer status;
|
|
|
|
private Long clienteCorporativoId;
|
|
|
|
private Long motivoCancelacionId;
|
|
|
|
private Long grupoContratoId;
|
|
|
|
private Transportadora transportadora;
|
|
|
|
private String descOrigem;
|
|
|
|
private String descDestino;
|
|
|
|
@Renderizado( posicao = 7 )
|
|
private String trecho;
|
|
|
|
@Renderizado( posicao = 8 )
|
|
private String mensagem;
|
|
|
|
public SituacaoVoucher getSituacaoVoucher() {
|
|
return SituacaoVoucher.buscarPeloValor(status);
|
|
}
|
|
|
|
public String getTrecho() {
|
|
return descOrigem +" X "+descDestino;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object obj) {
|
|
if (obj == null) {
|
|
return false;
|
|
}
|
|
|
|
if (getClass() != obj.getClass()) {
|
|
return false;
|
|
}
|
|
|
|
final VoucherVO other = (VoucherVO) obj;
|
|
return this.getVoucherId().equals(other.getVoucherId());
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int hash = 7;
|
|
hash = 59 * hash + (this.getVoucherId() != null ? this.getVoucherId().hashCode() : 0);
|
|
return hash;
|
|
}
|
|
|
|
public VoucherVO( Voucher pai ) {
|
|
this.voucherId = pai.getVoucherId();
|
|
this.claseServicioId = pai.getClaseServicioId();
|
|
this.clienteCorporativoId = pai.getClienteCorporativoId();
|
|
this.contrato = pai.getContrato();
|
|
this.dataInclusao = pai.getDataInclusao();
|
|
this.dataValidade = pai.getDataValidade();
|
|
this.descDestino = pai.getDescDestino();
|
|
this.descOrigem = pai.getDescOrigem();
|
|
this.destinoId = pai.getDestinoId();
|
|
this.origenId = pai.getOrigenId();
|
|
this.grupoContratoId = pai.getGrupoContratoId();
|
|
this.motivoCancelacionId = pai.getMotivoCancelacionId();
|
|
this.nomePassageiro = pai.getNomePassageiro();
|
|
this.numFatura = pai.getNumFatura();
|
|
this.status = pai.getStatus();
|
|
this.transportadora = pai.getTransportadora();
|
|
this.valorLegalizado = pai.getValorLegalizado();
|
|
this.valorLicitado = pai.getValorLicitado();
|
|
}
|
|
|
|
public static VoucherVO converteVoucher( Voucher pai ) {
|
|
return new VoucherVO(pai);
|
|
}
|
|
|
|
}
|