Servicio de cola de impresion - Only Control
This commit is contained in:
parent
b698acb879
commit
9c615cc167
|
|
@ -25,7 +25,8 @@ public class ColaImpresionUtil {
|
||||||
public static final String QUERY_SOLICITUD_NUM = "SELECT o FROM TarmSolicitud o WHERE o.numerosolicitud=:numerosolicitud";
|
public static final String QUERY_SOLICITUD_NUM = "SELECT o FROM TarmSolicitud o WHERE o.numerosolicitud=:numerosolicitud";
|
||||||
private static ColaImpresionUtil INSTANCIA = new ColaImpresionUtil();
|
private static ColaImpresionUtil INSTANCIA = new ColaImpresionUtil();
|
||||||
|
|
||||||
private ColaImpresionUtil(){}
|
private ColaImpresionUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
public static ColaImpresionUtil getInstancia() {
|
public static ColaImpresionUtil getInstancia() {
|
||||||
return INSTANCIA;
|
return INSTANCIA;
|
||||||
|
|
@ -33,6 +34,7 @@ public class ColaImpresionUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Método en el que se completa la información que se va a exponer en el web service
|
* Método en el que se completa la información que se va a exponer en el web service
|
||||||
|
*
|
||||||
* @param coladeImpresionList una lista de {@link TarmColadeImpresion}
|
* @param coladeImpresionList una lista de {@link TarmColadeImpresion}
|
||||||
* @param personcode código de la persona
|
* @param personcode código de la persona
|
||||||
* @param usercode código del usuario
|
* @param usercode código del usuario
|
||||||
|
|
@ -40,9 +42,9 @@ public class ColaImpresionUtil {
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public List<ColaImpresionDto> completaColaImpresion(List<TarmColadeImpresion> coladeImpresionList, Integer personcode, String usercode) throws Exception{
|
public List<ColaImpresionDto> completaColaImpresion(List<TarmColadeImpresion> coladeImpresionList, Integer personcode, String usercode) throws Exception {
|
||||||
List<ColaImpresionDto> lcolaImpresion = null;
|
List<ColaImpresionDto> lcolaImpresion = null;
|
||||||
if(coladeImpresionList != null && !coladeImpresionList.isEmpty()){
|
if (coladeImpresionList != null && !coladeImpresionList.isEmpty()) {
|
||||||
lcolaImpresion = new ArrayList<ColaImpresionDto>();
|
lcolaImpresion = new ArrayList<ColaImpresionDto>();
|
||||||
for (TarmColadeImpresion tarmColadeImpresion : coladeImpresionList) {
|
for (TarmColadeImpresion tarmColadeImpresion : coladeImpresionList) {
|
||||||
ColaImpresionDto colaImpresion = new ColaImpresionDto();
|
ColaImpresionDto colaImpresion = new ColaImpresionDto();
|
||||||
|
|
@ -55,35 +57,35 @@ public class ColaImpresionUtil {
|
||||||
colaImpresion.setPersona(personaDto);
|
colaImpresion.setPersona(personaDto);
|
||||||
colaImpresion.setDocumento(obtenerDocumentoId(tarmColadeImpresion.getCdocumento(), personaDto));
|
colaImpresion.setDocumento(obtenerDocumentoId(tarmColadeImpresion.getCdocumento(), personaDto));
|
||||||
|
|
||||||
List<TarmArmaPruebas> pruebas=null;
|
List<TarmArmaPruebas> pruebas = null;
|
||||||
List<TarmArmaPruebas> pruebasRealizadasAlArma=null;
|
List<TarmArmaPruebas> pruebasRealizadasAlArma = null;
|
||||||
if(colaImpresion.getDocumento()!=null && colaImpresion.getDocumento().getCarma()!=null){
|
if (colaImpresion.getDocumento() != null && colaImpresion.getDocumento().getCarma() != null) {
|
||||||
StringBuilder sql = new StringBuilder("select o from TarmArmaPruebas o where o.pk=(select max(p.pk) from TarmArmaPruebas p where p.carma='"+colaImpresion.getDocumento().getCarma()+"' and p.apruebaevaluacion='Y')");
|
StringBuilder sql = new StringBuilder("select o from TarmArmaPruebas o where o.pk=(select max(p.pk) from TarmArmaPruebas p where p.carma='" + colaImpresion.getDocumento().getCarma() + "' and p.apruebaevaluacion='Y')");
|
||||||
System.out.println("sql....."+sql);
|
System.out.println("sql....." + sql);
|
||||||
pruebas=PersistenceHelper.getEntityManager().createQuery(sql.toString()).getResultList();
|
pruebas = PersistenceHelper.getEntityManager().createQuery(sql.toString()).getResultList();
|
||||||
// Se valida si existe alguna prueba de registro balistico para el arma
|
// Se valida si existe alguna prueba de registro balistico para el arma
|
||||||
StringBuilder sql2 = new StringBuilder("select o from TarmArmaPruebas o where o.carma='"+colaImpresion.getDocumento().getCarma()+"'");
|
StringBuilder sql2 = new StringBuilder("select o from TarmArmaPruebas o where o.carma='" + colaImpresion.getDocumento().getCarma() + "'");
|
||||||
pruebasRealizadasAlArma=PersistenceHelper.getEntityManager().createQuery(sql2.toString()).getResultList();
|
pruebasRealizadasAlArma = PersistenceHelper.getEntityManager().createQuery(sql2.toString()).getResultList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pruebas!=null && pruebas.size()>0){
|
if (pruebas != null && pruebas.size() > 0) {
|
||||||
//ingresa el arma
|
//ingresa el arma
|
||||||
ArmaDto arma=ArmaUtil.getInstancia().obtenerArmaId(colaImpresion.getDocumento().getCarma());
|
ArmaDto arma = ArmaUtil.getInstancia().obtenerArmaId(colaImpresion.getDocumento().getCarma());
|
||||||
colaImpresion.setArma(arma);
|
colaImpresion.setArma(arma);
|
||||||
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
||||||
lcolaImpresion.add(colaImpresion);
|
lcolaImpresion.add(colaImpresion);
|
||||||
}else if(pruebas!=null && pruebas.size()==0 && pruebasRealizadasAlArma.isEmpty()){
|
} else if (pruebas != null && pruebas.size() == 0 && pruebasRealizadasAlArma.isEmpty()) {
|
||||||
// Usado para los datos migrados que no fueron ingresados por solicitud y no tienen prueba de registro balistico
|
// Usado para los datos migrados que no fueron ingresados por solicitud y no tienen prueba de registro balistico
|
||||||
ArmaDto arma=ArmaUtil.getInstancia().obtenerArmaId(colaImpresion.getDocumento().getCarma());
|
ArmaDto arma = ArmaUtil.getInstancia().obtenerArmaId(colaImpresion.getDocumento().getCarma());
|
||||||
if(arma!=null && arma.getIdArma()!=null){
|
if (arma != null && arma.getIdArma() != null) {
|
||||||
colaImpresion.setArma(arma);
|
colaImpresion.setArma(arma);
|
||||||
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
||||||
lcolaImpresion.add(colaImpresion);
|
lcolaImpresion.add(colaImpresion);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(colaImpresion.getDocumento().getCarma()==null || colaImpresion.getDocumento().getCarma().trim().length()==0){
|
} else if (colaImpresion.getDocumento().getCarma() == null || colaImpresion.getDocumento().getCarma().trim().length() == 0) {
|
||||||
colaImpresion.setArma(null);
|
colaImpresion.setArma(null);
|
||||||
System.out.println("numsilicitud.1....."+colaImpresion.getDocumento().getNumeroSolicitud());
|
System.out.println("numsilicitud.1....." + colaImpresion.getDocumento().getNumeroSolicitud());
|
||||||
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
||||||
lcolaImpresion.add(colaImpresion);
|
lcolaImpresion.add(colaImpresion);
|
||||||
}
|
}
|
||||||
|
|
@ -94,6 +96,7 @@ public class ColaImpresionUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Devuelve la cola de impresión con los datos completos
|
* Devuelve la cola de impresión con los datos completos
|
||||||
|
*
|
||||||
* @param coladeImpresionList
|
* @param coladeImpresionList
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
|
@ -101,11 +104,11 @@ public class ColaImpresionUtil {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public List<ColaImpresionDto> completaColaImpresion(List<TarmColadeImpresion> coladeImpresionList) throws Exception {
|
public List<ColaImpresionDto> completaColaImpresion(List<TarmColadeImpresion> coladeImpresionList) throws Exception {
|
||||||
List<ColaImpresionDto> lcolaImpresion = null;
|
List<ColaImpresionDto> lcolaImpresion = null;
|
||||||
if(coladeImpresionList != null && !coladeImpresionList.isEmpty()){
|
if (coladeImpresionList != null && !coladeImpresionList.isEmpty()) {
|
||||||
lcolaImpresion = new ArrayList<ColaImpresionDto>();
|
lcolaImpresion = new ArrayList<ColaImpresionDto>();
|
||||||
for (TarmColadeImpresion tarmColadeImpresion : coladeImpresionList) {
|
for (TarmColadeImpresion tarmColadeImpresion : coladeImpresionList) {
|
||||||
TarmDocumentoHabilitante tarmDocumentoHabilitante = PersistenceHelper.getEntityManager().find(TarmDocumentoHabilitante.class, tarmColadeImpresion.getCdocumento());
|
TarmDocumentoHabilitante tarmDocumentoHabilitante = PersistenceHelper.getEntityManager().find(TarmDocumentoHabilitante.class, tarmColadeImpresion.getCdocumento());
|
||||||
if(tarmDocumentoHabilitante != null){
|
if (tarmDocumentoHabilitante != null) {
|
||||||
ColaImpresionDto colaImpresion = new ColaImpresionDto();
|
ColaImpresionDto colaImpresion = new ColaImpresionDto();
|
||||||
colaImpresion.setIdImpresion(tarmColadeImpresion.getPk());
|
colaImpresion.setIdImpresion(tarmColadeImpresion.getPk());
|
||||||
colaImpresion.setFechaImpresion(tarmColadeImpresion.getFechaimpresion());
|
colaImpresion.setFechaImpresion(tarmColadeImpresion.getFechaimpresion());
|
||||||
|
|
@ -114,31 +117,31 @@ public class ColaImpresionUtil {
|
||||||
colaImpresion.setPersona(personaDto);
|
colaImpresion.setPersona(personaDto);
|
||||||
colaImpresion.setDocumento(obtenerDocumentoId(tarmColadeImpresion.getCdocumento(), personaDto));
|
colaImpresion.setDocumento(obtenerDocumentoId(tarmColadeImpresion.getCdocumento(), personaDto));
|
||||||
|
|
||||||
List<TarmArmaPruebas> pruebas=null;
|
List<TarmArmaPruebas> pruebas = null;
|
||||||
List<TarmArmaPruebas> pruebasRealizadasAlArma=null;
|
List<TarmArmaPruebas> pruebasRealizadasAlArma = null;
|
||||||
if(colaImpresion.getDocumento()!=null && colaImpresion.getDocumento().getCarma()!=null){
|
if (colaImpresion.getDocumento() != null && colaImpresion.getDocumento().getCarma() != null) {
|
||||||
StringBuilder sql = new StringBuilder("select o from TarmArmaPruebas o where o.pk=(select max(p.pk) from TarmArmaPruebas p where p.carma='"+colaImpresion.getDocumento().getCarma()+"' and p.apruebaevaluacion='Y')");
|
StringBuilder sql = new StringBuilder("select o from TarmArmaPruebas o where o.pk=(select max(p.pk) from TarmArmaPruebas p where p.carma='" + colaImpresion.getDocumento().getCarma() + "' and p.apruebaevaluacion='Y')");
|
||||||
// System.out.println("sql....."+sql);
|
// System.out.println("sql....."+sql);
|
||||||
pruebas=PersistenceHelper.getEntityManager().createQuery(sql.toString()).getResultList();
|
pruebas = PersistenceHelper.getEntityManager().createQuery(sql.toString()).getResultList();
|
||||||
// Se valida si existe alguna prueba de registro balistico para el arma
|
// Se valida si existe alguna prueba de registro balistico para el arma
|
||||||
StringBuilder sql2 = new StringBuilder("select o from TarmArmaPruebas o where o.carma='"+colaImpresion.getDocumento().getCarma()+"'");
|
StringBuilder sql2 = new StringBuilder("select o from TarmArmaPruebas o where o.carma='" + colaImpresion.getDocumento().getCarma() + "'");
|
||||||
pruebasRealizadasAlArma=PersistenceHelper.getEntityManager().createQuery(sql2.toString()).getResultList();
|
pruebasRealizadasAlArma = PersistenceHelper.getEntityManager().createQuery(sql2.toString()).getResultList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pruebas!=null && pruebas.size()>0){
|
if (pruebas != null && pruebas.size() > 0) {
|
||||||
colaImpresion.setArma(ArmaUtil.getInstancia().obtenerArmaId(colaImpresion.getDocumento().getCarma()));
|
colaImpresion.setArma(ArmaUtil.getInstancia().obtenerArmaId(colaImpresion.getDocumento().getCarma()));
|
||||||
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
||||||
lcolaImpresion.add(colaImpresion);
|
lcolaImpresion.add(colaImpresion);
|
||||||
}else if(pruebas!=null && pruebas.size()==0 && pruebasRealizadasAlArma.isEmpty()){
|
} else if (pruebas != null && pruebas.size() == 0 && pruebasRealizadasAlArma.isEmpty()) {
|
||||||
// Usado para los datos migrados que no fueron ingresados por solicitud y no tienen prueba de registro balistico
|
// Usado para los datos migrados que no fueron ingresados por solicitud y no tienen prueba de registro balistico
|
||||||
ArmaDto arma=ArmaUtil.getInstancia().obtenerArmaId(colaImpresion.getDocumento().getCarma());
|
ArmaDto arma = ArmaUtil.getInstancia().obtenerArmaId(colaImpresion.getDocumento().getCarma());
|
||||||
if(arma!=null && arma.getIdArma()!=null){
|
if (arma != null && arma.getIdArma() != null) {
|
||||||
colaImpresion.setArma(arma);
|
colaImpresion.setArma(arma);
|
||||||
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
||||||
lcolaImpresion.add(colaImpresion);
|
lcolaImpresion.add(colaImpresion);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(colaImpresion.getDocumento().getCarma()==null || colaImpresion.getDocumento().getCarma().trim().length()==0){
|
} else if (colaImpresion.getDocumento().getCarma() == null || colaImpresion.getDocumento().getCarma().trim().length() == 0) {
|
||||||
colaImpresion.setArma(null);
|
colaImpresion.setArma(null);
|
||||||
// System.out.println("numsilicitud.2....."+colaImpresion.getDocumento().getNumeroSolicitud());
|
// System.out.println("numsilicitud.2....."+colaImpresion.getDocumento().getNumeroSolicitud());
|
||||||
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
colaImpresion.setEsAutorizacion(verificaTipoTramite(colaImpresion.getDocumento().getNumeroSolicitud()));
|
||||||
|
|
@ -152,34 +155,34 @@ public class ColaImpresionUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Devuelve un documento en base al id enviado
|
* Devuelve un documento en base al id enviado
|
||||||
|
*
|
||||||
* @param codigoDocumento
|
* @param codigoDocumento
|
||||||
* @param personaDto
|
* @param personaDto
|
||||||
* @return DocumentoDto
|
* @return DocumentoDto
|
||||||
*/
|
*/
|
||||||
public DocumentoDto obtenerDocumentoId(Long codigoDocumento, PersonaDto personaDto){
|
public DocumentoDto obtenerDocumentoId(Long codigoDocumento, PersonaDto personaDto) {
|
||||||
DocumentoDto documento = null;
|
DocumentoDto documento = null;
|
||||||
TarmDocumentoHabilitante tarmDocumentoHabilitante = PersistenceHelper.getEntityManager().find(TarmDocumentoHabilitante.class, codigoDocumento);
|
TarmDocumentoHabilitante tarmDocumentoHabilitante = PersistenceHelper.getEntityManager().find(TarmDocumentoHabilitante.class, codigoDocumento);
|
||||||
if(tarmDocumentoHabilitante != null){
|
if (tarmDocumentoHabilitante != null) {
|
||||||
documento = new DocumentoDto();
|
documento = new DocumentoDto();
|
||||||
documento.setCodigoDocumento(tarmDocumentoHabilitante.getPk());
|
documento.setCodigoDocumento(tarmDocumentoHabilitante.getPk());
|
||||||
documento.setFechaEmision(tarmDocumentoHabilitante.getFechaemision());
|
documento.setFechaEmision(tarmDocumentoHabilitante.getFechaemision());
|
||||||
documento.setFechaExpiracion(tarmDocumentoHabilitante.getFechaexpiracion());
|
documento.setFechaExpiracion(tarmDocumentoHabilitante.getFechaexpiracion());
|
||||||
documento.setNumeroDocumento(tarmDocumentoHabilitante.getNumerodocumento());
|
documento.setNumeroDocumento(tarmDocumentoHabilitante.getNumerodocumento());
|
||||||
if(tarmDocumentoHabilitante.getCsolicitud()!=null){
|
if (tarmDocumentoHabilitante.getCsolicitud() != null) {
|
||||||
procesaDatosTramite(documento, tarmDocumentoHabilitante.getCsolicitud());
|
procesaDatosTramite(documento, tarmDocumentoHabilitante.getCsolicitud());
|
||||||
}
|
} else {
|
||||||
else{
|
String querySolicitud = "select max(csolicitud) from tarmsolicituddocumento where cdocumento = '" + codigoDocumento + "'";
|
||||||
String querySolicitud = "select max(csolicitud) from tarmsolicituddocumento where cdocumento = '"+codigoDocumento.toString()+"'";
|
|
||||||
String codigosolicitud = PersistenceHelper.getEntityManager().createNativeQuery(querySolicitud).getSingleResult().toString();
|
String codigosolicitud = PersistenceHelper.getEntityManager().createNativeQuery(querySolicitud).getSingleResult().toString();
|
||||||
if(codigosolicitud!=null){
|
if (codigosolicitud != null) {
|
||||||
procesaDatosTramite(documento, codigosolicitud);
|
procesaDatosTramite(documento, codigosolicitud);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
documento.setCarma(tarmDocumentoHabilitante.getCarma());
|
documento.setCarma(tarmDocumentoHabilitante.getCarma());
|
||||||
if(tarmDocumentoHabilitante.getCtramite() != null){//buscamos datos del tramite
|
if (tarmDocumentoHabilitante.getCtramite() != null) {//buscamos datos del tramite
|
||||||
try {
|
try {
|
||||||
TarmTramite tarmTramite = TarmTramite.find(PersistenceHelper.getEntityManager(), tarmDocumentoHabilitante.getCtramite());
|
TarmTramite tarmTramite = TarmTramite.find(PersistenceHelper.getEntityManager(), tarmDocumentoHabilitante.getCtramite());
|
||||||
if(tarmTramite != null){
|
if (tarmTramite != null) {
|
||||||
documento.setTipoTramite(CatalogoUtil.getInstancia().getDescripcion(tarmTramite.getTipotramite(), tarmTramite.getTipotramitecodigo()));
|
documento.setTipoTramite(CatalogoUtil.getInstancia().getDescripcion(tarmTramite.getTipotramite(), tarmTramite.getTipotramitecodigo()));
|
||||||
documento.setTramite(CatalogoUtil.getInstancia().getDescripcion(tarmTramite.getTipoautorizacion(), tarmTramite.getTipoautorizacioncodigo()));
|
documento.setTramite(CatalogoUtil.getInstancia().getDescripcion(tarmTramite.getTipoautorizacion(), tarmTramite.getTipoautorizacioncodigo()));
|
||||||
documento.setCategoria(CatalogoUtil.getInstancia().getDescripcion(tarmTramite.getCategoria(), tarmTramite.getCategoriacodigo()));
|
documento.setCategoria(CatalogoUtil.getInstancia().getDescripcion(tarmTramite.getCategoria(), tarmTramite.getCategoriacodigo()));
|
||||||
|
|
@ -199,8 +202,7 @@ public class ColaImpresionUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Devuelve la jurisdiccion con el valor de la misma, sea direccion con la
|
* Devuelve la jurisdiccion con el valor de la misma, sea direccion con la respectiva direccion de la persona que le emiten el carnet.
|
||||||
* respectiva direccion de la persona que le emiten el carnet.
|
|
||||||
*
|
*
|
||||||
* @param descripcion
|
* @param descripcion
|
||||||
* @param personaDto
|
* @param personaDto
|
||||||
|
|
@ -239,9 +241,9 @@ public class ColaImpresionUtil {
|
||||||
//
|
//
|
||||||
// return numerosolicitud;
|
// return numerosolicitud;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifica si es o no autorización
|
* Verifica si es o no autorización
|
||||||
|
*
|
||||||
* @param numerosolicitud
|
* @param numerosolicitud
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
|
@ -250,16 +252,16 @@ public class ColaImpresionUtil {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public String verificaTipoTramite(String numerosolicitud) throws CommondbException, Exception {
|
public String verificaTipoTramite(String numerosolicitud) throws CommondbException, Exception {
|
||||||
String tipoTramite = null;
|
String tipoTramite = null;
|
||||||
if(numerosolicitud != null){
|
if (numerosolicitud != null) {
|
||||||
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_SOLICITUD_NUM);
|
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_SOLICITUD_NUM);
|
||||||
query.setParameter("numerosolicitud", numerosolicitud);
|
query.setParameter("numerosolicitud", numerosolicitud);
|
||||||
List<TarmSolicitud> ltarmSolicitud = query.getResultList();
|
List<TarmSolicitud> ltarmSolicitud = query.getResultList();
|
||||||
if(ltarmSolicitud != null && !ltarmSolicitud.isEmpty()){
|
if (ltarmSolicitud != null && !ltarmSolicitud.isEmpty()) {
|
||||||
TarmSolicitud tarmSolicitud = ltarmSolicitud.iterator().next();
|
TarmSolicitud tarmSolicitud = ltarmSolicitud.iterator().next();
|
||||||
TarmTramite tarmTramite = TarmTramite.find(PersistenceHelper.getEntityManager(), tarmSolicitud.getCtramite());
|
TarmTramite tarmTramite = TarmTramite.find(PersistenceHelper.getEntityManager(), tarmSolicitud.getCtramite());
|
||||||
if(tarmTramite.getTipoautorizacion().equals("1") && tarmTramite.getTipoautorizacioncodigo().equals("TIPOAUTORIZACION")){
|
if (tarmTramite.getTipoautorizacion().equals("1") && tarmTramite.getTipoautorizacioncodigo().equals("TIPOAUTORIZACION")) {
|
||||||
tipoTramite = Constant.STR_Y;
|
tipoTramite = Constant.STR_Y;
|
||||||
} else if(tarmTramite.getTipoautorizacion().equals("6") && tarmTramite.getTipoautorizacioncodigo().equals("TIPOAUTORIZACION")){
|
} else if (tarmTramite.getTipoautorizacion().equals("6") && tarmTramite.getTipoautorizacioncodigo().equals("TIPOAUTORIZACION")) {
|
||||||
tipoTramite = Constant.STR_N;
|
tipoTramite = Constant.STR_N;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -269,14 +271,15 @@ public class ColaImpresionUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Procesa datos del trámite y completa la información
|
* Procesa datos del trámite y completa la información
|
||||||
|
*
|
||||||
* @param documento
|
* @param documento
|
||||||
* @param csolicitud
|
* @param csolicitud
|
||||||
*/
|
*/
|
||||||
private void procesaDatosTramite(DocumentoDto documento, String csolicitud){
|
private void procesaDatosTramite(DocumentoDto documento, String csolicitud) {
|
||||||
TarmSolicitud tarmSolicitud;
|
TarmSolicitud tarmSolicitud;
|
||||||
try {
|
try {
|
||||||
tarmSolicitud = TarmSolicitud.find(PersistenceHelper.getEntityManager(), csolicitud);
|
tarmSolicitud = TarmSolicitud.find(PersistenceHelper.getEntityManager(), csolicitud);
|
||||||
if(tarmSolicitud != null){
|
if (tarmSolicitud != null) {
|
||||||
documento.setNumeroSolicitud(tarmSolicitud.getNumerosolicitud());
|
documento.setNumeroSolicitud(tarmSolicitud.getNumerosolicitud());
|
||||||
documento.setEstadoTramite(CatalogoUtil.getInstancia().getDescripcion(tarmSolicitud.getEstado(), tarmSolicitud.getEstadocodigo()));
|
documento.setEstadoTramite(CatalogoUtil.getInstancia().getDescripcion(tarmSolicitud.getEstado(), tarmSolicitud.getEstadocodigo()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue