From 3d392e3c6b0e1680c289077e4a5789560a2811c7 Mon Sep 17 00:00:00 2001 From: wilian Date: Wed, 19 Feb 2020 20:50:31 +0000 Subject: [PATCH] bug#18029 bug#18028 dev:thiago qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@100307 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../ventaboletos/constantes/Constantes.java | 1 + .../constantes/ConstantesFuncionSistema.java | 1 + .../ventaboletos/dao/PricingCtrlDAO.java | 17 + .../ventaboletos/dao/PricingDAO.java | 10 + .../hibernate/PricingCtrlHibernateDAO.java | 39 ++ .../dao/hibernate/PricingHibernateDAO.java | 96 +++- .../ventaboletos/entidad/Parada.java | 7 + .../ventaboletos/entidad/Pricing.java | 10 +- .../entidad/PricingClasseTarifaria.java | 9 + .../ventaboletos/entidad/PricingCtrl.java | 97 ++++ .../ventaboletos/entidad/PricingDia.java | 18 +- .../ventaboletos/entidad/TipoServicio.java | 6 + .../ventaboletos/enums/PricingOperacaoWS.java | 7 + .../service/PricingAsientoService.java | 2 + .../service/PricingCategoriaService.java | 4 + .../service/PricingClaseService.java | 5 + .../service/PricingCorridaService.java | 5 + .../service/PricingCtrlService.java | 11 + .../service/PricingDiaService.java | 3 + .../service/PricingMarcaService.java | 4 + .../service/PricingMercadoService.java | 4 + .../service/PricingOcupaAntecipaService.java | 2 + .../service/PricingPuntoVentaService.java | 5 + .../service/PricingRutaService.java | 5 + .../ventaboletos/service/PricingService.java | 11 + .../service/PricingTipoPtoVtaService.java | 4 + .../service/PricingTipoServicioService.java | 5 + .../service/PricingVigenciaService.java | 2 + .../impl/PricingAsientoServiceImpl.java | 10 + .../impl/PricingCategoriaServiceImpl.java | 10 + .../service/impl/PricingClaseServiceImpl.java | 10 + .../impl/PricingCorridaServiceImpl.java | 10 + .../service/impl/PricingCtrlServiceImpl.java | 73 +++ .../service/impl/PricingDiaServiceImpl.java | 10 + .../service/impl/PricingMarcaServiceImpl.java | 10 + .../impl/PricingMercadoServiceImpl.java | 23 +- .../impl/PricingOcupaAntecipaServiceImpl.java | 10 + .../impl/PricingPuntoVentaServiceImpl.java | 10 + .../service/impl/PricingRutaServiceImpl.java | 10 + .../service/impl/PricingServiceImpl.java | 25 + .../impl/PricingTipoPtoVtaServiceImpl.java | 10 + .../impl/PricingTipoServicioServiceImpl.java | 10 + .../impl/PricingVigenciaServiceImpl.java | 10 + .../PricingConverterVOToEntidad.java | 428 ++++++++++++++++++ .../ventaboletos/vo/pricing/Pricing.java | 381 ++++++++++++++++ .../vo/pricing/PricingAsiento.java | 50 ++ .../vo/pricing/PricingCanalVenta.java | 37 ++ .../vo/pricing/PricingCategoria.java | 39 ++ .../vo/pricing/PricingClasse.java | 41 ++ .../vo/pricing/PricingCorrida.java | 29 ++ .../ventaboletos/vo/pricing/PricingDia.java | 121 +++++ .../ventaboletos/vo/pricing/PricingMarca.java | 34 ++ .../vo/pricing/PricingMercado.java | 57 +++ .../vo/pricing/PricingOcupaAntecipa.java | 121 +++++ .../vo/pricing/PricingPuntoVenta.java | 39 ++ .../ventaboletos/vo/pricing/PricingRuta.java | 39 ++ .../vo/pricing/PricingTipoCorrida.java | 41 ++ .../vo/pricing/PricingVigencia.java | 56 +++ 58 files changed, 2124 insertions(+), 20 deletions(-) create mode 100644 src/com/rjconsultores/ventaboletos/dao/PricingCtrlDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCtrlHibernateDAO.java create mode 100644 src/com/rjconsultores/ventaboletos/entidad/PricingCtrl.java create mode 100644 src/com/rjconsultores/ventaboletos/enums/PricingOperacaoWS.java create mode 100644 src/com/rjconsultores/ventaboletos/service/PricingCtrlService.java create mode 100644 src/com/rjconsultores/ventaboletos/service/impl/PricingCtrlServiceImpl.java create mode 100644 src/com/rjconsultores/ventaboletos/utilerias/PricingConverterVOToEntidad.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/Pricing.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingAsiento.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingCanalVenta.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingCategoria.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingClasse.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingCorrida.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingDia.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingMarca.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingMercado.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingOcupaAntecipa.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingPuntoVenta.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingRuta.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingTipoCorrida.java create mode 100644 src/com/rjconsultores/ventaboletos/vo/pricing/PricingVigencia.java diff --git a/src/com/rjconsultores/ventaboletos/constantes/Constantes.java b/src/com/rjconsultores/ventaboletos/constantes/Constantes.java index b39f458d2..4c25cd682 100644 --- a/src/com/rjconsultores/ventaboletos/constantes/Constantes.java +++ b/src/com/rjconsultores/ventaboletos/constantes/Constantes.java @@ -78,6 +78,7 @@ public class Constantes { public static List ORGAOS_CONCEDENTES_CALCULO_AGER = new ArrayList(Arrays.asList(new Integer[]{5,23})); public static final String UTF_8 = "UTF-8"; + public static final String CHARSET_UTF8 = ";charset=utf-8"; public static final int INTERVALO_FECHAMENTO_DIARIO = 1; public static final int INTERVALO_FECHAMENTO_SEMANAL = 7; diff --git a/src/com/rjconsultores/ventaboletos/constantes/ConstantesFuncionSistema.java b/src/com/rjconsultores/ventaboletos/constantes/ConstantesFuncionSistema.java index 018fd9799..eb47a15c3 100644 --- a/src/com/rjconsultores/ventaboletos/constantes/ConstantesFuncionSistema.java +++ b/src/com/rjconsultores/ventaboletos/constantes/ConstantesFuncionSistema.java @@ -26,6 +26,7 @@ public class ConstantesFuncionSistema { public static final String CLAVE_RELATORIO_TROCO_SIMPLES = "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.RELATORIOTROCOSIMPLES"; public static final String CLAVE_RELATORIO_ESTORNO_TROCO_SIMPLES = "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.RELATORIOESTORNOTROCOSIMPLES"; public static final String CLAVE_CONFIG_EMITE_SOMENTE_CUPOM_EMBARQUE = "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.CONFIGTIPOPASSAGEM.EMITESOMENTECPEMB"; + public static final String CLAVE_ADM_PRICING_MODIFICACAOMASSIVAWS = "COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MODIFICACAOMASSIVAWS"; public static final String CLAVE_ESTOQUE_W2I = "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.ESTOQUEW2I"; } diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingCtrlDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingCtrlDAO.java new file mode 100644 index 000000000..9f47866c3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/PricingCtrlDAO.java @@ -0,0 +1,17 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.PricingCtrl; + +/** + * + * @author wilian + */ +public interface PricingCtrlDAO extends GenericDAO { + + public PricingCtrl obtenerPricingCtrl(); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/PricingDAO.java b/src/com/rjconsultores/ventaboletos/dao/PricingDAO.java index ea86afddd..ca73f041f 100644 --- a/src/com/rjconsultores/ventaboletos/dao/PricingDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/PricingDAO.java @@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.dao; import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Pricing; import java.math.BigDecimal; +import java.util.Date; import java.util.List; /** @@ -20,4 +21,13 @@ public interface PricingDAO extends GenericDAO { BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo); public List buscarPorNombre(String nombPricing); + + public List buscar(Integer pricingId, String nomepricing, Integer empresaId, Date dataViagemInicio, Date dataViagemFim, Integer origemId, Integer destinoId); + + /** + * Recupera os pricings com vigencia fim da viagem acima ou igual aos dias informados. + * @param diasFimViagem + * @return + */ + public List buscar(Integer diasFimViagem); } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCtrlHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCtrlHibernateDAO.java new file mode 100644 index 000000000..a529b6d5b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingCtrlHibernateDAO.java @@ -0,0 +1,39 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.PricingCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.PricingCtrl; + +@Repository("pricingCtrlDAO") +public class PricingCtrlHibernateDAO extends GenericHibernateDAO implements PricingCtrlDAO { + + @Autowired + public PricingCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + @SuppressWarnings("unchecked") + public List obtenerTodos() { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + return c.list(); + } + + @Override + public PricingCtrl obtenerPricingCtrl() { + Criteria c = this.makeCriteria(); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.setMaxResults(1); + return (PricingCtrl) c.uniqueResult(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingHibernateDAO.java index 68f24b763..6d03d9084 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/PricingHibernateDAO.java @@ -4,18 +4,25 @@ */ package com.rjconsultores.ventaboletos.dao.hibernate; -import com.rjconsultores.ventaboletos.dao.PricingDAO; -import com.rjconsultores.ventaboletos.entidad.Empresa; -import com.rjconsultores.ventaboletos.entidad.Pricing; import java.math.BigDecimal; +import java.util.Date; import java.util.List; + +import org.apache.commons.lang.StringUtils; import org.hibernate.Criteria; +import org.hibernate.Query; import org.hibernate.SessionFactory; import org.hibernate.criterion.Restrictions; +import org.hibernate.type.IntegerType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Repository; +import com.rjconsultores.ventaboletos.dao.PricingDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + /** * * @author Rafius @@ -66,4 +73,87 @@ public class PricingHibernateDAO extends GenericHibernateDAO return c.list(); } + + @Override + public List buscar(Integer pricingId, String nomepricing, Integer empresaId, Date dataViagemInicio, Date dataViagemFim, Integer origemId, Integer destinoId) { + StringBuilder sQuery = new StringBuilder("SELECT p FROM Pricing p WHERE p.activo = 1 "); + + if(pricingId != null) { + sQuery.append("AND p.pricingId = :pricingId "); + } + + if(StringUtils.isNotBlank(nomepricing)) { + sQuery.append("AND p.nombPricing like :nomepricing "); + } + + if(empresaId != null) { + sQuery.append("AND p.empresa.empresaId = :empresaId "); + } + + if(dataViagemInicio != null) { + sQuery.append("AND p.pricingVigenciaList.fecinicioviaje >= :dataViagemInicio "); + } + + if(dataViagemFim != null) { + sQuery.append("AND p.pricingVigenciaList.fecfinviaje <= :dataViagemFim "); + } + + if(origemId != null) { + sQuery.append("AND p.pricingMercadoList.origen.paradaId = :origemId "); + } + + if(destinoId != null) { + sQuery.append("AND p.pricingMercadoList.destino.paradaId = :destinoId "); + } + + Query qr = getSession().createQuery(sQuery.toString()); + if(pricingId != null) { + qr.setParameter("pricingId", pricingId); + } + + if(StringUtils.isNotBlank(nomepricing)) { + qr.setParameter("nomepricing", nomepricing); + } + + if(empresaId != null) { + qr.setParameter("empresaId", empresaId); + } + + if(dataViagemInicio != null) { + qr.setParameter("dataViagemInicio", dataViagemInicio); + } + + if(dataViagemFim != null) { + qr.setParameter("dataViagemFim", dataViagemFim); + } + + if(origemId != null) { + qr.setParameter("origemId", origemId); + } + + if(destinoId != null) { + qr.setParameter("destinoId", destinoId); + } + + return qr.list(); + } + + @Override + public List buscar(Integer diasFimViagem) { + if(diasFimViagem == null || diasFimViagem == 0) { + return null; + } + StringBuilder sQuery = new StringBuilder(); + sQuery.append("SELECT p.pricing_id ") + .append("FROM pricing p ") + .append("JOIN pricing_vigencia pv ON p.pricing_id = pv.pricing_id and pv.activo = 1 ") + .append("WHERE p.activo = 1 ") + .append("HAVING to_date(:dataAtual,'dd/mm/yyyy') - max(pv.fecfinviaje) >= :diasFimViagem ") + .append("GROUP BY p.pricing_id "); + + Query qr = getSession().createSQLQuery(sQuery.toString()).addScalar("pricing_id", IntegerType.INSTANCE); + qr.setParameter("dataAtual", DateUtil.getStringDate(new Date(), "dd/MM/yyyy")); + qr.setParameter("diasFimViagem", diasFimViagem); + return qr.list(); + } } diff --git a/src/com/rjconsultores/ventaboletos/entidad/Parada.java b/src/com/rjconsultores/ventaboletos/entidad/Parada.java index e7cd82663..af1518bcc 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Parada.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Parada.java @@ -101,6 +101,13 @@ public class Parada implements Serializable { private List codigosOrgaosConcedentes = new ArrayList(); public Parada() { + super(); + } + + public Parada(Integer paradaId) { + this(); + + this.paradaId = paradaId; } public List getCategoriaMercadoDestinoList() { diff --git a/src/com/rjconsultores/ventaboletos/entidad/Pricing.java b/src/com/rjconsultores/ventaboletos/entidad/Pricing.java index 720374a0e..25ed0e08f 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Pricing.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Pricing.java @@ -25,6 +25,8 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; +import org.apache.commons.lang.BooleanUtils; + /** * * @author Rafius @@ -183,7 +185,7 @@ public class Pricing implements Serializable { } public Boolean getIndtransferible() { - return indtransferible; + return BooleanUtils.toBoolean(indtransferible); } public void setIndtransferible(Boolean indtransferible) { @@ -191,7 +193,7 @@ public class Pricing implements Serializable { } public Boolean getIndreservable() { - return indreservable; + return BooleanUtils.toBoolean(indreservable); } public void setIndreservable(Boolean indreservable) { @@ -199,7 +201,7 @@ public class Pricing implements Serializable { } public Boolean getIndcancelable() { - return indcancelable; + return BooleanUtils.toBoolean(indcancelable); } public void setIndcancelable(Boolean indcancelable) { @@ -494,7 +496,7 @@ public class Pricing implements Serializable { } public Boolean getExibeVenda() { - return exibeVenda; + return BooleanUtils.toBoolean(exibeVenda); } public void setExibeVenda(Boolean exibeVenda) { diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingClasseTarifaria.java b/src/com/rjconsultores/ventaboletos/entidad/PricingClasseTarifaria.java index ae0ecbc08..ce99b803b 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/PricingClasseTarifaria.java +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingClasseTarifaria.java @@ -39,6 +39,15 @@ public class PricingClasseTarifaria implements Serializable { @Basic(optional = false) @Column(name = "USUARIO_ID") private Integer usuarioId; + + public PricingClasseTarifaria() { + super(); + } + + public PricingClasseTarifaria(Integer pricingClasseTarifariaId) { + this(); + this.pricingClasseTarifariaId = pricingClasseTarifariaId; + } public Integer getPricingClasseTarifariaId() { return pricingClasseTarifariaId; diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingCtrl.java b/src/com/rjconsultores/ventaboletos/entidad/PricingCtrl.java new file mode 100644 index 000000000..108a98b65 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingCtrl.java @@ -0,0 +1,97 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "PRICING_CTRL_SEQ", sequenceName = "PRICING_CTRL_SEQ", allocationSize = 1) +@Table(name = "PRICING_CTRL") +public class PricingCtrl implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_CTRL_SEQ") + @Column(name = "PRICINGCTRL_ID") + private Integer pricingctrlId; + + @Column(name = "ACTIVO") + private Boolean activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Integer getPricingctrlId() { + return pricingctrlId; + } + + public void setPricingctrlId(Integer pricingctrlId) { + this.pricingctrlId = pricingctrlId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getPricingctrlId() == null) ? 0 : getPricingctrlId().hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof PricingCtrl)) + return false; + PricingCtrl other = (PricingCtrl) obj; + if (getPricingctrlId() == null) { + if (other.getPricingctrlId() != null) + return false; + } else if (!getPricingctrlId().equals(other.getPricingctrlId())) + return false; + return true; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PricingDia.java b/src/com/rjconsultores/ventaboletos/entidad/PricingDia.java index 5394500e5..d6016cee6 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/PricingDia.java +++ b/src/com/rjconsultores/ventaboletos/entidad/PricingDia.java @@ -19,6 +19,8 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; +import org.apache.commons.lang.BooleanUtils; + /** * * @author Rafius @@ -87,7 +89,7 @@ public class PricingDia implements Serializable { } public Boolean getInddomingo() { - return inddomingo; + return BooleanUtils.toBoolean(inddomingo); } public void setInddomingo(Boolean inddomingo) { @@ -95,7 +97,7 @@ public class PricingDia implements Serializable { } public Boolean getIndjueves() { - return indjueves; + return BooleanUtils.toBoolean(indjueves); } public void setIndjueves(Boolean indjueves) { @@ -103,7 +105,7 @@ public class PricingDia implements Serializable { } public Boolean getIndlunes() { - return indlunes; + return BooleanUtils.toBoolean(indlunes); } public void setIndlunes(Boolean indlunes) { @@ -111,7 +113,7 @@ public class PricingDia implements Serializable { } public Boolean getIndmartes() { - return indmartes; + return BooleanUtils.toBoolean(indmartes); } public void setIndmartes(Boolean indmartes) { @@ -119,7 +121,7 @@ public class PricingDia implements Serializable { } public Boolean getIndmiercoles() { - return indmiercoles; + return BooleanUtils.toBoolean(indmiercoles); } public void setIndmiercoles(Boolean indmiercoles) { @@ -127,7 +129,7 @@ public class PricingDia implements Serializable { } public Boolean getIndsabado() { - return indsabado; + return BooleanUtils.toBoolean(indsabado); } public void setIndsabado(Boolean indsabado) { @@ -135,7 +137,7 @@ public class PricingDia implements Serializable { } public Boolean getIndviernes() { - return indviernes; + return BooleanUtils.toBoolean(indviernes); } public void setIndviernes(Boolean indviernes) { @@ -191,7 +193,7 @@ public class PricingDia implements Serializable { } public Boolean getIndfecventa() { - return indfecventa; + return BooleanUtils.toBoolean(indfecventa); } public void setIndfecventa(Boolean indfecventa) { diff --git a/src/com/rjconsultores/ventaboletos/entidad/TipoServicio.java b/src/com/rjconsultores/ventaboletos/entidad/TipoServicio.java index 9485bcc59..4443afb67 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/TipoServicio.java +++ b/src/com/rjconsultores/ventaboletos/entidad/TipoServicio.java @@ -43,6 +43,12 @@ public class TipoServicio implements Serializable { private Integer usuarioId; public TipoServicio() { + super(); + } + + public TipoServicio(Integer tiposervicioId) { + this(); + this.tiposervicioId = tiposervicioId; } public Integer getTiposervicioId() { diff --git a/src/com/rjconsultores/ventaboletos/enums/PricingOperacaoWS.java b/src/com/rjconsultores/ventaboletos/enums/PricingOperacaoWS.java new file mode 100644 index 000000000..6a85ab29e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/enums/PricingOperacaoWS.java @@ -0,0 +1,7 @@ +package com.rjconsultores.ventaboletos.enums; + +public enum PricingOperacaoWS { + + INCLUIR, ALTERAR, EXCLUIR, INATIVAR; + +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java b/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java index 9d4a456ab..24c4040dc 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingAsientoService.java @@ -15,4 +15,6 @@ import java.util.List; public interface PricingAsientoService extends GenericService { public List obtenerPricingCategoria(Pricing pricing, Integer value); + + public void borrar(List pricingAsientos); } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingCategoriaService.java b/src/com/rjconsultores/ventaboletos/service/PricingCategoriaService.java index f30eecc96..dc87b04bb 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingCategoriaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingCategoriaService.java @@ -4,6 +4,8 @@ */ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.Categoria; import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingCategoria; @@ -15,4 +17,6 @@ import com.rjconsultores.ventaboletos.entidad.PricingCategoria; public interface PricingCategoriaService extends GenericService { public Boolean obtenerPricingCategoria(Pricing pricing, Categoria categoria); + + public void borrar(List pricingCategorias); } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingClaseService.java b/src/com/rjconsultores/ventaboletos/service/PricingClaseService.java index b905a66ad..3eb6fed61 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingClaseService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingClaseService.java @@ -4,6 +4,8 @@ */ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.ClaseServicio; import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingClase; @@ -15,4 +17,7 @@ import com.rjconsultores.ventaboletos.entidad.PricingClase; public interface PricingClaseService extends GenericService { public Boolean obtenerPricingClase(Pricing pricing, ClaseServicio claseServicio); + + public void borrar(List pricingClases); + } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingCorridaService.java b/src/com/rjconsultores/ventaboletos/service/PricingCorridaService.java index 9140371bf..dac7f8a3b 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingCorridaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingCorridaService.java @@ -4,6 +4,8 @@ */ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingCorrida; @@ -15,4 +17,7 @@ import com.rjconsultores.ventaboletos.entidad.PricingCorrida; public interface PricingCorridaService extends GenericService { public Boolean obtenerPricingCorrida(Pricing pricing, CorridaCtrl corrida); + + public void borrar(List pricingCorridas); + } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingCtrlService.java b/src/com/rjconsultores/ventaboletos/service/PricingCtrlService.java new file mode 100644 index 000000000..cedfb3112 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/PricingCtrlService.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.PricingCtrl; + +public interface PricingCtrlService extends GenericService { + + public PricingCtrl obtenerPricingCtrl(); + + public PricingCtrl suscribirOrActualizacion(PricingCtrl entidad); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/PricingDiaService.java b/src/com/rjconsultores/ventaboletos/service/PricingDiaService.java index 0db7c052b..e60c20fad 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingDiaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingDiaService.java @@ -14,4 +14,7 @@ import java.util.List; public interface PricingDiaService extends GenericService { public List buscarTraslapa(PricingDia pricingDia); + + public void borrar(List pricingDias); + } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingMarcaService.java b/src/com/rjconsultores/ventaboletos/service/PricingMarcaService.java index e5e5b6545..f261320b9 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingMarcaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingMarcaService.java @@ -4,6 +4,8 @@ */ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.Marca; import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingMarca; @@ -15,5 +17,7 @@ import com.rjconsultores.ventaboletos.entidad.PricingMarca; public interface PricingMarcaService extends GenericService { public Boolean obtenerPricingMarca(Pricing pricing, Marca marca); + + public void borrar(List pricingMarcaList); } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingMercadoService.java b/src/com/rjconsultores/ventaboletos/service/PricingMercadoService.java index 9a6051f81..6d2f06b8c 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingMercadoService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingMercadoService.java @@ -5,6 +5,8 @@ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.Parada; import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingMercado; @@ -16,5 +18,7 @@ import com.rjconsultores.ventaboletos.entidad.PricingMercado; public interface PricingMercadoService extends GenericService { public Boolean obtenerPricingMercado(Pricing pricing, Parada origen, Parada destino); + + public void borrar(List pricingMercados); } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingOcupaAntecipaService.java b/src/com/rjconsultores/ventaboletos/service/PricingOcupaAntecipaService.java index 1d292c14d..c5cb9cf54 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingOcupaAntecipaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingOcupaAntecipaService.java @@ -13,4 +13,6 @@ public interface PricingOcupaAntecipaService { public void borrar(PricingOcupaAntecipa entidad); public List updateList(PricingOcupaAntecipa entidad); + + public void borrar(List pricingOcupaAntecipas); } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingPuntoVentaService.java b/src/com/rjconsultores/ventaboletos/service/PricingPuntoVentaService.java index 21692527d..18235ae48 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingPuntoVentaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingPuntoVentaService.java @@ -4,6 +4,8 @@ */ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; @@ -15,4 +17,7 @@ import com.rjconsultores.ventaboletos.entidad.PuntoVenta; public interface PricingPuntoVentaService extends GenericService { public Boolean obtenerPricingPuntoVenta(Pricing pricing, PuntoVenta puntoVenta); + + public void borrar(List pricingPuntoVentas); + } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingRutaService.java b/src/com/rjconsultores/ventaboletos/service/PricingRutaService.java index 22dc6ff16..7ae511e2e 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingRutaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingRutaService.java @@ -4,6 +4,8 @@ */ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingRuta; import com.rjconsultores.ventaboletos.entidad.Ruta; @@ -15,4 +17,7 @@ import com.rjconsultores.ventaboletos.entidad.Ruta; public interface PricingRutaService extends GenericService { public Boolean obtenerPricingRuta(Pricing pricing, Ruta ruta); + + public void borrar(List pricingRutas); + } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingService.java b/src/com/rjconsultores/ventaboletos/service/PricingService.java index 19b0be06e..9d013b96a 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingService.java @@ -5,6 +5,7 @@ package com.rjconsultores.ventaboletos.service; import java.math.BigDecimal; +import java.util.Date; import java.util.List; import com.rjconsultores.ventaboletos.entidad.Empresa; @@ -29,4 +30,14 @@ public interface PricingService extends GenericService { public void ativar(Pricing entidad); public Boolean clonarPricing(Integer pricingId, String nomePricing, boolean incluirPadraoPricingTipoPassagemPET); + + public List buscar(Integer pricingId, String nomepricing, Integer empresaId, Date dataViagemInicio, + Date dataViagemFim, Integer origemId, Integer destinoId); + + /** + * Exclui pricings que possuem viagens com dias finalizadas iguais ou acima do informados. + * @param diasFimViagem + */ + public void excluirPricing(Integer diasFimViagem); + } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingTipoPtoVtaService.java b/src/com/rjconsultores/ventaboletos/service/PricingTipoPtoVtaService.java index 3539b593e..afd63e5e6 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingTipoPtoVtaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingTipoPtoVtaService.java @@ -4,6 +4,8 @@ */ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; @@ -15,4 +17,6 @@ import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; public interface PricingTipoPtoVtaService extends GenericService { public Boolean obtenerPricingTipoPuntoVenta(Pricing pricing, TipoPuntoVenta tipoPuntoVenta); + + public void borrar(List pricingTipoPtoVtas); } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingTipoServicioService.java b/src/com/rjconsultores/ventaboletos/service/PricingTipoServicioService.java index ef8618860..5ea65ecf4 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingTipoServicioService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingTipoServicioService.java @@ -4,6 +4,8 @@ */ package com.rjconsultores.ventaboletos.service; +import java.util.List; + import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; import com.rjconsultores.ventaboletos.entidad.TipoServicio; @@ -15,4 +17,7 @@ import com.rjconsultores.ventaboletos.entidad.TipoServicio; public interface PricingTipoServicioService extends GenericService { public Boolean obtenerPricingTipoServicio(Pricing pricing, TipoServicio tipoServicio); + + public void borrar(List pricingTipoServicios); + } diff --git a/src/com/rjconsultores/ventaboletos/service/PricingVigenciaService.java b/src/com/rjconsultores/ventaboletos/service/PricingVigenciaService.java index f280ec2ee..5219608c3 100644 --- a/src/com/rjconsultores/ventaboletos/service/PricingVigenciaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PricingVigenciaService.java @@ -19,4 +19,6 @@ public interface PricingVigenciaService extends GenericService pricingVigenciaList); } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java index 4cd0a2af6..a55567a4d 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingAsientoServiceImpl.java @@ -63,4 +63,14 @@ public class PricingAsientoServiceImpl implements PricingAsientoService { public List obtenerPricingCategoria(Pricing pricing, Integer asiento) { return pricingAsientoDAO.obtenerPricingCategoria(pricing, asiento); } + + @Override + @Transactional + public void borrar(List pricingAsientos) { + if(pricingAsientos != null && !pricingAsientos.isEmpty()) { + for (PricingAsiento pricingAsiento : pricingAsientos) { + borrar(pricingAsiento); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingCategoriaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingCategoriaServiceImpl.java index 0f2b51b1a..ff8fd5100 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingCategoriaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingCategoriaServiceImpl.java @@ -64,4 +64,14 @@ public class PricingCategoriaServiceImpl implements PricingCategoriaService { public Boolean obtenerPricingCategoria(Pricing pricing, Categoria categoria) { return pricingCategoriaDAO.obtenerPricingCategoria(pricing, categoria); } + + @Override + @Transactional + public void borrar(List pricingCategorias) { + if(pricingCategorias != null && !pricingCategorias.isEmpty()) { + for (PricingCategoria pricingCategoria : pricingCategorias) { + borrar(pricingCategoria); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingClaseServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingClaseServiceImpl.java index 6c2aaa38c..ecf984245 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingClaseServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingClaseServiceImpl.java @@ -64,4 +64,14 @@ public class PricingClaseServiceImpl implements PricingClaseService { public Boolean obtenerPricingClase(Pricing pricing, ClaseServicio claseServicio) { return pricingClaseDAO.obtenerPricingClase(pricing, claseServicio); } + + @Override + @Transactional + public void borrar(List pricingClases) { + if(pricingClases != null && !pricingClases.isEmpty()) { + for (PricingClase pricingClase : pricingClases) { + borrar(pricingClase); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingCorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingCorridaServiceImpl.java index fc0fe03b6..33c8619a3 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingCorridaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingCorridaServiceImpl.java @@ -64,4 +64,14 @@ public class PricingCorridaServiceImpl implements PricingCorridaService { public Boolean obtenerPricingCorrida(Pricing pricing, CorridaCtrl corrida) { return pricingCorridaDAO.obtenerPricingCorrida(pricing, corrida); } + + @Override + @Transactional + public void borrar(List pricingCorridas) { + if(pricingCorridas != null && !pricingCorridas.isEmpty()) { + for (PricingCorrida pricingCorrida : pricingCorridas) { + borrar(pricingCorrida); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingCtrlServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingCtrlServiceImpl.java new file mode 100644 index 000000000..07b31a41f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingCtrlServiceImpl.java @@ -0,0 +1,73 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.PricingCtrlDAO; +import com.rjconsultores.ventaboletos.entidad.PricingCtrl; +import com.rjconsultores.ventaboletos.service.PricingCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("pricingCtrlService") +public class PricingCtrlServiceImpl implements PricingCtrlService { + + @Autowired + private PricingCtrlDAO pricingCtrlDAO; + + @Override + public List obtenerTodos() { + return pricingCtrlDAO.obtenerTodos(); + } + + @Override + public PricingCtrl obtenerID(Integer id) { + return pricingCtrlDAO.obtenerID(id); + } + + @Override + @Transactional + public PricingCtrl suscribir(PricingCtrl entidad) { + entidad.setActivo(true); + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(new Date()); + return pricingCtrlDAO.suscribir(entidad); + } + + @Override + @Transactional + public PricingCtrl actualizacion(PricingCtrl entidad) { + entidad.setActivo(true); + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(new Date()); + return pricingCtrlDAO.actualizacion(entidad); + } + + @Override + @Transactional + public void borrar(PricingCtrl entidad) { + entidad.setActivo(false); + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(new Date()); + pricingCtrlDAO.actualizacion(entidad); + } + + @Override + public PricingCtrl obtenerPricingCtrl() { + return pricingCtrlDAO.obtenerPricingCtrl(); + } + + @Override + @Transactional + public PricingCtrl suscribirOrActualizacion(PricingCtrl entidad) { + if(entidad.getPricingctrlId() == null) { + return suscribir(entidad); + } else { + return actualizacion(entidad); + } + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingDiaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingDiaServiceImpl.java index 539f08af6..17f972e55 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingDiaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingDiaServiceImpl.java @@ -63,4 +63,14 @@ public class PricingDiaServiceImpl implements PricingDiaService { public List buscarTraslapa(PricingDia pricingDia) { return pricingDiaDAO.buscarTraslapa(pricingDia); } + + @Override + @Transactional + public void borrar(List pricingDias) { + if(pricingDias != null && !pricingDias.isEmpty()) { + for (PricingDia pricingDia : pricingDias) { + borrar(pricingDia); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingMarcaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingMarcaServiceImpl.java index b52e5b523..80a9dc31c 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingMarcaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingMarcaServiceImpl.java @@ -64,4 +64,14 @@ public class PricingMarcaServiceImpl implements PricingMarcaService { public Boolean obtenerPricingMarca(Pricing pricing, Marca marca) { return pricingMarcaDAO.obtenerPricingMarca(pricing, marca); } + + @Override + @Transactional + public void borrar(List pricingMarcaList) { + if(pricingMarcaList != null && !pricingMarcaList.isEmpty()) { + for (PricingMarca pricingMarca : pricingMarcaList) { + borrar(pricingMarca); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingMercadoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingMercadoServiceImpl.java index 966c445b4..004ae379d 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingMercadoServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingMercadoServiceImpl.java @@ -4,17 +4,19 @@ */ package com.rjconsultores.ventaboletos.service.impl; +import java.util.Calendar; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + import com.rjconsultores.ventaboletos.dao.PricingMercadoDAO; import com.rjconsultores.ventaboletos.entidad.Parada; import com.rjconsultores.ventaboletos.entidad.Pricing; import com.rjconsultores.ventaboletos.entidad.PricingMercado; import com.rjconsultores.ventaboletos.service.PricingMercadoService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; -import java.util.Calendar; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; /** * @@ -64,4 +66,15 @@ public class PricingMercadoServiceImpl implements PricingMercadoService { public Boolean obtenerPricingMercado(Pricing pricing, Parada origen, Parada destino) { return pricingMercadoDAO.obtenerPricingMercado(pricing, origen, destino); } + + @Override + @Transactional + public void borrar(List pricingMercados) { + if(pricingMercados != null && !pricingMercados.isEmpty()) { + for (PricingMercado pricingMercado : pricingMercados) { + borrar(pricingMercado); + } + } + } + } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingOcupaAntecipaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingOcupaAntecipaServiceImpl.java index fb2338a2c..df0263a16 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingOcupaAntecipaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingOcupaAntecipaServiceImpl.java @@ -121,4 +121,14 @@ public class PricingOcupaAntecipaServiceImpl implements PricingOcupaAntecipaServ return traslapa; } + + @Override + @Transactional + public void borrar(List pricingOcupaAntecipas) { + if(pricingOcupaAntecipas != null && !pricingOcupaAntecipas.isEmpty()) { + for (PricingOcupaAntecipa pricingOcupaAntecipa : pricingOcupaAntecipas) { + borrar(pricingOcupaAntecipa); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingPuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingPuntoVentaServiceImpl.java index 990c4c26f..3c484fe61 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingPuntoVentaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingPuntoVentaServiceImpl.java @@ -64,4 +64,14 @@ public class PricingPuntoVentaServiceImpl implements PricingPuntoVentaService { public Boolean obtenerPricingPuntoVenta(Pricing pricing, PuntoVenta puntoVenta) { return pricingPuntoVentaDAO.obtenerPricingPuntoVenta(pricing, puntoVenta); } + + @Override + @Transactional + public void borrar(List pricingPuntoVentas) { + if(pricingPuntoVentas != null && !pricingPuntoVentas.isEmpty()) { + for (PricingPuntoVenta pricingPuntoVenta : pricingPuntoVentas) { + borrar(pricingPuntoVenta); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingRutaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingRutaServiceImpl.java index c564bd4f5..849cbeeee 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingRutaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingRutaServiceImpl.java @@ -65,4 +65,14 @@ public class PricingRutaServiceImpl implements PricingRutaService { public Boolean obtenerPricingRuta(Pricing pricing, Ruta ruta) { return pricingRutaDAO.obtenerPricingRuta(pricing, ruta); } + + @Override + @Transactional + public void borrar(List pricingRutas) { + if(pricingRutas != null && !pricingRutas.isEmpty()) { + for (PricingRuta pricingRuta : pricingRutas) { + borrar(pricingRuta); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingServiceImpl.java index 8b50bfe96..1395782c7 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingServiceImpl.java @@ -7,8 +7,10 @@ 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; +import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -42,6 +44,8 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; */ @Service("pricingService") public class PricingServiceImpl implements PricingService { + + private static Logger log = Logger.getLogger(PricingServiceImpl.class); @Autowired private PricingDAO pricingDAO; @@ -555,4 +559,25 @@ public class PricingServiceImpl implements PricingService { } return false; } + + @Override + public List buscar(Integer pricingId, String nomepricing, Integer empresaId, Date dataViagemInicio, Date dataViagemFim, Integer origemId, Integer destinoId) { + return pricingDAO.buscar(pricingId, nomepricing, empresaId, dataViagemInicio, dataViagemFim, origemId, destinoId); + } + + @Override + @Transactional + public void excluirPricing(Integer diasFimViagem) { + try { + List pricings = pricingDAO.buscar(diasFimViagem); + for (Integer pricingId : pricings) { + Pricing pricing = pricingDAO.obtenerID(pricingId); + borrar(pricing); + log.info(String.format("Pricing [%d] excluido via WS", pricingId)); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + } + } + } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoPtoVtaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoPtoVtaServiceImpl.java index 50f4adfc4..97af181ed 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoPtoVtaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoPtoVtaServiceImpl.java @@ -64,4 +64,14 @@ public class PricingTipoPtoVtaServiceImpl implements PricingTipoPtoVtaService { public Boolean obtenerPricingTipoPuntoVenta(Pricing pricing, TipoPuntoVenta tipoPuntoVenta) { return pricingTipoPtoVtaDAO.obtenerPricingTipoPuntoVenta(pricing, tipoPuntoVenta); } + + @Override + @Transactional + public void borrar(List pricingTipoPtoVtas) { + if(pricingTipoPtoVtas != null && !pricingTipoPtoVtas.isEmpty()) { + for (PricingTipoPtoVta pricingTipoPtoVta : pricingTipoPtoVtas) { + borrar(pricingTipoPtoVta); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoServicioServiceImpl.java index 6284a033a..a193845e3 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoServicioServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingTipoServicioServiceImpl.java @@ -65,4 +65,14 @@ public class PricingTipoServicioServiceImpl implements PricingTipoServicioServic public Boolean obtenerPricingTipoServicio(Pricing pricing, TipoServicio tipoServicio) { return pricingTipoServicioDAO.obtenerPricingTipoServicio(pricing, tipoServicio); } + + @Override + @Transactional + public void borrar(List pricingTipoServicios) { + if(pricingTipoServicios != null && !pricingTipoServicios.isEmpty()) { + for (PricingTipoServicio pricingTipoServicio : pricingTipoServicios) { + borrar(pricingTipoServicio); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PricingVigenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PricingVigenciaServiceImpl.java index 4d586cdd4..d89ed498c 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PricingVigenciaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PricingVigenciaServiceImpl.java @@ -68,4 +68,14 @@ public class PricingVigenciaServiceImpl implements PricingVigenciaService { public Boolean podeSalvar(Pricing pricing, PricingVigencia pricingVigencia, Date inicio, Date fim) { return pricingVigenciaDAO.podeSalvar(pricing, pricingVigencia, inicio, fim); } + + @Override + @Transactional + public void borrar(List pricingVigenciaList) { + if(pricingVigenciaList != null && !pricingVigenciaList.isEmpty()) { + for (PricingVigencia pricingVigencia : pricingVigenciaList) { + borrar(pricingVigencia); + } + } + } } diff --git a/src/com/rjconsultores/ventaboletos/utilerias/PricingConverterVOToEntidad.java b/src/com/rjconsultores/ventaboletos/utilerias/PricingConverterVOToEntidad.java new file mode 100644 index 000000000..20b0a8bce --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/utilerias/PricingConverterVOToEntidad.java @@ -0,0 +1,428 @@ +package com.rjconsultores.ventaboletos.utilerias; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingClase; +import com.rjconsultores.ventaboletos.entidad.PricingClasseTarifaria; +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import com.rjconsultores.ventaboletos.vo.pricing.PricingAsiento; +import com.rjconsultores.ventaboletos.vo.pricing.PricingCanalVenta; +import com.rjconsultores.ventaboletos.vo.pricing.PricingCategoria; +import com.rjconsultores.ventaboletos.vo.pricing.PricingClasse; +import com.rjconsultores.ventaboletos.vo.pricing.PricingCorrida; +import com.rjconsultores.ventaboletos.vo.pricing.PricingDia; +import com.rjconsultores.ventaboletos.vo.pricing.PricingMarca; +import com.rjconsultores.ventaboletos.vo.pricing.PricingMercado; +import com.rjconsultores.ventaboletos.vo.pricing.PricingOcupaAntecipa; +import com.rjconsultores.ventaboletos.vo.pricing.PricingPuntoVenta; +import com.rjconsultores.ventaboletos.vo.pricing.PricingRuta; +import com.rjconsultores.ventaboletos.vo.pricing.PricingTipoCorrida; +import com.rjconsultores.ventaboletos.vo.pricing.PricingVigencia; + +public class PricingConverterVOToEntidad { + + private static Logger log = Logger.getLogger(PricingConverterVOToEntidad.class); + + private static PricingConverterVOToEntidad INSTANCE; + + private PricingConverterVOToEntidad() { + super(); + } + + public synchronized static PricingConverterVOToEntidad getInstance() { + if(INSTANCE == null) { + INSTANCE = new PricingConverterVOToEntidad(); + } + return INSTANCE; + } + + public Pricing convertVOToEntidad(com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + try { + Pricing retorno = new Pricing(); + retorno.setPricingId(pricingVO.getPricingId()); + retorno.setNombPricing(pricingVO.getNomePricing()); + retorno.setCantboleto(pricingVO.getQtdePoltronas() != null ? pricingVO.getQtdePoltronas().shortValue() : null); + retorno.setDescuentoporcentaje(pricingVO.getPorcentagemIda()); + retorno.setDescuentoporcredondo(pricingVO.getPorcentagemIdaVolta()); + retorno.setIndtransferible(pricingVO.getPodeTransferir() != null ? pricingVO.getPodeTransferir().equals(1) : true); + retorno.setIndreservable(pricingVO.getPodeReservar() != null ? pricingVO.getPodeReservar().equals(1): true); + retorno.setExibeVenda(pricingVO.getExibirVenda() != null ? pricingVO.getExibirVenda().equals(1) : true); + retorno.setIndcancelable(pricingVO.getPodeCancelar() != null ? pricingVO.getPodeCancelar().equals(1) : true); + retorno.setActivo(Pricing.ATIVO); + retorno.setFecmodif(new Date()); + retorno.setCantdiasanticipacion(pricingVO.getDiasAtencipacao()); + retorno.setEmpresa(new Empresa(pricingVO.getEmpresaId())); + retorno.setIndGeneraFeriadoViaje(StringUtils.isNotBlank(pricingVO.getAplicaFeriadoDtViagem()) ? pricingVO.getAplicaFeriadoDtViagem() : "S"); + retorno.setIndGeneraFeriadoVenta(StringUtils.isNotBlank(pricingVO.getAplicaFeriadoDtVenda()) ? pricingVO.getAplicaFeriadoDtVenda() : "S"); + + convertVOToEntidadPoltronas(retorno, pricingVO); + convertVOToEntidadCanalVendas(retorno, pricingVO); + convertVOToEntidadCategorias(retorno, pricingVO); + convertVOToEntidadClasses(retorno, pricingVO); + convertVOToEntidadServicos(retorno, pricingVO); + convertVOToEntidadDias(retorno, pricingVO); + convertVOToEntidadOcupacoes(retorno, pricingVO); + convertVOToEntidadPuntoventas(retorno, pricingVO); + convertVOToEntidadLinhas(retorno, pricingVO); + convertVOToEntidadTiposervicos(retorno, pricingVO); + convertVOToEntidadMercados(retorno, pricingVO); + convertVOToEntidadVigencias(retorno, pricingVO); + convertVOToEntidadMarcas(retorno, pricingVO); + + return retorno; + } catch (Exception e) { + log.error(e.getMessage(), e); + } + return null; + } + + public void convertVOToEntidadPoltronas(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getPoltronas() != null && !pricingVO.getPoltronas().isEmpty()) { + List asientos = new ArrayList(); + for (PricingAsiento pricingAsientoVO : pricingVO.getPoltronas()) { + com.rjconsultores.ventaboletos.entidad.PricingAsiento pricingAsiento = new com.rjconsultores.ventaboletos.entidad.PricingAsiento(); + pricingAsiento.setPricing(retorno); + pricingAsiento.setActivo(Pricing.ATIVO); + pricingAsiento.setFecmodif(new Date()); + pricingAsiento.setUsuarioId(retorno.getUsuarioId()); + pricingAsiento.setNombImagen(pricingAsientoVO.getNombImagen()); + pricingAsiento.setNumeasiento(pricingAsientoVO.getNumeasiento()); + pricingAsiento.setPorcentaje(pricingAsientoVO.getPorcentaje()); + + asientos.add(pricingAsiento); + } + retorno.setPricingAsientoList(asientos); + } + } + + public void convertVOToEntidadCanalVendas(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getCanalvendas() != null && !pricingVO.getCanalvendas().isEmpty()) { + List tipoPtoVtas = new ArrayList(); + for (PricingCanalVenta pricingCanalVentaVO : pricingVO.getCanalvendas()) { + com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta pricingTipoPtoVta = new com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta(); + pricingTipoPtoVta.setPricing(retorno); + pricingTipoPtoVta.setActivo(Pricing.ATIVO); + pricingTipoPtoVta.setFecmodif(new Date()); + pricingTipoPtoVta.setUsuarioId(retorno.getUsuarioId()); + pricingTipoPtoVta.setTipoPtovta(new TipoPuntoVenta(pricingCanalVentaVO.getCanalventaId().shortValue())); + + tipoPtoVtas.add(pricingTipoPtoVta); + } + + if(tipoPtoVtas.isEmpty()) { + com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta pricingTipoPtoVta = new com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta(); + pricingTipoPtoVta.setPricing(retorno); + pricingTipoPtoVta.setActivo(Pricing.ATIVO); + pricingTipoPtoVta.setFecmodif(new Date()); + pricingTipoPtoVta.setUsuarioId(retorno.getUsuarioId()); + pricingTipoPtoVta.setTipoPtovta(new TipoPuntoVenta(Short.valueOf("-1"))); + + tipoPtoVtas.add(pricingTipoPtoVta); + } + retorno.setPricingTipoptovtaList(tipoPtoVtas); + } + } + + public void convertVOToEntidadCategorias(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getCategorias() != null && !pricingVO.getCategorias().isEmpty()) { + List categorias = new ArrayList(); + for (PricingCategoria pricingCategoriaVO : pricingVO.getCategorias()) { + com.rjconsultores.ventaboletos.entidad.PricingCategoria pricingCategoria = new com.rjconsultores.ventaboletos.entidad.PricingCategoria(); + pricingCategoria.setPricing(retorno); + pricingCategoria.setActivo(Pricing.ATIVO); + pricingCategoria.setFecmodif(new Date()); + pricingCategoria.setUsuarioId(retorno.getUsuarioId()); + pricingCategoria.setCategoria(new Categoria(pricingCategoriaVO.getCategoriaId())); + + categorias.add(pricingCategoria); + } + + if(categorias.isEmpty()) { + com.rjconsultores.ventaboletos.entidad.PricingCategoria pricingCategoria = new com.rjconsultores.ventaboletos.entidad.PricingCategoria(); + pricingCategoria.setPricing(retorno); + pricingCategoria.setActivo(Pricing.ATIVO); + pricingCategoria.setFecmodif(new Date()); + pricingCategoria.setUsuarioId(retorno.getUsuarioId()); + pricingCategoria.setCategoria(new Categoria(1)); + + categorias.add(pricingCategoria); + + pricingCategoria = new com.rjconsultores.ventaboletos.entidad.PricingCategoria(); + pricingCategoria.setPricing(retorno); + pricingCategoria.setActivo(Pricing.ATIVO); + pricingCategoria.setFecmodif(new Date()); + pricingCategoria.setUsuarioId(retorno.getUsuarioId()); + pricingCategoria.setCategoria(new Categoria(48)); + + categorias.add(pricingCategoria); + } + + retorno.setPricingCategoriaList(categorias); + } + } + + public void convertVOToEntidadClasses(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getClasses() != null && !pricingVO.getClasses().isEmpty()) { + List clases = new ArrayList(); + for (PricingClasse pricingClasseVO : pricingVO.getClasses()) { + com.rjconsultores.ventaboletos.entidad.PricingClase pricingClase = new com.rjconsultores.ventaboletos.entidad.PricingClase(); + pricingClase.setPricing(retorno); + pricingClase.setActivo(Pricing.ATIVO); + pricingClase.setFecmodif(new Date()); + pricingClase.setUsuarioId(retorno.getUsuarioId()); + pricingClase.setClaseServicio(new ClaseServicio(pricingClasseVO.getClasseservicioId())); + + clases.add(pricingClase); + } + + if(clases.isEmpty()) { + com.rjconsultores.ventaboletos.entidad.PricingClase pricingClase = new com.rjconsultores.ventaboletos.entidad.PricingClase(); + pricingClase.setPricing(retorno); + pricingClase.setActivo(Pricing.ATIVO); + pricingClase.setFecmodif(new Date()); + pricingClase.setUsuarioId(retorno.getUsuarioId()); + pricingClase.setClaseServicio(new ClaseServicio(1)); + + clases.add(pricingClase); + } + retorno.setPricingClaseList(clases); + } + } + + public void convertVOToEntidadServicos(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getServicos() != null && !pricingVO.getServicos().isEmpty()) { + List corridas = new ArrayList(); + for (PricingCorrida pricingServicoVO : pricingVO.getServicos()) { + com.rjconsultores.ventaboletos.entidad.PricingCorrida pricingCorrida = new com.rjconsultores.ventaboletos.entidad.PricingCorrida(); + pricingCorrida.setPricing(retorno); + pricingCorrida.setActivo(Pricing.ATIVO); + pricingCorrida.setFecmodif(new Date()); + pricingCorrida.setUsuarioId(retorno.getUsuarioId()); + pricingCorrida.setCorridaCtrl(new CorridaCtrl(pricingServicoVO.getNumservico())); + + corridas.add(pricingCorrida); + } + retorno.setPricingCorridaList(corridas); + } + } + + public void convertVOToEntidadDias(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) throws ParseException { + if(pricingVO.getDias() != null && !pricingVO.getDias().isEmpty()) { + List dias = new ArrayList(); + for (PricingDia pricingDiaVO : pricingVO.getDias()) { + com.rjconsultores.ventaboletos.entidad.PricingDia pricingDia = new com.rjconsultores.ventaboletos.entidad.PricingDia(); + pricingDia.setPricing(retorno); + pricingDia.setActivo(Pricing.ATIVO); + pricingDia.setFecmodif(new Date()); + pricingDia.setUsuarioId(retorno.getUsuarioId()); + + if(StringUtils.isNotBlank(pricingDiaVO.getHorariofim())) { + pricingDia.setHorariofin(DateUtil.getFecInicio(DateUtil.getDateFromString(pricingDiaVO.getHorariofim(), "HH:mm")).getTime()); + } + + if(StringUtils.isNotBlank(pricingDiaVO.getHorarioinicio())) { + pricingDia.setHorarioinicio(DateUtil.getFecInicio(DateUtil.getDateFromString(pricingDiaVO.getHorarioinicio(), "HH:mm")).getTime()); + } + + pricingDia.setIndlunes(pricingDiaVO.getSegunda() != null ? pricingDiaVO.getSegunda().equals(1) : false); + pricingDia.setIndmartes(pricingDiaVO.getTerca() != null ? pricingDiaVO.getTerca().equals(1) : false); + pricingDia.setIndmiercoles(pricingDiaVO.getQuarta() != null ? pricingDiaVO.getQuarta().equals(1) : false); + pricingDia.setIndjueves(pricingDiaVO.getQuinta() != null ? pricingDiaVO.getQuinta().equals(1) : false); + pricingDia.setIndviernes(pricingDiaVO.getSexta() != null ? pricingDiaVO.getSexta().equals(1) : false); + pricingDia.setIndsabado(pricingDiaVO.getSabado() != null ? pricingDiaVO.getSabado().equals(1) : false); + pricingDia.setIndfecventa(pricingDiaVO.getDataviagem() == null || !pricingDiaVO.getDataviagem().equals(1)); + pricingDia.setIndfecviaje(!pricingDia.getIndfecventa()); + + dias.add(pricingDia); + } + retorno.setPricingDiaList(dias); + } + } + + public void convertVOToEntidadOcupacoes(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getOcupacoes() != null && !pricingVO.getOcupacoes().isEmpty()) { + List ocupacoes = new ArrayList(); + for (PricingOcupaAntecipa pricingOcupaAntecipaVO : pricingVO.getOcupacoes()) { + com.rjconsultores.ventaboletos.entidad.PricingOcupaAntecipa pricingOcupaAntecipa = new com.rjconsultores.ventaboletos.entidad.PricingOcupaAntecipa(); + pricingOcupaAntecipa.setPricing(retorno); + pricingOcupaAntecipa.setActivo(Pricing.ATIVO); + pricingOcupaAntecipa.setFecmodif(new Date()); + pricingOcupaAntecipa.setUsuarioId(retorno.getUsuarioId()); + pricingOcupaAntecipa.setCantasientosmax(pricingOcupaAntecipaVO.getCantasientosmax()); + pricingOcupaAntecipa.setCantasientosmin(pricingOcupaAntecipaVO.getCantasientosmin()); + pricingOcupaAntecipa.setCantdiasmax(pricingOcupaAntecipaVO.getCantdiasmax()); + pricingOcupaAntecipa.setCantdiasmin(pricingOcupaAntecipaVO.getCantdiasmin()); + pricingOcupaAntecipa.setImporte(pricingOcupaAntecipaVO.getImporte()); + pricingOcupaAntecipa.setOcupacionfinal(pricingOcupaAntecipaVO.getOcupacionfinal()); + pricingOcupaAntecipa.setOcupacioninicial(pricingOcupaAntecipaVO.getOcupacioninicial()); + pricingOcupaAntecipa.setPorcentaje(pricingOcupaAntecipaVO.getPorcentaje()); + if(pricingOcupaAntecipaVO.getClasseId() != null) { + pricingOcupaAntecipa.setPricingClasseTarifaria(new PricingClasseTarifaria(pricingOcupaAntecipaVO.getClasseId())); + } + + ocupacoes.add(pricingOcupaAntecipa); + } + retorno.setPricingOcupaAntecipaList(ocupacoes); + } + } + + public void convertVOToEntidadPuntoventas(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getPuntoventas() != null && !pricingVO.getPuntoventas().isEmpty()) { + List puntoventas = new ArrayList(); + for (PricingPuntoVenta pricingPuntoVentaVO : pricingVO.getPuntoventas()) { + com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta pricingPuntoVenta = new com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta(); + pricingPuntoVenta.setPricing(retorno); + pricingPuntoVenta.setActivo(Pricing.ATIVO); + pricingPuntoVenta.setFecmodif(new Date()); + pricingPuntoVenta.setUsuarioId(retorno.getUsuarioId()); + pricingPuntoVenta.setPuntoVenta(new PuntoVenta(pricingPuntoVentaVO.getPuntoventaId())); + + puntoventas.add(pricingPuntoVenta); + } + + if(puntoventas.isEmpty()) { + com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta pricingPuntoVenta = new com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta(); + pricingPuntoVenta.setPricing(retorno); + pricingPuntoVenta.setActivo(Pricing.ATIVO); + pricingPuntoVenta.setFecmodif(new Date()); + pricingPuntoVenta.setUsuarioId(retorno.getUsuarioId()); + pricingPuntoVenta.setPuntoVenta(new PuntoVenta(-1)); + + puntoventas.add(pricingPuntoVenta); + } + + retorno.setPricingPuntoventaList(puntoventas); + } + } + + public void convertVOToEntidadLinhas(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getLinhas() != null && !pricingVO.getLinhas().isEmpty()) { + List rutas = new ArrayList(); + for (PricingRuta pricingLinhaVO : pricingVO.getLinhas()) { + com.rjconsultores.ventaboletos.entidad.PricingRuta pricingRuta = new com.rjconsultores.ventaboletos.entidad.PricingRuta(); + pricingRuta.setPricing(retorno); + pricingRuta.setActivo(Pricing.ATIVO); + pricingRuta.setFecmodif(new Date()); + pricingRuta.setUsuarioId(retorno.getUsuarioId()); + pricingRuta.setRuta(new Ruta(pricingLinhaVO.getRutaId())); + + rutas.add(pricingRuta); + } + + if(rutas.isEmpty()) { + com.rjconsultores.ventaboletos.entidad.PricingRuta pricingRuta = new com.rjconsultores.ventaboletos.entidad.PricingRuta(); + pricingRuta.setPricing(retorno); + pricingRuta.setActivo(Pricing.ATIVO); + pricingRuta.setFecmodif(new Date()); + pricingRuta.setUsuarioId(retorno.getUsuarioId()); + pricingRuta.setRuta(new Ruta(-1)); + + rutas.add(pricingRuta); + } + retorno.setPricingRutaList(rutas); + } + } + + public void convertVOToEntidadTiposervicos(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getTiposervicos() != null && !pricingVO.getTiposervicos().isEmpty()) { + List tipoServicios = new ArrayList(); + for (PricingTipoCorrida pricingTipoCorridaVO : pricingVO.getTiposervicos()) { + com.rjconsultores.ventaboletos.entidad.PricingTipoServicio pricingTipoServicio = new com.rjconsultores.ventaboletos.entidad.PricingTipoServicio(); + pricingTipoServicio.setPricing(retorno); + pricingTipoServicio.setActivo(Pricing.ATIVO); + pricingTipoServicio.setFecmodif(new Date()); + pricingTipoServicio.setUsuarioId(retorno.getUsuarioId()); + pricingTipoServicio.setTipoServicio(new TipoServicio(pricingTipoCorridaVO.getTipocorridaId())); + + tipoServicios.add(pricingTipoServicio); + } + retorno.setPricingTipoServicioList(tipoServicios); + } + } + + public void convertVOToEntidadMercados(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getMercados() != null && !pricingVO.getMercados().isEmpty()) { + List mercados = new ArrayList(); + for (PricingMercado pricingMercadoVO : pricingVO.getMercados()) { + com.rjconsultores.ventaboletos.entidad.PricingMercado pricingMercado = new com.rjconsultores.ventaboletos.entidad.PricingMercado(); + pricingMercado.setPricing(retorno); + pricingMercado.setActivo(Pricing.ATIVO); + pricingMercado.setFecmodif(new Date()); + pricingMercado.setUsuarioId(retorno.getUsuarioId()); + pricingMercado.setOrigen(new Parada(pricingMercadoVO.getOrigemId())); + pricingMercado.setDestino(new Parada(pricingMercadoVO.getDestinoId())); + + mercados.add(pricingMercado); + } + retorno.setPricingMercadoList(mercados); + } + } + + public void convertVOToEntidadVigencias(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) throws ParseException { + if(pricingVO.getVigencias() != null && !pricingVO.getVigencias().isEmpty()) { + List vigencias = new ArrayList(); + for (PricingVigencia pricingVigenciaVO : pricingVO.getVigencias()) { + com.rjconsultores.ventaboletos.entidad.PricingVigencia pricingVigencia = new com.rjconsultores.ventaboletos.entidad.PricingVigencia(); + pricingVigencia.setPricing(retorno); + pricingVigencia.setActivo(Pricing.ATIVO); + pricingVigencia.setFecmodif(new Date()); + pricingVigencia.setUsuarioId(retorno.getUsuarioId()); + + if(StringUtils.isNotBlank(pricingVigenciaVO.getInicioDataVenda())) { + pricingVigencia.setFecinicioventa(DateUtil.getDateFromString(pricingVigenciaVO.getInicioDataVenda(), "dd/MM/yyyy HH:mm")); + } + + if(StringUtils.isNotBlank(pricingVigenciaVO.getFimDataVenda())) { + pricingVigencia.setFecfinventa(DateUtil.getDateFromString(pricingVigenciaVO.getFimDataVenda(), "dd/MM/yyyy HH:mm")); + } + + if(StringUtils.isNotBlank(pricingVigenciaVO.getInicioDataViagem())) { + pricingVigencia.setFecinicioviaje(DateUtil.getDateFromString(pricingVigenciaVO.getInicioDataViagem(), "dd/MM/yyyy HH:mm")); + } + + if(StringUtils.isNotBlank(pricingVigenciaVO.getFimDataViagem())) { + pricingVigencia.setFecfinviaje(DateUtil.getDateFromString(pricingVigenciaVO.getFimDataViagem(), "dd/MM/yyyy HH:mm")); + } + + vigencias.add(pricingVigencia); + } + retorno.setPricingVigenciaList(vigencias); + } + } + + public void convertVOToEntidadMarcas(Pricing retorno, com.rjconsultores.ventaboletos.vo.pricing.Pricing pricingVO) { + if(pricingVO.getMarcas() != null && !pricingVO.getMarcas().isEmpty()) { + List marcas = new ArrayList(); + for (PricingMarca pricingMarcaVO : pricingVO.getMarcas()) { + com.rjconsultores.ventaboletos.entidad.PricingMarca pricingMarca = new com.rjconsultores.ventaboletos.entidad.PricingMarca(); + pricingMarca.setPricing(retorno); + pricingMarca.setActivo(Pricing.ATIVO); + pricingMarca.setFecmodif(new Date()); + pricingMarca.setUsuarioId(retorno.getUsuarioId()); + pricingMarca.setMarca(new Marca(pricingMarcaVO.getMarcaId().shortValue())); + + marcas.add(pricingMarca); + } + retorno.setPricingMarcaList(marcas); + } + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/Pricing.java b/src/com/rjconsultores/ventaboletos/vo/pricing/Pricing.java new file mode 100644 index 000000000..291095af4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/Pricing.java @@ -0,0 +1,381 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.PricingClase; +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; + +public class Pricing implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer pricingId; + private String nomePricing; + private String aplicaFeriadoDtViagem; + private String aplicaFeriadoDtVenda; + private Integer empresaId; + private Integer qtdePoltronas; + private Integer tipoPricingPorcentagem; + private BigDecimal porcentagemIda; + private BigDecimal porcentagemIdaVolta; + private Integer podeTransferir; + private Integer podeCancelar; + private Integer podeReservar; + private Integer diasAtencipacao; + private Integer exibirVenda; + private BigDecimal valor; + + private String pricingoperacao; + + private List poltronas; // + private List canalvendas; // + private List categorias; // + private List classes; // + private List servicos; // + private List dias; // + private List ocupacoes; // + private List puntoventas; // + private List linhas; // + private List tiposervicos; // + private List mercados; // + private List vigencias; // + private List marcas; // + + public Pricing() { + super(); + } + + public Pricing(com.rjconsultores.ventaboletos.entidad.Pricing pricing) { + this(); + pricingId = pricing.getPricingId(); + nomePricing = pricing.getNombPricing(); + aplicaFeriadoDtViagem = pricing.getIndGeneraFeriadoViaje(); + aplicaFeriadoDtVenda = pricing.getIndGeneraFeriadoVenta(); + empresaId = pricing.getEmpresa().getEmpresaId(); + qtdePoltronas = pricing.getCantboleto() != null ? pricing.getCantboleto().intValue() : null; + tipoPricingPorcentagem = pricing.getDescuentoporcentaje() != null ? 1 : 0; + porcentagemIda = pricing.getDescuentoporcentaje(); + porcentagemIdaVolta = pricing.getDescuentoporcredondo(); + podeTransferir = pricing.getIndtransferible() ? 1 : 0; + podeCancelar = pricing.getIndcancelable() ? 1 : 0; + podeReservar = pricing.getIndreservable() ? 1 : 0; + diasAtencipacao = pricing.getCantdiasanticipacion(); + exibirVenda = pricing.getExibeVenda() ? 1 : 0; + + poltronas = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingAsiento pricingAsiento : pricing.getPricingAsientoList()) { + PricingAsiento pricingasientoVO = new PricingAsiento(pricingAsiento); + poltronas.add(pricingasientoVO); + } + + canalvendas = new ArrayList(0); + for (PricingTipoPtoVta pricingTipoPtoVta : pricing.getPricingTipoptovtaList()) { + PricingCanalVenta pricingCanalVenta = new PricingCanalVenta(pricingTipoPtoVta); + canalvendas.add(pricingCanalVenta); + } + + categorias = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingCategoria pricingCategoria : pricing.getPricingCategoriaList()) { + PricingCategoria pricingCategoriaVO = new PricingCategoria(pricingCategoria); + categorias.add(pricingCategoriaVO); + } + + classes = new ArrayList(0); + for (PricingClase pricingClase : pricing.getPricingClaseList()) { + PricingClasse pricingClasse = new PricingClasse(pricingClase); + classes.add(pricingClasse); + } + + servicos = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingCorrida pricingCorrida : pricing.getPricingCorridaList()) { + PricingCorrida pricingCorridaVO = new PricingCorrida(pricingCorrida); + servicos.add(pricingCorridaVO); + } + + dias = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingDia pricingDia : pricing.getPricingDiaList()) { + PricingDia pricingDiaVO = new PricingDia(pricingDia); + dias.add(pricingDiaVO); + } + + ocupacoes = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingOcupaAntecipa pricingOcupaAntecipa : pricing.getPricingOcupaAntecipaList()) { + PricingOcupaAntecipa pricingOcupaAntecipaVO = new PricingOcupaAntecipa(pricingOcupaAntecipa); + ocupacoes.add(pricingOcupaAntecipaVO); + } + + puntoventas = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta pricingPuntoVenta : pricing.getPricingPuntoventaList()) { + PricingPuntoVenta pricingPuntoVentaVO = new PricingPuntoVenta(pricingPuntoVenta); + puntoventas.add(pricingPuntoVentaVO); + } + + linhas = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingRuta pricingRuta : pricing.getPricingRutaList()) { + PricingRuta pricingRutaVO = new PricingRuta(pricingRuta); + linhas.add(pricingRutaVO); + } + + tiposervicos = new ArrayList(0); + for (PricingTipoServicio pricingTipoServicio: pricing.getPricingTipoServicioList()) { + PricingTipoCorrida pricingTipoCorrida = new PricingTipoCorrida(pricingTipoServicio); + tiposervicos.add(pricingTipoCorrida); + } + + mercados = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingMercado pricingMercado : pricing.getPricingMercadoList()) { + PricingMercado pricingMercadoVO = new PricingMercado(pricingMercado); + mercados.add(pricingMercadoVO); + } + + vigencias = new ArrayList(0); + for (com.rjconsultores.ventaboletos.entidad.PricingVigencia pricingVigencia : pricing.getPricingVigenciaList()) { + PricingVigencia pricingVigenciaVO = new PricingVigencia(pricingVigencia); + vigencias.add(pricingVigenciaVO); + } + + marcas = new ArrayList(); + for (com.rjconsultores.ventaboletos.entidad.PricingMarca pricingMarca : pricing.getPricingMarcaList()) { + PricingMarca pricingMarcaVO = new PricingMarca(pricingMarca); + marcas.add(pricingMarcaVO); + } + + } + + public Integer getPricingId() { + return pricingId; + } + + public void setPricingId(Integer pricingId) { + this.pricingId = pricingId; + } + + public String getNomePricing() { + return nomePricing; + } + + public void setNomePricing(String nomePricing) { + this.nomePricing = nomePricing; + } + + public String getAplicaFeriadoDtViagem() { + return aplicaFeriadoDtViagem; + } + + public void setAplicaFeriadoDtViagem(String aplicaFeriadoDtViagem) { + this.aplicaFeriadoDtViagem = aplicaFeriadoDtViagem; + } + + public String getAplicaFeriadoDtVenda() { + return aplicaFeriadoDtVenda; + } + + public void setAplicaFeriadoDtVenda(String aplicaFeriadoDtVenda) { + this.aplicaFeriadoDtVenda = aplicaFeriadoDtVenda; + } + + public Integer getEmpresaId() { + return empresaId; + } + + public void setEmpresaId(Integer empresaId) { + this.empresaId = empresaId; + } + + public Integer getQtdePoltronas() { + return qtdePoltronas; + } + + public void setQtdePoltronas(Integer qtdePoltronas) { + this.qtdePoltronas = qtdePoltronas; + } + + public Integer getTipoPricingPorcentagem() { + return tipoPricingPorcentagem; + } + + public void setTipoPricingPorcentagem(Integer tipoPricingPorcentagem) { + this.tipoPricingPorcentagem = tipoPricingPorcentagem; + } + + public BigDecimal getPorcentagemIda() { + return porcentagemIda; + } + + public void setPorcentagemIda(BigDecimal porcentagemIda) { + this.porcentagemIda = porcentagemIda; + } + + public BigDecimal getPorcentagemIdaVolta() { + return porcentagemIdaVolta; + } + + public void setPorcentagemIdaVolta(BigDecimal porcentagemIdaVolta) { + this.porcentagemIdaVolta = porcentagemIdaVolta; + } + + public Integer getPodeTransferir() { + return podeTransferir; + } + + public void setPodeTransferir(Integer podeTransferir) { + this.podeTransferir = podeTransferir; + } + + public Integer getPodeCancelar() { + return podeCancelar; + } + + public void setPodeCancelar(Integer podeCancelar) { + this.podeCancelar = podeCancelar; + } + + public Integer getPodeReservar() { + return podeReservar; + } + + public void setPodeReservar(Integer podeReservar) { + this.podeReservar = podeReservar; + } + + public Integer getDiasAtencipacao() { + return diasAtencipacao; + } + + public void setDiasAtencipacao(Integer diasAtencipacao) { + this.diasAtencipacao = diasAtencipacao; + } + + public BigDecimal getValor() { + return valor; + } + + public void setValor(BigDecimal valor) { + this.valor = valor; + } + + public String getPricingoperacao() { + return pricingoperacao; + } + + public void setPricingoperacao(String pricingoperacao) { + this.pricingoperacao = pricingoperacao; + } + + public List getPoltronas() { + return poltronas; + } + + public void setPoltronas(List poltronas) { + this.poltronas = poltronas; + } + + public List getCanalvendas() { + return canalvendas; + } + + public void setCanalvendas(List canalvendas) { + this.canalvendas = canalvendas; + } + + public List getCategorias() { + return categorias; + } + + public void setCategorias(List categorias) { + this.categorias = categorias; + } + + public List getClasses() { + return classes; + } + + public void setClasses(List classes) { + this.classes = classes; + } + + public List getServicos() { + return servicos; + } + + public void setServicos(List servicos) { + this.servicos = servicos; + } + + public List getDias() { + return dias; + } + + public void setDias(List dias) { + this.dias = dias; + } + + public List getOcupacoes() { + return ocupacoes; + } + + public void setOcupacoes(List ocupacoes) { + this.ocupacoes = ocupacoes; + } + + public List getPuntoventas() { + return puntoventas; + } + + public void setPuntoventas(List puntoventas) { + this.puntoventas = puntoventas; + } + + public List getLinhas() { + return linhas; + } + + public void setLinhas(List linhas) { + this.linhas = linhas; + } + + public List getTiposervicos() { + return tiposervicos; + } + + public void setTiposervicos(List tiposervicos) { + this.tiposervicos = tiposervicos; + } + + public Integer getExibirVenda() { + return exibirVenda; + } + + public void setExibirVenda(Integer exibirVenda) { + this.exibirVenda = exibirVenda; + } + + public List getMercados() { + return mercados; + } + + public void setMercados(List mercados) { + this.mercados = mercados; + } + + public List getVigencias() { + return vigencias; + } + + public void setVigencias(List vigencias) { + this.vigencias = vigencias; + } + + public List getMarcas() { + return marcas; + } + + public void setMarcas(List marcas) { + this.marcas = marcas; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingAsiento.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingAsiento.java new file mode 100644 index 000000000..06f15eb4a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingAsiento.java @@ -0,0 +1,50 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class PricingAsiento implements Serializable { + + private static final long serialVersionUID = 1L; + + private String numeasiento; + private String nombImagen; + private BigDecimal porcentaje; + + public PricingAsiento() { + super(); + } + + public PricingAsiento(com.rjconsultores.ventaboletos.entidad.PricingAsiento pricingAsiento) { + this(); + + numeasiento = pricingAsiento.getNumeasiento(); + nombImagen = pricingAsiento.getNombImagen(); + porcentaje = pricingAsiento.getPorcentaje(); + } + + public String getNumeasiento() { + return numeasiento; + } + + public void setNumeasiento(String numeasiento) { + this.numeasiento = numeasiento; + } + + public String getNombImagen() { + return nombImagen; + } + + public void setNombImagen(String nombImagen) { + this.nombImagen = nombImagen; + } + + public BigDecimal getPorcentaje() { + return porcentaje; + } + + public void setPorcentaje(BigDecimal porcentaje) { + this.porcentaje = porcentaje; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCanalVenta.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCanalVenta.java new file mode 100644 index 000000000..f020f2a42 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCanalVenta.java @@ -0,0 +1,37 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; + +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; + +public class PricingCanalVenta implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer canalventaId; + private String desccanalventa; + + public PricingCanalVenta() { + super(); + } + + public PricingCanalVenta(PricingTipoPtoVta pricingTipoPtoVta) { + this(); + + this.canalventaId = pricingTipoPtoVta.getTipoPtovta().getTipoptovtaId().intValue(); + this.desccanalventa = pricingTipoPtoVta.getTipoPtovta().getDesctipo(); + } + public Integer getCanalventaId() { + return canalventaId; + } + public void setCanalventaId(Integer canalventaId) { + this.canalventaId = canalventaId; + } + public String getDesccanalventa() { + return desccanalventa; + } + public void setDesccanalventa(String desccanalventa) { + this.desccanalventa = desccanalventa; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCategoria.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCategoria.java new file mode 100644 index 000000000..131e23bb5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCategoria.java @@ -0,0 +1,39 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; + +public class PricingCategoria implements Serializable{ + + private static final long serialVersionUID = 1L; + + private Integer categoriaId; + private String desccategoria; + + public PricingCategoria() { + super(); + } + + public PricingCategoria(com.rjconsultores.ventaboletos.entidad.PricingCategoria pricingCategoria) { + this(); + + this.categoriaId = pricingCategoria.getCategoria().getCategoriaId(); + this.desccategoria = pricingCategoria.getCategoria().getDesccategoria(); + } + + public Integer getCategoriaId() { + return categoriaId; + } + + public void setCategoriaId(Integer categoriaId) { + this.categoriaId = categoriaId; + } + + public String getDesccategoria() { + return desccategoria; + } + + public void setDesccategoria(String desccategoria) { + this.desccategoria = desccategoria; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingClasse.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingClasse.java new file mode 100644 index 000000000..88680fc76 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingClasse.java @@ -0,0 +1,41 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; + +import com.rjconsultores.ventaboletos.entidad.PricingClase; + +public class PricingClasse implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer classeservicioId; + private String descclasseservicio; + + public PricingClasse() { + super(); + } + + public PricingClasse(PricingClase pricingClase) { + this(); + + this.classeservicioId = pricingClase.getClaseServicio().getClaseservicioId(); + this.descclasseservicio = pricingClase.getClaseServicio().getDescclase(); + } + + public Integer getClasseservicioId() { + return classeservicioId; + } + + public void setClasseservicioId(Integer classeservicioId) { + this.classeservicioId = classeservicioId; + } + + public String getDescclasseservicio() { + return descclasseservicio; + } + + public void setDescclasseservicio(String descclasseservicio) { + this.descclasseservicio = descclasseservicio; + } + +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCorrida.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCorrida.java new file mode 100644 index 000000000..d6fab00d2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingCorrida.java @@ -0,0 +1,29 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; + +public class PricingCorrida implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer numservico; + + public PricingCorrida() { + super(); + } + + public PricingCorrida(com.rjconsultores.ventaboletos.entidad.PricingCorrida pricingCorrida) { + this(); + + this.numservico = pricingCorrida.getCorridaCtrl().getCorridaId(); + } + + public Integer getNumservico() { + return numservico; + } + + public void setNumservico(Integer numservico) { + this.numservico = numservico; + } + +} \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingDia.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingDia.java new file mode 100644 index 000000000..17827c1a8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingDia.java @@ -0,0 +1,121 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; + +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + +public class PricingDia implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer segunda; + private Integer terca; + private Integer quarta; + private Integer quinta; + private Integer sexta; + private Integer sabado; + private Integer domingo; + private String horarioinicio; + private String horariofim; + private Integer dataviagem; + + public PricingDia() { + super(); + } + + public PricingDia(com.rjconsultores.ventaboletos.entidad.PricingDia pricingDia) { + this(); + + segunda = pricingDia.getIndlunes() ? 1 : 0; + terca = pricingDia.getIndmartes() ? 1 : 0; + quarta = pricingDia.getIndmiercoles() ? 1 : 0; + quinta = pricingDia.getIndjueves() ? 1 : 0; + sexta = pricingDia.getIndviernes() ? 1 : 0; + sabado = pricingDia.getIndsabado() ? 1 : 0; + domingo = pricingDia.getInddomingo() ? 1 : 0; + horarioinicio = pricingDia.getHorarioinicio() != null ? DateUtil.getStringDate(pricingDia.getHorarioinicio(), "HH:mm") : null; + horariofim = pricingDia.getHorariofin() != null ? DateUtil.getStringDate(pricingDia.getHorariofin(), "HH:mm") : null; + dataviagem = pricingDia.getIndfecventa() ? 1 : 0; + } + + public Integer getSegunda() { + return segunda; + } + + public void setSegunda(Integer segunda) { + this.segunda = segunda; + } + + public Integer getTerca() { + return terca; + } + + public void setTerca(Integer terca) { + this.terca = terca; + } + + public Integer getQuarta() { + return quarta; + } + + public void setQuarta(Integer quarta) { + this.quarta = quarta; + } + + public Integer getQuinta() { + return quinta; + } + + public void setQuinta(Integer quinta) { + this.quinta = quinta; + } + + public Integer getSexta() { + return sexta; + } + + public void setSexta(Integer sexta) { + this.sexta = sexta; + } + + public Integer getSabado() { + return sabado; + } + + public void setSabado(Integer sabado) { + this.sabado = sabado; + } + + public Integer getDomingo() { + return domingo; + } + + public void setDomingo(Integer domingo) { + this.domingo = domingo; + } + + public String getHorarioinicio() { + return horarioinicio; + } + + public void setHorarioinicio(String horarioinicio) { + this.horarioinicio = horarioinicio; + } + + public String getHorariofim() { + return horariofim; + } + + public void setHorariofim(String horariofim) { + this.horariofim = horariofim; + } + + public Integer getDataviagem() { + return dataviagem; + } + + public void setDataviagem(Integer dataviagem) { + this.dataviagem = dataviagem; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingMarca.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingMarca.java new file mode 100644 index 000000000..278edd779 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingMarca.java @@ -0,0 +1,34 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +public class PricingMarca { + + private Integer marcaId; + private String descmarca; + + public PricingMarca() { + super(); + } + + public PricingMarca(com.rjconsultores.ventaboletos.entidad.PricingMarca pricingMarca) { + this(); + this.marcaId = pricingMarca.getMarca().getMarcaId().intValue(); + this.descmarca = pricingMarca.getMarca().getDescmarca(); + } + + public Integer getMarcaId() { + return marcaId; + } + + public void setMarcaId(Integer marcaId) { + this.marcaId = marcaId; + } + + public String getDescmarca() { + return descmarca; + } + + public void setDescmarca(String descmarca) { + this.descmarca = descmarca; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingMercado.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingMercado.java new file mode 100644 index 000000000..afa8508ee --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingMercado.java @@ -0,0 +1,57 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +public class PricingMercado { + + private String descorigem; + private Integer origemId; + + private String descdestino; + private Integer destinoId; + + public PricingMercado() { + super(); + } + + public PricingMercado(com.rjconsultores.ventaboletos.entidad.PricingMercado pricingMercado) { + this(); + + this.origemId = pricingMercado.getOrigen() != null ? pricingMercado.getOrigen().getParadaId() : null; + this.descorigem = pricingMercado.getOrigen() != null ? pricingMercado.getOrigen().getDescparada() : null; + + this.destinoId = pricingMercado.getDestino() != null ? pricingMercado.getDestino().getParadaId() : null; + this.descdestino = pricingMercado.getDestino() != null ? pricingMercado.getDestino().getDescparada() : null; + } + + public String getDescorigem() { + return descorigem; + } + + public void setDescorigem(String descorigem) { + this.descorigem = descorigem; + } + + public Integer getOrigemId() { + return origemId; + } + + public void setOrigemId(Integer origemId) { + this.origemId = origemId; + } + + public String getDescdestino() { + return descdestino; + } + + public void setDescdestino(String descdestino) { + this.descdestino = descdestino; + } + + public Integer getDestinoId() { + return destinoId; + } + + public void setDestinoId(Integer destinoId) { + this.destinoId = destinoId; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingOcupaAntecipa.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingOcupaAntecipa.java new file mode 100644 index 000000000..6136f9f51 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingOcupaAntecipa.java @@ -0,0 +1,121 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class PricingOcupaAntecipa implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer cantdiasmin; + private Integer cantdiasmax; + private Integer cantasientosmin; + private Integer cantasientosmax; + private BigDecimal porcentaje; + private BigDecimal ocupacioninicial; + private BigDecimal ocupacionfinal; + private BigDecimal importe; + + private Integer classeId; + private String descclasse; + + public PricingOcupaAntecipa() { + super(); + } + + public PricingOcupaAntecipa(com.rjconsultores.ventaboletos.entidad.PricingOcupaAntecipa pricingOcupaAntecipa) { + this(); + + cantdiasmin = pricingOcupaAntecipa.getCantdiasmin(); + cantdiasmax = pricingOcupaAntecipa.getCantdiasmax(); + cantasientosmin = pricingOcupaAntecipa.getCantasientosmin(); + cantasientosmax = pricingOcupaAntecipa.getCantasientosmax(); + porcentaje = pricingOcupaAntecipa.getPorcentaje(); + ocupacioninicial = pricingOcupaAntecipa.getOcupacioninicial(); + ocupacionfinal = pricingOcupaAntecipa.getOcupacionfinal(); + importe = pricingOcupaAntecipa.getImporte(); + classeId = pricingOcupaAntecipa.getPricingClasseTarifaria() != null ? pricingOcupaAntecipa.getPricingClasseTarifaria().getPricingClasseTarifariaId() : null; + descclasse = pricingOcupaAntecipa.getPricingClasseTarifaria() != null ? pricingOcupaAntecipa.getPricingClasseTarifaria().getDescClasseTarifaria() : null; + } + + public Integer getCantdiasmin() { + return cantdiasmin; + } + + public void setCantdiasmin(Integer cantdiasmin) { + this.cantdiasmin = cantdiasmin; + } + + public Integer getCantdiasmax() { + return cantdiasmax; + } + + public void setCantdiasmax(Integer cantdiasmax) { + this.cantdiasmax = cantdiasmax; + } + + public Integer getCantasientosmin() { + return cantasientosmin; + } + + public void setCantasientosmin(Integer cantasientosmin) { + this.cantasientosmin = cantasientosmin; + } + + public Integer getCantasientosmax() { + return cantasientosmax; + } + + public void setCantasientosmax(Integer cantasientosmax) { + this.cantasientosmax = cantasientosmax; + } + + public BigDecimal getPorcentaje() { + return porcentaje; + } + + public void setPorcentaje(BigDecimal porcentaje) { + this.porcentaje = porcentaje; + } + + public BigDecimal getOcupacioninicial() { + return ocupacioninicial; + } + + public void setOcupacioninicial(BigDecimal ocupacioninicial) { + this.ocupacioninicial = ocupacioninicial; + } + + public BigDecimal getOcupacionfinal() { + return ocupacionfinal; + } + + public void setOcupacionfinal(BigDecimal ocupacionfinal) { + this.ocupacionfinal = ocupacionfinal; + } + + public BigDecimal getImporte() { + return importe; + } + + public void setImporte(BigDecimal importe) { + this.importe = importe; + } + + public Integer getClasseId() { + return classeId; + } + + public void setClasseId(Integer classeId) { + this.classeId = classeId; + } + + public String getDescclasse() { + return descclasse; + } + + public void setDescclasse(String descclasse) { + this.descclasse = descclasse; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingPuntoVenta.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingPuntoVenta.java new file mode 100644 index 000000000..b51e95807 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingPuntoVenta.java @@ -0,0 +1,39 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; + +public class PricingPuntoVenta implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer puntoventaId; + private String nombpuntoventa; + + public PricingPuntoVenta() { + super(); + } + + public PricingPuntoVenta(com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta pricingPuntoVenta) { + this(); + + this.puntoventaId = pricingPuntoVenta.getPuntoVenta().getPuntoventaId(); + this.nombpuntoventa = pricingPuntoVenta.getPuntoVenta().getNombpuntoventa(); + } + + public Integer getPuntoventaId() { + return puntoventaId; + } + + public void setPuntoventaId(Integer puntoventaId) { + this.puntoventaId = puntoventaId; + } + + public String getNombpuntoventa() { + return nombpuntoventa; + } + + public void setNombpuntoventa(String nombpuntoventa) { + this.nombpuntoventa = nombpuntoventa; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingRuta.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingRuta.java new file mode 100644 index 000000000..8daaf5ead --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingRuta.java @@ -0,0 +1,39 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; + +public class PricingRuta implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer rutaId; + private String descruta; + + public PricingRuta() { + super(); + } + + public PricingRuta(com.rjconsultores.ventaboletos.entidad.PricingRuta pricingRuta) { + this(); + + this.rutaId = pricingRuta.getRuta().getRutaId(); + this.descruta = pricingRuta.getRuta().getDescruta(); + } + + public Integer getRutaId() { + return rutaId; + } + + public void setRutaId(Integer rutaId) { + this.rutaId = rutaId; + } + + public String getDescruta() { + return descruta; + } + + public void setDescruta(String descruta) { + this.descruta = descruta; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingTipoCorrida.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingTipoCorrida.java new file mode 100644 index 000000000..c9e843dfc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingTipoCorrida.java @@ -0,0 +1,41 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; + +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; + +public class PricingTipoCorrida implements Serializable { + + private static final long serialVersionUID = 1L; + + private Integer tipocorridaId; + private String desctipocorrida; + + public PricingTipoCorrida() { + super(); + } + + public PricingTipoCorrida(PricingTipoServicio pricingTipoServicio) { + this(); + + this.tipocorridaId = pricingTipoServicio.getTipoServicio().getTiposervicioId(); + this.desctipocorrida = pricingTipoServicio.getTipoServicio().getDescservicio(); + } + + public Integer getTipocorridaId() { + return tipocorridaId; + } + + public void setTipocorridaId(Integer tipocorridaId) { + this.tipocorridaId = tipocorridaId; + } + + public String getDesctipocorrida() { + return desctipocorrida; + } + + public void setDesctipocorrida(String desctipocorrida) { + this.desctipocorrida = desctipocorrida; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/PricingVigencia.java b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingVigencia.java new file mode 100644 index 000000000..daa7eabba --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/PricingVigencia.java @@ -0,0 +1,56 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + +public class PricingVigencia { + + private String inicioDataViagem; + private String fimDataViagem; + private String inicioDataVenda; + private String fimDataVenda; + + public PricingVigencia() { + super(); + } + + public PricingVigencia(com.rjconsultores.ventaboletos.entidad.PricingVigencia pricingVigencia) { + this(); + this.inicioDataVenda = pricingVigencia.getFecinicioventa() != null ? DateUtil.getStringDate(pricingVigencia.getFecinicioventa(), "dd/MM/yyyy HH:mm") : null; + this.fimDataVenda = pricingVigencia.getFecfinventa() != null ? DateUtil.getStringDate(pricingVigencia.getFecfinventa(), "dd/MM/yyyy HH:mm") : null; + this.inicioDataViagem = pricingVigencia.getFecinicioviaje() != null ? DateUtil.getStringDate(pricingVigencia.getFecinicioviaje(), "dd/MM/yyyy HH:mm") : null; + this.fimDataViagem = pricingVigencia.getFecfinviaje() != null ? DateUtil.getStringDate(pricingVigencia.getFecfinviaje(), "dd/MM/yyyy HH:mm") : null; + } + + public String getInicioDataViagem() { + return inicioDataViagem; + } + + public void setInicioDataViagem(String inicioDataViagem) { + this.inicioDataViagem = inicioDataViagem; + } + + public String getFimDataViagem() { + return fimDataViagem; + } + + public void setFimDataViagem(String fimDataViagem) { + this.fimDataViagem = fimDataViagem; + } + + public String getInicioDataVenda() { + return inicioDataVenda; + } + + public void setInicioDataVenda(String inicioDataVenda) { + this.inicioDataVenda = inicioDataVenda; + } + + public String getFimDataVenda() { + return fimDataVenda; + } + + public void setFimDataVenda(String fimDataVenda) { + this.fimDataVenda = fimDataVenda; + } + +}