fixes bug#9614
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@78658 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
4b3d19a0d8
commit
af247d11ec
|
@ -80,6 +80,9 @@ public class Categoria implements Serializable {
|
|||
@Column(name = "INDNAOUSAASSENTO")
|
||||
private Boolean indnaousaassento;
|
||||
|
||||
@Column(name = "CVESISTEMA")
|
||||
private String cvesistema;
|
||||
|
||||
public Categoria() {
|
||||
}
|
||||
|
||||
|
@ -239,4 +242,11 @@ public class Categoria implements Serializable {
|
|||
this.orgaosConcedentes = orgaosConcedentes;
|
||||
}
|
||||
|
||||
public String getCvesistema() {
|
||||
return cvesistema;
|
||||
}
|
||||
|
||||
public void setCvesistema(String cvesistema) {
|
||||
this.cvesistema = cvesistema;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
|
||||
/**
|
||||
|
@ -21,4 +22,6 @@ public interface CategoriaCtrlService {
|
|||
public CategoriaCtrl actualizacion(CategoriaCtrl entidad);
|
||||
|
||||
public void borrar(CategoriaCtrl entidad);
|
||||
|
||||
public boolean validaCategoriaProgramaFidelidade(Categoria categoria);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaCtrlDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.ConstanteDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaClase;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
|
@ -22,6 +24,7 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento;
|
|||
import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo;
|
||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaCtrlService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
|
@ -33,12 +36,19 @@ import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|||
public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
||||
|
||||
public static final int CATEGORIA_ADULTO = 1;
|
||||
private static final String CVE_SISTEMA_CATEGORIA_FIDELIDADE = "FIDELIDADE";
|
||||
private static final String CONSTANTE_URL_WS_FIDELIDADE = "URL_WS_FIDELIDADE";
|
||||
private static final String CONSTANTE_SENHA_WS_FIDELIDADE = "SENHA_WS_FIDELIDADE";
|
||||
private static final String CONSTANTE_USUARIO_WS_FIDELIDADE = "USUARIO_WS_FIDELIDADE";
|
||||
private static final int CANT_MAX_CATEGORIA_ADULTO = 200;
|
||||
@Autowired
|
||||
private CategoriaCtrlDAO categoriaCtrlDAO;
|
||||
@Autowired
|
||||
private CategoriaDAO categoriaDAO;
|
||||
|
||||
@Autowired
|
||||
private ConstanteDAO constanteDAO;
|
||||
|
||||
@Override
|
||||
public CategoriaCtrl obtenerID(Integer id) {
|
||||
return categoriaCtrlDAO.obtenerID(id);
|
||||
|
@ -165,4 +175,23 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
|||
|
||||
return cd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validaCategoriaProgramaFidelidade(Categoria categoria){
|
||||
|
||||
if(categoria.getCvesistema().equals(CVE_SISTEMA_CATEGORIA_FIDELIDADE)){
|
||||
Constante url = constanteDAO.buscarPorNomeConstante(CONSTANTE_URL_WS_FIDELIDADE);
|
||||
Constante usuario = constanteDAO.buscarPorNomeConstante(CONSTANTE_USUARIO_WS_FIDELIDADE);
|
||||
Constante senha = constanteDAO.buscarPorNomeConstante(CONSTANTE_SENHA_WS_FIDELIDADE);
|
||||
|
||||
if(url == null || url.getValorconstante() == null || url.getValorconstante().isEmpty() ||
|
||||
usuario == null || usuario.getValorconstante() == null || usuario.getValorconstante().isEmpty() ||
|
||||
senha == null || senha.getValorconstante() == null || senha.getValorconstante().isEmpty()){
|
||||
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue