1329 lines
50 KiB
Plaintext
Executable File
1329 lines
50 KiB
Plaintext
Executable File
package com.fp.frontend.controller.armas.solicitud;
|
|
|
|
import java.io.InputStream;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Calendar;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.faces.bean.ManagedBean;
|
|
import javax.faces.bean.ManagedProperty;
|
|
import javax.faces.bean.ViewScoped;
|
|
import javax.faces.context.FacesContext;
|
|
|
|
import org.primefaces.context.RequestContext;
|
|
import org.primefaces.event.FileUploadEvent;
|
|
import org.primefaces.model.UploadedFile;
|
|
|
|
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.parametros.CentroControlArmasController;
|
|
import com.fp.frontend.controller.armas.parametros.TarmCentroControlJurController;
|
|
import com.fp.frontend.controller.armas.parametros.TiposArmasExplosivosController;
|
|
import com.fp.frontend.controller.pcustomer.PersonAddressController;
|
|
import com.fp.frontend.controller.pcustomer.PersonDetailController;
|
|
import com.fp.frontend.controller.pgeneral.gene.CatalogDetailController;
|
|
import com.fp.frontend.controller.pgeneral.gene.CountryController;
|
|
import com.fp.frontend.controller.pgeneral.gene.ParametersController;
|
|
import com.fp.frontend.helper.MessageHelper;
|
|
import com.fp.frontend.utility.MsgControlArmas;
|
|
import com.fp.persistence.parmas.fun.TarmRegistroArmas;
|
|
import com.fp.persistence.parmas.param.TarmCentroControl;
|
|
import com.fp.persistence.parmas.param.TarmCentroControlJur;
|
|
import com.fp.persistence.parmas.param.TarmTipoArmaExplosivo;
|
|
import com.fp.persistence.parmas.param.TarmTramite;
|
|
import com.fp.persistence.parmas.soli.TarmArmaPruebas;
|
|
import com.fp.persistence.parmas.soli.TarmArmas;
|
|
import com.fp.persistence.parmas.soli.TarmSolicitud;
|
|
import com.fp.persistence.parmas.soli.TarmSolicitudArmas;
|
|
import com.fp.persistence.parmas.soli.TarmSolicitudTramite;
|
|
import com.fp.persistence.pcustomer.gene.TcustPersonAddress;
|
|
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
|
|
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetail;
|
|
import com.fp.persistence.pgeneral.gene.TgeneCountry;
|
|
import com.fp.persistence.pgeneral.gene.TgeneParameters;
|
|
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
|
|
|
|
/**
|
|
*
|
|
* Controlador que administra la ficha tecnica de armas
|
|
* @author Carlos Guzman
|
|
*
|
|
*/
|
|
@ManagedBean
|
|
@ViewScoped
|
|
public class IngresoFichaTecnicaArmasController extends AbstractController<TarmArmaPruebas> {
|
|
|
|
/**
|
|
*
|
|
*/
|
|
private static final long serialVersionUID = 8843091476010012919L;
|
|
|
|
/**
|
|
* Controlador que maneja alfresco
|
|
*/
|
|
@ManagedProperty(value = "#{alfrescoController}")
|
|
private AlfrescoController alfrescoController;
|
|
|
|
/**
|
|
* Controlador que maneja reportes
|
|
*/
|
|
@ManagedProperty(value = "#{reportController}")
|
|
private ReportController reportController;
|
|
|
|
/**
|
|
* Controlador que maneja armas
|
|
*/
|
|
@ManagedProperty(value = "#{armasController}")
|
|
private ArmasController armas;
|
|
|
|
private TarmArmas arma = new TarmArmas();
|
|
|
|
private String editarReg;
|
|
|
|
private String codigoSolicitud;
|
|
|
|
private boolean habilitaButtom;
|
|
|
|
private TarmCentroControl centroControl = new TarmCentroControl();
|
|
|
|
private List<TarmArmaPruebas> listadoArmasPruebas = new ArrayList<>();
|
|
|
|
private String observacion;
|
|
|
|
private String estado;
|
|
|
|
private Date fec_actual;
|
|
|
|
private String formato;
|
|
|
|
private String xpathflujo;
|
|
|
|
private TcustPersonDetail responsableCentroControl= null;
|
|
|
|
private TsafeUserDetail tsafeUserDetailUsuario = null;
|
|
|
|
private Boolean btnFlujo;
|
|
|
|
private List<TarmArmaPruebas> tarmArmaPruebasList;
|
|
/**
|
|
* lista del catalogo de las acciones (Aceptar o rechazar)
|
|
*/
|
|
private List<TgeneCatalogDetail> laccion;
|
|
|
|
private boolean deshabilitadoGenerarReporte=true;
|
|
|
|
private TarmSolicitud solicitud;
|
|
private TarmSolicitudTramite solicitudTramite;
|
|
private TarmTramite tramite;
|
|
private TcustPersonAddress direccionCliente;
|
|
private String provincia;
|
|
private String canton;
|
|
private String ciudad;
|
|
private String direccion;
|
|
private TgeneCatalogDetail estadotramite;
|
|
private TgeneCatalogDetail usoActividad;
|
|
private TcustPersonDetail personaDetalle;
|
|
private TgeneCatalogDetail identificacion;
|
|
private TgeneCatalogDetail detallecatalogoTipoTramite;
|
|
private TgeneCatalogDetail detallecatalogo;
|
|
/***
|
|
* Bandera para saber el tramite seleccionano, NOLETAL,COLECCION,..
|
|
* @throws Exception
|
|
*/
|
|
private String tramiteingresado;
|
|
|
|
public IngresoFichaTecnicaArmasController() throws Exception {
|
|
super(TarmArmaPruebas.class);
|
|
}
|
|
|
|
@PostConstruct
|
|
private void postconstruct() {
|
|
System.out.println("postconstruct");
|
|
try {
|
|
startQuery();
|
|
this.init();
|
|
laccion=CatalogDetailController.find("ACCION");
|
|
if(codigoSolicitud!=null){
|
|
caragarArmas();
|
|
}
|
|
} catch (Exception e) {
|
|
MessageHelper.setMessageError(e);
|
|
|
|
}
|
|
}
|
|
|
|
public void startQuery() {
|
|
System.out.println("startQuery");
|
|
try {
|
|
this.pasteBpmScreenParameters();
|
|
codigoSolicitud=super.getMfilters().get("csolicitud");//"1012";//2656
|
|
super.getMfilters().clear();
|
|
} catch (Exception e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
private void init() {
|
|
System.out.println("init");
|
|
recperpage = 3000; // Cambiar al # reg a mirar.
|
|
lrecord = new ArrayList<>();
|
|
beanalias = "INGRESOFICHAARMAS";
|
|
try {
|
|
if(this.obtenerCentroControl()==null){
|
|
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_sin_centrocontrol"));
|
|
return;
|
|
}
|
|
|
|
solicitud=SolicitudController.findSolicitudxcodsolicitud(codigoSolicitud);
|
|
//VALIDA EL tramite seleccionado
|
|
this.validarTramite();
|
|
solicitudTramite=SolicitudTramiteController.findByCSolicitud(codigoSolicitud);
|
|
tramite=TarmTramiteController.find(solicitud.getCtramite()+"");
|
|
direccionCliente=PersonAddressController.find(String.valueOf(solicitud.getPersoncode())) ;
|
|
provincia = direccionCliente.modifiedData().get("provincia")==null?null: direccionCliente.modifiedData().get("provincia").toString(); //personAddressController.getLprovinces()==null || .getLprovinces().isEmpty()?null:personAddressController.getLprovinces().get(0);
|
|
canton = direccionCliente.modifiedData().get("canton")==null?null: direccionCliente.modifiedData().get("canton").toString();//personAddressController.getLcantones()==null || personAddressController.getLcantones().isEmpty()?null:personAddressController.getLcantones().get(0);
|
|
ciudad = direccionCliente.modifiedData().get("ciudad")==null?null: direccionCliente.modifiedData().get("ciudad").toString();//personAddressController.getLcities()==null || personAddressController.getLcities().isEmpty()?null:personAddressController.getLcities().get(0);
|
|
direccion= direccionCliente.getAddress();
|
|
estadotramite = (solicitudTramite.getEstadotramite()==null || solicitudTramite.getEstadotramitecodigo()==null)?null:CatalogDetailController.findxCodigoCodcatalogo(solicitudTramite.getEstadotramite(), solicitudTramite.getEstadotramitecodigo());
|
|
usoActividad = (tramite.getUsoactividad()==null || tramite.getUsoactividadcodigo()==null)?null:CatalogDetailController.findxCodigoCodcatalogo(tramite.getUsoactividad(), tramite.getUsoactividadcodigo());
|
|
personaDetalle = PersonDetailController.find(String.valueOf(solicitud.getPersoncode()));
|
|
identificacion = (personaDetalle.getIdentificationcatalog()==null || personaDetalle.getIdentificationcatalogcode()==null)?null:CatalogDetailController.findxCodigoCodcatalogo(personaDetalle.getIdentificationcatalog(), personaDetalle.getIdentificationcatalogcode());
|
|
detallecatalogoTipoTramite = (tramite.getTipoautorizacion()==null || tramite.getTipoautorizacioncodigo()==null)?null:CatalogDetailController.findxCodigoCodcatalogo(tramite.getTipoautorizacion(), tramite.getTipoautorizacioncodigo());
|
|
detallecatalogo = (tramite.getCategoria()==null || tramite.getCategoriacodigo()==null)?null:CatalogDetailController.findxCodigoCodcatalogo(tramite.getCategoria(), tramite.getCategoriacodigo());
|
|
|
|
record=new TarmArmaPruebas();
|
|
this.fec_actual = new Date();
|
|
this.habilitaButtom = true;
|
|
this.responsableCentroControl = new TcustPersonDetail();
|
|
this.responsableCentroControl = new TcustPersonDetail();
|
|
this.tsafeUserDetailUsuario = new TsafeUserDetail();
|
|
this.obtenerResponsableCentroControl();
|
|
btnFlujo=Boolean.FALSE;
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
private void validarTramite(){
|
|
tramiteingresado = "OTROS";
|
|
TgeneParameters parametrofichanoletal=ParametersController.find("CODIGO.FICHANOLETAL", "1");
|
|
if(parametrofichanoletal!=null && parametrofichanoletal.getTextvalue()!=null && !parametrofichanoletal.getTextvalue().trim().isEmpty()){
|
|
String [] arrayCodTramite=parametrofichanoletal.getTextvalue().split(",");
|
|
List<String>listaCodTraite=Arrays.asList(arrayCodTramite);
|
|
for (String item : listaCodTraite) {
|
|
Long codigotramite=Long.parseLong(item);
|
|
if(solicitud.getCtramite().equals(codigotramite) ||
|
|
codigotramite.longValue()==solicitud.getCtramite().longValue()){
|
|
tramiteingresado = "NOLETAL";
|
|
}
|
|
}
|
|
}
|
|
TgeneParameters parametrofichacoleccion=ParametersController.find("CODIGO.FICHACOLECCION", "1");
|
|
if(parametrofichacoleccion!=null && parametrofichacoleccion.getTextvalue()!=null && !parametrofichacoleccion.getTextvalue().trim().isEmpty()){
|
|
String [] arrayCodTramite=parametrofichacoleccion.getTextvalue().split(",");
|
|
List<String>listaCodTraite=Arrays.asList(arrayCodTramite);
|
|
for (String item : listaCodTraite) {
|
|
Long codigotramite=Long.parseLong(item);
|
|
if(solicitud.getCtramite().equals(codigotramite) ||
|
|
codigotramite.longValue()==solicitud.getCtramite().longValue()){
|
|
tramiteingresado = "COLECCION";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
public void create() throws Exception {
|
|
super.create();
|
|
}
|
|
|
|
@SuppressWarnings("unchecked")
|
|
private void querydatabaseArma(){
|
|
try {
|
|
Request request = this.callerhelper.getRequest();
|
|
DtoQuery dto = super.getDtoQuery(true);
|
|
dto.setOrderby("t.pk");
|
|
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
|
mtables.put(this.beanalias, dto); // permite adicionar mas de una tabla.
|
|
request.setQueryTables(mtables);
|
|
Response resp = this.callerhelper.executeQuery(request);
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
|
this.lrecord = new ArrayList<TarmArmaPruebas>();
|
|
MessageHelper.setMessageError(resp);
|
|
} else {
|
|
this.lrecord = (List<TarmArmaPruebas>) resp.get(this.beanalias);
|
|
super.postQuery(this.lrecord);
|
|
}
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@Override
|
|
protected void querydatabase() {
|
|
try {
|
|
Request request = this.callerhelper.getRequest();
|
|
DtoQuery dto = super.getDtoQuery(true);
|
|
dto.setOrderby("t.pk");
|
|
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
|
|
mtables.put(this.beanalias, dto); // permite adicionar mas de una tabla.
|
|
request.setQueryTables(mtables);
|
|
Response resp = this.callerhelper.executeQuery(request);
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
|
|
this.lrecord = new ArrayList<TarmArmaPruebas>();
|
|
MessageHelper.setMessageError(resp);
|
|
} else {
|
|
this.lrecord = (List<TarmArmaPruebas>) resp.get(this.beanalias);
|
|
super.postQuery(this.lrecord);
|
|
}
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
public void caragarArmas() {
|
|
try {
|
|
List<TarmSolicitudArmas> listaSolicitudArmas = RecepcionArmasController.findPorSolicitudTodas(codigoSolicitud);
|
|
tarmArmaPruebasList = new ArrayList<>();
|
|
for (TarmSolicitudArmas solicitudArmas : listaSolicitudArmas) {
|
|
TarmArmaPruebas armaPrueba = find(codigoSolicitud,solicitudArmas.getPk().getCarma());
|
|
if (armaPrueba != null) {
|
|
armaPrueba.getModifiedData().put("tarmArmarecordPruebas", armaPrueba);
|
|
//
|
|
TarmArmas tarmArma = ArmasController.find(solicitudArmas.getPk().getCarma(), null);
|
|
armaPrueba.modifiedData().put("arma",tarmArma!=null?tarmArma:new TarmArmas());
|
|
armaPrueba.modifiedData().put("impresion",Boolean.FALSE);
|
|
tarmArmaPruebasList.add(armaPrueba);
|
|
} else {
|
|
this.create();
|
|
record.getModifiedData().put("tarmArmaPruebas", armaPrueba);
|
|
this.record.setCarma(solicitudArmas.getPk().getCarma());
|
|
this.record.setCsolicitud(codigoSolicitud);
|
|
this.record.setPersoncode(solicitudArmas.getPk().getPersoncode());
|
|
this.record.isnew = true;
|
|
//
|
|
TarmArmas tarmArma = ArmasController.find(solicitudArmas.getPk().getCarma(), null);
|
|
record.modifiedData().put("arma",tarmArma!=null?tarmArma:new TarmArmas());
|
|
record.modifiedData().put("impresion",Boolean.FALSE);
|
|
tarmArmaPruebasList.add(record);
|
|
}
|
|
}
|
|
} catch (Throwable e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void save() {
|
|
try {
|
|
if(cargarArchivo()){
|
|
return;
|
|
}
|
|
// Validacion para cambio de estado de arma a estado aprobada
|
|
TarmArmas tarmArmaObj = ArmasController.find(record.getCarma(), null);
|
|
if(record.getApruebaevaluacion().equals("Y")){
|
|
String estadoarma="APTA";
|
|
System.out.println("solicitud.getCtramite() "+solicitud.getCtramite());
|
|
if(tramiteingresado!=null && !tramiteingresado.trim().isEmpty() && tramiteingresado.equals("COLECCION")){
|
|
estadoarma="COLE";
|
|
}
|
|
tarmArmaObj.setEstado(estadoarma);
|
|
if(armas.getMfilters().get("csolicitud")!=null){
|
|
armas.getMfilters().remove("csolicitud");
|
|
}
|
|
armas.update(tarmArmaObj);
|
|
armas.save();
|
|
}else if(record.getApruebaevaluacion().equals("N")){
|
|
tarmArmaObj.setEstado("NAPT");
|
|
armas.update(tarmArmaObj);
|
|
armas.save();
|
|
}
|
|
|
|
Request request = callerhelper.getRequest();
|
|
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
|
|
request.setSaveTables(msave);
|
|
|
|
DtoSave dtosave = super.getDtoSave();
|
|
dtosave.setReturnpk(true);
|
|
dtosave.setPosition(2);
|
|
msave.put(beanalias, dtosave);
|
|
request.setSaveTables(msave);
|
|
|
|
DtoSave dtoSaveArma = armas.getDtoSave();
|
|
dtoSaveArma.setIsForm(Boolean.TRUE);
|
|
dtoSaveArma.setReturnpk(Boolean.TRUE);
|
|
dtoSaveArma.setPosition(1);
|
|
msave.put(armas.getBeanalias(), dtoSaveArma);
|
|
|
|
Response resp = callerhelper.executeSave(request);
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
|
|
this.postCommit(resp);
|
|
MessageHelper.setMessageInfo(resp);
|
|
record.modifiedData().put("GUARDA", "S");
|
|
MessageHelper.setMessageInfo(resp);
|
|
} else {
|
|
record.modifiedData().put("GUARDA", "N");
|
|
MessageHelper.setMessageError(resp);
|
|
}
|
|
} catch (Throwable e) {
|
|
record.modifiedData().put("GUARDA", "N");
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
public void uploadImpronta(FileUploadEvent event) {
|
|
record.modifiedData().put("FileUploadImpronta", event.getFile());
|
|
}
|
|
|
|
public void uploadFoto(FileUploadEvent event) {
|
|
record.modifiedData().put("FileUploadFoto", event.getFile());
|
|
}
|
|
|
|
/**
|
|
* Metodo invocado al cerrar el dialogo del registro de la ficha tecnica de las armas
|
|
* @throws Exception
|
|
*/
|
|
public Boolean cargarArchivo() throws Exception {
|
|
Boolean msgArchivos=Boolean.FALSE;
|
|
//Impronta
|
|
UploadedFile uploadedFileImpronta=null;
|
|
if(record.modifiedData().get("FileUploadImpronta")!=null){
|
|
uploadedFileImpronta= (UploadedFile)record.modifiedData().get("FileUploadImpronta");
|
|
}else{
|
|
MessageHelper.setMessageError("INGRESE LA IMPRONTA");
|
|
msgArchivos=Boolean.TRUE;
|
|
}
|
|
//FOTO
|
|
UploadedFile uploadedFoto=null;
|
|
if(record.modifiedData().get("FileUploadFoto")!=null){
|
|
uploadedFoto= (UploadedFile)record.modifiedData().get("FileUploadFoto");
|
|
}else{
|
|
MessageHelper.setMessageError("INGRESE LA FOTO");
|
|
msgArchivos=Boolean.TRUE;
|
|
}
|
|
if(msgArchivos){
|
|
return msgArchivos;
|
|
}
|
|
String xPathLocation= getRutaDocumento();
|
|
String xphat1=uploadedFoto.getFileName();
|
|
if(xphat1.length()<9){
|
|
xphat1="DOCUMENTO-"+xphat1;
|
|
}
|
|
if(alfrescoController.uploadFile(uploadedFoto.getInputstream(),xphat1, xPathLocation+ "/cm:fotografia")){
|
|
record.setXpathfotografia(xPathLocation + "/cm:fotografia/cm:" + xphat1);
|
|
record.setImagenfotografia(uploadedFoto.getContents());
|
|
}else{
|
|
MessageHelper.setMessageError("ERROR AL CARGAR LA FOTO");
|
|
return Boolean.TRUE;
|
|
}
|
|
String xphat2=uploadedFileImpronta.getFileName();
|
|
if(xphat2.length()<9){
|
|
xphat2="DOCUMENTO-"+xphat2;
|
|
}
|
|
if(alfrescoController.uploadFile(uploadedFileImpronta.getInputstream(),xphat2, xPathLocation+ "/cm:impronta")){
|
|
record.setXpathimpronta(xPathLocation + "/cm:impronta/cm:" + xphat2);
|
|
this.record.setImagenimpronta(uploadedFileImpronta.getContents());
|
|
}else{
|
|
MessageHelper.setMessageError("ERROR AL CARGAR LA IMPRONTA");
|
|
return Boolean.TRUE;
|
|
}
|
|
record.modifiedData().remove("FileUploadImpronta");
|
|
record.modifiedData().remove("FileUploadFoto");
|
|
super.update();
|
|
this.habilitaButtom = false;
|
|
return msgArchivos;
|
|
}
|
|
|
|
|
|
public void verificarPuedeGenerarReporte(){
|
|
for(TarmArmaPruebas tarmArmaPruebas:this.tarmArmaPruebasList){
|
|
//IMPRIME record.modifiedData().get("IMPRIME").equals("S")
|
|
if(tarmArmaPruebas.getPk()==null ||tarmArmaPruebas.getImagenfotografia()==null||tarmArmaPruebas.getImagenimpronta()==null
|
|
||tarmArmaPruebas.getXpathfichatecarmas()==null
|
|
|| tarmArmaPruebas.getIsimpreso()==null || !tarmArmaPruebas.getIsimpreso().equalsIgnoreCase("Y")){
|
|
MessageHelper.setMessageError(MsgControlArmas.getProperty("lbl_impresionarma1") + tarmArmaPruebas.getCarma() + MsgControlArmas.getProperty("lbl_impresionarma2"));
|
|
deshabilitadoGenerarReporte = true;
|
|
return;
|
|
}
|
|
}
|
|
deshabilitadoGenerarReporte = false;
|
|
}
|
|
|
|
/**
|
|
* Metodo para finalizar la tarea del flujo
|
|
*/
|
|
public void completarTarea() {
|
|
|
|
try {
|
|
if(deshabilitadoGenerarReporte && !btnFlujo){
|
|
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_generereporte"));
|
|
return;
|
|
}
|
|
Request request = callerhelper.getRequest();
|
|
// limpiar request para finalizar la tarea.
|
|
super.cleanRequest(request);
|
|
request.modifiedData().put("csolicitud", codigoSolicitud);
|
|
request.modifiedData().put("TID", tid);
|
|
request.modifiedData().put("BPMStatus", bpmDataStatus == null ? "A" : bpmDataStatus); // A,D,R
|
|
request.modifiedData().put("BPMObs", bpmDataComment == null ? "OK" : bpmDataComment);
|
|
Response resp = callerhelper.executeSave(request);
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
|
|
MessageHelper.setMessageInfo(resp);
|
|
btnFlujo=Boolean.FALSE;
|
|
RequestContext.getCurrentInstance().execute("Maia.refreshusertasks()");
|
|
} else {
|
|
MessageHelper.setMessageError(resp);
|
|
}
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
public String codigoAceptado() throws Exception {
|
|
TgeneParameters f = ParametersController.find("ACEPTADO", "1");
|
|
return f.getTextvalue();
|
|
}
|
|
|
|
@Override
|
|
public void postCommit(Response response) throws Exception {
|
|
super.postCommitGeneric(response, beanalias);
|
|
}
|
|
|
|
/**
|
|
* Metodo para armar la ruta del documento
|
|
* @return
|
|
*/
|
|
public String getRutaDocumento() {
|
|
Calendar calendar = Calendar.getInstance();
|
|
StringBuilder ruta = new StringBuilder("cm:Solicitudes");
|
|
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));
|
|
ruta = ruta.append("/cm:D-").append(
|
|
(calendar.get(Calendar.DAY_OF_MONTH)) <= 9 ? "0" + (calendar.get(Calendar.DAY_OF_MONTH)) : (calendar.get(Calendar.DAY_OF_MONTH)));
|
|
TarmSolicitud solicitud = SolicitudArmasController.find(codigoSolicitud);
|
|
ruta = ruta.append("/cm:").append(solicitud.getNumerosolicitud());
|
|
ruta = ruta.append("/cm:").append("armas");
|
|
return ruta.toString();
|
|
}
|
|
|
|
/**
|
|
* Metodo que indica si se debe habilitar el boton del pantalla ficha tecnica
|
|
*/
|
|
public void habilitarBoton() {
|
|
this.habilitaButtom = true;
|
|
}
|
|
|
|
|
|
/**
|
|
* Metodo que indica si se debe habilitar el boton del pantalla ficha tecnica
|
|
*/
|
|
public void cerrar() {
|
|
if(record.modifiedData().get("GUARDA")!=null && record.modifiedData().get("GUARDA").equals("S") &&
|
|
record.modifiedData().get("IMPRIME")!=null && record.modifiedData().get("IMPRIME").equals("S") ){
|
|
}else{
|
|
MessageHelper.setMessageError("GUARDE Y GENERE EL REPORTE");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* Ejecuta reporte de registro balistico
|
|
*
|
|
*/
|
|
public void reporteRegistroBalistico() {
|
|
try {
|
|
String gradoUsuario ="";
|
|
String path = "armas/reports/registroBalistico";
|
|
String filename=MsgControlArmas.getProperty("lbl_registroBalistico");
|
|
|
|
//Fija parametros del report.
|
|
HashMap<String, Object> parameters = new HashMap<>();
|
|
|
|
//Logos
|
|
parameters.put("pathLogoIzquierda", "repo:/maia/1/image/comandoconjunto");
|
|
parameters.put("pathLogoDerecha", "repo:/maia/1/image/selloarmas");
|
|
|
|
//Obteniendo la solicitud
|
|
TarmSolicitud solicitud=SolicitudController.findSolicitudxcodsolicitud(this.codigoSolicitud);
|
|
SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
|
|
|
|
//Codigo solicitud
|
|
parameters.put("csolicitud", this.codigoSolicitud);
|
|
|
|
//Fecha de solicitud
|
|
parameters.put("fechaSolicitud", sdf.format(solicitud.getFregistro()));
|
|
|
|
//Obteniendo los datos del tramite
|
|
TarmTramite tramite=TarmTramiteController.find(solicitud.getCtramite().toString());
|
|
TgeneCatalogDetail tipoTramite=CatalogDetailController.findxCodigoCodcatalogo(tramite.getTipotramite(), tramite.getTipotramitecodigo());
|
|
TgeneCatalogDetail categoria=CatalogDetailController.findxCodigoCodcatalogo(tramite.getCategoria(), tramite.getCategoriacodigo());
|
|
TarmSolicitudTramite solicitudTramite=SolicitudTramiteController.findByCSolicitud(this.codigoSolicitud);
|
|
TgeneCatalogDetail tipoAutorizacion=CatalogDetailController.findxCodigoCodcatalogo(tramite.getTipoautorizacion(), tramite.getTipoautorizacioncodigo());
|
|
TgeneCatalogDetail usoActividad=CatalogDetailController.findxCodigoCodcatalogo(tramite.getUsoactividad(), tramite.getUsoactividadcodigo());
|
|
|
|
//Tipo de tramite
|
|
if(tipoTramite!=null && tipoTramite.getDescription()!=null){
|
|
parameters.put("tipoTramite", tipoTramite.getDescription());
|
|
}else{
|
|
parameters.put("tipoTramite", " ");
|
|
}
|
|
|
|
//Categoria
|
|
if(categoria!=null && categoria.getDescription()!=null){
|
|
parameters.put("categoria", categoria.getDescription());
|
|
}else{
|
|
parameters.put("categoria", " ");
|
|
}
|
|
|
|
//No tramite
|
|
if(solicitudTramite!=null){
|
|
parameters.put("noTramite", solicitudTramite.getNumerotramite());
|
|
}else{
|
|
parameters.put("noTramite", " ");
|
|
}
|
|
|
|
//Tipo de autorizacion
|
|
if(tipoAutorizacion!=null && tipoAutorizacion.getDescription()!=null){
|
|
parameters.put("tipoAutorizacion", tipoAutorizacion.getDescription());
|
|
}else{
|
|
parameters.put("tipoAutorizacion", " ");
|
|
}
|
|
|
|
//Uso-actividad
|
|
if(usoActividad!=null && usoActividad.getDescription()!=null){
|
|
parameters.put("usoActividad", usoActividad.getDescription());
|
|
}else{
|
|
parameters.put("usoActividad", " ");
|
|
}
|
|
|
|
TgeneCatalogDetail grado = CatalogDetailController.findxCodigoCodcatalogo(this.responsableCentroControl.getMilitarygrade(), this.responsableCentroControl.getMilitarygradecode());
|
|
if(grado != null){
|
|
gradoUsuario = grado.getDescription()+" - "+this.responsableCentroControl.getName();
|
|
}else{
|
|
gradoUsuario = "Sin Grado - "+this.responsableCentroControl.getName();
|
|
}
|
|
TcustPersonDetail person = PersonDetailController.find(String.valueOf(solicitud.getPersoncode()));
|
|
//PersonDetailController.find(String.valueOf(solicitud.getPersoncode()));
|
|
//Fecha
|
|
parameters.put("fechaActual", sdf.format(this.fec_actual));
|
|
parameters.put("fecActualHora", new SimpleDateFormat("dd-MM-yyyy / hh:mm:ss").format(this.fec_actual));
|
|
parameters.put("personCode", person.getPk().getPersoncode());
|
|
parameters.put("centroControl", this.obtenerCentroControl());
|
|
parameters.put("gradoUsuario", gradoUsuario);
|
|
parameters.put("usuario", this.tsafeUserDetailUsuario.getNickname());
|
|
String format = this.formato;
|
|
try {
|
|
this.reportController.execute(path, parameters, format, filename, this.getLoginController());
|
|
btnFlujo=Boolean.TRUE;
|
|
|
|
} catch (Exception ex) {
|
|
MessageHelper.setMessageError(ex);
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
MessageHelper.setMessageError(ex);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Obtiene el centro de control segun usurio logeado.
|
|
* @throws Exception
|
|
*
|
|
*/
|
|
private String obtenerCentroControl() throws Exception {
|
|
this.tsafeUserDetailUsuario = (TsafeUserDetail) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
|
|
PersonAddressController personAddressController = new PersonAddressController();
|
|
TcustPersonAddress tcustPersonAddres=personAddressController.findPrincipal(tsafeUserDetailUsuario.getPk().getPersoncode().toString());
|
|
if(tcustPersonAddres == null){
|
|
return null;
|
|
}
|
|
TarmCentroControlJur centroControlJur= TarmCentroControlJurController.findxProvincia(tcustPersonAddres.getProvincecode());
|
|
centroControl= CentroControlArmasController.findPorCodigo(centroControlJur.getCcentrocontrol());
|
|
return CatalogDetailController.findxCodigoCodcatalogo( centroControl.getNombreinstitucion(), centroControl.getNombreinstitucioncodigo()).getDescription();
|
|
}
|
|
|
|
/**
|
|
* Obtiene el responsable del Centro de Control
|
|
*/
|
|
public void obtenerResponsableCentroControl(){
|
|
Integer responsable = this.centroControl.getPersoncode();
|
|
this.responsableCentroControl = PersonDetailController.find(responsable.toString());
|
|
|
|
}
|
|
|
|
|
|
public void saveImprimir() {
|
|
try {
|
|
if(!record.modifiedData().get("GUARDA").equals("S")){
|
|
MessageHelper.setMessageError("GUARDE LA FICHA PARA GENERAR EL REPORTE");
|
|
return;
|
|
}
|
|
reporteFichaArmas();
|
|
record.setIsimpreso("Y");
|
|
update();
|
|
Request request = callerhelper.getRequest();
|
|
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
|
|
request.setSaveTables(msave);
|
|
DtoSave dtosave = super.getDtoSave();
|
|
dtosave.setReturnpk(true);
|
|
msave.put(beanalias, dtosave);
|
|
request.setSaveTables(msave);
|
|
Response resp = callerhelper.executeSave(request);
|
|
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
|
|
this.postCommit(resp);
|
|
MessageHelper.setMessageInfo(resp);
|
|
record.modifiedData().put("IMPRIME", "S");
|
|
MessageHelper.setMessageInfo(resp);
|
|
} else {
|
|
record.modifiedData().put("IMPRIME", "N");
|
|
MessageHelper.setMessageError(resp);
|
|
}
|
|
} catch (Throwable e) {
|
|
record.modifiedData().put("IMPRIME", "N");
|
|
MessageHelper.setMessageError(e);
|
|
}
|
|
}
|
|
/**
|
|
* Obtiene el reporte de Ficha de Armas
|
|
* @throws Exception
|
|
*/
|
|
public void reporteFichaArmas() throws Exception {
|
|
String gradoUsuario ="";
|
|
String path = "armas/reports/fichaTecArmas";
|
|
if(tramiteingresado!=null && !tramiteingresado.trim().isEmpty() && tramiteingresado.equals("NOLETAL")){
|
|
path = "armas/reports/fichaTecArmasNoLetales";
|
|
}
|
|
if(tramiteingresado!=null && !tramiteingresado.trim().isEmpty() && tramiteingresado.equals("COLECCION")){
|
|
path = "armas/reports/fichaTecArmasColeccion";
|
|
}
|
|
|
|
String filename=MsgControlArmas.getProperty("lbl_fichaTecnicaArmas");
|
|
|
|
//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");
|
|
|
|
//Centro de control
|
|
parameters.put("centroControl", this.obtenerCentroControl());
|
|
|
|
//Fecha actual
|
|
SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
|
|
parameters.put("fechaActual", sdf.format(this.fec_actual));
|
|
//Fecha de solicitud
|
|
if(solicitud!=null && solicitud.getFregistro()!=null){
|
|
parameters.put("fechaSolicitud", sdf.format(solicitud.getFregistro()));
|
|
}else{
|
|
parameters.put("fechaSolicitud", " ");
|
|
}
|
|
//No tramite
|
|
if(solicitudTramite!=null && solicitudTramite.getNumerotramite()!=null){
|
|
parameters.put("noTramite", solicitudTramite.getNumerotramite());
|
|
}else{
|
|
parameters.put("noTramite", " ");
|
|
}
|
|
|
|
//Tipo de tramites
|
|
if(detallecatalogoTipoTramite!=null && detallecatalogoTipoTramite.getDescription()!=null){
|
|
parameters.put("tipoTramite", detallecatalogoTipoTramite.getDescription());
|
|
}else{
|
|
parameters.put("tipoTramite", " ");
|
|
}
|
|
//Estado tramite
|
|
if(estadotramite!=null && estadotramite.getDescription()!=null){
|
|
parameters.put("estadoTramite", estadotramite.getDescription());
|
|
}else{
|
|
parameters.put("estadoTramite", " ");
|
|
}
|
|
|
|
//Uso actividad
|
|
if(usoActividad!=null && usoActividad.getDescription()!=null){
|
|
parameters.put("usoActividad",usoActividad.getDescription());
|
|
}else{
|
|
parameters.put("usoActividad", " ");
|
|
}
|
|
//Tipo de documento
|
|
if(identificacion!=null){
|
|
parameters.put("tipoDocumento", identificacion.getDescription());
|
|
}else{
|
|
parameters.put("tipoDocumento", " ");
|
|
}
|
|
//No documento
|
|
if(personaDetalle!=null){
|
|
parameters.put("cedula", personaDetalle.getIdentification());
|
|
}else{
|
|
parameters.put("cedula", " ");
|
|
}
|
|
//Nombre razon social
|
|
if(personaDetalle!=null){
|
|
parameters.put("nombreRazon", personaDetalle.getName());
|
|
}else{
|
|
parameters.put("nombreRazon", " ");
|
|
}
|
|
//Provincia
|
|
if(provincia !=null){
|
|
parameters.put("provincia", provincia);
|
|
}else{
|
|
parameters.put("provincia", " ");
|
|
}
|
|
//Canton
|
|
if(canton!=null){
|
|
parameters.put("canton", canton);
|
|
}else{
|
|
parameters.put("canton", " ");
|
|
}
|
|
//Ciudad
|
|
if(ciudad!=null){
|
|
parameters.put("ciudad", ciudad);
|
|
}else{
|
|
parameters.put("ciudad", " ");
|
|
}
|
|
//Direccion
|
|
if(direccion!=null){
|
|
parameters.put("direccion",direccion);
|
|
}else{
|
|
parameters.put("direccion", " ");
|
|
}
|
|
//Codigo de arma
|
|
parameters.put("codigoArma", this.record.getCarma());
|
|
//Codigo de registro de TarmArmaPrueba
|
|
parameters.put("cArmaPrueba", record.getPk().toString());
|
|
TarmArmas arma=(TarmArmas)this.record.getModifiedData().get("arma");
|
|
TarmRegistroArmas regArma = RegistroArmController.findByCodigo(arma.getCregistro().toString());
|
|
TgeneCountry paisOrigen=CountryController.findcountry(regArma.getPaisorigen());
|
|
//Clase
|
|
if(arma.getModifiedData().get("clase")!=null){
|
|
parameters.put("clase", arma.getModifiedData().get("clase")==null?"":arma.getModifiedData().get("clase"));
|
|
}else{
|
|
parameters.put("clase", " ");
|
|
}
|
|
//Obtniendo el tipo arma explosivo
|
|
TarmTipoArmaExplosivo tae=arma==null?null:TiposArmasExplosivosController.findarma(arma.getCtipoarmaexplosivo());
|
|
//Tipo arma
|
|
TgeneCatalogDetail tipoArma=tae==null?null:CatalogDetailController.findxCodigoCodcatalogo(tae.getTipoarmaexplosivo(), "TIPOARMAEXPLOSIVO");
|
|
parameters.put("tipoArma", (tipoArma==null || tipoArma.getDescription().isEmpty())?"": tipoArma.getDescription());
|
|
//Serie
|
|
parameters.put("serie", (arma==null || arma.getLote()==null || arma.getLote().isEmpty())?"":arma.getLote());
|
|
//Pais fabricacion
|
|
parameters.put("paisFabricacion", (paisOrigen==null)?"":(paisOrigen.getDescription()));
|
|
//Calibre
|
|
parameters.put("calibre", (arma.getModifiedData().get("calibre")==null)?"":arma.getModifiedData().get("calibre"));
|
|
//Longitud
|
|
TgeneCatalogDetail longitud=(tae==null || tae.getLongitud()==null || tae.getLongitudcodigo()==null || tae.getLongitud().isEmpty() || tae.getLongitudcodigo().isEmpty())?null:CatalogDetailController.findxCodigoCodcatalogo(tae.getLongitud(),tae.getLongitudcodigo());
|
|
if(longitud!=null && longitud.getDescription()!=null){
|
|
parameters.put("longitud", longitud.getDescription());
|
|
}else{
|
|
parameters.put("longitud", " ");
|
|
}
|
|
//Marca
|
|
parameters.put("marca", arma.getModifiedData().get("marca"));
|
|
//Modelo
|
|
parameters.put("modelo", arma.getModelo());
|
|
//Color
|
|
parameters.put("color", arma.getModifiedData().get("color"));
|
|
//Observacion
|
|
parameters.put("observacion", this.record.getObservacion());
|
|
//Aptitud de disparo
|
|
String aptitudDisparo=" ";
|
|
if(this.record.getAptituddisparo().equalsIgnoreCase("Y")){
|
|
aptitudDisparo="BUENO";
|
|
}else{
|
|
aptitudDisparo="MALO";
|
|
}
|
|
parameters.put("aptitudDisparo", aptitudDisparo);
|
|
|
|
//Balas testigo
|
|
String balasTestigo=" ";
|
|
if(this.record.getBalastestigo()!=null && this.record.getBalastestigo().equalsIgnoreCase("Y")){
|
|
balasTestigo=MsgControlArmas.getProperty("lbl_si");
|
|
}else if(this.record.getBalastestigo()!=null){
|
|
balasTestigo="NO";
|
|
}
|
|
parameters.put("balasTestigo", balasTestigo);
|
|
|
|
//Vainas testigo
|
|
String vainasTestigo=" ";
|
|
if(this.record.getVainastestigo()!=null && this.record.getVainastestigo().equalsIgnoreCase("Y")){
|
|
vainasTestigo=MsgControlArmas.getProperty("lbl_si");
|
|
}else if(this.record.getVainastestigo()!=null){
|
|
vainasTestigo="NO";
|
|
}
|
|
parameters.put("vainasTestigo", vainasTestigo);
|
|
|
|
//tubocanion
|
|
String tubocanion=" ";
|
|
if(this.record.getTubocanion()!=null && this.record.getTubocanion().equalsIgnoreCase("Y")){
|
|
tubocanion=MsgControlArmas.getProperty("lbl_si");
|
|
parameters.put("balasTestigo", tubocanion);
|
|
}else if(this.record.getTubocanion()!=null){
|
|
tubocanion="NO";
|
|
parameters.put("balasTestigo", tubocanion);
|
|
}
|
|
|
|
|
|
//Estado final
|
|
String estadoFinal=" ";
|
|
if(this.record.getApruebaevaluacion().equalsIgnoreCase("Y")){
|
|
estadoFinal="APROBADA";
|
|
}else{
|
|
estadoFinal="REPROBADA";
|
|
}
|
|
parameters.put("estadoFinal", estadoFinal);
|
|
//Codigo de persona
|
|
parameters.put("personcode",record.getPersoncode());
|
|
//Codigo de arma
|
|
parameters.put("codArma", record.getCarma());
|
|
//codigo solicitud
|
|
parameters.put("csolicitud", this.codigoSolicitud);
|
|
//Grado del funcionario
|
|
TgeneCatalogDetail grado = CatalogDetailController.findxCodigoCodcatalogo(this.responsableCentroControl.getMilitarygrade(), this.responsableCentroControl.getMilitarygradecode());
|
|
if(grado != null){
|
|
gradoUsuario = grado.getDescription()+" - "+this.responsableCentroControl.getName();
|
|
}else{
|
|
gradoUsuario = "Sin Grado - "+this.responsableCentroControl.getName();
|
|
}
|
|
parameters.put("personcode",responsableCentroControl.getPk().getPersoncode());
|
|
parameters.put("gradoUsuario", gradoUsuario);
|
|
String format = "pdf";
|
|
|
|
this.xpathflujo = this.getRutaDocumento();
|
|
filename = filename + this.record.getPk().toString();
|
|
InputStream report=this.reportController.jaspertoInputstream(path, parameters, format, filename, this.getLoginController());
|
|
if(!this.alfrescoController.uploadFile(report, filename+".pdf", this.xpathflujo)){
|
|
throw new Exception("ERROR AL CARGAR EL REPORTE");
|
|
}
|
|
this.record.setXpathfichatecarmas(this.xpathflujo + "/cm:" + filename+".pdf");
|
|
this.record.getModifiedData().put("impresion",Boolean.TRUE);
|
|
}
|
|
|
|
/**
|
|
* Metodo para encontrar por codigo de solicitud
|
|
* @param codigoSolicitud
|
|
* @return registro de armaPrueba encontrado
|
|
*/
|
|
public List<TarmArmaPruebas> findPorSolicitud(String codigoSolicitud){
|
|
try {
|
|
IngresoFichaTecnicaArmasController cc = new IngresoFichaTecnicaArmasController();
|
|
cc.init();
|
|
cc.recperpage = 300;
|
|
cc.addFilter("csolicitud", codigoSolicitud);
|
|
cc.querydatabaseArma();
|
|
if (cc.lrecord != null) {
|
|
return cc.lrecord;
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Metodo para encontrar por codigo de solicitud
|
|
* @param codigoSolicitud
|
|
* @return registro de armaPrueba encontrado
|
|
*/
|
|
public static List<TarmArmaPruebas> buscarFichasPorSolicitud(String codigoSolicitud){
|
|
try {
|
|
IngresoFichaTecnicaArmasController cc = new IngresoFichaTecnicaArmasController();
|
|
cc.init();
|
|
cc.recperpage = 300;
|
|
cc.addFilter("csolicitud", codigoSolicitud);
|
|
cc.querydatabaseArma();
|
|
if (cc.lrecord != null) {
|
|
return cc.lrecord;
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public TarmArmaPruebas find(String codigoSolicitud, String carma){
|
|
try {
|
|
IngresoFichaTecnicaArmasController cc = new IngresoFichaTecnicaArmasController();
|
|
cc.init();
|
|
cc.recperpage = 300;
|
|
cc.addFilter("carma", carma);
|
|
cc.addFilter("csolicitud", codigoSolicitud);
|
|
cc.querydatabaseArma();
|
|
if (cc.lrecord != null && cc.lrecord.size()>0) {
|
|
return cc.lrecord.get(0);
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static TarmArmaPruebas findByPk(String pk){
|
|
try {
|
|
IngresoFichaTecnicaArmasController cc = new IngresoFichaTecnicaArmasController();
|
|
cc.init();
|
|
cc.recperpage = 10;
|
|
cc.addFilter("pk", pk);
|
|
cc.querydatabaseArma();
|
|
if (cc.lrecord != null && cc.lrecord.size()>0) {
|
|
return cc.lrecord.get(0);
|
|
}
|
|
return null;
|
|
} catch (Throwable e) {
|
|
MessageHelper.setMessageError(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public AlfrescoController getAlfrescoController() {
|
|
return alfrescoController;
|
|
}
|
|
|
|
public void setAlfrescoController(AlfrescoController alfrescoController) {
|
|
this.alfrescoController = alfrescoController;
|
|
}
|
|
|
|
|
|
public TarmArmas getArma() {
|
|
return arma;
|
|
}
|
|
|
|
public void setArma(TarmArmas arma) {
|
|
this.arma = arma;
|
|
}
|
|
|
|
public String getEditarReg() {
|
|
return editarReg;
|
|
}
|
|
|
|
public void setEditarReg(String editarReg) {
|
|
this.editarReg = editarReg;
|
|
}
|
|
|
|
public String getCodigoSolicitud() {
|
|
return codigoSolicitud;
|
|
}
|
|
|
|
public void setCodigoSolicitud(String codigoSolicitud) {
|
|
this.codigoSolicitud = codigoSolicitud;
|
|
}
|
|
|
|
public List<TarmArmaPruebas> getListadoArmasPruebas() {
|
|
return listadoArmasPruebas;
|
|
}
|
|
|
|
public void setListadoArmasPruebas(List<TarmArmaPruebas> listadoArmasPruebas) {
|
|
this.listadoArmasPruebas = listadoArmasPruebas;
|
|
}
|
|
|
|
|
|
/**
|
|
* metodo que registra el cambio de la seleccion del recuperador balisitico y segun esto aprueba la evaluacion
|
|
*/
|
|
public void cambia(TarmArmaPruebas armaPruebas){
|
|
record=null;
|
|
record=armaPruebas;
|
|
if("Y".equals(record.getAptituddisparo()) && "Y".equals(record.getVainastestigo()) && "Y".equals(record.getBalastestigo())){
|
|
record.setApruebaevaluacion("Y");
|
|
}
|
|
else{
|
|
record.setApruebaevaluacion("N");
|
|
}
|
|
habilitaButtom = true;
|
|
armaPruebas.modifiedData().put("GUARDA", "N");
|
|
armaPruebas.modifiedData().put("IMPRIME", "N");
|
|
record.modifiedData().put("GUARDA", "N");
|
|
record.modifiedData().put("IMPRIME", "N");
|
|
}
|
|
|
|
|
|
public String getObservacion() {
|
|
return observacion;
|
|
}
|
|
|
|
public void setObservacion(String observacion) {
|
|
this.observacion = observacion;
|
|
}
|
|
|
|
public String getEstado() {
|
|
return estado;
|
|
}
|
|
|
|
public void setEstado(String estado) {
|
|
this.estado = estado;
|
|
}
|
|
|
|
public List<TgeneCatalogDetail> getLaccion() {
|
|
return laccion;
|
|
}
|
|
|
|
public void setLaccion(List<TgeneCatalogDetail> laccion) {
|
|
this.laccion = laccion;
|
|
}
|
|
public ReportController getReportController() {
|
|
return reportController;
|
|
}
|
|
|
|
public void setReportController(ReportController reportController) {
|
|
this.reportController = reportController;
|
|
}
|
|
|
|
public boolean isHabilitaButtom() {
|
|
return habilitaButtom;
|
|
}
|
|
|
|
public void setHabilitaButtom(boolean habilitaButtom) {
|
|
this.habilitaButtom = habilitaButtom;
|
|
}
|
|
public String getFormato() {
|
|
return formato;
|
|
}
|
|
|
|
public void setFormato(String formato) {
|
|
this.formato = formato;
|
|
}
|
|
|
|
public Date getFec_actual() {
|
|
return fec_actual;
|
|
}
|
|
|
|
public void setFec_actual(Date fec_actual) {
|
|
this.fec_actual = fec_actual;
|
|
}
|
|
|
|
public Boolean getBtnFlujo() {
|
|
return btnFlujo;
|
|
}
|
|
|
|
public void setBtnFlujo(Boolean btnFlujo) {
|
|
this.btnFlujo = btnFlujo;
|
|
}
|
|
|
|
public boolean isDeshabilitadoGenerarReporte() {
|
|
return deshabilitadoGenerarReporte;
|
|
}
|
|
|
|
public void setDeshabilitadoGenerarReporte(boolean deshabilitadoGenerarReporte) {
|
|
this.deshabilitadoGenerarReporte = deshabilitadoGenerarReporte;
|
|
}
|
|
|
|
|
|
public void changeApruebaEvaluacion(){
|
|
if(tramiteingresado!=null && !tramiteingresado.trim().isEmpty() && tramiteingresado.equals("NOLETAL")){
|
|
if(this.record.getAptituddisparo()!=null && ("Y".equalsIgnoreCase(this.record.getAptituddisparo())) &&
|
|
(this.record.getTubocanion()!=null && "Y".equalsIgnoreCase(this.record.getTubocanion())) ){
|
|
this.record.setApruebaevaluacion("Y");
|
|
}
|
|
else{
|
|
this.record.setApruebaevaluacion("N");
|
|
}
|
|
}else if(tramiteingresado!=null && !tramiteingresado.trim().isEmpty() && tramiteingresado.equals("COLECCION")){
|
|
if(this.record.getAptituddisparo()!=null && ("Y".equalsIgnoreCase(this.record.getAptituddisparo()))){
|
|
this.record.setApruebaevaluacion("Y");
|
|
}
|
|
else{
|
|
this.record.setApruebaevaluacion("N");
|
|
}
|
|
}else{
|
|
if(this.record.getAptituddisparo()!=null && ("Y".equalsIgnoreCase(this.record.getAptituddisparo())) &&
|
|
(this.record.getBalastestigo()!=null && "Y".equalsIgnoreCase(this.record.getBalastestigo())) &&
|
|
(this.record.getVainastestigo()!=null && "Y".equalsIgnoreCase(this.record.getVainastestigo()))){
|
|
this.record.setApruebaevaluacion("Y");
|
|
}else{
|
|
this.record.setApruebaevaluacion("N");
|
|
}
|
|
}
|
|
}
|
|
|
|
public TarmCentroControl getCentroControl() {
|
|
return centroControl;
|
|
}
|
|
|
|
public void setCentroControl(TarmCentroControl centroControl) {
|
|
this.centroControl = centroControl;
|
|
}
|
|
|
|
public String getXpathflujo() {
|
|
return xpathflujo;
|
|
}
|
|
|
|
public void setXpathflujo(String xpathflujo) {
|
|
this.xpathflujo = xpathflujo;
|
|
}
|
|
|
|
public TcustPersonDetail getResponsableCentroControl() {
|
|
return responsableCentroControl;
|
|
}
|
|
|
|
public void setResponsableCentroControl(
|
|
TcustPersonDetail responsableCentroControl) {
|
|
this.responsableCentroControl = responsableCentroControl;
|
|
}
|
|
|
|
public TsafeUserDetail getTsafeUserDetailUsuario() {
|
|
return tsafeUserDetailUsuario;
|
|
}
|
|
|
|
public void setTsafeUserDetailUsuario(TsafeUserDetail tsafeUserDetailUsuario) {
|
|
this.tsafeUserDetailUsuario = tsafeUserDetailUsuario;
|
|
}
|
|
|
|
public TarmSolicitud getSolicitud() {
|
|
return solicitud;
|
|
}
|
|
|
|
public void setSolicitud(TarmSolicitud solicitud) {
|
|
this.solicitud = solicitud;
|
|
}
|
|
|
|
public TarmSolicitudTramite getSolicitudTramite() {
|
|
return solicitudTramite;
|
|
}
|
|
|
|
public void setSolicitudTramite(TarmSolicitudTramite solicitudTramite) {
|
|
this.solicitudTramite = solicitudTramite;
|
|
}
|
|
|
|
public TarmTramite getTramite() {
|
|
return tramite;
|
|
}
|
|
|
|
public void setTramite(TarmTramite tramite) {
|
|
this.tramite = tramite;
|
|
}
|
|
|
|
public TcustPersonAddress getDireccionCliente() {
|
|
return direccionCliente;
|
|
}
|
|
|
|
public void setDireccionCliente(TcustPersonAddress direccionCliente) {
|
|
this.direccionCliente = direccionCliente;
|
|
}
|
|
|
|
public String getProvincia() {
|
|
return provincia;
|
|
}
|
|
|
|
public void setProvincia(String provincia) {
|
|
this.provincia = provincia;
|
|
}
|
|
|
|
public String getCanton() {
|
|
return canton;
|
|
}
|
|
|
|
public void setCanton(String canton) {
|
|
this.canton = canton;
|
|
}
|
|
|
|
public String getCiudad() {
|
|
return ciudad;
|
|
}
|
|
|
|
public void setCiudad(String ciudad) {
|
|
this.ciudad = ciudad;
|
|
}
|
|
|
|
public String getDireccion() {
|
|
return direccion;
|
|
}
|
|
|
|
public void setDireccion(String direccion) {
|
|
this.direccion = direccion;
|
|
}
|
|
|
|
public TgeneCatalogDetail getEstadotramite() {
|
|
return estadotramite;
|
|
}
|
|
|
|
public void setEstadotramite(TgeneCatalogDetail estadotramite) {
|
|
this.estadotramite = estadotramite;
|
|
}
|
|
|
|
public TgeneCatalogDetail getUsoActividad() {
|
|
return usoActividad;
|
|
}
|
|
|
|
public void setUsoActividad(TgeneCatalogDetail usoActividad) {
|
|
this.usoActividad = usoActividad;
|
|
}
|
|
|
|
public TcustPersonDetail getPersonaDetalle() {
|
|
return personaDetalle;
|
|
}
|
|
|
|
public void setPersonaDetalle(TcustPersonDetail personaDetalle) {
|
|
this.personaDetalle = personaDetalle;
|
|
}
|
|
|
|
public TgeneCatalogDetail getIdentificacion() {
|
|
return identificacion;
|
|
}
|
|
|
|
public void setIdentificacion(TgeneCatalogDetail identificacion) {
|
|
this.identificacion = identificacion;
|
|
}
|
|
|
|
public TgeneCatalogDetail getDetallecatalogoTipoTramite() {
|
|
return detallecatalogoTipoTramite;
|
|
}
|
|
|
|
public void setDetallecatalogoTipoTramite(
|
|
TgeneCatalogDetail detallecatalogoTipoTramite) {
|
|
this.detallecatalogoTipoTramite = detallecatalogoTipoTramite;
|
|
}
|
|
|
|
public TgeneCatalogDetail getDetallecatalogo() {
|
|
return detallecatalogo;
|
|
}
|
|
|
|
public void setDetallecatalogo(TgeneCatalogDetail detallecatalogo) {
|
|
this.detallecatalogo = detallecatalogo;
|
|
}
|
|
|
|
public List<TarmArmaPruebas> getTarmArmaPruebasList() {
|
|
return tarmArmaPruebasList;
|
|
}
|
|
|
|
public void setTarmArmaPruebasList(List<TarmArmaPruebas> tarmArmaPruebasList) {
|
|
this.tarmArmaPruebasList = tarmArmaPruebasList;
|
|
}
|
|
|
|
public ArmasController getArmas() {
|
|
return armas;
|
|
}
|
|
|
|
public void setArmas(ArmasController armas) {
|
|
this.armas = armas;
|
|
}
|
|
|
|
public String getTramiteingresado() {
|
|
return tramiteingresado;
|
|
}
|
|
|
|
public void setTramiteingresado(String tramiteingresado) {
|
|
this.tramiteingresado = tramiteingresado;
|
|
}
|
|
|
|
|
|
|
|
}
|