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