2373 lines
83 KiB
Plaintext
Executable File
2373 lines
83 KiB
Plaintext
Executable File
package com.fp.frontend.controller.armas.solicitud;
|
||
|
||
import java.io.ByteArrayInputStream;
|
||
import java.io.InputStream;
|
||
import java.io.OutputStream;
|
||
import java.math.BigDecimal;
|
||
import java.sql.Timestamp;
|
||
import java.text.SimpleDateFormat;
|
||
import java.util.ArrayList;
|
||
import java.util.Calendar;
|
||
import java.util.Collections;
|
||
import java.util.Comparator;
|
||
import java.util.Date;
|
||
import java.util.HashMap;
|
||
import java.util.Iterator;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
import javax.annotation.PostConstruct;
|
||
import javax.faces.application.FacesMessage;
|
||
import javax.faces.bean.ManagedBean;
|
||
import javax.faces.bean.ManagedProperty;
|
||
import javax.faces.bean.ViewScoped;
|
||
import javax.faces.context.FacesContext;
|
||
import javax.servlet.http.HttpServletResponse;
|
||
|
||
import org.apache.commons.lang.StringUtils;
|
||
import org.primefaces.context.RequestContext;
|
||
import org.primefaces.event.FileUploadEvent;
|
||
import org.primefaces.event.SelectEvent;
|
||
import org.primefaces.model.UploadedFile;
|
||
|
||
import com.fp.dto.AbstractDataTransport;
|
||
import com.fp.dto.Request;
|
||
import com.fp.dto.Response;
|
||
import com.fp.dto.query.DtoQuery;
|
||
import com.fp.dto.save.DtoSave;
|
||
import com.fp.frontend.controller.AbstractController;
|
||
import com.fp.frontend.controller.ReportController;
|
||
import com.fp.frontend.controller.alfresco.AlfrescoController;
|
||
import com.fp.frontend.controller.armas.funcionalidad.RegistroArmController;
|
||
import com.fp.frontend.controller.armas.lov.ArmaExplosivoLovController;
|
||
import com.fp.frontend.controller.armas.lov.ArmasLovController;
|
||
import com.fp.frontend.controller.pcustomer.PersonAddressController;
|
||
import com.fp.frontend.controller.pcustomer.PersonDetailController;
|
||
import com.fp.frontend.controller.pcustomer.PersonPhoneController;
|
||
import com.fp.frontend.controller.pgeneral.gene.CantonController;
|
||
import com.fp.frontend.controller.pgeneral.gene.CatalogDetailController;
|
||
import com.fp.frontend.controller.pgeneral.gene.CityController;
|
||
import com.fp.frontend.controller.pgeneral.gene.CountryController;
|
||
import com.fp.frontend.controller.pgeneral.gene.ParametersController;
|
||
import com.fp.frontend.controller.pgeneral.gene.ParroquiaController;
|
||
import com.fp.frontend.controller.pgeneral.gene.ProvinceController;
|
||
import com.fp.frontend.helper.MessageHelper;
|
||
import com.fp.frontend.utility.MsgControlArmas;
|
||
import com.fp.frontend.utility.ValidateIdentification;
|
||
import com.fp.frontend.webservices.snap.cedula.ClienteCedula;
|
||
import com.fp.frontend.webservices.snap.ruc.ClienteRUC;
|
||
import com.fp.persistence.parmas.param.TarmCentroControl;
|
||
import com.fp.persistence.parmas.param.TarmTipoArmaExplosivo;
|
||
import com.fp.persistence.parmas.soli.TarmArmas;
|
||
import com.fp.persistence.pcustomer.gene.TcustPersonAddress;
|
||
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
|
||
import com.fp.persistence.pgeneral.gene.TgeneCanton;
|
||
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetail;
|
||
import com.fp.persistence.pgeneral.gene.TgeneCity;
|
||
import com.fp.persistence.pgeneral.gene.TgeneCountry;
|
||
import com.fp.persistence.pgeneral.gene.TgeneParameters;
|
||
import com.fp.persistence.pgeneral.gene.TgeneParroquia;
|
||
import com.fp.persistence.pgeneral.gene.TgeneProvince;
|
||
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
|
||
|
||
import ec.gob.registrocivil.consultacedula.Cedula;
|
||
import ec.gov.sri.wsconsultacontribuyente.Contribuyente;
|
||
|
||
/**
|
||
* Clase controladora del bean TarmDecomiso.
|
||
*
|
||
* @author C.P.
|
||
* @version 2.1
|
||
*/
|
||
@SuppressWarnings("serial")
|
||
@ManagedBean
|
||
@ViewScoped
|
||
public class DecomisoMaterialController extends AbstractController<AbstractDataTransport> {
|
||
|
||
/**
|
||
* Constructor
|
||
* @throws Exception
|
||
*/
|
||
public DecomisoMaterialController() throws Exception {
|
||
super(AbstractDataTransport.class);
|
||
}
|
||
/**
|
||
* Controlador que maneja el decomiso
|
||
*/
|
||
@ManagedProperty(value = "#{decomisoController}")
|
||
private DecomisoController decomisoController;
|
||
/**
|
||
* Controlador que maneja PersonDetail
|
||
*/
|
||
@ManagedProperty(value = "#{personDetailController}")
|
||
private PersonDetailController personDetailController;
|
||
/**
|
||
* Controlador que maneja PersonPhone
|
||
*/
|
||
@ManagedProperty(value = "#{personPhoneController}")
|
||
private PersonPhoneController personPhoneController;
|
||
|
||
/**
|
||
* Detalle del usuario
|
||
*/
|
||
private TcustPersonDetail usuario;
|
||
/**
|
||
* Controlador que maneja armas
|
||
*/
|
||
@ManagedProperty(value = "#{armasController}")
|
||
private ArmasController armasController;
|
||
|
||
/**
|
||
* Controlador que maneja armas
|
||
*/
|
||
@ManagedProperty(value = "#{armasLovController}")
|
||
private ArmasLovController armasLovController;
|
||
/**
|
||
* Controlador que maneja TarmRegistroArmas
|
||
*/
|
||
@ManagedProperty(value = "#{registroArmController}")
|
||
private RegistroArmController registroArmController;
|
||
/**
|
||
* Controlador que maneja TarmDecomisoArma
|
||
*/
|
||
@ManagedProperty(value = "#{decomisoArmaController}")
|
||
private DecomisoArmaController decomisoArmaController;
|
||
/**
|
||
* Controlador Inyectado ReportController
|
||
*/
|
||
@ManagedProperty(value = "#{reportController}")
|
||
private ReportController reportController;
|
||
|
||
/**
|
||
* Atributo para la lista de objetos TgeneProvince
|
||
*/
|
||
private List<TgeneProvince> lprovinces;
|
||
|
||
/**
|
||
* Atributo para la lista de objetos TgeneProvince
|
||
*/
|
||
private List<TgeneCanton> lcantones;
|
||
|
||
/**
|
||
* Atributo para la lista de objetos TgeneProvince
|
||
*/
|
||
private List<TgeneParroquia> lparroquias;
|
||
|
||
/**
|
||
* Atributo para la lista de objetos TgeneProvince
|
||
*/
|
||
private List<TgeneCity> lcities;
|
||
|
||
/**
|
||
* Atributo para la lista de objetos TgeneCatalogDetail
|
||
*/
|
||
private List<TgeneCatalogDetail> tipoProceso;
|
||
/**
|
||
* Atributo para la lista de objetos TgeneCatalogDetail
|
||
*/
|
||
private List<TgeneCatalogDetail> tipoDocumeno;
|
||
/**
|
||
* Atributo para la lista de objetos TgeneCatalogDetail
|
||
*/
|
||
private List<TgeneCatalogDetail> grados;
|
||
/**
|
||
* Atributo para la lista de objetos TgeneCatalogDetail
|
||
*/
|
||
private List<TgeneCatalogDetail> unidades;
|
||
|
||
private TsafeUserDetail tsafeUserDetail;
|
||
|
||
private String centroControl;
|
||
|
||
private String unidad;
|
||
|
||
private TarmCentroControl centroControlLogeado;
|
||
|
||
private List<TgeneCatalogDetail> centroControls;
|
||
/**
|
||
* Deshabilita la pantalla después de grabar la solicitud
|
||
*/
|
||
private boolean deshabilitarPantalla;
|
||
/**
|
||
* Deshabilita la pantalla materiales después de grabar la solicitud
|
||
*/
|
||
private boolean deshabilitarPantallaMaterial;
|
||
/**
|
||
* Atributo para setear el portador del arma
|
||
*/
|
||
private TcustPersonDetail tcustPersonDetailPortador;
|
||
|
||
private String nombrePortador;
|
||
/**
|
||
/**
|
||
* Atributo para ingresar el numero de identificacion del propietario
|
||
*/
|
||
private String identificacionPro;
|
||
/**
|
||
* Atributo para ingresar el tipo de identificacion del propietario
|
||
*/
|
||
private String tipoIdentificacionPro;
|
||
/**
|
||
* Variables de tipo boolean para selecionar el usuario sin portador
|
||
*/
|
||
private boolean sinPortador;
|
||
/**
|
||
* Variables de tipo boolean para selecionar el usuario sin documento
|
||
*/
|
||
private boolean sinDocumento;
|
||
|
||
/**
|
||
* Variables de tipo boolean para habilitar el boton crear en el lov registro material
|
||
*/
|
||
private boolean habilitaNoDecomiso;
|
||
/**
|
||
* Variables que permite el ingreso de un portador
|
||
*/
|
||
private String ingresoPortador;
|
||
/**
|
||
* Variables de tipo boolean para selecionar el usuario sin portador
|
||
*/
|
||
private boolean sinIdentificacion;
|
||
/**
|
||
* Atributo para la lista de objetos TgeneCatalogDetail
|
||
*/
|
||
private List<TgeneCatalogDetail> motivoDecomisoList;
|
||
/**
|
||
* Listado de marcas
|
||
*/
|
||
private List<TgeneCatalogDetail> lmarca;
|
||
/**
|
||
* Listado de colores
|
||
*/
|
||
private List<TgeneCatalogDetail> lcolor;
|
||
/**
|
||
* Listado de tipos de fabricación
|
||
*/
|
||
private List<TgeneCatalogDetail> ltipofabricacion;
|
||
/**
|
||
* Listado de paises
|
||
*/
|
||
private List<TgeneCountry> lcountry;
|
||
|
||
/**
|
||
* codigo del de arma
|
||
*/
|
||
private String codigoArma;
|
||
/**
|
||
* codigo del ruc
|
||
*/
|
||
private String codigoRuc;
|
||
/**
|
||
* codigo del ruc
|
||
*/
|
||
private String codigoCedula;
|
||
/**
|
||
* codigo de la persona por defaul
|
||
*/
|
||
private String codigoPersonaSinIdentificacion;
|
||
|
||
private String codigoTelefonoFijo;
|
||
/**
|
||
* descripción de la unidad de medida
|
||
*/
|
||
private String codigoUnidadpeso;
|
||
/**
|
||
* codigo del ruc
|
||
*/
|
||
private String codigoPasaporte;
|
||
/**
|
||
* descripción de la unidad de medida
|
||
*/
|
||
private String unidadpeso;
|
||
/**
|
||
* descripción de la unidad de medida
|
||
*/
|
||
private String descripcionUnidadpeso;
|
||
/**
|
||
* Tipo del arma explosivo
|
||
*/
|
||
private TarmTipoArmaExplosivo tipoArmaExplosivo ;
|
||
/**
|
||
* Arma seleccionada para el decomiso
|
||
*/
|
||
private List<TarmArmas> armaSeleccionadaList;
|
||
/**
|
||
* atributo para bloquear el boton
|
||
*/
|
||
private Boolean btn;
|
||
|
||
/**
|
||
* atributo para bloquear el boton
|
||
*/
|
||
private Boolean btnfileUpload;
|
||
|
||
/**
|
||
* atributo para bloquear el boton save
|
||
*/
|
||
private Boolean btnSave;
|
||
|
||
/**
|
||
* atributo para bloquear el boton
|
||
*/
|
||
private Boolean btnRegistro;
|
||
|
||
/**
|
||
* atributo para bloquear el boton tramite sino executa el reporte registo
|
||
*/
|
||
private Boolean isExecuteRegistro;
|
||
/**
|
||
* codigo del pais de origen
|
||
*/
|
||
private String codigoPaisOrigen;
|
||
/**
|
||
* Variable para el envio del mail
|
||
*/
|
||
private String cdecomiso;
|
||
|
||
private Boolean btnPeso;
|
||
|
||
private Boolean btnCantidad;
|
||
/**
|
||
* codigo de la provincia del usuario que se logueo
|
||
*/
|
||
private String cprovincia;
|
||
|
||
/**
|
||
* latitud de la direcci<63>n en el google map
|
||
*/
|
||
private String latitud;
|
||
/**
|
||
* longitud de la direcci<63>n en el google map
|
||
*/
|
||
private String longitud;
|
||
/**
|
||
* direccion en la que se va ha visualizar el map
|
||
*/
|
||
private String direccionGoogleMap;
|
||
/**
|
||
* Propiedad que premite controlar operaciones de cargar archivos al Alfresco
|
||
*/
|
||
@ManagedProperty(value = "#{alfrescoController}")
|
||
private AlfrescoController alfrescoController;
|
||
/**
|
||
* Variable que nos permite cargar el comprobante de deposito al Alfresco
|
||
*/
|
||
private UploadedFile uploadedFile;
|
||
/**
|
||
* tipoMapa permite visualizar la posicion del mapa por direccion o por coordenadas
|
||
*/
|
||
private String tipoMapa;
|
||
/**
|
||
* Nombre de la persona o empresa del decomisado sin documento
|
||
*/
|
||
private String nombrerazonsocialsindoc;
|
||
|
||
private String latitudG;
|
||
private String latitudM;
|
||
private String latitudS;
|
||
private String longuitudG;
|
||
private String longuitudM;
|
||
private String longuitudS;
|
||
|
||
private String latitudGMS;
|
||
private String longitudGMS;
|
||
/**
|
||
* Se recupera el filename del pdf para la descarga.
|
||
*/
|
||
private String filename;
|
||
/**
|
||
* Se recupera del pdf el byteArray para la descarga.
|
||
*/
|
||
private byte[] byteArray;
|
||
|
||
/**
|
||
* Indica si se debe activar la pestana de seleccionar material
|
||
*/
|
||
private boolean seleccionarMaterial;
|
||
|
||
/**
|
||
* Metodo invocado despues de instanciar el controlador
|
||
*/
|
||
@PostConstruct
|
||
private void postconstruct() {
|
||
this.init();
|
||
// Inicializa autoconsulta
|
||
super.startQuery();
|
||
}
|
||
|
||
/**
|
||
* Incializa variables del controlador, cuando se esta utilizando una pagina que utliza el controlador.
|
||
*/
|
||
public void init() {
|
||
try {
|
||
setDireccionGoogleMap("Ecuador");
|
||
this.recperpage = 10; // Cambiar al # reg a mirar.
|
||
this.lrecord = new ArrayList<>();
|
||
this.beanalias = "DECOMISOMATERIAL";
|
||
decomisoController.create();
|
||
decomisoController.clearAll();
|
||
personDetailController.create();
|
||
armasController.clearAll();
|
||
getArmasLovController().clearAll();
|
||
seleccionarMaterial = Boolean.FALSE;
|
||
btn= Boolean.FALSE;
|
||
btnfileUpload= Boolean.FALSE;
|
||
btnSave= Boolean.TRUE;
|
||
btnRegistro= Boolean.TRUE;
|
||
isExecuteRegistro= Boolean.FALSE;
|
||
deshabilitarPantalla = Boolean.FALSE;
|
||
deshabilitarPantallaMaterial = Boolean.FALSE;
|
||
sinDocumento = Boolean.FALSE;
|
||
habilitaNoDecomiso = Boolean.FALSE;
|
||
//Obteniendo los datos del usuario logueado
|
||
TsafeUserDetail tsafeUserDetail=(TsafeUserDetail)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
|
||
usuario=PersonDetailController.find(tsafeUserDetail.getPk().getPersoncode().toString());
|
||
//obtencion del centro de control
|
||
obtenerProvincia();
|
||
//centroControls=CatalogDetailController.find("INSTITUCION");
|
||
centroControl = tsafeUserDetail.getModifiedData().get("centrocontrol").toString();
|
||
unidad = tsafeUserDetail.getModifiedData().get("unidad").toString();
|
||
|
||
lprovinces = ProvinceController.find("EC");
|
||
//catalogo de (decomiso incautacion)
|
||
tipoProceso = CatalogDetailController.find("TIPOREGISTRO", "DECINC");
|
||
tipoDocumeno = CatalogDetailController.find("IDENTIFICATION");
|
||
grados = CatalogDetailController.find("MILITARYGRADE");
|
||
unidades = new ArrayList<>();
|
||
|
||
lmarca = CatalogDetailController.find("MARCA");
|
||
lcolor = CatalogDetailController.find("COLOR");
|
||
ltipofabricacion = CatalogDetailController.find("TIPOFABRICACION");
|
||
lcountry = CountryController.find();
|
||
// seteo de variables
|
||
decomisoController.getRecord().setFecharegistro(new java.sql.Date(new Date().getTime()));
|
||
//decomisoController.getRecord().setOrganismocontrol(centroControl.getModifiedData().get("desinstitucion").toString());
|
||
decomisoController.getRecord().setCountrycode("EC");
|
||
//consulta de los codigos a utilizarse en la pantalla
|
||
codigoArma=codigos("CODIGO.ARMADEFUEGO");
|
||
codigoRuc=codigos("CODIGO.RUC");
|
||
codigoCedula=codigos("CODIGO.CEDULA");
|
||
codigoPasaporte=codigos("CODIGO.PASAPORTE");
|
||
codigoUnidadpeso=codigos("CODIGO.PESO");
|
||
//codigoPersonaPortador=codigos("CODIGO.PERSONA.SINPORTADOR");
|
||
codigoTelefonoFijo=codigos("CODIGO.PHONE.FIJO");
|
||
codigoPersonaSinIdentificacion=codigos("CODIGO.PERSONA.SINPROPIETARIO");
|
||
tcustPersonDetailPortador=null;
|
||
sinPortador=Boolean.FALSE;
|
||
armaSeleccionadaList=new ArrayList<TarmArmas>();
|
||
cdecomiso=null;
|
||
btnPeso=Boolean.FALSE;
|
||
btnCantidad=Boolean.FALSE;
|
||
latitudG = "";
|
||
latitudM = "";
|
||
latitudS = "";
|
||
longuitudG = "";
|
||
longuitudM = "";
|
||
longuitudS = "";
|
||
} catch (Exception e) {
|
||
MessageHelper.setMessageError(e);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método para obtener el centro de control
|
||
* @throws Exception
|
||
*/
|
||
private void obtenerProvincia() throws Exception {
|
||
tsafeUserDetail=(TsafeUserDetail)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
|
||
PersonAddressController personAddressController = new PersonAddressController();
|
||
TcustPersonAddress tcustPersonAddres=personAddressController.findPrincipal(tsafeUserDetail.getPk().getPersoncode().toString());
|
||
if(tcustPersonAddres!=null && tcustPersonAddres.getProvincecode()!=null){
|
||
cprovincia=tcustPersonAddres.getProvincecode();
|
||
}else{
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_notienedireccionprincipal"));
|
||
return;
|
||
}
|
||
}
|
||
|
||
|
||
/* (non-Javadoc)
|
||
* @see com.fp.frontend.controller.AbstractController#querydatabase()
|
||
*/
|
||
@Override
|
||
protected void querydatabase() {
|
||
try {
|
||
Request request = this.callerhelper.getRequest();
|
||
DtoQuery dto = getDtoQuery(true);
|
||
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
||
mtables.put(getBeanalias(), dto); // permite adicionar mas de una tabla.
|
||
request.setQueryTables(mtables);
|
||
Response resp = this.callerhelper.executeQuery(request);
|
||
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
||
MessageHelper.setMessageError(resp);
|
||
} else {
|
||
resp.get(getBeanalias());
|
||
}
|
||
} catch (Throwable e) {
|
||
MessageHelper.setMessageError(e);
|
||
}
|
||
}
|
||
|
||
|
||
/* (non-Javadoc)
|
||
* @see com.fp.frontend.controller.AbstractController#save()
|
||
*/
|
||
@Override
|
||
public void save(){
|
||
try {
|
||
Request request = this.callerhelper.getRequest();
|
||
DtoSave dtosave = super.getDtoSave();
|
||
|
||
//valida que el documento de activida de control este cargado
|
||
if(uploadedFile == null){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_seleccionearchivodecomisoincautacion"));
|
||
return;
|
||
}
|
||
|
||
//valida si esta ingresado el funcionario
|
||
if(decomisoController.getRecord().getFuncionario()==null){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_ingrese_funcionario"));
|
||
return;
|
||
}
|
||
//Accion de dialog materiales
|
||
//armasSeleccionada();
|
||
|
||
//valida que el arma este seleccionada
|
||
if(armaSeleccionadaList==null || armaSeleccionadaList.size()==0){
|
||
String tipoprocesoStr = catalogoDescripcion(tipoProceso,decomisoController.getRecord().getTipoproceso());
|
||
if(tipoprocesoStr == null || tipoprocesoStr.isEmpty()){
|
||
tipoprocesoStr = " DECOMISO";
|
||
}
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_seleccioneelarmaarealizareldecomisoincautacion") +" "+tipoprocesoStr);
|
||
return;
|
||
}
|
||
|
||
if(sinDocumento){//validamos que se haya pulsado el boton de verificar o selecionado no propietario
|
||
tcustPersonDetailPortador=PersonDetailController.find(codigoPersonaSinIdentificacion);
|
||
decomisoController.getRecord().setNumerodocumento(tcustPersonDetailPortador.getIdentification());
|
||
if(nombrerazonsocialsindoc!=null && !nombrerazonsocialsindoc.isEmpty()){
|
||
decomisoController.getRecord().setNombrerazonsocial(nombrerazonsocialsindoc);
|
||
}
|
||
}
|
||
//validamos si tcustPersonDetailPortador este lleno o si han seleccionado sin portador para asignarle el por default
|
||
if(sinPortador){//validamos que se haya pulsado el boton de verificar o selecionado no propietario
|
||
tcustPersonDetailPortador=PersonDetailController.find(codigoPersonaSinIdentificacion);
|
||
decomisoController.getRecord().setNumerodocumento(tcustPersonDetailPortador.getIdentification());
|
||
}
|
||
if(tcustPersonDetailPortador==null){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_seleccionesinportadoroverifiqueusuarioexistente"));
|
||
return;
|
||
}
|
||
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
|
||
//----------datos del PERSONA
|
||
actualizaDatosPersonaPortador();
|
||
//persona detalle
|
||
DtoSave dtosavePersondetail = personDetailController.getDtoSave();
|
||
dtosavePersondetail.setReturnpk(true);
|
||
dtosavePersondetail.setPosition(1);
|
||
msave.put(personDetailController.getBeanalias(), dtosavePersondetail);
|
||
//telefono
|
||
DtoSave dtosavePersonphone = personPhoneController.getDtoSave();
|
||
dtosavePersonphone.setReturnpk(true);
|
||
dtosavePersonphone.setPosition(6);
|
||
msave.put(personPhoneController.getBeanalias(), dtosavePersonphone);
|
||
//----------DATOS DE ARMAS-REGISTRO DE ARMAS
|
||
//registro de armas
|
||
armasSeleccionadas();
|
||
//armas
|
||
DtoSave dtosaveArma = armasController.getDtoSave();//lleno
|
||
dtosaveArma.setPosition(3);
|
||
msave.put(armasController.getBeanalias(), dtosaveArma);
|
||
//registroarma
|
||
DtoSave dtosaveRegistroArma= registroArmController.getDtoSave();//vacio
|
||
dtosaveRegistroArma.setReturnpk(true);
|
||
dtosaveRegistroArma.setPosition(2);
|
||
msave.put(registroArmController.getBeanalias(), dtosaveRegistroArma);
|
||
//----------DECOMISO
|
||
//decomiso incautacion
|
||
//codigo de la person a que realiza el decomiso
|
||
decomisoController.getRecord().setPersoncoderegistra(tsafeUserDetail.getPk().getPersoncode());
|
||
//tipo proceso
|
||
decomisoController.getRecord().setTipoprocesocode("TIPOREGISTRO");
|
||
//tipo identificacion
|
||
decomisoController.getRecord().setTipodocumentocode("IDENTIFICATION");
|
||
//tipo de gardo del militar
|
||
decomisoController.getRecord().setGradofuncionariocode("MILITARYGRADE");
|
||
//catalogo del centro de control
|
||
decomisoController.getRecord().setCcentrocontrol(tsafeUserDetail.getCcentrocontrol());
|
||
decomisoController.getRecord().setOrganismocontrol(centroControl);
|
||
decomisoController.update();
|
||
|
||
DtoSave dtosaveDecomiso= decomisoController.getDtoSave();
|
||
dtosaveDecomiso.setPosition(4);
|
||
dtosaveDecomiso.setReturnpk(true);
|
||
msave.put(decomisoController.getBeanalias(), dtosaveDecomiso);
|
||
//----------DECOMISO ARMA CONTROLLER
|
||
DtoSave dtosaveDecomisoArma= decomisoArmaController.getDtoSave();
|
||
dtosaveDecomisoArma.setPosition(5);
|
||
msave.put(decomisoArmaController.getBeanalias(), dtosaveDecomisoArma);
|
||
|
||
msave.put(this.beanalias, dtosave);
|
||
request.setSaveTables(msave);
|
||
//---------TransactionRule DecomisoMAterial
|
||
Response resp = this.callerhelper.executeSave(request);
|
||
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
|
||
this.postCommit(resp);
|
||
btn = Boolean.TRUE;
|
||
btnSave = Boolean.TRUE;
|
||
btnRegistro = Boolean.FALSE;
|
||
deshabilitarPantalla = Boolean.TRUE;
|
||
deshabilitarPantallaMaterial = Boolean.TRUE;
|
||
decomisoController.postCommit(resp);
|
||
decomisoController.getRecord().setNumerotransaccion(resp.get("numerotransaccion").toString());
|
||
cdecomiso=resp.get("cdecomiso").toString();
|
||
|
||
//----------ARCHIVO ALFRESCO
|
||
subirArchivoAlfresco();
|
||
imprimir();
|
||
decomisoController.getRecord().setIsnew(false);
|
||
//Se actualizan los path de los reportes en el alfresco
|
||
decomisoController.update();
|
||
decomisoController.save();
|
||
|
||
uploadedFile = null;
|
||
armaSeleccionadaList = null;
|
||
MessageHelper.setMessageInfo(MsgControlArmas.getProperty("lbl_numerotransaccion") +": "+resp.get("numerotransaccion").toString());
|
||
|
||
} else {
|
||
MessageHelper.setMessageError(resp);
|
||
}
|
||
} catch (Throwable e) {
|
||
MessageHelper.setMessageError(e);
|
||
}
|
||
}
|
||
|
||
|
||
|
||
/**
|
||
* Metodo que permite grabar el documento de decommiso en el Alfresco
|
||
* @param decomiso
|
||
* */
|
||
public void subirArchivoAlfresco() {
|
||
try {
|
||
|
||
String tipoprocesoStr = catalogoDescripcion(tipoProceso,decomisoController.getRecord().getTipoproceso());
|
||
|
||
String xPathLocation= getRutaDocumentoSolBase() + "/cm:" + unidad.replace(" ", "_") + "/cm:" + tipoprocesoStr.replace(" ", "_") + "/cm:" + decomisoController.getRecord().getNumerotransaccion();
|
||
if(uploadedFile!=null && uploadedFile.getFileName()!=null){
|
||
String extencionArchivo=getExtension(uploadedFile.getFileName());
|
||
String nombreArchivo = "CMPREC-"+decomisoController.getRecord().getNumerorecibo()+"."+extencionArchivo;
|
||
//"cm:Decomiso/cm:A-2016/cm:M-01/cm:CENTRO CONTROL/cm:ABANDONO/cm:ABAN-00000123/cm:CMPREC-000000319.pdf"
|
||
decomisoController.getRecord().setXpath(xPathLocation + "/cm:" + nombreArchivo);
|
||
if(alfrescoController.uploadFile(uploadedFile.getInputstream(),nombreArchivo, xPathLocation)){
|
||
decomisoController.getRecord().setXpath(xPathLocation + "/cm:" + nombreArchivo);
|
||
|
||
}
|
||
else{
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_decomisoSinDatosAsociados"));
|
||
}
|
||
}
|
||
else{
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_ingreseDocumentoDecomiso"));
|
||
}
|
||
|
||
|
||
|
||
} catch (Exception e) {
|
||
// TODO Auto-generated catch block
|
||
e.printStackTrace();
|
||
} catch (Throwable e) {
|
||
// TODO Auto-generated catch block
|
||
e.printStackTrace();
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Metodo que genera el reporte recibo registro
|
||
* @param fila
|
||
*/
|
||
public void imprimir() {
|
||
try {
|
||
|
||
querydatabase();
|
||
//String gradoUsuario ="";
|
||
String path = "armas/reports/registrodecomisomaterial";
|
||
//String filename="REGISTRODECOMISO"+"-"+decomisoController.getRecord().getNumerorecibo();
|
||
filename = "CMPREG-"+decomisoController.getRecord().getNumerorecibo();
|
||
//Fija parametros del report.
|
||
HashMap<String, Object> parameters = new HashMap<>();
|
||
parameters.put("pathLogoIzquierda", "repo:/maia/1/image/comandoconjunto");
|
||
parameters.put("pathLogoDerecha", "repo:/maia/1/image/selloarmas");
|
||
|
||
String tipoprocesoStr = catalogoDescripcion(tipoProceso,decomisoController.getRecord().getTipoproceso());
|
||
String provinciaStr = ProvinceController.getDescProvByCodigo(decomisoController.getRecord().getCountrycode(),decomisoController.getRecord().getProvincecode());
|
||
String cantonStr = CantonController.getDescCantonByCodigo(decomisoController.getRecord().getCountrycode(),decomisoController.getRecord().getProvincecode(),decomisoController.getRecord().getCantoncode());
|
||
String cuidadStr = CityController.getDescCiudadByCodigo(decomisoController.getRecord().getCountrycode(),decomisoController.getRecord().getProvincecode(),decomisoController.getRecord().getCantoncode(),decomisoController.getRecord().getCitycode());
|
||
String parroquiaStr = ParroquiaController.getDescParroquiaByCodigo(decomisoController.getRecord().getCountrycode(),decomisoController.getRecord().getProvincecode(),decomisoController.getRecord().getCantoncode(),decomisoController.getRecord().getParroquiacode());
|
||
|
||
|
||
//Tipo Proceso
|
||
parameters.put("tipoproceso", "RECIBO DE REGISTRO "+tipoprocesoStr);
|
||
//No. Transaccion
|
||
parameters.put("pnumerotransaccion", decomisoController.getRecord().getNumerotransaccion());
|
||
//Nombre de la persona que decommisa
|
||
parameters.put("nombredecomisadopor", decomisoController.getRecord().getFuncionario());
|
||
//No. Documento
|
||
parameters.put("numerodocumento", decomisoController.getRecord().getCedulafuncionario());
|
||
//Organismo de Control
|
||
parameters.put("organismocontrol", decomisoController.getRecord().getOrganismocontrol());
|
||
//Unidad de Control
|
||
parameters.put("unidadcontrol", unidad);
|
||
//No. Comprobante recibo
|
||
parameters.put("numerocomprobante", decomisoController.getRecord().getNumerorecibo());
|
||
//Fecha Decomiso
|
||
parameters.put("fechadecomiso", decomisoController.getRecord().getFechadecomiso());
|
||
//Fecha Registro Decomiso
|
||
parameters.put("fecharegistrodecomiso", decomisoController.getRecord().getFecharegistro());
|
||
//Provincia Decomiso
|
||
parameters.put("provinciadecomiso", provinciaStr);
|
||
//Canton Decomiso
|
||
parameters.put("cantondecomiso", cantonStr);
|
||
//Cuidad Decomiso
|
||
parameters.put("cuidaddecomiso", cuidadStr);
|
||
//Parroquia Decomiso
|
||
parameters.put("parroquiadecomiso", parroquiaStr);
|
||
//Direccion Decomiso
|
||
parameters.put("direcciondecomiso", decomisoController.getRecord().getDireccion());
|
||
//Portador Decomiso
|
||
parameters.put("portadordecomiso", decomisoController.getRecord().getNombrerazonsocial());
|
||
//No. Documento Portador
|
||
parameters.put("numerodocumentoportador", decomisoController.getRecord().getNumerodocumento());
|
||
//Usuario
|
||
parameters.put("usuario",this.usuario.getName());
|
||
//Fecha
|
||
SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy / hh:mm:ss");
|
||
parameters.put("lugarFecha", sdf.format(Calendar.getInstance().getTime()));
|
||
|
||
String format = "pdf";
|
||
|
||
byteArray = this.reportController.jaspertoByteArray(path, parameters, format, filename, this.getLoginController());
|
||
|
||
// Se obtiene el InputStream para subir el archivo alfresco
|
||
InputStream inputStream = new ByteArrayInputStream(byteArray);
|
||
|
||
String nombreArchivo = (filename!=null && !filename.isEmpty()) ? filename+"."+format : null;
|
||
String xPathLocation= getRutaDocumentoSolBase() + "/cm:" + unidad.replace(" ", "_") + "/cm:" + tipoprocesoStr.replace(" ", "_") + "/cm:" + decomisoController.getRecord().getNumerotransaccion();
|
||
//="cm:Decomiso/cm:A-2016/cm:M-01/cm:CENTRO CONTROL/cm:ABANDONO/cm:ABAN-00000123/cm:CMPREG-000000319.pdf"
|
||
if (nombreArchivo != null && xPathLocation != null && inputStream != null) {
|
||
decomisoController.getRecord().setComprobantexpath(xPathLocation + "/cm:" + nombreArchivo);
|
||
if (alfrescoController.uploadFile(inputStream, nombreArchivo, xPathLocation)) {
|
||
decomisoController.getRecord().setComprobantexpath(xPathLocation + "/cm:" + nombreArchivo);
|
||
}
|
||
} else {
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_subiroarchivoregistrorecibo").concat("("+nombreArchivo+")"));
|
||
|
||
}
|
||
//Se executo el reporte
|
||
//isExecuteRegistro= Boolean.TRUE;
|
||
} catch (Exception ex) {
|
||
//isExecuteRegistro= Boolean.FALSE;
|
||
MessageHelper.setMessageError(ex);
|
||
return;
|
||
}
|
||
|
||
}
|
||
|
||
/**
|
||
* Metodo que genera el reporte recibo registro
|
||
*/
|
||
public void imprimirDocGenerado() {
|
||
try{
|
||
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
|
||
// Se nombra igual que el documento pdf que se encuentra en el alfresco
|
||
response.addHeader("Content-disposition", "attachment; filename=" + filename + ".pdf");
|
||
|
||
OutputStream outputStream = response.getOutputStream();
|
||
// Se escribe en el documento pdf el byte array recuperado del metodo imprimir
|
||
outputStream.write(byteArray);
|
||
outputStream.flush();
|
||
outputStream.close();
|
||
FacesContext.getCurrentInstance().responseComplete();
|
||
} catch (Exception ex) {
|
||
|
||
MessageHelper.setMessageError(ex);
|
||
return;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
/**
|
||
* Actualiza los datos del portador del arma
|
||
* @throws Exception
|
||
*/
|
||
private void actualizaDatosPersonaPortador() throws Exception {
|
||
personDetailController.clearAll();
|
||
// VALIDAMOS EL PORTADOR
|
||
if (tcustPersonDetailPortador.getPk() == null|| tcustPersonDetailPortador.getPk().getPersoncode() == null) {
|
||
// seteamos al portador
|
||
tcustPersonDetailPortador.setIsnew(true);
|
||
tcustPersonDetailPortador.setName(decomisoController.getRecord().getNombrerazonsocial());
|
||
tcustPersonDetailPortador.setIdentification(decomisoController.getRecord().getNumerodocumento());
|
||
tcustPersonDetailPortador.setIdentificationcatalog(decomisoController.getRecord().getTipodocumento());
|
||
tcustPersonDetailPortador.setIdentificationcatalogcode("IDENTIFICATION");
|
||
personDetailController.setRecord(tcustPersonDetailPortador);
|
||
personDetailController.update();
|
||
// creacion del telefono
|
||
if (decomisoController.getRecord().getTelefono() != null&& decomisoController.getRecord().getTelefono().length() > 0) {
|
||
personPhoneController.create();
|
||
personPhoneController.getRecord().setPhonetypecatalog(codigoTelefonoFijo);
|
||
personPhoneController.getRecord().setPhonetypecatalogcode("PHONETYPE");
|
||
personPhoneController.getRecord().setPhonenumber(decomisoController.getRecord().getTelefono());
|
||
personPhoneController.actualizar();
|
||
}
|
||
} else {
|
||
decomisoController.getRecord().setPersoncode(tcustPersonDetailPortador.getPk().getPersoncode());
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
/**
|
||
* Valida el si selecciona un arma
|
||
* @throws Exception
|
||
*/
|
||
private void armasSeleccionadas() throws Exception{
|
||
armasController.clearAll();
|
||
TgeneCatalogDetail estadoArma = CatalogDetailController.find("ESTADOARMA", decomisoController.getRecord().getTipoproceso()).get(0);
|
||
for(TarmArmas armas:armaSeleccionadaList){
|
||
//TarmArmas t= (TarmArmas)armas.cloneMe();
|
||
armasController.setRecord((TarmArmas)armas.cloneMe());
|
||
//t.getModifiedData().put("estadoseleccion",Boolean.FALSE); //selecciona solo un registro
|
||
if(armasController.getRecord().getModifiedData().get("estadoseleccion").equals(Boolean.TRUE)){
|
||
armasController.getRecord().setIsnew(true);
|
||
armasController.getRecord().setPk(null);
|
||
armasController.getRecord().setEstado(estadoArma.getPk().getCatalog());
|
||
armasController.getRecord().setEstadocodigo("ESTADOARMA");
|
||
//fech de registro
|
||
armasController.getRecord().setFecharegistro(new java.sql.Date(new Date().getTime()));
|
||
armasController.actualizar(armasController.getRecord());
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método que limpia las variables cuando escoge tipo documento
|
||
*/
|
||
// public void tipoDocumentoSel(AjaxBehaviorEvent event){
|
||
// if(event.getComponent().getAttributes().get("value") != null){
|
||
public void tipoDocumentoSel(){
|
||
if(this.decomisoController.getRecord().getTipodocumento() != null){
|
||
ingresoPortador = "CON DOCUMENTO";
|
||
validacioIngresoPortador();
|
||
}else{
|
||
ingresoPortador = null;
|
||
validacioIngresoPortador();
|
||
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método que limpia las variables cundo chequea sin portador
|
||
*/
|
||
public void sinPortador(){
|
||
|
||
if(sinPortador){
|
||
ingresoPortador = "SIN PORTADOR";
|
||
validacioIngresoPortador();
|
||
}else{
|
||
ingresoPortador = null;
|
||
validacioIngresoPortador();
|
||
}
|
||
|
||
}
|
||
|
||
/**
|
||
* Método que limpia las variables cundo chequea sin portador
|
||
*/
|
||
public void sinDocumento(){
|
||
if(sinDocumento){
|
||
ingresoPortador = "SIN DOCUMENTO";
|
||
validacioIngresoPortador();
|
||
}else{
|
||
ingresoPortador = null;
|
||
validacioIngresoPortador();
|
||
}
|
||
|
||
|
||
|
||
}
|
||
|
||
private void validacioIngresoPortador(){
|
||
if(ingresoPortador==null){
|
||
sinDocumento = Boolean.FALSE;
|
||
sinPortador = Boolean.FALSE;
|
||
this.decomisoController.getRecord().setTipodocumento(null);
|
||
this.decomisoController.getRecord().setNumerodocumento(null);
|
||
this.decomisoController.getRecord().setNombrerazonsocial(null);
|
||
}else if(ingresoPortador.equals("SIN PORTADOR")){
|
||
sinDocumento = Boolean.FALSE;
|
||
this.decomisoController.getRecord().setTipodocumento(null);
|
||
this.decomisoController.getRecord().setNumerodocumento(null);
|
||
this.decomisoController.getRecord().setNombrerazonsocial(null);
|
||
}else if(ingresoPortador.equals("SIN DOCUMENTO")){
|
||
sinPortador = Boolean.FALSE;
|
||
this.decomisoController.getRecord().setTipodocumento(null);
|
||
this.decomisoController.getRecord().setNumerodocumento(null);
|
||
this.decomisoController.getRecord().setNombrerazonsocial(null);
|
||
|
||
}else if(ingresoPortador.equals("CON DOCUMENTO")){
|
||
sinPortador = Boolean.FALSE;
|
||
sinDocumento = Boolean.FALSE;
|
||
/*this.decomisoController.getRecord().setNumerodocumento(null);
|
||
this.decomisoController.getRecord().setNombrerazonsocial(null);*/
|
||
}
|
||
|
||
}
|
||
|
||
|
||
/**
|
||
* Método para inicializar la lista de las armas
|
||
* y validacién de los datos del portador
|
||
*/
|
||
public void registrarMaterial(){
|
||
if(!sinPortador && !sinDocumento){
|
||
validarPortador();
|
||
}
|
||
//valida que el documento de activida de control este cargado
|
||
if(uploadedFile == null){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_recuerdeClickCargarDocActControl"));
|
||
return;
|
||
}
|
||
armasController.setLrecord(new ArrayList<TarmArmas>());
|
||
armasController.getMfilters().put("lote", null);
|
||
|
||
if (decomisoController.getRecord().getTipoproceso().equals("DECO")) {
|
||
habilitaNoDecomiso = Boolean.TRUE;
|
||
}
|
||
deshabilitarPantalla = Boolean.TRUE;
|
||
seleccionarMaterial = Boolean.TRUE;
|
||
btnfileUpload= Boolean.TRUE;
|
||
btn= Boolean.TRUE;
|
||
btnSave= Boolean.TRUE;
|
||
FacesContext context = FacesContext.getCurrentInstance();
|
||
context.addMessage(null, new FacesMessage("RECUERDE", MsgControlArmas.getProperty("msg_recuerdeClickTabRegMaterial")));
|
||
|
||
}
|
||
|
||
public void changeTipoProceso(){
|
||
|
||
if (decomisoController.getRecord().getTipoproceso().equals("DECO")) {
|
||
habilitaNoDecomiso = Boolean.TRUE;
|
||
}else{
|
||
habilitaNoDecomiso = Boolean.FALSE;
|
||
}
|
||
|
||
String catalogReg = decomisoController.getRecord().getTipoproceso();
|
||
motivoDecomisoList = new ArrayList<TgeneCatalogDetail>();
|
||
if (catalogReg != null && !catalogReg.equals("")) {
|
||
if (catalogReg.equals("INCA")) {
|
||
catalogReg = "DECO";
|
||
}
|
||
motivoDecomisoList = CatalogDetailController.find("MOTIVODECOMISO",
|
||
catalogReg);
|
||
} else {
|
||
motivoDecomisoList = CatalogDetailController.find("MOTIVODECOMISO");
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método que se ejecuta al pulsar el boton aceptar del dialog que lista las armas a seleccionar
|
||
* Valida si selecciono algun registro si no le obliga a seleccionar
|
||
*/
|
||
public void armasSeleccionada(){
|
||
//validamos que de la lista exista un registro escogido
|
||
armaSeleccionadaList=new ArrayList<TarmArmas>();
|
||
for(TarmArmas t:armasController.getLrecord()){
|
||
if(Boolean.TRUE.equals(t.getModifiedData().get("estadoseleccion"))){
|
||
armaSeleccionadaList.add(t);
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método para el evento change del combo provincias
|
||
*/
|
||
public void executeProvince() {
|
||
if ((decomisoController.getRecord().getCountrycode() != null) && (decomisoController.getRecord().getCountrycode().compareTo("") != 0)) {
|
||
lcantones = CantonController.find(decomisoController.getRecord().getCountrycode(), decomisoController.getRecord().getProvincecode());
|
||
lparroquias = new ArrayList<>();
|
||
lcities = new ArrayList<>();
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método para el evento change del combo cantones
|
||
*/
|
||
public void executeCanton() {
|
||
if ((decomisoController.getRecord().getCountrycode() != null) && (decomisoController.getRecord().getCountrycode().compareTo("") != 0)) {
|
||
lparroquias = ParroquiaController.find(decomisoController.getRecord().getCountrycode(), decomisoController.getRecord().getProvincecode(), decomisoController.getRecord().getCantoncode());
|
||
lcities = CityController.find(decomisoController.getRecord().getCountrycode(), decomisoController.getRecord().getProvincecode(), decomisoController.getRecord().getCantoncode());
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método para el evento change del combo ciudad
|
||
*/
|
||
public void executeCiudad() {
|
||
if ((decomisoController.getRecord().getCantoncode() != null) && (decomisoController.getRecord().getCantoncode().compareTo("") != 0)) {
|
||
List<TgeneCity> lcities = CityController.find(decomisoController.getRecord().getCountrycode(), decomisoController.getRecord().getProvincecode(), decomisoController.getRecord().getCantoncode());
|
||
setDireccionGoogleMap(lcities.get(0).getDescription() + ", " + "Ecuador");
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método que valida la persona portadora del arma o explosivo
|
||
* en las tablas de maia y en la snap
|
||
*
|
||
*/
|
||
public void validarPortador(){
|
||
//this.decomisoController.getRecord().setNombrerazonsocial(null);
|
||
//-------------------validar SELECCION TIPO UBICACION
|
||
if(tipoMapa == null || "".equals(tipoMapa)){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("mg_error_seleccioneeltipoMapa"));
|
||
return;
|
||
}
|
||
//-------------------validar LATITUD Y LONGITUD
|
||
if(decomisoController.getRecord().getLatitud()==null || decomisoController.getRecord().getLongitud()==null){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("mg_error_seleccioneeltipodedocumentooingreselongitudlatitud"));
|
||
return;
|
||
}
|
||
if(decomisoController.getRecord().getNumerodocumento()==null || decomisoController.getRecord().getTipodocumento()==null){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("mg_error_seleccioneeltipodedocumentooingreselacedula"));
|
||
return;
|
||
}
|
||
if(decomisoController.getRecord().getTipodocumento().equals(codigoCedula)){
|
||
//----------validamos si es valida la CEDULA
|
||
if(!ValidateIdentification.cedula(decomisoController.getRecord().getNumerodocumento())){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_nodocumentoinvalido"));
|
||
return;
|
||
}
|
||
//envia a buscar en MAIA
|
||
tcustPersonDetailPortador=buscarPersonaMaia(decomisoController.getRecord().getNumerodocumento(),decomisoController.getRecord().getTipodocumento());
|
||
if(tcustPersonDetailPortador==null){
|
||
//envia a buscar en la SNAP
|
||
tcustPersonDetailPortador=buscarPersonaSnap(decomisoController.getRecord().getNumerodocumento(),decomisoController.getRecord().getTipodocumento());
|
||
}
|
||
}else if(decomisoController.getRecord().getTipodocumento().equals(codigoRuc)){
|
||
//----------validamos si es valida el RUC
|
||
if(!ValidateIdentification.ruc(decomisoController.getRecord().getNumerodocumento())){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_nodocumentoinvalido"));
|
||
return;
|
||
}
|
||
//envia a buscar en maia
|
||
tcustPersonDetailPortador=buscarPersonaMaia(decomisoController.getRecord().getNumerodocumento(),decomisoController.getRecord().getTipodocumento());
|
||
if(tcustPersonDetailPortador==null){
|
||
//envia a buscar en la snap
|
||
tcustPersonDetailPortador=buscarPersonaSnap(decomisoController.getRecord().getNumerodocumento(),decomisoController.getRecord().getTipodocumento());
|
||
}
|
||
}else{
|
||
//----------si es PASAPORTE
|
||
tcustPersonDetailPortador=buscarPersonaMaia(decomisoController.getRecord().getNumerodocumento(),decomisoController.getRecord().getTipodocumento());
|
||
if(tcustPersonDetailPortador==null){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("mg_error_usuarionoencontrado"));
|
||
tcustPersonDetailPortador= new TcustPersonDetail();
|
||
tcustPersonDetailPortador.setIdentification(decomisoController.getRecord().getNumerodocumento());
|
||
tcustPersonDetailPortador.setIdentificationcatalog(decomisoController.getRecord().getTipodocumento());
|
||
tcustPersonDetailPortador.setIdentificationcatalogcode("IDENTIFICATION");
|
||
tcustPersonDetailPortador.setName(decomisoController.getRecord().getNombrerazonsocial());
|
||
|
||
}
|
||
}
|
||
//validamos que existe la persona en Maia o SNAP
|
||
if(tcustPersonDetailPortador!=null && tcustPersonDetailPortador.getIdentification()!=null && tcustPersonDetailPortador.getName()!=null){
|
||
//seteamos el nombre para visualizarle
|
||
decomisoController.getRecord().setNombrerazonsocial(tcustPersonDetailPortador.getName());
|
||
nombrePortador = tcustPersonDetailPortador.getName();
|
||
}else if(!decomisoController.getRecord().getTipodocumento().equals(codigoPasaporte)){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("mg_error_usuarionoencontrado"));
|
||
tcustPersonDetailPortador= new TcustPersonDetail();
|
||
|
||
}
|
||
|
||
}
|
||
|
||
/**
|
||
* Método para validar si la persona existe en la BD de Maia
|
||
* @param numeroDocumento
|
||
* @param tipoDocumento
|
||
* @return TcustPersonDetail
|
||
*/
|
||
public TcustPersonDetail buscarPersonaMaia(String numeroDocumento, String tipoDocumento){
|
||
return PersonDetailController.findxidentification(numeroDocumento,tipoDocumento);
|
||
}
|
||
|
||
/**
|
||
* Método para buscar a la persona en la snap
|
||
* @param documento
|
||
*/
|
||
public TcustPersonDetail buscarPersonaSnap(String documento,String tipoDocumento){
|
||
if(tipoDocumento.equals(codigoCedula)){
|
||
Cedula cedula= ClienteCedula.obtenerCedula(documento);
|
||
if(cedula!=null){
|
||
TcustPersonDetail detail= new TcustPersonDetail();
|
||
detail.setName(cedula.getNombre());
|
||
detail.setIdentification(cedula.getCedula());
|
||
detail.setIdentificationcatalog("CED");
|
||
detail.setIdentificationcatalogcode("IDENTIFICATION");
|
||
detail.setDatefrom(new Timestamp(System.currentTimeMillis()));
|
||
return detail;
|
||
}else{
|
||
return null;
|
||
}
|
||
}else {
|
||
Contribuyente contribuyente= ClienteRUC.obtenerRUC(documento);
|
||
if(contribuyente!=null){
|
||
TcustPersonDetail detail= new TcustPersonDetail();
|
||
detail.setName(contribuyente.getRazonSocial());
|
||
detail.setIdentification(contribuyente.getNumeroRuc());
|
||
detail.setIdentificationcatalog("RUC");
|
||
detail.setIdentificationcatalogcode("IDENTIFICATION");
|
||
detail.setDatefrom(new Timestamp(System.currentTimeMillis()));
|
||
return detail;
|
||
}else{
|
||
return null;
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
/**
|
||
* Método para manejar el evento change en el CheckBox
|
||
* Arma a decomisar
|
||
* @throws Exception
|
||
*/
|
||
public void onChange(TarmArmas arma) throws Exception {
|
||
|
||
for(TarmArmas t:armasController.getLrecord()){
|
||
//t.getModifiedData().put("estadoseleccion",Boolean.FALSE); //selecciona solo un registro
|
||
if(arma.getPk()==null && t.getPk()==null){
|
||
if(validacioncampos(arma)){
|
||
}else{
|
||
t.getModifiedData().put("estadoseleccion",Boolean.FALSE);
|
||
}
|
||
}else if(arma.getPk()!=null && arma.getPk().equals(t.getPk())){
|
||
if(validacioncampos(arma)){
|
||
//arma.getModifiedData().put("estadoseleccion",Boolean.TRUE);
|
||
//le asignamos un umero para que le ordene
|
||
if (armaSeleccionadaList.contains(arma)) {
|
||
arma.getModifiedData().put("ordenarma", 0);
|
||
armaSeleccionadaList.remove(arma);
|
||
armaSeleccionadaList.add(arma);
|
||
}else{
|
||
armaSeleccionadaList.add(arma);
|
||
}
|
||
}else{
|
||
t.getModifiedData().put("estadoseleccion",Boolean.FALSE);
|
||
if(armaSeleccionadaList.contains(arma)){
|
||
armaSeleccionadaList.remove(arma);
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
|
||
}
|
||
|
||
/**
|
||
* Método para validar los campos esten ingresados
|
||
* @param arma
|
||
* @return
|
||
*/
|
||
private Boolean validacioncampos(TarmArmas arma){
|
||
if(arma.getModifiedData().get("motivocatalogo")==null){
|
||
MessageHelper.setMessageError("INGRESE EL MOTIVO DE DECOMISO/INCAUTACION DEL ARMA CODIDGO : "+arma.getPk());
|
||
return false;
|
||
}
|
||
if(arma.getModifiedData().get("cantidad")==null){
|
||
MessageHelper.setMessageError("INGRESE EL MOTIVO DE DECOMISO/INCAUTACION DEL ARMA CODIDGO : "+arma.getPk());
|
||
return false;
|
||
}
|
||
if(arma.getModifiedData().get("observaciondecomiso")==null){
|
||
MessageHelper.setMessageError("INGRESE EL MOTIVO DE DECOMISO/INCAUTACION DEL ARMA CODIDGO : "+arma.getPk());
|
||
return false;
|
||
}
|
||
|
||
return true ;
|
||
}
|
||
/**
|
||
* Método para ingresar el motivo del decomiso
|
||
* desde el popup
|
||
*/
|
||
public void datosDecomiso(){
|
||
if(decomisoController.getRecord().getTipoproceso()==null ||decomisoController.getRecord().getTipoproceso().isEmpty()){
|
||
MessageHelper.setMessageError("INGRESE EL TIPO DE PROCESO EN DATOS GENERALES");
|
||
return;
|
||
}/*else{
|
||
String catalogReg = decomisoController.getRecord().getTipoproceso();
|
||
if(catalogReg.equals("INCA")){
|
||
catalogReg = "DECO";
|
||
}
|
||
motivoDecomisoList = CatalogDetailController.find("MOTIVODECOMISO",catalogReg);
|
||
}*/
|
||
|
||
try {
|
||
//se setea el tipo del proceso
|
||
if(armasController.getRecord().getModifiedData().get("estadodecomiso")==null){
|
||
armasController.getRecord().getModifiedData().put("estadodecomiso", decomisoController.getRecord().getTipoproceso());
|
||
}
|
||
|
||
if(armasController.getRecord().getCantidad()!=null){
|
||
armasController.getRecord().getModifiedData().put("cantidad", armasController.getRecord().getCantidad());
|
||
}
|
||
if(armasController.getRecord().getPeso()!=null){
|
||
armasController.getRecord().getModifiedData().put("cantidad", armasController.getRecord().getPeso());
|
||
}
|
||
|
||
} catch (Exception e) {
|
||
MessageHelper.setMessageError(e);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método para actualizar el motivo del decomiso del arma arma existente
|
||
* se ejecuta en el botón del formulario del motivo de decomiso
|
||
*/
|
||
public void actualizarDecomiso(){
|
||
|
||
TgeneCatalogDetail estadoArma = CatalogDetailController.find("ESTADOARMA", decomisoController.getRecord().getTipoproceso()).get(0);
|
||
if(estadoArma!=null){
|
||
armasController.getRecord().getModifiedData().put("estadodecomisodesc", estadoArma.getDescription());
|
||
}
|
||
//seteod de los codigos
|
||
armasController.getRecord().getModifiedData().put("motivocatalogocode", "MOTIVODECOMISO");
|
||
armasController.getRecord().getModifiedData().put("estadodecomisocode", "TIPOREGISTRO");
|
||
//descripcion del motivodecomiso
|
||
catalogos(motivoDecomisoList, armasController.getRecord().getModifiedData().get("motivocatalogo").toString(), "motivodecomisodesc");
|
||
}
|
||
|
||
/**
|
||
* Método para actualizar el arma cuando ya llena los datos en el formulario de crear arma
|
||
* @throws Exception
|
||
*/
|
||
public void actualizarArmaCreada() throws Exception {
|
||
//valida la combinacion del arma que exista
|
||
if(tipoArmaExplosivo == null || tipoArmaExplosivo.getPk()==null){
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_camposrequeridos"));
|
||
return;
|
||
}
|
||
//armasController.clearAll();
|
||
// for(TarmArmas t:armasController.getLrecord()){
|
||
// t.getModifiedData().put("estadoseleccion",Boolean.FALSE);
|
||
// }
|
||
//DATOS PARA VISUALIZAR EN PANTALLA
|
||
//DATOS DE LA GRILLA
|
||
//cantidad
|
||
if(armasController.getRecord().getCantidad()!=null && armasController.getRecord().getCantidad()>0){
|
||
armasController.getRecord().getModifiedData().put("cantidad", armasController.getRecord().getCantidad());
|
||
}
|
||
if(armasController.getRecord().getPeso()!=null && armasController.getRecord().getPeso().compareTo(new BigDecimal(0))>0){
|
||
armasController.getRecord().getModifiedData().put("cantidad", armasController.getRecord().getPeso());
|
||
}
|
||
//propietario
|
||
TcustPersonDetail tcustPersonDetail=PersonDetailController.find(codigoPersonaSinIdentificacion);
|
||
armasController.getRecord().getModifiedData().put("propietario", tcustPersonDetail.getName());
|
||
//unidad de medida
|
||
armasController.getRecord().getModifiedData().put("unidadmedida",tipoArmaExplosivo.getUnidadmedidapeso());
|
||
//unidad de medida
|
||
armasController.getRecord().getModifiedData().put("unidadmedidadesc",tipoArmaExplosivo.getUnidadmedidapeso());
|
||
//le asignamos una marca
|
||
|
||
TgeneCatalogDetail marcaArma = CatalogDetailController.findCatalog("MARCA", armasController.getRecord().getMarca()).get(0);
|
||
if(marcaArma!=null){
|
||
armasController.getRecord().getModifiedData().put("marca",marcaArma.getDescription());
|
||
}
|
||
TgeneCatalogDetail estadoArma = CatalogDetailController.find("ESTADOARMA", decomisoController.getRecord().getTipoproceso()).get(0);
|
||
if(estadoArma!=null){
|
||
armasController.getRecord().getModifiedData().put("estado",estadoArma.getDescription());
|
||
armasController.getRecord().getModifiedData().put("estadodecomisodesc", estadoArma.getDescription());
|
||
}
|
||
|
||
//motivo del decomiso
|
||
catalogos(motivoDecomisoList, armasController.getRecord().getModifiedData().get("motivocatalogo").toString(), "motivodecomisodesc");
|
||
|
||
//seteamos el check
|
||
armasController.getRecord().getModifiedData().put("estadoseleccion",Boolean.TRUE);
|
||
|
||
//seteo de codigos
|
||
armasController.getRecord().getModifiedData().put("motivocatalogocode", "MOTIVODECOMISO");//['motivocatalogo']
|
||
armasController.getRecord().getModifiedData().put("estadodecomisocode", "TIPOREGISTRO");//['estadodecomiso']
|
||
|
||
//datos para el REGISTROARMA
|
||
//personcode
|
||
armasController.getRecord().getModifiedData().put("personcode",tcustPersonDetail.getPk().getPersoncode());
|
||
armasController.getRecord().getModifiedData().put("tiporegistro",decomisoController.getRecord().getTipoproceso());
|
||
armasController.getRecord().getModifiedData().put("tiporegistrocode","TIPOREGISTRO");
|
||
//pais de origen
|
||
armasController.getRecord().getModifiedData().put("paisorigen",codigoPaisOrigen);
|
||
//fecha de creacion
|
||
armasController.getRecord().getModifiedData().put("fechacreacion",new java.sql.Date(new Date().getTime()));
|
||
|
||
//pais de origen
|
||
armasController.getRecord().setCpaisorigen(codigoPaisOrigen);
|
||
armasController.getRecord().setColorcodigo("COLOR");
|
||
armasController.getRecord().setTipofabricacioncodigo("TIPOFABRICACION");
|
||
//unidad de medida
|
||
armasController.getRecord().setUnidadmedidacantidad(tipoArmaExplosivo.getUnidadmedidapeso());
|
||
armasController.getRecord().setUnidadmedidacantidadcodigo("UNIDADMEDIDA");
|
||
//fech de registro
|
||
armasController.getRecord().setFecharegistro(new java.sql.Date(new Date().getTime()));
|
||
//le asignamos un umero para que le ordene
|
||
armasController.getRecord().getModifiedData().put("ordenarma",0);
|
||
//ACTUALIZA EL ARMA
|
||
armasController.actualizar(armasController.getRecord());
|
||
//Valor razon social
|
||
//nombrePortador
|
||
decomisoController.getRecord().setNombrerazonsocial(nombrePortador);
|
||
//limpiamos la variable
|
||
tipoArmaExplosivo=null;
|
||
btnPeso=Boolean.FALSE;
|
||
btnCantidad=Boolean.FALSE;
|
||
|
||
//ordena la lista lvigenciaMeses
|
||
Collections.sort(armasController.getLrecord(), new Comparator<TarmArmas>() {
|
||
public int compare(TarmArmas p1, TarmArmas p2) {
|
||
return String.valueOf(p1.getModifiedData().get("ordenarma")).compareTo(String.valueOf(p2.getModifiedData().get("ordenarma")));
|
||
}
|
||
});
|
||
|
||
armaSeleccionadaList.add(armasController.getRecord());
|
||
|
||
}
|
||
|
||
|
||
/**
|
||
* Método para recorreer los combos y setear las descripciones de lo q se escoge
|
||
* para la vista
|
||
* @param list
|
||
* @param codigo
|
||
* @param pk
|
||
*/
|
||
public void catalogos(List<TgeneCatalogDetail>list, String codigo,String pk){
|
||
for(TgeneCatalogDetail item:list){
|
||
if(codigo.equals(item.getPk().getCatalog())){
|
||
armasController.getRecord().getModifiedData().put(pk, item.getDescription());
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método para devolver la descripcion
|
||
*
|
||
* @param list
|
||
* @param codigo
|
||
* @return
|
||
*/
|
||
public String catalogoDescripcion(List<TgeneCatalogDetail> list, String codigo) {
|
||
for (TgeneCatalogDetail item : list) {
|
||
if (codigo.equals(item.getPk().getCatalog())) {
|
||
return item.getDescription();
|
||
}
|
||
}
|
||
return null;
|
||
}
|
||
|
||
|
||
/**
|
||
* Método para crear un arma a decomisar
|
||
* @throws Exception
|
||
*/
|
||
public void createArmaDecomisada() throws Exception {
|
||
//inicializamos el amra
|
||
armasController.create();
|
||
armasController.getRecord().setCountrycode("EC");
|
||
TgeneCatalogDetail estadoArma = CatalogDetailController.find("ESTADOARMA", decomisoController.getRecord().getTipoproceso()).get(0);
|
||
if(estadoArma!=null){
|
||
armasController.getRecord().setEstado(estadoArma.getPk().getCatalog());
|
||
}
|
||
armasController.getRecord().setEstadocodigo("ESTADOARMA");
|
||
armasController.getRecord().setMarcacodigo("MARCA");
|
||
armasController.setLprovincias(ProvinceController.find(armasController.getRecord().getCountrycode()));
|
||
armasController.executeProvince();
|
||
unidadpeso=null;
|
||
descripcionUnidadpeso=null;
|
||
// tcustPersonDetailPropietario= new TcustPersonDetail();
|
||
//se setea el tipo del proceso
|
||
armasController.getRecord().getModifiedData().put("estadodecomiso", decomisoController.getRecord().getTipoproceso());
|
||
if(!sinPortador){
|
||
//cargamos los datos del usuario portador
|
||
//tipo de identificacion
|
||
tipoIdentificacionPro=decomisoController.getRecord().getTipodocumento();
|
||
//numero de documento
|
||
identificacionPro=decomisoController.getRecord().getNumerodocumento();
|
||
//nombre razon social
|
||
// tcustPersonDetailPropietario.setName(decomisoController.getRecord().getNombrerazonsocial());
|
||
}
|
||
//NUEVO
|
||
if(!sinDocumento){
|
||
decomisoController.getRecord().setNombrerazonsocial(nombrerazonsocialsindoc);
|
||
}
|
||
codigoPaisOrigen=null;
|
||
descripcionUnidadpeso=null;
|
||
btnPeso=Boolean.FALSE;
|
||
btnCantidad=Boolean.FALSE;
|
||
}
|
||
|
||
|
||
/**
|
||
* Abre el LOV de la clase del arma
|
||
*/
|
||
public void openArmaExplosivoLov() {
|
||
armasController.getRecord().getModifiedData().put("longitud", null);
|
||
armasController.getRecord().getModifiedData().put("tipoarmaexplosivo", null);
|
||
armasController.getRecord().getModifiedData().put("calibre", null);
|
||
descripcionUnidadpeso=null;
|
||
Map<String, List<String>> params = new HashMap<>();
|
||
ArmaExplosivoLovController.openLov(params);
|
||
}
|
||
|
||
/**
|
||
* Regresa del LOV de armas
|
||
* @param event
|
||
*/
|
||
public void onReturnArmaExplosivo(SelectEvent event) {
|
||
tipoArmaExplosivo = (TarmTipoArmaExplosivo) event.getObject();
|
||
armasController.getRecord().setCantidad(null);
|
||
armasController.getRecord().setPeso(null);
|
||
armasController.getRecord().getModifiedData().put("clase", tipoArmaExplosivo.getModifiedData().get("nclase"));
|
||
armasController.getRecord().getModifiedData().put("tipoarmaexplosivo", tipoArmaExplosivo.getModifiedData().get("ntipo"));
|
||
armasController.getRecord().getModifiedData().put("longitud", tipoArmaExplosivo.getModifiedData().get("nlongitud"));
|
||
armasController.getRecord().getModifiedData().put("calibre", tipoArmaExplosivo.getModifiedData().get("ncalibre"));
|
||
if(tipoArmaExplosivo.getModifiedData().get("desunidad")!=null){
|
||
unidadpeso=tipoArmaExplosivo.getModifiedData().get("desunidad").toString();
|
||
}else{
|
||
unidadpeso=null;
|
||
}
|
||
if(tipoArmaExplosivo.getClase().equals(codigoArma)){
|
||
armasController.getRecord().setCantidad(1);
|
||
armasController.getRecord().getModifiedData().put("cantidad", 1);
|
||
}else{
|
||
armasController.getRecord().setCantidad(null);
|
||
armasController.getRecord().getModifiedData().put("cantidad",null);
|
||
}
|
||
//codigo del arma explosivo
|
||
armasController.getRecord().setCtipoarmaexplosivo(tipoArmaExplosivo.getPk());
|
||
btnPeso=Boolean.FALSE;
|
||
btnCantidad=Boolean.FALSE;
|
||
if(tipoArmaExplosivo.getModifiedData().get("deslegalcode")!=null){
|
||
descripcionUnidadpeso=tipoArmaExplosivo.getModifiedData().get("deslegalcode").toString();
|
||
if(codigoUnidadpeso.equals(descripcionUnidadpeso)){
|
||
btnPeso=Boolean.TRUE;
|
||
}else{
|
||
btnCantidad=Boolean.TRUE;
|
||
}
|
||
}else{
|
||
descripcionUnidadpeso=null;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método para inicilalizar los campos segun la unidad de medida (unidad, kg)
|
||
|
||
* @param cantidad
|
||
*/
|
||
public void cantidad(Integer cantidad){
|
||
armasController.getRecord().setPeso(null);
|
||
armasController.getRecord().getModifiedData().put("cantidad", cantidad);
|
||
}
|
||
/**
|
||
* Método para inicilalizar los campos segun la unidad de medida (unidad, kg)
|
||
|
||
* @param peso
|
||
*/
|
||
public void peso(BigDecimal peso){
|
||
armasController.getRecord().setCantidad(null);
|
||
armasController.getRecord().getModifiedData().put("cantidad", peso);
|
||
}
|
||
|
||
/**
|
||
* Método que elimina el arma creada solamente de la vista
|
||
* @param arma
|
||
*/
|
||
public void eliminarArmaVista(TarmArmas arma){
|
||
try {
|
||
armasController.remove();
|
||
// tcustPersonDetailPropietario= new TcustPersonDetail();
|
||
tipoDocumeno=null;
|
||
identificacionPro=null;
|
||
} catch (Exception e) {
|
||
MessageHelper.setMessageError(e);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Validacion de las fechas que no se amayor a la actual
|
||
* @param fech
|
||
*/
|
||
public void validarComprobanteRecibo(String numerorecibo){
|
||
String tipoproceso = this.decomisoController.getRecord().getTipoproceso();
|
||
String organismoControl = tsafeUserDetail.getCcentrocontrol();
|
||
|
||
if(tipoproceso ==null || tipoproceso.isEmpty()){
|
||
decomisoController.getRecord().setNumerorecibo("");
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_validarnumerocomprobanterecibo"));
|
||
return;
|
||
}
|
||
boolean isRecibo = DecomisoController.findReciboByTipoProcesoOrganismoControl(numerorecibo, tipoproceso, organismoControl);
|
||
if(isRecibo){
|
||
decomisoController.getRecord().setNumerorecibo("");
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_numerocomprobanterecibo"));
|
||
return;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Validacion de las fechas que no se amayor a la actual
|
||
* @param fech
|
||
*/
|
||
public void validarfecha(Date fech){
|
||
if(fech.getTime()>(new Date()).getTime()){
|
||
fech=new Date();
|
||
decomisoController.getRecord().setFechadecomiso(new java.sql.Date(new Date().getTime()));
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_fechadecomisonopuedesermayoralaactual"));
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Método para obtener los codigos
|
||
*/
|
||
public String codigos(String parametro){
|
||
TgeneParameters tgeneParameters= ParametersController.find(parametro, "1");
|
||
return tgeneParameters.getTextvalue();
|
||
}
|
||
public void querySelMaterial(){
|
||
|
||
try {
|
||
|
||
noFiltrarCodigosEstados();
|
||
armasLovController.setRecperpage(500);
|
||
armasLovController.query();
|
||
|
||
armasController.getLrecord().clear();
|
||
|
||
if (armasLovController.getLrecord() != null
|
||
|| !armasLovController.getLrecord().isEmpty()) {
|
||
armasController.getLrecord().addAll(armasLovController.getLrecord());
|
||
}
|
||
|
||
if(armaSeleccionadaList !=null && !armaSeleccionadaList.isEmpty()){
|
||
armasController.getLrecord().addAll(armaSeleccionadaList);
|
||
}
|
||
|
||
//ordenamos la lista
|
||
Collections.sort(armasController.getLrecord(), new Comparator<TarmArmas>() {
|
||
public int compare(TarmArmas p1, TarmArmas p2) {
|
||
return String.valueOf(p1.getModifiedData().get("ordenarma")).compareTo(String.valueOf(p2.getModifiedData().get("ordenarma")));
|
||
}
|
||
});
|
||
|
||
} catch (Exception e) {
|
||
|
||
e.printStackTrace();
|
||
}
|
||
}
|
||
|
||
/* Abre el LOV de la clase del arma
|
||
*/
|
||
public void noFiltrarCodigosEstados() {
|
||
Map<String, Object> mfileldsArm = new HashMap<String, Object>();
|
||
//No filtra los codigos de armas ya consultados
|
||
String sqlFiltroCodigoArma = "";
|
||
if(armaSeleccionadaList != null && !armaSeleccionadaList.isEmpty()){
|
||
StringBuffer sqlCodigos = new StringBuffer();
|
||
for(TarmArmas tarmArmas : armaSeleccionadaList){
|
||
if(!sqlCodigos.toString().isEmpty()){
|
||
sqlCodigos.append(" , ");
|
||
}
|
||
sqlCodigos.append("'" + tarmArmas.getPk()+"'");
|
||
}
|
||
sqlFiltroCodigoArma = (!sqlCodigos.toString().trim().isEmpty())?" t.pk not in( " + sqlCodigos.toString() + ") ":"";
|
||
|
||
}
|
||
|
||
mfileldsArm.put("codigosarmasdec", sqlFiltroCodigoArma);
|
||
|
||
mfileldsArm.put("estadosarmasdec", " t.estado not in('DEST','CANC','SUSP','DEC','INC','ENTR','ABA','RECL') ");
|
||
|
||
armasLovController.setMfilelds(mfileldsArm);
|
||
}
|
||
|
||
|
||
|
||
public void validacionFuncionario(){
|
||
if(decomisoController.getRecord().getCedulafuncionario()!=null){
|
||
TcustPersonDetail personDetail= buscarPersonaSnap(decomisoController.getRecord().getCedulafuncionario(), "CED");
|
||
decomisoController.getRecord().setFuncionario(null);
|
||
if(personDetail!=null && personDetail.getName()!=null){
|
||
decomisoController.getRecord().setFuncionario(personDetail.getName());
|
||
}else{
|
||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_nodocumentoinvalido"));
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Recorta el nombre del archivo a cargarse
|
||
* @param nombre
|
||
* @return nombre recortado
|
||
*/
|
||
public String recorteNombre(String nombre){
|
||
String fielname=nombre;
|
||
if(fielname.length()>30){
|
||
fielname=fielname.substring(0,30)+extencionArchivo(nombre);
|
||
}
|
||
return fielname;
|
||
}
|
||
|
||
/**
|
||
* Obtiene la extencion del archivo a cargar
|
||
* @param nombre
|
||
* @return
|
||
*/
|
||
private String extencionArchivo(String nombre){
|
||
int pos=nombre.lastIndexOf('.');
|
||
nombre=nombre.substring(pos);
|
||
return nombre;
|
||
}
|
||
/**
|
||
* Metodo que retorna la extencion del comprobante de deposito que se desea subir al alfresco
|
||
*/
|
||
public String getExtension(String filename) {
|
||
int index = filename.lastIndexOf('.');
|
||
if (index == -1) {
|
||
return "";
|
||
} else {
|
||
return filename.substring(index + 1);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Retorna la ruta base donde se almacenara dicho archivo
|
||
*
|
||
* @return
|
||
*/
|
||
public String getRutaDocumentoSolBase() {
|
||
Calendar calendar = Calendar.getInstance();
|
||
calendar.setTime(decomisoController.getRecord().getFechadecomiso());
|
||
StringBuilder ruta = new StringBuilder("cm:Decomiso");
|
||
ruta = ruta.append("/cm:A-").append(calendar.get(Calendar.YEAR));
|
||
ruta = ruta.append("/cm:M-").append((calendar.get(Calendar.MONTH)+1) <= 9 ? "0" + (calendar.get(Calendar.MONTH) + 1) : (calendar.get(Calendar.MONTH)+1));
|
||
return ruta.toString();
|
||
}
|
||
|
||
/**
|
||
* Carga el archivo a grabar en la memoria para su posterior persistencia en el Alfresco
|
||
*/
|
||
public void handleUpload(FileUploadEvent event){
|
||
uploadedFile = event.getFile();
|
||
btnfileUpload = Boolean.TRUE;
|
||
FacesContext context = FacesContext.getCurrentInstance();
|
||
context.addMessage(null, new FacesMessage("RECUERDE", MsgControlArmas.getProperty("msg_recuerdeClickBtnRegMaterial")));
|
||
|
||
}
|
||
|
||
/**
|
||
* Metodo que permite setear los datos de coordenadas relacionados a la entidad TarmDecomiso, una vez seleccionado un punto en el Map desde pantalla
|
||
*/
|
||
public void evento(){
|
||
getDecomisoController().getRecord().setLatitud(new BigDecimal(getLatitud()));
|
||
getDecomisoController().getRecord().setLongitud(new BigDecimal(getLongitud()));
|
||
String longitudString = getDecomisoController().getRecord().getLongitud().toString();
|
||
if(longitudString.contains("-")){
|
||
longitudString = longitudString.replace("-", "");
|
||
setLongitudGMS("oeste");
|
||
}else{
|
||
setLongitudGMS("este");
|
||
}
|
||
String[] longitud = transformarGrados(longitudString);
|
||
|
||
|
||
|
||
String latitudString = getDecomisoController().getRecord().getLatitud().toString();
|
||
if(latitudString.contains("-")){
|
||
latitudString = latitudString.replace("-", "");
|
||
setLatitudGMS("sur");
|
||
}else{
|
||
setLatitudGMS("norte");
|
||
}
|
||
String[] latitud = transformarGrados(latitudString);
|
||
setLatitudG(latitud[0]);
|
||
setLatitudM(latitud[1]);
|
||
setLatitudS(latitud[2]);
|
||
setLonguitudG(longitud[0]);
|
||
setLonguitudM(longitud[1]);
|
||
setLonguitudS(longitud[2]);
|
||
}
|
||
|
||
/**
|
||
* Inicializa los campos al cambiar el tipo de Ubicacion desde la pagina
|
||
*/
|
||
public void changeUbicacion(){
|
||
getDecomisoController().getRecord().setLatitud(null);
|
||
getDecomisoController().getRecord().setLongitud(null);
|
||
setLatitudG("");
|
||
setLatitudM("");
|
||
setLatitudS("");
|
||
setLonguitudG("");
|
||
setLonguitudM("");
|
||
setLonguitudS("");
|
||
setLatitud("");
|
||
setLongitud("");
|
||
setLongitudGMS(null);
|
||
setLatitudGMS(null);
|
||
}
|
||
|
||
/**
|
||
* Permite inicializar los campos de longitud y lalitud y cargar a los datos de coordenadas relacionados a la entidad TarmDecomiso
|
||
*/
|
||
public void openMapPorCoordenandas(){
|
||
setLatitud("");
|
||
setLongitud("");
|
||
if("coodernadas".equals(tipoMapa)){
|
||
getDecomisoController().getRecord().setLatitud(new BigDecimal(transformarCoordenadas(latitudG, latitudM, latitudS, "sur".equals(latitudGMS))));
|
||
getDecomisoController().getRecord().setLongitud(new BigDecimal(transformarCoordenadas(longuitudG, longuitudM, longuitudS, "oeste".equals(longitudGMS))));
|
||
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Metodo que permite transformar de Coordenadas Hexadecimales a Coordenadas en Grados, Minutos y Seguntos
|
||
* @param coordenada
|
||
* @return vector con las Coordenadas en Grados, Minutos y Seguntos
|
||
*/
|
||
public String[] transformarGrados(String coordenada){
|
||
int grados = new BigDecimal(coordenada).intValue();
|
||
BigDecimal minutos = new BigDecimal(coordenada).subtract(new BigDecimal(grados)).multiply(new BigDecimal(60));
|
||
int min = minutos.intValue();
|
||
BigDecimal segundos = minutos.subtract(new BigDecimal(min)).multiply(new BigDecimal(60)).setScale(4, BigDecimal.ROUND_FLOOR);
|
||
//System.out.println("latitude: " + grados + " " + min + " " + segundos);
|
||
return (grados + "," + min + "," + segundos).split(",");
|
||
}
|
||
|
||
/**
|
||
* Metodo que permite transformar de coordenadas en Grados, Minutos y Seguntos a Coordenadas Hexadecimales
|
||
* @param grados
|
||
* @param minutos
|
||
* @param segundos
|
||
* @return coordenadas Hexadecimales
|
||
*/
|
||
public String transformarCoordenadas(String grados, String minutos, String segundos, boolean negativo){
|
||
BigDecimal resultado = new BigDecimal(grados).add(new BigDecimal(minutos).divide(new BigDecimal(60), 12, BigDecimal.ROUND_FLOOR)).add(new BigDecimal(segundos).divide(new BigDecimal(3600), 12, BigDecimal.ROUND_FLOOR));
|
||
resultado = resultado.setScale(12, BigDecimal.ROUND_FLOOR);
|
||
if(negativo){
|
||
resultado = resultado.multiply(new BigDecimal(-1));
|
||
}
|
||
return resultado.toString();
|
||
}
|
||
|
||
|
||
/**
|
||
* Muestra un mensaje de error siempre y cuando sea un error de componente y se lo muestra como general
|
||
* @return
|
||
*/
|
||
public Boolean getExisteMensajesError() {
|
||
Boolean resp = Boolean.FALSE;
|
||
FacesContext facesContext = FacesContext.getCurrentInstance();
|
||
final Iterator<String> idComponentesMensajes = facesContext.getClientIdsWithMessages();
|
||
while(idComponentesMensajes.hasNext()){
|
||
String idComp = idComponentesMensajes.next();
|
||
if(StringUtils.isNotBlank(idComp)){
|
||
System.out.println("El id es "+idComp.replace(":", "\\\\:"));
|
||
System.out.println("$('#"+idComp.replace(":", "\\\\:")+"').focus();");
|
||
facesContext.validationFailed();
|
||
resp = Boolean.TRUE;
|
||
RequestContext.getCurrentInstance().execute("$('#"+idComp.replace(":", "\\\\:")+"').focus();");
|
||
break;
|
||
}
|
||
}
|
||
return resp;
|
||
}
|
||
|
||
public DecomisoController getDecomisoController() {
|
||
return decomisoController;
|
||
}
|
||
|
||
|
||
public void setDecomisoController(DecomisoController decomisoController) {
|
||
this.decomisoController = decomisoController;
|
||
}
|
||
|
||
public List<TgeneProvince> getLprovinces() {
|
||
return lprovinces;
|
||
}
|
||
|
||
public void setLprovinces(List<TgeneProvince> lprovinces) {
|
||
this.lprovinces = lprovinces;
|
||
}
|
||
|
||
public List<TgeneCanton> getLcantones() {
|
||
return lcantones;
|
||
}
|
||
|
||
public void setLcantones(List<TgeneCanton> lcantones) {
|
||
this.lcantones = lcantones;
|
||
}
|
||
|
||
public List<TgeneParroquia> getLparroquias() {
|
||
return lparroquias;
|
||
}
|
||
|
||
public void setLparroquias(List<TgeneParroquia> lparroquias) {
|
||
this.lparroquias = lparroquias;
|
||
}
|
||
|
||
public List<TgeneCity> getLcities() {
|
||
return lcities;
|
||
}
|
||
|
||
public void setLcities(List<TgeneCity> lcities) {
|
||
this.lcities = lcities;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getTipoProceso() {
|
||
return tipoProceso;
|
||
}
|
||
|
||
public void setTipoProceso(List<TgeneCatalogDetail> tipoProceso) {
|
||
this.tipoProceso = tipoProceso;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getTipoDocumeno() {
|
||
return tipoDocumeno;
|
||
}
|
||
|
||
public void setTipoDocumeno(List<TgeneCatalogDetail> tipoDocumeno) {
|
||
this.tipoDocumeno = tipoDocumeno;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getGrados() {
|
||
return grados;
|
||
}
|
||
|
||
public void setGrados(List<TgeneCatalogDetail> grados) {
|
||
this.grados = grados;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getUnidades() {
|
||
return unidades;
|
||
}
|
||
|
||
public void setUnidades(List<TgeneCatalogDetail> unidades) {
|
||
this.unidades = unidades;
|
||
}
|
||
|
||
public ArmasController getArmasController() {
|
||
return armasController;
|
||
}
|
||
|
||
public void setArmasController(ArmasController armasController) {
|
||
this.armasController = armasController;
|
||
}
|
||
|
||
public TsafeUserDetail getTsafeUserDetail() {
|
||
return tsafeUserDetail;
|
||
}
|
||
|
||
public void setTsafeUserDetail(TsafeUserDetail tsafeUserDetail) {
|
||
this.tsafeUserDetail = tsafeUserDetail;
|
||
}
|
||
|
||
public TcustPersonDetail getTcustPersonDetailPortador() {
|
||
return tcustPersonDetailPortador;
|
||
}
|
||
|
||
public void setTcustPersonDetailPortador(
|
||
TcustPersonDetail tcustPersonDetailPortador) {
|
||
this.tcustPersonDetailPortador = tcustPersonDetailPortador;
|
||
}
|
||
|
||
public boolean isSinPortador() {
|
||
return sinPortador;
|
||
}
|
||
|
||
public void setSinPortador(boolean sinPortador) {
|
||
this.sinPortador = sinPortador;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getMotivoDecomisoList() {
|
||
return motivoDecomisoList;
|
||
}
|
||
|
||
public void setMotivoDecomisoList(List<TgeneCatalogDetail> motivoDecomisoList) {
|
||
this.motivoDecomisoList = motivoDecomisoList;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getLmarca() {
|
||
return lmarca;
|
||
}
|
||
|
||
public void setLmarca(List<TgeneCatalogDetail> lmarca) {
|
||
this.lmarca = lmarca;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getLcolor() {
|
||
return lcolor;
|
||
}
|
||
|
||
public void setLcolor(List<TgeneCatalogDetail> lcolor) {
|
||
this.lcolor = lcolor;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getLtipofabricacion() {
|
||
return ltipofabricacion;
|
||
}
|
||
|
||
public void setLtipofabricacion(List<TgeneCatalogDetail> ltipofabricacion) {
|
||
this.ltipofabricacion = ltipofabricacion;
|
||
}
|
||
|
||
public List<TgeneCountry> getLcountry() {
|
||
return lcountry;
|
||
}
|
||
|
||
public void setLcountry(List<TgeneCountry> lcountry) {
|
||
this.lcountry = lcountry;
|
||
}
|
||
|
||
public String getCodigoArma() {
|
||
return codigoArma;
|
||
}
|
||
|
||
public void setCodigoArma(String codigoArma) {
|
||
this.codigoArma = codigoArma;
|
||
}
|
||
|
||
public String getIdentificacionPro() {
|
||
return identificacionPro;
|
||
}
|
||
|
||
public void setIdentificacionPro(String identificacionPro) {
|
||
this.identificacionPro = identificacionPro;
|
||
}
|
||
|
||
public String getTipoIdentificacionPro() {
|
||
return tipoIdentificacionPro;
|
||
}
|
||
|
||
public void setTipoIdentificacionPro(String tipoIdentificacionPro) {
|
||
this.tipoIdentificacionPro = tipoIdentificacionPro;
|
||
}
|
||
|
||
public boolean isSinIdentificacion() {
|
||
return sinIdentificacion;
|
||
}
|
||
|
||
public void setSinIdentificacion(boolean sinIdentificacion) {
|
||
this.sinIdentificacion = sinIdentificacion;
|
||
}
|
||
|
||
public PersonDetailController getPersonDetailController() {
|
||
return personDetailController;
|
||
}
|
||
|
||
public void setPersonDetailController(
|
||
PersonDetailController personDetailController) {
|
||
this.personDetailController = personDetailController;
|
||
}
|
||
|
||
public String getUnidadpeso() {
|
||
return unidadpeso;
|
||
}
|
||
|
||
public void setUnidadpeso(String unidadpeso) {
|
||
this.unidadpeso = unidadpeso;
|
||
}
|
||
|
||
public TarmTipoArmaExplosivo getTipoArmaExplosivo() {
|
||
return tipoArmaExplosivo;
|
||
}
|
||
|
||
public void setTipoArmaExplosivo(TarmTipoArmaExplosivo tipoArmaExplosivo) {
|
||
this.tipoArmaExplosivo = tipoArmaExplosivo;
|
||
}
|
||
|
||
public String getDescripcionUnidadpeso() {
|
||
return descripcionUnidadpeso;
|
||
}
|
||
|
||
public void setDescripcionUnidadpeso(String descripcionUnidadpeso) {
|
||
this.descripcionUnidadpeso = descripcionUnidadpeso;
|
||
}
|
||
|
||
public String getCodigoUnidadpeso() {
|
||
return codigoUnidadpeso;
|
||
}
|
||
|
||
public void setCodigoUnidadpeso(String codigoUnidadpeso) {
|
||
this.codigoUnidadpeso = codigoUnidadpeso;
|
||
}
|
||
|
||
public RegistroArmController getRegistroArmController() {
|
||
return registroArmController;
|
||
}
|
||
|
||
public void setRegistroArmController(RegistroArmController registroArmController) {
|
||
this.registroArmController = registroArmController;
|
||
}
|
||
|
||
public String getCodigoPasaporte() {
|
||
return codigoPasaporte;
|
||
}
|
||
|
||
public void setCodigoPasaporte(String codigoPasaporte) {
|
||
this.codigoPasaporte = codigoPasaporte;
|
||
}
|
||
|
||
public DecomisoArmaController getDecomisoArmaController() {
|
||
return decomisoArmaController;
|
||
}
|
||
|
||
public void setDecomisoArmaController(
|
||
DecomisoArmaController decomisoArmaController) {
|
||
this.decomisoArmaController = decomisoArmaController;
|
||
}
|
||
|
||
public PersonPhoneController getPersonPhoneController() {
|
||
return personPhoneController;
|
||
}
|
||
|
||
public void setPersonPhoneController(PersonPhoneController personPhoneController) {
|
||
this.personPhoneController = personPhoneController;
|
||
}
|
||
|
||
public ReportController getReportController() {
|
||
return reportController;
|
||
}
|
||
|
||
public void setReportController(ReportController reportController) {
|
||
this.reportController = reportController;
|
||
}
|
||
|
||
public Boolean getBtn() {
|
||
return btn;
|
||
}
|
||
|
||
public void setBtn(Boolean btn) {
|
||
this.btn = btn;
|
||
}
|
||
|
||
public String getCodigoPaisOrigen() {
|
||
return codigoPaisOrigen;
|
||
}
|
||
|
||
public void setCodigoPaisOrigen(String codigoPaisOrigen) {
|
||
this.codigoPaisOrigen = codigoPaisOrigen;
|
||
}
|
||
|
||
public List<TarmArmas> getArmaSeleccionadaList() {
|
||
return armaSeleccionadaList;
|
||
}
|
||
|
||
public void setArmaSeleccionadaList(List<TarmArmas> armaSeleccionadaList) {
|
||
this.armaSeleccionadaList = armaSeleccionadaList;
|
||
}
|
||
|
||
public String getCdecomiso() {
|
||
return cdecomiso;
|
||
}
|
||
|
||
public void setCdecomiso(String cdecomiso) {
|
||
this.cdecomiso = cdecomiso;
|
||
}
|
||
|
||
public Boolean getBtnPeso() {
|
||
return btnPeso;
|
||
}
|
||
|
||
public void setBtnPeso(Boolean btnPeso) {
|
||
this.btnPeso = btnPeso;
|
||
}
|
||
|
||
public Boolean getBtnCantidad() {
|
||
return btnCantidad;
|
||
}
|
||
|
||
public void setBtnCantidad(Boolean btnCantidad) {
|
||
this.btnCantidad = btnCantidad;
|
||
}
|
||
|
||
public List<TgeneCatalogDetail> getCentroControls() {
|
||
return centroControls;
|
||
}
|
||
|
||
public void setCentroControls(List<TgeneCatalogDetail> centroControls) {
|
||
this.centroControls = centroControls;
|
||
}
|
||
|
||
public String getCentroControl() {
|
||
return centroControl;
|
||
}
|
||
|
||
public void setCentroControl(String centroControl) {
|
||
this.centroControl = centroControl;
|
||
}
|
||
|
||
public String getLatitud() {
|
||
return latitud;
|
||
}
|
||
|
||
public void setLatitud(String latitud) {
|
||
this.latitud = latitud;
|
||
}
|
||
|
||
public String getLongitud() {
|
||
return longitud;
|
||
}
|
||
|
||
public void setLongitud(String longitud) {
|
||
this.longitud = longitud;
|
||
}
|
||
|
||
public String getDireccionGoogleMap() {
|
||
return direccionGoogleMap;
|
||
}
|
||
|
||
public void setDireccionGoogleMap(String direccionGoogleMap) {
|
||
this.direccionGoogleMap = direccionGoogleMap;
|
||
}
|
||
|
||
public String getTipoMapa() {
|
||
return tipoMapa;
|
||
}
|
||
|
||
public void setTipoMapa(String tipoMapa) {
|
||
this.tipoMapa = tipoMapa;
|
||
}
|
||
|
||
public String getLatitudG() {
|
||
return latitudG;
|
||
}
|
||
|
||
public void setLatitudG(String latitudG) {
|
||
this.latitudG = latitudG;
|
||
}
|
||
|
||
public String getLatitudM() {
|
||
return latitudM;
|
||
}
|
||
|
||
public void setLatitudM(String latitudM) {
|
||
this.latitudM = latitudM;
|
||
}
|
||
|
||
public String getLatitudS() {
|
||
return latitudS;
|
||
}
|
||
|
||
public void setLatitudS(String latitudS) {
|
||
this.latitudS = latitudS;
|
||
}
|
||
|
||
public String getLonguitudG() {
|
||
return longuitudG;
|
||
}
|
||
|
||
public void setLonguitudG(String longuitudG) {
|
||
this.longuitudG = longuitudG;
|
||
}
|
||
|
||
public String getLonguitudM() {
|
||
return longuitudM;
|
||
}
|
||
|
||
public void setLonguitudM(String longuitudM) {
|
||
this.longuitudM = longuitudM;
|
||
}
|
||
|
||
public String getLonguitudS() {
|
||
return longuitudS;
|
||
}
|
||
|
||
public void setLonguitudS(String longuitudS) {
|
||
this.longuitudS = longuitudS;
|
||
}
|
||
|
||
/**
|
||
* @return the latitudGMS
|
||
*/
|
||
public String getLatitudGMS() {
|
||
return latitudGMS;
|
||
}
|
||
|
||
/**
|
||
* @param latitudGMS the latitudGMS to set
|
||
*/
|
||
public void setLatitudGMS(String latitudGMS) {
|
||
this.latitudGMS = latitudGMS;
|
||
}
|
||
|
||
/**
|
||
* @return the longitudGMS
|
||
*/
|
||
public String getLongitudGMS() {
|
||
return longitudGMS;
|
||
}
|
||
|
||
/**
|
||
* @param longitudGMS the longitudGMS to set
|
||
*/
|
||
public void setLongitudGMS(String longitudGMS) {
|
||
this.longitudGMS = longitudGMS;
|
||
}
|
||
|
||
|
||
public boolean isSinDocumento() {
|
||
return sinDocumento;
|
||
}
|
||
|
||
public void setSinDocumento(boolean sinDocumento) {
|
||
this.sinDocumento = sinDocumento;
|
||
}
|
||
|
||
public AlfrescoController getAlfrescoController() {
|
||
return alfrescoController;
|
||
}
|
||
|
||
public void setAlfrescoController(AlfrescoController alfrescoController) {
|
||
this.alfrescoController = alfrescoController;
|
||
}
|
||
|
||
public UploadedFile getUploadedFile() {
|
||
return uploadedFile;
|
||
}
|
||
|
||
public void setUploadedFile(UploadedFile uploadedFile) {
|
||
this.uploadedFile = uploadedFile;
|
||
}
|
||
|
||
public String getIngresoPortador() {
|
||
return ingresoPortador;
|
||
}
|
||
|
||
public void setIngresoPortador(String ingresoPortador) {
|
||
this.ingresoPortador = ingresoPortador;
|
||
}
|
||
|
||
public String getNombrerazonsocialsindoc() {
|
||
return nombrerazonsocialsindoc;
|
||
}
|
||
|
||
public void setNombrerazonsocialsindoc(String nombrerazonsocialsindoc) {
|
||
this.nombrerazonsocialsindoc = nombrerazonsocialsindoc;
|
||
}
|
||
|
||
public boolean isHabilitaNoDecomiso() {
|
||
return habilitaNoDecomiso;
|
||
}
|
||
|
||
public void setHabilitaNoDecomiso(boolean habilitaNoDecomiso) {
|
||
this.habilitaNoDecomiso = habilitaNoDecomiso;
|
||
}
|
||
|
||
public Boolean getBtnfileUpload() {
|
||
return btnfileUpload;
|
||
}
|
||
|
||
public void setBtnfileUpload(Boolean btnfileUpload) {
|
||
this.btnfileUpload = btnfileUpload;
|
||
}
|
||
|
||
public boolean isDeshabilitarPantalla() {
|
||
return deshabilitarPantalla;
|
||
}
|
||
|
||
public void setDeshabilitarPantalla(boolean deshabilitarPantalla) {
|
||
this.deshabilitarPantalla = deshabilitarPantalla;
|
||
}
|
||
|
||
public boolean isDeshabilitarPantallaMaterial() {
|
||
return deshabilitarPantallaMaterial;
|
||
}
|
||
|
||
public void setDeshabilitarPantallaMaterial(boolean deshabilitarPantalla) {
|
||
this.deshabilitarPantallaMaterial = deshabilitarPantalla;
|
||
}
|
||
|
||
public Boolean getBtnSave() {
|
||
return btnSave;
|
||
}
|
||
|
||
public void setBtnSave(Boolean btnSave) {
|
||
this.btnSave = btnSave;
|
||
}
|
||
|
||
public Boolean getIsExecuteRegistro() {
|
||
return isExecuteRegistro;
|
||
}
|
||
|
||
public void setIsExecuteRegistro(Boolean isExecuteRegistro) {
|
||
this.isExecuteRegistro = isExecuteRegistro;
|
||
}
|
||
|
||
public String getUnidad() {
|
||
return unidad;
|
||
}
|
||
|
||
public void setUnidad(String unidad) {
|
||
this.unidad = unidad;
|
||
}
|
||
|
||
public Boolean getBtnRegistro() {
|
||
return btnRegistro;
|
||
}
|
||
|
||
public void setBtnRegistro(Boolean btnRegistro) {
|
||
this.btnRegistro = btnRegistro;
|
||
}
|
||
|
||
public String getFilename() {
|
||
return filename;
|
||
}
|
||
|
||
public void setFilename(String filename) {
|
||
this.filename = filename;
|
||
}
|
||
|
||
|
||
public byte[] getByteArray() {
|
||
return byteArray;
|
||
}
|
||
|
||
public void setByteArray(byte[] byteArray) {
|
||
this.byteArray = byteArray;
|
||
}
|
||
|
||
public boolean isSeleccionarMaterial() {
|
||
return seleccionarMaterial;
|
||
}
|
||
|
||
public void setSeleccionarMaterial(boolean seleccionarMaterial) {
|
||
this.seleccionarMaterial = seleccionarMaterial;
|
||
}
|
||
|
||
public ArmasLovController getArmasLovController() {
|
||
return armasLovController;
|
||
}
|
||
|
||
public void setArmasLovController(ArmasLovController armasLovController) {
|
||
this.armasLovController = armasLovController;
|
||
}
|
||
|
||
public String getNombrePortador() {
|
||
return nombrePortador;
|
||
}
|
||
|
||
public void setNombrePortador(String nombrePortador) {
|
||
this.nombrePortador = nombrePortador;
|
||
}
|
||
}
|