Pacote - Cria configuração de pacotes (fixes bug #6041)
Tempo: 2 horas git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@41824 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1799342c4e
commit
08456e40ce
|
@ -1,6 +1,13 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
|
||||
public interface PacoteService extends GenericService<Pacote, Integer> {
|
||||
|
||||
public Boolean verificaCadastroTarifa(Pacote pacote, TipoTarifaPacote tarifa);
|
||||
|
||||
public Boolean verificaCadastroItemAdicional(Pacote pacote, ItemAdicional item);
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,14 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.PacoteDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteItem;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteItemService;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteService;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteTarifaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("pacoteService")
|
||||
|
@ -18,6 +24,12 @@ public class PacoteServiceImpl implements PacoteService {
|
|||
@Autowired
|
||||
private PacoteDAO pacoteDAO;
|
||||
|
||||
@Autowired
|
||||
private PacoteTarifaService pacoteTarifaService;
|
||||
|
||||
@Autowired
|
||||
private PacoteItemService pacoteItemService;
|
||||
|
||||
@Override
|
||||
public List<Pacote> obtenerTodos() {
|
||||
return pacoteDAO.obtenerTodos();
|
||||
|
@ -56,4 +68,28 @@ public class PacoteServiceImpl implements PacoteService {
|
|||
pacoteDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean verificaCadastroTarifa(Pacote pacote, TipoTarifaPacote tarifa) {
|
||||
|
||||
List<PacoteTarifa> pacoteTarifaLs = pacoteTarifaService.buscaTarifasPacote(pacote);
|
||||
for (PacoteTarifa pacoteTarifa : pacoteTarifaLs) {
|
||||
if (pacoteTarifa.getTipoTarifaPacote().equals(tarifa))
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean verificaCadastroItemAdicional(Pacote pacote, ItemAdicional item) {
|
||||
List<PacoteItem> pacoteItemLs = pacoteItemService.buscaItensPacote(pacote);
|
||||
|
||||
for (PacoteItem pacoteItem : pacoteItemLs) {
|
||||
if (pacoteItem.getItemAdicional().equals(item))
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue