diff --git a/src/com/rjconsultores/ventaboletos/constantes/ConstantesFuncionSistema.java b/src/com/rjconsultores/ventaboletos/constantes/ConstantesFuncionSistema.java index a69b30f3e..7d413e1ad 100644 --- a/src/com/rjconsultores/ventaboletos/constantes/ConstantesFuncionSistema.java +++ b/src/com/rjconsultores/ventaboletos/constantes/ConstantesFuncionSistema.java @@ -34,4 +34,11 @@ public class ConstantesFuncionSistema { public static final String CLAVE_RELATORIO_PRICING_ESPECIFICO = "COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MENU.RELATORIOPRICINGESPECIFICO"; public static final String CLAVE_MODIFICACAO_EMBARCADA = "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.MODIFICACIONMASIVAEMBARCADA"; public static final String CLAVE_AUTORIZACAO_RUTA = "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.AUTORIZACAORUTA"; + + public static final String CLAVE_MENU_GESTAO_PRICING = "COM.RJCONSULTORES.ADMINISTRACION.GUI.GESTAODEPRICING"; + public static final String CLAVE_GESTAO_PRICING_ESPECIFICO = "COM.RJCONSULTORES.ADMINISTRACION.GUI.GESTAODEPRICING.PRICINGESPECIFICO"; + public static final String CLAVE_GESTAO_PRICING = "COM.RJCONSULTORES.ADMINISTRACION.GUI.GESTAODEPRICING.PRICING"; + public static final String CLAVE_TELA_GESTAO_PRICING = "COM.RJCONSULTORES.ADMINISTRACION.GUI.GESTAODEPRICING.GESTAOPRICING"; + public static final String CLAVE_MENU_RELATORIOS_MUDANCAS = "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.RELATORIOSDEMUDANCAS"; + public static final String CLAVE_MENU_RELATORIOS_MUDANCAS_PRICING = "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.RELATORIOSDEMUDANCAS.RELATORIOSDEMUDANCASPRICING"; } diff --git a/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java index 7a430afd4..1240280ea 100644 --- a/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java @@ -11,6 +11,7 @@ import com.rjconsultores.ventaboletos.entidad.ClaseServicio; import com.rjconsultores.ventaboletos.entidad.Corrida; import com.rjconsultores.ventaboletos.entidad.Corrida.Id; import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Estado; import com.rjconsultores.ventaboletos.entidad.Marca; import com.rjconsultores.ventaboletos.entidad.Parada; @@ -105,5 +106,8 @@ public interface CorridaDAO extends GenericDAO { public CorridaVO buscarVOPorId(Id corridaId); - public Integer buscarOcupacaoCorrida(Corrida corrida); + public Integer buscarOcupacaoCorrida(Corrida corrida); + + public List buscarCorridas(Parada ori, Parada des, Date dataInicio, Date dataFinal, ClaseServicio cs, + Ruta linha, Empresa empresa); } \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/dao/CorridaTramoDAO.java b/src/com/rjconsultores/ventaboletos/dao/CorridaTramoDAO.java index 4128ae82b..9ce9638d3 100644 --- a/src/com/rjconsultores/ventaboletos/dao/CorridaTramoDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/CorridaTramoDAO.java @@ -5,6 +5,7 @@ import java.util.List; import com.rjconsultores.ventaboletos.entidad.Corrida; import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.entidad.Tramo; public interface CorridaTramoDAO extends GenericDAO { @@ -15,5 +16,7 @@ public interface CorridaTramoDAO extends GenericDAO { List buscarCorridaTramoPorCorrida(Corrida corrida); public BigDecimal buscarSumTarjetaMesmaCorrida(CorridaTramo ct); + + List buscarTramoPorCorridaId(Integer corridaId); } diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingAsientoDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingAsientoDAO.java new file mode 100644 index 000000000..ac3f4c425 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingAsientoDAO.java @@ -0,0 +1,13 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingAsiento; + +public interface GP_PricingAsientoDAO extends GenericDAO { + + public List obtenerPricingCategoria(GP_Pricing pricing, Integer asiento); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingCategoriaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingCategoriaDAO.java new file mode 100644 index 000000000..67848b9db --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingCategoriaDAO.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCategoria; + +/** + * + * @author Rafius + */ +public interface GP_PricingCategoriaDAO extends GenericDAO { + + public Boolean obtenerPricingCategoria(GP_Pricing pricing, Categoria categoria); + + List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingClaseDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingClaseDAO.java new file mode 100644 index 000000000..06c6c3587 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingClaseDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingClase; + +public interface GP_PricingClaseDAO extends GenericDAO { + + public Boolean obtenerPricingClase(GP_Pricing pricing, ClaseServicio claseServicio); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingClasseTarifariaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingClasseTarifariaDAO.java new file mode 100644 index 000000000..b3bc38cac --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingClasseTarifariaDAO.java @@ -0,0 +1,9 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingClasseTarifaria; + +public interface GP_PricingClasseTarifariaDAO extends GenericDAO { + + public Boolean validacionSigla(String sigla); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingCorridaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingCorridaDAO.java new file mode 100644 index 000000000..314600d8d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingCorridaDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCorrida; + +public interface GP_PricingCorridaDAO extends GenericDAO { + + public Boolean obtenerPricingCorrida(GP_Pricing pricing, CorridaCtrl corrida); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingDAO.java new file mode 100644 index 000000000..b8e122619 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingDAO.java @@ -0,0 +1,20 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.math.BigDecimal; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingRevisaoValoresVO; + +public interface GP_PricingDAO extends GenericDAO { + + public List buscar(String nombPricing, Empresa empresa, + Short cantboleto, Integer cantdiasanticipacion, + BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo); + + public List buscarPorNombre(String nombPricing); + + public List buscarPricingRevisaoValoresVO(List classeServicioIds,List marcaIds, List rutaIds, List tramoIds, List lsPricingVigencia); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingDiaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingDiaDAO.java new file mode 100644 index 000000000..a84b4e803 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingDiaDAO.java @@ -0,0 +1,13 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingDia; + +public interface GP_PricingDiaDAO extends GenericDAO { + + public List buscarTraslapa(GP_PricingDia pricingDia); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoAgenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoAgenciaDAO.java new file mode 100644 index 000000000..7013bbe3b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoAgenciaDAO.java @@ -0,0 +1,9 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoAgencia; + +public interface GP_PricingEspecificoAgenciaDAO extends GenericDAO { + + Boolean isDuplicado(GP_PricingEspecificoAgencia entidad); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoCanalVendasDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoCanalVendasDAO.java new file mode 100644 index 000000000..536b9f75f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoCanalVendasDAO.java @@ -0,0 +1,9 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCanalVendas; + +public interface GP_PricingEspecificoCanalVendasDAO extends GenericDAO { + + Boolean isDuplicado(GP_PricingEspecificoCanalVendas entidad); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoCategoriaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoCategoriaDAO.java new file mode 100644 index 000000000..3d37ac53b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoCategoriaDAO.java @@ -0,0 +1,9 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCategoria; + +public interface GP_PricingEspecificoCategoriaDAO extends GenericDAO { + + Boolean isDuplicado(GP_PricingEspecificoCategoria entidad); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoDAO.java new file mode 100644 index 000000000..3eb9fae58 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoDAO.java @@ -0,0 +1,19 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.Date; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecifico; +import com.rjconsultores.ventaboletos.entidad.Parada; + + +public interface GP_PricingEspecificoDAO extends GenericDAO { + + public List buscarPorNome(GP_PricingEspecifico pricingEspecifico); + + public List buscarPorNome(String nome); + + public List buscar(List empresas, List tipoClasses, List origens, List destinos, Date vigenciaInicial, Date vigenciaFinal); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoOcupacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoOcupacionDAO.java new file mode 100644 index 000000000..d648e657d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingEspecificoOcupacionDAO.java @@ -0,0 +1,7 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoOcupacion; + +public interface GP_PricingEspecificoOcupacionDAO extends GenericDAO { + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingFormapagoDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingFormapagoDAO.java new file mode 100644 index 000000000..a6b0365d9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingFormapagoDAO.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingFormapago; + +public interface GP_PricingFormapagoDAO extends GenericDAO { + + List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingGestaoDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingGestaoDAO.java new file mode 100644 index 000000000..5c42346a9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingGestaoDAO.java @@ -0,0 +1,7 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingGestao; + +public interface GP_PricingGestaoDAO extends GenericDAO { + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingHistoricoDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingHistoricoDAO.java new file mode 100644 index 000000000..0c0b5b377 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingHistoricoDAO.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.dao; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingHistorico; + + +public interface GP_PricingHistoricoDAO extends GenericDAO { + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingImporteDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingImporteDAO.java new file mode 100644 index 000000000..6236a8610 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingImporteDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingImporte; +import com.rjconsultores.ventaboletos.entidad.Moneda; + +public interface GP_PricingImporteDAO extends GenericDAO { + + public List buscarMoneda(GP_PricingImporte pricingImporte, Moneda moneda); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingMarcaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingMarcaDAO.java new file mode 100644 index 000000000..60f6e7ecc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingMarcaDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMarca; +import com.rjconsultores.ventaboletos.entidad.Marca; + +public interface GP_PricingMarcaDAO extends GenericDAO { + + public Boolean obtenerPricingMarca(GP_Pricing pricing, Marca marca); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingMercadoDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingMercadoDAO.java new file mode 100644 index 000000000..c4fcfcf8c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingMercadoDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMercado; +import com.rjconsultores.ventaboletos.entidad.Parada; + +public interface GP_PricingMercadoDAO extends GenericDAO { + + public Boolean obtenerPricingMercado(GP_Pricing pricing, Parada origen, Parada destino); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingOcupaAntecipaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingOcupaAntecipaDAO.java new file mode 100644 index 000000000..d617a4379 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingOcupaAntecipaDAO.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingOcupaAntecipa; + +public interface GP_PricingOcupaAntecipaDAO extends GenericDAO { + + + public List buscarOcupaAntecipaPricing(Integer pricingId); + + public List buscarOcupaAntecipaPricingAtivos(Integer pricingId); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingPuntoVentaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingPuntoVentaDAO.java new file mode 100644 index 000000000..b3eab837c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingPuntoVentaDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; + +public interface GP_PricingPuntoVentaDAO extends GenericDAO { + + public Boolean obtenerPricingPuntoVenta(GP_Pricing pricing, PuntoVenta puntoVenta); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingRutaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingRutaDAO.java new file mode 100644 index 000000000..3c9120c37 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingRutaDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; + +public interface GP_PricingRutaDAO extends GenericDAO { + + public Boolean obtenerPricingRuta(GP_Pricing pricing, Ruta ruta); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingTipoPtoVtaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingTipoPtoVtaDAO.java new file mode 100644 index 000000000..79fc76cbb --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingTipoPtoVtaDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; + +public interface GP_PricingTipoPtoVtaDAO extends GenericDAO { + + public Boolean obtenerPricingTipoPuntoVenta(GP_Pricing pricing, TipoPuntoVenta tipoPuntoVenta); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingTipoServicioDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingTipoServicioDAO.java new file mode 100644 index 000000000..ccab61415 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingTipoServicioDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; + +public interface GP_PricingTipoServicioDAO extends GenericDAO { + + public Boolean obtenerPricingTipoServicio(GP_Pricing pricing, TipoServicio tipoServicio); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/GP_PricingVigenciaDAO.java b/src/com/rjconsultores/ventaboletos/dao/GP_PricingVigenciaDAO.java new file mode 100644 index 000000000..624241c16 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/GP_PricingVigenciaDAO.java @@ -0,0 +1,17 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.Date; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; + +public interface GP_PricingVigenciaDAO extends GenericDAO { + + public List buscarPorVigencias(GP_PricingVigencia pv); + + public Boolean podeSalvar(GP_Pricing pricing, GP_PricingVigencia pricingVigencia, + Date inicio, Date fim); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/dao/TramoDAO.java b/src/com/rjconsultores/ventaboletos/dao/TramoDAO.java index d68639b2a..5fa93d35c 100644 --- a/src/com/rjconsultores/ventaboletos/dao/TramoDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/TramoDAO.java @@ -53,4 +53,5 @@ public interface TramoDAO extends GenericDAO { public List buscarListaPorIds(List tramoIds, String chaveCorrida, boolean tarifaEmbarcada) throws Exception; + List obtenerTramosPorOrigemDestino(Parada origem, Parada destino); } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java index 8bd6e24b7..c8b5fbf19 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java @@ -38,6 +38,7 @@ import com.rjconsultores.ventaboletos.entidad.Corrida; import com.rjconsultores.ventaboletos.entidad.Corrida.Id; import com.rjconsultores.ventaboletos.entidad.CorridaTramo; import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Estado; import com.rjconsultores.ventaboletos.entidad.Marca; import com.rjconsultores.ventaboletos.entidad.Parada; @@ -1113,5 +1114,80 @@ public class CorridaHibernateDAO extends GenericHibernateDAO buscarCorridas(Parada ori, Parada des, Date dataInicial, Date dataFinal, ClaseServicio cs, + Ruta linha, Empresa empresa) { + + StringBuilder hql = new StringBuilder(""); + hql.append("select distinct "); + hql.append(" new com.rjconsultores.ventaboletos.entidad.Corrida("); + hql.append(" c.marca, "); + hql.append(" c.id.corridaId, "); + hql.append(" c.id.feccorrida, "); + hql.append(" c.origem, "); + hql.append(" c.destino, "); + hql.append(" c.claseServicio, "); + hql.append(" c.corridaCtrl.horario) "); + hql.append("from "); + hql.append(" Corrida c "); + hql.append(" where c.activo = 1 "); + + if (empresa != null) { + hql.append(" and c.empresa = :empresa "); + } + if (linha != null) { + hql.append(" and c.ruta = :linha "); + } + if (ori != null) { + hql.append(" and c.origem = :origen "); + } + if (des != null) { + hql.append(" and c.destino = :destino"); + } + if (cs != null) { + hql.append(" and c.claseServicio = :claseServicio "); + } + if (dataInicial != null) { + + hql.append(" and c.corridaCtrl.horario >= :horaSalidaInicio"); + } + if (dataFinal != null) { + + hql.append(" and c.corridaCtrl.horario <= :horaSalidaFin"); + } + + hql.append(" order by c.id.corridaId,c.corridaCtrl.horario"); + + Query query = getSession().createQuery(hql.toString()); + + if (empresa != null) { + query.setParameter("empresa", empresa); + } + if (linha != null) { + query.setParameter("linha", linha); + } + if (ori != null) { + query.setParameter("origen", ori); + } + if (des != null) { + query.setParameter("destino", des); + } + if (cs != null) { + query.setParameter("claseServicio", cs); + } + + if (dataInicial != null) { + + query.setParameter("horaSalidaInicio", dataInicial); + } + if (dataFinal != null) { + query.setParameter("horaSalidaFin", dataFinal); + + } + + return query.list(); + } } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaTramoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaTramoHibernateDAO.java index 3ac6058d2..a00763952 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaTramoHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaTramoHibernateDAO.java @@ -8,6 +8,7 @@ import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.SessionFactory; +import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.hibernate.transform.AliasToBeanResultTransformer; import org.hibernate.type.ShortType; @@ -19,6 +20,7 @@ import org.springframework.stereotype.Repository; import com.rjconsultores.ventaboletos.dao.CorridaTramoDAO; import com.rjconsultores.ventaboletos.entidad.Corrida; import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.entidad.Tramo; import com.rjconsultores.ventaboletos.utilerias.ActivoUtil; @Repository("corridaTramoDAO") @@ -93,4 +95,15 @@ public class CorridaTramoHibernateDAO extends GenericHibernateDAO buscarTramoPorCorridaId(Integer corridaId) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", ActivoUtil.ATIVO)); + c.createAlias("corrida", "corrida"); + c.add(Restrictions.eq("corrida.id.corridaId", corridaId)); + c.setProjection(Projections.distinct(Projections.property("tramo"))); + + return c.list(); + } + } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingAsientoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingAsientoHibernateDAO.java new file mode 100644 index 000000000..01ae86a59 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingAsientoHibernateDAO.java @@ -0,0 +1,50 @@ +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.GP_PricingAsientoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingAsiento; +import com.rjconsultores.ventaboletos.entidad.Pricing; + +@Repository("gp_pricingAsientoDAO") +public class GP_PricingAsientoHibernateDAO extends GenericHibernateDAO + implements GP_PricingAsientoDAO { + + @Autowired + public GP_PricingAsientoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Pricing.ATIVO)); + + return c.list(); + } + + public List obtenerPricingCategoria(GP_Pricing pricing, Integer asiento) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("numeasiento", asiento.toString())); + + return c.list(); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingCategoriaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingCategoriaHibernateDAO.java new file mode 100644 index 000000000..779673d08 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingCategoriaHibernateDAO.java @@ -0,0 +1,54 @@ +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.GP_PricingCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCategoria; + +@Repository("gp_pricingCategoriaDAO") +public class GP_PricingCategoriaHibernateDAO extends GenericHibernateDAO + implements GP_PricingCategoriaDAO { + + @Autowired + public GP_PricingCategoriaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingCategoria(GP_Pricing pricing, Categoria categoria) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("categoria", categoria)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingClaseHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingClaseHibernateDAO.java new file mode 100644 index 000000000..8a2819be3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingClaseHibernateDAO.java @@ -0,0 +1,55 @@ +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.GP_PricingClaseDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingClase; + +@Repository("gp_pricingClaseDAO") +public class GP_PricingClaseHibernateDAO extends GenericHibernateDAO + implements GP_PricingClaseDAO { + + @Autowired + public GP_PricingClaseHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingClase(GP_Pricing pricing, ClaseServicio claseServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("claseServicio", claseServicio)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingClasseTarifariaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingClasseTarifariaHibernateDAO.java new file mode 100644 index 000000000..07a40e165 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingClasseTarifariaHibernateDAO.java @@ -0,0 +1,51 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.Query; +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.GP_PricingClasseTarifariaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingClasseTarifaria; + +@Repository("gp_pricingClasseTarifariaDAO") +public class GP_PricingClasseTarifariaHibernateDAO extends GenericHibernateDAO + implements GP_PricingClasseTarifariaDAO { + + @Autowired + public GP_PricingClasseTarifariaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @SuppressWarnings("unchecked") + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public Boolean validacionSigla(String sigla) { + + StringBuffer hql = new StringBuffer(); + hql.append(" FROM GP_PricingClasseTarifaria pct "); + hql.append(" WHERE pct.sigla = :sigla "); + hql.append(" AND pct.activo = :activo "); + + Query query = getSession().createQuery(hql.toString()); + query.setParameter("activo", Boolean.TRUE); + query.setParameter("sigla", sigla); + + if (query.list().isEmpty()) + return true; + else + return false; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingCorridaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingCorridaHibernateDAO.java new file mode 100644 index 000000000..451831888 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingCorridaHibernateDAO.java @@ -0,0 +1,54 @@ +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.GP_PricingCorridaDAO; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCorrida; + +@Repository("gp_pricingCorridaDAO") +public class GP_PricingCorridaHibernateDAO extends GenericHibernateDAO + implements GP_PricingCorridaDAO { + + @Autowired + public GP_PricingCorridaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingCorrida(GP_Pricing pricing, CorridaCtrl corrida) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("corridaCtrl", corrida)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingDiaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingDiaHibernateDAO.java new file mode 100644 index 000000000..35aaed7d1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingDiaHibernateDAO.java @@ -0,0 +1,71 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import org.apache.log4j.Logger; +import org.hibernate.Criteria; +import org.hibernate.Query; +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.GP_PricingDiaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingDia; +import com.rjconsultores.ventaboletos.entidad.Pricing; + +@Repository("gp_pricingDiaDAO") +public class GP_PricingDiaHibernateDAO extends GenericHibernateDAO + implements GP_PricingDiaDAO { + + private static Logger log = Logger.getLogger(GP_PricingDiaHibernateDAO.class); + + @Autowired + public GP_PricingDiaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Pricing.ATIVO)); + + return c.list(); + } + + public List buscarTraslapa(GP_PricingDia pricingDia) { + Date horarioinicio = pricingDia.getHorarioinicio(); + Date horariofin = pricingDia.getHorariofin(); + + SimpleDateFormat sf = new SimpleDateFormat("HHmm"); + + StringBuilder hql = new StringBuilder(); + hql.append("select pv from GP_PricingDia pv "); + hql.append(" where pv.activo = 1 "); + hql.append(" and pricing.pricingId = ").append(pricingDia.getPricing().getPricingId()); + hql.append(" and pv.horariofin >= :horariofin "); + hql.append(" and pv.horarioinicio >= :horarioinicio "); + + log.info("Hora Ini: " + sf.format(horarioinicio)); + log.info("Hora Fin: " + sf.format(horariofin)); + log.info("SQL: " + hql.toString()); + + Query sq = getSession().createQuery(hql.toString()); + sq.setParameter("horariofin", horariofin); + sq.setParameter("horarioinicio", horarioinicio); + + return sq.list(); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoAgenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoAgenciaHibernateDAO.java new file mode 100644 index 000000000..389219fe0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoAgenciaHibernateDAO.java @@ -0,0 +1,42 @@ +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.GP_PricingEspecificoAgenciaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoAgencia; + + +@Repository("gp_pricingEspecificoAgenciaDAO") +public class GP_PricingEspecificoAgenciaHibernateDAO extends GenericHibernateDAO implements GP_PricingEspecificoAgenciaDAO { + + @Autowired + public GP_PricingEspecificoAgenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @SuppressWarnings("unchecked") + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + @SuppressWarnings("unchecked") + @Override + public Boolean isDuplicado(GP_PricingEspecificoAgencia entidad) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("puntoVenta.puntoventaId", entidad.getPuntoVenta().getPuntoventaId())); + + return c.list().isEmpty(); + } +} + diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoCanalVendasHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoCanalVendasHibernateDAO.java new file mode 100644 index 000000000..cfca88517 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoCanalVendasHibernateDAO.java @@ -0,0 +1,42 @@ +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.GP_PricingEspecificoCanalVendasDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCanalVendas; + + +@Repository("gp_pricingEspecificoCanalVendasDAO") +public class GP_PricingEspecificoCanalVendasHibernateDAO extends GenericHibernateDAO implements GP_PricingEspecificoCanalVendasDAO { + + @Autowired + public GP_PricingEspecificoCanalVendasHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @SuppressWarnings("unchecked") + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + @SuppressWarnings("unchecked") + @Override + public Boolean isDuplicado(GP_PricingEspecificoCanalVendas entidad) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("tipoPtovta.tipoptovtaId", entidad.getTipoPtovta().getTipoptovtaId())); + + return c.list().isEmpty(); + } +} + diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoCategoriaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoCategoriaHibernateDAO.java new file mode 100644 index 000000000..e0040302b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoCategoriaHibernateDAO.java @@ -0,0 +1,40 @@ +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.GP_PricingEspecificoCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCategoria; + +@Repository("gp_pricingEspecificoCategoriaDAO") +public class GP_PricingEspecificoCategoriaHibernateDAO extends GenericHibernateDAO implements GP_PricingEspecificoCategoriaDAO { + + @Autowired + public GP_PricingEspecificoCategoriaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @SuppressWarnings("unchecked") + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public Boolean isDuplicado(GP_PricingEspecificoCategoria entidad) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("categoria.categoriaId", entidad.getCategoria().getCategoriaId())); + + return c.list().isEmpty(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoHibernateDAO.java new file mode 100644 index 000000000..861d9f1e2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoHibernateDAO.java @@ -0,0 +1,129 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.Date; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.Query; +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.GP_PricingEspecificoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecifico; +import com.rjconsultores.ventaboletos.entidad.Parada; + +/** + * + * @author Rafius + */ +@Repository("gp_pricingEspecificoDAO") +public class GP_PricingEspecificoHibernateDAO extends GenericHibernateDAO + implements GP_PricingEspecificoDAO { + + @Autowired + public GP_PricingEspecificoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + public List buscarPorNome(GP_PricingEspecifico pricingEspecifico) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombPricing", pricingEspecifico.getNombPricing())); + + return c.list(); + } + + @Override + public List buscarPorNome(String nome) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("nombPricing", nome)); + + return c.list(); + } + + @Override + public List buscar(List empresas, List tipoClasses, List origens, List destinos, Date vigenciaInicial, Date vigenciaFinal) { + + StringBuilder hql = new StringBuilder(); + hql.append("SELECT DISTINCT pe "); + hql.append("FROM GP_PricingEspecifico pe "); + hql.append(" WHERE pe.activo = 1 "); + + if (!empresas.isEmpty()) { + hql.append(" AND pe.marca.empresa.empresaId IN ("); + for (Empresa e : empresas) { + hql.append(e.getEmpresaId() + ","); + } + hql.deleteCharAt(hql.length() - 1); + hql.append(")"); + } + + if (!tipoClasses.isEmpty()) { + hql.append(" AND pe.claseServicio.claseservicioId IN ("); + for (ClaseServicio c : tipoClasses) { + hql.append(c.getClaseservicioId() + ","); + } + hql.deleteCharAt(hql.length() - 1); + hql.append(")"); + } + + if (!origens.isEmpty()) { + hql.append(" AND pe.parada.paradaId IN ("); + for (Parada o : origens) { + hql.append(o.getParadaId() + ","); + } + hql.deleteCharAt(hql.length() - 1); + hql.append(")"); + } + + if (!destinos.isEmpty()) { + hql.append(" AND pe.parada1.paradaId IN ("); + for (Parada o : origens) { + hql.append(o.getParadaId() + ","); + } + hql.deleteCharAt(hql.length() - 1); + hql.append(")"); + } + + if (vigenciaInicial != null) { + hql.append(" AND YEAR(pe.fechorinicio) >= YEAR(:vigenciaInicial) "); + hql.append(" AND MONTH(pe.fechorinicio)>= MONTH(:vigenciaInicial) "); + hql.append(" AND DAY(pe.fechorinicio) >= DAY(:vigenciaInicial) "); + } + + if (vigenciaFinal != null) { + hql.append(" AND YEAR(pe.fechorfin) <= YEAR(:vigenciaFinal) "); + hql.append(" AND MONTH(pe.fechorfin) <= MONTH(:vigenciaFinal) "); + hql.append(" AND DAY(pe.fechorfin) <= DAY(:vigenciaFinal) "); + } + + Query query = getSession().createQuery(hql.toString()); + + if (vigenciaInicial != null) { + query.setDate("vigenciaInicial", vigenciaInicial); + } + if (vigenciaFinal != null) { + query.setDate("vigenciaFinal", vigenciaFinal); + } + + return query.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoOcupacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoOcupacionHibernateDAO.java new file mode 100644 index 000000000..f7775457f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingEspecificoOcupacionHibernateDAO.java @@ -0,0 +1,32 @@ +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.GP_PricingEspecificoOcupacionDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoOcupacion; + + +@Repository("gp_pricingEspecificoOcupacionDAO") +public class GP_PricingEspecificoOcupacionHibernateDAO extends GenericHibernateDAO implements GP_PricingEspecificoOcupacionDAO { + + @Autowired + public GP_PricingEspecificoOcupacionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @SuppressWarnings("unchecked") + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingFormapagoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingFormapagoHibernateDAO.java new file mode 100644 index 000000000..ee543a2a1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingFormapagoHibernateDAO.java @@ -0,0 +1,32 @@ +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.GP_PricingFormapagoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingFormapago; + +@Repository("gp_pricingFormapagoDAO") +public class GP_PricingFormapagoHibernateDAO extends GenericHibernateDAO implements GP_PricingFormapagoDAO { + + @Autowired + public GP_PricingFormapagoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingGestaoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingGestaoHibernateDAO.java new file mode 100644 index 000000000..82b122ee8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingGestaoHibernateDAO.java @@ -0,0 +1,33 @@ +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.GP_PricingGestaoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingGestao; + +@Repository("gp_pricingGestaoDAO") +public class GP_PricingGestaoHibernateDAO extends GenericHibernateDAO + implements GP_PricingGestaoDAO { + + @Autowired + public GP_PricingGestaoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingHibernateDAO.java new file mode 100644 index 000000000..6bdc013b6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingHibernateDAO.java @@ -0,0 +1,156 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.math.BigDecimal; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.Query; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.hibernate.transform.AliasToBeanResultTransformer; +import org.hibernate.type.BigDecimalType; +import org.hibernate.type.StringType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.GP_PricingDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingRevisaoValoresVO; + +@Repository("gp_pricingDAO") +public class GP_PricingHibernateDAO extends GenericHibernateDAO + implements GP_PricingDAO { + + @Autowired + public GP_PricingHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public List buscar(String nombPricing, Empresa empresa, + Short cantboleto, Integer cantdiasanticipacion, + BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + c.add(Restrictions.eq("nombPricing", nombPricing)); + c.add(Restrictions.eq("empresa", empresa)); + c.add(Restrictions.eq("cantboleto", cantboleto)); + c.add(Restrictions.eq("cantdiasanticipacion", cantdiasanticipacion)); + if (descuentoporcentaje != null) { + c.add(Restrictions.eq("descuentoporcentaje", descuentoporcentaje)); + } + if (descuentoporcredondo != null) { + c.add(Restrictions.eq("descuentoporcredondo", descuentoporcredondo)); + } + + return c.list(); + } + + public List buscarPorNombre(String nombPricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + c.add(Restrictions.eq("nombPricing", nombPricing)); + + return c.list(); + } + + @Override + public List buscarPricingRevisaoValoresVO(List classeServicioIds,List marcaIds, List rutaIds, List tramoIds, List lsPricingVigencia) { + StringBuilder sql = new StringBuilder(); + sql.append(" SELECT distinct "); + sql.append(" porigen.descparada \"origem\", "); + sql.append(" pdestino.descparada \"destino\", "); + sql.append(" cs.descclase \"classeServico\", "); + sql.append(" coalesce(t.precio,0) + coalesce(t.importetaxaembarque,0) + coalesce(t.importepedagio,0) "); + sql.append(" + coalesce(t.importeseguro,0) + coalesce(t.importeoutros,0) \"precioAtual\", "); + sql.append(" coalesce(t.precio,0) \"tarifaAtual\", "); + sql.append(" coalesce(t.importetaxaembarque,0) \"taxaEmbarque\", "); + sql.append(" coalesce(t.importepedagio,0) \"pedagio\", "); + sql.append(" coalesce(t.importeseguro,0) \"seguro\", "); + sql.append(" coalesce(t.importeoutros,0) \"outros\" "); + sql.append(" FROM tarifa t "); + sql.append(" join tramo tr on tr.tramo_id = t.tramo_id "); + sql.append(" join parada pOrigen on porigen.parada_id = tr.origen_id "); + sql.append(" join parada pDestino on pDestino.parada_id = tr.destino_id "); + sql.append(" join clase_servicio cs on cs.claseservicio_id = t.claseservicio_id "); + sql.append(" join vigencia_tarifa vt on vt.vigenciatarifa_id = t.vigenciatarifa_id "); + sql.append(" join marca m on m.marca_id = t.marca_id "); + sql.append(" join ruta r on t.ruta_id = r.ruta_id "); + sql.append(" where "); + sql.append(" t.activo = 1 "); + sql.append(" and vt.activo = 1 "); + sql.append(" and tr.activo = 1 "); + if(lsPricingVigencia!= null && !lsPricingVigencia.isEmpty()) { + sql.append(" and (" ); + for (int i = 1; i <= lsPricingVigencia.size(); i++) { + sql.append(" (:dataInicioPricing between vt.feciniciovigencia and vt.fecfinvigencia "); + sql.append(" or :dataFimPricing between vt.feciniciovigencia and vt.fecfinvigencia) "); + if(i < lsPricingVigencia.size()) { + sql.append(" or "); + } + } + sql.append(" )" ); + } + + if (classeServicioIds != null && !classeServicioIds.isEmpty()) { + sql.append(" and cs.claseservicio_id in(:listClasseServicioId) "); + } + if(tramoIds != null && !tramoIds.isEmpty()) { + sql.append(" and tr.tramo_id in (:listTramoId) "); + } + if (marcaIds != null && !marcaIds.isEmpty()) { + sql.append(" and m.marca_id in(:listMarcaId) "); + } + if (rutaIds != null && !rutaIds.isEmpty()) { + sql.append(" and r.ruta_id in(:listRutaId) "); + } + + Query query = getSession().createSQLQuery(sql.toString()) + .addScalar("origem",StringType.INSTANCE) + .addScalar("destino",StringType.INSTANCE) + .addScalar("classeServico", StringType.INSTANCE) + .addScalar("precioAtual", BigDecimalType.INSTANCE) + .addScalar("tarifaAtual", BigDecimalType.INSTANCE) + .addScalar("taxaEmbarque", BigDecimalType.INSTANCE) + .addScalar("pedagio", BigDecimalType.INSTANCE) + .addScalar("seguro", BigDecimalType.INSTANCE) + .addScalar("outros", BigDecimalType.INSTANCE) + .setResultTransformer(new AliasToBeanResultTransformer(GP_PricingRevisaoValoresVO.class)); + + if(lsPricingVigencia!= null && !lsPricingVigencia.isEmpty()) { + for (GP_PricingVigencia pricingVigencia:lsPricingVigencia) { + query.setDate("dataInicioPricing", pricingVigencia.getFecinicioventa()); + query.setDate("dataFimPricing", pricingVigencia.getFecfinventa()); + } + } + + if (classeServicioIds != null && !classeServicioIds.isEmpty()) { + query.setParameterList("listClasseServicioId", classeServicioIds); + } + if(tramoIds != null && !tramoIds.isEmpty()) { + query.setParameterList("listTramoId", tramoIds); + } + if (marcaIds != null && !marcaIds.isEmpty()) { + query.setParameterList("listMarcaId", marcaIds); + } + if (rutaIds != null && !rutaIds.isEmpty()) { + query.setParameterList("listRutaId", rutaIds); + } + + query.setFetchSize(1000); + return query.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingHistoricoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingHistoricoHibernateDAO.java new file mode 100644 index 000000000..1e1c93dde --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingHistoricoHibernateDAO.java @@ -0,0 +1,21 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import org.hibernate.SessionFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.GP_PricingHistoricoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingHistorico; + + +@Repository("gp_pricingHistoricoDAO") +public class GP_PricingHistoricoHibernateDAO extends GenericHibernateDAO implements GP_PricingHistoricoDAO { + + @Autowired + public GP_PricingHistoricoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + +} + diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingImporteHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingImporteHibernateDAO.java new file mode 100644 index 000000000..4777fbcc1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingImporteHibernateDAO.java @@ -0,0 +1,50 @@ +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.GP_PricingImporteDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingImporte; +import com.rjconsultores.ventaboletos.entidad.Moneda; + +@Repository("gp_pricingImporteDAO") +public class GP_PricingImporteHibernateDAO extends GenericHibernateDAO + implements GP_PricingImporteDAO { + + @Autowired + public GP_PricingImporteHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public List buscarMoneda(GP_PricingImporte pricingImporte, Moneda moneda) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricingImporte.getPricing())); + c.add(Restrictions.eq("moneda", moneda)); + + return c.list(); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingMarcaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingMarcaHibernateDAO.java new file mode 100644 index 000000000..3dc6800ae --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingMarcaHibernateDAO.java @@ -0,0 +1,54 @@ +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.GP_PricingMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMarca; +import com.rjconsultores.ventaboletos.entidad.Marca; + +@Repository("gp_pricingMarcaDAO") +public class GP_PricingMarcaHibernateDAO extends GenericHibernateDAO + implements GP_PricingMarcaDAO { + + @Autowired + public GP_PricingMarcaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingMarca(GP_Pricing pricing, Marca marca) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("marca", marca)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingMercadoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingMercadoHibernateDAO.java new file mode 100644 index 000000000..4a78dd7c1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingMercadoHibernateDAO.java @@ -0,0 +1,55 @@ +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.GP_PricingMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMercado; +import com.rjconsultores.ventaboletos.entidad.Parada; + +@Repository("gp_pricingMercadoDAO") +public class GP_PricingMercadoHibernateDAO extends GenericHibernateDAO + implements GP_PricingMercadoDAO { + + @Autowired + public GP_PricingMercadoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingMercado(GP_Pricing pricing, Parada origen, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("origen", origen)); + c.add(Restrictions.eq("destino", destino)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingOcupaAntecipaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingOcupaAntecipaHibernateDAO.java new file mode 100644 index 000000000..1f97bd63f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingOcupaAntecipaHibernateDAO.java @@ -0,0 +1,67 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.ArrayList; +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.GP_PricingOcupaAntecipaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingOcupaAntecipa; + +@Repository("gp_pricingOcupacionDAO") +public class GP_PricingOcupaAntecipaHibernateDAO extends GenericHibernateDAO + implements GP_PricingOcupaAntecipaDAO { + + @Autowired + public GP_PricingOcupaAntecipaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + return c.list(); + } + + @Override + public List buscarOcupaAntecipaPricing(Integer pricingId) { + return buscarOcupaAntecipaPricing(pricingId, GP_Pricing.ATIVO, GP_Pricing.INATIVO); + } + + @Override + public List buscarOcupaAntecipaPricingAtivos(Integer pricingId) { + return buscarOcupaAntecipaPricing(pricingId, GP_Pricing.ATIVO, null); + } + + private List buscarOcupaAntecipaPricing(Integer pricingId, Integer ativo, Integer inativo) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + List pricingStatus = new ArrayList(); + if(ativo != null) { + pricingStatus.add(ativo); + } + if(inativo != null) { + pricingStatus.add(inativo); + } + + c.add(Restrictions.in("activo", pricingStatus)); + c.add(Restrictions.eq("pricing.pricingId", pricingId)); + + return c.list(); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingPuntoVentaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingPuntoVentaHibernateDAO.java new file mode 100644 index 000000000..40a300bc0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingPuntoVentaHibernateDAO.java @@ -0,0 +1,54 @@ +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.GP_PricingPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; + +@Repository("gp_pricingPuntoVentaDAO") +public class GP_PricingPuntoVentaHibernateDAO extends GenericHibernateDAO + implements GP_PricingPuntoVentaDAO { + + @Autowired + public GP_PricingPuntoVentaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingPuntoVenta(GP_Pricing pricing, PuntoVenta puntoVenta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("puntoVenta", puntoVenta)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingRutaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingRutaHibernateDAO.java new file mode 100644 index 000000000..2af54c600 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingRutaHibernateDAO.java @@ -0,0 +1,54 @@ +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.GP_PricingRutaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; + +@Repository("gp_pricingRutaDAO") +public class GP_PricingRutaHibernateDAO extends GenericHibernateDAO + implements GP_PricingRutaDAO { + + @Autowired + public GP_PricingRutaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingRuta(GP_Pricing pricing, Ruta ruta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("ruta", ruta)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingTipoPtoVtaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingTipoPtoVtaHibernateDAO.java new file mode 100644 index 000000000..03c1598b3 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingTipoPtoVtaHibernateDAO.java @@ -0,0 +1,54 @@ +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.GP_PricingTipoPtoVtaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; + +@Repository("gp_pricingTipoPtoVtaDAO") +public class GP_PricingTipoPtoVtaHibernateDAO extends GenericHibernateDAO + implements GP_PricingTipoPtoVtaDAO { + + @Autowired + public GP_PricingTipoPtoVtaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingTipoPuntoVenta(GP_Pricing pricing, TipoPuntoVenta tipoPuntoVenta) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("tipoPtovta", tipoPuntoVenta)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingTipoServicioHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingTipoServicioHibernateDAO.java new file mode 100644 index 000000000..07a98ed14 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingTipoServicioHibernateDAO.java @@ -0,0 +1,54 @@ +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.GP_PricingTipoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; + +@Repository("gp_pricingTipoServicioDAO") +public class GP_PricingTipoServicioHibernateDAO extends GenericHibernateDAO + implements GP_PricingTipoServicioDAO { + + @Autowired + public GP_PricingTipoServicioHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + public Boolean obtenerPricingTipoServicio(GP_Pricing pricing, TipoServicio tipoServicio) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.eq("pricing", pricing)); + c.add(Restrictions.eq("tipoServicio", tipoServicio)); + + if (c.list().size() > 0) { + return true; + } else { + return false; + } + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingVigenciaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingVigenciaHibernateDAO.java new file mode 100644 index 000000000..e6c7b5b7e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/GP_PricingVigenciaHibernateDAO.java @@ -0,0 +1,83 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.Calendar; +import java.util.Date; +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.GP_PricingVigenciaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; + +@Repository("gp_pricingVigenciaDAO") +public class GP_PricingVigenciaHibernateDAO extends GenericHibernateDAO + implements GP_PricingVigenciaDAO { + + @Autowired + public GP_PricingVigenciaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + return c.list(); + } + + @Override + public List buscarPorVigencias(GP_PricingVigencia pv) { + Criteria c = getSession().createCriteria(getPersistentClass()); + + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + + c.add(Restrictions.eq("pricing", pv.getPricing())); + + Date fecinicioventa = pv.getFecinicioventa(); + Date fecfinventa = pv.getFecfinventa(); + + c.add(Restrictions.or(Restrictions.between("fecinicioventa", fecinicioventa, fecfinventa), + (Restrictions.between("fecfinventa", fecinicioventa, fecfinventa)))); + + return c.list(); + } + + @Override + public Boolean podeSalvar(GP_Pricing pricing, GP_PricingVigencia pricingVigencia, Date inicio, Date fim) { + Calendar fecInicio = Calendar.getInstance(); + fecInicio.setTime(inicio); + fecInicio.set(Calendar.MILLISECOND, 0); + fecInicio.set(Calendar.SECOND, 0); + + Calendar fecFin = Calendar.getInstance(); + fecFin.setTime(fim); + fecFin.set(Calendar.MILLISECOND, 0); + fecFin.set(Calendar.SECOND, 0); + + Criteria c = this.getSession().createCriteria(GP_PricingVigencia.class); + c.add(Restrictions.eq("activo", GP_Pricing.ATIVO)); + c.add(Restrictions.ge("fecfinviaje", fecInicio.getTime())); + c.add(Restrictions.le("fecinicioviaje", fecFin.getTime())); + c.add(Restrictions.eq("pricing", pricing)); + if (pricingVigencia.getPricingvigenciaId() != null) { + c.add(Restrictions.ne("pricingvigenciaId", pricingVigencia.getPricingvigenciaId())); + } + + return c.list().isEmpty(); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("pricing.pricingId", pricing.getPricingId())); + + return c.list(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoHibernateDAO.java index 9b8d74fd6..a777dacc5 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TramoHibernateDAO.java @@ -285,4 +285,15 @@ public class TramoHibernateDAO extends GenericHibernateDAO return query.list(); } + + @Override + public List obtenerTramosPorOrigemDestino(Parada origem, Parada destino) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("origem", origem)); + c.add(Restrictions.eq("destino", destino)); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + + return c.list(); + } } diff --git a/src/com/rjconsultores/ventaboletos/entidad/ClaseServicio.java b/src/com/rjconsultores/ventaboletos/entidad/ClaseServicio.java index d73d487d8..89106c37b 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/ClaseServicio.java +++ b/src/com/rjconsultores/ventaboletos/entidad/ClaseServicio.java @@ -292,5 +292,10 @@ public class ClaseServicio implements Serializable, Auditavel { public void setTipoDescontoMonitrip(TipoClasseServicoBPe tipoClasseServicoBPe) { this.tipoDescontoMonitrip = tipoClasseServicoBPe; } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } } \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_Pricing.java b/src/com/rjconsultores/ventaboletos/entidad/GP_Pricing.java new file mode 100644 index 000000000..5296bcb52 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_Pricing.java @@ -0,0 +1,845 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + + +@Entity +@SequenceGenerator(name = "GP_PRICING_SEQ", sequenceName = "GP_PRICING_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING") +public class GP_Pricing implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + public static final Integer ATIVO = 1; + public static final Integer INATIVO = 2; + public static final Integer EXCLUIDO = 0; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_SEQ") + @Column(name = "PRICING_ID") + private Integer pricingId; + + @Column(name = "NOMBPRICING") + private String nombPricing; + + @Column(name = "CANTBOLETO") + private Short cantboleto; + + @Column(name = "DESCUENTOPORCENTAJE") + private BigDecimal descuentoporcentaje; + + @Column(name = "DESCUENTOPORCREDONDO") + private BigDecimal descuentoporcredondo; + + @Column(name = "INDTRANSFERIBLE") + private Boolean indtransferible; + + @Column(name = "INDRESERVABLE") + private Boolean indreservable; + + @Column(name = "EXIBEVENDA") + private Boolean exibeVenda; + + @Column(name = "INDCANCELABLE") + private Boolean indcancelable; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @Column(name = "CANTDIASANTICIPACION") + private Integer cantdiasanticipacion; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingAsientoList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingMercadoList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingMarcaList; + + @JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID") + @ManyToOne + private Empresa empresa; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingRutaList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingDiaList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingImporteList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingTipoptovtaList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingCategoriaList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingVigenciaList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingClaseList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingCorridaList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingPuntoventaList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingTipoServicioList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingOcupaAntecipaList; + + @OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL) + private List pricingFormapagoList; + + @Column(name = "INDGENERAFERIADOVIAJE") + private String indGeneraFeriadoViaje; + + @Column(name = "INDGENERAFERIADOVENTA") + private String indGeneraFeriadoVenta; + + @Column(name = "COLOR") + private String color; + + @Column(name = "INDSOBREPOSICAO") + private Boolean indSobreposicao; + + @Column(name = "INDGESTAO") + private Boolean indGestao; + + @Column(name = "INDAGRUPADODIA") + private Boolean indAgrupadoDia; + + @Column(name = "INDAGRUPADOSERVICO") + private Boolean indAgrupadoServico; + + @Column(name = "INDESTADIAMINIMA") + private Boolean indestadiaminima; + + @Column(name = "CANTDIAS_ESTADIAMINIMA") + private Integer cantdiasEstadiaminima; + + @Column(name = "INDLUN_ESTADIAMINIMA") + private Boolean indLunEstadiaminima; + + @Column(name = "INDMAR_ESTADIAMINIMA") + private Boolean indMarEstadiaminima; + + @Column(name = "INDMIE_ESTADIAMINIMA") + private Boolean indMieEstadiaminima; + + @Column(name = "INDJUE_ESTADIAMINIMA") + private Boolean indJueEstadiaminima; + + @Column(name = "INDVIE_ESTADIAMINIMA") + private Boolean indVieEstadiaminima; + + @Column(name = "INDSAB_ESTADIAMINIMA") + private Boolean indSabEstadiaminima; + + @Column(name = "INDDOM_ESTADIAMINIMA") + private Boolean indDomEstadiaminima; + + public enum GerarFeriado { + // Declaração dos enum + GERARSEMPRE("GERAR SEMPRE", "S"), + + GERARQUANDOFERIADO("GERAR SÓ QUANDO FOR FERIADO", "F"), + + GERARQUANDONAOFERIADO("GERAR QUANDO NÃO FOR FERIADO", "N"); + + // Definição das constantes + public final String valor; + public final String descricao; + + public String valor() { + return this.valor; + } + + public String descricao() { + return this.descricao; + } + + private GerarFeriado(String descricao, String valor) { + this.descricao = descricao; + this.valor = valor; + } + } + + public GP_Pricing() { + } + + public GP_Pricing(Integer pricingId) { + this.pricingId = pricingId; + } + + public Integer getPricingId() { + return pricingId; + } + + public void setPricingId(Integer pricingId) { + this.pricingId = pricingId; + } + + public Short getCantboleto() { + return cantboleto; + } + + public Integer getCantdiasanticipacion() { + return cantdiasanticipacion; + } + + public void setCantdiasanticipacion(Integer cantdiasanticipacion) { + this.cantdiasanticipacion = cantdiasanticipacion; + } + + public void setCantboleto(Short cantboleto) { + this.cantboleto = cantboleto; + } + + public BigDecimal getDescuentoporcentaje() { + return descuentoporcentaje; + } + + public void setDescuentoporcentaje(BigDecimal descuentoporcentaje) { + this.descuentoporcentaje = descuentoporcentaje; + } + + public BigDecimal getDescuentoporcredondo() { + return descuentoporcredondo; + } + + public void setDescuentoporcredondo(BigDecimal descuentoporcredondo) { + this.descuentoporcredondo = descuentoporcredondo; + } + + public Boolean getIndtransferible() { + return indtransferible; + } + + public void setIndtransferible(Boolean indtransferible) { + this.indtransferible = indtransferible; + } + + public Boolean getIndreservable() { + return indreservable; + } + + public void setIndreservable(Boolean indreservable) { + this.indreservable = indreservable; + } + + public Boolean getIndcancelable() { + return indcancelable; + } + + public void setIndcancelable(Boolean indcancelable) { + this.indcancelable = indcancelable; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public List getPricingOcupaAntecipaList() { + List poaList = new ArrayList(); + for (GP_PricingOcupaAntecipa poa : this.pricingOcupaAntecipaList) { + if (poa.getActivo() != EXCLUIDO.intValue()) { + poaList.add(poa); + } + } + return poaList; + } + + public void setPricingOcupaAntecipaList(List pricingOcupaAntecipaList) { + this.pricingOcupaAntecipaList = pricingOcupaAntecipaList; + } + + public List getPricingAsientoList() { + List paList = new ArrayList(); + for (GP_PricingAsiento pa : this.pricingAsientoList) { + if (pa.getActivo() != EXCLUIDO.intValue()) { + paList.add(pa); + } + } + + return paList; + } + + public void setPricingAsientoList(List pricingAsientoList) { + this.pricingAsientoList = pricingAsientoList; + } + + public List getPricingMercadoList() { + List pmList = new ArrayList(); + for (GP_PricingMercado pm : this.pricingMercadoList) { + if (pm.getActivo() != EXCLUIDO.intValue()) { + pmList.add(pm); + } + } + + return pmList; + } + + public void setPricingMercadoList(List pricingMercadoList) { + this.pricingMercadoList = pricingMercadoList; + } + + public List getPricingMarcaList() { + List pmList = new ArrayList(); + for (GP_PricingMarca pm : this.pricingMarcaList) { + if (pm.getActivo() != EXCLUIDO.intValue()) { + pmList.add(pm); + } + } + + return pmList; + } + + public void setPricingMarcaList(List pricingMarcaList) { + this.pricingMarcaList = pricingMarcaList; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public List getPricingRutaList() { + List prList = new ArrayList(); + for (GP_PricingRuta pr : this.pricingRutaList) { + if (pr.getActivo() != EXCLUIDO.intValue()) { + prList.add(pr); + } + } + + return prList; + } + + public void setPricingRutaList(List pricingRutaList) { + this.pricingRutaList = pricingRutaList; + } + + public List getPricingDiaList() { + List pdList = new ArrayList(); + for (GP_PricingDia pd : this.pricingDiaList) { + if (pd.getActivo() != EXCLUIDO.intValue()) { + pdList.add(pd); + } + } + + return pdList; + } + + public void setPricingDiaList(List pricingDiaList) { + this.pricingDiaList = pricingDiaList; + } + + public List getPricingImporteList() { + List piList = new ArrayList(); + for (GP_PricingImporte pi : this.pricingImporteList) { + if (pi.getActivo() != EXCLUIDO.intValue()) { + piList.add(pi); + } + } + + return piList; + } + + public void setPricingImporteList(List pricingImporteList) { + this.pricingImporteList = pricingImporteList; + } + + public List getPricingTipoptovtaList() { + List ptList = new ArrayList(); + for (GP_PricingTipoPtoVta pt : this.pricingTipoptovtaList) { + if (pt.getActivo() != EXCLUIDO.intValue()) { + ptList.add(pt); + } + } + + return ptList; + } + + public void setPricingTipoptovtaList(List pricingTipoptovtaList) { + this.pricingTipoptovtaList = pricingTipoptovtaList; + } + + public List getPricingCategoriaList() { + List pcList = new ArrayList(); + for (GP_PricingCategoria pc : this.pricingCategoriaList) { + if (pc.getActivo() != EXCLUIDO.intValue()) { + pcList.add(pc); + } + } + + return pcList; + } + + public void setPricingCategoriaList(List pricingCategoriaList) { + this.pricingCategoriaList = pricingCategoriaList; + } + + public List getPricingVigenciaList() { + List pvList = new ArrayList(); + if (this.pricingVigenciaList != null) { + for (GP_PricingVigencia pv : this.pricingVigenciaList) { + if (pv.getActivo() != EXCLUIDO.intValue()) { + pvList.add(pv); + } + } + } + + return pvList; + } + + public void setPricingVigenciaList(List pricingVigenciaList) { + this.pricingVigenciaList = pricingVigenciaList; + } + + public List getPricingClaseList() { + List pcList = new ArrayList(); + for (GP_PricingClase pc : this.pricingClaseList) { + if (pc.getActivo() != EXCLUIDO.intValue()) { + pcList.add(pc); + } + } + + return pcList; + } + + public void setPricingClaseList(List pricingClaseList) { + this.pricingClaseList = pricingClaseList; + } + + public List getPricingCorridaList() { + List pcList = new ArrayList(); + if (pricingCorridaList == null) { + return null; + } + + for (GP_PricingCorrida pc : this.pricingCorridaList) { + if (pc.getActivo() != EXCLUIDO.intValue()) { + pcList.add(pc); + } + } + + return pcList; + } + + public void setPricingCorridaList(List pricingCorridaList) { + this.pricingCorridaList = pricingCorridaList; + } + + public List getPricingPuntoventaList() { + List ppList = new ArrayList(); + for (GP_PricingPuntoVenta pp : this.pricingPuntoventaList) { + if (pp.getActivo() != EXCLUIDO.intValue()) { + ppList.add(pp); + } + } + + return ppList; + } + + public void setPricingPuntoventaList(List pricingPuntoventaList) { + this.pricingPuntoventaList = pricingPuntoventaList; + } + + public List getPricingTipoServicioList() { + List ppList = new ArrayList(); + for (GP_PricingTipoServicio pp : this.pricingTipoServicioList) { + if (pp.getActivo() != EXCLUIDO.intValue()) { + ppList.add(pp); + } + } + + return ppList; + } + + public void setPricingTipoServicioList(List pricingTipoServicioList) { + this.pricingTipoServicioList = pricingTipoServicioList; + } + + public List getPricingFormapagoList() { + List pfpList = new ArrayList(); + for (GP_PricingFormapago pfp : this.pricingFormapagoList) { + if (pfp.getActivo() != EXCLUIDO.intValue()) { + pfpList.add(pfp); + } + } + + return pfpList; + } + + public void setPricingFormapagoList(List pricingFormapagoList) { + this.pricingFormapagoList = pricingFormapagoList; + } + + public String getIndGeneraFeriadoViaje() { + return indGeneraFeriadoViaje; + } + + public void setIndGeneraFeriadoViaje(String indGeneraFeriadoViaje) { + this.indGeneraFeriadoViaje = indGeneraFeriadoViaje; + } + + public String getIndGeneraFeriadoVenta() { + return indGeneraFeriadoVenta; + } + + public void setIndGeneraFeriadoVenta(String indGeneraFeriadoVenta) { + this.indGeneraFeriadoVenta = indGeneraFeriadoVenta; + } + + public String getNombPricing() { + return nombPricing; + } + + public void setNombPricing(String nombPricing) { + this.nombPricing = nombPricing; + } + + public Boolean getExibeVenda() { + return exibeVenda; + } + + public void setExibeVenda(Boolean exibeVenda) { + this.exibeVenda = exibeVenda; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public Boolean getIndSobreposicao() { + return indSobreposicao; + } + + public void setIndSobreposicao(Boolean indSobreposicao) { + this.indSobreposicao = indSobreposicao; + } + + public Boolean getIndGestao() { + return indGestao; + } + + public void setIndGestao(Boolean indGestao) { + this.indGestao = indGestao; + } + + public Boolean getIndAgrupadoDia() { + return indAgrupadoDia; + } + + public void setIndAgrupadoDia(Boolean indAgrupadoDia) { + this.indAgrupadoDia = indAgrupadoDia; + } + + public Boolean getIndAgrupadoServico() { + return indAgrupadoServico; + } + + public void setIndAgrupadoServico(Boolean indAgrupadoServico) { + this.indAgrupadoServico = indAgrupadoServico; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingId != null ? pricingId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_Pricing)) { + return false; + } + GP_Pricing other = (GP_Pricing) object; + if ((this.pricingId == null && other.pricingId != null) || (this.pricingId != null && !this.pricingId.equals(other.pricingId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "[ Id=" + pricingId + ", nome=" + nombPricing + "]"; + } + + public Boolean getIndestadiaminima() { + return indestadiaminima; + } + + public void setIndestadiaminima(Boolean indestadiaminima) { + this.indestadiaminima = indestadiaminima; + } + + public Integer getCantdiasEstadiaminima() { + return cantdiasEstadiaminima; + } + + public void setCantdiasEstadiaminima(Integer cantdiasEstadiaminima) { + this.cantdiasEstadiaminima = cantdiasEstadiaminima; + } + + public Boolean getIndLunEstadiaminima() { + return indLunEstadiaminima; + } + + public void setIndLunEstadiaminima(Boolean indLunEstadiaminima) { + this.indLunEstadiaminima = indLunEstadiaminima; + } + + public Boolean getIndMarEstadiaminima() { + return indMarEstadiaminima; + } + + public void setIndMarEstadiaminima(Boolean indMarEstadiaminima) { + this.indMarEstadiaminima = indMarEstadiaminima; + } + + public Boolean getIndMieEstadiaminima() { + return indMieEstadiaminima; + } + + public void setIndMieEstadiaminima(Boolean indMieEstadiaminima) { + this.indMieEstadiaminima = indMieEstadiaminima; + } + + public Boolean getIndJueEstadiaminima() { + return indJueEstadiaminima; + } + + public void setIndJueEstadiaminima(Boolean indJueEstadiaminima) { + this.indJueEstadiaminima = indJueEstadiaminima; + } + + public Boolean getIndVieEstadiaminima() { + return indVieEstadiaminima; + } + + public void setIndVieEstadiaminima(Boolean indVieEstadiaminima) { + this.indVieEstadiaminima = indVieEstadiaminima; + } + + public Boolean getIndSabEstadiaminima() { + return indSabEstadiaminima; + } + + public void setIndSabEstadiaminima(Boolean indSabEstadiaminima) { + this.indSabEstadiaminima = indSabEstadiaminima; + } + + public Boolean getIndDomEstadiaminima() { + return indDomEstadiaminima; + } + + public void setIndDomEstadiaminima(Boolean indDomEstadiaminima) { + this.indDomEstadiaminima = indDomEstadiaminima; + } + + public GP_Pricing clonar() throws CloneNotSupportedException { + GP_Pricing novo = new GP_Pricing(); + + novo = (GP_Pricing) super.clone(); + + novo.setEmpresa((Empresa) empresa.getCloneObject()); + + List auxGP_PricingAsientoList = new ArrayList(); + for (GP_PricingAsiento aux : pricingAsientoList) { + + GP_PricingAsiento obj = (GP_PricingAsiento) aux.clone(); + + auxGP_PricingAsientoList.add(obj); + } + novo.setPricingAsientoList(auxGP_PricingAsientoList); + + List auxGP_PricingCategoriaList = new ArrayList(); + for (GP_PricingCategoria aux : pricingCategoriaList) { + + GP_PricingCategoria obj = (GP_PricingCategoria) aux.clone(); + + auxGP_PricingCategoriaList.add(obj); + } + novo.setPricingCategoriaList(auxGP_PricingCategoriaList); + + List auxGP_PricingClaseList = new ArrayList(); + for (GP_PricingClase aux : pricingClaseList) { + + GP_PricingClase obj = (GP_PricingClase) aux.clone(); + + auxGP_PricingClaseList.add(obj); + } + novo.setPricingClaseList(auxGP_PricingClaseList); + + List auxGP_PricingCorridaList = new ArrayList(); + for (GP_PricingCorrida aux : pricingCorridaList) { + + GP_PricingCorrida obj = (GP_PricingCorrida) aux.clone(); + + auxGP_PricingCorridaList.add(obj); + } + novo.setPricingCorridaList(auxGP_PricingCorridaList); + + List auxGP_PricingDiaList = new ArrayList(); + for (GP_PricingDia aux : pricingDiaList) { + + GP_PricingDia obj = (GP_PricingDia) aux.clone(); + + auxGP_PricingDiaList.add(obj); + } + novo.setPricingDiaList(auxGP_PricingDiaList); + + List auxGP_PricingFormapagoList = new ArrayList(); + for (GP_PricingFormapago aux : pricingFormapagoList) { + + GP_PricingFormapago obj = (GP_PricingFormapago) aux.clone(); + + auxGP_PricingFormapagoList.add(obj); + } + novo.setPricingFormapagoList(auxGP_PricingFormapagoList); + + List auxGP_PricingImporteList = new ArrayList(); + for (GP_PricingImporte aux : pricingImporteList) { + + GP_PricingImporte obj = (GP_PricingImporte) aux.clone(); + + auxGP_PricingImporteList.add(obj); + } + novo.setPricingImporteList(auxGP_PricingImporteList); + + List auxGP_PricingMarcaList = new ArrayList(); + for (GP_PricingMarca aux : pricingMarcaList) { + + GP_PricingMarca obj = (GP_PricingMarca) aux.clone(); + + auxGP_PricingMarcaList.add(obj); + } + novo.setPricingMarcaList(auxGP_PricingMarcaList); + + List auxGP_PricingMercadoList = new ArrayList(); + for (GP_PricingMercado aux : pricingMercadoList) { + + GP_PricingMercado obj = (GP_PricingMercado) aux.clone(); + + auxGP_PricingMercadoList.add(obj); + } + novo.setPricingMercadoList(auxGP_PricingMercadoList); + + List auxGP_PricingOcupaAntecipaList = new ArrayList(); + for (GP_PricingOcupaAntecipa aux : pricingOcupaAntecipaList) { + + GP_PricingOcupaAntecipa obj = (GP_PricingOcupaAntecipa) aux.clone(); + + auxGP_PricingOcupaAntecipaList.add(obj); + } + novo.setPricingOcupaAntecipaList(auxGP_PricingOcupaAntecipaList); + + List auxGP_PricingVigenciaList = new ArrayList(); + for (GP_PricingVigencia aux : pricingVigenciaList) { + + GP_PricingVigencia obj = (GP_PricingVigencia) aux.clone(); + + auxGP_PricingVigenciaList.add(obj); + } + novo.setPricingVigenciaList(auxGP_PricingVigenciaList); + + List auxGP_PricingPuntoVentaList = new ArrayList(); + for (GP_PricingPuntoVenta aux : pricingPuntoventaList) { + + GP_PricingPuntoVenta obj = (GP_PricingPuntoVenta) aux.clone(); + + auxGP_PricingPuntoVentaList.add(obj); + } + novo.setPricingPuntoventaList(auxGP_PricingPuntoVentaList); + + List auxGP_PricingRutaList = new ArrayList(); + for (GP_PricingRuta aux : pricingRutaList) { + + GP_PricingRuta obj = (GP_PricingRuta) aux.clone(); + + auxGP_PricingRutaList.add(obj); + } + novo.setPricingRutaList(auxGP_PricingRutaList); + + List auxGP_PricingTipoPtoVtaList = new ArrayList(); + for (GP_PricingTipoPtoVta aux : pricingTipoptovtaList) { + + GP_PricingTipoPtoVta obj = (GP_PricingTipoPtoVta) aux.clone(); + + auxGP_PricingTipoPtoVtaList.add(obj); + } + novo.setPricingTipoptovtaList(auxGP_PricingTipoPtoVtaList); + + List auxGP_PricingTipoServicioList = new ArrayList(); + for (GP_PricingTipoServicio aux : pricingTipoServicioList) { + + GP_PricingTipoServicio obj = (GP_PricingTipoServicio) aux.clone(); + + auxGP_PricingTipoServicioList.add(obj); + } + novo.setPricingTipoServicioList(auxGP_PricingTipoServicioList); + + return novo; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingAsiento.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingAsiento.java new file mode 100644 index 000000000..ce7043149 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingAsiento.java @@ -0,0 +1,159 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + + + +@Entity +@SequenceGenerator(name = "GP_PRICING_ASIENTO_SEQ", sequenceName = "GP_PRICING_ASIENTO_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_ASIENTO") +public class GP_PricingAsiento implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_ASIENTO_SEQ") + @Column(name = "PRICINGASIENTO_ID") + private Integer pricingasientoId; + + @Column(name = "NUMEASIENTO") + private String numeasiento; + + @Column(name = "NOMBIMAGEN") + private String nombImagen; + + @Column(name = "PORCENTAJE") + private BigDecimal porcentaje; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + public GP_PricingAsiento() { + } + + public GP_PricingAsiento(Integer pricingasientoId) { + this.pricingasientoId = pricingasientoId; + } + + public Integer getPricingasientoId() { + return pricingasientoId; + } + + public void setPricingasientoId(Integer pricingasientoId) { + this.pricingasientoId = pricingasientoId; + } + + public String getNumeasiento() { + return numeasiento; + } + + public void setNumeasiento(String numeasiento) { + this.numeasiento = numeasiento; + } + + public BigDecimal getPorcentaje() { + return porcentaje; + } + + public void setPorcentaje(BigDecimal porcentaje) { + this.porcentaje = porcentaje; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public String getNombImagen() { + return nombImagen; + } + + public void setNombImagen(String nombImagen) { + this.nombImagen = nombImagen; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingasientoId != null ? pricingasientoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingAsiento)) { + return false; + } + GP_PricingAsiento other = (GP_PricingAsiento) object; + if ((this.pricingasientoId == null && other.pricingasientoId != null) || (this.pricingasientoId != null && !this.pricingasientoId.equals(other.pricingasientoId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return " [Poltrona=" + numeasiento + ", Porcentagem=" + porcentaje + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingCategoria.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingCategoria.java new file mode 100644 index 000000000..f3979629f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingCategoria.java @@ -0,0 +1,134 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_CATEGORIA_SEQ", sequenceName = "GP_PRICING_CATEGORIA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_CATEGORIA") +public class GP_PricingCategoria implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_CATEGORIA_SEQ") + @Column(name = "PRICINGCATEGORIA_ID") + private Integer pricingcategoriaId; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") + @ManyToOne + private Categoria categoria; + + public GP_PricingCategoria() { + } + + public GP_PricingCategoria(Integer pricingcategoriaId) { + this.pricingcategoriaId = pricingcategoriaId; + } + + public Integer getPricingcategoriaId() { + return pricingcategoriaId; + } + + public void setPricingcategoriaId(Integer pricingcategoriaId) { + this.pricingcategoriaId = pricingcategoriaId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingcategoriaId != null ? pricingcategoriaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingCategoria)) { + return false; + } + GP_PricingCategoria other = (GP_PricingCategoria) object; + if ((this.pricingcategoriaId == null && other.pricingcategoriaId != null) || (this.pricingcategoriaId != null && !this.pricingcategoriaId.equals(other.pricingcategoriaId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return " [ categoria=" + categoria.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingClase.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingClase.java new file mode 100644 index 000000000..424062680 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingClase.java @@ -0,0 +1,135 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + + +@Entity +@SequenceGenerator(name = "GP_PRICING_CLASE_SEQ", sequenceName = "GP_PRICING_CLASE_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_CLASE") +public class GP_PricingClase implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_CLASE_SEQ") + @Column(name = "PRICINGCLASE_ID") + private Integer pricingclaseId; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + public GP_PricingClase() { + } + + public GP_PricingClase(Integer pricingclaseId) { + this.pricingclaseId = pricingclaseId; + } + + public Integer getPricingclaseId() { + return pricingclaseId; + } + + public void setPricingclaseId(Integer pricingclaseId) { + this.pricingclaseId = pricingclaseId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingclaseId != null ? pricingclaseId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingClase)) { + return false; + } + GP_PricingClase other = (GP_PricingClase) object; + if ((this.pricingclaseId == null && other.pricingclaseId != null) || (this.pricingclaseId != null && !this.pricingclaseId.equals(other.pricingclaseId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return "[ CLASSE =" + claseServicio.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingClasseTarifaria.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingClasseTarifaria.java new file mode 100644 index 000000000..dbcddd3d9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingClasseTarifaria.java @@ -0,0 +1,127 @@ +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 = "GP_PRICING_CLAS_TAR_SEQ", sequenceName = "GP_PRICING_CLAS_TAR_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_CLASSE_TARIFARIA") +public class GP_PricingClasseTarifaria implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_CLAS_TAR_SEQ") + @Column(name = "PRICINGCLASSETARIFARIA_ID") + private Integer pricingClasseTarifariaId; + @Column(name = "DESCCLASSE_TARIFARIA") + private String descClasseTarifaria; + @Column(name = "SIGLA") + private String sigla; + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Integer getPricingClasseTarifariaId() { + return pricingClasseTarifariaId; + } + + public void setPricingClasseTarifariaId(Integer pricingClasseTarifariaId) { + this.pricingClasseTarifariaId = pricingClasseTarifariaId; + } + + public String getDescClasseTarifaria() { + return descClasseTarifaria; + } + + public void setDescClasseTarifaria(String descClasseTarifaria) { + this.descClasseTarifaria = descClasseTarifaria; + } + + public String getSigla() { + return sigla; + } + + public void setSigla(String sigla) { + this.sigla = sigla; + } + + 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 + ((pricingClasseTarifariaId == null) ? 0 : pricingClasseTarifariaId.hashCode()); + result = prime * result + ((sigla == null) ? 0 : sigla.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + GP_PricingClasseTarifaria other = (GP_PricingClasseTarifaria) obj; + if (pricingClasseTarifariaId == null) { + if (other.pricingClasseTarifariaId != null) + return false; + } else if (!pricingClasseTarifariaId.equals(other.pricingClasseTarifariaId)) + return false; + if (sigla == null) { + if (other.sigla != null) + return false; + } else if (!sigla.equals(other.sigla)) + return false; + return true; + } + + @Override + public String toString() { + return descClasseTarifaria + " - " + sigla; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingCorrida.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingCorrida.java new file mode 100644 index 000000000..f438912d1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingCorrida.java @@ -0,0 +1,132 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_CORRIDA_SEQ", sequenceName = "GP_PRICING_CORRIDA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_CORRIDA") +public class GP_PricingCorrida implements Serializable, Cloneable { + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_CORRIDA_SEQ") + @Column(name = "PRICINGCORRIDA_ID") + private Integer pricingcorridaId; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "CORRIDA_ID", referencedColumnName = "CORRIDA_ID") + @ManyToOne + private CorridaCtrl corridaCtrl; + + public GP_PricingCorrida() { + } + + public GP_PricingCorrida(Integer pricingcorridaId) { + this.pricingcorridaId = pricingcorridaId; + } + + public Integer getPricingcorridaId() { + return pricingcorridaId; + } + + public void setPricingcorridaId(Integer pricingcorridaId) { + this.pricingcorridaId = pricingcorridaId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public CorridaCtrl getCorridaCtrl() { + return corridaCtrl; + } + + public void setCorridaCtrl(CorridaCtrl corridaCtrl) { + this.corridaCtrl = corridaCtrl; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingcorridaId != null ? pricingcorridaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingCorrida)) { + return false; + } + GP_PricingCorrida other = (GP_PricingCorrida) object; + if ((this.pricingcorridaId == null && other.pricingcorridaId != null) || (this.pricingcorridaId != null && !this.pricingcorridaId.equals(other.pricingcorridaId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return "[ CORRIDA =" + corridaCtrl.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingDia.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingDia.java new file mode 100644 index 000000000..eb24b36d4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingDia.java @@ -0,0 +1,245 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + + +@Entity +@SequenceGenerator(name = "GP_PRICING_DIA_SEQ", sequenceName = "GP_PRICING_DIA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_DIA") +public class GP_PricingDia implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_DIA_SEQ") + @Column(name = "PRICINGDIA_ID") + private Integer pricingdiaId; + + @Column(name = "INDLUNES") + private Boolean indlunes; + + @Column(name = "INDMARTES") + private Boolean indmartes; + + @Column(name = "INDMIERCOLES") + private Boolean indmiercoles; + + @Column(name = "INDJUEVES") + private Boolean indjueves; + + @Column(name = "INDVIERNES") + private Boolean indviernes; + + @Column(name = "INDSABADO") + private Boolean indsabado; + + @Column(name = "INDDOMINGO") + private Boolean inddomingo; + + @Column(name = "HORARIOINICIO") + @Temporal(TemporalType.TIMESTAMP) + // Fue cambido de TIME para TIMESTAMP porque cuando está time el año que se salva el 1900 y no 1970. + private Date horarioinicio; + + @Column(name = "HORARIOFIN") + @Temporal(TemporalType.TIMESTAMP) + // Fue cambido de TIME para TIMESTAMP porque cuando está time el año que se salva el 1900 y no 1970. + private Date horariofin; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @Column(name = "INDFECVIAJE") + private Boolean indfecviaje; + + @Column(name = "INDFECVENTA") + private Boolean indfecventa; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + public GP_PricingDia() { + } + + public GP_PricingDia(Integer pricingdiaId) { + this.pricingdiaId = pricingdiaId; + } + + public Integer getPricingdiaId() { + return pricingdiaId; + } + + public void setPricingdiaId(Integer pricingdiaId) { + this.pricingdiaId = pricingdiaId; + } + + public Boolean getInddomingo() { + return inddomingo; + } + + public void setInddomingo(Boolean inddomingo) { + this.inddomingo = inddomingo; + } + + public Boolean getIndjueves() { + return indjueves; + } + + public void setIndjueves(Boolean indjueves) { + this.indjueves = indjueves; + } + + public Boolean getIndlunes() { + return indlunes; + } + + public void setIndlunes(Boolean indlunes) { + this.indlunes = indlunes; + } + + public Boolean getIndmartes() { + return indmartes; + } + + public void setIndmartes(Boolean indmartes) { + this.indmartes = indmartes; + } + + public Boolean getIndmiercoles() { + return indmiercoles; + } + + public void setIndmiercoles(Boolean indmiercoles) { + this.indmiercoles = indmiercoles; + } + + public Boolean getIndsabado() { + return indsabado; + } + + public void setIndsabado(Boolean indsabado) { + this.indsabado = indsabado; + } + + public Boolean getIndviernes() { + return indviernes; + } + + public void setIndviernes(Boolean indviernes) { + this.indviernes = indviernes; + } + + public Date getHorarioinicio() { + return horarioinicio; + } + + public void setHorarioinicio(Date horarioinicio) { + this.horarioinicio = horarioinicio; + } + + public Date getHorariofin() { + return horariofin; + } + + public void setHorariofin(Date horariofin) { + this.horariofin = horariofin; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer activo) { + this.activo = activo; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Boolean getIndfecviaje() { + return indfecviaje; + } + + public void setIndfecviaje(Boolean indfecviaje) { + this.indfecviaje = indfecviaje; + } + + public Boolean getIndfecventa() { + return indfecventa; + } + + public void setIndfecventa(Boolean indfecventa) { + this.indfecventa = indfecventa; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingdiaId != null ? pricingdiaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingDia)) { + return false; + } + GP_PricingDia other = (GP_PricingDia) object; + if ((this.pricingdiaId == null && other.pricingdiaId != null) || (this.pricingdiaId != null && !this.pricingdiaId.equals(other.pricingdiaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "[id=" + pricingdiaId + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecifico.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecifico.java new file mode 100644 index 000000000..b8fbe51b9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecifico.java @@ -0,0 +1,430 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; + +import org.hibernate.annotations.LazyCollection; +import org.hibernate.annotations.LazyCollectionOption; +import org.hibernate.annotations.Where; + +@Entity +@SequenceGenerator(name = "GP_PRICING_ESPECIFICO_SEQ", sequenceName = "GP_PRICING_ESPECIFICO_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_ESPECIFICO") +public class GP_PricingEspecifico implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_ESPECIFICO_SEQ") + @Column(name = "PRICINGESPECIFICO_ID") + private Long pricingespecificoId; + + @Column(name = "NOMBPRICING") + private String nombPricing; + + @Column(name = "FECHORINICIO") + @Temporal(TemporalType.TIMESTAMP) + private Date fechorinicio; + + @Column(name = "FECHORFIN") + @Temporal(TemporalType.TIMESTAMP) + private Date fechorfin; + + @Column(name = "TARIFA") + private BigDecimal tarifa; + + @Column(name = "TARIFAREDABIERTO") + private BigDecimal tarifaredabierto; + + @Column(name = "ACTIVO") + private Boolean activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada parada; + + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada parada1; + + @JoinColumn(name = "MONEDA_ID", referencedColumnName = "MONEDA_ID") + @ManyToOne + private Moneda moneda; + + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + + @JoinColumn(name = "CLASESERVICIO_ID", referencedColumnName = "CLASESERVICIO_ID") + @ManyToOne + private ClaseServicio claseServicio; + + @Column(name = "CORRIDA_ID") + private Integer corridaId; + + @Column(name = "EXIBEVENDA") + private Boolean exibeVenda; + + @OneToMany(mappedBy = "pricingEspecifico", cascade = CascadeType.ALL, fetch = FetchType.LAZY) + private List pricingEspecificoOcupacionsList; + + @OneToMany(mappedBy = "pricingEspecifico", cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @Where(clause="ACTIVO=1") + private List pricingEspecificoAgenciasList; + + @OneToMany(mappedBy = "pricingEspecifico", cascade = CascadeType.ALL) + @LazyCollection(LazyCollectionOption.FALSE) + @Where(clause="ACTIVO=1") + private List pricingEspecificoCanalVendasList; + + @OneToMany(mappedBy = "pricingEspecifico", cascade = CascadeType.ALL) + @LazyCollection(LazyCollectionOption.FALSE) + @Where(clause="ACTIVO=1") + private List pricingEspecificoCategoriaList; + + @Column(name = "COLOR") + private String color; + + @Column(name = "INDSOBREPOSICAO") + private Boolean indSobreposicao; + + public GP_PricingEspecifico() { + } + + public GP_PricingEspecifico(Long pricingespecificoId) { + this.pricingespecificoId = pricingespecificoId; + } + + public Long getPricingespecificoId() { + return pricingespecificoId; + } + + public void setPricingespecificoId(Long pricingespecificoId) { + this.pricingespecificoId = pricingespecificoId; + } + + public Date getFechorinicio() { + return fechorinicio; + } + + public void setFechorinicio(Date fechorinicio) { + this.fechorinicio = fechorinicio; + } + + public Date getFechorfin() { + return fechorfin; + } + + public void setFechorfin(Date fechorfin) { + this.fechorfin = fechorfin; + } + + public BigDecimal getTarifa() { + return tarifa; + } + + public void setTarifa(BigDecimal tarifa) { + this.tarifa = tarifa; + } + + public BigDecimal getTarifaredabierto() { + return tarifaredabierto; + } + + public void setTarifaredabierto(BigDecimal tarifaredabierto) { + this.tarifaredabierto = tarifaredabierto; + } + + 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; + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public Parada getParada1() { + return parada1; + } + + public void setParada1(Parada parada1) { + this.parada1 = parada1; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public String getNombPricing() { + return nombPricing; + } + + public void setNombPricing(String nombPricing) { + this.nombPricing = nombPricing; + } + + public Integer getCorridaId() { + return corridaId; + } + + public void setCorridaId(Integer corridaId) { + this.corridaId = corridaId; + } + + public List getPricingEspecificoOcupacionsList() { + if(this.pricingEspecificoOcupacionsList == null){ + this.pricingEspecificoOcupacionsList = new ArrayList(); + } + return this.pricingEspecificoOcupacionsList; + } + + public void setPricingEspecificoOcupacionsList(List pricingEspecificoOcupacionsList) { + this.pricingEspecificoOcupacionsList = pricingEspecificoOcupacionsList; + } + + public Boolean getExibeVenda() { + return exibeVenda; + } + + public void setExibeVenda(Boolean exibeVenda) { + this.exibeVenda = exibeVenda; + } + + public List getPricingEspecificoAgenciasList() { + if(this.pricingEspecificoAgenciasList == null){ + this.pricingEspecificoAgenciasList = new ArrayList(); + } + return pricingEspecificoAgenciasList; + } + + public void setPricingEspecificoAgenciasList(List pricingEspecificoAgenciasList) { + this.pricingEspecificoAgenciasList = pricingEspecificoAgenciasList; + } + + + public List getPricingEspecificoCanalVendasList() { + if(this.pricingEspecificoCanalVendasList == null){ + this.pricingEspecificoCanalVendasList = new ArrayList(); + } + return pricingEspecificoCanalVendasList; + } + + public void setPricingEspecificoCanalVendasList(List pricingEspecificoCanalVendasList) { + this.pricingEspecificoCanalVendasList = pricingEspecificoCanalVendasList; + } + + public List getPricingEspecificoCategoriaList() { + if (this.pricingEspecificoCategoriaList == null) { + this.pricingEspecificoCategoriaList = new ArrayList(); + } + return pricingEspecificoCategoriaList; + } + + public void setPricingEspecificoCategoriaList(List pricingEspecificoCategoriaList) { + this.pricingEspecificoCategoriaList = pricingEspecificoCategoriaList; + } + + public Boolean getIndSobreposicao() { + return indSobreposicao; + } + + public void setIndSobreposicao(Boolean indSobreposicao) { + this.indSobreposicao = indSobreposicao; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingespecificoId != null ? pricingespecificoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof GP_PricingEspecifico)) { + return false; + } + GP_PricingEspecifico other = (GP_PricingEspecifico) object; + if ((this.pricingespecificoId == null && other.pricingespecificoId != null) || (this.pricingespecificoId != null && !this.pricingespecificoId.equals(other.pricingespecificoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "[ nomePricing="+ nombPricing+ "] "; + } + + @Transient + public List getPricingEspecificoOcupacionsListActivos() { + List peoList = new ArrayList(); + if(getPricingEspecificoOcupacionsList() != null) { + for (GP_PricingEspecificoOcupacion peo : getPricingEspecificoOcupacionsList()) { + if (peo.getActivo()) { + peoList.add(peo); + } + } + } + return peoList; + } + @Transient + public List getPricingEspecificoAgenciaListActivos() { + List peoList = new ArrayList(); + if(getPricingEspecificoAgenciasList() != null) { + for (GP_PricingEspecificoAgencia peo : getPricingEspecificoAgenciasList()) { + if (peo.getActivo()) { + peoList.add(peo); + } + } + } + return peoList; + } + @Transient + public List getPricingEspecificoCanalListActivos() { + List pecList = new ArrayList(); + if(getPricingEspecificoCanalVendasList() != null) { + for (GP_PricingEspecificoCanalVendas pec : getPricingEspecificoCanalVendasList()) { + if (pec.getActivo()) { + pecList.add(pec); + } + } + } + return pecList; + } + + public GP_PricingEspecifico clonar() throws CloneNotSupportedException, IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException { + GP_PricingEspecifico novo = new GP_PricingEspecifico(); + + novo = (GP_PricingEspecifico) super.clone(); + + novo.setClaseServicio((ClaseServicio) this.claseServicio.clone()); + novo.setMarca((Marca) this.marca.clone()); + novo.setMoneda((Moneda) this.moneda.clone()); + novo.setParada((Parada) this.parada.clone()); + novo.setParada1((Parada) this.parada1.clone()); + + novo.setPricingEspecificoAgenciasList(new ArrayList()); + for(GP_PricingEspecificoAgencia aux: pricingEspecificoAgenciasList) { + + GP_PricingEspecificoAgencia obj = (GP_PricingEspecificoAgencia) aux.clone(); + + if(obj.getActivo()) { + novo.getPricingEspecificoAgenciasList().add(obj); + } + } + + novo.setPricingEspecificoCanalVendasList(new ArrayList()); + for(GP_PricingEspecificoCanalVendas aux: pricingEspecificoCanalVendasList) { + + GP_PricingEspecificoCanalVendas obj = (GP_PricingEspecificoCanalVendas) aux.clone(); + + if(obj.getActivo()) { + novo.getPricingEspecificoCanalVendasList().add(obj); + } + } + + novo.setPricingEspecificoCategoriaList(new ArrayList()); + for(GP_PricingEspecificoCategoria aux: pricingEspecificoCategoriaList) { + + GP_PricingEspecificoCategoria obj = (GP_PricingEspecificoCategoria) aux.clone(); + + if(obj.getActivo()) { + novo.getPricingEspecificoCategoriaList().add(obj); + } + } + + novo.setPricingEspecificoOcupacionsList(new ArrayList()); + for(GP_PricingEspecificoOcupacion aux: pricingEspecificoOcupacionsList) { + + GP_PricingEspecificoOcupacion obj = (GP_PricingEspecificoOcupacion) aux.clone(); + + if(obj.getActivo()) { + novo.getPricingEspecificoOcupacionsList().add(obj); + } + } + + return novo; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoAgencia.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoAgencia.java new file mode 100644 index 000000000..2c01d6858 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoAgencia.java @@ -0,0 +1,144 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_ESP_PUNTOV_SEQ", sequenceName = "GP_PRICING_ESP_PUNTOV_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_ESP_PUNTO_VENTA") +public class GP_PricingEspecificoAgencia implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_ESP_PUNTOV_SEQ") + @Column(name = "PRICINGESPPUNTOVENTA_ID") + private Integer pricingEspecificoAgenciaId; + + @ManyToOne + @JoinColumn(name = "PUNTOVENTA_ID",referencedColumnName = "PUNTOVENTA_ID") + private PuntoVenta puntoVenta; + + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICINGESPECIFICO_ID", referencedColumnName = "PRICINGESPECIFICO_ID") + @ManyToOne + private GP_PricingEspecifico pricingEspecifico; + + public GP_PricingEspecificoAgencia() { + super(); + } + public GP_PricingEspecificoAgencia(PuntoVenta puntoVenta, GP_PricingEspecifico pricingEspecifico, Integer usuarioId) { + super(); + + this.puntoVenta = puntoVenta; + this.pricingEspecifico = pricingEspecifico; + this.usuarioId = usuarioId; + this.fecmodif = new Date(); + this.activo = Boolean.TRUE; + } + public Integer getPricingEspecificoAgenciaId() { + return pricingEspecificoAgenciaId; + } + public void setPricingEspecificoAgenciaId(Integer pricingEspecificoAgenciaId) { + this.pricingEspecificoAgenciaId = pricingEspecificoAgenciaId; + } + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + 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; + } + public GP_PricingEspecifico getPricingEspecifico() { + return pricingEspecifico; + } + public void setPricingEspecifico(GP_PricingEspecifico pricingEspecifico) { + this.pricingEspecifico = pricingEspecifico; + } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((activo == null) ? 0 : activo.hashCode()); + result = prime * result + ((pricingEspecifico == null) ? 0 : pricingEspecifico.hashCode()); + result = prime * result + ((puntoVenta == null) ? 0 : puntoVenta.hashCode()); + return result; + } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + GP_PricingEspecificoAgencia other = (GP_PricingEspecificoAgencia) obj; + if (activo == null) { + if (other.activo != null) + return false; + } else if (!activo.equals(other.activo)) + return false; + if (pricingEspecifico == null) { + if (other.pricingEspecifico != null) + return false; + } else if (!pricingEspecifico.equals(other.pricingEspecifico)) + return false; + if (puntoVenta == null) { + if (other.puntoVenta != null) + return false; + } else if (!puntoVenta.equals(other.puntoVenta)) + return false; + return true; + } + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } + @Override + public String toString() { + return "[puntoVenta=" + puntoVenta.toString() + " ]"; + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoCanalVendas.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoCanalVendas.java new file mode 100644 index 000000000..124f2fc61 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoCanalVendas.java @@ -0,0 +1,148 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * @author Bruno Rodrigo + * + */ +@Entity +@SequenceGenerator(name = "GP_PRICING_ESP_CANAL_SEQ", sequenceName = "GP_PRICING_ESP_CANAL_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_ESP_CANAL_VENTA") +public class GP_PricingEspecificoCanalVendas implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_ESP_CANAL_SEQ") + @Column(name = "PRICINGESPCANAL_ID") + private Integer pricingEspecificoCanalId; + + @ManyToOne + @JoinColumn(name = "TIPOPTOVTA_ID", referencedColumnName = "TIPOPTOVTA_ID") + private TipoPuntoVenta tipoPtovta; + + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @JoinColumn(name = "PRICINGESPECIFICO_ID", referencedColumnName = "PRICINGESPECIFICO_ID") + @ManyToOne + private GP_PricingEspecifico pricingEspecifico; + + public GP_PricingEspecificoCanalVendas() { + super(); + } + public GP_PricingEspecificoCanalVendas(TipoPuntoVenta tipoPtovta, GP_PricingEspecifico pricingEspecifico, Integer usuarioId) { + super(); + + this.tipoPtovta = tipoPtovta; + this.pricingEspecifico = pricingEspecifico; + this.usuarioId = usuarioId; + this.fecmodif = new Date(); + this.activo = Boolean.TRUE; + } + + public Integer getPricingEspecificoCanalId() { + return pricingEspecificoCanalId; + } + public void setPricingEspecificoCanalId(Integer pricingEspecificoCanalId) { + this.pricingEspecificoCanalId = pricingEspecificoCanalId; + } + public TipoPuntoVenta getTipoPtovta() { + return tipoPtovta; + } + public void setTipoPtovta(TipoPuntoVenta tipoPtovta) { + this.tipoPtovta = tipoPtovta; + } + 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; + } + public GP_PricingEspecifico getPricingEspecifico() { + return pricingEspecifico; + } + public void setPricingEspecifico(GP_PricingEspecifico pricingEspecifico) { + this.pricingEspecifico = pricingEspecifico; + } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((activo == null) ? 0 : activo.hashCode()); + result = prime * result + ((pricingEspecifico == null) ? 0 : pricingEspecifico.hashCode()); + result = prime * result + ((tipoPtovta == null) ? 0 : tipoPtovta.hashCode()); + return result; + } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + GP_PricingEspecificoCanalVendas other = (GP_PricingEspecificoCanalVendas) obj; + if (activo == null) { + if (other.activo != null) + return false; + } else if (!activo.equals(other.activo)) + return false; + if (pricingEspecifico == null) { + if (other.pricingEspecifico != null) + return false; + } else if (!pricingEspecifico.equals(other.pricingEspecifico)) + return false; + if (tipoPtovta == null) { + if (other.tipoPtovta != null) + return false; + } else if (!tipoPtovta.equals(other.tipoPtovta)) + return false; + return true; + } + + + + @Override + public String toString() { + return " [TIPO_PONTO_VENDA=" + tipoPtovta.toString() + "]"; + } + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoCategoria.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoCategoria.java new file mode 100644 index 000000000..2750b4b39 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoCategoria.java @@ -0,0 +1,154 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_ESP_CATEGORIA_SEQ", sequenceName = "GP_PRICING_ESP_CATEGORIA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_ESP_CATEGORIA") +public class GP_PricingEspecificoCategoria implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + + private Integer pricingEspecificoCategoriaId; + private GP_PricingEspecifico pricingEspecifico; + private Categoria categoria; + private Boolean activo; + private Date fecmodif; + private Integer usuarioId; + + public GP_PricingEspecificoCategoria() { + super(); + } + + public GP_PricingEspecificoCategoria(Categoria categoria, GP_PricingEspecifico pricingEspecifico, Integer usuarioId) { + this.pricingEspecifico = pricingEspecifico; + this.categoria = categoria; + this.usuarioId = usuarioId; + this.activo = true; + this.fecmodif = new Date(); + } + + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_ESP_CATEGORIA_SEQ") + @Column(name = "PRICINGESPECIFICO_CATEGORIAID") + public Integer getPricingEspecificoCategoriaId() { + return pricingEspecificoCategoriaId; + } + + public void setPricingEspecificoCategoriaId(Integer pricingEspecificoCategoriaId) { + this.pricingEspecificoCategoriaId = pricingEspecificoCategoriaId; + } + + @JoinColumn(name = "PRICINGESPECIFICO_ID", referencedColumnName = "PRICINGESPECIFICO_ID") + @ManyToOne + public GP_PricingEspecifico getPricingEspecifico() { + return pricingEspecifico; + } + + public void setPricingEspecifico(GP_PricingEspecifico pricingEspecifico) { + this.pricingEspecifico = pricingEspecifico; + } + + @ManyToOne + @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + @Column(name = "ACTIVO") + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + @Basic(optional = false) + @Column(name = "USUARIO_ID") + 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 + ((activo == null) ? 0 : activo.hashCode()); + result = prime * result + ((pricingEspecifico == null) ? 0 : pricingEspecifico.hashCode()); + result = prime * result + ((categoria == null) ? 0 : categoria.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + GP_PricingEspecificoCategoria other = (GP_PricingEspecificoCategoria) obj; + if (activo == null) { + if (other.activo != null) + return false; + } else if (!activo.equals(other.activo)) + return false; + if (pricingEspecifico == null) { + if (other.pricingEspecifico != null) + return false; + } else if (!pricingEspecifico.equals(other.pricingEspecifico)) + return false; + if (categoria == null) { + if (other.categoria != null) + return false; + } else if (!categoria.equals(other.categoria)) + return false; + return true; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + @Override + public String toString() { + return " [ CATEGORIA=" + categoria.toString() + "]"; + } + + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoOcupacion.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoOcupacion.java new file mode 100644 index 000000000..5dd8d39f0 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingEspecificoOcupacion.java @@ -0,0 +1,182 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_ESPEC_OCUP_SEQ", sequenceName = "GP_PRICING_ESPEC_OCUP_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_ESPEC_OCUPACION") +public class GP_PricingEspecificoOcupacion implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_ESPEC_OCUP_SEQ") + @Column(name = "PRICINGESPECIFICOOCUPACION_ID") + private Integer pricingEspecificoOcupacionId; + + @Column(name = "OCUPACIONINICIAL") + private BigDecimal ocupacioninicial; + + @Column(name = "OCUPACIONFINAL") + private BigDecimal ocupacionfinal; + + @Column(name = "TARIFA") + private BigDecimal tarifa; + + @Basic(optional = false) + @Column(name = "ACTIVO") + private Boolean activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @Column(name = "DESCUENTO") + private BigDecimal descuento; + + @JoinColumn(name = "PRICINGESPECIFICO_ID", referencedColumnName = "PRICINGESPECIFICO_ID") + @ManyToOne + private GP_PricingEspecifico pricingEspecifico; + + public GP_PricingEspecificoOcupacion() { + super(); + } + + public GP_PricingEspecificoOcupacion(BigDecimal ocupacioninicial, BigDecimal ocupacionfinal, BigDecimal tarifa, Boolean activo, Date fecmodif, Integer usuarioId, BigDecimal descuento, GP_PricingEspecifico pricingEspecifico) { + super(); + this.ocupacioninicial = ocupacioninicial; + this.ocupacionfinal = ocupacionfinal; + this.tarifa = tarifa; + this.activo = activo; + this.fecmodif = fecmodif; + this.usuarioId = usuarioId; + this.descuento = descuento; + this.pricingEspecifico = pricingEspecifico; + } + + public Integer getPricingEspecificoOcupacionId() { + return pricingEspecificoOcupacionId; + } + + public void setPricingEspecificoOcupacionId(Integer pricingEspecificoOcupacionId) { + this.pricingEspecificoOcupacionId = pricingEspecificoOcupacionId; + } + + 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 getTarifa() { + return tarifa; + } + + public void setTarifa(BigDecimal tarifa) { + this.tarifa = tarifa; + } + + 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; + } + + public GP_PricingEspecifico getPricingEspecifico() { + return pricingEspecifico; + } + + public void setPricingEspecifico(GP_PricingEspecifico pricingEspecifico) { + this.pricingEspecifico = pricingEspecifico; + } + + public BigDecimal getDescuento() { + return descuento; + } + + public void setDescuento(BigDecimal descuento) { + this.descuento = descuento; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((pricingEspecificoOcupacionId == null) ? 0 : pricingEspecificoOcupacionId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + GP_PricingEspecificoOcupacion other = (GP_PricingEspecificoOcupacion) obj; + if (pricingEspecificoOcupacionId == null) { + if (other.pricingEspecificoOcupacionId != null) + return false; + } else if (!pricingEspecificoOcupacionId.equals(other.pricingEspecificoOcupacionId)) + return false; + return true; + } + + @Override + public String toString() { + return " [OCUPACAO_INICIAL=" + ocupacioninicial + ", OCUPACAO_FINAL=" + ocupacionfinal + ", TARIFA=" + tarifa + ", DESCONTO=" + descuento + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingFormapago.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingFormapago.java new file mode 100644 index 000000000..6f425acd2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingFormapago.java @@ -0,0 +1,155 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_FORMAPAGO_SEQ", sequenceName = "GP_PRICING_FORMAPAGO_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_FORMAPAGO") +public class GP_PricingFormapago implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_FORMAPAGO_SEQ") + @Column(name = "PRICINGFORMAPAGO_ID") + private Integer pricingformapagoId; + + @Column(name = "INDEXCEPCION") + private Boolean indexcepcion; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "FORMAPAGO_ID", referencedColumnName = "FORMAPAGO_ID") + @ManyToOne + private FormaPago formaPago; + + public GP_PricingFormapago() { + } + + public GP_PricingFormapago(Integer pricingformapagoId) { + this.pricingformapagoId = pricingformapagoId; + } + + public GP_PricingFormapago(Integer pricingformapagoId, Boolean indexcepcion, Integer activo, Date fecmodif, Integer usuarioId, GP_Pricing pricing, FormaPago formaPago) { + this.pricingformapagoId = pricingformapagoId; + this.indexcepcion = indexcepcion; + this.activo = activo; + this.fecmodif = fecmodif; + this.usuarioId = usuarioId; + this.pricing = pricing; + this.formaPago = formaPago; + } + + public Integer getPricingformapagoId() { + return pricingformapagoId; + } + + public void setPricingformapagoId(Integer pricingformapagoId) { + this.pricingformapagoId = pricingformapagoId; + } + + public Boolean getIndexcepcion() { + return indexcepcion; + } + + public void setIndexcepcion(Boolean indexcepcion) { + this.indexcepcion = indexcepcion; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public FormaPago getFormaPago() { + return formaPago; + } + + public void setFormaPago(FormaPago formaPago) { + this.formaPago = formaPago; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingformapagoId != null ? pricingformapagoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingFormapago)) { + return false; + } + GP_PricingFormapago other = (GP_PricingFormapago) object; + if ((this.pricingformapagoId == null && other.pricingformapagoId != null) || (this.pricingformapagoId != null && !this.pricingformapagoId.equals(other.pricingformapagoId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return " [formaPago=" + formaPago.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingGestao.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingGestao.java new file mode 100644 index 000000000..fed196ed9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingGestao.java @@ -0,0 +1,127 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_GESTAO_SEQ", sequenceName = "GP_PRICING_GESTAO_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_GESTAO") +public class GP_PricingGestao implements Serializable { + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_GESTAO_SEQ") + @Column(name = "PRICINGGESTAO_ID") + private Integer pricinggestaoId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + @Column(name = "CORRIDA_ID") + private Integer corridaId; + @Column(name = "FECCORRIDA") + @Temporal(TemporalType.DATE) + private Date feccorrida; + @Column(name = "ACTIVO") + private Integer activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public GP_PricingGestao() { + } + + public Integer getPricinggestaoId() { + return pricinggestaoId; + } + + public void setPricinggestaoId(Integer pricinggestaoId) { + this.pricinggestaoId = pricinggestaoId; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public Integer getCorridaId() { + return corridaId; + } + + public void setCorridaId(Integer corridaId) { + this.corridaId = corridaId; + } + + public Date getFeccorrida() { + return feccorrida; + } + + public void setFeccorrida(Date feccorrida) { + this.feccorrida = feccorrida; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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() { + int hash = 0; + hash += (pricinggestaoId != null ? pricinggestaoId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingGestao)) { + return false; + } + GP_PricingGestao other = (GP_PricingGestao) object; + if ((this.pricinggestaoId == null && other.pricinggestaoId != null) || (this.pricinggestaoId != null && !this.pricinggestaoId.equals(other.pricinggestaoId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "entidad.test.PricingGestao[pricinggestaoId=" + pricinggestaoId + "]"; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingHistorico.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingHistorico.java new file mode 100644 index 000000000..7d6a6800f --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingHistorico.java @@ -0,0 +1,148 @@ +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 = "GP_PRICING_HISTORICO_SEQ", sequenceName = "GP_PRICING_HISTORICO_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_HISTORICO") +public class GP_PricingHistorico implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_HISTORICO_SEQ") + @Column(name = "PRICINGHISTORICO_ID") + private Long pricingHistoricoId; + + @Column(name = "PRICING_ID") + private Long pricingId; + + @Column(name = "ISESPECIFICO") + private Boolean isEspecifico; + + @Column(name = "DESCRICAO") + private String descricao; + + @Column(name = "VALORANTERIOR") + private String valorAnterior; + + @Column(name = "VALORNOVO") + private String valorNovo; + + @Column(name = "CAMPOALTERADO") + private String campoAlterado; + + @Column(name = "CLASSEALTERADA") + private String classeAlterada; + + @Column(name = "CLASSEPRINCIPAL") + private String classePrincipal; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Long getPricingHistoricoId() { + return pricingHistoricoId; + } + + public void setPricingHistoricoId(Long pricingHistoricoId) { + this.pricingHistoricoId = pricingHistoricoId; + } + + public Long getPricingId() { + return pricingId; + } + + public void setPricingId(Long pricingId) { + this.pricingId = pricingId; + } + + public Boolean getIsEspecifico() { + return isEspecifico == null ? false : isEspecifico; + } + + public void setIsEspecifico(Boolean isEspecifico) { + this.isEspecifico = isEspecifico; + } + + public String getDescricao() { + return descricao; + } + + public void setDescricao(String descricao) { + this.descricao = descricao; + } + + public String getValorAnterior() { + return valorAnterior; + } + + public void setValorAnterior(String valorAnterior) { + this.valorAnterior = valorAnterior; + } + + public String getValorNovo() { + return valorNovo; + } + + public void setValorNovo(String valorNovo) { + this.valorNovo = valorNovo; + } + + public String getCampoAlterado() { + return campoAlterado; + } + + public void setCampoAlterado(String campoAlterado) { + this.campoAlterado = campoAlterado; + } + + public String getClasseAlterada() { + return classeAlterada; + } + + public void setClasseAlterada(String classeAlterada) { + this.classeAlterada = classeAlterada; + } + + 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; + } + + public String getClassePrincipal() { + return classePrincipal; + } + + public void setClassePrincipal(String classePrincipal) { + this.classePrincipal = classePrincipal; + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingImporte.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingImporte.java new file mode 100644 index 000000000..a252d9e4e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingImporte.java @@ -0,0 +1,146 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_IMPORTE_SEQ", sequenceName = "GP_PRICING_IMPORTE_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_IMPORTE") +public class GP_PricingImporte implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_IMPORTE_SEQ") + @Column(name = "PRICINGIMPORTE_ID") + private Integer pricingimporteId; + + @Column(name = "IMPORTE") + private BigDecimal importe; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "MONEDA_ID", referencedColumnName = "MONEDA_ID") + @ManyToOne + private Moneda moneda; + + public GP_PricingImporte() { + } + + public GP_PricingImporte(Integer pricingimporteId) { + this.pricingimporteId = pricingimporteId; + } + + public Integer getPricingimporteId() { + return pricingimporteId; + } + + public void setPricingimporteId(Integer pricingimporteId) { + this.pricingimporteId = pricingimporteId; + } + + public BigDecimal getImporte() { + return importe; + } + + public void setImporte(BigDecimal importe) { + this.importe = importe; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingimporteId != null ? pricingimporteId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingImporte)) { + return false; + } + GP_PricingImporte other = (GP_PricingImporte) object; + if ((this.pricingimporteId == null && other.pricingimporteId != null) || (this.pricingimporteId != null && !this.pricingimporteId.equals(other.pricingimporteId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return " [ importe=" + importe + ", moneda=" + moneda.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingMarca.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingMarca.java new file mode 100644 index 000000000..94f70d8f7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingMarca.java @@ -0,0 +1,134 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_MARCA_SEQ", sequenceName = "GP_PRICING_MARCA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_MARCA") +public class GP_PricingMarca implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_MARCA_SEQ") + @Column(name = "PRICINGMARCA_ID") + private Integer pricingmarcaId; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "MARCA_ID", referencedColumnName = "MARCA_ID") + @ManyToOne + private Marca marca; + + public GP_PricingMarca() { + } + + public GP_PricingMarca(Integer pricingmarcaId) { + this.pricingmarcaId = pricingmarcaId; + } + + public Integer getPricingmarcaId() { + return pricingmarcaId; + } + + public void setPricingmarcaId(Integer pricingmarcaId) { + this.pricingmarcaId = pricingmarcaId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingmarcaId != null ? pricingmarcaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingMarca)) { + return false; + } + GP_PricingMarca other = (GP_PricingMarca) object; + if ((this.pricingmarcaId == null && other.pricingmarcaId != null) || (this.pricingmarcaId != null && !this.pricingmarcaId.equals(other.pricingmarcaId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return " [marca=" + marca.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingMercado.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingMercado.java new file mode 100644 index 000000000..791cd74ab --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingMercado.java @@ -0,0 +1,146 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + + +@Entity +@SequenceGenerator(name = "GP_PRICING_MERCADO_SEQ", sequenceName = "GP_PRICING_MERCADO_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_MERCADO") +public class GP_PricingMercado implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_MERCADO_SEQ") + @Column(name = "PRICINGPARADA_ID") + private Integer pricingparadaId; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada origen; + + @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID") + @ManyToOne + private Parada destino; + + public GP_PricingMercado() { + } + + public GP_PricingMercado(Integer pricingparadaId) { + this.pricingparadaId = pricingparadaId; + } + + public Integer getPricingparadaId() { + return pricingparadaId; + } + + public void setPricingparadaId(Integer pricingparadaId) { + this.pricingparadaId = pricingparadaId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public Parada getDestino() { + return destino; + } + + public void setDestino(Parada destino) { + this.destino = destino; + } + + public Parada getOrigen() { + return origen; + } + + public void setOrigen(Parada origen) { + this.origen = origen; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingparadaId != null ? pricingparadaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingMercado)) { + return false; + } + GP_PricingMercado other = (GP_PricingMercado) object; + if ((this.pricingparadaId == null && other.pricingparadaId != null) || (this.pricingparadaId != null && !this.pricingparadaId.equals(other.pricingparadaId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return "[origen=" + origen.toString() + ", destino=" + destino.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingOcupaAntecipa.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingOcupaAntecipa.java new file mode 100644 index 000000000..97e439040 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingOcupaAntecipa.java @@ -0,0 +1,238 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.math.BigDecimal; +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_OCUPA_ANTECIPA_SEQ", sequenceName = "GP_PRICING_OCUPA_ANTECIPA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_OCUPA_ANTECIPA") +public class GP_PricingOcupaAntecipa implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_OCUPA_ANTECIPA_SEQ") + @Column(name = "PRICINGOCUPAANTECIPA_ID") + private Integer pricingocupaantecipaId; + + @Column(name = "CANTDIASMIN") + private Integer cantdiasmin; + + @Column(name = "CANTDIASMAX") + private Integer cantdiasmax; + + @Column(name = "CANTASIENTOSMIN") + private Integer cantasientosmin; + + @Column(name = "CANTASIENTOSMAX") + private Integer cantasientosmax; + + @Column(name = "PORCENTAJE") + private BigDecimal porcentaje; + + @Column(name = "OCUPACIONINICIAL") + private BigDecimal ocupacioninicial; + + @Column(name = "OCUPACIONFINAL") + private BigDecimal ocupacionfinal; + + @Column(name = "IMPORTE") + private BigDecimal importe; + + @Basic(optional = false) + @Column(name = "ACTIVO") + private Integer activo; + + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Basic(optional = false) + @Column(name = "USUARIO_ID") + + private Integer usuarioId; + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "PRICINGCLASSETARIFARIA_ID", referencedColumnName = "PRICINGCLASSETARIFARIA_ID") + @ManyToOne + private GP_PricingClasseTarifaria pricingClasseTarifaria; + + @Column(name = "COR") + private String cor; + + public GP_PricingOcupaAntecipa() { + super(); + } + + public GP_PricingOcupaAntecipa(Integer pricingocupaantecipaId) { + this(); + this.pricingocupaantecipaId = pricingocupaantecipaId; + } + + public Integer getPricingocupaantecipaId() { + return pricingocupaantecipaId; + } + + public void setPricingocupaantecipaId(Integer pricingocupaantecipaId) { + this.pricingocupaantecipaId = pricingocupaantecipaId; + } + + 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 getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public GP_PricingClasseTarifaria getPricingClasseTarifaria() { + return pricingClasseTarifaria; + } + + public void setPricingClasseTarifaria(GP_PricingClasseTarifaria pricingClasseTarifaria) { + this.pricingClasseTarifaria = pricingClasseTarifaria; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (getPricingocupaantecipaId() != null ? getPricingocupaantecipaId().hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingOcupaAntecipa)) { + return false; + } + GP_PricingOcupaAntecipa other = (GP_PricingOcupaAntecipa) object; + if ((this.getPricingocupaantecipaId() == null && other.getPricingocupaantecipaId() != null) || (this.getPricingocupaantecipaId() != null && !this.getPricingocupaantecipaId().equals(other.getPricingocupaantecipaId()))) { + return false; + } + return true; + } + + @Override + public String toString() { + return " [DIAS_MIN=" + cantdiasmin + ", DIAS_MAX=" + cantdiasmax + ", MIN_POLTRONA=" + cantasientosmin + + ", MAX_POLRONA=" + cantasientosmax + ", OCUPACAO_INICIAL=" + ocupacioninicial + ", OCUPACAO_FINAL=" + ocupacionfinal + "]"; + } + + public String getCor() { + return cor; + } + + public void setCor(String cor) { + this.cor = cor; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingPuntoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingPuntoVenta.java new file mode 100644 index 000000000..126241bf2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingPuntoVenta.java @@ -0,0 +1,132 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_PUNTOVENTA_SEQ", sequenceName = "GP_PRICING_PUNTOVENTA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_PUNTOVENTA") +public class GP_PricingPuntoVenta implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_PUNTOVENTA_SEQ") + @Column(name = "PRICINGPTOVTA_ID") + private Integer pricingptovtaId; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID") + @ManyToOne + private PuntoVenta puntoVenta; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + public GP_PricingPuntoVenta() { + } + + public GP_PricingPuntoVenta(Integer pricingptovtaId) { + this.pricingptovtaId = pricingptovtaId; + } + + public Integer getPricingptovtaId() { + return pricingptovtaId; + } + + public void setPricingptovtaId(Integer pricingptovtaId) { + this.pricingptovtaId = pricingptovtaId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingptovtaId != null ? pricingptovtaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingPuntoVenta)) { + return false; + } + GP_PricingPuntoVenta other = (GP_PricingPuntoVenta) object; + if ((this.pricingptovtaId == null && other.pricingptovtaId != null) || (this.pricingptovtaId != null && !this.pricingptovtaId.equals(other.pricingptovtaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return " [ PONTO_VENDA=" + puntoVenta.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingRuta.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingRuta.java new file mode 100644 index 000000000..91c132bfc --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingRuta.java @@ -0,0 +1,133 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_RUTA_SEQ", sequenceName = "GP_PRICING_RUTA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_RUTA") + +public class GP_PricingRuta implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_RUTA_SEQ") + @Column(name = "PRICINGRUTA_ID") + private Integer pricingrutaId; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID") + @ManyToOne + private Ruta ruta; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + public GP_PricingRuta() { + } + + public GP_PricingRuta(Integer pricingrutaId) { + this.pricingrutaId = pricingrutaId; + } + + public Integer getPricingrutaId() { + return pricingrutaId; + } + + public void setPricingrutaId(Integer pricingrutaId) { + this.pricingrutaId = pricingrutaId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingrutaId != null ? pricingrutaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingRuta)) { + return false; + } + GP_PricingRuta other = (GP_PricingRuta) object; + if ((this.pricingrutaId == null && other.pricingrutaId != null) || (this.pricingrutaId != null && !this.pricingrutaId.equals(other.pricingrutaId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return " [ linha=" + ruta.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingTipoPtoVta.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingTipoPtoVta.java new file mode 100644 index 000000000..8d7d80b84 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingTipoPtoVta.java @@ -0,0 +1,142 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Rafius + */ +@Entity +@SequenceGenerator(name = "GP_PRICING_TIPOPTOVTA_SEQ", sequenceName = "GP_PRICING_TIPOPTOVTA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_TIPOPTOVTA") +public class GP_PricingTipoPtoVta implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_TIPOPTOVTA_SEQ") + @Column(name = "PRICINGTIPOPTOVTA_ID") + private Integer pricingtipoptovtaId; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + + private Date fecmodif; + @Column(name = "USUARIO_ID") + + private Integer usuarioId; + @JoinColumn(name = "TIPOPTOVTA_ID", referencedColumnName = "TIPOPTOVTA_ID") + @ManyToOne + private TipoPuntoVenta tipoPtovta; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + public GP_PricingTipoPtoVta() { + } + + public GP_PricingTipoPtoVta(Integer pricingtipoptovtaId) { + this.pricingtipoptovtaId = pricingtipoptovtaId; + } + + public Integer getPricingtipoptovtaId() { + return pricingtipoptovtaId; + } + + public void setPricingtipoptovtaId(Integer pricingtipoptovtaId) { + this.pricingtipoptovtaId = pricingtipoptovtaId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public TipoPuntoVenta getTipoPtovta() { + return tipoPtovta; + } + + public void setTipoPtovta(TipoPuntoVenta tipoPtovta) { + this.tipoPtovta = tipoPtovta; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingtipoptovtaId != null ? pricingtipoptovtaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingTipoPtoVta)) { + return false; + } + GP_PricingTipoPtoVta other = (GP_PricingTipoPtoVta) object; + if ((this.pricingtipoptovtaId == null && other.pricingtipoptovtaId != null) || (this.pricingtipoptovtaId != null && !this.pricingtipoptovtaId.equals(other.pricingtipoptovtaId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return " [ TIPO_PONTO_VENDA=" + tipoPtovta.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingTipoServicio.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingTipoServicio.java new file mode 100644 index 000000000..097983609 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingTipoServicio.java @@ -0,0 +1,135 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "GP_PRICING_TIPOSERVICIO_SEQ", sequenceName = "GP_PRICING_TIPOSERVICIO_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_TIPOSERVICIO") +public class GP_PricingTipoServicio implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_TIPOSERVICIO_SEQ") + @Column(name = "PRICINGTIPOSERVICIO_ID") + private Integer pricingtiposervicioId; + + @Basic(optional = false) + @Column(name = "ACTIVO") + private Integer activo; + + @Basic(optional = false) + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Basic(optional = false) + @Column(name = "USUARIO_ID") + private int usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + @JoinColumn(name = "TIPOSERVICIO_ID", referencedColumnName = "TIPOSERVICIO_ID") + @ManyToOne + private TipoServicio tipoServicio; + + public GP_PricingTipoServicio() { + } + + public GP_PricingTipoServicio(Integer pricingtiposervicioId) { + this.pricingtiposervicioId = pricingtiposervicioId; + } + + public Integer getPricingtiposervicioId() { + return pricingtiposervicioId; + } + + public void setPricingtiposervicioId(Integer pricingtiposervicioId) { + this.pricingtiposervicioId = pricingtiposervicioId; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public int getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(int usuarioId) { + this.usuarioId = usuarioId; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + public TipoServicio getTipoServicio() { + return tipoServicio; + } + + public void setTipoServicio(TipoServicio tipoServicio) { + this.tipoServicio = tipoServicio; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingtiposervicioId != null ? pricingtiposervicioId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingTipoServicio)) { + return false; + } + GP_PricingTipoServicio other = (GP_PricingTipoServicio) object; + if ((this.pricingtiposervicioId == null && other.pricingtiposervicioId != null) || (this.pricingtiposervicioId != null && !this.pricingtiposervicioId.equals(other.pricingtiposervicioId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return " [ TIPO_SERVICO =" + tipoServicio.toString() + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/GP_PricingVigencia.java b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingVigencia.java new file mode 100644 index 000000000..53595efb6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/GP_PricingVigencia.java @@ -0,0 +1,175 @@ +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.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + +@Entity +@SequenceGenerator(name = "GP_PRICING_VIGENCIA_SEQ", sequenceName = "GP_PRICING_VIGENCIA_SEQ", allocationSize = 1) +@Table(name = "GP_PRICING_VIGENCIA") +public class GP_PricingVigencia implements Serializable, Cloneable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_VIGENCIA_SEQ") + @Column(name = "PRICINGVIGENCIA_ID") + private Integer pricingvigenciaId; + + @Column(name = "FECINICIOVIAJE") + @Temporal(TemporalType.TIMESTAMP) + private Date fecinicioviaje; + + @Column(name = "FECFINVIAJE") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinviaje; + + @Column(name = "FECINICIOVENTA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecinicioventa; + + @Column(name = "FECFINVENTA") + @Temporal(TemporalType.TIMESTAMP) + private Date fecfinventa; + + @Column(name = "ACTIVO") + private Integer activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + @JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID") + @ManyToOne + private GP_Pricing pricing; + + public GP_PricingVigencia() { + } + + public GP_PricingVigencia(Integer pricingvigenciaId) { + this.pricingvigenciaId = pricingvigenciaId; + } + + public Integer getPricingvigenciaId() { + return pricingvigenciaId; + } + + public void setPricingvigenciaId(Integer pricingvigenciaId) { + this.pricingvigenciaId = pricingvigenciaId; + } + + public Date getFecinicioviaje() { + return fecinicioviaje; + } + + public void setFecinicioviaje(Date fecinicioviaje) { + this.fecinicioviaje = fecinicioviaje; + } + + public Date getFecfinviaje() { + return fecfinviaje; + } + + public void setFecfinviaje(Date fecfinviaje) { + this.fecfinviaje = fecfinviaje; + } + + public Date getFecinicioventa() { + return fecinicioventa; + } + + public void setFecinicioventa(Date fecinicioventa) { + this.fecinicioventa = fecinicioventa; + } + + public Date getFecfinventa() { + return fecfinventa; + } + + public void setFecfinventa(Date fecfinventa) { + this.fecfinventa = fecfinventa; + } + + public Integer getActivo() { + return activo; + } + + public void setActivo(Integer 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; + } + + public GP_Pricing getPricing() { + return pricing; + } + + public void setPricing(GP_Pricing pricing) { + this.pricing = pricing; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (pricingvigenciaId != null ? pricingvigenciaId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof GP_PricingVigencia)) { + return false; + } + GP_PricingVigencia other = (GP_PricingVigencia) object; + if ((this.pricingvigenciaId == null && other.pricingvigenciaId != null) || (this.pricingvigenciaId != null && !this.pricingvigenciaId.equals(other.pricingvigenciaId))) { + return false; + } + return true; + } + + + + @Override + public String toString() { + return " [INICIO_VIAGEM=" + DateUtil.getStringDate(fecinicioviaje) + + ", FIM_VIAGEM=" + DateUtil.getStringDate(fecfinviaje) + + ", INICIO_VENDA=" + DateUtil.getStringDate(fecinicioventa) + + ", FIM_VENDA=" + DateUtil.getStringDate(fecfinventa) + "]"; + } + + @Override + protected Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Marca.java b/src/com/rjconsultores/ventaboletos/entidad/Marca.java index 64b91daca..27fb1ca5f 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Marca.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Marca.java @@ -265,6 +265,11 @@ public class Marca implements Serializable, Auditavel { public Marca getCloneObject() throws CloneNotSupportedException { return marcaClone; } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } @Override public String getTextoInclusaoExclusao() { diff --git a/src/com/rjconsultores/ventaboletos/entidad/Moneda.java b/src/com/rjconsultores/ventaboletos/entidad/Moneda.java index 1c42bbcee..9f6724dfe 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Moneda.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Moneda.java @@ -166,5 +166,9 @@ public class Moneda implements Serializable { public void setSigla(String sigla) { this.sigla = sigla; } - + + @Override + public Object clone() throws CloneNotSupportedException { + return this.clone(); + } } diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingAsientoService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingAsientoService.java new file mode 100644 index 000000000..f3c1d9089 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingAsientoService.java @@ -0,0 +1,13 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingAsiento; + +public interface GP_PricingAsientoService extends GenericService { + + public List obtenerPricingCategoria(GP_Pricing pricing, Integer value); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingCategoriaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingCategoriaService.java new file mode 100644 index 000000000..698b4e83d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingCategoriaService.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCategoria; + +public interface GP_PricingCategoriaService extends GenericService { + + public Boolean obtenerPricingCategoria(GP_Pricing pricing, Categoria categoria); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingClaseService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingClaseService.java new file mode 100644 index 000000000..a8f5df6cd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingClaseService.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingClase; + +public interface GP_PricingClaseService extends GenericService { + + public Boolean obtenerPricingClase(GP_Pricing pricing, ClaseServicio claseServicio); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingClasseTarifariaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingClasseTarifariaService.java new file mode 100644 index 000000000..d0374af2b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingClasseTarifariaService.java @@ -0,0 +1,9 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingClasseTarifaria; + +public interface GP_PricingClasseTarifariaService extends GenericService { + + public Boolean validacionSigla(String sigla); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingCorridaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingCorridaService.java new file mode 100644 index 000000000..42d4059f4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingCorridaService.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCorrida; + +public interface GP_PricingCorridaService extends GenericService { + + public Boolean obtenerPricingCorrida(GP_Pricing pricing, CorridaCtrl corrida); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingDiaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingDiaService.java new file mode 100644 index 000000000..9aeccb1ab --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingDiaService.java @@ -0,0 +1,13 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingDia; + +public interface GP_PricingDiaService extends GenericService { + + public List buscarTraslapa(GP_PricingDia pricingDia); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoAgenciaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoAgenciaService.java new file mode 100644 index 000000000..f50002a39 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoAgenciaService.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoAgencia; + +public interface GP_PricingEspecificoAgenciaService extends GenericService { + + Boolean existeAgenciaPricing(GP_PricingEspecificoAgencia entidad); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoCanalVendasService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoCanalVendasService.java new file mode 100644 index 000000000..c8b70a159 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoCanalVendasService.java @@ -0,0 +1,8 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCanalVendas; + +public interface GP_PricingEspecificoCanalVendasService extends GenericService { + + Boolean existeCanalVendasPricing(GP_PricingEspecificoCanalVendas entidad); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoCategoriaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoCategoriaService.java new file mode 100644 index 000000000..2fcec5817 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoCategoriaService.java @@ -0,0 +1,6 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCategoria; + +public interface GP_PricingEspecificoCategoriaService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoOcupacionService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoOcupacionService.java new file mode 100644 index 000000000..6886623d2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoOcupacionService.java @@ -0,0 +1,6 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoOcupacion; + +public interface GP_PricingEspecificoOcupacionService extends GenericService { +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoService.java new file mode 100644 index 000000000..8c0493254 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingEspecificoService.java @@ -0,0 +1,21 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.Date; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecifico; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCategoria; +import com.rjconsultores.ventaboletos.entidad.Parada; + +public interface GP_PricingEspecificoService extends GenericService { + + public List buscarPorNome(GP_PricingEspecifico pricingEspecifico); + + public List buscarPorNome(String nome); + + public GP_PricingEspecifico clonarPricing(Long id, String nome, List pricingCategoriaList); + + public List buscar(List empresas, List tipoClasses, List origens, List destinos, Date vigenciaInicial, Date vigenciaFinal); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingFormapagoService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingFormapagoService.java new file mode 100644 index 000000000..a8293568b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingFormapagoService.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingFormapago; + +public interface GP_PricingFormapagoService extends GenericService { + + List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingGestaoService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingGestaoService.java new file mode 100644 index 000000000..ea44a03b4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingGestaoService.java @@ -0,0 +1,11 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingGestao; + +public interface GP_PricingGestaoService extends GenericService { + +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingHistoricoService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingHistoricoService.java new file mode 100644 index 000000000..28301fe20 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingHistoricoService.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingHistorico; + +public interface GP_PricingHistoricoService extends GenericService { + + public void compararESalvar(Object original, Object novo); + + public void registarExclusao(Object pricing, Boolean ativar); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingImporteService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingImporteService.java new file mode 100644 index 000000000..6117edd6e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingImporteService.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingImporte; +import com.rjconsultores.ventaboletos.entidad.Moneda; + +public interface GP_PricingImporteService extends GenericService { + + public List buscarMoneda(GP_PricingImporte pricingImporte, Moneda moneda); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingMarcaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingMarcaService.java new file mode 100644 index 000000000..a566c47ee --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingMarcaService.java @@ -0,0 +1,15 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMarca; +import com.rjconsultores.ventaboletos.entidad.Marca; + +public interface GP_PricingMarcaService extends GenericService { + + public Boolean obtenerPricingMarca(GP_Pricing pricing, Marca marca); + + public List obtenerTodoPorPricing(GP_Pricing pricing); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingMercadoService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingMercadoService.java new file mode 100644 index 000000000..8866f7a12 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingMercadoService.java @@ -0,0 +1,15 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMercado; +import com.rjconsultores.ventaboletos.entidad.Parada; + +public interface GP_PricingMercadoService extends GenericService { + + public Boolean obtenerPricingMercado(GP_Pricing pricing, Parada origen, Parada destino); + + public List obtenerTodoPorPricing(GP_Pricing pricing); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingOcupaAntecipaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingOcupaAntecipaService.java new file mode 100644 index 000000000..a40c47004 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingOcupaAntecipaService.java @@ -0,0 +1,34 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingOcupaAntecipa; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingOcupaAntecipaLegendaVO; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingOcupaAntecipaVO; + +public interface GP_PricingOcupaAntecipaService { + + public GP_PricingOcupaAntecipa obtenerID(Integer pricingocupaantecipaId) throws BusinessException; + + public GP_PricingOcupaAntecipa suscribir(GP_PricingOcupaAntecipa entidad) throws BusinessException; + + public GP_PricingOcupaAntecipa actualizacion(GP_PricingOcupaAntecipa entidad) throws BusinessException; + + public void borrar(GP_PricingOcupaAntecipa entidad); + + public List updateList(GP_PricingOcupaAntecipa entidad); + + public List carregarPricingOcupaAntecipaVO(Integer pricingId); + + public List carregarPricingOcupaAntecipa(Integer pricingId); + + public List carregarPricingOcupaAntecipaLegenda(Integer pricingId); + + List carregarPricingOcupaAntecipaVO(List pricingOcupaAntecipas); + + List carregarPricingOcupaAntecipaLegenda(List lsPricingOcupaAntecipa); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingPuntoVentaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingPuntoVentaService.java new file mode 100644 index 000000000..d576f36cd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingPuntoVentaService.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; + +public interface GP_PricingPuntoVentaService extends GenericService { + + public Boolean obtenerPricingPuntoVenta(GP_Pricing pricing, PuntoVenta puntoVenta); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingRevisaoValoresService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingRevisaoValoresService.java new file mode 100644 index 000000000..c6b4b2b53 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingRevisaoValoresService.java @@ -0,0 +1,18 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_PricingClase; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCorrida; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMarca; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMercado; +import com.rjconsultores.ventaboletos.entidad.GP_PricingOcupaAntecipa; +import com.rjconsultores.ventaboletos.entidad.GP_PricingRuta; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingRevisaoValoresVO; + +public interface GP_PricingRevisaoValoresService extends GenericService { + + public List buscarPricingRevisaoValoresVO(List lsPricingVigencia, List lsPricingClase, List lsPricingMarca, List lsPricingMercado, List lsPricingOcupaAntecipa, List lsPricingCorrida, List lsPricingRuta); + +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingRutaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingRutaService.java new file mode 100644 index 000000000..5878ec381 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingRutaService.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; + +public interface GP_PricingRutaService extends GenericService { + + public Boolean obtenerPricingRuta(GP_Pricing pricing, Ruta ruta); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingService.java new file mode 100644 index 000000000..ee3b74e08 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingService.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.service; + +import java.math.BigDecimal; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; + +public interface GP_PricingService extends GenericService { + + public void borrarFisico(GP_Pricing pricing); + + public List buscar(String nombPricing, Empresa empresa, + Short cantboleto, Integer cantdiasanticipacion, + BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo); + + public List buscarPorNombre(String nombPricing); + + public void inativar(GP_Pricing entidad); + + public void ativar(GP_Pricing entidad); + + public Boolean clonarPricing(Integer pricingId, String nomePricing, boolean incluirPadraoPricingTipoPassagemPET); + + public GP_Pricing clonarGP_Pricing(Integer pricingId, String nomePricing, boolean incluirPadraoPricingTipoPassagemPET, boolean isPricingAtivo); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingTipoPtoVtaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingTipoPtoVtaService.java new file mode 100644 index 000000000..214db84b6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingTipoPtoVtaService.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; + +public interface GP_PricingTipoPtoVtaService extends GenericService { + + public Boolean obtenerPricingTipoPuntoVenta(GP_Pricing pricing, TipoPuntoVenta tipoPuntoVenta); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingTipoServicioService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingTipoServicioService.java new file mode 100644 index 000000000..d2f0b09b7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingTipoServicioService.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; + +public interface GP_PricingTipoServicioService extends GenericService { + + public Boolean obtenerPricingTipoServicio(GP_Pricing pricing, TipoServicio tipoServicio); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/GP_PricingVigenciaService.java b/src/com/rjconsultores/ventaboletos/service/GP_PricingVigenciaService.java new file mode 100644 index 000000000..46d5ed3e2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/GP_PricingVigenciaService.java @@ -0,0 +1,17 @@ +package com.rjconsultores.ventaboletos.service; + +import java.util.Date; +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; + +public interface GP_PricingVigenciaService extends GenericService { + + public List buscarPorVigencias(GP_PricingVigencia pv); + + public Boolean podeSalvar(GP_Pricing pricing, GP_PricingVigencia pricingVigencia, + Date inicio, Date fim); + + public List obtenerTodoPorPricing(GP_Pricing pricing); +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_GestaoPricingService.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_GestaoPricingService.java new file mode 100644 index 000000000..4f03ee5b5 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_GestaoPricingService.java @@ -0,0 +1,27 @@ +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 com.rjconsultores.ventaboletos.dao.CorridaDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; + +@Service("gp_GestaoPricingService") +public class GP_GestaoPricingService { + + @Autowired + private CorridaDAO corridaDAO; + + public List buscarCorridas(Parada origem, Parada destino, Date dataInicio, Date dataFinal, ClaseServicio classe, + Ruta linha, Empresa empresa) { + return corridaDAO.buscarCorridas(origem, destino, dataInicio, dataFinal, classe, linha, empresa); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingAsientoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingAsientoServiceImpl.java new file mode 100644 index 000000000..9e78bc0b9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingAsientoServiceImpl.java @@ -0,0 +1,65 @@ +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.GP_PricingAsientoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingAsiento; +import com.rjconsultores.ventaboletos.service.GP_PricingAsientoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingAsientoService") +public class GP_PricingAsientoServiceImpl implements GP_PricingAsientoService { + + @Autowired + private GP_PricingAsientoDAO pricingAsientoDAO; + + public List obtenerTodos() { + return pricingAsientoDAO.obtenerTodos(); + } + + public GP_PricingAsiento obtenerID(Integer id) { + return pricingAsientoDAO.obtenerID(id); + } + + @Transactional + public GP_PricingAsiento suscribir(GP_PricingAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingAsientoDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingAsiento actualizacion(GP_PricingAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingAsientoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingAsiento entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingAsientoDAO.actualizacion(entidad); + } + + public List obtenerPricingCategoria(GP_Pricing pricing, Integer asiento) { + return pricingAsientoDAO.obtenerPricingCategoria(pricing, asiento); + } + + + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingAsientoDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingCategoriaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingCategoriaServiceImpl.java new file mode 100644 index 000000000..2e182e6b8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingCategoriaServiceImpl.java @@ -0,0 +1,65 @@ +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.GP_PricingCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCategoria; +import com.rjconsultores.ventaboletos.service.GP_PricingCategoriaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingCategoriaService") +public class GP_PricingCategoriaServiceImpl implements GP_PricingCategoriaService { + + @Autowired + private GP_PricingCategoriaDAO pricingCategoriaDAO; + + public List obtenerTodos() { + return pricingCategoriaDAO.obtenerTodos(); + } + + public GP_PricingCategoria obtenerID(Integer id) { + return pricingCategoriaDAO.obtenerID(id); + } + + @Transactional + public GP_PricingCategoria suscribir(GP_PricingCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingCategoriaDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingCategoria actualizacion(GP_PricingCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingCategoriaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingCategoriaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingCategoria(GP_Pricing pricing, Categoria categoria) { + return pricingCategoriaDAO.obtenerPricingCategoria(pricing, categoria); + } + + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingCategoriaDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingClaseServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingClaseServiceImpl.java new file mode 100644 index 000000000..9714e01c9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingClaseServiceImpl.java @@ -0,0 +1,65 @@ +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.GP_PricingClaseDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingClase; +import com.rjconsultores.ventaboletos.service.GP_PricingClaseService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingClaseService") +public class GP_PricingClaseServiceImpl implements GP_PricingClaseService { + + @Autowired + private GP_PricingClaseDAO pricingClaseDAO; + + public List obtenerTodos() { + return pricingClaseDAO.obtenerTodos(); + } + + public GP_PricingClase obtenerID(Integer id) { + return pricingClaseDAO.obtenerID(id); + } + + @Transactional + public GP_PricingClase suscribir(GP_PricingClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingClaseDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingClase actualizacion(GP_PricingClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingClaseDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingClase entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingClaseDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingClase(GP_Pricing pricing, ClaseServicio claseServicio) { + return pricingClaseDAO.obtenerPricingClase(pricing, claseServicio); + } + + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingClaseDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingClasseTarifariaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingClasseTarifariaServiceImpl.java new file mode 100644 index 000000000..01e32b496 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingClasseTarifariaServiceImpl.java @@ -0,0 +1,62 @@ +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.GP_PricingClasseTarifariaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingClasseTarifaria; +import com.rjconsultores.ventaboletos.service.GP_PricingClasseTarifariaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingClasseTarifariaService") +public class GP_PricingClasseTarifariaServiceImpl implements GP_PricingClasseTarifariaService { + + @Autowired + private GP_PricingClasseTarifariaDAO pricingClasseTarifariaDAO; + + @Override + public List obtenerTodos() { + return pricingClasseTarifariaDAO.obtenerTodos(); + } + + @Override + public GP_PricingClasseTarifaria obtenerID(Integer id) { + return pricingClasseTarifariaDAO.obtenerID(id); + } + + @Override + @Transactional + public GP_PricingClasseTarifaria suscribir(GP_PricingClasseTarifaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + return pricingClasseTarifariaDAO.suscribir(entidad); + } + + @Override + @Transactional + public GP_PricingClasseTarifaria actualizacion(GP_PricingClasseTarifaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + return pricingClasseTarifariaDAO.actualizacion(entidad); + } + + @Override + @Transactional + public void borrar(GP_PricingClasseTarifaria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + pricingClasseTarifariaDAO.actualizacion(entidad); + } + + public Boolean validacionSigla(String sigla) { + return pricingClasseTarifariaDAO.validacionSigla(sigla); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingCorridaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingCorridaServiceImpl.java new file mode 100644 index 000000000..bca83d0c9 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingCorridaServiceImpl.java @@ -0,0 +1,66 @@ +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.GP_PricingCorridaDAO; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCorrida; +import com.rjconsultores.ventaboletos.service.GP_PricingCorridaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingCorridaService") +public class GP_PricingCorridaServiceImpl implements GP_PricingCorridaService { + + @Autowired + private GP_PricingCorridaDAO pricingCorridaDAO; + + public List obtenerTodos() { + return pricingCorridaDAO.obtenerTodos(); + } + + public GP_PricingCorrida obtenerID(Integer id) { + return pricingCorridaDAO.obtenerID(id); + } + + @Transactional + public GP_PricingCorrida suscribir(GP_PricingCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingCorridaDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingCorrida actualizacion(GP_PricingCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingCorridaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingCorrida entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingCorridaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingCorrida(GP_Pricing pricing, CorridaCtrl corrida) { + return pricingCorridaDAO.obtenerPricingCorrida(pricing, corrida); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingCorridaDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingDiaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingDiaServiceImpl.java new file mode 100644 index 000000000..903da85c7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingDiaServiceImpl.java @@ -0,0 +1,65 @@ +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.GP_PricingDiaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingDia; +import com.rjconsultores.ventaboletos.service.GP_PricingDiaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingDiaService") +public class GP_PricingDiaServiceImpl implements GP_PricingDiaService { + + @Autowired + private GP_PricingDiaDAO pricingDiaDAO; + + public List obtenerTodos() { + return pricingDiaDAO.obtenerTodos(); + } + + public GP_PricingDia obtenerID(Integer id) { + return pricingDiaDAO.obtenerID(id); + } + + @Transactional + public GP_PricingDia suscribir(GP_PricingDia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingDiaDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingDia actualizacion(GP_PricingDia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingDiaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingDia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingDiaDAO.actualizacion(entidad); + } + + public List buscarTraslapa(GP_PricingDia pricingDia) { + return pricingDiaDAO.buscarTraslapa(pricingDia); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingDiaDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoAgenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoAgenciaServiceImpl.java new file mode 100644 index 000000000..0831b527b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoAgenciaServiceImpl.java @@ -0,0 +1,62 @@ +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.GP_PricingEspecificoAgenciaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoAgencia; +import com.rjconsultores.ventaboletos.service.GP_PricingEspecificoAgenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingEspecificoAgenciaService") +public class GP_PricingEspecificoAgenciaServiceImpl implements GP_PricingEspecificoAgenciaService { + @Autowired + private GP_PricingEspecificoAgenciaDAO pricingEspecificoAgenciaDAO; + + @Override + public List obtenerTodos() { + return pricingEspecificoAgenciaDAO.obtenerTodos(); + } + + @Override + public GP_PricingEspecificoAgencia obtenerID(Long id) { + return pricingEspecificoAgenciaDAO.obtenerID(id); + } + + @Override + @Transactional + public GP_PricingEspecificoAgencia suscribir(GP_PricingEspecificoAgencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setActivo(Boolean.TRUE); + + return pricingEspecificoAgenciaDAO.suscribir(entidad); + } + + @Override + @Transactional + public GP_PricingEspecificoAgencia actualizacion(GP_PricingEspecificoAgencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + + return pricingEspecificoAgenciaDAO.actualizacion(entidad); + } + + @Override + @Transactional + public void borrar(GP_PricingEspecificoAgencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingEspecificoAgenciaDAO.actualizacion(entidad); + } + @Override + public Boolean existeAgenciaPricing (GP_PricingEspecificoAgencia entidad){ + return pricingEspecificoAgenciaDAO.isDuplicado(entidad); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoCanalVendasServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoCanalVendasServiceImpl.java new file mode 100644 index 000000000..b44fd1d0c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoCanalVendasServiceImpl.java @@ -0,0 +1,62 @@ +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.GP_PricingEspecificoCanalVendasDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCanalVendas; +import com.rjconsultores.ventaboletos.service.GP_PricingEspecificoCanalVendasService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingEspecificoCanalVendasService") +public class GP_PricingEspecificoCanalVendasServiceImpl implements GP_PricingEspecificoCanalVendasService { + @Autowired + private GP_PricingEspecificoCanalVendasDAO pricingEspecificoCanalVendasDAO; + + @Override + public List obtenerTodos() { + return pricingEspecificoCanalVendasDAO.obtenerTodos(); + } + + @Override + public GP_PricingEspecificoCanalVendas obtenerID(Long id) { + return pricingEspecificoCanalVendasDAO.obtenerID(id); + } + + @Override + @Transactional + public GP_PricingEspecificoCanalVendas suscribir(GP_PricingEspecificoCanalVendas entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setActivo(Boolean.TRUE); + + return pricingEspecificoCanalVendasDAO.suscribir(entidad); + } + + @Override + @Transactional + public GP_PricingEspecificoCanalVendas actualizacion(GP_PricingEspecificoCanalVendas entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + + return pricingEspecificoCanalVendasDAO.actualizacion(entidad); + } + + @Override + @Transactional + public void borrar(GP_PricingEspecificoCanalVendas entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingEspecificoCanalVendasDAO.actualizacion(entidad); + } + @Override + public Boolean existeCanalVendasPricing (GP_PricingEspecificoCanalVendas entidad){ + return pricingEspecificoCanalVendasDAO.isDuplicado(entidad); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoCategoriaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoCategoriaServiceImpl.java new file mode 100644 index 000000000..6e933a40e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoCategoriaServiceImpl.java @@ -0,0 +1,58 @@ +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.GP_PricingEspecificoCategoriaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCategoria; +import com.rjconsultores.ventaboletos.service.GP_PricingEspecificoCategoriaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingEspecificoCategoriaService") +public class GP_PricingEspecificoCategoriaServiceImpl implements GP_PricingEspecificoCategoriaService { + @Autowired + private GP_PricingEspecificoCategoriaDAO pricingEspecificoCategoriaDAO; + + @Override + public List obtenerTodos() { + return pricingEspecificoCategoriaDAO.obtenerTodos(); + } + + @Override + public GP_PricingEspecificoCategoria obtenerID(Long id) { + return pricingEspecificoCategoriaDAO.obtenerID(id); + } + + @Override + @Transactional + public GP_PricingEspecificoCategoria suscribir(GP_PricingEspecificoCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setActivo(Boolean.TRUE); + + return pricingEspecificoCategoriaDAO.suscribir(entidad); + } + + @Override + @Transactional + public GP_PricingEspecificoCategoria actualizacion(GP_PricingEspecificoCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + + return pricingEspecificoCategoriaDAO.actualizacion(entidad); + } + + @Override + @Transactional + public void borrar(GP_PricingEspecificoCategoria entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingEspecificoCategoriaDAO.actualizacion(entidad); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoOcupacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoOcupacionServiceImpl.java new file mode 100644 index 000000000..862dee7e2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoOcupacionServiceImpl.java @@ -0,0 +1,57 @@ +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.GP_PricingEspecificoOcupacionDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoOcupacion; +import com.rjconsultores.ventaboletos.service.GP_PricingEspecificoOcupacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingEspecificoOcupacionService") +public class GP_PricingEspecificoOcupacionServiceImpl implements GP_PricingEspecificoOcupacionService { + @Autowired + private GP_PricingEspecificoOcupacionDAO pricingEspecificoOcupacionDAO; + + @Override + public List obtenerTodos() { + return pricingEspecificoOcupacionDAO.obtenerTodos(); + } + + @Override + public GP_PricingEspecificoOcupacion obtenerID(Long id) { + return pricingEspecificoOcupacionDAO.obtenerID(id); + } + + @Override + public GP_PricingEspecificoOcupacion suscribir(GP_PricingEspecificoOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingEspecificoOcupacionDAO.suscribir(entidad); + } + + @Override + @Transactional + public GP_PricingEspecificoOcupacion actualizacion(GP_PricingEspecificoOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + + return pricingEspecificoOcupacionDAO.actualizacion(entidad); + } + + @Override + public void borrar(GP_PricingEspecificoOcupacion entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingEspecificoOcupacionDAO.actualizacion(entidad); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoServiceImpl.java new file mode 100644 index 000000000..8bd1d1735 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingEspecificoServiceImpl.java @@ -0,0 +1,195 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.ArrayList; +import java.util.Calendar; +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.GP_PricingEspecificoDAO; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecifico; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoAgencia; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCanalVendas; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoCategoria; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecificoOcupacion; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.GP_PricingEspecificoService; +import com.rjconsultores.ventaboletos.service.GP_PricingHistoricoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingEspecificoService") +public class GP_PricingEspecificoServiceImpl implements GP_PricingEspecificoService { + + @Autowired + private GP_PricingEspecificoDAO pricingEspecificoDAO; + @Autowired + private GP_PricingHistoricoService pricingHistoricoService; + + public List obtenerTodos() { + return pricingEspecificoDAO.obtenerTodos(); + } + + public GP_PricingEspecifico obtenerID(Long id) { + return pricingEspecificoDAO.obtenerID(id); + } + + @Transactional + public GP_PricingEspecifico suscribir(GP_PricingEspecifico entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingEspecificoDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingEspecifico actualizacion(GP_PricingEspecifico entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return pricingEspecificoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingEspecifico entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + pricingEspecificoDAO.actualizacion(entidad); + + pricingHistoricoService.registarExclusao(entidad, false); + } + + public List buscarPorNome(GP_PricingEspecifico pricingEspecifico) { + return pricingEspecificoDAO.buscarPorNome(pricingEspecifico); + } + + @Override + public List buscarPorNome(String nome) { + // TODO Auto-generated method stub + return null; + } + + @Override + @Transactional + public GP_PricingEspecifico clonarPricing(Long id, String nome, List pricingCategoriaList) { + + GP_PricingEspecifico pricingToClone = obtenerID(id); + GP_PricingEspecifico clonePricing = new GP_PricingEspecifico(); + + clonePricing.setNombPricing(nome); + clonePricing.setClaseServicio(pricingToClone.getClaseServicio()); + clonePricing.setCorridaId(pricingToClone.getCorridaId()); + clonePricing.setFechorfin(pricingToClone.getFechorfin()); + clonePricing.setFechorinicio(pricingToClone.getFechorinicio()); + clonePricing.setMarca(pricingToClone.getMarca()); + clonePricing.setMoneda(pricingToClone.getMoneda()); + clonePricing.setParada(pricingToClone.getParada()); + clonePricing.setParada1(pricingToClone.getParada1()); + clonePricing.setPricingEspecificoOcupacionsList(getPricingEspecificoOcupacion(pricingToClone, clonePricing)); + clonePricing.setTarifa(pricingToClone.getTarifa()); + clonePricing.setTarifaredabierto(pricingToClone.getTarifaredabierto()); + + clonePricing.setPricingEspecificoAgenciasList(getPricingEspecificoAgenciasList(pricingToClone, clonePricing)); + clonePricing.setPricingEspecificoCanalVendasList(getPricingEspecificoCanalVendasList(pricingToClone, clonePricing)); + clonePricing.setPricingEspecificoCategoriaList(getPricingEspecificoCategoriaList(pricingToClone, clonePricing, pricingCategoriaList)); + + return suscribir(clonePricing); + } + + private List getPricingEspecificoAgenciasList(GP_PricingEspecifico pricingToClone, GP_PricingEspecifico clonePricing) { + + List toReturn = new ArrayList(); + + for (GP_PricingEspecificoAgencia a : pricingToClone.getPricingEspecificoAgenciasList()) { + if (a.getActivo()) { + GP_PricingEspecificoAgencia newPricingAgencia = new GP_PricingEspecificoAgencia(); + + newPricingAgencia.setActivo(true); + newPricingAgencia.setFecmodif(new Date()); + newPricingAgencia.setPricingEspecifico(clonePricing); + newPricingAgencia.setPuntoVenta(a.getPuntoVenta()); + newPricingAgencia.setUsuarioId(clonePricing.getUsuarioId()); + + toReturn.add(newPricingAgencia); + } + } + + return toReturn; + } + + private List getPricingEspecificoCanalVendasList(GP_PricingEspecifico pricingToClone, GP_PricingEspecifico clonePricing) { + + List toReturn = new ArrayList(); + + for (GP_PricingEspecificoCanalVendas c : pricingToClone.getPricingEspecificoCanalVendasList()) { + if (c.getActivo()) { + GP_PricingEspecificoCanalVendas newCanalVendas = new GP_PricingEspecificoCanalVendas(); + + newCanalVendas.setActivo(true); + newCanalVendas.setFecmodif(new Date()); + newCanalVendas.setPricingEspecifico(clonePricing); + newCanalVendas.setTipoPtovta(c.getTipoPtovta()); + newCanalVendas.setUsuarioId(clonePricing.getUsuarioId()); + + toReturn.add(newCanalVendas); + } + } + + return toReturn; + } + + private List getPricingEspecificoCategoriaList(GP_PricingEspecifico pricingToClone, GP_PricingEspecifico clonePricing, List pricingCategoriaList) { + + List toReturn = new ArrayList(); + + for (GP_PricingEspecificoCategoria c : pricingCategoriaList) { + if (c.getActivo()) { + GP_PricingEspecificoCategoria newCategoria = new GP_PricingEspecificoCategoria(); + + newCategoria.setActivo(true); + newCategoria.setFecmodif(new Date()); + newCategoria.setPricingEspecifico(clonePricing); + newCategoria.setCategoria(c.getCategoria()); + newCategoria.setUsuarioId(clonePricing.getUsuarioId()); + + toReturn.add(newCategoria); + } + } + + return toReturn; + } + + private List getPricingEspecificoOcupacion(GP_PricingEspecifico pricingToClone, GP_PricingEspecifico clonePricing){ + + List list = new ArrayList(); + + for(GP_PricingEspecificoOcupacion peo : pricingToClone.getPricingEspecificoOcupacionsList()){ + GP_PricingEspecificoOcupacion newPeo = new GP_PricingEspecificoOcupacion( + peo.getOcupacioninicial(), + peo.getOcupacionfinal(), + peo.getTarifa(), + peo.getActivo(), + new Date(), + UsuarioLogado.getUsuarioLogado().getUsuarioId(), + peo.getDescuento(), + clonePricing); + + list.add(newPeo); + } + + return list; + } + + @Override + public List buscar(List empresas, List tipoClasses, List origens, List destinos, Date vigenciaInicial, Date vigenciaFinal) { + return pricingEspecificoDAO.buscar(empresas, tipoClasses, origens, destinos, vigenciaInicial, vigenciaFinal); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingFormapagoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingFormapagoServiceImpl.java new file mode 100644 index 000000000..7b502e66c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingFormapagoServiceImpl.java @@ -0,0 +1,65 @@ +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.GP_PricingFormapagoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingFormapago; +import com.rjconsultores.ventaboletos.service.GP_PricingFormapagoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingFormapagoService") +public class GP_PricingFormapagoServiceImpl implements GP_PricingFormapagoService { + + @Autowired + private GP_PricingFormapagoDAO pricingFormapagoDAO; + + @Override + public List obtenerTodos() { + return pricingFormapagoDAO.obtenerTodos(); + } + + @Override + public GP_PricingFormapago obtenerID(Integer id) { + return pricingFormapagoDAO.obtenerID(id); + } + + @Transactional + public GP_PricingFormapago suscribir(GP_PricingFormapago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingFormapagoDAO.suscribir(entidad); + + } + + @Transactional + public GP_PricingFormapago actualizacion(GP_PricingFormapago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingFormapagoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingFormapago entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingFormapagoDAO.actualizacion(entidad); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingFormapagoDAO.obtenerTodoPorPricing(pricing); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingGestaoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingGestaoServiceImpl.java new file mode 100644 index 000000000..3673037c4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingGestaoServiceImpl.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +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.GP_PricingGestaoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingGestao; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.service.GP_PricingGestaoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingGestaoService") +public class GP_PricingGestaoServiceImpl implements GP_PricingGestaoService { + + @Autowired + private GP_PricingGestaoDAO pricingGestaoDAO; + + public List obtenerTodos() { + return pricingGestaoDAO.obtenerTodos(); + } + + public GP_PricingGestao obtenerID(Integer id) { + return pricingGestaoDAO.obtenerID(id); + } + + @Transactional + public GP_PricingGestao suscribir(GP_PricingGestao entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Pricing.ATIVO); + + return pricingGestaoDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingGestao actualizacion(GP_PricingGestao entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Pricing.ATIVO); + + return pricingGestaoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingGestao entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Pricing.EXCLUIDO); + + pricingGestaoDAO.actualizacion(entidad); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingHistoricoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingHistoricoServiceImpl.java new file mode 100644 index 000000000..63178d082 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingHistoricoServiceImpl.java @@ -0,0 +1,148 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +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; + +import com.rjconsultores.ventaboletos.dao.GP_PricingHistoricoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingEspecifico; +import com.rjconsultores.ventaboletos.entidad.GP_PricingHistorico; +import com.rjconsultores.ventaboletos.service.GP_PricingHistoricoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingHistoricoService") +public class GP_PricingHistoricoServiceImpl implements GP_PricingHistoricoService { + + @Autowired + private GP_PricingHistoricoDAO pricingHistoricoDAO; + + private static Logger log = Logger.getLogger(GP_PricingHistoricoServiceImpl.class); + + @Override + @Transactional + public void compararESalvar(Object original, Object novo) { + +// List alteracoes = Auditador.auditar(original, novo); +// +// Long idPricing = null; +// Boolean isPricingEspecifico = false; +// +// if(novo instanceof GP_PricingEspecifico ) { +// idPricing = ((GP_PricingEspecifico) novo).getPricingespecificoId(); +// isPricingEspecifico = true; +// } else { +// idPricing = Long.parseLong(((GP_Pricing) novo).getPricingId().toString()); +// isPricingEspecifico = false; +// } +// +// Date dataHoraAlteracao = Calendar.getInstance().getTime(); +// Integer usuarioId = UsuarioLogado.getUsuarioLogado().getUsuarioId(); +// +// for(AlteracoesDoObjeto alteracao : alteracoes) { +// GP_PricingHistorico historico = criarHistorico(alteracao.getDescricao(), alteracao.getClassePrincipal(), alteracao.getCampoAlterado(), +// alteracao.getClasseAlterada(), dataHoraAlteracao, idPricing, usuarioId, +// alteracao.getValorAnterior(), alteracao.getValorNovo(), isPricingEspecifico); +// +// try { +// pricingHistoricoDAO.suscribir(historico); +// } catch (Exception e) { +// log.error("Erro ao salvar o historico do pricing ", e); +// } +// } + } + + @Transactional + @Override + public void registarExclusao(Object pricing, Boolean ativar) { + Date dataHoraAlteracao = Calendar.getInstance().getTime(); + Integer usuarioId = UsuarioLogado.getUsuarioLogado().getUsuarioId(); + + String nomePricing = null; + Long pricingId = null; + Boolean isPricingEspecifico = false; + + if(pricing instanceof GP_PricingEspecifico ) { + nomePricing = ((GP_PricingEspecifico) pricing).getNombPricing(); + pricingId = ((GP_PricingEspecifico) pricing).getPricingespecificoId(); + isPricingEspecifico = true; + } else { + nomePricing = ((GP_Pricing) pricing).getNombPricing(); + pricingId = Long.parseLong(((GP_Pricing) pricing).getPricingId().toString()); + } + + StringBuilder descricao = new StringBuilder(); + + descricao.append("O Pricing ").append(pricingId).append(" - ").append(nomePricing) + .append(" foi " + (ativar ? "ativado " : "desativado") + " pelo usuário ").append(usuarioId).append(" - ").append(UsuarioLogado.getUsuarioLogado().getNombusuario()) + .append(" em ").append(getStringDate(dataHoraAlteracao)); + + GP_PricingHistorico historico = criarHistorico(descricao.toString(), "PRICING_RAPIDO", "ATIVO", "PRICING_RAPIDO", dataHoraAlteracao, + pricingId, usuarioId, ativar ? "NAO" : "SIM" , ativar ? "SIM" : "NAO", isPricingEspecifico); + + try { + pricingHistoricoDAO.suscribir(historico); + } catch (Exception e) { + log.error("Erro ao salvar o historico do pricing ", e); + } + } + + private String getStringDate(java.util.Date d) { + if (d != null) { + DateFormat df = new SimpleDateFormat("dd/MM/yyyy hh:mm"); + return df.format(d); + } + return null; + } + + private GP_PricingHistorico criarHistorico(String descricao, String classePrincipal, String campoAlterado, String classeAlterada, Date dataHoraAlteracao, Long pricingId, + Integer usuarioId, String valorAnterior, String valorNovo, Boolean isEspecifico) { + GP_PricingHistorico historico = new GP_PricingHistorico(); + + historico.setClassePrincipal(classePrincipal); + historico.setCampoAlterado(campoAlterado); + historico.setClasseAlterada(classeAlterada); + historico.setFecmodif(dataHoraAlteracao); + historico.setIsEspecifico(isEspecifico); + historico.setPricingId(pricingId); + historico.setUsuarioId(usuarioId); + historico.setValorAnterior(valorAnterior); + historico.setValorNovo(valorNovo); + historico.setDescricao(descricao); + + return historico; + } + + @Override + public List obtenerTodos() { + return pricingHistoricoDAO.obtenerTodos(); + } + + @Override + public GP_PricingHistorico obtenerID(Long id) { + return pricingHistoricoDAO.obtenerID(id); + } + + @Override + public GP_PricingHistorico suscribir(GP_PricingHistorico entidad) { + return pricingHistoricoDAO.suscribir(entidad); + } + + @Override + public GP_PricingHistorico actualizacion(GP_PricingHistorico entidad) { + return pricingHistoricoDAO.actualizacion(entidad); + } + + @Override + public void borrar(GP_PricingHistorico entidad) { + pricingHistoricoDAO.borrar(entidad); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingImporteServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingImporteServiceImpl.java new file mode 100644 index 000000000..f3f7112aa --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingImporteServiceImpl.java @@ -0,0 +1,66 @@ +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.GP_PricingImporteDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingImporte; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.service.GP_PricingImporteService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingImporteService") +public class GP_PricingImporteServiceImpl implements GP_PricingImporteService { + + @Autowired + private GP_PricingImporteDAO pricingImporteDAO; + + public List obtenerTodos() { + return pricingImporteDAO.obtenerTodos(); + } + + public GP_PricingImporte obtenerID(Integer id) { + return pricingImporteDAO.obtenerID(id); + } + + @Transactional + public GP_PricingImporte suscribir(GP_PricingImporte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingImporteDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingImporte actualizacion(GP_PricingImporte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingImporteDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingImporte entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingImporteDAO.actualizacion(entidad); + } + + public List buscarMoneda(GP_PricingImporte pricingImporte, Moneda moneda) { + return pricingImporteDAO.buscarMoneda(pricingImporte, moneda); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingImporteDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingMarcaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingMarcaServiceImpl.java new file mode 100644 index 000000000..4cc9e07e2 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingMarcaServiceImpl.java @@ -0,0 +1,66 @@ +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.GP_PricingMarcaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMarca; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.service.GP_PricingMarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingMarcaService") +public class GP_PricingMarcaServiceImpl implements GP_PricingMarcaService { + + @Autowired + private GP_PricingMarcaDAO pricingMarcaDAO; + + public List obtenerTodos() { + return pricingMarcaDAO.obtenerTodos(); + } + + public GP_PricingMarca obtenerID(Integer id) { + return pricingMarcaDAO.obtenerID(id); + } + + @Transactional + public GP_PricingMarca suscribir(GP_PricingMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingMarcaDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingMarca actualizacion(GP_PricingMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingMarcaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingMarca entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingMarcaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingMarca(GP_Pricing pricing, Marca marca) { + return pricingMarcaDAO.obtenerPricingMarca(pricing, marca); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingMarcaDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingMercadoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingMercadoServiceImpl.java new file mode 100644 index 000000000..a69f32d4d --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingMercadoServiceImpl.java @@ -0,0 +1,66 @@ +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.GP_PricingMercadoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMercado; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.GP_PricingMercadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingMercadoService") +public class GP_PricingMercadoServiceImpl implements GP_PricingMercadoService { + + @Autowired + private GP_PricingMercadoDAO pricingMercadoDAO; + + public List obtenerTodos() { + return pricingMercadoDAO.obtenerTodos(); + } + + public GP_PricingMercado obtenerID(Integer id) { + return pricingMercadoDAO.obtenerID(id); + } + + @Transactional + public GP_PricingMercado suscribir(GP_PricingMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingMercadoDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingMercado actualizacion(GP_PricingMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingMercadoDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingMercado entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingMercadoDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingMercado(GP_Pricing pricing, Parada origen, Parada destino) { + return pricingMercadoDAO.obtenerPricingMercado(pricing, origen, destino); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingMercadoDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingOcupaAntecipaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingOcupaAntecipaServiceImpl.java new file mode 100644 index 000000000..5ce8e854b --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingOcupaAntecipaServiceImpl.java @@ -0,0 +1,293 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.dao.GP_PricingOcupaAntecipaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingOcupaAntecipa; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.GP_PricingOcupaAntecipaService; +import com.rjconsultores.ventaboletos.utilerias.TraslaparUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingOcupaAntecipaLegendaVO; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingOcupaAntecipaLegendaVO.GP_PricingOcupaAtencipaLegendaItemVO; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingOcupaAntecipaPoltronasVO; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingOcupaAntecipaVO; + +@Service("gp_pricingOcupacionService") +public class GP_PricingOcupaAntecipaServiceImpl implements GP_PricingOcupaAntecipaService { + + private static final Logger log = LoggerFactory.getLogger(GP_PricingOcupaAntecipaServiceImpl.class); + + @Autowired + private GP_PricingOcupaAntecipaDAO pricingOcupacionDAO; + + @Transactional + public GP_PricingOcupaAntecipa suscribir(GP_PricingOcupaAntecipa entidad) throws BusinessException { + traslapa(entidad); + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingOcupacionDAO.suscribir(entidad); + } + + @Transactional(rollbackFor = BusinessException.class) + public GP_PricingOcupaAntecipa actualizacion(GP_PricingOcupaAntecipa entidad) throws BusinessException { + traslapa(entidad); + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingOcupacionDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingOcupaAntecipa entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingOcupacionDAO.actualizacion(entidad); + } + + public List updateList(GP_PricingOcupaAntecipa pricingOcupaAntecipa) { + List lsSalvos = pricingOcupacionDAO.buscarOcupaAntecipaPricing(pricingOcupaAntecipa.getPricing().getPricingId()); + return lsSalvos; + } + + private void traslapa(GP_PricingOcupaAntecipa pricingOcupaAntecipa) throws BusinessException { + + List lsSalvos = pricingOcupacionDAO.buscarOcupaAntecipaPricing(pricingOcupaAntecipa.getPricing().getPricingId()); + + // removo o pricing que eu estou validando + lsSalvos.remove(pricingOcupaAntecipa); + + BigDecimal cantocupaini = pricingOcupaAntecipa.getOcupacioninicial(); + BigDecimal cantocupafin = pricingOcupaAntecipa.getOcupacionfinal(); + + boolean validaCantPorcentaje = ((cantocupaini != null) && (cantocupafin != null)); + + Integer cantasientosmin = pricingOcupaAntecipa.getCantasientosmin(); + Integer cantasientosmax = pricingOcupaAntecipa.getCantasientosmax(); + + boolean validaCantAsientos = ((cantasientosmin != null) && (cantasientosmax != null)); + + Integer cantdiasmin = pricingOcupaAntecipa.getCantdiasmin(); + Integer cantdiasmax = pricingOcupaAntecipa.getCantdiasmax(); + + boolean validaCantDias = ((cantdiasmin != null) && (cantdiasmax != null)); + + for (GP_PricingOcupaAntecipa poa : lsSalvos) { + boolean traslapaCantPorcentaje = false; + if (validaCantPorcentaje) { + if ((poa.getOcupacioninicial() != null) && (poa.getOcupacionfinal() != null)) { + traslapaCantPorcentaje = TraslaparUtil.intersectNum(poa.getOcupacioninicial(), poa.getOcupacionfinal(), cantocupaini, cantocupafin); + } + } + + boolean traslapaCantAsiento = false; + if (validaCantAsientos) { + if ((poa.getCantasientosmin() != null) && (poa.getCantasientosmax() != null)) { + traslapaCantAsiento = TraslaparUtil.intersectNum(poa.getCantasientosmin(), poa.getCantasientosmax(), cantasientosmin, cantasientosmax); + } + } + + boolean traslapaCantDias = false; + if (validaCantDias) { + if ((poa.getCantdiasmin() != null) && (poa.getCantdiasmax() != null)) { + traslapaCantDias = TraslaparUtil.intersectNum(poa.getCantdiasmin(), poa.getCantdiasmax(), cantdiasmin, cantdiasmax); + } + } + + if ((traslapaCantPorcentaje || traslapaCantAsiento ) && traslapaCantDias ){ + List args = new ArrayList(); + String dias = poa.getCantdiasmin() + "-" + poa.getCantdiasmax(); + args.add(dias); + String faixa = null; + if(traslapaCantPorcentaje) { + faixa = poa.getOcupacioninicial() + "-" + poa.getOcupacionfinal(); + } + if(traslapaCantAsiento) { + faixa = poa.getCantasientosmin() + "-" + poa.getCantasientosmax(); + } + args.add(faixa); + log.info("registro que traslapa PricingOcupaAntecipa id =" + poa.getPricingocupaantecipaId()); + throw new BusinessException("PricingOcupaAntecipaServiceImpl.msg.traslapa", args.toArray()); + } + + } + + } + + @Override + public List carregarPricingOcupaAntecipaVO(Integer pricingId) { + List pricingOcupaAntecipas = carregarPricingOcupaAntecipa(pricingId); + return carregarPricingOcupaAntecipaVO(pricingOcupaAntecipas); + } + + @Override + public List carregarPricingOcupaAntecipaVO(List pricingOcupaAntecipas) { + List aux = new ArrayList(); + + for (GP_PricingOcupaAntecipa ocupacaoAntecipa: pricingOcupaAntecipas) { + Integer cantdiasmax = ocupacaoAntecipa.getCantdiasmax() != null ? ocupacaoAntecipa.getCantdiasmax() : GP_PricingOcupaAntecipaVO.CANTDIASMAXDEFAULT; + GP_PricingOcupaAntecipaVO ocupacao = new GP_PricingOcupaAntecipaVO(); + + ocupacao.setPricingocupaantecipaId(ocupacaoAntecipa.getPricingocupaantecipaId()); + ocupacao.setDias(ocupacaoAntecipa.getCantdiasmin() + "-" + cantdiasmax); + ocupacao.setDiaMin(ocupacaoAntecipa.getCantdiasmin()); + int linhaMax = cantdiasmax.equals(GP_PricingOcupaAntecipaVO.CANTDIASMAXDEFAULT) ? ocupacaoAntecipa.getCantdiasmin() + 10 : cantdiasmax; + if(linhaMax > GP_PricingOcupaAntecipaVO.CANTDIASMAXDEFAULT) { + linhaMax = GP_PricingOcupaAntecipaVO.CANTDIASMAXDEFAULT; + } + + ocupacao.setDiaMax(linhaMax); + + if(ocupacaoAntecipa.getOcupacioninicial() != null && ocupacaoAntecipa.getOcupacionfinal() != null) { + ocupacao.setOcupMin(ocupacaoAntecipa.getOcupacioninicial().intValue()); + ocupacao.setOcupMax(ocupacaoAntecipa.getOcupacionfinal().intValue()); + } else if(ocupacaoAntecipa.getCantasientosmin() != null && ocupacaoAntecipa.getCantasientosmax() != null) { + ocupacao.setOcupMin(ocupacaoAntecipa.getCantasientosmin().intValue()); + ocupacao.setOcupMax(ocupacaoAntecipa.getCantasientosmax().intValue()); + } + ocupacao.setCor(ocupacaoAntecipa.getCor()); + ocupacao.setPercentual(ocupacaoAntecipa.getPorcentaje()); + + ocupacao.marcarPoltronas(); + + aux.add(ocupacao); + } + + Collections.sort(aux, new Comparator() { + + @Override + public int compare(GP_PricingOcupaAntecipaVO o1, GP_PricingOcupaAntecipaVO o2) { + int retorno = o1.getDiaMin().compareTo(o2.getDiaMax()); + return retorno; + } + }); + + + List retorno = new ArrayList(); + for (GP_PricingOcupaAntecipaVO pricingOcupacaoAntecipa : aux) { + retorno.addAll(gerarDados(pricingOcupacaoAntecipa)); + } + + retorno = agruparMesmoDias(retorno); + + if(retorno.size() >= 3) { + retorno.get(retorno.size() - 2).setAuxDesc("..."); + } + + if(retorno.size() >= 2) { + retorno.get(retorno.size() - 1).setAuxDesc(GP_PricingOcupaAntecipaVO.CANTDIASMAXDEFAULT.toString()); + } + + return retorno; + } + + private List agruparMesmoDias(List lsOcupacaoAntecipas) { + List retorno = new ArrayList(); + for (GP_PricingOcupaAntecipaVO pricingOcupacaoAntecipa : lsOcupacaoAntecipas) { + GP_PricingOcupaAntecipaVO aux = new GP_PricingOcupaAntecipaVO(pricingOcupacaoAntecipa, true); + if(retorno.isEmpty() || !retorno.contains(aux)) { + retorno.add(aux); + } else { + int index = retorno.indexOf(pricingOcupacaoAntecipa); + retorno.get(index).getPoltronas().addAll(aux.getPoltronas()); + } + } + + adicionarPoltronasNaoMarcadas(retorno); + + return retorno; + } + + private void adicionarPoltronasNaoMarcadas(List lsRetorno) { + for (GP_PricingOcupaAntecipaVO pricingOcupacaoAntecipa : lsRetorno) { + List poltronasPadrao = GP_PricingOcupaAntecipaPoltronasVO.carregarPoltronasPadrao(); + poltronasPadrao.removeAll(pricingOcupacaoAntecipa.getPoltronas()); + pricingOcupacaoAntecipa.getPoltronas().addAll(poltronasPadrao); + Collections.sort(pricingOcupacaoAntecipa.getPoltronas(), new Comparator() { + @Override + public int compare(GP_PricingOcupaAntecipaPoltronasVO o1, GP_PricingOcupaAntecipaPoltronasVO o2) { + return o1.getPoltrona().compareTo(o2.getPoltrona()); + } + }); + } + } + + private List gerarDados(GP_PricingOcupaAntecipaVO ocupacao) { + List retorno = new ArrayList(); + for (int i = ocupacao.getDiaMin(); i <= ocupacao.getDiaMax(); i++) { + GP_PricingOcupaAntecipaVO pricingOcupacao = new GP_PricingOcupaAntecipaVO(ocupacao); + pricingOcupacao.setAntecipacao(i); + retorno.add(pricingOcupacao); + } + return retorno; + } + + @Override + public List carregarPricingOcupaAntecipaLegenda(Integer pricingId) { + List lsPricingOcupaAntecipa = carregarPricingOcupaAntecipa(pricingId); + + return carregarPricingOcupaAntecipaLegenda(lsPricingOcupaAntecipa); + } + + @Override + public List carregarPricingOcupaAntecipaLegenda(List lsPricingOcupaAntecipa) { + NumberFormat nf = NumberFormat.getPercentInstance(); + nf.setMaximumFractionDigits(2); + nf.setMinimumFractionDigits(2); + + GP_PricingOcupaAntecipaLegendaVO legendaDias = new GP_PricingOcupaAntecipaLegendaVO(); + GP_PricingOcupaAntecipaLegendaVO legendaPercentuais = new GP_PricingOcupaAntecipaLegendaVO(); + legendaDias.setLegenda(Labels.getLabel("editarPricingController.legenda.label")); + legendaDias.setItens(new ArrayList()); + legendaPercentuais.setItens(new ArrayList()); + for (GP_PricingOcupaAntecipa ocupaAntecipa : lsPricingOcupaAntecipa) { + Integer cantdiasmax = ocupaAntecipa.getCantdiasmax() != null ? ocupaAntecipa.getCantdiasmax() : GP_PricingOcupaAntecipaVO.CANTDIASMAXDEFAULT; + String dias = ocupaAntecipa.getCantdiasmin() + "-" + cantdiasmax; + GP_PricingOcupaAtencipaLegendaItemVO auxDias = legendaDias.new GP_PricingOcupaAtencipaLegendaItemVO(dias, nf.format(ocupaAntecipa.getPorcentaje().doubleValue()/100), ocupaAntecipa.getCor(), dias, ocupaAntecipa.getPricingocupaantecipaId()); + GP_PricingOcupaAtencipaLegendaItemVO auxPercentual = legendaDias.new GP_PricingOcupaAtencipaLegendaItemVO(nf.format(ocupaAntecipa.getPorcentaje().doubleValue()/100), nf.format(ocupaAntecipa.getPorcentaje().doubleValue()/100), ocupaAntecipa.getCor(), dias, ocupaAntecipa.getPricingocupaantecipaId()); + if(!legendaDias.getItens().contains(auxDias)) { + legendaDias.getItens().add(auxDias); + legendaPercentuais.getItens().add(auxPercentual); + } + } + List retorno = new ArrayList(); + retorno.add(legendaDias); + retorno.add(legendaPercentuais); + return retorno; + } + + @Override + public GP_PricingOcupaAntecipa obtenerID(Integer pricingocupaantecipaId) throws BusinessException { + return pricingOcupacionDAO.obtenerID(pricingocupaantecipaId); + } + + @Override + public List carregarPricingOcupaAntecipa(Integer pricingId) { + return pricingOcupacionDAO.buscarOcupaAntecipaPricingAtivos(pricingId); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingOcupacionDAO.obtenerTodoPorPricing(pricing); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingPuntoVentaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingPuntoVentaServiceImpl.java new file mode 100644 index 000000000..7ee3754a1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingPuntoVentaServiceImpl.java @@ -0,0 +1,66 @@ +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.GP_PricingPuntoVentaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.GP_PricingPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("p_pricingPuntoVentaService") +public class GP_PricingPuntoVentaServiceImpl implements GP_PricingPuntoVentaService { + + @Autowired + private GP_PricingPuntoVentaDAO pricingPuntoVentaDAO; + + public List obtenerTodos() { + return pricingPuntoVentaDAO.obtenerTodos(); + } + + public GP_PricingPuntoVenta obtenerID(Integer id) { + return pricingPuntoVentaDAO.obtenerID(id); + } + + @Transactional + public GP_PricingPuntoVenta suscribir(GP_PricingPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingPuntoVentaDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingPuntoVenta actualizacion(GP_PricingPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingPuntoVentaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingPuntoVenta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingPuntoVentaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingPuntoVenta(GP_Pricing pricing, PuntoVenta puntoVenta) { + return pricingPuntoVentaDAO.obtenerPricingPuntoVenta(pricing, puntoVenta); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingPuntoVentaDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingRevisaoValoresServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingRevisaoValoresServiceImpl.java new file mode 100644 index 000000000..741a93331 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingRevisaoValoresServiceImpl.java @@ -0,0 +1,186 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.rjconsultores.ventaboletos.dao.CorridaTramoDAO; +import com.rjconsultores.ventaboletos.dao.GP_PricingDAO; +import com.rjconsultores.ventaboletos.dao.TramoDAO; +import com.rjconsultores.ventaboletos.entidad.GP_PricingClase; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCorrida; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMarca; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMercado; +import com.rjconsultores.ventaboletos.entidad.GP_PricingOcupaAntecipa; +import com.rjconsultores.ventaboletos.entidad.GP_PricingRuta; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.service.GP_PricingRevisaoValoresService; +import com.rjconsultores.ventaboletos.utilerias.MoneyHelper; +import com.rjconsultores.ventaboletos.vo.pricing.GP_PricingRevisaoValoresVO; + +@Service("gp_pricingRevisaoValoresService") +public class GP_PricingRevisaoValoresServiceImpl implements GP_PricingRevisaoValoresService { + + private static final Logger log = LoggerFactory.getLogger(GP_PricingRevisaoValoresServiceImpl.class); + + @Autowired + private GP_PricingDAO pricingDAO; + @Autowired + private TramoDAO tramoDao; + @Autowired + private CorridaTramoDAO corridaTramoDAO; + + private static final BigDecimal HUNDRED = new BigDecimal(100); + + + @Override + public List obtenerTodos() { + return null; + } + + @Override + public GP_PricingRevisaoValoresVO obtenerID(Long id) { + return null; + } + + @Override + public GP_PricingRevisaoValoresVO suscribir(GP_PricingRevisaoValoresVO entidad) { + return null; + } + + @Override + public GP_PricingRevisaoValoresVO actualizacion(GP_PricingRevisaoValoresVO entidad) { + return null; + } + + @Override + public void borrar(GP_PricingRevisaoValoresVO entidad) { + } + + public List buscarPricingRevisaoValoresVO(List lsPricingVigencia, + List lsPricingClase, + List lsPricingMarca, List lsPricingMercado, + List lsPricingOcupaAntecipa, List lsPricingCorrida, + List lsPricingRuta) { + List classeServicioIds = validaPricingClasseServico(lsPricingClase); + List marcaIds = validaPricingMarca(lsPricingMarca); + List rutaIds = validaPricingRuta(lsPricingRuta); + List tramoIds = validaPricingTramo(lsPricingMercado); + tramoIds = validaPricingCorrida(lsPricingCorrida, tramoIds); + + + List pricingRevisaoValoresVOs = pricingDAO.buscarPricingRevisaoValoresVO(classeServicioIds, marcaIds, rutaIds, tramoIds ,lsPricingVigencia); + return validaDescontosCadastradosPricing(pricingRevisaoValoresVOs, lsPricingOcupaAntecipa); + } + + private List validaDescontosCadastradosPricing(List pricingRevisaoValoresVOs, List lsPricingOcupaAntecipa) { + List retornoPricingRevisaoValoresVOs = new ArrayList(); + if(!lsPricingOcupaAntecipa.isEmpty()) { + for (GP_PricingOcupaAntecipa gp_PricingOcupaAntecipa : lsPricingOcupaAntecipa) { + for (GP_PricingRevisaoValoresVO gp_PricingRevisaoValoresVO : pricingRevisaoValoresVOs) { + GP_PricingRevisaoValoresVO revisaoValoresVO = new GP_PricingRevisaoValoresVO(gp_PricingRevisaoValoresVO); + BigDecimal tarifaPricing = BigDecimal.ZERO; + String desconto = null; + String antecipacao = null; + String ocupacao = null; + if(gp_PricingOcupaAntecipa.getPorcentaje()!= null) { + tarifaPricing = MoneyHelper.getValorDescontadoPercentual(gp_PricingRevisaoValoresVO.getTarifaAtual(), gp_PricingOcupaAntecipa.getPorcentaje()); + desconto = gp_PricingOcupaAntecipa.getPorcentaje()+"%"; + }else { + tarifaPricing = gp_PricingRevisaoValoresVO.getTarifaAtual().subtract( gp_PricingOcupaAntecipa.getImporte()); + desconto = MoneyHelper.getValor(gp_PricingOcupaAntecipa.getImporte()); + } + antecipacao = gp_PricingOcupaAntecipa.getCantdiasmin() +" - "+ gp_PricingOcupaAntecipa.getCantdiasmax(); + ocupacao = gp_PricingOcupaAntecipa.getOcupacioninicial() +" - "+ gp_PricingOcupaAntecipa.getOcupacionfinal(); + revisaoValoresVO.setTarifaComPricing(tarifaPricing); + revisaoValoresVO.setDesconto(desconto); + revisaoValoresVO.setAntecipacao(antecipacao); + revisaoValoresVO.setOcupacao(ocupacao); + retornoPricingRevisaoValoresVOs.add(revisaoValoresVO); + } + } + + } + + return retornoPricingRevisaoValoresVOs; + } + + private List validaPricingCorrida(List lsPricingCorrida, List tramoIds) { + Set tramosCorrida = new HashSet(tramoIds); + for (GP_PricingCorrida gp_PricingCorrida : lsPricingCorrida) { + List listTramo = corridaTramoDAO.buscarTramoPorCorridaId(gp_PricingCorrida.getCorridaCtrl().getCorridaId()); + for (Tramo tramo : listTramo) { + tramosCorrida.add(tramo.getTramoId()); + } + } + return new ArrayList(tramosCorrida); + } + + private List validaPricingTramo(List lsPricingMercado) { + List tramos = new ArrayList(); + for (GP_PricingMercado gp_PricingMercado : lsPricingMercado) { + tramos = tramoDao.obtenerTramosPorOrigemDestino(gp_PricingMercado.getOrigen(), gp_PricingMercado.getDestino()); + } + Set tramosIds = new HashSet(); + if(tramos!= null && !tramos.isEmpty()) { + for (Tramo tramo : tramos) { + tramosIds.add(tramo.getTramoId()); + } + } + + + return new ArrayList(tramosIds); + } + + private List validaPricingRuta(List lsPricingRuta) { + List rutaIds = null; + if (!lsPricingRuta.isEmpty()) { + rutaIds = new ArrayList(); + for (GP_PricingRuta ruta : lsPricingRuta) { + if (ruta.getRuta().getRutaId() != -1) { + rutaIds.add(ruta.getRuta().getRutaId()); + } + } + } + return rutaIds; + } + + private List validaPricingMarca(List lsPricingMarca) { + List marcaIds = null; + if (!lsPricingMarca.isEmpty()) { + marcaIds = new ArrayList(); + for (GP_PricingMarca marca : lsPricingMarca) { + if (marca.getMarca().getMarcaId() != -1) { + marcaIds.add(marca.getMarca().getMarcaId().intValue()); + } + } + } + return marcaIds; + } + + /** + * @param lsPricingClase + * @return + */ + private List validaPricingClasseServico(List lsPricingClase) { + List classeServicioIds = null; + if (!lsPricingClase.isEmpty()) { + classeServicioIds = new ArrayList(); + for (GP_PricingClase clase : lsPricingClase) { + if (clase.getClaseServicio().getClaseservicioId() != -1) { + classeServicioIds.add(clase.getClaseServicio().getClaseservicioId()); + } + } + } + return classeServicioIds; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingRutaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingRutaServiceImpl.java new file mode 100644 index 000000000..411e5f991 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingRutaServiceImpl.java @@ -0,0 +1,66 @@ +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.GP_PricingRutaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.service.GP_PricingRutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingRutaService") +public class GP_PricingRutaServiceImpl implements GP_PricingRutaService { + + @Autowired + private GP_PricingRutaDAO pricingRutaDAO; + + public List obtenerTodos() { + return pricingRutaDAO.obtenerTodos(); + } + + public GP_PricingRuta obtenerID(Integer id) { + return pricingRutaDAO.obtenerID(id); + } + + @Transactional + public GP_PricingRuta suscribir(GP_PricingRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingRutaDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingRuta actualizacion(GP_PricingRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingRutaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingRuta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingRutaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingRuta(GP_Pricing pricing, Ruta ruta) { + return pricingRutaDAO.obtenerPricingRuta(pricing, ruta); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingRutaDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingServiceImpl.java new file mode 100644 index 000000000..84a0c42ec --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingServiceImpl.java @@ -0,0 +1,590 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.math.BigDecimal; +import java.util.ArrayList; +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.GP_PricingDAO; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingAsiento; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCategoria; +import com.rjconsultores.ventaboletos.entidad.GP_PricingClase; +import com.rjconsultores.ventaboletos.entidad.GP_PricingCorrida; +import com.rjconsultores.ventaboletos.entidad.GP_PricingDia; +import com.rjconsultores.ventaboletos.entidad.GP_PricingFormapago; +import com.rjconsultores.ventaboletos.entidad.GP_PricingImporte; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMarca; +import com.rjconsultores.ventaboletos.entidad.GP_PricingMercado; +import com.rjconsultores.ventaboletos.entidad.GP_PricingOcupaAntecipa; +import com.rjconsultores.ventaboletos.entidad.GP_PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.GP_PricingRuta; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.GP_PricingHistoricoService; +import com.rjconsultores.ventaboletos.service.GP_PricingService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingService") +public class GP_PricingServiceImpl implements GP_PricingService { + + @Autowired + private GP_PricingDAO pricingDAO; + + @Autowired + private GP_PricingHistoricoService pricingHistoricoService; + + @Autowired + private CategoriaService categoriaService; + + public List obtenerTodos() { + return pricingDAO.obtenerTodos(); + } + + public GP_Pricing obtenerID(Integer id) { + return pricingDAO.obtenerID(id); + } + + @Transactional + public GP_Pricing suscribir(GP_Pricing entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingDAO.suscribir(entidad); + } + + @Transactional + public GP_Pricing actualizacion(GP_Pricing entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingDAO.actualizacion(entidad); + } + + private void ativarInativarExcluirPricing(GP_Pricing entidad, Integer ativarInativarExcluir) { + entidad = obtenerID(entidad.getPricingId()); + + for (GP_PricingAsiento pricingAsiento : entidad.getPricingAsientoList()) { + pricingAsiento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingAsiento.setFecmodif(Calendar.getInstance().getTime()); + pricingAsiento.setActivo(ativarInativarExcluir); + } + + for (GP_PricingCategoria pricingCategoria : entidad.getPricingCategoriaList()) { + pricingCategoria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingCategoria.setFecmodif(Calendar.getInstance().getTime()); + pricingCategoria.setActivo(ativarInativarExcluir); + } + + for (GP_PricingClase pricingClase : entidad.getPricingClaseList()) { + pricingClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingClase.setFecmodif(Calendar.getInstance().getTime()); + pricingClase.setActivo(ativarInativarExcluir); + } + + for (GP_PricingCorrida pricingCorrida : entidad.getPricingCorridaList()) { + pricingCorrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingCorrida.setFecmodif(Calendar.getInstance().getTime()); + pricingCorrida.setActivo(ativarInativarExcluir); + } + + for (GP_PricingDia pricingDia : entidad.getPricingDiaList()) { + pricingDia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingDia.setFecmodif(Calendar.getInstance().getTime()); + pricingDia.setActivo(ativarInativarExcluir); + } + + for (GP_PricingImporte pricingImporte : entidad.getPricingImporteList()) { + pricingImporte.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingImporte.setFecmodif(Calendar.getInstance().getTime()); + pricingImporte.setActivo(ativarInativarExcluir); + } + + for (GP_PricingMarca pricingMarca : entidad.getPricingMarcaList()) { + pricingMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingMarca.setFecmodif(Calendar.getInstance().getTime()); + pricingMarca.setActivo(ativarInativarExcluir); + } + + for (GP_PricingMercado pricingMercado : entidad.getPricingMercadoList()) { + pricingMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingMercado.setFecmodif(Calendar.getInstance().getTime()); + pricingMercado.setActivo(ativarInativarExcluir); + } + + for (GP_PricingOcupaAntecipa pricingOcupaAntecipa : entidad.getPricingOcupaAntecipaList()) { + pricingOcupaAntecipa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingOcupaAntecipa.setFecmodif(Calendar.getInstance().getTime()); + pricingOcupaAntecipa.setActivo(ativarInativarExcluir); + } + + for (GP_PricingPuntoVenta pricingPuntoVenta : entidad.getPricingPuntoventaList()) { + pricingPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + pricingPuntoVenta.setActivo(ativarInativarExcluir); + } + + for (GP_PricingRuta pricingRuta : entidad.getPricingRutaList()) { + pricingRuta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingRuta.setFecmodif(Calendar.getInstance().getTime()); + pricingRuta.setActivo(ativarInativarExcluir); + } + + for (GP_PricingTipoPtoVta pricingTipoPtoVta : entidad.getPricingTipoptovtaList()) { + pricingTipoPtoVta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingTipoPtoVta.setFecmodif(Calendar.getInstance().getTime()); + pricingTipoPtoVta.setActivo(ativarInativarExcluir); + } + + for (GP_PricingVigencia pricingVigencia : entidad.getPricingVigenciaList()) { + pricingVigencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingVigencia.setFecmodif(Calendar.getInstance().getTime()); + pricingVigencia.setActivo(ativarInativarExcluir); + } + + for (GP_PricingTipoServicio pricingTipoServicio : entidad.getPricingTipoServicioList()) { + pricingTipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingTipoServicio.setFecmodif(Calendar.getInstance().getTime()); + pricingTipoServicio.setActivo(ativarInativarExcluir); + } + + for (GP_PricingFormapago pricingFormapago : entidad.getPricingFormapagoList()) { + pricingFormapago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingFormapago.setFecmodif(Calendar.getInstance().getTime()); + pricingFormapago.setActivo(ativarInativarExcluir); + } + + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(ativarInativarExcluir); + + pricingDAO.actualizacion(entidad); + + pricingHistoricoService.registarExclusao(entidad, ativarInativarExcluir == GP_Pricing.ATIVO); + } + + @Transactional + public void borrar(GP_Pricing entidad) { + ativarInativarExcluirPricing(entidad, GP_Pricing.EXCLUIDO); + } + + @Transactional + public void inativar(GP_Pricing entidad) { + ativarInativarExcluirPricing(entidad, GP_Pricing.INATIVO); + } + + @Transactional + public void ativar(GP_Pricing entidad) { + ativarInativarExcluirPricing(entidad, GP_Pricing.ATIVO); + } + + @Transactional + public void borrarFisico(GP_Pricing entidad) { + borrar(entidad); + } + + public List buscar(String nombPricing, Empresa empresa, Short cantboleto, + Integer cantdiasanticipacion, BigDecimal descuentoporcentaje, BigDecimal descuentoporcredondo) { + return pricingDAO.buscar(nombPricing, empresa, cantboleto, cantdiasanticipacion, descuentoporcentaje, descuentoporcredondo); + } + + public List buscarPorNombre(String nombPricing) { + return pricingDAO.buscarPorNombre(nombPricing); + } + + @Transactional + public Boolean clonarPricing(Integer pricingId, String nomePricing, boolean incluirPadraoPricingTipoPassagemPET) { + + GP_Pricing pricing = this.obtenerID(pricingId); + GP_Pricing clonePricing = new GP_Pricing(); + + clonePricing.setNombPricing(nomePricing); + + clonePricing.setCantboleto(pricing.getCantboleto()); + clonePricing.setCantdiasanticipacion(pricing.getCantdiasanticipacion()); + clonePricing.setDescuentoporcentaje(pricing.getDescuentoporcentaje()); + clonePricing.setDescuentoporcredondo(pricing.getDescuentoporcredondo()); + clonePricing.setEmpresa(pricing.getEmpresa()); + clonePricing.setIndcancelable(pricing.getIndcancelable()); + clonePricing.setIndGeneraFeriadoVenta(pricing.getIndGeneraFeriadoVenta()); + clonePricing.setIndGeneraFeriadoViaje(pricing.getIndGeneraFeriadoViaje()); + clonePricing.setIndtransferible(pricing.getIndtransferible()); + + clonePricing = suscribir(clonePricing); + + percorrerPricingAtivoParaClonar(pricing, clonePricing, incluirPadraoPricingTipoPassagemPET); + actualizacion(clonePricing); + + inativar(clonePricing); + + pricingHistoricoService.compararESalvar(null, clonePricing); + + return clonePricing.getPricingId() != null; + } + + @Transactional + public GP_Pricing clonarGP_Pricing(Integer pricingId, String nomePricing, boolean incluirPadraoPricingTipoPassagemPET, + boolean isPricingAtivo) { + + GP_Pricing pricing = this.obtenerID(pricingId); + GP_Pricing clonePricing = new GP_Pricing(); + + clonePricing.setNombPricing(nomePricing); + + clonePricing.setCantboleto(pricing.getCantboleto()); + clonePricing.setCantdiasanticipacion(pricing.getCantdiasanticipacion()); + clonePricing.setDescuentoporcentaje(pricing.getDescuentoporcentaje()); + clonePricing.setDescuentoporcredondo(pricing.getDescuentoporcredondo()); + clonePricing.setEmpresa(pricing.getEmpresa()); + clonePricing.setIndcancelable(pricing.getIndcancelable()); + clonePricing.setIndGeneraFeriadoVenta(pricing.getIndGeneraFeriadoVenta()); + clonePricing.setIndGeneraFeriadoViaje(pricing.getIndGeneraFeriadoViaje()); + clonePricing.setIndtransferible(pricing.getIndtransferible()); + + clonePricing = suscribir(clonePricing); + + percorrerPricingAtivoParaClonar(pricing, clonePricing, incluirPadraoPricingTipoPassagemPET); + actualizacion(clonePricing); + + if(!isPricingAtivo){ + inativar(clonePricing); + } + + return clonePricing; + } + + private void percorrerPricingAtivoParaClonar(GP_Pricing pricing, GP_Pricing clonePricing, boolean incluirPadraoPricingTipoPassagemPET) { + Integer ativar = GP_Pricing.ATIVO; + clonePricing.setPricingAsientoList(obtemPricingAsientoList(pricing, clonePricing, ativar)); + clonePricing.setPricingCategoriaList(obtemPricingCategoriaList(pricing, clonePricing, ativar, incluirPadraoPricingTipoPassagemPET)); + clonePricing.setPricingClaseList(obtemPricingClaseList(pricing, clonePricing, ativar)); + clonePricing.setPricingCorridaList(obtemPricingCorridaList(pricing, clonePricing, ativar)); + clonePricing.setPricingDiaList(obtemPricingDiaList(pricing, clonePricing, ativar)); + clonePricing.setPricingImporteList(obtemPricingImporteList(pricing, clonePricing, ativar)); + clonePricing.setPricingMarcaList(obtemPricingMarcaList(pricing, clonePricing, ativar)); + clonePricing.setPricingMercadoList(obtemPricingMercadoList(pricing, clonePricing, ativar)); + clonePricing.setPricingOcupaAntecipaList(obtemPricingOcupaAntecipaList(pricing, clonePricing, ativar)); + clonePricing.setPricingPuntoventaList(obtemPricingPuntoVentaList(pricing, clonePricing, ativar)); + clonePricing.setPricingRutaList(obtemPricingRutaList(pricing, clonePricing, ativar)); + clonePricing.setPricingTipoptovtaList(obtemPricingTipoPtoVtaList(pricing, clonePricing, ativar)); + clonePricing.setPricingVigenciaList(obtemPricingVigenciaList(pricing, clonePricing, ativar)); + clonePricing.setPricingTipoServicioList(obtemPricingTipoServicioList(pricing, clonePricing, ativar)); + clonePricing.setPricingFormapagoList(obtemPricingFormapagoList(pricing, clonePricing, ativar)); + } + + private List obtemPricingFormapagoList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingFormapagoList = new ArrayList(); + for (GP_PricingFormapago pricingFormapago : pricing.getPricingFormapagoList()) { + + GP_PricingFormapago clonePricingFormapago = new GP_PricingFormapago(); + clonePricingFormapago.setIndexcepcion(pricingFormapago.getIndexcepcion()); + clonePricingFormapago.setFormaPago(pricingFormapago.getFormaPago()); + + clonePricingFormapago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingFormapago.setFecmodif(Calendar.getInstance().getTime()); + clonePricingFormapago.setActivo(ativar); + clonePricingFormapago.setPricing(clonePricing); + pricingFormapagoList.add(clonePricingFormapago); + } + return pricingFormapagoList; + } + + private List obtemPricingTipoServicioList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingTipoServicioList = new ArrayList(); + for (GP_PricingTipoServicio pricingTipoServicio : pricing.getPricingTipoServicioList()) { + + GP_PricingTipoServicio clonePricingTipoServicio = new GP_PricingTipoServicio(); + clonePricingTipoServicio.setTipoServicio(pricingTipoServicio.getTipoServicio()); + + clonePricingTipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingTipoServicio.setFecmodif(Calendar.getInstance().getTime()); + clonePricingTipoServicio.setActivo(ativar); + clonePricingTipoServicio.setPricing(clonePricing); + pricingTipoServicioList.add(clonePricingTipoServicio); + } + return pricingTipoServicioList; + } + + private List obtemPricingVigenciaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingVigenciaList = new ArrayList(); + for (GP_PricingVigencia pricingVigencia : pricing.getPricingVigenciaList()) { + + GP_PricingVigencia clonePricingVigencia = new GP_PricingVigencia(); + + clonePricingVigencia.setFecfinventa(pricingVigencia.getFecfinventa()); + clonePricingVigencia.setFecinicioventa(pricingVigencia.getFecinicioventa()); + clonePricingVigencia.setFecinicioviaje(pricingVigencia.getFecinicioviaje()); + clonePricingVigencia.setFecfinviaje(pricingVigencia.getFecfinviaje()); + + clonePricingVigencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingVigencia.setFecmodif(Calendar.getInstance().getTime()); + clonePricingVigencia.setActivo(ativar); + clonePricingVigencia.setPricing(clonePricing); + pricingVigenciaList.add(clonePricingVigencia); + } + return pricingVigenciaList; + } + + private List obtemPricingTipoPtoVtaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingTipoPtoVtaList = new ArrayList(); + for (GP_PricingTipoPtoVta pricingTipoPtoVta : pricing.getPricingTipoptovtaList()) { + + GP_PricingTipoPtoVta clonePricingTipoPtoVta = new GP_PricingTipoPtoVta(); + + clonePricingTipoPtoVta.setTipoPtovta(pricingTipoPtoVta.getTipoPtovta()); + + clonePricingTipoPtoVta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingTipoPtoVta.setFecmodif(Calendar.getInstance().getTime()); + clonePricingTipoPtoVta.setActivo(ativar); + clonePricingTipoPtoVta.setPricing(clonePricing); + pricingTipoPtoVtaList.add(clonePricingTipoPtoVta); + } + return pricingTipoPtoVtaList; + } + + private List obtemPricingRutaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingRutaList = new ArrayList(); + for (GP_PricingRuta pricingRuta : pricing.getPricingRutaList()) { + + GP_PricingRuta clonePricingRuta = new GP_PricingRuta(); + + clonePricingRuta.setRuta(pricingRuta.getRuta()); + + clonePricingRuta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingRuta.setFecmodif(Calendar.getInstance().getTime()); + clonePricingRuta.setActivo(ativar); + clonePricingRuta.setPricing(clonePricing); + pricingRutaList.add(clonePricingRuta); + } + return pricingRutaList; + } + + private List obtemPricingPuntoVentaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingPuntoVentaList = new ArrayList(); + for (GP_PricingPuntoVenta pricingPuntoVenta : pricing.getPricingPuntoventaList()) { + + GP_PricingPuntoVenta clonePricingPuntoVenta = new GP_PricingPuntoVenta(); + + clonePricingPuntoVenta.setPuntoVenta(pricingPuntoVenta.getPuntoVenta()); + + clonePricingPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + clonePricingPuntoVenta.setActivo(ativar); + clonePricingPuntoVenta.setPricing(clonePricing); + pricingPuntoVentaList.add(clonePricingPuntoVenta); + } + return pricingPuntoVentaList; + } + + private List obtemPricingOcupaAntecipaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingOcupaAntecipaList = new ArrayList(); + for (GP_PricingOcupaAntecipa pricingOcupaAntecipa : pricing.getPricingOcupaAntecipaList()) { + + GP_PricingOcupaAntecipa clonePricingOcupaAntecipa = new GP_PricingOcupaAntecipa(); + + clonePricingOcupaAntecipa.setCantasientosmin(pricingOcupaAntecipa.getCantasientosmin()); + clonePricingOcupaAntecipa.setCantasientosmax(pricingOcupaAntecipa.getCantasientosmax()); + clonePricingOcupaAntecipa.setCantdiasmin(pricingOcupaAntecipa.getCantdiasmin()); + clonePricingOcupaAntecipa.setCantdiasmax(pricingOcupaAntecipa.getCantdiasmax()); + clonePricingOcupaAntecipa.setImporte(pricingOcupaAntecipa.getImporte()); + clonePricingOcupaAntecipa.setPorcentaje(pricingOcupaAntecipa.getPorcentaje()); + clonePricingOcupaAntecipa.setOcupacioninicial(pricingOcupaAntecipa.getOcupacioninicial()); + clonePricingOcupaAntecipa.setOcupacionfinal(pricingOcupaAntecipa.getOcupacionfinal()); + + clonePricingOcupaAntecipa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingOcupaAntecipa.setFecmodif(Calendar.getInstance().getTime()); + clonePricingOcupaAntecipa.setActivo(ativar); + clonePricingOcupaAntecipa.setPricing(clonePricing); + pricingOcupaAntecipaList.add(clonePricingOcupaAntecipa); + } + return pricingOcupaAntecipaList; + } + + private List obtemPricingMercadoList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingMercadoList = new ArrayList(); + for (GP_PricingMercado pricingMercado : pricing.getPricingMercadoList()) { + + GP_PricingMercado clonePricingMercado = new GP_PricingMercado(); + + clonePricingMercado.setDestino(pricingMercado.getDestino()); + clonePricingMercado.setOrigen(pricingMercado.getOrigen()); + + clonePricingMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingMercado.setFecmodif(Calendar.getInstance().getTime()); + clonePricingMercado.setActivo(ativar); + clonePricingMercado.setPricing(clonePricing); + pricingMercadoList.add(clonePricingMercado); + } + return pricingMercadoList; + } + + private List obtemPricingMarcaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingMarcaList = new ArrayList(); + for (GP_PricingMarca pricingMarca : pricing.getPricingMarcaList()) { + + GP_PricingMarca clonePricingMarca = new GP_PricingMarca(); + + clonePricingMarca.setMarca(pricingMarca.getMarca()); + + clonePricingMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingMarca.setFecmodif(Calendar.getInstance().getTime()); + clonePricingMarca.setActivo(ativar); + clonePricingMarca.setPricing(clonePricing); + pricingMarcaList.add(clonePricingMarca); + } + return pricingMarcaList; + } + + private List obtemPricingImporteList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingImporteList = new ArrayList(); + for (GP_PricingImporte pricingImporte : pricing.getPricingImporteList()) { + + GP_PricingImporte clonePricingImporte = new GP_PricingImporte(); + + clonePricingImporte.setImporte(pricingImporte.getImporte()); + clonePricingImporte.setMoneda(pricingImporte.getMoneda()); + + clonePricingImporte.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingImporte.setFecmodif(Calendar.getInstance().getTime()); + clonePricingImporte.setActivo(ativar); + clonePricingImporte.setPricing(clonePricing); + pricingImporteList.add(clonePricingImporte); + } + return pricingImporteList; + } + + private List obtemPricingDiaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingDiaList = new ArrayList(); + for (GP_PricingDia pricingDia : pricing.getPricingDiaList()) { + + GP_PricingDia clonePricingDia = new GP_PricingDia(); + + clonePricingDia.setHorariofin(pricingDia.getHorariofin()); + clonePricingDia.setHorarioinicio(pricingDia.getHorarioinicio()); + clonePricingDia.setInddomingo(pricingDia.getInddomingo()); + clonePricingDia.setIndjueves(pricingDia.getIndjueves()); + clonePricingDia.setIndlunes(pricingDia.getIndlunes()); + clonePricingDia.setIndmartes(pricingDia.getIndmartes()); + clonePricingDia.setIndmiercoles(pricingDia.getIndmiercoles()); + clonePricingDia.setIndsabado(pricingDia.getIndsabado()); + clonePricingDia.setIndviernes(pricingDia.getIndviernes()); + clonePricingDia.setIndfecventa(pricingDia.getIndfecventa()); + clonePricingDia.setIndfecviaje(pricingDia.getIndfecviaje()); + + clonePricingDia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingDia.setFecmodif(Calendar.getInstance().getTime()); + clonePricingDia.setActivo(ativar); + clonePricingDia.setPricing(clonePricing); + pricingDiaList.add(clonePricingDia); + } + return pricingDiaList; + } + + private List obtemPricingCorridaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingCorridaList = new ArrayList(); + for (GP_PricingCorrida pricingCorrida : pricing.getPricingCorridaList()) { + + GP_PricingCorrida clonePricingCorrida = new GP_PricingCorrida(); + + clonePricingCorrida.setCorridaCtrl(pricingCorrida.getCorridaCtrl()); + + clonePricingCorrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingCorrida.setFecmodif(Calendar.getInstance().getTime()); + clonePricingCorrida.setActivo(ativar); + clonePricingCorrida.setPricing(clonePricing); + pricingCorridaList.add(clonePricingCorrida); + } + return pricingCorridaList; + } + + private List obtemPricingAsientoList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingAsientoList = new ArrayList(); + for (GP_PricingAsiento pricingAsiento : pricing.getPricingAsientoList()) { + + GP_PricingAsiento clonePricingAsiento = new GP_PricingAsiento(); + + clonePricingAsiento.setNombImagen(pricingAsiento.getNombImagen()); + clonePricingAsiento.setNumeasiento(pricingAsiento.getNumeasiento()); + clonePricingAsiento.setPorcentaje(pricingAsiento.getPorcentaje()); + + clonePricingAsiento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingAsiento.setFecmodif(Calendar.getInstance().getTime()); + clonePricingAsiento.setActivo(ativar); + clonePricingAsiento.setPricing(clonePricing); + pricingAsientoList.add(clonePricingAsiento); + } + return pricingAsientoList; + } + + private List obtemPricingClaseList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar) { + List pricingClaseList = new ArrayList(); + for (GP_PricingClase pricingClase : pricing.getPricingClaseList()) { + + GP_PricingClase clonePricingClase = new GP_PricingClase(); + + clonePricingClase.setClaseServicio(pricingClase.getClaseServicio()); + + clonePricingClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingClase.setFecmodif(Calendar.getInstance().getTime()); + clonePricingClase.setActivo(ativar); + clonePricingClase.setPricing(clonePricing); + pricingClaseList.add(clonePricingClase); + } + return pricingClaseList; + } + + private List obtemPricingCategoriaList(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar, boolean incluirPadraoPricingTipoPassagemPET) { + List pricingCategoriaList = new ArrayList(); + for (GP_PricingCategoria pricingCategoria : pricing.getPricingCategoriaList()) { + setCategoria(clonePricing, ativar, pricingCategoriaList, pricingCategoria.getCategoria()); + } + + if (incluirPadraoPricingTipoPassagemPET) { + configuraInclusaoPadraoTipoPassagemPET(pricing, clonePricing, ativar, pricingCategoriaList); + } + + return pricingCategoriaList; + } + + protected void setCategoria(GP_Pricing clonePricing, Integer ativar, List pricingCategoriaList, Categoria categoria) { + GP_PricingCategoria clonePricingCategoria = new GP_PricingCategoria(); + clonePricingCategoria.setCategoria(categoria); + clonePricingCategoria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + clonePricingCategoria.setFecmodif(Calendar.getInstance().getTime()); + clonePricingCategoria.setActivo(ativar); + clonePricingCategoria.setPricing(clonePricing); + pricingCategoriaList.add(clonePricingCategoria); + } + + private void configuraInclusaoPadraoTipoPassagemPET(GP_Pricing pricing, GP_Pricing clonePricing, Integer ativar, List pricingCategoriaList) { + Categoria categoriaNormal = categoriaService.buscarUmaCategoria("NORMAL"); + if (!possuiCategoriaNaLista(pricing.getPricingCategoriaList(), categoriaNormal)) { + setCategoria(clonePricing, ativar, pricingCategoriaList, categoriaNormal); + } + Categoria categoriaPET = categoriaService.buscarUmaCategoria("PET"); + if (!possuiCategoriaNaLista(pricing.getPricingCategoriaList(), categoriaPET)) { + setCategoria(clonePricing, ativar, pricingCategoriaList, categoriaPET); + } + + } + + private boolean possuiCategoriaNaLista(List categoriaList, Categoria categoria) { + for (GP_PricingCategoria pricingCategoria : categoriaList) { + if (pricingCategoria.getCategoria().equals(categoria)) { + return true; + } + } + return false; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingTipoPtoVtaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingTipoPtoVtaServiceImpl.java new file mode 100644 index 000000000..9113d2932 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingTipoPtoVtaServiceImpl.java @@ -0,0 +1,66 @@ +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.GP_PricingTipoPtoVtaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.GP_PricingTipoPtoVtaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingTipoPtoVtaService") +public class GP_PricingTipoPtoVtaServiceImpl implements GP_PricingTipoPtoVtaService { + + @Autowired + private GP_PricingTipoPtoVtaDAO pricingTipoPtoVtaDAO; + + public List obtenerTodos() { + return pricingTipoPtoVtaDAO.obtenerTodos(); + } + + public GP_PricingTipoPtoVta obtenerID(Integer id) { + return pricingTipoPtoVtaDAO.obtenerID(id); + } + + @Transactional + public GP_PricingTipoPtoVta suscribir(GP_PricingTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingTipoPtoVtaDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingTipoPtoVta actualizacion(GP_PricingTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingTipoPtoVtaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingTipoPtoVta entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingTipoPtoVtaDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingTipoPuntoVenta(GP_Pricing pricing, TipoPuntoVenta tipoPuntoVenta) { + return pricingTipoPtoVtaDAO.obtenerPricingTipoPuntoVenta(pricing, tipoPuntoVenta); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingTipoPtoVtaDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingTipoServicioServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingTipoServicioServiceImpl.java new file mode 100644 index 000000000..5171dd6c1 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingTipoServicioServiceImpl.java @@ -0,0 +1,66 @@ +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.GP_PricingTipoServicioDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import com.rjconsultores.ventaboletos.service.GP_PricingTipoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingTipoServicioService") +public class GP_PricingTipoServicioServiceImpl implements GP_PricingTipoServicioService { + + @Autowired + private GP_PricingTipoServicioDAO pricingTipoServicioDAO; + + public List obtenerTodos() { + return pricingTipoServicioDAO.obtenerTodos(); + } + + public GP_PricingTipoServicio obtenerID(Integer id) { + return pricingTipoServicioDAO.obtenerID(id); + } + + @Transactional + public GP_PricingTipoServicio suscribir(GP_PricingTipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingTipoServicioDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingTipoServicio actualizacion(GP_PricingTipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingTipoServicioDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingTipoServicio entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingTipoServicioDAO.actualizacion(entidad); + } + + public Boolean obtenerPricingTipoServicio(GP_Pricing pricing, TipoServicio tipoServicio) { + return pricingTipoServicioDAO.obtenerPricingTipoServicio(pricing, tipoServicio); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingTipoServicioDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingVigenciaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingVigenciaServiceImpl.java new file mode 100644 index 000000000..5f41d277e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/GP_PricingVigenciaServiceImpl.java @@ -0,0 +1,70 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.Calendar; +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.GP_PricingVigenciaDAO; +import com.rjconsultores.ventaboletos.entidad.GP_Pricing; +import com.rjconsultores.ventaboletos.entidad.GP_PricingVigencia; +import com.rjconsultores.ventaboletos.service.GP_PricingVigenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("gp_pricingVigenciaService") +public class GP_PricingVigenciaServiceImpl implements GP_PricingVigenciaService { + + @Autowired + private GP_PricingVigenciaDAO pricingVigenciaDAO; + + public List obtenerTodos() { + return pricingVigenciaDAO.obtenerTodos(); + } + + public GP_PricingVigencia obtenerID(Integer id) { + return pricingVigenciaDAO.obtenerID(id); + } + + @Transactional + public GP_PricingVigencia suscribir(GP_PricingVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingVigenciaDAO.suscribir(entidad); + } + + @Transactional + public GP_PricingVigencia actualizacion(GP_PricingVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.ATIVO); + + return pricingVigenciaDAO.actualizacion(entidad); + } + + @Transactional + public void borrar(GP_PricingVigencia entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(GP_Pricing.EXCLUIDO); + + pricingVigenciaDAO.actualizacion(entidad); + } + + public List buscarPorVigencias(GP_PricingVigencia pv) { + return pricingVigenciaDAO.buscarPorVigencias(pv); + } + + public Boolean podeSalvar(GP_Pricing pricing, GP_PricingVigencia pricingVigencia, Date inicio, Date fim) { + return pricingVigenciaDAO.podeSalvar(pricing, pricingVigencia, inicio, fim); + } + + @Override + public List obtenerTodoPorPricing(GP_Pricing pricing) { + return pricingVigenciaDAO.obtenerTodoPorPricing(pricing); + } +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaLegendaVO.java b/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaLegendaVO.java new file mode 100644 index 000000000..6940c376a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaLegendaVO.java @@ -0,0 +1,129 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.util.List; + +public class GP_PricingOcupaAntecipaLegendaVO { + + private String legenda; + private List itens; + + public String getLegenda() { + return legenda; + } + + public void setLegenda(String legenda) { + this.legenda = legenda; + } + + public List getItens() { + return itens; + } + + public void setItens(List itens) { + this.itens = itens; + } + + public class GP_PricingOcupaAtencipaLegendaItemVO { + + private String descricao; + private String percentual; + private String cor; + private String dias; + private Integer pricingocupaantecipaId; + + public GP_PricingOcupaAtencipaLegendaItemVO() { + super(); + } + + public GP_PricingOcupaAtencipaLegendaItemVO(String descricao, String percentual, String cor, String dias, Integer pricingocupaantecipaId) { + super(); + this.descricao = descricao; + this.percentual = percentual; + this.cor = cor; + this.dias = dias; + this.pricingocupaantecipaId = pricingocupaantecipaId; + } + + public String getPercentual() { + return percentual; + } + + public void setPercentual(String percentual) { + this.percentual = percentual; + } + + public String getCor() { + return cor; + } + + public void setCor(String cor) { + this.cor = cor; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((cor == null) ? 0 : cor.hashCode()); + result = prime * result + ((percentual == null) ? 0 : percentual.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof GP_PricingOcupaAtencipaLegendaItemVO)) + return false; + GP_PricingOcupaAtencipaLegendaItemVO other = (GP_PricingOcupaAtencipaLegendaItemVO) obj; + if (getCor() == null) { + if (other.getCor() != null) + return false; + } else if (!getCor().equals(other.getCor())) + return false; + if (getPercentual() == null) { + if (other.getPercentual() != null) + return false; + } else if (!getPercentual().equals(other.getPercentual())) + return false; + if (getDias() == null) { + if (other.getDias() != null) + return false; + } else if (!getDias().equals(other.getDias())) + return false; + return true; + } + + public String getDias() { + return dias; + } + + public void setDias(String dias) { + this.dias = dias; + } + + public Integer getPricingocupaantecipaId() { + return pricingocupaantecipaId; + } + + public void setPricingocupaantecipaId(Integer pricingocupaantecipaId) { + this.pricingocupaantecipaId = pricingocupaantecipaId; + } + + @Override + public String toString() { + return "GP_PricingOcupaAtencipaLegendaItemVO [percentual=" + percentual + ", cor=" + cor + ", dias=" + dias + ", pricingocupaantecipaId=" + pricingocupaantecipaId + "]"; + } + + public String getDescricao() { + return descricao; + } + + public void setDescricao(String descricao) { + this.descricao = descricao; + } + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaPoltronasVO.java b/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaPoltronasVO.java new file mode 100644 index 000000000..092334565 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaPoltronasVO.java @@ -0,0 +1,110 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class GP_PricingOcupaAntecipaPoltronasVO { + + public static final Integer MAXPOLTRONAS = 100; + + public static final String COR_BRANCA = "#FFFFFF"; + + private Integer pricingocupaantecipaId; + private Integer poltrona; + private String cor; + private BigDecimal percentual; + + public GP_PricingOcupaAntecipaPoltronasVO() { + super(); + } + + public GP_PricingOcupaAntecipaPoltronasVO(Integer poltrona, String cor) { + this(); + this.poltrona = poltrona; + this.cor = cor; + } + + public GP_PricingOcupaAntecipaPoltronasVO(GP_PricingOcupaAntecipaPoltronasVO poltrona) { + this(); + this.poltrona = poltrona.getPoltrona(); + this.cor = poltrona.getCor(); + this.percentual = poltrona.getPercentual(); + this.pricingocupaantecipaId = poltrona.getPricingocupaantecipaId(); + } + + public Integer getPoltrona() { + return poltrona; + } + + public void setPoltrona(Integer poltrona) { + this.poltrona = poltrona; + } + + public String getCor() { + return cor; + } + + public void setCor(String cor) { + this.cor = cor; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((poltrona == null) ? 0 : poltrona.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof GP_PricingOcupaAntecipaPoltronasVO)) + return false; + GP_PricingOcupaAntecipaPoltronasVO other = (GP_PricingOcupaAntecipaPoltronasVO) obj; + if (getPoltrona() == null) { + if (other.getPoltrona() != null) + return false; + } else if (!getPoltrona().equals(other.getPoltrona())) + return false; + return true; + } + + public BigDecimal getPercentual() { + return percentual; + } + + public void setPercentual(BigDecimal percentual) { + this.percentual = percentual; + } + + public static List carregarPoltronasPadrao() { + List retorno = new ArrayList(); + for (int i = 1; i <= MAXPOLTRONAS; i++) { + retorno.add(new GP_PricingOcupaAntecipaPoltronasVO(i, COR_BRANCA)); + } + return retorno; + } + + @Override + public String toString() { + return "GP_PricingOcupaAntecipaPoltronasVO [poltrona=" + poltrona + ", cor=" + cor + ", percentual=" + percentual + "]"; + } + + public boolean isAdicionar() { + return getCor() == null || !COR_BRANCA.equals(getCor().toUpperCase()); + } + + public Integer getPricingocupaantecipaId() { + return pricingocupaantecipaId; + } + + public void setPricingocupaantecipaId(Integer pricingocupaantecipaId) { + this.pricingocupaantecipaId = pricingocupaantecipaId; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaVO.java b/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaVO.java new file mode 100644 index 000000000..a0ef6a63a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingOcupaAntecipaVO.java @@ -0,0 +1,197 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang.StringUtils; + +public class GP_PricingOcupaAntecipaVO { + + public static final Integer CANTDIASMAXDEFAULT = 365; + + private Integer pricingocupaantecipaId; + private String dias; + private Integer antecipacao; + private List poltronas; + private Integer ocupMin; + private Integer ocupMax; + private Integer diaMin; + private Integer diaMax; + private BigDecimal percentual; + private String cor; + private String auxDesc; + + public GP_PricingOcupaAntecipaVO() { + super(); + } + + public GP_PricingOcupaAntecipaVO(GP_PricingOcupaAntecipaVO pricingOcupacaoAntecipa) { + this(pricingOcupacaoAntecipa, false); + } + + public GP_PricingOcupaAntecipaVO(GP_PricingOcupaAntecipaVO pricingOcupacaoAntecipa, boolean somentePoltronasMarcadas) { + this(); + this.pricingocupaantecipaId = pricingOcupacaoAntecipa.getPricingocupaantecipaId(); + this.dias = pricingOcupacaoAntecipa.getDias(); + this.antecipacao = pricingOcupacaoAntecipa.getAntecipacao(); + this.ocupMin = pricingOcupacaoAntecipa.getOcupMin(); + this.ocupMax = pricingOcupacaoAntecipa.getOcupMax(); + this.diaMin = pricingOcupacaoAntecipa.getDiaMin(); + this.diaMax = pricingOcupacaoAntecipa.getDiaMax(); + this.percentual = pricingOcupacaoAntecipa.getPercentual(); + this.cor = pricingOcupacaoAntecipa.getCor(); + this.auxDesc = pricingOcupacaoAntecipa.getAuxDesc(); + adicionarPoltronas(pricingOcupacaoAntecipa, somentePoltronasMarcadas); + } + + private void adicionarPoltronas(GP_PricingOcupaAntecipaVO pricingOcupacaoAntecipa, boolean somentePoltronasMarcadas) { + if(pricingOcupacaoAntecipa.getPoltronas() != null) { + this.poltronas = new ArrayList(); + for (GP_PricingOcupaAntecipaPoltronasVO poltrona : pricingOcupacaoAntecipa.getPoltronas()) { + if(!somentePoltronasMarcadas || poltrona.isAdicionar()) { + this.poltronas.add(new GP_PricingOcupaAntecipaPoltronasVO(poltrona)); + } + } + } + } + + public String getDias() { + return dias; + } + + public void setDias(String dias) { + this.dias = dias; + } + + public Integer getAntecipacao() { + return antecipacao; + } + + public void setAntecipacao(Integer antecipacao) { + this.antecipacao = antecipacao; + } + + public List getPoltronas() { + return poltronas; + } + + public void setPoltronas(List poltronas) { + this.poltronas = poltronas; + } + + public Integer getOcupMin() { + return ocupMin; + } + + public void setOcupMin(Integer ocupMin) { + this.ocupMin = ocupMin; + } + + public Integer getOcupMax() { + return ocupMax; + } + + public void setOcupMax(Integer ocupMax) { + this.ocupMax = ocupMax; + } + + public Integer getDiaMin() { + return diaMin; + } + + public void setDiaMin(Integer diaMin) { + this.diaMin = diaMin; + } + + public Integer getDiaMax() { + return diaMax; + } + + public void setDiaMax(Integer diaMax) { + this.diaMax = diaMax; + } + + public BigDecimal getPercentual() { + return percentual; + } + + public void setPercentual(BigDecimal percentual) { + this.percentual = percentual; + } + + public void marcarPoltronas() { + if(poltronas == null || poltronas.isEmpty()) { + poltronas = GP_PricingOcupaAntecipaPoltronasVO.carregarPoltronasPadrao(); + } + + for (GP_PricingOcupaAntecipaPoltronasVO poltrona : poltronas) { + if(poltrona.getPoltrona() >= getOcupMin() && poltrona.getPoltrona() <= getOcupMax()) { + poltrona.setCor(getCor()); + poltrona.setPercentual(getPercentual()); + poltrona.setPricingocupaantecipaId(getPricingocupaantecipaId()); + } + } + } + + public String getCor() { + return cor; + } + + public void setCor(String cor) { + this.cor = cor; + } + + @Override + public String toString() { + return "GP_PricingOcupacaoAntecipaVO [dias=" + dias + ", antecipacao=" + antecipacao + ", poltronas=" + poltronas + ", ocupMin=" + ocupMin + ", ocupMax=" + ocupMax + ", diaMin=" + diaMin + ", diaMax=" + diaMax + ", percentual=" + percentual + ", cor=" + cor + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getAntecipacao() == null) ? 0 : getAntecipacao().hashCode()); + result = prime * result + ((getDias() == null) ? 0 : getDias().hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof GP_PricingOcupaAntecipaVO)) + return false; + GP_PricingOcupaAntecipaVO other = (GP_PricingOcupaAntecipaVO) obj; + if (getAntecipacao() == null) { + if (other.getAntecipacao() != null) + return false; + } else if (!getAntecipacao().equals(other.getAntecipacao())) + return false; + if (getDias() == null) { + if (other.getDias() != null) + return false; + } else if (!getDias().equals(other.getDias())) + return false; + return true; + } + + public String getAuxDesc() { + return StringUtils.isNotBlank(auxDesc) ? auxDesc : antecipacao != null ? antecipacao.toString() : ""; + } + + public void setAuxDesc(String auxDesc) { + this.auxDesc = auxDesc; + } + + public Integer getPricingocupaantecipaId() { + return pricingocupaantecipaId; + } + + public void setPricingocupaantecipaId(Integer pricingocupaantecipaId) { + this.pricingocupaantecipaId = pricingocupaantecipaId; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingRevisaoValoresVO.java b/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingRevisaoValoresVO.java new file mode 100644 index 000000000..85d5a38b6 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/pricing/GP_PricingRevisaoValoresVO.java @@ -0,0 +1,174 @@ +package com.rjconsultores.ventaboletos.vo.pricing; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class GP_PricingRevisaoValoresVO implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + + private String origem; + private String destino; + private String classeServico; + private BigDecimal precioAtual; + private BigDecimal tarifaAtual; + private BigDecimal taxaEmbarque; + private BigDecimal pedagio; + private BigDecimal seguro; + private BigDecimal outros; + private String desconto; + private BigDecimal precoComPricing; + private BigDecimal tarifaComPricing; + private String ocupacao; + private String antecipacao; + + public String getOrigem() { + return origem; + } + + public void setOrigem(String origem) { + this.origem = origem; + } + + public String getDestino() { + return destino; + } + + public void setDestino(String destino) { + this.destino = destino; + } + + public String getClasseServico() { + return classeServico; + } + + public void setClasseServico(String classeServico) { + this.classeServico = classeServico; + } + + public BigDecimal getPrecioAtual() { + return precioAtual; + } + + public void setPrecioAtual(BigDecimal precioAtual) { + this.precioAtual = precioAtual; + } + + public BigDecimal getTarifaAtual() { + return tarifaAtual; + } + + public void setTarifaAtual(BigDecimal tarifaAtual) { + this.tarifaAtual = tarifaAtual; + } + + public BigDecimal getTaxaEmbarque() { + return taxaEmbarque; + } + + public void setTaxaEmbarque(BigDecimal taxaEmbarque) { + this.taxaEmbarque = taxaEmbarque; + } + + public BigDecimal getPedagio() { + if(pedagio == null) { + pedagio = BigDecimal.ZERO; + } + return pedagio; + } + + public void setPedagio(BigDecimal pedagio) { + this.pedagio = pedagio; + } + + public BigDecimal getSeguro() { + if(seguro == null) { + seguro = BigDecimal.ZERO; + } + return seguro; + } + + public void setSeguro(BigDecimal seguro) { + this.seguro = seguro; + } + + public BigDecimal getOutros() { + if(outros == null) { + outros = BigDecimal.ZERO; + } + return outros; + } + + public void setOutros(BigDecimal outros) { + this.outros = outros; + } + + public String getDesconto() { + return desconto; + } + + public void setDesconto(String desconto) { + this.desconto = desconto; + } + + public BigDecimal getPrecoComPricing() { + if(tarifaComPricing != null) { + precoComPricing = tarifaComPricing.add(this.getPedagio()).add(this.getSeguro()).add(this.getOutros()); + } + return precoComPricing; + } + + public void setPrecoComPricing(BigDecimal precoComPricing) { + this.precoComPricing = precoComPricing; + } + + public BigDecimal getTarifaComPricing() { + return tarifaComPricing; + } + + public void setTarifaComPricing(BigDecimal tarifaComPricing) { + this.tarifaComPricing = tarifaComPricing; + } + + public String getOcupacao() { + return ocupacao; + } + + public void setOcupacao(String ocupacao) { + this.ocupacao = ocupacao; + } + + public String getAntecipacao() { + return antecipacao; + } + + public void setAntecipacao(String antecipacao) { + this.antecipacao = antecipacao; + } + + public GP_PricingRevisaoValoresVO() { + super(); + } + + public GP_PricingRevisaoValoresVO(GP_PricingRevisaoValoresVO other) { + super(); + this.origem = other.getOrigem(); + this.destino = other.getDestino(); + this.classeServico = other.getClasseServico(); + this.precioAtual = other.getPrecioAtual(); + this.tarifaAtual = other.getTarifaAtual(); + this.taxaEmbarque = other.getTaxaEmbarque(); + this.pedagio = other.getPedagio(); + this.seguro = other.getSeguro(); + this.outros = other.getOutros(); + this.desconto = other.getDesconto(); + this.precoComPricing = other.getPrecoComPricing(); + this.tarifaComPricing = other.getTarifaComPricing(); + this.ocupacao = other.getOcupacao(); + this.antecipacao = other.getAntecipacao(); + } + +}