Legalizacao Massiva Voucher feat bug#AL-4710
parent
d56489469e
commit
44e7b6bf44
|
@ -64,5 +64,7 @@ public interface ParadaDAO {
|
|||
public List<Parada> buscarDestinosPorOrigem(Integer origemId);
|
||||
|
||||
public List<Parada> obtenerOrigenPorListRutaIds(Integer orgaoConcendenteId, Integer empresaId,Integer[] listRuta);
|
||||
|
||||
public List<String> buscarDescOrigemDestino(Integer origemId, Integer destinoId);
|
||||
|
||||
}
|
||||
|
|
|
@ -5,5 +5,7 @@ import com.rjconsultores.ventaboletos.entidad.Transportadora;
|
|||
public interface TransportadoraDAO extends GenericDAO<Transportadora, Long> {
|
||||
|
||||
public boolean existe(String nit);
|
||||
|
||||
public Transportadora buscarPorNit(String nit);
|
||||
|
||||
}
|
||||
|
|
|
@ -8,5 +8,7 @@ import com.rjconsultores.ventaboletos.entidad.Voucher;
|
|||
public interface VoucherDAO extends GenericDAO<Voucher, Long> {
|
||||
|
||||
public List<Voucher> buscarConsulta(Long voucherId, String numContrato, String nit, String nomeTransportadora, Date dataInicial, Date dataFinal, Integer origemId, Integer destinoId);
|
||||
|
||||
public List<Voucher> buscarLegalizacao(Long numInicial, Long numFinal, String numContrato, Integer status, Integer origenId, Integer destinoId);
|
||||
|
||||
}
|
||||
|
|
|
@ -282,4 +282,29 @@ public class ParadaHibernateDAO extends GenericHibernateDAO<Parada, Integer> imp
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> buscarDescOrigemDestino(Integer origemId, Integer destinoId) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(" SELECT descparada AS descOrigem ");
|
||||
sb.append(" FROM parada po ");
|
||||
sb.append(" WHERE po.activo = 1 ");
|
||||
sb.append(" and po.parada_id =:origemId ");
|
||||
sb.append(" UNION ");
|
||||
sb.append(" SELECT descparada AS descDestino ");
|
||||
sb.append(" FROM parada pd ");
|
||||
sb.append(" WHERE pd.activo = 1 ");
|
||||
sb.append(" and pd.parada_id =:destinoId ");
|
||||
|
||||
Query qry = getSession().createSQLQuery(sb.toString());
|
||||
|
||||
qry.setInteger("origemId", origemId);
|
||||
qry.setInteger("destinoId", destinoId);
|
||||
|
||||
List<String> list = qry.list();
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,4 +37,18 @@ public class TransportadoraHibernateDAO extends GenericHibernateDAO<Transportado
|
|||
|
||||
return !c.list().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transportadora buscarPorNit(String nit) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("nit", nit.trim()));
|
||||
c.add(Restrictions.eq(ACTIVO, Boolean.TRUE));
|
||||
|
||||
List<Transportadora> ret = castList(Transportadora.class, c.list());
|
||||
if( ret.isEmpty()) {
|
||||
return null;
|
||||
}else {
|
||||
return ret.get(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,10 +45,7 @@ public class VoucherHibernateDAO extends GenericHibernateDAO<Voucher, Long> impl
|
|||
hql.append("SELECT v, ori.descParada AS descOrigem , des.descParada AS descDestino ");
|
||||
hql.append("FROM Voucher v ");
|
||||
|
||||
setJoins( numContrato,
|
||||
nit,
|
||||
nomeTransportadora,
|
||||
hql);
|
||||
setJoins( hql);
|
||||
|
||||
hql.append("WHERE v.activo = 1 ");
|
||||
|
||||
|
@ -57,9 +54,13 @@ public class VoucherHibernateDAO extends GenericHibernateDAO<Voucher, Long> impl
|
|||
nit,
|
||||
nomeTransportadora,
|
||||
dataInicial,
|
||||
dataFinal,
|
||||
dataFinal,
|
||||
null,
|
||||
origemId,
|
||||
destinoId,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
hql);
|
||||
|
||||
hql.append("ORDER BY voucherId ");
|
||||
|
@ -72,35 +73,117 @@ public class VoucherHibernateDAO extends GenericHibernateDAO<Voucher, Long> impl
|
|||
nomeTransportadora,
|
||||
dataInicial,
|
||||
dataFinal,
|
||||
null,
|
||||
origemId,
|
||||
destinoId,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
query);
|
||||
|
||||
return query.list();
|
||||
}
|
||||
|
||||
private void setJoins(String numContrato, String nit, String nomeTransportadora, StringBuilder hql) {
|
||||
hql.append("LEFT JOIN Parada ori ON v.origenId = ori.origenId ");
|
||||
hql.append("LEFT JOIN Parada des ON v.origenId = des.origenId ");
|
||||
@Override
|
||||
public List<Voucher> buscarLegalizacao(Long numInicial,
|
||||
Long numFinal,
|
||||
String numContrato,
|
||||
Integer status,
|
||||
Integer origemId,
|
||||
Integer destinoId) {
|
||||
|
||||
|
||||
StringBuilder hql = new StringBuilder();
|
||||
hql.append(" SELECT v ");
|
||||
hql.append(" FROM Voucher v ");
|
||||
hql.append(" WHERE v.activo = 1 ");
|
||||
|
||||
|
||||
setClausulas(null,
|
||||
numContrato,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
status,
|
||||
origemId,
|
||||
destinoId,
|
||||
null,
|
||||
numInicial,
|
||||
numFinal,
|
||||
hql);
|
||||
|
||||
hql.append("ORDER BY v.voucherId ");
|
||||
|
||||
Query query = getSession().createQuery(hql.toString());
|
||||
|
||||
setParametros(null,
|
||||
numContrato,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
status,
|
||||
origemId,
|
||||
destinoId,
|
||||
null,
|
||||
numInicial,
|
||||
numFinal,
|
||||
query);
|
||||
|
||||
return query.list();
|
||||
}
|
||||
|
||||
|
||||
private void setJoins(StringBuilder hql) {
|
||||
hql.append("LEFT JOIN com.rjconsultores.ventaboletos.entidad.Parada ori ON v.origenId = ori.paradaId ");
|
||||
hql.append("LEFT JOIN com.rjconsultores.ventaboletos.entidad.Parada des ON v.destinoId = des.paradaId ");
|
||||
}
|
||||
|
||||
private void setClausulas(Long voucherId, String numContrato, String nit, String nomeTransportadora,
|
||||
Date dataInicial, Date dataFinal, Integer origemId, Integer destinoId, StringBuilder hql) {
|
||||
private void setClausulas(Long voucherId,
|
||||
String numContrato,
|
||||
String nit,
|
||||
String nomeTransportadora,
|
||||
Date dataInicial,
|
||||
Date dataFinal,
|
||||
Integer status,
|
||||
Integer origemId,
|
||||
Integer destinoId,
|
||||
Long transportadoraId,
|
||||
Long numInicial,
|
||||
Long numFinal,
|
||||
StringBuilder hql) {
|
||||
|
||||
if(voucherId != null ){
|
||||
hql.append(" AND v.voucherId = :voucherId ");
|
||||
}
|
||||
|
||||
if(numInicial != null ){
|
||||
hql.append(" AND v.voucherId >= :numInicial ");
|
||||
}
|
||||
|
||||
if(numFinal != null ){
|
||||
hql.append(" AND v.voucherId <= :numFinal ");
|
||||
}
|
||||
|
||||
if(status != null ){
|
||||
hql.append(" AND v.status = :status ");
|
||||
}
|
||||
|
||||
if(numContrato != null ){
|
||||
hql.append(" AND v.voucherId = :voucherId ");
|
||||
hql.append(" AND v.contrato.numContrato = :numContrato ");
|
||||
}
|
||||
|
||||
if(nit != null ){
|
||||
hql.append(" AND v.voucherId = :voucherId ");
|
||||
hql.append(" AND v.transportadora.nit = :nit ");
|
||||
}
|
||||
|
||||
if(nomeTransportadora != null ){
|
||||
hql.append(" AND v.voucherId = :voucherId ");
|
||||
hql.append(" AND v.transportadora.nomeTransportadora like :nomeTransportadora ");
|
||||
}
|
||||
|
||||
if(transportadoraId != null ){
|
||||
hql.append(" AND v.transportadora.transportadoraId = :transportadoraId ");
|
||||
}
|
||||
|
||||
if(dataInicial != null ){
|
||||
|
@ -125,14 +208,26 @@ public class VoucherHibernateDAO extends GenericHibernateDAO<Voucher, Long> impl
|
|||
String nit,
|
||||
String nomeTransportadora,
|
||||
Date dataInicial,
|
||||
Date dataFinal,
|
||||
Date dataFinal,
|
||||
Integer status,
|
||||
Integer origemId,
|
||||
Integer destinoId,
|
||||
Integer destinoId,
|
||||
Long transportadoraId,
|
||||
Long numInicial,
|
||||
Long numFinal,
|
||||
Query query) {
|
||||
|
||||
if(voucherId != null ){
|
||||
query.setLong("voucherId", voucherId);
|
||||
}
|
||||
|
||||
if(numInicial != null ){
|
||||
query.setLong("numInicial", numInicial);
|
||||
}
|
||||
|
||||
if(numFinal != null ){
|
||||
query.setLong("numFinal", numFinal);
|
||||
}
|
||||
|
||||
if(numContrato != null ){
|
||||
query.setString("numContrato", numContrato);
|
||||
|
@ -146,6 +241,10 @@ public class VoucherHibernateDAO extends GenericHibernateDAO<Voucher, Long> impl
|
|||
query.setString("nomeTransportadora", nomeTransportadora);
|
||||
}
|
||||
|
||||
if(transportadoraId != null ){
|
||||
query.setLong("transportadoraId", transportadoraId);
|
||||
}
|
||||
|
||||
if(dataInicial != null ){
|
||||
query.setDate("dataInicial", dataInicial);
|
||||
}
|
||||
|
@ -154,6 +253,10 @@ public class VoucherHibernateDAO extends GenericHibernateDAO<Voucher, Long> impl
|
|||
query.setDate("dataFinal", dataFinal);
|
||||
}
|
||||
|
||||
if(status != null ){
|
||||
query.setInteger("status", status);
|
||||
}
|
||||
|
||||
if(origemId != null ){
|
||||
query.setInteger("origemId", origemId);
|
||||
}
|
||||
|
|
|
@ -97,6 +97,14 @@ public class Voucher implements Serializable {
|
|||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "TRANSPORTADORA_ID")
|
||||
private Transportadora transportadora;
|
||||
|
||||
@Column(name = "DATA_FATURA")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date dataFatura;
|
||||
|
||||
@Column(name = "DATA_LEGALIZA")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date dataLegaliza;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private boolean activo;
|
||||
|
|
|
@ -15,7 +15,6 @@ import com.rjconsultores.ventaboletos.entidad.Ruta;
|
|||
import com.rjconsultores.ventaboletos.entidad.TipoParada;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||
import com.rjconsultores.ventaboletos.vo.parada.ParadaVO;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -48,8 +47,10 @@ public interface ParadaService {
|
|||
|
||||
public List<Parada> buscarPorAgrupamentoParadaId(AgrupamentoParada agrupamentoParada);
|
||||
|
||||
public List<Parada> buscarDestinosPorOrigem(Integer origemId);
|
||||
public List<Parada> buscarDestinosPorOrigem(Integer origemId);
|
||||
|
||||
public List<Parada> obtenerOrigenPorListRutaIds(Integer orgaoConcendenteId, Integer empresaId,Integer[] listRuta);
|
||||
|
||||
public List<String> buscarDescOrigemDestino(Integer origemId, Integer destinoId);
|
||||
|
||||
}
|
||||
|
|
|
@ -6,4 +6,6 @@ public interface TransportadoraService extends GenericService<Transportadora, Lo
|
|||
|
||||
public boolean existe(String nit);
|
||||
|
||||
public Transportadora buscarPorNit(String nit);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Transportadora;
|
||||
import com.rjconsultores.ventaboletos.entidad.Voucher;
|
||||
import com.rjconsultores.ventaboletos.vo.configuracioneccomerciales.VoucherVO;
|
||||
|
||||
public interface VoucherService extends GenericService<Voucher, Long> {
|
||||
|
||||
List<Voucher> buscarConsulta(Long voucherId, String numContrato, String nit, String nomeTransportadora, Date dataInicial, Date dataFinal, Integer origemId, Integer destinoId);
|
||||
|
||||
List<VoucherVO> legalizar(Long numInicial, Long numFinal, String numContrato, Transportadora transportadora, BigDecimal valor, Parada origem, Parada destino);
|
||||
|
||||
}
|
||||
|
|
|
@ -66,7 +66,8 @@ public class ImportacaoRetornoBancarioServiceImpl implements ImportacaoRetornoBa
|
|||
&& !detalhe.getCodigoOcorrencia().equals(LIQUIDACAO_EM_CARTORIO) ) {
|
||||
erros++;
|
||||
detalhado.append("Registro sem ocorrencia de quitação: ").append(detalhe.getNossoNumero()).append(".\n");
|
||||
}else if( salvarRetornoBancario( detalhe, empresa.getEmpresaId(), usuarioId )) {
|
||||
}else
|
||||
if( salvarRetornoBancario( detalhe, empresa.getEmpresaId(), usuarioId )) {
|
||||
atualizados++;
|
||||
detalhado.append("Quitado:").append(detalhe.getNossoNumero()).append(".\n");
|
||||
}else {
|
||||
|
|
|
@ -39,6 +39,7 @@ public class ParadaServiceImpl implements ParadaService {
|
|||
|
||||
@Autowired
|
||||
private ParadaDAO paradaDAO;
|
||||
|
||||
@Autowired
|
||||
private TramoDAO tramoDAO;
|
||||
|
||||
|
@ -190,4 +191,9 @@ public class ParadaServiceImpl implements ParadaService {
|
|||
public List<Parada> obtenerOrigenPorListRutaIds(Integer orgaoConcendenteId, Integer empresaId, Integer[] listRuta){
|
||||
return paradaDAO.obtenerOrigenPorListRutaIds(orgaoConcendenteId,empresaId,listRuta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> buscarDescOrigemDestino(Integer origemId, Integer destinoId) {
|
||||
return paradaDAO.buscarDescOrigemDestino(origemId, destinoId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ public class TransportadoraServiceImpl implements TransportadoraService {
|
|||
|
||||
@Transactional
|
||||
public Transportadora actualizacion(Transportadora entidad) {
|
||||
entidad.setFecModif(Calendar.getInstance().getTime());
|
||||
return transportadoraDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
|
@ -57,4 +58,9 @@ public class TransportadoraServiceImpl implements TransportadoraService {
|
|||
public boolean existe(String nit) {
|
||||
return transportadoraDAO.existe(nit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transportadora buscarPorNit(String nit) {
|
||||
return transportadoraDAO.buscarPorNit(nit);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -11,11 +9,16 @@ import java.util.List;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.VoucherDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Transportadora;
|
||||
import com.rjconsultores.ventaboletos.entidad.Voucher;
|
||||
import com.rjconsultores.ventaboletos.enums.SituacaoVoucher;
|
||||
import com.rjconsultores.ventaboletos.service.VoucherService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.vo.configuracioneccomerciales.VoucherVO;
|
||||
|
||||
@Service("voucherService")
|
||||
public class VoucherServiceImpl implements VoucherService {
|
||||
|
@ -72,4 +75,72 @@ public class VoucherServiceImpl implements VoucherService {
|
|||
origemId,
|
||||
destinoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<VoucherVO> legalizar(Long numInicial,
|
||||
Long numFinal,
|
||||
String numContrato,
|
||||
Transportadora transportadora,
|
||||
BigDecimal valor,
|
||||
Parada origem,
|
||||
Parada destino) {
|
||||
List<Voucher> dados = voucherDAO.buscarLegalizacao(numInicial,
|
||||
numFinal,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
|
||||
List<VoucherVO> retorno = new ArrayList<VoucherVO>();
|
||||
for (Voucher vou : dados) {
|
||||
VoucherVO vo;
|
||||
|
||||
if( !vou.getContrato().getNumContrato().equals(numContrato)) {
|
||||
vo = VoucherVO.converteVoucher(vou);
|
||||
vo.setMensagem(Labels.getLabel("legalizacaoMassivaController.MSG.contratoDiferente"));
|
||||
retorno.add(vo);
|
||||
continue;
|
||||
}
|
||||
|
||||
if( !vou.getStatus().equals(SituacaoVoucher.EMITIDO.getValor())) {
|
||||
vo = VoucherVO.converteVoucher(vou);
|
||||
vo.setMensagem(Labels.getLabel("legalizacaoMassivaController.MSG.statusDiferente"));
|
||||
retorno.add(vo);
|
||||
continue;
|
||||
}
|
||||
|
||||
if( origem != null && !vou.getOrigenId().equals(origem.getParadaId())) {
|
||||
vo = VoucherVO.converteVoucher(vou);
|
||||
vo.setMensagem(Labels.getLabel("legalizacaoMassivaController.MSG.origemDiferente"));
|
||||
retorno.add(vo);
|
||||
continue;
|
||||
}
|
||||
|
||||
if( destino != null && !vou.getDestinoId().equals(destino.getParadaId())) {
|
||||
vo = VoucherVO.converteVoucher(vou);
|
||||
vo.setMensagem(Labels.getLabel("legalizacaoMassivaController.MSG.destinoDiferente"));
|
||||
retorno.add(vo);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
vou.setValorLegalizado(valor);
|
||||
vou.setTransportadora(transportadora);
|
||||
vou.setStatus(SituacaoVoucher.LEGALIZADO.getValor());
|
||||
vou.setDataLegaliza(Calendar.getInstance().getTime());
|
||||
|
||||
vou = voucherDAO.actualizacion(vou);
|
||||
vo = VoucherVO.converteVoucher(vou);
|
||||
vo.setMensagem(Labels.getLabel("label.sucesso"));
|
||||
}catch (Exception e) {
|
||||
vo = VoucherVO.converteVoucher(vou);
|
||||
vo.setMensagem(e.getMessage());
|
||||
}
|
||||
|
||||
retorno.add(vo);
|
||||
}
|
||||
|
||||
return retorno;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue