595 lines
23 KiB
Plaintext
Executable File
595 lines
23 KiB
Plaintext
Executable File
package com.fp.frontend.controller.armas.solicitud;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.faces.bean.ManagedBean;
|
|
import javax.faces.bean.ViewScoped;
|
|
|
|
import com.fp.dto.Request;
|
|
import com.fp.dto.Response;
|
|
import com.fp.dto.query.DtoQuery;
|
|
import com.fp.dto.query.Filter;
|
|
import com.fp.dto.query.SubQuery;
|
|
import com.fp.dto.save.DtoSave;
|
|
import com.fp.frontend.controller.AbstractController;
|
|
import com.fp.frontend.controller.pcustomer.PersonDetailController;
|
|
import com.fp.frontend.controller.pgeneral.gene.CatalogDetailController;
|
|
import com.fp.frontend.helper.MessageHelper;
|
|
import com.fp.persistence.parmas.param.TarmTramite;
|
|
import com.fp.persistence.parmas.soli.TarmSolicitud;
|
|
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
|
|
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetail;
|
|
|
|
@SuppressWarnings("serial")
|
|
@ManagedBean
|
|
@ViewScoped
|
|
public class TarmTramiteController extends AbstractController<TarmTramite> {
|
|
|
|
public TarmTramiteController() throws Exception {
|
|
super(TarmTramite.class);
|
|
}
|
|
|
|
@PostConstruct
|
|
private void postconstruct() {
|
|
this.init();
|
|
// Inicializa autoconsulta
|
|
super.startQuery();
|
|
|
|
}
|
|
|
|
/**
|
|
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
|
|
*/
|
|
private void init() {
|
|
try {
|
|
recperpage = 15; // Cambiar al # reg a mirar.
|
|
lrecord = new ArrayList<>();
|
|
beanalias = "TARMTRAMITECONTROLLER";
|
|
} catch (Exception e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Crea una instancia de TgeneTransactionProcess y marca el registro como nuevo.
|
|
*
|
|
* @throws Exception
|
|
*/
|
|
@Override
|
|
public void create() throws Exception {
|
|
super.create();
|
|
}
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@Override
|
|
protected void querydatabase() {
|
|
try {
|
|
DtoQuery dto = super.getDtoQuery(true);
|
|
|
|
//Tipo de tramite
|
|
SubQuery subqueryTipoTramite= new SubQuery("TgeneCatalogDetail","description","tipotramite","i.pk.catalog=t.tipotramite and i.pk.catalogcode=t.tipotramitecodigo");
|
|
dto.addSubQuery(subqueryTipoTramite);
|
|
|
|
SubQuery subqueryTramite= new SubQuery("TgeneCatalogDetail","description","tipoautorizacion","i.pk.catalog=t.tipoautorizacion and i.pk.catalogcode=t.tipoautorizacioncodigo");
|
|
dto.addSubQuery(subqueryTramite);
|
|
|
|
//Uso/Actividad
|
|
SubQuery subqueryUsoActividad= new SubQuery("TgeneCatalogDetail","description","usoactividad","i.pk.catalog=t.usoactividad and i.pk.catalogcode=t.usoactividadcodigo");
|
|
dto.addSubQuery(subqueryUsoActividad);
|
|
|
|
//Categoria
|
|
SubQuery subqueryCategoria= new SubQuery("TgeneCatalogDetail","description","categoria","i.pk.catalog=t.categoria and i.pk.catalogcode=t.categoriacodigo");
|
|
dto.addSubQuery(subqueryCategoria);
|
|
|
|
/*
|
|
//No. Tramite
|
|
SubQuery subqueryNoTramite= new SubQuery("TarmSolicitudTramite","numerotramite","numerotramite","i.pk.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryNoTramite);
|
|
|
|
//Codigo de solicitud
|
|
SubQuery subqueryCSolicitud= new SubQuery("TarmSolicitudTramite","pk.csolicitud","csolicitud","i.pk.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryCSolicitud);
|
|
|
|
//No. Documento
|
|
SubQuery subqueryNoDocumento= new SubQuery("TarmDocumentoHabilitante","numerodocumento","nodocumento","i.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryNoDocumento);
|
|
|
|
//Fecha emision
|
|
SubQuery subqueryFechaEmision= new SubQuery("TarmDocumentoHabilitante","fechaemision","fechaemision","i.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryFechaEmision);
|
|
|
|
//Fecha expiracion
|
|
SubQuery subqueryFechaExpiracion= new SubQuery("TarmDocumentoHabilitante","fechaexpiracion","fechaexpiracion","i.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryFechaExpiracion);
|
|
*/
|
|
|
|
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
|
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
|
|
|
|
Request request = callerhelper.getRequest();
|
|
request.setQueryTables(mtables);
|
|
|
|
Response resp = callerhelper.executeQuery(request);
|
|
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
|
lrecord = new ArrayList<TarmTramite>();
|
|
MessageHelper.setMessageError(resp);
|
|
} else {
|
|
lrecord = (List<TarmTramite>) resp.get(beanalias);
|
|
if(!lrecord.isEmpty()){
|
|
record=lrecord.get(0);
|
|
|
|
//Tipo de autorizacion
|
|
if(record.getTipoautorizacion()!=null && !record.getTipoautorizacion().isEmpty()
|
|
&& record.getTipoautorizacioncodigo()!=null && !record.getTipoautorizacioncodigo().isEmpty()){
|
|
TgeneCatalogDetail tipoAturizacion=CatalogDetailController.findxCodigoCodcatalogo(record.getTipoautorizacion(), record.getTipoautorizacioncodigo());
|
|
if(tipoAturizacion!=null){
|
|
record.getModifiedData().put("tipoautorizacion", tipoAturizacion.getDescription());
|
|
}
|
|
}
|
|
|
|
//Poniendo el nombre de la persona al tramite
|
|
if(record.getModifiedData().get("csolicitud")!=null){
|
|
TarmSolicitud solicitud=SolicitudController.findSolicitudxcodsolicitud(record.getModifiedData().get("csolicitud").toString());
|
|
if(solicitud!=null){
|
|
TcustPersonDetail detallesPersona=PersonDetailController.find(solicitud.getPersoncode().toString());
|
|
if(detallesPersona!=null){
|
|
record.getModifiedData().put("nombre", detallesPersona.getName());
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
super.postQuery(lrecord);
|
|
}
|
|
|
|
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Query por criterios de tramite
|
|
*/
|
|
protected void querydatabaseCriteriosTramite(String tipoAutorizacion, String tipoTramiteCodigo, String tipoTramiteCodigo2) {
|
|
try {
|
|
DtoQuery dto = super.getDtoQuery(true);
|
|
|
|
Filter tipoTramiteFiltro= new Filter();
|
|
/* if(tipoAutorizacion!=null){
|
|
cc.addFilter("tipoautorizacion", tipoAutorizacion);
|
|
}
|
|
*/
|
|
tipoTramiteFiltro.setSql("t.tipoautorizacion = " + tipoAutorizacion + " and (t.tipotramite = " + tipoTramiteCodigo + " or t.tipotramite = " + tipoTramiteCodigo2 + ")" );
|
|
|
|
dto.addFiltro(tipoTramiteFiltro);
|
|
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
|
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
|
|
|
|
Request request = callerhelper.getRequest();
|
|
request.setQueryTables(mtables);
|
|
|
|
Response resp = callerhelper.executeQuery(request);
|
|
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
|
lrecord = new ArrayList<TarmTramite>();
|
|
MessageHelper.setMessageError(resp);
|
|
} else {
|
|
lrecord = (List<TarmTramite>) resp.get(beanalias);
|
|
if(!lrecord.isEmpty()){
|
|
record=lrecord.get(0);
|
|
|
|
//Tipo de autorizacion
|
|
if(record.getTipoautorizacion()!=null && !record.getTipoautorizacion().isEmpty()
|
|
&& record.getTipoautorizacioncodigo()!=null && !record.getTipoautorizacioncodigo().isEmpty()){
|
|
TgeneCatalogDetail tipoAturizacion=CatalogDetailController.findxCodigoCodcatalogo(record.getTipoautorizacion(), record.getTipoautorizacioncodigo());
|
|
if(tipoAturizacion!=null){
|
|
record.getModifiedData().put("tipoautorizacion", tipoAturizacion.getDescription());
|
|
}
|
|
}
|
|
|
|
//Poniendo el nombre de la persona al tramite
|
|
if(record.getModifiedData().get("csolicitud")!=null){
|
|
TarmSolicitud solicitud=SolicitudController.findSolicitudxcodsolicitud(record.getModifiedData().get("csolicitud").toString());
|
|
if(solicitud!=null){
|
|
TcustPersonDetail detallesPersona=PersonDetailController.find(solicitud.getPersoncode().toString());
|
|
if(detallesPersona!=null){
|
|
record.getModifiedData().put("nombre", detallesPersona.getName());
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
super.postQuery(lrecord);
|
|
}
|
|
|
|
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Query por criterios de tramite
|
|
*/
|
|
protected void querydatabaseCriteriosTramite(String tipoAutorizacion) {
|
|
try {
|
|
DtoQuery dto = super.getDtoQuery(true);
|
|
|
|
Filter tipoTramiteFiltro= new Filter();
|
|
|
|
tipoTramiteFiltro.setSql("t.tipotramitecodigo = 'TIPOTRAMITE' and t.tipoautorizacion = " + tipoAutorizacion);
|
|
|
|
dto.addFiltro(tipoTramiteFiltro);
|
|
|
|
SubQuery stipoAutorizacion= new SubQuery
|
|
("TgeneCatalogDetail", "description", "tipotramite", "i.pk.catalog=t.tipotramite and i.pk.catalogcode=t.tipotramitecodigo and t.tipotramitecodigo = 'TIPOTRAMITE'");
|
|
|
|
dto.addSubQuery(stipoAutorizacion);
|
|
|
|
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
|
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
|
|
|
|
Request request = callerhelper.getRequest();
|
|
request.setQueryTables(mtables);
|
|
|
|
Response resp = callerhelper.executeQuery(request);
|
|
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
|
lrecord = new ArrayList<TarmTramite>();
|
|
MessageHelper.setMessageError(resp);
|
|
} else {
|
|
|
|
lrecord = (List<TarmTramite>) resp.get(beanalias);
|
|
|
|
|
|
|
|
if(!lrecord.isEmpty()){
|
|
record=lrecord.get(0);
|
|
|
|
//Tipo de autorizacion
|
|
if(record.getTipoautorizacion()!=null && !record.getTipoautorizacion().isEmpty()
|
|
&& record.getTipoautorizacioncodigo()!=null && !record.getTipoautorizacioncodigo().isEmpty()){
|
|
TgeneCatalogDetail tipoAturizacion=CatalogDetailController.findxCodigoCodcatalogo(record.getTipoautorizacion(), record.getTipoautorizacioncodigo());
|
|
if(tipoAturizacion!=null){
|
|
record.getModifiedData().put("tipoautorizacion", tipoAturizacion.getDescription());
|
|
}
|
|
}
|
|
|
|
//Poniendo el nombre de la persona al tramite
|
|
if(record.getModifiedData().get("csolicitud")!=null){
|
|
TarmSolicitud solicitud=SolicitudController.findSolicitudxcodsolicitud(record.getModifiedData().get("csolicitud").toString());
|
|
if(solicitud!=null){
|
|
TcustPersonDetail detallesPersona=PersonDetailController.find(solicitud.getPersoncode().toString());
|
|
if(detallesPersona!=null){
|
|
record.getModifiedData().put("nombre", detallesPersona.getName());
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
super.postQuery(lrecord);
|
|
}
|
|
|
|
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Query por criterios de tramite
|
|
*/
|
|
protected void querydatabaseCriteriosTramite(String tipoAutorizacion, String tipoTramite) {
|
|
try {
|
|
DtoQuery dto = super.getDtoQuery(true);
|
|
|
|
Filter tipoTramiteFiltro= new Filter();
|
|
|
|
tipoTramiteFiltro.setSql("t.tipotramitecodigo = 'TIPOTRAMITE' and t.tipoautorizacion = " + tipoAutorizacion);
|
|
|
|
dto.addFiltro(tipoTramiteFiltro);
|
|
|
|
SubQuery stipoAutorizacion= new SubQuery
|
|
("TgeneCatalogDetail", "description", "tipotramite", "i.pk.catalog=t.tipotramite and i.pk.catalogcode=t.tipotramitecodigo and t.tipotramitecodigo = 'TIPOTRAMITE'");
|
|
|
|
dto.addSubQuery(stipoAutorizacion);
|
|
|
|
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
|
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
|
|
|
|
Request request = callerhelper.getRequest();
|
|
request.setQueryTables(mtables);
|
|
|
|
Response resp = callerhelper.executeQuery(request);
|
|
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
|
lrecord = new ArrayList<TarmTramite>();
|
|
MessageHelper.setMessageError(resp);
|
|
} else {
|
|
|
|
lrecord = (List<TarmTramite>) resp.get(beanalias);
|
|
|
|
|
|
|
|
if(!lrecord.isEmpty()){
|
|
record=lrecord.get(0);
|
|
|
|
//Tipo de autorizacion
|
|
if(record.getTipoautorizacion()!=null && !record.getTipoautorizacion().isEmpty()
|
|
&& record.getTipoautorizacioncodigo()!=null && !record.getTipoautorizacioncodigo().isEmpty()){
|
|
TgeneCatalogDetail tipoAturizacion=CatalogDetailController.findxCodigoCodcatalogo(record.getTipoautorizacion(), record.getTipoautorizacioncodigo());
|
|
if(tipoAturizacion!=null){
|
|
record.getModifiedData().put("tipoautorizacion", tipoAturizacion.getDescription());
|
|
}
|
|
}
|
|
|
|
//Poniendo el nombre de la persona al tramite
|
|
if(record.getModifiedData().get("csolicitud")!=null){
|
|
TarmSolicitud solicitud=SolicitudController.findSolicitudxcodsolicitud(record.getModifiedData().get("csolicitud").toString());
|
|
if(solicitud!=null){
|
|
TcustPersonDetail detallesPersona=PersonDetailController.find(solicitud.getPersoncode().toString());
|
|
if(detallesPersona!=null){
|
|
record.getModifiedData().put("nombre", detallesPersona.getName());
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
super.postQuery(lrecord);
|
|
}
|
|
|
|
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
protected void querydatabaseDesaduanizacion() {
|
|
try {
|
|
DtoQuery dto = super.getDtoQuery(true);
|
|
|
|
//Tipo de tramite
|
|
SubQuery subqueryTipoTramite= new SubQuery("TgeneCatalogDetail","description","tipotramite","i.pk.catalog=t.tipotramite and i.pk.catalogcode=t.tipotramitecodigo");
|
|
dto.addSubQuery(subqueryTipoTramite);
|
|
|
|
//Uso/Actividad
|
|
SubQuery subqueryUsoActividad= new SubQuery("TgeneCatalogDetail","description","usoactividad","i.pk.catalog=t.usoactividad and i.pk.catalogcode=t.usoactividadcodigo");
|
|
dto.addSubQuery(subqueryUsoActividad);
|
|
|
|
//Categoria
|
|
SubQuery subqueryCategoria= new SubQuery("TgeneCatalogDetail","description","categoria","i.pk.catalog=t.categoria and i.pk.catalogcode=t.categoriacodigo");
|
|
dto.addSubQuery(subqueryCategoria);
|
|
|
|
/*
|
|
//No. Tramite
|
|
SubQuery subqueryNoTramite= new SubQuery("TarmSolicitudTramite","numerotramite","numerotramite","i.pk.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryNoTramite);
|
|
|
|
//Codigo de solicitud
|
|
SubQuery subqueryCSolicitud= new SubQuery("TarmSolicitudTramite","pk.csolicitud","csolicitud","i.pk.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryCSolicitud);
|
|
|
|
//Estado tramite
|
|
SubQuery subqueryEstado= new SubQuery("TarmSolicitudTramite","estadotramite","estadotramite","i.pk.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryEstado);
|
|
|
|
//No. Documento
|
|
SubQuery subqueryNoDocumento= new SubQuery("TarmDocumentoHabilitante","numerodocumento","nodocumento","i.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryNoDocumento);
|
|
|
|
//Fecha emision
|
|
SubQuery subqueryFechaEmision= new SubQuery("TarmDocumentoHabilitante","fechaemision","fechaemision","i.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryFechaEmision);
|
|
|
|
//Fecha expiracion
|
|
SubQuery subqueryFechaExpiracion= new SubQuery("TarmDocumentoHabilitante","fechaexpiracion","fechaexpiracion","i.ctramite=t.pk");
|
|
dto.addSubQuery(subqueryFechaExpiracion);
|
|
*/
|
|
|
|
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
|
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
|
|
|
|
Request request = callerhelper.getRequest();
|
|
request.setQueryTables(mtables);
|
|
|
|
Response resp = callerhelper.executeQuery(request);
|
|
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
|
lrecord = new ArrayList<TarmTramite>();
|
|
MessageHelper.setMessageError(resp);
|
|
} else {
|
|
lrecord = (List<TarmTramite>) resp.get(beanalias);
|
|
if(!lrecord.isEmpty()){
|
|
record=lrecord.get(0);
|
|
|
|
}
|
|
super.postQuery(lrecord);
|
|
}
|
|
|
|
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
protected void querydatabaseSimple() {
|
|
try {
|
|
DtoQuery dto = super.getDtoQuery(true);
|
|
|
|
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
|
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
|
|
|
|
Request request = callerhelper.getRequest();
|
|
request.setQueryTables(mtables);
|
|
|
|
Response resp = callerhelper.executeQuery(request);
|
|
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
|
lrecord = new ArrayList<TarmTramite>();
|
|
MessageHelper.setMessageError(resp);
|
|
} else {
|
|
lrecord = (List<TarmTramite>) resp.get(beanalias);
|
|
if(!lrecord.isEmpty()){
|
|
record=lrecord.get(0);
|
|
|
|
}
|
|
super.postQuery(lrecord);
|
|
}
|
|
|
|
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
public void save() {
|
|
try {
|
|
DtoSave dtosave = super.getDtoSave();
|
|
dtosave.setReturnpk(true); // Para que el core devuelva el pk de los registros nuevos.
|
|
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
|
|
|
|
Request request = callerhelper.getRequest();
|
|
msave.put(beanalias, dtosave); // adicionar metadata de mantenimiento para cada tabla.
|
|
|
|
request.setSaveTables(msave);
|
|
Response resp = callerhelper.executeSave(request);
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
|
|
this.postCommit(resp);
|
|
MessageHelper.setMessageInfo(resp);
|
|
} else {
|
|
MessageHelper.setMessageError(resp);
|
|
}
|
|
|
|
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void postCommit(Response response) throws Exception {
|
|
super.postCommitGeneric(response, beanalias);
|
|
}
|
|
|
|
/**
|
|
* Entrega una lista de requisitos.
|
|
*
|
|
* @return List<TarmRequisito>
|
|
*/
|
|
public static TarmTramite find(String ctramite) {
|
|
try {
|
|
TarmTramiteController cc = new TarmTramiteController();
|
|
cc.init();
|
|
cc.recperpage = 300;
|
|
cc.addFilter("pk", ctramite);
|
|
cc.querydatabase();
|
|
if (cc.record != null) {
|
|
return cc.record;
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Metodo para buscar tramite por criterios de busqueda
|
|
* @param tipoAutorizacion el codigo del tipo de autorizacion
|
|
* @return el registro de tramite encontrado
|
|
*/
|
|
public static List<TarmTramite> findPorCriteriosTramite(String tipoAutorizacion) {
|
|
try {
|
|
TarmTramiteController cc = new TarmTramiteController();
|
|
cc.init();
|
|
cc.recperpage = 30000;
|
|
|
|
cc.querydatabaseCriteriosTramite(tipoAutorizacion);
|
|
|
|
if (cc.lrecord != null) {
|
|
return cc.lrecord;
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Metodo para buscar tramite por criterios de busqueda
|
|
* @param tipoTramite el codigo del tipo de tramite
|
|
* @param tipoTramite2 otro codigo de tipo de tramite
|
|
* @param tipoAutorizacion el codigo del tipo de autorizacion
|
|
* @return el registro de tramite encontrado
|
|
*/
|
|
public static List<TarmTramite> findPorCriteriosTramite(String tipoTramite, String tipoTramite2, String tipoAutorizacion) {
|
|
try {
|
|
TarmTramiteController cc = new TarmTramiteController();
|
|
cc.init();
|
|
cc.recperpage = 30000;
|
|
|
|
cc.querydatabaseCriteriosTramite(tipoAutorizacion, tipoTramite, tipoTramite2);
|
|
if (cc.lrecord != null) {
|
|
return cc.lrecord;
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Entrega una lista de requisitos.
|
|
*
|
|
* @return List<TarmRequisito>
|
|
*/
|
|
public static TarmTramite findSimple(String ctramite) {
|
|
try {
|
|
TarmTramiteController cc = new TarmTramiteController();
|
|
cc.init();
|
|
cc.recperpage = 300;
|
|
cc.addFilter("pk", ctramite);
|
|
cc.querydatabaseSimple();
|
|
if (cc.record != null) {
|
|
return cc.record;
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Busca tramites para desaduanizacion
|
|
*/
|
|
public static List<TarmTramite> findTramitesDesaduanizar() {
|
|
try {
|
|
TarmTramiteController cc = new TarmTramiteController();
|
|
cc.init();
|
|
cc.recperpage = 300;
|
|
cc.addFilter("tipoautorizacion", "1");
|
|
cc.addFilter("categoria", "14");
|
|
//cc.addFilter("usoactividad", "27");
|
|
cc.querydatabaseDesaduanizacion();
|
|
if (cc.lrecord != null) {
|
|
return cc.lrecord;
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
}
|