Merge pull request 'Espec Cadastrar Policiais pelo ponto de venda' (#5) from AL-1294 into master
Reviewed-on: http://18.235.188.113:3000/adm/ModelWeb/pulls/5 Reviewed-by: fabio <fabio.faria@rjconsultores.com.br> Reviewed-by: pinheiro <valdevir@rjconsultores.com.br>master
commit
9ec6f09ad5
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ModelWeb</artifactId>
|
<artifactId>ModelWeb</artifactId>
|
||||||
<version>1.0.8</version>
|
<version>1.0.9</version>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
|
|
|
@ -135,4 +135,6 @@ public class Constantes {
|
||||||
|
|
||||||
public static final String SMTP_COMISSAO_USER = "SMTP_COMISSAO_USER";
|
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
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
public interface TipoOcupacionDAO extends GenericDAO<TipoOcupacion, Integer> {
|
public interface TipoOcupacionDAO extends GenericDAO<TipoOcupacion, Short> {
|
||||||
|
|
||||||
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion);
|
public List<TipoOcupacion> buscar(String desctipo, String cvetipoocupacion);
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import com.rjconsultores.ventaboletos.entidad.TipoOcupacion;
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Repository("tipoOcupacionDAO")
|
@Repository("tipoOcupacionDAO")
|
||||||
public class TipoOcupacionHibernateDAO extends GenericHibernateDAO<TipoOcupacion, Integer>
|
public class TipoOcupacionHibernateDAO extends GenericHibernateDAO<TipoOcupacion, Short>
|
||||||
implements TipoOcupacionDAO {
|
implements TipoOcupacionDAO {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.TipoOcupacion;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -29,4 +30,6 @@ public interface ConstanteService extends GenericService<Constante, Integer> {
|
||||||
public Integer buscarValorConstantePorNomeConstante(String nomeConstante);
|
public Integer buscarValorConstantePorNomeConstante(String nomeConstante);
|
||||||
|
|
||||||
public String buscarURLAPIEmb();
|
public String buscarURLAPIEmb();
|
||||||
|
|
||||||
|
public List<TipoOcupacion> BuscarTipoOcupacaoSemValidacao();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
public interface TipoOcupacionService extends GenericService<TipoOcupacion, Integer> {
|
public interface TipoOcupacionService extends GenericService<TipoOcupacion, Short> {
|
||||||
|
|
||||||
public List<TipoOcupacion> buscar(String desctipo);
|
public List<TipoOcupacion> buscar(String desctipo);
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,7 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.ConstanteDAO;
|
import java.util.ArrayList;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
|
||||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -18,6 +14,14 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
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
|
* @author Administrador
|
||||||
|
@ -27,6 +31,9 @@ public class ConstanteServiceImpl implements ConstanteService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConstanteDAO constanteDAO;
|
private ConstanteDAO constanteDAO;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TipoOcupacionDAO tipoOcupacaoDAO;
|
||||||
|
|
||||||
public static final String URL_PAINEL_BPE = "URL_PAINEL_BPE";
|
public static final String URL_PAINEL_BPE = "URL_PAINEL_BPE";
|
||||||
public static final String URL_API = "URL_API";
|
public static final String URL_API = "URL_API";
|
||||||
public static final String URL_API_EMB = "URL_API_EMB";
|
public static final String URL_API_EMB = "URL_API_EMB";
|
||||||
|
@ -155,4 +162,35 @@ public class ConstanteServiceImpl implements ConstanteService {
|
||||||
|
|
||||||
return constante.getValorconstante();
|
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();
|
return tipoOcupacionDAO.obtenerTodos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public TipoOcupacion obtenerID(Integer id) {
|
public TipoOcupacion obtenerID(Short id) {
|
||||||
return tipoOcupacionDAO.obtenerID(id);
|
return tipoOcupacionDAO.obtenerID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue