parent
874e4d780b
commit
ae7f39b58b
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ModelWeb</artifactId>
|
||||
<version>1.0.8</version>
|
||||
<version>1.0.9</version>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
|
|
|
@ -135,4 +135,6 @@ public class Constantes {
|
|||
|
||||
public static final String SMTP_COMISSAO_USER = "SMTP_COMISSAO_USER";
|
||||
|
||||
public static final String TIPO_OCUPACAO_SEM_VALIDACAO = "TIPO_OCUPACAO_SEM_VALIDACAO";
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
*
|
||||
* @author Administrador
|
||||
*/
|
||||
public interface TipoOcupacionDAO extends GenericDAO<TipoOcupacion, Integer> {
|
||||
public interface TipoOcupacionDAO extends GenericDAO<TipoOcupacion, Short> {
|
||||
|
||||
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.rjconsultores.ventaboletos.entidad.TipoOcupacion;
|
|||
* @author Administrador
|
||||
*/
|
||||
@Repository("tipoOcupacionDAO")
|
||||
public class TipoOcupacionHibernateDAO extends GenericHibernateDAO<TipoOcupacion, Integer>
|
||||
public class TipoOcupacionHibernateDAO extends GenericHibernateDAO<TipoOcupacion, Short>
|
||||
implements TipoOcupacionDAO {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoOcupacion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -29,4 +30,6 @@ public interface ConstanteService extends GenericService<Constante, Integer> {
|
|||
public Integer buscarValorConstantePorNomeConstante(String nomeConstante);
|
||||
|
||||
public String buscarURLAPIEmb();
|
||||
|
||||
public List<TipoOcupacion> BuscarTipoOcupacaoSemValidacao();
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
*
|
||||
* @author Administrador
|
||||
*/
|
||||
public interface TipoOcupacionService extends GenericService<TipoOcupacion, Integer> {
|
||||
public interface TipoOcupacionService extends GenericService<TipoOcupacion, Short> {
|
||||
|
||||
public List<TipoOcupacion> buscar(String desctipo);
|
||||
|
||||
|
|
|
@ -4,11 +4,7 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.ConstanteDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -18,6 +14,14 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.dao.ConstanteDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.TipoOcupacionDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoOcupacion;
|
||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
|
@ -27,6 +31,9 @@ public class ConstanteServiceImpl implements ConstanteService {
|
|||
@Autowired
|
||||
private ConstanteDAO constanteDAO;
|
||||
|
||||
@Autowired
|
||||
private TipoOcupacionDAO tipoOcupacaoDAO;
|
||||
|
||||
public static final String URL_PAINEL_BPE = "URL_PAINEL_BPE";
|
||||
public static final String URL_API = "URL_API";
|
||||
public static final String URL_API_EMB = "URL_API_EMB";
|
||||
|
@ -155,4 +162,35 @@ public class ConstanteServiceImpl implements ConstanteService {
|
|||
|
||||
return constante.getValorconstante();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TipoOcupacion> BuscarTipoOcupacaoSemValidacao() {
|
||||
Constante constante = constanteDAO.buscarPorNomeConstante(Constantes.TIPO_OCUPACAO_SEM_VALIDACAO);
|
||||
|
||||
if (constante == null || StringUtils.isBlank(constante.getValorconstante())){
|
||||
return null;
|
||||
}
|
||||
|
||||
String[] tipos = constante.getValorconstante().split(",");
|
||||
|
||||
List<TipoOcupacion> tiposOcupacaoSemValidacao = new ArrayList<TipoOcupacion>();
|
||||
|
||||
for(String tipoOcupacaoId : tipos) {
|
||||
TipoOcupacion tipoOcupacao = tipoOcupacaoDAO.obtenerID(buscarValorShort(tipoOcupacaoId));
|
||||
|
||||
if(tipoOcupacao != null) {
|
||||
tiposOcupacaoSemValidacao.add(tipoOcupacao);
|
||||
}
|
||||
}
|
||||
|
||||
return tiposOcupacaoSemValidacao;
|
||||
}
|
||||
|
||||
private Short buscarValorShort(String tipoOcupacaoId) {
|
||||
try {
|
||||
return Short.valueOf(tipoOcupacaoId);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class TipoOcupacionServiceImpl implements TipoOcupacionService {
|
|||
return tipoOcupacionDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public TipoOcupacion obtenerID(Integer id) {
|
||||
public TipoOcupacion obtenerID(Short id) {
|
||||
return tipoOcupacionDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue