bug #8826
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@67479 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ae5827ca98
commit
8daf4ec0aa
|
@ -22,7 +22,9 @@ import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||||
import com.rjconsultores.ventaboletos.dao.BusquedaDatosTicketDAO;
|
import com.rjconsultores.ventaboletos.dao.BusquedaDatosTicketDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||||
import com.rjconsultores.ventaboletos.enums.SituacaoVendaPacote;
|
import com.rjconsultores.ventaboletos.enums.SituacaoVendaPacote;
|
||||||
|
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.ClientePacoteVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.ClientePacoteVO;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.DadosBancarioVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.EnderecoApanheVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.EnderecoApanheVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.ItemAdicionalVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.ItemAdicionalVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.PacoteVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.PacoteVO;
|
||||||
|
@ -30,6 +32,7 @@ import com.rjconsultores.ventaboletos.vo.busquedapacotes.PagamentoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.PassageiroVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.PassageiroVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.ServicoVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.ServicoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosClientePacoteResultTransformer;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosClientePacoteResultTransformer;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosDadosBancarioResultTransformer;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosEnderecoApanheResultTransformer;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosEnderecoApanheResultTransformer;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosItemAdicionalResultTransformer;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosItemAdicionalResultTransformer;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosPagamentoResultTransformer;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosPagamentoResultTransformer;
|
||||||
|
@ -176,7 +179,8 @@ public class BusquedaDatosTicketHibernateDAO extends GenericHibernateDAO<Pacote,
|
||||||
private void carregarDadosPagamento(List<PacoteVO> pacotes) {
|
private void carregarDadosPagamento(List<PacoteVO> pacotes) {
|
||||||
StringBuilder sQuery = new StringBuilder();
|
StringBuilder sQuery = new StringBuilder();
|
||||||
sQuery.append("SELECT PFP.PACOTEFORMAPAGO_ID, PFP.VALOR, PFP.VENDAPACOTE_ID, FP.FORMAPAGO_ID, FP.DESCPAGO, CT.TIPOTARJETA, CT.NUMAUTORIZACION, CT.CANTPARCELAS, ")
|
sQuery.append("SELECT PFP.PACOTEFORMAPAGO_ID, PFP.VALOR, PFP.VENDAPACOTE_ID, FP.FORMAPAGO_ID, FP.DESCPAGO, CT.TIPOTARJETA, CT.NUMAUTORIZACION, CT.CANTPARCELAS, ")
|
||||||
.append("NC.NOTACREDITOVENDAPACOTE_ID, VPC.NUMOPERACION AS NUMOPERACAOPACOTECANCELAMENTO, CT.NOMBTITULAR, CT.FECOPERACION, CT.NUMTARJETA, CT.DESCOPERADORACARTAO ")
|
.append("NC.NOTACREDITOVENDAPACOTE_ID, VPC.NUMOPERACION AS NUMOPERACAOPACOTECANCELAMENTO, CT.NOMBTITULAR, CT.FECOPERACION, CT.NUMTARJETA, CT.DESCOPERADORACARTAO, ")
|
||||||
|
.append("FP.TIPO_PAGO, CDP.CAJADIVERSOSPAGO_ID ")
|
||||||
.append("FROM PACOTE_FORMAPAGO PFP ")
|
.append("FROM PACOTE_FORMAPAGO PFP ")
|
||||||
.append("JOIN FORMA_PAGO FP ON FP.FORMAPAGO_ID = PFP.FORMAPAGO_ID ")
|
.append("JOIN FORMA_PAGO FP ON FP.FORMAPAGO_ID = PFP.FORMAPAGO_ID ")
|
||||||
.append("LEFT JOIN CAJA_DIVERSOS CD ON CD.VENDAPACOTE_ID = PFP.VENDAPACOTE_ID ")
|
.append("LEFT JOIN CAJA_DIVERSOS CD ON CD.VENDAPACOTE_ID = PFP.VENDAPACOTE_ID ")
|
||||||
|
@ -201,7 +205,8 @@ public class BusquedaDatosTicketHibernateDAO extends GenericHibernateDAO<Pacote,
|
||||||
.addScalar("NOMBTITULAR", StringType.INSTANCE)
|
.addScalar("NOMBTITULAR", StringType.INSTANCE)
|
||||||
.addScalar("FECOPERACION", DateType.INSTANCE)
|
.addScalar("FECOPERACION", DateType.INSTANCE)
|
||||||
.addScalar("NUMTARJETA", StringType.INSTANCE)
|
.addScalar("NUMTARJETA", StringType.INSTANCE)
|
||||||
.addScalar("DESCOPERADORACARTAO", StringType.INSTANCE);
|
.addScalar("DESCOPERADORACARTAO", StringType.INSTANCE)
|
||||||
|
.addScalar("TIPO_PAGO", IntegerType.INSTANCE);
|
||||||
|
|
||||||
query.setResultTransformer(new DatosPagamentoResultTransformer());
|
query.setResultTransformer(new DatosPagamentoResultTransformer());
|
||||||
query.setParameterList("vendapacoteIds", getVendapacoteIds(pacotes));
|
query.setParameterList("vendapacoteIds", getVendapacoteIds(pacotes));
|
||||||
|
@ -211,6 +216,8 @@ public class BusquedaDatosTicketHibernateDAO extends GenericHibernateDAO<Pacote,
|
||||||
int flag = -1;
|
int flag = -1;
|
||||||
for (PagamentoVO pagamento : pagamentos) {
|
for (PagamentoVO pagamento : pagamentos) {
|
||||||
if(pagamento.getVendapacoteId().equals(pacote.getVendapacoteId())) {
|
if(pagamento.getVendapacoteId().equals(pacote.getVendapacoteId())) {
|
||||||
|
|
||||||
|
|
||||||
flag = 0;
|
flag = 0;
|
||||||
if(pacote.getFormaspagamento() == null) {
|
if(pacote.getFormaspagamento() == null) {
|
||||||
pacote.setFormaspagamento(new ArrayList<PagamentoVO>());
|
pacote.setFormaspagamento(new ArrayList<PagamentoVO>());
|
||||||
|
@ -221,6 +228,10 @@ public class BusquedaDatosTicketHibernateDAO extends GenericHibernateDAO<Pacote,
|
||||||
(!isPacoteReserva(pacote) && !isPagamentoPacoteReserva(pagamento))) {
|
(!isPacoteReserva(pacote) && !isPagamentoPacoteReserva(pagamento))) {
|
||||||
pacote.getFormaspagamento().add(pagamento);
|
pacote.getFormaspagamento().add(pagamento);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isPagamentoDeposito(pagamento)) {
|
||||||
|
carregarDadosDeposito(pacote, pagamento);
|
||||||
|
}
|
||||||
} else if(flag == 0){
|
} else if(flag == 0){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -228,12 +239,16 @@ public class BusquedaDatosTicketHibernateDAO extends GenericHibernateDAO<Pacote,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isPagamentoDeposito(PagamentoVO pagamento) {
|
||||||
|
return TipoFormapago.DEPOSITO.equals(pagamento.getTipoFormapago());
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isPacoteReserva(PacoteVO pacote) {
|
private boolean isPacoteReserva(PacoteVO pacote) {
|
||||||
return SituacaoVendaPacote.RESERVA.toString().equals(pacote.getStatus());
|
return SituacaoVendaPacote.RESERVA.toString().equals(pacote.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isPagamentoPacoteReserva(PagamentoVO pagamento) {
|
private boolean isPagamentoPacoteReserva(PagamentoVO pagamento) {
|
||||||
return pagamento.getFormapagoId().equals(Constantes.FORMA_PAGO_RESERVA.intValue());
|
return TipoFormapago.RESERVA.equals(pagamento.getTipoFormapago());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -417,4 +432,28 @@ public class BusquedaDatosTicketHibernateDAO extends GenericHibernateDAO<Pacote,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private void carregarDadosDeposito(PacoteVO pacote, PagamentoVO pagamento) {
|
||||||
|
StringBuilder sQuery = new StringBuilder();
|
||||||
|
sQuery.append("SELECT CDDP.IDENTIFICACAO_DEPOSITO, CDDP.IMPORTE, CDDP.FECDEPOSITO ")
|
||||||
|
.append("FROM CAJA_DET_DEPOSITO_PAGO CDDP ")
|
||||||
|
.append("JOIN CAJA_DIVERSOS_PAGO CDP ON CDP.CAJADIVERSOSPAGO_ID = CDDP.CAJADIVERSOSPAGO_ID ")
|
||||||
|
.append("JOIN CAJA_DIVERSOS CD ON CD.CAJADIVERSOS_ID = CDP.CAJADIVERSOS_ID ")
|
||||||
|
.append("WHERE CDDP.ACTIVO = 1 ")
|
||||||
|
.append("AND CD.VENDAPACOTE_ID = :vendapacoteId ")
|
||||||
|
.append("AND CDP.FORMAPAGO_ID = :formapagoId ");
|
||||||
|
|
||||||
|
SQLQuery query = getSession().createSQLQuery(sQuery.toString())
|
||||||
|
.addScalar("IDENTIFICACAO_DEPOSITO", StringType.INSTANCE)
|
||||||
|
.addScalar("IMPORTE", BigDecimalType.INSTANCE)
|
||||||
|
.addScalar("FECDEPOSITO", DateType.INSTANCE);
|
||||||
|
|
||||||
|
query.setResultTransformer(new DatosDadosBancarioResultTransformer());
|
||||||
|
query.setParameter("vendapacoteId", pacote.getVendapacoteId());
|
||||||
|
query.setParameter("formapagoId", pagamento.getFormapagoId());
|
||||||
|
|
||||||
|
List<DadosBancarioVO> dadosBancarios = query.list();
|
||||||
|
pagamento.setDadosBancarios(dadosBancarios);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.CajaDAO;
|
import com.rjconsultores.ventaboletos.dao.CajaDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||||
|
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Caja;
|
import com.rjconsultores.ventaboletos.entidad.Caja;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.exception.VendaEmbarcadaBoletoException;
|
import com.rjconsultores.ventaboletos.exception.VendaEmbarcadaBoletoException;
|
||||||
|
@ -35,7 +36,9 @@ import com.rjconsultores.ventaboletos.exception.VendaEmbarcadaBoletoFormapagoExc
|
||||||
import com.rjconsultores.ventaboletos.exception.VendaEmbarcadaCajaException;
|
import com.rjconsultores.ventaboletos.exception.VendaEmbarcadaCajaException;
|
||||||
import com.rjconsultores.ventaboletos.exception.VendaEmbarcadaCajaFormapagoException;
|
import com.rjconsultores.ventaboletos.exception.VendaEmbarcadaCajaFormapagoException;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.OcdUtil;
|
import com.rjconsultores.ventaboletos.utilerias.OcdUtil;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.DadosBancarioVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.NotaCreditoVendaPacoteVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.NotaCreditoVendaPacoteVO;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer.DatosDadosBancarioResultTransformer;
|
||||||
import com.rjconsultores.ventaboletos.vo.caja.CajaCerradoVO;
|
import com.rjconsultores.ventaboletos.vo.caja.CajaCerradoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.caja.CajaDetalleVO;
|
import com.rjconsultores.ventaboletos.vo.caja.CajaDetalleVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.caja.CajaVO;
|
import com.rjconsultores.ventaboletos.vo.caja.CajaVO;
|
||||||
|
@ -176,6 +179,7 @@ public class CajaHibernateDAO extends GenericHibernateDAO<Object, Long> implemen
|
||||||
.addScalar("notacreditovendapacoteId", LongType.INSTANCE)
|
.addScalar("notacreditovendapacoteId", LongType.INSTANCE)
|
||||||
.addScalar("operadoracartao", StringType.INSTANCE)
|
.addScalar("operadoracartao", StringType.INSTANCE)
|
||||||
.addScalar("cvesecretaria", StringType.INSTANCE)
|
.addScalar("cvesecretaria", StringType.INSTANCE)
|
||||||
|
.addScalar("tipoPago", IntegerType.INSTANCE)
|
||||||
.addScalar("indEncargoVenta", BooleanType.INSTANCE);
|
.addScalar("indEncargoVenta", BooleanType.INSTANCE);
|
||||||
|
|
||||||
sql.setResultTransformer(new AliasToBeanResultTransformer(CajaDetalleVO.class));
|
sql.setResultTransformer(new AliasToBeanResultTransformer(CajaDetalleVO.class));
|
||||||
|
@ -234,6 +238,14 @@ public class CajaHibernateDAO extends GenericHibernateDAO<Object, Long> implemen
|
||||||
|
|
||||||
cajaDetalleVO.getFormaspagamento().add(pagamentoVO);
|
cajaDetalleVO.getFormaspagamento().add(pagamentoVO);
|
||||||
|
|
||||||
|
if(pagamentoVO.getDadosBancarios() == null) {
|
||||||
|
pagamentoVO.setDadosBancarios(new ArrayList<DadosBancarioVO>());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isPagamentoDeposito(TipoFormapago.getTipoFormapagoByValor(cd.getTipoPago()))) {
|
||||||
|
pagamentoVO.getDadosBancarios().addAll(carregarDadosDeposito(cd.getCajaId(), cd.getFormaPagoId()));
|
||||||
|
}
|
||||||
|
|
||||||
if (indexOf == -1){
|
if (indexOf == -1){
|
||||||
lsResultado.add(cajaDetalleVO);
|
lsResultado.add(cajaDetalleVO);
|
||||||
}
|
}
|
||||||
|
@ -524,6 +536,32 @@ public class CajaHibernateDAO extends GenericHibernateDAO<Object, Long> implemen
|
||||||
return new BigDecimal(chave += seq);
|
return new BigDecimal(chave += seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private List<DadosBancarioVO> carregarDadosDeposito(Long cajaId, Integer formapagoId) {
|
||||||
|
StringBuilder sQuery = new StringBuilder();
|
||||||
|
sQuery.append("SELECT CDDP.IDENTIFICACAO_DEPOSITO, CDDP.IMPORTE, CDDP.FECDEPOSITO ")
|
||||||
|
.append("FROM CAJA_DET_DEPOSITO_PAGO CDDP ")
|
||||||
|
.append("JOIN CAJA_FORMAPAGO CFP ON CFP.CAJAFORMAPAGO_ID = CDDP.CAJAFORMAPAGO_ID ")
|
||||||
|
.append("WHERE CDDP.ACTIVO = 1 ")
|
||||||
|
.append("AND CFP.CAJA_ID = :cajaId ")
|
||||||
|
.append("AND CFP.FORMAPAGO_ID = :formapagoId ");
|
||||||
|
|
||||||
|
SQLQuery query = getSession().createSQLQuery(sQuery.toString())
|
||||||
|
.addScalar("IDENTIFICACAO_DEPOSITO", StringType.INSTANCE)
|
||||||
|
.addScalar("IMPORTE", BigDecimalType.INSTANCE)
|
||||||
|
.addScalar("FECDEPOSITO", DateType.INSTANCE);
|
||||||
|
|
||||||
|
query.setResultTransformer(new DatosDadosBancarioResultTransformer());
|
||||||
|
query.setParameter("cajaId", cajaId);
|
||||||
|
query.setParameter("formapagoId", formapagoId);
|
||||||
|
|
||||||
|
return query.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isPagamentoDeposito(TipoFormapago tipoFormapago) {
|
||||||
|
return TipoFormapago.DEPOSITO.equals(tipoFormapago);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Map<String, List<Caja>> buscarCajaYTarjeta(String... numoperacionList) {
|
public Map<String, List<Caja>> buscarCajaYTarjeta(String... numoperacionList) {
|
||||||
|
@ -553,6 +591,4 @@ public class CajaHibernateDAO extends GenericHibernateDAO<Object, Long> implemen
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -944,7 +944,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
sb.append(" ocd.ocd_id as \"ocdId\", ocd.numoperacion as \"numoperacionOcd\", ");
|
sb.append(" ocd.ocd_id as \"ocdId\", ocd.numoperacion as \"numoperacionOcd\", ");
|
||||||
sb.append(" cdp.notacreditovendapacote_id as \"notacreditovendapacoteId\", ");
|
sb.append(" cdp.notacreditovendapacote_id as \"notacreditovendapacoteId\", ");
|
||||||
sb.append(" ct.descoperadoracartao as \"operadoracartao\", ");
|
sb.append(" ct.descoperadoracartao as \"operadoracartao\", ");
|
||||||
sb.append(" sec.cvesecretaria as \"cvesecretaria\", ");
|
sb.append(" sec.cvesecretaria as \"cvesecretaria\", ");
|
||||||
|
sb.append(" fp.tipo_pago as \"tipoPago\", ");
|
||||||
sb.append(" c.INDENCARGOVENTA as \"indEncargoVenta\" ");
|
sb.append(" c.INDENCARGOVENTA as \"indEncargoVenta\" ");
|
||||||
sb.append(" from ");
|
sb.append(" from ");
|
||||||
sb.append(" caja c ");
|
sb.append(" caja c ");
|
||||||
|
|
|
@ -38,4 +38,34 @@ public enum TipoFormapago {
|
||||||
return valor;
|
return valor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TipoFormapago getTipoFormapagoByValor(Integer valor) {
|
||||||
|
if(TipoFormapago.DINHEIRO.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.DINHEIRO;
|
||||||
|
} else if(TipoFormapago.DEBITO.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.DEBITO;
|
||||||
|
} else if(TipoFormapago.CREDITO.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.CREDITO;
|
||||||
|
} else if(TipoFormapago.NOTA_CREDITO.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.NOTA_CREDITO;
|
||||||
|
} else if(TipoFormapago.TROCA_PASSAGEM.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.TROCA_PASSAGEM;
|
||||||
|
} else if(TipoFormapago.IMPRESSAO_PASSAGEM.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.IMPRESSAO_PASSAGEM;
|
||||||
|
} else if(TipoFormapago.ORDEM_SERVICO.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.ORDEM_SERVICO;
|
||||||
|
} else if(TipoFormapago.BOLETO_ABERTO.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.BOLETO_ABERTO;
|
||||||
|
} else if(TipoFormapago.PACOTE.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.PACOTE;
|
||||||
|
} else if(TipoFormapago.RESERVA.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.RESERVA;
|
||||||
|
} else if(TipoFormapago.CHEQUE.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.CHEQUE;
|
||||||
|
} else if(TipoFormapago.DEPOSITO.getValor().equals(valor)) {
|
||||||
|
return TipoFormapago.DEPOSITO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,19 @@
|
||||||
package com.rjconsultores.ventaboletos.vo.busquedapacotes;
|
package com.rjconsultores.ventaboletos.vo.busquedapacotes;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
@XmlRootElement(name = "dadosBancarios")
|
@XmlRootElement(name = "dadosBancarios")
|
||||||
@XmlType(propOrder = {"banco", "identificadorDeposito"})
|
@XmlType(propOrder = {"banco", "identificadorDeposito", "data", "valor"})
|
||||||
public class DadosBancarioVO {
|
public class DadosBancarioVO {
|
||||||
|
|
||||||
private String banco;
|
private String banco;
|
||||||
private String identificadorDeposito;
|
private String identificadorDeposito;
|
||||||
|
private Date data;
|
||||||
|
private BigDecimal valor;
|
||||||
|
|
||||||
public String getBanco() {
|
public String getBanco() {
|
||||||
return banco;
|
return banco;
|
||||||
|
@ -26,4 +31,20 @@ public class DadosBancarioVO {
|
||||||
this.identificadorDeposito = identificadorDeposito;
|
this.identificadorDeposito = identificadorDeposito;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(Date data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getValor() {
|
||||||
|
return valor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValor(BigDecimal valor) {
|
||||||
|
this.valor = valor;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,32 @@
|
||||||
package com.rjconsultores.ventaboletos.vo.busquedapacotes;
|
package com.rjconsultores.ventaboletos.vo.busquedapacotes;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
import javax.xml.bind.annotation.XmlTransient;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
||||||
import com.rjconsultores.ventaboletos.vo.caja.PagamentoCartaoVO;
|
import com.rjconsultores.ventaboletos.vo.caja.PagamentoCartaoVO;
|
||||||
|
|
||||||
@XmlRootElement(name = "pagamento")
|
@XmlRootElement(name = "pagamento")
|
||||||
@XmlType(propOrder = { "formapagamento", "moeda", "valor", "notacredito", "cartao", "dadosBancario" })
|
@XmlType(propOrder = { "formapagamento", "moeda", "valor", "notacredito", "cartao", "dadosBancarios" })
|
||||||
public class PagamentoVO {
|
public class PagamentoVO {
|
||||||
|
|
||||||
private String formapagamento;
|
private String formapagamento;
|
||||||
private String moeda;
|
private String moeda;
|
||||||
private BigDecimal valor;
|
private BigDecimal valor;
|
||||||
private PagamentoCartaoVO cartao;
|
private PagamentoCartaoVO cartao;
|
||||||
private DadosBancarioVO dadosBancario;
|
|
||||||
private Long vendapacoteId;
|
private Long vendapacoteId;
|
||||||
private Integer formapagoId;
|
private Integer formapagoId;
|
||||||
private NotaCreditoVendaPacoteVO notacredito;
|
private NotaCreditoVendaPacoteVO notacredito;
|
||||||
|
private TipoFormapago tipoFormapago;
|
||||||
|
private Long cajadiversospagoId;
|
||||||
|
|
||||||
|
private List<DadosBancarioVO> dadosBancarios;
|
||||||
|
|
||||||
public String getMoeda() {
|
public String getMoeda() {
|
||||||
return moeda;
|
return moeda;
|
||||||
|
@ -53,14 +60,6 @@ public class PagamentoVO {
|
||||||
this.valor = valor;
|
this.valor = valor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DadosBancarioVO getDadosBancario() {
|
|
||||||
return dadosBancario;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDadosBancario(DadosBancarioVO dadosBancario) {
|
|
||||||
this.dadosBancario = dadosBancario;
|
|
||||||
}
|
|
||||||
|
|
||||||
@XmlTransient
|
@XmlTransient
|
||||||
public Long getVendapacoteId() {
|
public Long getVendapacoteId() {
|
||||||
return vendapacoteId;
|
return vendapacoteId;
|
||||||
|
@ -87,4 +86,57 @@ public class PagamentoVO {
|
||||||
this.notacredito = notacredito;
|
this.notacredito = notacredito;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlTransient
|
||||||
|
public TipoFormapago getTipoFormapago() {
|
||||||
|
return tipoFormapago;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoFormapago(TipoFormapago tipoFormapago) {
|
||||||
|
this.tipoFormapago = tipoFormapago;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlTransient
|
||||||
|
public Long getCajadiversospagoId() {
|
||||||
|
return cajadiversospagoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCajadiversospagoId(Long cajadiversospagoId) {
|
||||||
|
this.cajadiversospagoId = cajadiversospagoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((formapagoId == null) ? 0 : formapagoId.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (!(obj instanceof PagamentoVO))
|
||||||
|
return false;
|
||||||
|
PagamentoVO other = (PagamentoVO) obj;
|
||||||
|
if (formapagoId == null) {
|
||||||
|
if (other.formapagoId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!formapagoId.equals(other.formapagoId))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElementWrapper
|
||||||
|
@XmlElement(name = "dadosBancario", type = DadosBancarioVO.class)
|
||||||
|
public List<DadosBancarioVO> getDadosBancarios() {
|
||||||
|
return dadosBancarios;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDadosBancarios(List<DadosBancarioVO> dadosBancarios) {
|
||||||
|
this.dadosBancarios = dadosBancarios;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.rjconsultores.ventaboletos.vo.busquedapacotes.transformer;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.hibernate.transform.ResultTransformer;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.DadosBancarioVO;
|
||||||
|
|
||||||
|
public class DatosDadosBancarioResultTransformer implements ResultTransformer {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
|
public List<DadosBancarioVO> transformList(List mapList) {
|
||||||
|
List<DadosBancarioVO> dadosBancarios = new ArrayList<DadosBancarioVO>();
|
||||||
|
for(Object objmap : mapList ) {
|
||||||
|
Map<String, Object> tupleMap = (Map<String, Object>) objmap;
|
||||||
|
DadosBancarioVO dadosBancario = new DadosBancarioVO();
|
||||||
|
dadosBancario.setIdentificadorDeposito((String) tupleMap.get("IDENTIFICACAO_DEPOSITO"));
|
||||||
|
dadosBancario.setData((Date) tupleMap.get("FECDEPOSITO"));
|
||||||
|
dadosBancario.setValor((BigDecimal) tupleMap.get("IMPORTE"));
|
||||||
|
|
||||||
|
dadosBancarios.add(dadosBancario);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dadosBancarios;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object transformTuple(Object[] data, String[] aliases) {
|
||||||
|
Map<String,Object> row = new HashMap<String,Object>();
|
||||||
|
|
||||||
|
for(int index = 0; index < aliases.length; index++){
|
||||||
|
row.put(aliases[index], data[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import org.hibernate.transform.ResultTransformer;
|
import org.hibernate.transform.ResultTransformer;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.NotaCreditoVendaPacoteVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.NotaCreditoVendaPacoteVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.PagamentoVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.PagamentoVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.caja.PagamentoCartaoVO;
|
import com.rjconsultores.ventaboletos.vo.caja.PagamentoCartaoVO;
|
||||||
|
@ -59,7 +59,10 @@ public class DatosPagamentoResultTransformer implements ResultTransformer {
|
||||||
pagamento.setFormapagamento((String) tupleMap.get("DESCPAGO"));
|
pagamento.setFormapagamento((String) tupleMap.get("DESCPAGO"));
|
||||||
pagamento.setValor((BigDecimal) tupleMap.get("VALOR"));
|
pagamento.setValor((BigDecimal) tupleMap.get("VALOR"));
|
||||||
|
|
||||||
if(isVentaCartaoCredito(pagamento.getFormapagoId()) || isVentaCartaoDebito(pagamento.getFormapagoId())) {
|
Integer tipoPago = (Integer) tupleMap.get("TIPO_PAGO");
|
||||||
|
pagamento.setTipoFormapago(TipoFormapago.getTipoFormapagoByValor(tipoPago));
|
||||||
|
|
||||||
|
if(isVentaCartaoCredito(pagamento.getTipoFormapago()) || isVentaCartaoDebito(pagamento.getTipoFormapago())) {
|
||||||
PagamentoCartaoVO cartao = new PagamentoCartaoVO();
|
PagamentoCartaoVO cartao = new PagamentoCartaoVO();
|
||||||
cartao.setBandeira((String) tupleMap.get("TIPOTARJETA"));
|
cartao.setBandeira((String) tupleMap.get("TIPOTARJETA"));
|
||||||
cartao.setNumautorizacao((String) tupleMap.get("NUMAUTORIZACION"));
|
cartao.setNumautorizacao((String) tupleMap.get("NUMAUTORIZACION"));
|
||||||
|
@ -82,12 +85,12 @@ public class DatosPagamentoResultTransformer implements ResultTransformer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isVentaCartaoCredito(Integer formapagoId){
|
private boolean isVentaCartaoCredito(TipoFormapago tipoFormapago) {
|
||||||
return Constantes.FORMA_PAGO_CREDITO.intValue() == formapagoId;
|
return TipoFormapago.CREDITO.equals(tipoFormapago);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isVentaCartaoDebito(Integer formapagoId){
|
private boolean isVentaCartaoDebito(TipoFormapago tipoFormapago) {
|
||||||
return Constantes.FORMA_PAGO_DEBITO.intValue() == formapagoId;
|
return TipoFormapago.DEBITO.equals(tipoFormapago);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,8 @@ public class CajaDetalleVO {
|
||||||
private String cvesecretaria;
|
private String cvesecretaria;
|
||||||
private Boolean indEncargoVenta;
|
private Boolean indEncargoVenta;
|
||||||
|
|
||||||
|
private Integer tipoPago;
|
||||||
|
|
||||||
public Long getCajaId() {
|
public Long getCajaId() {
|
||||||
return cajaId;
|
return cajaId;
|
||||||
}
|
}
|
||||||
|
@ -472,6 +474,13 @@ public class CajaDetalleVO {
|
||||||
public void setCvesecretaria(String cvesecretaria) {
|
public void setCvesecretaria(String cvesecretaria) {
|
||||||
this.cvesecretaria = cvesecretaria;
|
this.cvesecretaria = cvesecretaria;
|
||||||
}
|
}
|
||||||
|
@XmlTransient
|
||||||
|
public Integer getTipoPago() {
|
||||||
|
return tipoPago;
|
||||||
|
}
|
||||||
|
public void setTipoPago(Integer tipoPago) {
|
||||||
|
this.tipoPago = tipoPago;
|
||||||
|
}
|
||||||
public Boolean getIndEncargoVenta() {
|
public Boolean getIndEncargoVenta() {
|
||||||
return indEncargoVenta;
|
return indEncargoVenta;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
package com.rjconsultores.ventaboletos.vo.caja;
|
package com.rjconsultores.ventaboletos.vo.caja;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
import javax.xml.bind.annotation.XmlTransient;
|
||||||
import javax.xml.bind.annotation.XmlType;
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.DadosBancarioVO;
|
||||||
import com.rjconsultores.ventaboletos.vo.busquedapacotes.NotaCreditoVendaPacoteVO;
|
import com.rjconsultores.ventaboletos.vo.busquedapacotes.NotaCreditoVendaPacoteVO;
|
||||||
|
|
||||||
@XmlRootElement(name = "pagamento")
|
@XmlRootElement(name = "pagamento")
|
||||||
@XmlType(propOrder = { "formapagamento", "moeda", "valor", "cartao", "notacredito", "identificacaoEmpresa"})
|
@XmlType(propOrder = { "formapagamento", "moeda", "valor", "cartao", "notacredito", "identificacaoEmpresa", "dadosBancarios"})
|
||||||
public class PagamentoVO {
|
public class PagamentoVO {
|
||||||
|
|
||||||
private String formapagamento;
|
private String formapagamento;
|
||||||
|
@ -19,6 +24,9 @@ public class PagamentoVO {
|
||||||
private Integer formapagoId;
|
private Integer formapagoId;
|
||||||
private NotaCreditoVendaPacoteVO notacredito;
|
private NotaCreditoVendaPacoteVO notacredito;
|
||||||
private String identificacaoEmpresa;
|
private String identificacaoEmpresa;
|
||||||
|
private TipoFormapago tipoFormapago;
|
||||||
|
|
||||||
|
private List<DadosBancarioVO> dadosBancarios;
|
||||||
|
|
||||||
public String getMoeda() {
|
public String getMoeda() {
|
||||||
return moeda;
|
return moeda;
|
||||||
|
@ -76,4 +84,23 @@ public class PagamentoVO {
|
||||||
public void setIdentificacaoEmpresa(String identificacaoEmpresa) {
|
public void setIdentificacaoEmpresa(String identificacaoEmpresa) {
|
||||||
this.identificacaoEmpresa = identificacaoEmpresa;
|
this.identificacaoEmpresa = identificacaoEmpresa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlTransient
|
||||||
|
public TipoFormapago getTipoFormapago() {
|
||||||
|
return tipoFormapago;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoFormapago(TipoFormapago tipoFormapago) {
|
||||||
|
this.tipoFormapago = tipoFormapago;
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElementWrapper
|
||||||
|
@XmlElement(name = "dadosBancario", type = DadosBancarioVO.class)
|
||||||
|
public List<DadosBancarioVO> getDadosBancarios() {
|
||||||
|
return dadosBancarios;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDadosBancarios(List<DadosBancarioVO> dadosBancarios) {
|
||||||
|
this.dadosBancarios = dadosBancarios;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue