From 33e5969688748e05c1a048aed30d43c1c93b0932 Mon Sep 17 00:00:00 2001 From: frederico Date: Wed, 29 Jun 2016 12:54:43 +0000 Subject: [PATCH] =?UTF-8?q?fixed=20bug=20#7606=20-=20adi=C3=A7=C3=A3o=20pa?= =?UTF-8?q?r=C3=A2metros=20web=20service=20Venda=20Embarcada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@57425 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../dao/hibernate/CajaHibernateDAO.java | 2 ++ .../dao/sqlbuilder/impl/SQLBuilderOracle.java | 5 +++-- .../vo/caja/VendaEmbarcadaVO.java | 19 +++++++++++++++++++ .../ventaboletos/ws/rs/VendaEmbarcadaRS.java | 7 ++++--- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CajaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CajaHibernateDAO.java index 65e481d99..16516e6bf 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/CajaHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CajaHibernateDAO.java @@ -300,6 +300,8 @@ public class CajaHibernateDAO extends GenericHibernateDAO implemen query.setLong("boletoId", vendaEmbarcada.getBoletoId()); query.setTimestamp("fecModIf", vendaEmbarcada.getFecModIf()); query.setBigDecimal("precioPricing", vendaEmbarcada.getPrecio()); + query.setString("numFolioPreimpresso", vendaEmbarcada.getNumFolioPreimpresso()); + query.setString("serieImpFiscal", vendaEmbarcada.getSerieImpFiscal()); if (query.executeUpdate() != 1) { throw new VendaEmbarcadaBoletoException("Erro ao gerar boleto venda embarcada"); diff --git a/src/com/rjconsultores/ventaboletos/dao/sqlbuilder/impl/SQLBuilderOracle.java b/src/com/rjconsultores/ventaboletos/dao/sqlbuilder/impl/SQLBuilderOracle.java index 4bd6912af..896b5fdc1 100644 --- a/src/com/rjconsultores/ventaboletos/dao/sqlbuilder/impl/SQLBuilderOracle.java +++ b/src/com/rjconsultores/ventaboletos/dao/sqlbuilder/impl/SQLBuilderOracle.java @@ -1035,15 +1035,16 @@ public class SQLBuilderOracle implements SQLBuilder { sb.append("indreplica, numdocdescuento, canttransferencia, porccategoria, preciopricing, importecategoria, boletooriginal_id, importetaxaembarque,"); sb.append("importepedagio, importeoutros, importeseguro, desctipodoc, desctipodoc2, descnumdoc, descnumdoc2, tipoidentificaciondoc_id, descorgaodoc,"); sb.append("NUMFIDELIDAD, INFOPASAJERO, LEVANTE_ID, ESTADOFOLIO_ID, RUTA_ID, DESCCORREO, DESCTELEFONO, SERIEIMPFISCAL,NUMASIENTOVINCULADO, BOLETO_ID) values "); + sb.append("(:empresaCorridaId, :destinoId, :tipoVentaId, :categoriaId, null, :claseServicioId, :corridaId, :fecCorrida, :puntoVentaId, "); sb.append(":empresaPuntoVentaId, null, null, :origemId, :marcaId, null, null, :numAsiento, null,"); - sb.append("null,null,:precioPagado,null,null, null, :fechorViaje, :fechorVenta, null, :numOperacion,"); + sb.append("null,null,:precioPagado,null,null, :numFolioPreimpresso, :fechorViaje, :fechorVenta, null, :numOperacion,"); sb.append("'F', null, null, 'V', 0, 0, 0, null, 1,"); sb.append("0, :fecModIf, :usuarioId,null, null, null, 0, :precioBase, null,"); sb.append("null,null, null, null, null, :estacionId, null, null, null,1,"); sb.append("0, null, null, null, :precioPricing, null, null, :importeTaxaEmbarque,"); sb.append(":importePedagio, :importeOutros, :importeSeguro, null, null, null, null, null, null,"); - sb.append("null, null, null, null, :rutaId, null, null, null,null, :boletoId)"); + sb.append("null, null, null, null, :rutaId, null, null, :serieImpFiscal, null, :boletoId)"); return sb.toString(); } diff --git a/src/com/rjconsultores/ventaboletos/vo/caja/VendaEmbarcadaVO.java b/src/com/rjconsultores/ventaboletos/vo/caja/VendaEmbarcadaVO.java index 79db7282b..c9e7dda8d 100644 --- a/src/com/rjconsultores/ventaboletos/vo/caja/VendaEmbarcadaVO.java +++ b/src/com/rjconsultores/ventaboletos/vo/caja/VendaEmbarcadaVO.java @@ -34,6 +34,8 @@ public class VendaEmbarcadaVO { private BigInteger empresaId; private Long boletoId; private Date fecModIf; + private String numFolioPreimpresso; + private String serieImpFiscal; public VendaEmbarcadaVO() { fecModIf = new Date(System.currentTimeMillis()); @@ -270,4 +272,21 @@ public class VendaEmbarcadaVO { public void setFecModIf(Date fecModIf) { this.fecModIf = fecModIf; } + + public String getNumFolioPreimpresso() { + return numFolioPreimpresso; + } + + public void setNumFolioPreimpresso(String numFolioPreimpresso) { + this.numFolioPreimpresso = numFolioPreimpresso; + } + + public String getSerieImpFiscal() { + return serieImpFiscal; + } + + public void setSerieImpFiscal(String serieImpFiscal) { + this.serieImpFiscal = serieImpFiscal; + } + } diff --git a/src/com/rjconsultores/ventaboletos/ws/rs/VendaEmbarcadaRS.java b/src/com/rjconsultores/ventaboletos/ws/rs/VendaEmbarcadaRS.java index fb943b6ef..d38044f79 100644 --- a/src/com/rjconsultores/ventaboletos/ws/rs/VendaEmbarcadaRS.java +++ b/src/com/rjconsultores/ventaboletos/ws/rs/VendaEmbarcadaRS.java @@ -15,7 +15,6 @@ import javax.ws.rs.core.MediaType; import org.slf4j.Logger; -import com.rjconsultores.ventaboletos.dao.hibernate.CajaHibernateDAO; import com.rjconsultores.ventaboletos.service.VendaEmbarcadaService; import com.rjconsultores.ventaboletos.vo.caja.VendaEmbarcadaVO; import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext; @@ -30,7 +29,7 @@ public class VendaEmbarcadaRS { private final int ERROR_NAO_SUPORTADO_INVALIDO = 7; @POST - @Path("/gerarVenda/{numeroAssento}/{categoria}/{origemId}/{destinoId}/{servicoId}/{dataCorrida}/{dataVenda}/{preco}/{tipoVendaId}/{pontoVendaId}/{empresaCorridaId}/{estacaoId}/{usuarioId}/{empresaId}/{taxaEmbarque}/{pedagio}/{outros}/{seguro}/{rutaId}/{formaPagoId}/{classeServicoId}") + @Path("/gerarVenda/{numeroAssento}/{categoria}/{origemId}/{destinoId}/{servicoId}/{dataCorrida}/{dataVenda}/{preco}/{tipoVendaId}/{pontoVendaId}/{empresaCorridaId}/{estacaoId}/{usuarioId}/{empresaId}/{taxaEmbarque}/{pedagio}/{outros}/{seguro}/{rutaId}/{formaPagoId}/{classeServicoId}/{numFolioPreImpresso}/{serieImpFiscal}") @Produces({MediaType.APPLICATION_JSON}) public String gerarVenda(@PathParam("numeroAssento") String numeroAssento, @PathParam("categoria") String categoria, @PathParam("origemId") Integer origemId, @PathParam("destinoId") Integer destinoId, @PathParam("servicoId") Integer servicoId, @PathParam("dataCorrida") String dataCorrida, @PathParam("dataVenda") String dataVenda, @@ -38,7 +37,7 @@ public class VendaEmbarcadaRS { @PathParam("empresaCorridaId") Integer empresaCorridaId, @PathParam("estacaoId") Integer estacaoId, @PathParam("usuarioId") Integer usuarioId, @PathParam("empresaId") BigInteger empresaId, @PathParam("taxaEmbarque") BigDecimal importeTaxaEmbarque, @PathParam("pedagio") BigDecimal importePedagio, @PathParam("outros") BigDecimal importeOutros, @PathParam("seguro") BigDecimal importeSeguro, @PathParam("rutaId") Integer rutaId, @PathParam("formaPagoId") Integer formaPagoId, - @PathParam("classeServicoId") Integer classeServicoId){ + @PathParam("classeServicoId") Integer classeServicoId, @PathParam("numFolioPreImpresso") String numFolioPreImpresso, @PathParam("serieImpFiscal") String serieImpFiscal ){ String retornoJson = "{'response':'"; @@ -85,6 +84,8 @@ public class VendaEmbarcadaRS { vendaEmbarcada.setImportePedagio(importePedagio); vendaEmbarcada.setImporteOutros(importeOutros); vendaEmbarcada.setImporteSeguro(importeSeguro); + vendaEmbarcada.setNumFolioPreimpresso(numFolioPreImpresso); + vendaEmbarcada.setSerieImpFiscal(serieImpFiscal); VendaEmbarcadaService vendaEmbarcadaService = (VendaEmbarcadaService) AppContext.getApplicationContext().getBean("VendaEmbarcadaService");