wilian 2016-12-19 17:46:35 +00:00
parent 3bb3e88716
commit b65b27df0b
3 changed files with 17 additions and 2 deletions

View File

@ -45,6 +45,10 @@ public class PacoteTarifa implements Serializable {
private TipoTarifaPacote tipoTarifaPacote; private TipoTarifaPacote tipoTarifaPacote;
@Column(name = "INDVENDAWEB") @Column(name = "INDVENDAWEB")
private Boolean indvendaweb; private Boolean indvendaweb;
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
@ManyToOne
private Categoria categoria;
public PacoteTarifa() { public PacoteTarifa() {
super(); super();
@ -152,4 +156,12 @@ public class PacoteTarifa implements Serializable {
this.indvendaweb = indvendaweb; this.indvendaweb = indvendaweb;
} }
public Categoria getCategoria() {
return categoria;
}
public void setCategoria(Categoria categoria) {
this.categoria = categoria;
}
} }

View File

@ -3,13 +3,14 @@ package com.rjconsultores.ventaboletos.service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.rjconsultores.ventaboletos.entidad.Categoria;
import com.rjconsultores.ventaboletos.entidad.Pacote; import com.rjconsultores.ventaboletos.entidad.Pacote;
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa; import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote; import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
public interface PacoteTarifaService extends GenericService<PacoteTarifa, Integer> { public interface PacoteTarifaService extends GenericService<PacoteTarifa, Integer> {
public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa, Boolean indvendaweb); public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa, Boolean indvendaweb, Categoria categoria);
public PacoteTarifa buscaPacoteTarifa(Pacote pacote, TipoTarifaPacote tipoTarifaPacote); public PacoteTarifa buscaPacoteTarifa(Pacote pacote, TipoTarifaPacote tipoTarifaPacote);

View File

@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.PacoteTarifaDAO; import com.rjconsultores.ventaboletos.dao.PacoteTarifaDAO;
import com.rjconsultores.ventaboletos.entidad.Categoria;
import com.rjconsultores.ventaboletos.entidad.Pacote; import com.rjconsultores.ventaboletos.entidad.Pacote;
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa; import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote; import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
@ -63,7 +64,7 @@ public class PacoteTarifaServiceImpl implements PacoteTarifaService {
@Transactional(readOnly = false) @Transactional(readOnly = false)
@Override @Override
public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa, Boolean indvendaweb) { public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa, Boolean indvendaweb, Categoria categoria) {
if (pacoteTarifa == null) { if (pacoteTarifa == null) {
pacoteTarifa = new PacoteTarifa(); pacoteTarifa = new PacoteTarifa();
@ -73,6 +74,7 @@ public class PacoteTarifaServiceImpl implements PacoteTarifaService {
pacoteTarifa.setTarifa(tarifa); pacoteTarifa.setTarifa(tarifa);
pacoteTarifa.setTipoTarifaPacote(tipoTarifaPacote); pacoteTarifa.setTipoTarifaPacote(tipoTarifaPacote);
pacoteTarifa.setPacote(pacote); pacoteTarifa.setPacote(pacote);
pacoteTarifa.setCategoria(categoria);
if (pacoteTarifa.getPacotetarifaId() == null) { if (pacoteTarifa.getPacotetarifaId() == null) {
return suscribir(pacoteTarifa); return suscribir(pacoteTarifa);