captcha y alerta

This commit is contained in:
cruales 2022-08-02 17:10:57 -05:00
commit e92d54c8c5
8366 changed files with 1247624 additions and 0 deletions

11
.project Executable file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sources</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View File

@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding//reports-jsf/armas/reports/actaDevolucion.jrxml=UTF-8
encoding//reports-jsf/armas/reports/reporteCompaniasCControl.jasper=UTF-8

1
.svn/entries Executable file
View File

@ -0,0 +1 @@
12

1
.svn/format Executable file
View File

@ -0,0 +1 @@
12

View File

@ -0,0 +1,333 @@
package com.fp.frontend.controller.pgeneral.trans;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import org.primefaces.event.SelectEvent;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.dto.query.DtoQuery;
import com.fp.dto.query.SubQuery;
import com.fp.dto.save.DtoSave;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.pbpm.lov.TbpmRulesLovController;
import com.fp.frontend.controller.pgeneral.lov.MessageTemplatesLovController;
import com.fp.frontend.controller.pgeneral.lov.ProcessLovControler;
import com.fp.frontend.controller.pgeneral.lov.TransactionLovController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.pbpm.gene.TbpmRules;
import com.fp.persistence.pgeneral.message.TgeneMessageTemplates;
import com.fp.persistence.pgeneral.proc.TgeneProcess;
import com.fp.persistence.pgeneral.trans.TgeneTransaction;
import com.fp.persistence.pgeneral.trans.TgeneTransactionProcess;
/**
* Clase controladora del bean TgeneTransactionProcess.
*
* @author Jorge Vaca.
* @version 2.1
*/
@ManagedBean
@ViewScoped
public class TransactionProcessController extends AbstractController<TgeneTransactionProcess> {
private static final long serialVersionUID = 1L;
public TransactionProcessController() throws Exception {
super(TgeneTransactionProcess.class);
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
super.startQuery();
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
this.recperpage = 10; // Cambiar al # reg a mirar.
this.lrecord = new ArrayList<>();
this.beanalias = "CATALOG";
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
/**
* Crea una instancia de TgeneTransactionProcess y marca el registro como nuevo.
*
* @throws Exception
*/
@Override
public void create() throws Exception {
if (super.getMfilters().get("pk.transactionmodule") == null) {
MessageHelper.setMessageError("msg_transactionrequird");
return;
}
super.create();
this.record.getPk().setTransactionmodule(super.getMfilters().get("pk.transactionmodule"));
this.record.getPk().setTransactioncode(Integer.valueOf(super.getMfilters().get("pk.transactioncode")));
this.record.getPk().setTransactionversion(Integer.valueOf(super.getMfilters().get("pk.transactionversion")));
this.record.setCatalogcodetypeprocess("PROCESSTYPE");
this.record.setCatalogtypeprocess("TRANSACTION");
}
/**
* Actualiza datos de registros nuevos o modifiados, si el registro es nuevo
* se adiciona a lista de nuevos, si es actualizado se adiciona a la lista
* de actualizados.
*
* @throws Exception
*/
@Override
public void update() throws Exception {
if(record.getProcesscode() == null){
MessageHelper.setMessageError("msg_processrequired");
return;
}
super.update();
}
@SuppressWarnings("unchecked")
@Override
protected void querydatabase() {
try {
super.addFilter("catalogtypeprocess", "TRANSACTION");
if(super.getMfilters().get("pk.transactioncode")==null){
MessageHelper.setMessageError("msg_catalogrequird");
return;
}
DtoQuery dto = super.getDtoQuery(true);
dto.setOrderby("t.executionorder");
// subqueries
SubQuery subquery = new SubQuery("TgeneProcess", "shortdesc", "nprocess",
"i.pk.processcode = t.processcode and i.pk.catalogtypeprocess = t.catalogtypeprocess");
dto.addSubQuery(subquery);
// subqueries 1
SubQuery subquery1 = new SubQuery("TgeneMessageTemplates", "description", "messagedesc",
"i.pk = t.flowmessagecode");
dto.addSubQuery(subquery1);
// subqueries 2
SubQuery subquery2 = new SubQuery("TbpmRules", "description", "flowdesc",
"i.pk.rulecode = t.processname and i.pk.companycode = "+super.getLoginController().getRequest().getCompany().toString());
dto.addSubQuery(subquery2);
// subqueries 3
SubQuery subquery3 = new SubQuery("TgeneProcess", "shortdesc", "processdesc",
"i.pk.processcode = t.processcode and i.pk.catalogtypeprocess=t.catalogtypeprocess and i.pk.catalogcodetypeprocess=t.catalogcodetypeprocess");
dto.addSubQuery(subquery3);
// subqueries 3
SubQuery subquery4 = new SubQuery("TbpmRules", "description", "ruledesc",
"i.pk.rulecode = t.rulename and i.pk.companycode = "+super.getLoginController().getRequest().getCompany().toString());
dto.addSubQuery(subquery4);
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(this.beanalias, dto); // permite adicionar mas de una tabla.
Request request = this.callerhelper.getRequest();
request.setQueryTables(mtables);
Response resp = this.callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
this.lrecord = new ArrayList<TgeneTransactionProcess>();
MessageHelper.setMessageError(resp);
} else {
this.lrecord = (List<TgeneTransactionProcess>) resp.get(this.beanalias);
super.postQuery(this.lrecord);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@Override
public void save() {
try {
DtoSave dtosave = super.getDtoSave();
dtosave.setReturnpk(true); // Para que el core devuelva el pk de los registros nuevos.
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
Request request = this.callerhelper.getRequest();
msave.put(this.beanalias, dtosave); // adicionar metadata de mantenimiento para cada tabla.
request.setSaveTables(msave);
Response resp = this.callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
this.postCommit(resp);
MessageHelper.setMessageInfo(resp);
} else {
MessageHelper.setMessageError(resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@Override
public void postCommit(Response response) throws Exception {
super.postCommitGeneric(response, this.beanalias);
}
/**
* Abre el lov de transacciones
*/
public void openTransactionLov() {
Map<String, List<String>> params = new HashMap<>();
List<String> l = new ArrayList<>();
l.add("TRANSACTION"); // valor del parametro
params.put("processtype", l);
TransactionLovController.openLov(params);
}
/**
* Gestiona la respuesta del lov de transacciones
* @param event
* @throws Exception
*/
public void onReturnTransactionLov(SelectEvent event) throws Exception {
TgeneTransaction t = (TgeneTransaction) event.getObject();
super.addFilter("pk.transactionmodule", t.getPk().getTransactionmodule());
super.addFilter("pk.transactioncode", t.getPk().getTransactioncode().toString());
super.addFilter("pk.transactionversion", t.getPk().getTransactionversion().toString());
super.addField("transactionname", t.getName());
this.query();
}
/**
* Abre el lov de comandos
*/
public void openProcessLov() {
Map<String, List<String>> params = new HashMap<>();
List<String> l = new ArrayList<>();
l.add("TRANSACTION"); // valor del parametro
params.put("processtype", l);
ProcessLovControler.openLov(params);
}
/**
* Gestiona la respuesta del lov de comandos
* @param event
* @throws Exception
*/
public void onReturnPrcoessLov(SelectEvent event) throws Exception {
TgeneProcess t = (TgeneProcess) event.getObject();
this.record.setProcesscode(t.getPk().getProcesscode());
this.record.put("nprocess", t.getShortdesc());
}
/**
* Llama al Lov de Mensajes
*/
public void openMessageTemplateLov() {
Map<String, List<String>> params = new HashMap<>();
MessageTemplatesLovController.openLov(params);
}
/**
* Gestiona la respuesta del Lov de Mensajes
* @param event
* @throws Exception
*/
public void onReturnMessageTemplateLov(SelectEvent event) throws Exception {
TgeneMessageTemplates t = (TgeneMessageTemplates) event.getObject();
this.record.setFlowmessagecode(t.getPk().toString());
this.record.put("messagedesc", t.getDescription());
}
/**
* Elimina el codigo de mensaje
* @throws Exception
*/
public void removemessage() throws Exception {
if(record != null){
record.setFlowmessagecode(null);
record.modifiedData.put("messagedesc", null);
}
}
/**
* Llama al Lov de Mensajes
*/
public void openFlowLov() {
Map<String, List<String>> params = new HashMap<>();
List<String> l = new ArrayList<>();
l.add("F"); // valor del parametro
params.put("filetype", l);
TbpmRulesLovController.openLov(params);
}
/**
* Gestiona la respuesta del Lov de Mensajes
* @param event
* @throws Exception
*/
public void onReturnFlowLov(SelectEvent event) throws Exception {
TbpmRules t = (TbpmRules) event.getObject();
this.record.setProcessname(t.getPk().getRulecode());
//this.record.setPackagename(t.getPackagename());
this.record.put("flowdesc", t.getDescription());
}
/**
* Elimina el codigo de mensaje
* @throws Exception
*/
public void removeflow() throws Exception {
if(record != null){
record.setProcessname(null);
record.modifiedData.put("flowdesc", null);
}
}
/**
* Llama al Lov de Mensajes
*/
public void openRuleLov() {
Map<String, List<String>> params = new HashMap<>();
List<String> l = new ArrayList<>();
l.add("R"); // valor del parametro
params.put("filetype", l);
TbpmRulesLovController.openLov(params);
}
/**
* Gestiona la respuesta del Lov de Mensajes
* @param event
* @throws Exception
*/
public void onReturnRuleLov(SelectEvent event) throws Exception {
TbpmRules t = (TbpmRules) event.getObject();
this.record.setRulename(t.getPk().getRulecode());
this.record.put("ruledesc", t.getDescription());
}
/**
* Elimina el codigo de mensaje
* @throws Exception
*/
public void removerule() throws Exception {
if(record != null){
record.setRulename(null);
record.modifiedData.put("ruledesc", null);
}
}
}

View File

@ -0,0 +1,97 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents"
template="/WEB-INF/templates/template.xhtml">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{permisosAutorizacionesController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:catalogdetail"
saveProcess=""
saveUpdate=""
focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="9" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpkmod" value="#{msg_general.lbl_identification}:" />
<p:inputText id="fpkmod" value="#{permisosAutorizacionesController.tcustPersonDetail.identification}" style="width: 140px;" disabled="true" />
<p:outputLabel for="fname" value="#{msg_general.lbl_name}:" />
<p:inputText id="fname" value="#{permisosAutorizacionesController.tcustPersonDetail.name}" style="width: 360px;" disabled="true" />
<p:commandButton id="lovCatalog" icon="ui-icon-link" actionListener="#{permisosAutorizacionesController.openLov()}" process="@this" styleClass="m-lov-button">
<p:ajax event="dialogReturn" listener="#{permisosAutorizacionesController.onReturnPersonLov}" update="filters,data-content" />
</p:commandButton>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{permisosAutorizacionesController}"
queryProcess=":formTable:filters"
queryUpdate=""
createUpdate=""
dialogWidgetVar="" showCreateBtn="false" showSaveBtn="false"/>
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_catalogdetail}" />
</f:facet>
<p:dataTable id="catalogdetail" var="row" value="#{permisosAutorizacionesController.lrecord}" rows="15" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_general.lbl_code}" resizable="true" >
<h:outputText value="#{row.pk}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_tipotramite}" resizable="true" >
<h:outputText value="#{row.modifiedData['description']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_tipoautorizacion}" resizable="true" >
<h:outputText value="#{row.modifiedData['descriptionTipoAut']}" />
</p:column>
<p:column headerText="#{msg_general.lbl_category}" resizable="true" >
<h:outputText value="#{row.modifiedData['descriptiontram']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_usoactividad}" resizable="true" >
<h:outputText value="#{row.modifiedData['descriptionact']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_fechaEmision}" resizable="true" >
<h:outputText value="#{row.fechaemision}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_fechaexpiracion}" resizable="true" >
<h:outputText value="#{row.fechaexpiracion}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_ruta}" resizable="true" >
<h:outputText value="#{row.xpath}" />
</p:column>
<p:column styleClass="m-action-column" headerText="Descarga">
<p:column styleClass="m-action-column" headerText="#{msg_armas.lbl_documento}"
resizable="true" style="width:50px;text-align: center;" rendered="#{row.xpath != null}">
<maia:alfrescoDocDownload controllerAlfresco="#{permisosAutorizacionesController.alfrescoController}"
xPathLocation="#{row.xpath}" label="#{msg_armas.btn_descargarDocumentos}" immediate="true" />
</p:column>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,965 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.0.0.final using JasperReports Library version 6.0.0 -->
<!-- 2021-11-15T21:38:32 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Reporte General" pageWidth="800" pageHeight="842" columnWidth="760" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="80331279-9be4-4003-ad3d-d3b8bfdf2084">
<property name="net.sf.jasperreports.export.csv.write.header" value="true"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="3"/>
<property name="ireport.y" value="454"/>
<template><![CDATA[$P{pathstyle}]]></template>
<parameter name="pathstyle" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["repo:/maia/1/style/style"]]></defaultValueExpression>
</parameter>
<parameter name="pathLogoIzquierda" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/image/comandoconjunto"]]></defaultValueExpression>
</parameter>
<parameter name="pathLogoDerecha" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/image/selloarmas"]]></defaultValueExpression>
</parameter>
<parameter name="SUBREPORT_DIR" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/modules/armas/subreports/"]]></defaultValueExpression>
</parameter>
<parameter name="csolicitud" class="java.lang.String"/>
<parameter name="lugarFecha" class="java.lang.String"/>
<parameter name="flagAgencia" class="java.lang.Boolean">
<parameterDescription><![CDATA[]]></parameterDescription>
</parameter>
<parameter name="flagArmas" class="java.lang.Boolean"/>
<parameter name="flagDoc" class="java.lang.Boolean"/>
<parameter name="flagGuardias" class="java.lang.Boolean"/>
<parameter name="flagRequisitos" class="java.lang.Boolean">
<parameterDescription><![CDATA[]]></parameterDescription>
</parameter>
<parameter name="centroControl" class="java.lang.String"/>
<parameter name="gradoUsuario" class="java.lang.String"/>
<parameter name="usuario" class="java.lang.String"/>
<parameter name="codResponsable" class="java.lang.String"/>
<parameter name="tipoAutorizacion" class="java.lang.String"/>
<parameter name="categoria" class="java.lang.String"/>
<parameter name="usoActividad" class="java.lang.String"/>
<parameter name="tipoTramite" class="java.lang.String"/>
<parameter name="noTramite" class="java.lang.String"/>
<parameter name="cabecera" class="java.lang.String"/>
<parameter name="email" class="java.lang.String"/>
<parameter name="direccion" class="java.lang.String"/>
<parameter name="noSolicitud" class="java.lang.String">
<parameterDescription><![CDATA[]]></parameterDescription>
</parameter>
<parameter name="codigoQR" class="java.lang.String"/>
<queryString>
<![CDATA[select
rownum,
--DATOS DE LA SOLICITUD
solicitud.fregistro as fechasolicitud,
tipotramite.description as tipotramite,
categoria.description as categoria,
soltramite.numerotramite as numerotramite,
autorizacion.description as tramite,
actividad.description as usoactividad,
--DATOS DE LA PERSONA
personadetalle.name as nombre,
personadetalle.identification as cedula,
personadetalle.legalrepresent as nombrerl,
pais.description as paisorigen,
canton.description as canton,
parroquia.description as parroquia,
phonehome.phonenumber as telefonoconvencional,
estadocivil.description as estadocivil,
p.height as estatura,
tipopersona.description as tipopersona,
solicitud.lugarorigen as lugarorigen,
solicitud.nombrerazonsocialorigen as nombrerazonsocialorigen,
solicitud.aucp as nosolaucp,
documento.fechaemision as fechaemision,
tipodoc.description as tipodocumento,
personadetalle.legalrepresentidentification as cedularl,
provincia.description as provincia,
ciudad.description as ciudad,
personadireccion.address as direccion,
phonecel.phonenumber as celular,
(CASE WHEN UPPER(p.gender)='M' THEN 'MASCULINO' WHEN UPPER(p.gender)='F' THEN 'FEMENINO' ELSE '' END) as genero,
profesion.description as profesion,
solicitud.lugardestino as lugardestino,
documento.fechaexpiracion as fechaexpiracion,
tramite.cabecera as cabecera,
tramite.pie as pie
from tarmsolicitud solicitud
left join tarmsolicitudtramite soltramite on soltramite.csolicitud = solicitud.csolicitud
left join tarmtramite tramite on tramite.ctramite = soltramite.ctramite
--TIPO DE TRAMITE
left join tgenecatalogdetail tipotramite on tipotramite.catalog=tramite.tipotramite and tipotramite.catalogcode=tramite.tipotramitecodigo
--CATEGORIA
left join tgenecatalogdetail categoria on categoria.catalog=tramite.categoria and categoria.catalogcode=tramite.categoriacodigo
--AUTORIZACION
left join tgenecatalogdetail autorizacion on autorizacion.catalog=tramite.tipoautorizacion and autorizacion.catalogcode=tramite.tipoautorizacioncodigo
--USO ACTIVIDAD
left join tgenecatalogdetail actividad on actividad.catalog=tramite.usoactividad and actividad.catalogcode=tramite.usoactividadcodigo
--DATOS DE LA PERSONA
left join tcustperson persona on persona.personcode = solicitud.personcode
left join tcustpersondetail personadetalle
on personadetalle.personcode = persona.personcode
and personadetalle.dateto = TO_DATE (TO_CHAR (personadetalle.dateto, 'YYYY-MON-DD HH24:MI:SS'),'YYYY-MON-DD HH24:MI:SS')
left join tcustpersonaddress personadireccion
on personadireccion.personcode = personadetalle.personcode
and personadireccion.dateto = TO_DATE (TO_CHAR (personadetalle.dateto, 'YYYY-MON-DD HH24:MI:SS'),'YYYY-MON-DD HH24:MI:SS')
and personadireccion.principal = 'Y'
left join tcustpeople p
on p.personcode = personadetalle.personcode
and p.dateto = TO_DATE (TO_CHAR (p.dateto, 'YYYY-MON-DD HH24:MI:SS'),'YYYY-MON-DD HH24:MI:SS')
--DATOS DE PAIS,PROVINCIA,CIUDAD,PARROQUIA DE LA PERSONA
left join tgenecountry pais
on pais.countrycode = personadireccion.countrycode
left join tgeneprovince provincia
on provincia.provincecode = personadireccion.provincecode
and provincia.countrycode = personadireccion.countrycode
left join tgenecanton canton
on canton.cantoncode = personadireccion.cantoncode
and canton.provincecode = personadireccion.provincecode
and canton.countrycode = personadireccion.countrycode
left join tgenecity ciudad
on ciudad.citycode = personadireccion.citycode
and ciudad.cantoncode = personadireccion.cantoncode
and ciudad.provincecode = personadireccion.provincecode
and ciudad.countrycode = personadireccion.countrycode
left join tgeneparroquia parroquia
on parroquia.parroquiacode = personadireccion.parroquiacode
and parroquia.cantoncode = personadireccion.cantoncode
and parroquia.provincecode = personadireccion.provincecode
and parroquia.countrycode = personadireccion.countrycode
--TELEFONOS
left join tcustpersonphone phonehome
on phonehome.personcode=personadetalle.personcode
and phonehome.phonetypecatalog = 1
and phonehome.dateto = TO_DATE (TO_CHAR (phonehome.dateto, 'YYYY-MON-DD HH24:MI:SS'),'YYYY-MON-DD HH24:MI:SS')
left join tcustpersonphone phonecel
on phonecel.personcode=personadetalle.personcode AND phonecel.dateto = TO_DATE ('2999-12-31','YYYY-MM-DD')
and phonecel.phonetypecatalog = 2
--ESTADO CIVIL
left join tgenecatalogdetail estadocivil on estadocivil.catalog=p.maritalstatuscatalog
and estadocivil.catalogcode=p.maritalstatuscatalogcode
--TIPO DE PERSONA
left join tgenecatalogdetail tipopersona
on tipopersona.catalog=personadetalle.persontypecatalog
and tipopersona.catalogcode=personadetalle.persontypecatalogcode
--FECHA DE EMISION/EXPIRACION DE DOCUMENTO
left join tarmdocumentohabilitante documento
on documento.csolicitud = solicitud.csolicitud
and documento.personcode = solicitud.personcode
--TIPO DOCUMENTO
left join tgenecatalogdetail tipodoc
on tipodoc.catalog=personadetalle.identificationcatalog
and tipodoc.catalogcode=personadetalle.identificationcatalogcode
--PROFESION
left join tgenecatalogdetail profesion
on profesion.catalog=p.professioncatalog
and profesion.catalogcode=p.professioncatalogcode
--FILTRO DE BUSQUEDA
where solicitud.csolicitud= $P{csolicitud}]]>
</queryString>
<field name="fechasolicitud" class="java.util.Date">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="tipotramite" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="categoria" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="numerotramite" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="tramite" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="usoactividad" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="nombre" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cedula" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="nombrerl" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="paisorigen" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="canton" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="parroquia" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="telefonoconvencional" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="estadocivil" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="tipopersona" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="lugarorigen" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="fechaemision" class="java.util.Date">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="tipodocumento" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cedularl" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="provincia" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="ciudad" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="direccion" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="celular" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="genero" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="profesion" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="lugardestino" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="fechaexpiracion" class="java.util.Date">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cabecera" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="pie" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="estatura" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="nombrerazonsocialorigen" class="java.lang.String"/>
<field name="nosolaucp" class="java.lang.String"/>
<group name="informacionArmas"/>
<group name="informacionGuardias"/>
<group name="informacionAgencias"/>
<group name="requisitos"/>
<group name="listarDocumentos"/>
<group name="InfoArmasGroup1">
<groupHeader>
<band height="37">
<printWhenExpression><![CDATA[$P{flagArmas}]]></printWhenExpression>
<subreport>
<reportElement x="0" y="1" width="760" height="29" uuid="d7c4e2a1-5c97-44e0-bc37-2e7345d43a68"/>
<subreportParameter name="csolicitud">
<subreportParameterExpression><![CDATA[$P{csolicitud}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "informacionArmas"]]></subreportExpression>
</subreport>
</band>
</groupHeader>
</group>
<group name="InfoGuardiasGroup2">
<groupHeader>
<band height="35">
<printWhenExpression><![CDATA[$P{flagGuardias}]]></printWhenExpression>
<subreport>
<reportElement x="1" y="4" width="760" height="26" uuid="a4813eb7-bd46-453d-8d79-5a02a95dc2dc">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<subreportParameter name="csolicitud">
<subreportParameterExpression><![CDATA[$P{csolicitud}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "informacionGuardias"]]></subreportExpression>
</subreport>
</band>
</groupHeader>
</group>
<group name="InfoAgenciasGroup1">
<groupHeader>
<band height="38">
<printWhenExpression><![CDATA[$P{flagAgencia}]]></printWhenExpression>
<subreport>
<reportElement x="0" y="4" width="760" height="26" uuid="da128070-4a36-452e-8a97-ca7576491b23">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<subreportParameter name="csolicitud">
<subreportParameterExpression><![CDATA[$P{csolicitud}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "informacionAgenciasSucursales"]]></subreportExpression>
</subreport>
</band>
</groupHeader>
</group>
<group name="InfoRequisitosGroup1"/>
<group name="InfoDocGroup1">
<groupHeader>
<band height="38">
<printWhenExpression><![CDATA[$P{flagDoc}]]></printWhenExpression>
<subreport>
<reportElement x="2" y="0" width="760" height="27" uuid="30b18b62-d627-4f19-aca1-06152f58c8a3">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<subreportParameter name="csolicitud">
<subreportParameterExpression><![CDATA[$P{csolicitud}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "listarDocumentos"]]></subreportExpression>
</subreport>
</band>
</groupHeader>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="426">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement style="title1" x="90" y="19" width="470" height="20" forecolor="#000000" uuid="a5555ed3-8bce-44fd-afbb-28084239a1a1"/>
<textElement textAlignment="Center"/>
<text><![CDATA[COMANDO CONJUNTO DE LAS FUERZAS ARMADAS]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="90" y="42" width="470" height="16" forecolor="#000000" uuid="98c268e9-4cb8-4184-9c02-537b79b6957c">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Center"/>
<text><![CDATA[DEPARTAMENTO DE CONTROL DE ARMAS]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="1" y="141" width="99" height="16" forecolor="#000000" uuid="b7269dae-8fea-40f5-a8f0-4fb5b1935423">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[CATEGORÍA:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="261" y="125" width="89" height="16" forecolor="#000000" uuid="33e95c51-6de0-4170-99cd-35908e9fce31">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[TRÁMITE:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="1" y="109" width="99" height="16" forecolor="#000000" uuid="9755ef24-6003-430b-b359-a1db3549ac29">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[FECHA DE SOLICITUD:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="1" y="125" width="99" height="16" forecolor="#000000" uuid="fbe6639b-a192-484d-9dd8-802e5501abeb">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[TIPO DE TRÁMITE:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="261" y="141" width="89" height="16" forecolor="#000000" uuid="2f095ec8-10d9-4b8f-a925-3f1546d5d0e2">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[USO/ACTIVIDAD:]]></text>
</staticText>
<image>
<reportElement x="2" y="26" width="68" height="68" uuid="3290f869-ef8a-4381-8e57-7aeff12ca363">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{pathLogoIzquierda}]]></imageExpression>
</image>
<image>
<reportElement x="569" y="9" width="80" height="80" uuid="9052917f-d24c-47b3-ae9f-c2ef5b5dfc80">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{pathLogoDerecha}]]></imageExpression>
</image>
<textField>
<reportElement style="normal1" x="100" y="109" width="161" height="16" uuid="aeeeab82-2c2d-4f4a-b4f5-82ffaea7b551"/>
<textFieldExpression><![CDATA[new SimpleDateFormat("dd-MM-yyyy").format($F{fechasolicitud})]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="100" y="125" width="161" height="16" uuid="9c3d0bee-fc9b-4cbf-9621-a3b93f08a185"/>
<textFieldExpression><![CDATA[$P{tipoTramite}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="100" y="141" width="161" height="16" uuid="8c79ed8d-f4dd-411a-823c-a4e089086247"/>
<textFieldExpression><![CDATA[$P{categoria}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="350" y="125" width="284" height="16" uuid="653034d4-b722-4ce9-8248-4516b62f0323"/>
<textFieldExpression><![CDATA[$P{tipoAutorizacion}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="350" y="141" width="284" height="16" uuid="dd2dc614-43e9-408e-9923-6c09e1fdc171"/>
<textFieldExpression><![CDATA[$P{usoActividad}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal" isPrintRepeatedValues="false" x="1" y="157" width="648" height="37" uuid="9563ac8a-2086-4264-b096-0437f530314a">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA["Este documento es el soporte de la información ingresada en la solicitud, no es un documento válido para el trámite ingresado, al final del proceso y una vez aprobado el trámite se generara el documento oficial."]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="title3" x="0" y="202" width="150" height="16" forecolor="#000000" uuid="3bb8e17c-e4b2-4403-83b0-b0604f3b180d">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[NOMBRE / RAZÓN SOCIAL:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="218" width="150" height="16" forecolor="#000000" uuid="f87edae9-6df5-4c82-b40a-3937ad6d6d89">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[No DOCUMENTO:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="234" width="149" height="16" forecolor="#000000" uuid="009443dd-5321-4e42-bc2c-7400e645cd44">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[NOMBRE REPRESENTANTE LEGAL:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="250" width="150" height="16" forecolor="#000000" uuid="a14cb52b-d731-4e19-ba36-6f0f8b32cd4a">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[PAÍS ORIGEN:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="266" width="150" height="16" forecolor="#000000" uuid="808df12d-879c-4b4a-b6c6-14f0e748caef">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[CANTÓN:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="282" width="150" height="16" forecolor="#000000" uuid="6f70e23b-ac5b-4c5e-9173-8f536a391a7b">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[PARROQUIA:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="298" width="150" height="16" forecolor="#000000" uuid="e4f3f8ef-35ba-4965-aa83-8ce8ca454701">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[TELÉFONO:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="314" width="150" height="16" forecolor="#000000" uuid="5684f31f-2641-41c0-89ff-90b0152cd5b8">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[ESTADO CIVIL:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="330" width="150" height="16" forecolor="#000000" uuid="4290cfb9-d03a-491a-bf5d-5fae9fdb4bf8">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[ESTATURA:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="346" width="150" height="16" forecolor="#000000" uuid="77335193-a00e-4a24-a664-66e0e9c286dc">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[TIPO DE PERSONA:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="378" width="150" height="16" forecolor="#000000" uuid="98ae2b12-ac36-4855-8d4b-70c92b0657e6">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[LUGAR DE ORIGEN:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="394" width="150" height="16" forecolor="#000000" uuid="bdf07488-cde7-4728-8cf1-2fd9bfe36d0c">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[FECHA EXPEDICIÓN:]]></text>
</staticText>
<textField>
<reportElement style="normal1" x="150" y="202" width="499" height="16" uuid="395cc6b1-bcbf-4737-bb71-9dc78a2b00c3">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{nombre} == null ? "" : $F{nombre}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="218" width="180" height="16" uuid="54dfa112-3d42-40d5-9178-dc6d0728cf17">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{cedula} == null ? "" : $F{cedula}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="234" width="179" height="16" uuid="258c7831-fd11-491b-b8c1-2fd85bbcfe1d">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{nombrerl} == null ? "" : $F{nombrerl}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="250" width="180" height="16" uuid="15426e8f-581f-4c6f-8355-919fd30012fc">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{paisorigen} == null ? "" : $F{paisorigen}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="266" width="180" height="16" uuid="175d9f6c-a45c-446c-959d-6f7bfc7e492c">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
</reportElement>
<textFieldExpression><![CDATA[$F{canton} == null ? "" : $F{canton}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="282" width="180" height="16" uuid="5e5e5fe1-450d-4a8b-b712-05b7a245be1f">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{parroquia} == null ? "" : $F{parroquia}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="298" width="180" height="16" uuid="145e8eed-eff8-4c6f-bef7-0e3fe260c3a3">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{telefonoconvencional} == null ? "" : $F{telefonoconvencional}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="314" width="180" height="16" uuid="ab65a5b6-4da9-4b57-b178-8eea796e51ff">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{estadocivil} == null ? "" : $F{estadocivil}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="346" width="180" height="16" uuid="56646f05-15ef-48ac-8eca-94777a7a032e">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{tipopersona} == null ? "" : $F{tipopersona}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="378" width="180" height="16" uuid="4cf86629-9f58-4947-93cc-0ea0229a253c">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{lugarorigen} == null ? "" : $F{lugarorigen}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="394" width="169" height="16" uuid="313c4607-9360-4501-990e-b0396a5cff86">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{fechaexpiracion} == null ? "" : (new SimpleDateFormat("dd-MM-yyyy").format($F{fechaexpiracion}))]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" x="150" y="330" width="180" height="16" uuid="ffd9c73f-80b2-4a4c-8fcc-b279cabdbd62">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{estatura} == null ? "" : $F{estatura}]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="title3" x="330" y="218" width="150" height="16" forecolor="#000000" uuid="111b7962-7c48-4d01-9d57-bed64c836f6d">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[TIPO DOCUMENTO:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="234" width="150" height="16" forecolor="#000000" uuid="9ba22306-bf0a-4d3b-95cc-8747c7ff7beb">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[ACTIVIDAD ECONÓMICA:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="250" width="150" height="16" forecolor="#000000" uuid="5543005c-1ecb-4803-9e74-1c0d0e5bccf9">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[CÉDULA REPRESENTANTE LEGAL:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="266" width="150" height="16" forecolor="#000000" uuid="9c2b583b-138e-45c2-9cae-ece65b217c35">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[PROVINCIA:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="282" width="150" height="16" forecolor="#000000" uuid="eb65881f-96c8-4f2b-b2eb-229170df994f">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[CIUDAD:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="298" width="150" height="16" forecolor="#000000" uuid="43bf5d93-681c-4fdb-a83b-792a01f80c68">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[DIRECCIÓN:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="314" width="150" height="16" forecolor="#000000" uuid="9f7f29aa-9076-45bd-ad5c-c31d3a38dca4">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[TELÉFONO CELULAR:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="330" width="150" height="16" forecolor="#000000" uuid="b3617dda-4d02-4197-a426-cea3fd7d0034">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[GÉNERO:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="0" y="410" width="150" height="16" forecolor="#000000" uuid="41363e95-eb69-46e8-9ff4-15cb5a99c1b4">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[PROFESIÓN:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="346" width="150" height="16" forecolor="#000000" uuid="370435b5-bc62-4c49-baff-894f4a5ab022">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[EMAIL:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="378" width="150" height="16" forecolor="#000000" uuid="f8809fea-d4b4-4a58-8a5e-33f429c0ecd8">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[LUGAR DE DESTINO:]]></text>
</staticText>
<staticText>
<reportElement style="title3" x="330" y="394" width="150" height="16" forecolor="#000000" uuid="8a87b4f4-893b-41fa-a00a-dfe92e2db84d">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[FECHA CADUCA:]]></text>
</staticText>
<textField>
<reportElement style="normal1" x="150" y="394" width="179" height="16" uuid="be70bb6d-2dae-4212-b722-a388024b33ab">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{fechaemision} == null ? "" : (new SimpleDateFormat("dd-MM-yyyy").format($F{fechaemision}))]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="218" width="169" height="16" uuid="f4877331-52d5-4e6c-977d-05a2a78723fb">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{tipodocumento} == null ? "" : $F{tipodocumento}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="250" width="169" height="16" uuid="e10fd72a-3dcd-42c9-84e8-642d0c3b461e"/>
<textFieldExpression><![CDATA[$F{cedularl} == null ? "" : $F{cedularl}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="266" width="169" height="16" uuid="2dbf6ff9-8628-4d25-bd2f-32658b95624f">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{provincia} == null ? "" : $F{provincia}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="282" width="169" height="16" uuid="4e5b6656-7d2c-443a-9c99-fdfab59bda87">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{ciudad} == null ? "" : $F{ciudad}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="298" width="169" height="16" uuid="ce699d08-050e-4861-bc04-047f1efad8b4">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$P{direccion}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="314" width="169" height="16" uuid="2122d295-2325-4b85-8adc-4a3d968fc679">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{celular} == null ? "" : $F{celular}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="330" width="169" height="16" uuid="e0ea6e82-0aeb-4b2a-814e-f19d025a613e">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{genero} == null ? "" : $F{genero}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="normal1" isPrintRepeatedValues="false" x="150" y="410" width="179" height="16" isPrintWhenDetailOverflows="true" uuid="a9e71530-4595-4fd0-9a0e-88dfe5b74241">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{profesion} == null ? "" : $F{profesion}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="378" width="169" height="16" uuid="d55c68cf-5bd6-4ce6-bfe5-b3af8b29cb6c">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{lugardestino} == null ? "" : $F{lugardestino}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="title2" x="90" y="58" width="470" height="16" uuid="7c100f9b-26dd-43e4-8b0d-266544072024">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$P{centroControl}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="title2" x="90" y="77" width="470" height="16" forecolor="#000000" uuid="b7280497-3d68-417a-808f-38c0a75d31e7">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Center"/>
<text><![CDATA[SOLICITUD TRÁMITE]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="346" width="169" height="16" uuid="6a30e22d-6e35-49f7-a128-c00096e1e04e">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$P{email}]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="title3" x="261" y="109" width="89" height="16" forecolor="#000000" uuid="c2d0cb8f-6b9a-48cb-9cc7-dade8c91101d">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[No. SOLICITUD:]]></text>
</staticText>
<textField>
<reportElement style="normal1" x="350" y="109" width="284" height="16" uuid="3d3ccdbb-cc9e-4b61-add0-1c930d580e0d"/>
<textFieldExpression><![CDATA[$P{noSolicitud}]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="title3" x="331" y="362" width="150" height="16" forecolor="#000000" uuid="8ee3fb41-a340-4161-bd6d-7958a8b951ba">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[COMPRADOR/CONSUMIDOR:]]></text>
</staticText>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="481" y="362" width="168" height="16" uuid="b8c82b6e-3f69-444b-b277-7f1c6a189c54">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$P{usuario}]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="title3" x="1" y="362" width="150" height="16" forecolor="#000000" uuid="7a43a57c-ac36-47b2-a1a2-12ff4bbd24aa">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[RAZÓN SOCIAL VENDEDOR:]]></text>
</staticText>
<textField>
<reportElement style="normal1" x="151" y="362" width="180" height="16" uuid="3687d26e-fd54-469d-8f8e-e9a1d8822fdd">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{nombrerazonsocialorigen} == null ? "" : $F{nombrerazonsocialorigen}]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="title3" x="330" y="410" width="150" height="16" forecolor="#000000" uuid="5471ed42-136a-41bd-9ae6-e1c8eb2e505a">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[NO. SOLICITUD / AUCP:]]></text>
</staticText>
<textField>
<reportElement style="normal1" isPrintRepeatedValues="false" x="480" y="410" width="169" height="16" uuid="9b1872a7-2300-4e22-9ed0-085bf6e92c95">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$F{nosolaucp} == null ? "" : $F{nosolaucp}]]></textFieldExpression>
</textField>
</band>
</title>
<pageFooter>
<band height="82">
<textField>
<reportElement style="normal" x="385" y="9" width="156" height="13" uuid="dae0a268-0ec4-4895-b188-758c6a91e990"/>
<textFieldExpression><![CDATA[$P{lugarFecha}]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="normal" x="273" y="9" width="112" height="13" uuid="e441d13c-c74c-4c69-ad86-e61c3250dbb1"/>
<text><![CDATA[Fecha emisión / hora:]]></text>
</staticText>
<textField>
<reportElement style="normal" x="70" y="8" width="170" height="13" uuid="8b29d9ea-7dcd-43cc-881d-275a2244cf8e"/>
<textFieldExpression><![CDATA[$P{usuario}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="normal" x="0" y="8" width="50" height="13" uuid="2c7a9752-e4e7-4783-998e-ce5f9d158e26"/>
<text><![CDATA[Usuario:]]></text>
</staticText>
<staticText>
<reportElement x="581" y="9" width="40" height="13" uuid="c88fb39c-d0e0-4965-ba0a-f1a42f7efbaa">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<text><![CDATA[Página]]></text>
</staticText>
<textField evaluationTime="Page">
<reportElement x="621" y="9" width="20" height="13" uuid="863c93ec-cc3b-4d7a-8f0c-c25f8fa3c7c5"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="641" y="9" width="20" height="13" uuid="57fdc0f2-8637-4a2d-97cf-f8c4c9796369">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<text><![CDATA[de]]></text>
</staticText>
<textField evaluationTime="Report">
<reportElement x="661" y="9" width="20" height="13" uuid="91ab8f04-592a-430f-851c-6de77f55767c"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<image>
<reportElement x="1" y="27" width="60" height="52" uuid="e9b0dc7b-3d1e-4cda-91ea-2be4ec170edf"/>
<imageExpression><![CDATA[com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
new com.google.zxing.qrcode.QRCodeWriter().encode(
$P{codigoQR},
com.google.zxing.BarcodeFormat.QR_CODE, 500, 500))]]></imageExpression>
</image>
</band>
</pageFooter>
</jasperReport>

View File

@ -0,0 +1,37 @@
package com.fp.dto;
import com.fp.dto.fin.FinancialExchange;
/**
* Clase a extender en las clase que manejan saldos de cuentas.
* @author Jorge Vaca
* @version 2.1
*/
public class AbstractDataBalanceTransport extends AbstractDataTransport{
private static final long serialVersionUID = 1L;
/**Indica si el registro de la tabla es modificado.*/
private boolean modified = false;
/**
* Entrega el valor de: modified
* @return boolean
*/
public boolean isModified() {
return modified;
}
/**
* Fija el valor de: modified
* @param modified
*/
public void setModified(boolean modified) {
this.modified = modified;
}
@Override
public Object cloneMe() throws CloneNotSupportedException {
AbstractDataBalanceTransport p = (AbstractDataBalanceTransport) this.clone();
return p;
}
}

View File

@ -0,0 +1,124 @@
package com.fp.persistence.pgeneral.gene;
import javax.persistence.Column;
import java.io.Serializable;
import com.fp.dto.hb.HibernateId;
import java.lang.reflect.Field;
import javax.persistence.Embeddable;
import javax.persistence.Transient;
/**Clase que hace referencia a la Clave Primaria de TGENEOPERATIVECONDITION*/
@Embeddable
public class TgeneOperativeConditionKey extends com.fp.dto.AbstractDataTransport implements Serializable,Cloneable,HibernateId{
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
@Column(name="OPERATIVCONDITION", nullable=false,updatable=false)
/**
* Codigo de condicion operativa.
*/
private String operativcondition;
@Column(name="MODULECODE", nullable=false,updatable=false)
/**
* Codigo de modulo
*/
private String modulecode;
/**Contructor por defecto*/
public TgeneOperativeConditionKey(){}
/**Contructor de TgeneOperativeConditionKey
@param pOperativcondition Codigo de condicion operativa.
@param pModulecode Codigo de modulo
*/
public TgeneOperativeConditionKey(String pOperativcondition,String pModulecode){
operativcondition=pOperativcondition;
modulecode=pModulecode;
}
/**Obtiene el valor de operativcondition
@return valor de operativcondition*/
public String getOperativcondition(){
return operativcondition;
}
/**Fija el valor de operativcondition
@param pOperativcondition nuevo Valor de operativcondition*/
public void setOperativcondition(String pOperativcondition){
operativcondition=pOperativcondition;
}
/**Obtiene el valor de modulecode
@return valor de modulecode*/
public String getModulecode(){
return modulecode;
}
/**Fija el valor de modulecode
@param pModulecode nuevo Valor de modulecode*/
public void setModulecode(String pModulecode){
modulecode=pModulecode;
}
/**Implementación de la comparación de TgeneOperativeConditionKey
@param o Objeto de comparación
*/
public boolean equals(Object o){
if (o == null)return false;
if (! (o instanceof TgeneOperativeConditionKey))return false;
TgeneOperativeConditionKey that = (TgeneOperativeConditionKey) o;
if (this.getOperativcondition() == null || that.getOperativcondition() == null){
return false;
}
if (! this.getOperativcondition().equals(that.getOperativcondition())){
return false;
}
if (this.getModulecode() == null || that.getModulecode() == null){
return false;
}
if (! this.getModulecode().equals(that.getModulecode())){
return false;
}
return true;
}
/**Implementación del método hashCode bajo el patrón de Bloch
@return hashCode de la instancia TgeneOperativeConditionKey
*/
public int hashCode(){
if (this.hashValue == 0){
int result = 17;
result = result * 37 + (this.getOperativcondition() == null ? 0 : this.getOperativcondition().hashCode());
result = result * 37 + (this.getModulecode() == null ? 0 : this.getModulecode().hashCode());
this.hashValue = result;
}
return this.hashValue;
}
public Object cloneMe() throws CloneNotSupportedException {
return this.clone();
}
/**Implementación toString
*/
public String toString() {
Field[]fs=this.getClass().getDeclaredFields();
String data="";
for(Field f:fs){
try{
String name=f.getName();
if(f.getType().getName().compareTo("java.util.Set")==0)continue;
if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
data+="pk."+name+"="+f.get(this)+";";
}catch(Exception e){
continue;
}
}
if(data.compareTo("")==0){
data=super.toString();
}
return data;
}
}

View File

@ -0,0 +1,178 @@
package com.fp.persistence.pgeneral.auth;
import javax.persistence.Column;
import java.io.Serializable;
import com.fp.dto.hb.HibernateId;
import java.lang.reflect.Field;
import javax.persistence.Embeddable;
import javax.persistence.Transient;
/**Clase que hace referencia a la Clave Primaria de TGENESOLICITUDECLIENTDATA*/
@Embeddable
public class TgeneSolicitudeClientdataKey extends com.fp.dto.AbstractDataTransport implements Serializable,Cloneable,HibernateId{
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
@Column(name="SOLICITUDNUMBER", nullable=false,updatable=false)
/**
* Numero de solicitud
*/
private String solicitudnumber;
@Column(name="SOLICITUDSEQUENCE", nullable=false,updatable=false)
/**
* secuencia interna de solicitud
*/
private Integer solicitudsequence;
@Column(name="TITLE", nullable=false,updatable=false)
/**
* Codigo de informacion de clientes requerido.
*/
private String title;
@Column(name="PERSONCODE", nullable=false,updatable=false)
/**
* Codigo de persona asociado a la solicitud.
*/
private Integer personcode;
/**Contructor por defecto*/
public TgeneSolicitudeClientdataKey(){}
/**Contructor de TgeneSolicitudeClientdataKey
@param pSolicitudnumber Numero de solicitud
@param pSolicitudsequence secuencia interna de solicitud
@param pTitle Codigo de informacion de clientes requerido.
@param pPersoncode Codigo de persona asociado a la solicitud.
*/
public TgeneSolicitudeClientdataKey(String pSolicitudnumber,Integer pSolicitudsequence,String pTitle,Integer pPersoncode){
solicitudnumber=pSolicitudnumber;
solicitudsequence=pSolicitudsequence;
title=pTitle;
personcode=pPersoncode;
}
/**Obtiene el valor de solicitudnumber
@return valor de solicitudnumber*/
public String getSolicitudnumber(){
return solicitudnumber;
}
/**Fija el valor de solicitudnumber
@param pSolicitudnumber nuevo Valor de solicitudnumber*/
public void setSolicitudnumber(String pSolicitudnumber){
solicitudnumber=pSolicitudnumber;
}
/**Obtiene el valor de solicitudsequence
@return valor de solicitudsequence*/
public Integer getSolicitudsequence(){
return solicitudsequence;
}
/**Fija el valor de solicitudsequence
@param pSolicitudsequence nuevo Valor de solicitudsequence*/
public void setSolicitudsequence(Integer pSolicitudsequence){
solicitudsequence=pSolicitudsequence;
}
/**Obtiene el valor de title
@return valor de title*/
public String getTitle(){
return title;
}
/**Fija el valor de title
@param pTitle nuevo Valor de title*/
public void setTitle(String pTitle){
title=pTitle;
}
/**Obtiene el valor de personcode
@return valor de personcode*/
public Integer getPersoncode(){
return personcode;
}
/**Fija el valor de personcode
@param pPersoncode nuevo Valor de personcode*/
public void setPersoncode(Integer pPersoncode){
personcode=pPersoncode;
}
/**Implementación de la comparación de TgeneSolicitudeClientdataKey
@param o Objeto de comparación
*/
public boolean equals(Object o){
if (o == null)return false;
if (! (o instanceof TgeneSolicitudeClientdataKey))return false;
TgeneSolicitudeClientdataKey that = (TgeneSolicitudeClientdataKey) o;
if (this.getSolicitudnumber() == null || that.getSolicitudnumber() == null){
return false;
}
if (! this.getSolicitudnumber().equals(that.getSolicitudnumber())){
return false;
}
if (this.getSolicitudsequence() == null || that.getSolicitudsequence() == null){
return false;
}
if (! this.getSolicitudsequence().equals(that.getSolicitudsequence())){
return false;
}
if (this.getTitle() == null || that.getTitle() == null){
return false;
}
if (! this.getTitle().equals(that.getTitle())){
return false;
}
if (this.getPersoncode() == null || that.getPersoncode() == null){
return false;
}
if (! this.getPersoncode().equals(that.getPersoncode())){
return false;
}
return true;
}
/**Implementación del método hashCode bajo el patrón de Bloch
@return hashCode de la instancia TgeneSolicitudeClientdataKey
*/
public int hashCode(){
if (this.hashValue == 0){
int result = 17;
result = result * 37 + (this.getSolicitudnumber() == null ? 0 : this.getSolicitudnumber().hashCode());
result = result * 37 + (this.getSolicitudsequence() == null ? 0 : this.getSolicitudsequence().hashCode());
result = result * 37 + (this.getTitle() == null ? 0 : this.getTitle().hashCode());
result = result * 37 + (this.getPersoncode() == null ? 0 : this.getPersoncode().hashCode());
this.hashValue = result;
}
return this.hashValue;
}
public Object cloneMe() throws CloneNotSupportedException {
return this.clone();
}
/**Implementación toString
*/
public String toString() {
Field[]fs=this.getClass().getDeclaredFields();
String data="";
for(Field f:fs){
try{
String name=f.getName();
if(f.getType().getName().compareTo("java.util.Set")==0)continue;
if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
data+="pk."+name+"="+f.get(this)+";";
}catch(Exception e){
continue;
}
}
if(data.compareTo("")==0){
data=super.toString();
}
return data;
}
}

View File

@ -0,0 +1,368 @@
package com.fp.frontend.controller.armas.funcionalidad;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
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.eclipse.jdt.core.dom.ThisExpression;
import com.fp.dto.AbstractDataTransport;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.ReportController;
import com.fp.frontend.controller.armas.parametros.CentroControlArmasController;
import com.fp.frontend.controller.armas.parametros.TarmCentroControlJurController;
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.helper.MessageHelper;
import com.fp.frontend.utility.MsgControlArmas;
import com.fp.persistence.parmas.param.TarmCentroControl;
import com.fp.persistence.parmas.param.TarmCentroControlJur;
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.safe.TsafeUserDetail;
/**
* @author DLO
* Clase Controladora la cual genera el reporte de tr&aacute;mite por centro de control
*/
@ManagedBean
@ViewScoped
public class ReporteDecomisoController extends AbstractController<AbstractDataTransport> {
public ReporteDecomisoController() throws Exception {
super(AbstractDataTransport.class);
// TODO Auto-generated constructor stub
}
private static final long serialVersionUID = 1L;
@ManagedProperty(value = "#{reportController}")
private ReportController reportController;
@ManagedProperty(value = "#{personDetailController}")
private PersonDetailController personDetailController;
@ManagedProperty(value = "#{centroControlController}")
private CentroControlArmasController centroControlController;
private TcustPersonDetail customerperson;
private TsafeUserDetail userDetail;
private TcustPersonDetail responsableCentroControl= null;
private TsafeUserDetail tsafeUserDetailUsuario = null;
private TarmCentroControl centroControl = new TarmCentroControl();
private List<TgeneCatalogDetail> ltiporeg = null;
private List<TgeneCatalogDetail> lorgcontrol = null;
private String institucionCentroControl="";
private Date fechainicial;
private Date fechafinal;
private String filtro="";
private String filtro2="";
private String idTipoReg;
private Date fec_actual;
private String idOrgControl;
public String getInstitucionCentroControl() {
return institucionCentroControl;
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
this.lrecord = new ArrayList<>();
this.beanalias = "REPORTE";
ltiporeg = CatalogDetailController.find("TIPOREGISTRO", "DECINC");
this.lorgcontrol = CatalogDetailController.find("INSTITUCION");
this.responsableCentroControl = new TcustPersonDetail();
this.tsafeUserDetailUsuario = new TsafeUserDetail();
//this.obtenerResponsableCentroControl();
this.idTipoReg="";
this.idOrgControl="";
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
/**
* 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());
}
@Override
protected void querydatabase() {
}
/**
* Graba los registros en la base de datos
*/
@Override
public void save() {
}
/**
* Obtiene el reporte de Ficha de Armas
*/
public void reporteTramitesCentro() {
try {
if(this.fechainicial.getTime()>this.fechafinal.getTime()){
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_fechafinal"));
return;
}
String gradoUsuario ="";
String path = "armas/reports/reporteDecomiso";
//String filename=MsgControlArmas.getProperty("lbl_tramitesXcentro");
String filename="reporte";
//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
this.fec_actual = new Date();
SimpleDateFormat sdf=new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
parameters.put("fecActual", sdf.format(this.fec_actual));
//usuario
customerperson = PersonDetailController.find(this.tsafeUserDetailUsuario.getPk().getPersoncode().toString());
parameters.put("usuario", customerperson.getName());
//fechas inicial y final que vienen desde el controlador
SimpleDateFormat df=new SimpleDateFormat("dd/MM/yyyy");
parameters.put("fechainicial", df.format(this.fechainicial));
parameters.put("fechafinal", df.format(this.fechafinal));
if(this.idTipoReg.equals("DECO") && this.idTipoReg!=null){
this.filtro = " and d.tipoproceso = '"+this.idTipoReg+"' ";
parameters.put("filtro", this.filtro);
}else if (this.idTipoReg.equals("INCA") && this.idTipoReg!=null) {
this.filtro = " and d.tipoproceso = '"+this.idTipoReg+"' ";
parameters.put("filtro", this.filtro);
}else {
parameters.put("filtro", "");
}
if(this.idOrgControl!=null && !this.idOrgControl.equals("TODOS")){
this.filtro2 = " and cc.institucion = '"+this.idOrgControl+"' ";
parameters.put("filtro2", this.filtro2);
}else {
parameters.put("filtro2", "");
}
String format = "xlsx";
try {
this.reportController.executeXls(path, parameters, format, filename, this.getLoginController());
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
}
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
}
}
public ReportController getReportController() {
return reportController;
}
public void setReportController(ReportController reportController) {
this.reportController = reportController;
}
public TcustPersonDetail getCustomerperson() {
return customerperson;
}
public void setCustomerperson(TcustPersonDetail customerperson) {
this.customerperson = customerperson;
}
public TsafeUserDetail getUserDetail() {
return userDetail;
}
public void setUserDetail(TsafeUserDetail userDetail) {
this.userDetail = userDetail;
}
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 TarmCentroControl getCentroControl() {
return centroControl;
}
public void setCentroControl(TarmCentroControl centroControl) {
this.centroControl = centroControl;
}
public Date getFechainicial() {
return fechainicial;
}
public void setFechainicial(Date fechainicial) {
this.fechainicial = fechainicial;
}
public Date getFechafinal() {
return fechafinal;
}
public void setFechafinal(Date fechafinal) {
this.fechafinal = fechafinal;
}
public String getFiltro() {
return filtro;
}
public void setFiltro(String filtro) {
this.filtro = filtro;
}
public Date getFec_actual() {
return fec_actual;
}
public void setFec_actual(Date fec_actual) {
this.fec_actual = fec_actual;
}
public void setInstitucionCentroControl(String institucionCentroControl) {
this.institucionCentroControl = institucionCentroControl;
}
public String getIdTipoReg() {
return idTipoReg;
}
public void setIdTipoReg(String idTipoReg) {
this.idTipoReg = idTipoReg;
}
public List<TgeneCatalogDetail> getLtiporeg() {
return ltiporeg;
}
public void setLtiporeg(List<TgeneCatalogDetail> ltiporeg) {
this.ltiporeg = ltiporeg;
}
public PersonDetailController getPersonDetailController() {
return personDetailController;
}
public void setPersonDetailController(
PersonDetailController personDetailController) {
this.personDetailController = personDetailController;
}
public CentroControlArmasController getCentroControlController() {
return centroControlController;
}
public void setCentroControlController(
CentroControlArmasController centroControlController) {
this.centroControlController = centroControlController;
}
public List<TgeneCatalogDetail> getLorgcontrol() {
return lorgcontrol;
}
public void setLorgcontrol(List<TgeneCatalogDetail> lorgcontrol) {
this.lorgcontrol = lorgcontrol;
}
public String getIdOrgControl() {
return idOrgControl;
}
public void setIdOrgControl(String idOrgControl) {
this.idOrgControl = idOrgControl;
}
}

View File

@ -0,0 +1,744 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools">
<itemDefinition id="_tasksMetaDataItem" structureRef="java.util.Map" />
<itemDefinition id="_maiaItem" structureRef="java.util.Map" />
<itemDefinition id="_taskMetaDataItem" structureRef="com.fp.simple.dto.TaskInfo" />
<itemDefinition id="_actualTaskItem" structureRef="java.util.List" />
<itemDefinition id="_responseItem" structureRef="String" />
<process processType="Private" isExecutable="true" id="instrumnovacion" name="instrumnovacion" tns:packageName="maia.flows" tns:version="1" >
<extensionElements>
<tns:import name="java.util.List" />
</extensionElements>
<!-- process variables -->
<property id="tasksMetaData" itemSubjectRef="_tasksMetaDataItem"/>
<property id="maia" itemSubjectRef="_maiaItem"/>
<property id="taskMetaData" itemSubjectRef="_taskMetaDataItem"/>
<property id="actualTask" itemSubjectRef="_actualTaskItem"/>
<property id="response" itemSubjectRef="_responseItem"/>
<!-- nodes -->
<startEvent id="_1" name="Start" />
<scriptTask id="_2" name="Preparacion" scriptFormat="http://www.java.com/java" >
<script>actualTask=new java.util.ArrayList();
kcontext.setVariable("actualTask",actualTask);</script>
</scriptTask>
<callActivity id="_3" name="2-Notifica a las partes" calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("17",104, 1,20,"NOTIFPARTES",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("1-Enviar certificado cancelacion");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("1-Enviar certificado cancelacion",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_3_maiaInput" name="maia" />
<dataInput id="_3_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_3_actualTaskOutput" name="actualTask" />
<dataOutput id="_3_maiaOutput" name="maia" />
<dataOutput id="_3_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_3_maiaInput</dataInputRefs>
<dataInputRefs>_3_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_3_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_3_maiaOutput</dataOutputRefs>
<dataOutputRefs>_3_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_3_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_3_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_3_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_3_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_3_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_4" name="6-Envia a Negocios contrato" calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("17",104, 1,20,"ENVNEGCONT",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("4-Realiza escrituracion");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("4-Realiza escrituracion",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_4_maiaInput" name="maia" />
<dataInput id="_4_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_4_actualTaskOutput" name="actualTask" />
<dataOutput id="_4_maiaOutput" name="maia" />
<dataOutput id="_4_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_4_maiaInput</dataInputRefs>
<dataInputRefs>_4_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_4_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_4_maiaOutput</dataOutputRefs>
<dataOutputRefs>_4_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_4_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_4_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_4_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_4_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_4_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_76" name="10-Instrumenta Refinanciacion" calledElement="taskasign" tns:waitForCompletion="false" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("16",110, 1,20,"INSTREFINAN",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("9-Recibe y escanea escritura");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("9-Recibe y escanea escritura",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_76_maiaInput" name="maia" />
<dataInput id="_76_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_76_actualTaskOutput" name="actualTask" />
<dataOutput id="_76_maiaOutput" name="maia" />
<dataOutput id="_76_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_76_maiaInput</dataInputRefs>
<dataInputRefs>_76_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_76_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_76_maiaOutput</dataOutputRefs>
<dataOutputRefs>_76_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_76_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_76_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_76_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_76_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_76_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_77" name="7-Adjunta contrato " calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("16",104, 1,20,"ADJCONT",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("5-Inscribe escritura");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("5-Inscribe escritura",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_77_maiaInput" name="maia" />
<dataInput id="_77_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_77_actualTaskOutput" name="actualTask" />
<dataOutput id="_77_maiaOutput" name="maia" />
<dataOutput id="_77_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_77_maiaInput</dataInputRefs>
<dataInputRefs>_77_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_77_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_77_maiaOutput</dataOutputRefs>
<dataOutputRefs>_77_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_77_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_77_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_77_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_77_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_77_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_10" name="8-Imprimir Tabla" calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("17",104, 1,20,"IMPTABLA",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("7-Recibe escritura para validacion");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("7-Recibe escritura para validacion",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_10_maiaInput" name="maia" />
<dataInput id="_10_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_10_actualTaskOutput" name="actualTask" />
<dataOutput id="_10_maiaOutput" name="maia" />
<dataOutput id="_10_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_10_maiaInput</dataInputRefs>
<dataInputRefs>_10_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_10_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_10_maiaOutput</dataOutputRefs>
<dataOutputRefs>_10_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_10_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_10_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_10_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_10_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_10_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_12" name="9-Coordina firma" calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("17",104, 1,20,"COORDFIRMA",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("8-Envia copia");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("8-Envia copia",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_12_maiaInput" name="maia" />
<dataInput id="_12_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_12_actualTaskOutput" name="actualTask" />
<dataOutput id="_12_maiaOutput" name="maia" />
<dataOutput id="_12_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_12_maiaInput</dataInputRefs>
<dataInputRefs>_12_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_12_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_12_maiaOutput</dataOutputRefs>
<dataOutputRefs>_12_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_12_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_12_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_12_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_12_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_12_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_74" name="4-Crea contrato de mutuo" calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("17",104, 1,20,"CREACONTMUT",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("10-Validar Cond Proyecto");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("10-Validar Cond Proyecto",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_74_maiaInput" name="maia" />
<dataInput id="_74_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_74_actualTaskOutput" name="actualTask" />
<dataOutput id="_74_maiaOutput" name="maia" />
<dataOutput id="_74_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_74_maiaInput</dataInputRefs>
<dataInputRefs>_74_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_74_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_74_maiaOutput</dataOutputRefs>
<dataOutputRefs>_74_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_74_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_74_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_74_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_74_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_74_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_85" name="3-Suspende cobranzas" calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("17",104, 1,20,"SUSPCOBR",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("3-Envia oficio y minuta");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("3-Envia oficio y minuta",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_85_maiaInput" name="maia" />
<dataInput id="_85_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_85_actualTaskOutput" name="actualTask" />
<dataOutput id="_85_maiaOutput" name="maia" />
<dataOutput id="_85_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_85_maiaInput</dataInputRefs>
<dataInputRefs>_85_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_85_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_85_maiaOutput</dataOutputRefs>
<dataOutputRefs>_85_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_85_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_85_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_85_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_85_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_85_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_53" name="11-Instrumenta Reestructuracion" calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("17",104, 1,20,"INSTREESTR",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("11-Escrituras para archivo");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("11-Escrituras para archivo",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_53_maiaInput" name="maia" />
<dataInput id="_53_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_53_actualTaskOutput" name="actualTask" />
<dataOutput id="_53_maiaOutput" name="maia" />
<dataOutput id="_53_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_53_maiaInput</dataInputRefs>
<dataInputRefs>_53_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_53_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_53_maiaOutput</dataOutputRefs>
<dataOutputRefs>_53_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_53_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_53_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_53_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_53_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_53_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<callActivity id="_52" name="5-Coordina sucripcion contrato" calledElement="taskasign" >
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>taskMetaData=FlowUtil.createTaskInfo("17",104, 1,20,"COORDSUSCONT",Kind.OK);
kcontext.setVariable("taskMetaData",taskMetaData);</script>
</tns:onEntry-script>
<tns:onExit-script scriptFormat="http://www.java.com/java">
<script>List old=(List)tasksMetaData.get("2-Recibe documentacion");
if(old!=null){
old.addAll(actualTask);
}else{
old=actualTask;
}
tasksMetaData.put("2-Recibe documentacion",old);</script>
</tns:onExit-script>
</extensionElements>
<ioSpecification>
<dataInput id="_52_maiaInput" name="maia" />
<dataInput id="_52_taskMetaDataInput" name="taskMetaData" />
<dataOutput id="_52_actualTaskOutput" name="actualTask" />
<dataOutput id="_52_maiaOutput" name="maia" />
<dataOutput id="_52_taskMetaDataOutput" name="taskMetaData" />
<inputSet>
<dataInputRefs>_52_maiaInput</dataInputRefs>
<dataInputRefs>_52_taskMetaDataInput</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_52_actualTaskOutput</dataOutputRefs>
<dataOutputRefs>_52_maiaOutput</dataOutputRefs>
<dataOutputRefs>_52_taskMetaDataOutput</dataOutputRefs>
</outputSet>
</ioSpecification>
<dataInputAssociation>
<sourceRef>maia</sourceRef>
<targetRef>_52_maiaInput</targetRef>
</dataInputAssociation>
<dataInputAssociation>
<sourceRef>taskMetaData</sourceRef>
<targetRef>_52_taskMetaDataInput</targetRef>
</dataInputAssociation>
<dataOutputAssociation>
<sourceRef>_52_actualTaskOutput</sourceRef>
<targetRef>actualTask</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_52_maiaOutput</sourceRef>
<targetRef>maia</targetRef>
</dataOutputAssociation>
<dataOutputAssociation>
<sourceRef>_52_taskMetaDataOutput</sourceRef>
<targetRef>taskMetaData</targetRef>
</dataOutputAssociation>
</callActivity>
<exclusiveGateway id="_93" name="Gateway" gatewayDirection="Converging" />
<exclusiveGateway id="_92" name="Gateway" gatewayDirection="Diverging" />
<endEvent id="_89" name="End" >
<terminateEventDefinition/>
</endEvent>
<scriptTask id="_88" name="Finaliza Flujo" scriptFormat="http://www.java.com/java" >
<script>kcontext.setVariable("response","E");</script>
</scriptTask>
<parallelGateway id="_91" name="Gateway" gatewayDirection="Converging" />
<parallelGateway id="_90" name="Gateway" gatewayDirection="Diverging" />
<!-- connections -->
<sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />
<sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />
<sequenceFlow id="_52-_4" sourceRef="_52" targetRef="_4" />
<sequenceFlow id="_92-_76" sourceRef="_92" targetRef="_76" name="Refinanciacion" tns:priority="1" >
<conditionExpression xsi:type="tFormalExpression" language="http://www.jboss.org/drools/rule" >return ((String)maia.get("FINANCIALTYPE")).compareTo("F")==0;
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_4-_77" sourceRef="_4" targetRef="_77" />
<sequenceFlow id="_77-_10" sourceRef="_77" targetRef="_10" />
<sequenceFlow id="_10-_12" sourceRef="_10" targetRef="_12" />
<sequenceFlow id="_90-_74" sourceRef="_90" targetRef="_74" />
<sequenceFlow id="_90-_85" sourceRef="_90" targetRef="_85" />
<sequenceFlow id="_92-_53" sourceRef="_92" targetRef="_53" name="Reestructuracion" tns:priority="1" >
<conditionExpression xsi:type="tFormalExpression" language="http://www.jboss.org/drools/rule" >return ((String)maia.get("FINANCIALTYPE")).compareTo("R")==0;
</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_91-_52" sourceRef="_91" targetRef="_52" />
<sequenceFlow id="_76-_93" sourceRef="_76" targetRef="_93" />
<sequenceFlow id="_53-_93" sourceRef="_53" targetRef="_93" />
<sequenceFlow id="_12-_92" sourceRef="_12" targetRef="_92" />
<sequenceFlow id="_88-_89" sourceRef="_88" targetRef="_89" />
<sequenceFlow id="_93-_88" sourceRef="_93" targetRef="_88" />
<sequenceFlow id="_85-_91" sourceRef="_85" targetRef="_91" />
<sequenceFlow id="_74-_91" sourceRef="_74" targetRef="_91" />
<sequenceFlow id="_3-_90" sourceRef="_3" targetRef="_90" />
</process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="instrumnovacion" >
<bpmndi:BPMNShape bpmnElement="_1" >
<dc:Bounds x="102" y="99" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_2" >
<dc:Bounds x="71" y="28" width="116" height="31" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" >
<dc:Bounds x="231" y="20" width="202" height="49" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" >
<dc:Bounds x="862" y="193" width="177" height="49" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_76" >
<dc:Bounds x="1149" y="191" width="199" height="41" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_77" >
<dc:Bounds x="858" y="114" width="186" height="47" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_10" >
<dc:Bounds x="850" y="25" width="200" height="42" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_12" >
<dc:Bounds x="1156" y="29" width="177" height="40" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_74" >
<dc:Bounds x="638" y="23" width="168" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_85" >
<dc:Bounds x="464" y="117" width="183" height="45" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_53" >
<dc:Bounds x="1389" y="111" width="215" height="45" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_52" >
<dc:Bounds x="623" y="196" width="201" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_93" >
<dc:Bounds x="1473" y="189" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_92" >
<dc:Bounds x="1223" y="110" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_89" >
<dc:Bounds x="1742" y="192" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_88" >
<dc:Bounds x="1573" y="195" width="137" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_91" >
<dc:Bounds x="698" y="111" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_90" >
<dc:Bounds x="532" y="23" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_1-_2" >
<di:waypoint x="126" y="123" />
<di:waypoint x="129" y="43" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_2-_3" >
<di:waypoint x="129" y="43" />
<di:waypoint x="332" y="44" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_52-_4" >
<di:waypoint x="723" y="220" />
<di:waypoint x="950" y="217" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_92-_76" >
<di:waypoint x="1247" y="134" />
<di:waypoint x="1248" y="211" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_4-_77" >
<di:waypoint x="950" y="217" />
<di:waypoint x="951" y="137" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_77-_10" >
<di:waypoint x="951" y="137" />
<di:waypoint x="950" y="46" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_10-_12" >
<di:waypoint x="950" y="46" />
<di:waypoint x="1244" y="49" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_90-_74" >
<di:waypoint x="556" y="47" />
<di:waypoint x="722" y="47" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_90-_85" >
<di:waypoint x="556" y="47" />
<di:waypoint x="555" y="139" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_92-_53" >
<di:waypoint x="1247" y="134" />
<di:waypoint x="1496" y="133" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_91-_52" >
<di:waypoint x="722" y="135" />
<di:waypoint x="723" y="220" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_76-_93" >
<di:waypoint x="1248" y="211" />
<di:waypoint x="1497" y="213" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_53-_93" >
<di:waypoint x="1496" y="133" />
<di:waypoint x="1497" y="213" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_12-_92" >
<di:waypoint x="1244" y="49" />
<di:waypoint x="1247" y="134" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_88-_89" >
<di:waypoint x="1641" y="213" />
<di:waypoint x="1766" y="216" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_93-_88" >
<di:waypoint x="1497" y="213" />
<di:waypoint x="1641" y="213" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_85-_91" >
<di:waypoint x="555" y="139" />
<di:waypoint x="722" y="135" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_74-_91" >
<di:waypoint x="722" y="47" />
<di:waypoint x="722" y="135" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_3-_90" >
<di:waypoint x="332" y="44" />
<di:waypoint x="556" y="47" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@ -0,0 +1,31 @@
package com.fp.frontend.validators;
import java.io.InputStream;
import com.lowagie.text.pdf.AcroFields;
import com.lowagie.text.pdf.PdfReader;
public class DocFirmaValidator {
public static boolean validDocSign(InputStream path) {
boolean validSign = false;
try {
PdfReader reader = new PdfReader(path);
if (reader != null) {
AcroFields af = reader.getAcroFields();
if (af != null) {
if (af.getSignatureNames() != null
&& af.getSignatureNames().size() != 0) {
validSign = true;
}
}
}
} catch (Exception e) {
}
return validSign;
}
}

View File

@ -0,0 +1,111 @@
/**
*
*/
package com.fp.frontend.webservices.snap.modelo;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* Clase xml con los datos del tramite
* @author Manuel Cepeda
*
*/
@XmlRootElement(name="Tramite")
@XmlAccessorType(XmlAccessType.FIELD)
public class TramiteXml implements Serializable {
/**
*
*/
private static final long serialVersionUID = -431606681146448613L;
@XmlElement(name="Tramite")
private String tramite;
@XmlElement(name="FechaEmision")
private String fechaEmision;
@XmlElement(name="FechaExpiracion")
private String fechaExpiracion;
@XmlElement(name="NumeroDocumento")
private String numeroDocumento;
/**
*
*/
public TramiteXml() {
}
public TramiteXml (String fechaEmision,
String fechaExpiracion, String numeroDocumento) {
super();
this.fechaEmision = fechaEmision;
this.fechaExpiracion = fechaExpiracion;
this.numeroDocumento = numeroDocumento;
}
/**
* @return the tramite
*/
public String getTramite() {
return tramite;
}
/**
* @param tramite the tramite to set
*/
public void setTramite(String tramite) {
this.tramite = tramite;
}
/**
* @return the fechaEmision
*/
public String getFechaEmision() {
return fechaEmision;
}
/**
* @param fechaEmision the fechaEmision to set
*/
public void setFechaEmision(String fechaEmision) {
this.fechaEmision = fechaEmision;
}
/**
* @return the fechaExpiracion
*/
public String getFechaExpiracion() {
return fechaExpiracion;
}
/**
* @param fechaExpiracion the fechaExpiracion to set
*/
public void setFechaExpiracion(String fechaExpiracion) {
this.fechaExpiracion = fechaExpiracion;
}
/**
* @return the numeroDocumento
*/
public String getNumeroDocumento() {
return numeroDocumento;
}
/**
* @param numeroDocumento the numeroDocumento to set
*/
public void setNumeroDocumento(String numeroDocumento) {
this.numeroDocumento = numeroDocumento;
}
}

View File

@ -0,0 +1,355 @@
package com.fp.persistence.pgeneral.gene;
import java.io.Serializable;
import java.lang.reflect.Field;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;
import com.fp.dto.hb.HibernateBean;
import com.fp.general.exception.GeneralException;
/** Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENEOFFICE */
@Entity(name = "TgeneOffice")
@Table(name = "TGENEOFFICE")
public class TgeneOffice extends com.fp.dto.AbstractDataTransport implements Serializable, HibernateBean, Cloneable {
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
/**
* Clave primaria de la Entidad TgeneOffice
*/
@EmbeddedId
private TgeneOfficeKey pk;
@Version
@Column(name = "RECORDVERSION", nullable = true)
/**
* Optimistic locking del registro
*/
private Integer recordversion;
@Column(name = "DESCRIPTION", nullable = true)
/**
* Nombre de la oficina
*/
private String description;
@Column(name = "COUNTRYCODE", nullable = true)
/**
* Codigo de pais
*/
private String countrycode;
@Column(name = "PROVINCECODE", nullable = true)
/**
* Codigo de provincia
*/
private String provincecode;
@Column(name = "CITYCODE", nullable = true)
/**
* Codigo de cuidad
*/
private String citycode;
@Column(name = "ADDRESS", nullable = true)
/**
* Dieccion de la oficina.
*/
private String address;
@Column(name = "PHONE", nullable = true)
/**
* Numero de telefono asociado a la oficina.
*/
private String phone;
@Column(name = "CANTONCODE", nullable = true)
/**
* Codigo de canton
*/
private String cantoncode;
/** Contructor por defecto */
public TgeneOffice() {
}
/**
* Contructor de TgeneOffice
*
* @param pPk Clave Primaria del entity
*/
public TgeneOffice(TgeneOfficeKey pPk) {
this();
this.pk = pPk;
}
/**
* Metodo que entrega datos de la tabla dada la clave primaria.
*
* @param pEntityManager referencia de la session a obtener datos del bean.
* @param pKey Caleve primaria del bean.
* @return TgeneOffice
*/
public static TgeneOffice find(EntityManager pEntityManager, TgeneOfficeKey pKey) throws Exception {
TgeneOffice obj = pEntityManager.find(TgeneOffice.class, pKey);
return obj;
}
/**
* Entrega la Clave primaria de TgeneOffice
*
* @return El objeto que referencia a la Clave primaria de TgeneOffice
*/
public TgeneOfficeKey getPk() {
return this.pk;
}
/**
* Fija un nuevo valor a la Clave primaria de TgeneOffice
*
* @param pPk El objeto que referencia a la nueva Clave primaria de TgeneOffice
*/
public void setPk(TgeneOfficeKey pPk) {
this.pk = pPk;
}
/**
* Obtiene el valor de recordversion
*
* @return valor de recordversion
*/
public Integer getRecordversion() {
return this.recordversion;
}
/**
* Fija el valor de recordversion
*
* @param pRecordversion nuevo Valor de recordversion
*/
public void setRecordversion(Integer pRecordversion) {
this.recordversion = pRecordversion;
}
/**
* Obtiene el valor de description
*
* @return valor de description
*/
public String getDescription() {
return this.description;
}
/**
* Fija el valor de description
*
* @param pDescription nuevo Valor de description
*/
public void setDescription(String pDescription) {
this.description = pDescription;
}
/**
* Obtiene el valor de countrycode
*
* @return valor de countrycode
*/
public String getCountrycode() {
return this.countrycode;
}
/**
* Fija el valor de countrycode
*
* @param pCountrycode nuevo Valor de countrycode
*/
public void setCountrycode(String pCountrycode) {
this.countrycode = pCountrycode;
}
/**
* Obtiene el valor de provincecode
*
* @return valor de provincecode
*/
public String getProvincecode() {
return this.provincecode;
}
/**
* Fija el valor de provincecode
*
* @param pProvincecode nuevo Valor de provincecode
*/
public void setProvincecode(String pProvincecode) {
this.provincecode = pProvincecode;
}
/**
* Obtiene el valor de citycode
*
* @return valor de citycode
*/
public String getCitycode() {
return this.citycode;
}
/**
* Fija el valor de citycode
*
* @param pCitycode nuevo Valor de citycode
*/
public void setCitycode(String pCitycode) {
this.citycode = pCitycode;
}
/**
* Obtiene el valor de address
*
* @return valor de address
*/
public String getAddress() {
return this.address;
}
/**
* Fija el valor de address
*
* @param pAddress nuevo Valor de address
*/
public void setAddress(String pAddress) {
this.address = pAddress;
}
/**
* Obtiene el valor de phone
*
* @return valor de phone
*/
public String getPhone() {
return this.phone;
}
/**
* Fija el valor de phone
*
* @param pPhone nuevo Valor de phone
*/
public void setPhone(String pPhone) {
this.phone = pPhone;
}
/**
* Obtiene el valor de cantoncode
*
* @return valor de cantoncode
*/
public String getCantoncode() {
return this.cantoncode;
}
/**
* Fija el valor de cantoncode
*
* @param pCantoncode nuevo Valor de cantoncode
*/
public void setCantoncode(String pCantoncode) {
this.cantoncode = pCantoncode;
}
@Override
public boolean equals(Object rhs) {
if (rhs == null) {
return false;
}
if (!(rhs instanceof TgeneOffice)) {
return false;
}
TgeneOffice that = (TgeneOffice) rhs;
if ((this.getPk() == null) || (that.getPk() == null)) {
return false;
}
return (this.getPk().equals(that.getPk()));
}
/**
* Implementacion del metodo hashCode de la la entidad TgeneOffice
*
* @return el hashCode la instancia
*/
@Override
public int hashCode() {
if (this.hashValue == 0) {
int result = 17;
if (this.getPk() == null) {
result = super.hashCode();
} else {
result = this.getPk().hashCode();
}
this.hashValue = result;
}
return this.hashValue;
}
/** Implementacion toString */
@Override
public String toString() {
Field[] fs = this.getClass().getDeclaredFields();
String data = "";
for (Field f : fs) {
try {
String name = f.getName();
if (f.getType().getName().compareTo("java.util.Set") == 0) {
continue;
}
if ((name.compareTo("hashValue") == 0) || (name.compareTo("serialVersionUID") == 0)) {
continue;
}
data += name + "=" + f.get(this) + ";";
} catch (Exception e) {
continue;
}
}
if (data.compareTo("") == 0) {
data = super.toString();
}
return data;
}
/** Implementacion de la creacion de un bean en blanco TgeneOffice */
@Override
public Object createInstance() {
TgeneOffice instance = new TgeneOffice();
instance.setPk(new TgeneOfficeKey());
return instance;
}
/**
* Clona la entidad TgeneOffice
*
* @see com.fp.dto.hb.HibernateBean#cloneMe()
*/
@Override
public Object cloneMe() throws CloneNotSupportedException {
TgeneOffice p = (TgeneOffice) this.clone();
p.setPk((TgeneOfficeKey) this.pk.cloneMe());
return p;
}
}

View File

@ -0,0 +1,473 @@
package com.fp.general.db;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
import com.fp.common.helper.CalculationBase;
import com.fp.common.helper.Constant;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.cache.CacheManager;
import com.fp.persistence.commondb.helper.APPDates;
import com.fp.persistence.commondb.helper.FormatDates;
import com.fp.persistence.pgeneral.acco.TgeneAccount;
import com.fp.persistence.pgeneral.acco.TgeneAccountStatus;
import com.fp.persistence.pgeneral.acco.TgeneAccountStatusKey;
import com.fp.persistence.pgeneral.auth.TgeneSolicitudeClientdata;
import com.fp.persistence.pgeneral.auth.TgeneSolicitudeExceptions;
import com.fp.persistence.pgeneral.charge.TgeneCharges;
import com.fp.persistence.pgeneral.charge.TgeneSubProductCharges;
import com.fp.persistence.pgeneral.gene.TgeneBranch;
import com.fp.persistence.pgeneral.gene.TgeneSolicitude;
import com.fp.persistence.pgeneral.gene.TgeneSolicitudeRelationship;
import com.fp.persistence.pgeneral.menu.TgeneMenuLevel;
import com.fp.persistence.pgeneral.menu.TgeneMenuLevelDesc;
import com.fp.persistence.pgeneral.menu.TgeneMenuLevelTran;
import com.fp.persistence.pgeneral.menu.TgeneMenuProfile;
import com.fp.persistence.pgeneral.menu.TgeneMenuSubLevel;
import com.fp.persistence.pgeneral.menu.TgeneMenuSubLevelDesc;
import com.fp.persistence.pgeneral.product.TgeneModule;
import com.fp.persistence.pgeneral.product.TgeneProduct;
import com.fp.persistence.pgeneral.product.TgeneSubProduct;
import com.fp.persistence.pgeneral.product.TgeneSubprodClientData;
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
import com.fp.persistence.pgeneral.safe.TsafeUserProfile;
import com.fp.persistence.pgeneral.score.TgenePercentScore;
import com.fp.persistence.pgeneral.score.TgenePercentScoreKey;
import com.fp.persistence.pgeneral.score.TgeneScoreRank;
/**
* Clase utilitaria que maneje sql y hql utiliada en el proyecto general.
*
* @author Jorge Vaca
* @version 2.1
*/
public final class DataHelper {
/** Almacena una instancia de DataHelper. */
private static DataHelper cache;
/**
* Entrega una instancia de DataHelper.
*
* @return DataHelper
*/
public static DataHelper getInstance() {
if (DataHelper.cache != null) {
return DataHelper.cache;
}
synchronized (DataHelper.class) {
if (DataHelper.cache == null) {
DataHelper.cache = new DataHelper();
}
}
return DataHelper.cache;
}
/**
* Metodo que entrega datos de una sucursal definidos en TgeneBranch.
*
* @param pBranch Codigo de sucursal.
* @param pCompany Compania a la que pertenece la cuenta.
* @return TgeneBranch
* @throws Exception
*/
public TgeneBranch getTgeneBranch(Integer pBranch, Integer pCompany) throws Exception {
return TgeneBranch.find(PersistenceHelper.getEntityManager(), pBranch, pCompany);
}
/**
* Metodo que entrega datos de TgeneMenuProfile.
*
* @param pProfile Codigo de perfil del usuario.
* @return TgeneMenuProfile
* @throws Exception
*/
public TgeneMenuProfile getTgeneMenuProfile(String pProfile) throws Exception {
return TgeneMenuProfile.findByCodePerfilUsuario(PersistenceHelper.getEntityManager(), pProfile);
}
/**
* Metodo que entrega descripcion del primer nivel del menu.
*
* @param pmenucode Codigo de menu.
* @param pLevel Codigo de nivel.
* @param planguagecode Codigo de lenguaje del usuario.
* @return TgeneMenuLevelDesc
* @throws Exception
*/
public TgeneMenuLevelDesc getTgeneMenuLevelDesc(Integer pmenucode, Integer pLevel, String planguagecode) throws Exception {
return TgeneMenuLevelDesc.find(PersistenceHelper.getEntityManager(), pmenucode, pLevel, planguagecode);
}
/**
* Metodo que entrega la definicion del primer nivel del menu.
*
* @param pMenucode Codigo de menu.
* @return List<TgeneMenuLevel>
* @throws Exception
*/
public List<TgeneMenuLevel> getTgeneMenuLevel(Integer pMenucode) throws Exception {
return TgeneMenuLevel.findByMenuCode(PersistenceHelper.getEntityManager(), pMenucode);
}
/**
* Metodo que entrega uns lista de definicion del menu de segundo nivel.
*
* @param pMenucode Codigo de menu.
* @param pLevel Codigo del primer nivel.
* @return List<TgeneMenuSubLevel>
* @throws Exception
*/
public List<TgeneMenuSubLevel> getTgeneMenuSuLevels(Integer pMenucode, Integer pLevel) throws Exception {
return TgeneMenuSubLevel.find(PersistenceHelper.getEntityManager(), pMenucode, pLevel);
}
/**
* Metodo que emtrega la descripcion de un subnivel del menu.
*
* @param pmenucode Codigo de menu.
* @param pLevel Codigo de nivel de menu.
* @param pSublevel Codigo de subnivel de menu.
* @param planguagecode Codigo de lenguaje.
* @return TgeneMenuSubLevelDesc
* @throws Exception
*/
public TgeneMenuSubLevelDesc getTgeneMenuSubLevelDesc(Integer pmenucode, Integer pLevel, Integer pSublevel, String planguagecode)
throws Exception {
return TgeneMenuSubLevelDesc.find(PersistenceHelper.getEntityManager(), pmenucode, pLevel, pSublevel, planguagecode);
}
/**
* Metodo que entrega transacciones asociadas al codigo de menu y codigo de nivel.
*
* @param pMenucode Codigo de menu.
* @param pLevel Codigo de Nivel.
* @return List<TgeneMenuLevelTran>
* @throws Exception
*/
public List<TgeneMenuLevelTran> getTgeneMenuLevelTran(Integer pMenucode, Integer pLevel) throws Exception {
return TgeneMenuLevelTran.findByCodeMenuNivel(PersistenceHelper.getEntityManager(), pMenucode, pLevel);
}
/**
* Metodo que obtiene datos del perfil del usuario.
*
* @param pusercode Codigo de usuario.
* @return TsafeUserProfile
* @throws Exception
*/
public List<TsafeUserProfile> getTsafeUserProfile(String pusercode) throws Exception {
return TsafeUserProfile.find(PersistenceHelper.getEntityManager(), pusercode);
}
/**
* Metodo que obtiene datos de un registro del modulo.
*
* @param pModulecode Codigo de modulo a obtener datos de la base.
* @return TgeneModule
* @throws Exception
*/
public TgeneModule getTgeneModule(String pModulecode) throws Exception {
return TgeneModule.find(PersistenceHelper.getEntityManager(), pModulecode);
}
/**
* Metodo que obtiene datos de un registro del producto.
*
* @param pModulecode Codigo de modulo a obtener datos de la base.
* @param pProductcode Codigo de producto a obtener datos de la base.
* @return TgeneProduct
* @throws Exception
*/
public TgeneProduct getTgeneProduct(String pModulecode, String pProductcode) throws Exception {
return TgeneProduct.find(PersistenceHelper.getEntityManager(), pModulecode, pProductcode);
}
/**
* Metodo que obtiene datos de un registro del subproducto.
*
* @param pModulecode Codigo de modulo a obtener datos de la base.
* @param pProductcode Codigo de producto a obtener datos de la base.
* @param pSubproductcode Codigo de subproducto a obtener datos de la base.
* @return TgeneSubProduct
* @throws Exception
*/
public TgeneSubProduct getTgeneSubProduct(String pModulecode, String pProductcode, String pSubproductcode) throws Exception {
return TgeneSubProduct.find(PersistenceHelper.getEntityManager(), pModulecode, pProductcode, pSubproductcode);
}
/**
* Metodo que devuelve un registro de la tabla TGENEACCOUNT
*
* @param account Numero de la cuenta
* @param company Compania a la que pertenece la cuenta
* @param dateto Fecha de vigencia de la tarjeta
* @return
*/
public TgeneAccount getTgeneAccount(String account, Integer company, Timestamp dateto) throws Exception {
return TgeneAccount.findByFechaVigenciaTarjeta(PersistenceHelper.getEntityManager(), account, company, dateto);
}
/**
* Entrega una lista de excepciones de solicitud.
*
* @param pSolicitudenumber Numero de solicitud.
* @param pSolicitudesequence Secuencia interna de la solicitud.
* @return List<TgeneSolicitudeExceptions>
* @throws Exception
*/
public List<TgeneSolicitudeExceptions> getTgeneSolicitudeExceptions(String pSolicitudenumber, Integer pSolicitudesequence) throws Exception {
return TgeneSolicitudeExceptions.findBySolicitudeNumber(PersistenceHelper.getEntityManager(), pSolicitudenumber, pSolicitudesequence);
}
/**
* Metodo que entrega una lista de datos requeridos de clientes por producto.
*
* @param pModuleCode Codigo de modulo.
* @param pProductCode Codigo de producto.
* @param pSubproductCode Codigo de subproducto.
* @param pPersontype Tipo de persona.
* @return List<TgeneSubprodClientData>
* @throws Exception
*/
public List<TgeneSubprodClientData> getTgeneSubprodClientData(String pModuleCode, String pProductCode, String pSubproductCode,
String pPersontype, String pRelationshipcode) throws Exception {
return TgeneSubprodClientData.findByProduct(PersistenceHelper.getEntityManager(), pModuleCode, pProductCode, pSubproductCode, pPersontype,
pRelationshipcode);
}
/**
* Metodo que entrega una lista de datos activos requeridos de clientes por producto.
*
* @param pModuleCode Codigo de modulo.
* @param pProductCode Codigo de producto.
* @param pSubproductCode Codigo de subproducto.
* @param pPersontype Tipo de persona.
* @return List<TgeneSubprodClientData>
* @throws Exception
*/
public List<TgeneSubprodClientData> getTgeneSubprodClientDataActive(String pModuleCode, String pProductCode, String pSubproductCode,
String pPersontype, String pRelationshipcode) throws Exception {
return TgeneSubprodClientData.findByProductActive(PersistenceHelper.getEntityManager(), pModuleCode, pProductCode, pSubproductCode,
pPersontype, pRelationshipcode);
}
/**
* Entrega una lista de clientes relacionados a la solicitud.
*
* @param pSolicitudenumber Numero de solicitud.
* @param pSolicitudesequence Secuencia interna de la solicitud.
* @return List<TgeneSolicitudeRelationship>
* @throws Exception
*/
public List<TgeneSolicitudeRelationship> getTgeneSolicitudeRelationship(String pSolicitudenumber, Integer pSolicitudesequence) throws Exception {
return TgeneSolicitudeRelationship.findBySolicitudeNumber(PersistenceHelper.getEntityManager(), pSolicitudenumber, pSolicitudesequence);
}
/**
* Metodo que devuelve un objeto de tipo TgeneSolicitudeClientdata
*
* @param solicitudnumber
* @param solicitudsequence
* @param title
* @param personcode
* @return
* @throws Exception
*/
public TgeneSolicitudeClientdata getTgeneSolicitudeClientdata(String solicitudnumber, Integer solicitudsequence, String title, Integer personcode)
throws Exception {
return TgeneSolicitudeClientdata.find(PersistenceHelper.getEntityManager(), solicitudnumber, solicitudsequence, title, personcode);
}
/**
* Metodo que devuelve un objeto de tipo TgeneSolicitude
*
* @param solicitudnumber
* @param solicitudsequence
* @return
* @throws Exception
*/
public TgeneSolicitude getTgeneSolicitude(String solicitudnumber, Integer solicitudsequence) throws Exception {
return TgeneSolicitude.find(PersistenceHelper.getEntityManager(), solicitudnumber, solicitudsequence);
}
/**
* Metodo que devuelve un objeto de tipo TgeneSubprodClientData
*
* @param modulecode
* @param productcode
* @param subproductcode
* @param persontype
* @param relationshipcode
* @param title
* @return
* @throws Exception
*/
public TgeneSubprodClientData getTgeneSubprodClientData(String modulecode, String productcode, String subproductcode, String persontype,
String relationshipcode, String title) throws Exception {
return TgeneSubprodClientData.find(PersistenceHelper.getEntityManager(), modulecode, productcode, subproductcode, persontype,
relationshipcode, title);
}
/**
* Metodo que obtiene datos de un registro del subproducto.
*
* @param pModulecode Codigo de modulo a obtener datos de la base.
* @param pProductcode Codigo de producto a obtener datos de la base.
* @param pSubproductcode Codigo de subproducto a obtener datos de la base.
* @return TgeneSubProduct
* @throws Exception
*/
public TsafeUserDetail getTsafeUserDetail(String usercode) throws Exception {
return TsafeUserDetail.findByUserCode(PersistenceHelper.getEntityManager(), usercode);
}
/**
* Entrega un objeto con la calificacion a asociar a un prestamo, dado el tipo de credito, estatus operativo y el
* numero de dias de vencida una operacion.
*
* @param pCreditType Codigo de tipo de credito Consumo, Comercial.
* @param pOperationStatus Cordo de estatus de operacion, Original, restructurada
* @param pModuleCode Modulo al que pertenece el estado operativo.
* @param processdate Fecha en la cual se realiza la calificacion.
* @param expirationdate Fecha desde la cual esta vencido el credito.
* @return TgeneScoreRank
* @throws Exception
*/
public TgeneScoreRank getTgeneScoreRank(String pCreditType, String pOperationStatus, String pModuleCode, Date processdate, Date expirationdate)
throws Exception {
APPDates datefrom = null;
APPDates dateto = null;
int days = 0; // Si la fvencimiento esta en el futuro, indica que el prestamo tiene la mejor calificacion.
if (processdate.compareTo(expirationdate) >= 0) {
dateto = new APPDates(processdate);
datefrom = new APPDates(expirationdate);
dateto.setBase(CalculationBase.B365365);
days = dateto.substract(datefrom);
}
TgeneScoreRank obj = null;
List<TgeneScoreRank> ldata = this.getTgeneScoreRank(pCreditType, pOperationStatus, pModuleCode);
if ((ldata == null) || ldata.isEmpty()) {
return obj;
}
obj = ldata.get(0);
for (TgeneScoreRank object : ldata) {
if ((days >= object.getDaysfrom()) && (days <= object.getDaysto())) {
obj = object;
break;
}
}
return obj;
}
/**
* Entrega una lista con la calificacion a asociar a un prestamo, dado el tipo de credito, estatus operativo y el
* numero de dias de vencida una operacion.
*
* @param pCreditType Codigo de tipo de credito Consumo, Comercial.
* @param pOperationStatus Cordo de estatus de operacion, Original, restructurada
* @param pModuleCode Modulo al que pertenece el estado operativo.
* @return List<TgeneScoreRank>
* @throws Exception
*/
@SuppressWarnings("unchecked")
public List<TgeneScoreRank> getTgeneScoreRank(String pCreditType, String pOperationStatus, String pModuleCode) throws Exception {
List<TgeneScoreRank> ldata = null;
String key = pCreditType + pOperationStatus + pModuleCode;
CacheManager cm = CacheManager.getInstance();
ldata = (List<TgeneScoreRank>) cm.getData("TgeneScoreRank", key);
if (ldata == null) {
Map<String, Object> mTgeneScoreRank = cm.getMapDefinition("TgeneScoreRank");
ldata = TgeneScoreRank.find(PersistenceHelper.getEntityManager(), pCreditType, pOperationStatus, pModuleCode);
mTgeneScoreRank.put(key, ldata);
cm.putData("TgeneScoreRank", mTgeneScoreRank);
}
return ldata;
}
/**
* Entrega un objeto con el porcentaje de provision de acuerdo a la calificacion tipo de credito.
*
* @param pScoreScode Codigo de calificacion de cartera. A,B,C,D
* @param pCreditType Codigo de tipo de credito, Consumo, COmercial.
* @return TgenePercentScore
* @throws Exception
*/
public TgenePercentScore getTgenePercentScore(String pScoreScode, String pCreditType) throws Exception {
TgenePercentScore obj = null;
String key = pScoreScode + pCreditType;
CacheManager cm = CacheManager.getInstance();
obj = (TgenePercentScore) cm.getData("TgenePercentScore", key);
if (obj == null) {
Map<String, Object> mTgenePercentScore = cm.getMapDefinition("TgenePercentScore");
TgenePercentScoreKey k = new TgenePercentScoreKey(pScoreScode, pCreditType, FormatDates.getDefaultExpiryTimestamp());
obj = TgenePercentScore.find(PersistenceHelper.getEntityManager(), k);
mTgenePercentScore.put(key, obj);
cm.putData("TgenePercentScore", mTgenePercentScore);
}
return obj;
}
/**
* Entrega una lista de cargos por subproducto.
*
* @param pSolicitudenumber Numero de solicitud.
* @param pSolicitudesequence Secuencia interna de la solicitud.
* @return List<TgeneSolicitudeRelationship>
* @throws Exception
*/
public List<TgeneSubProductCharges> getTgeneSubProductChargesByCompany(Integer pCompany) throws Exception {
return TgeneSubProductCharges.findByCompany(PersistenceHelper.getEntityManager(), pCompany);
}
/**
* Entrega una lista de cargos por modulo.
*
* @param pModuleCode
* @return
* @throws Exception
*/
public List<TgeneSubProductCharges> getTgeneSubProductChargesByModule(String pModuleCode) throws Exception {
return TgeneSubProductCharges.findByModule(PersistenceHelper.getEntityManager(), pModuleCode);
}
/**
* Entrega una lista de cargos por modulo.
*
* @param pModuleCode
* @return
* @throws Exception
*/
public List<TgeneCharges> getTgeneChargesByModule(String pModuleCode) throws Exception {
return TgeneCharges.findByModule(PersistenceHelper.getEntityManager(), pModuleCode);
}
/**
* Metodo que entrega la descripcion del status de una garantia
*
* @param pModuleCode
* @param pStatuscode
* @return
* @throws Exception
*/
public TgeneAccountStatus getTgeneAccountStatus(String pModuleCode, String pStatuscode) throws Exception {
TgeneAccountStatus obj = null;
String key = pModuleCode + Constant.SEPARATOR + pStatuscode;
CacheManager cm = CacheManager.getInstance();
obj = (TgeneAccountStatus) cm.getData("TgeneAccountStatus", key);
if (obj == null) {
Map<String, Object> mTgeneAccountStatus = cm.getMapDefinition("TgeneAccountStatus");
TgeneAccountStatusKey keyp = new TgeneAccountStatusKey(pModuleCode, pStatuscode);
obj = TgeneAccountStatus.find(PersistenceHelper.getEntityManager(), keyp);
mTgeneAccountStatus.put(key, obj);
cm.putData("TgeneAccountStatus", (Object) mTgeneAccountStatus);
}
return obj;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
var Validator = {
catchCtrlCVX: function (e) {
if(e.ctrlKey==true && e.charCode==99)
return true;
if(e.ctrlKey==true && e.charCode==118)
return true;
if(e.ctrlKey==true && e.charCode==120)
return true;
},
validateInputNumber: function(e) {
if (this.catchCtrlCVX(e)){
return true;
}
k = (document.all) ? e.keyCode : e.which;
if (k == 8) return true;
if(k >= 96 && k<= 105){
return true;
}
var patron = /\d/;
var te = String.fromCharCode(k);
return patron.test(te);
}
};

View File

@ -0,0 +1,164 @@
package com.fp.frontend.controller.security.reports;
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 com.fp.dto.AbstractDataTransport;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.ReportController;
import com.fp.frontend.controller.security.LoginController;
import com.fp.frontend.controller.security.ProfileController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.pgeneral.safe.TsafeProfile;
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
/**
* Clase controladora de ipresion de usuarios.
*
* @author Jorge Vaca.
* @version 2.1
*/
@SuppressWarnings("serial")
@ManagedBean
@ViewScoped
public class ReportUserController extends AbstractController<AbstractDataTransport> {
@ManagedProperty(value = "#{reportController}")
private ReportController reportController;
private List<TsafeProfile> lsafeprofile;
@ManagedProperty(value = "#{logincontroller}")
private LoginController logincontroller;
private TsafeUserDetail tsafeUserDetailUsuario = null;
public ReportUserController() throws Exception {
super(AbstractDataTransport.class);
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
//super.startQuery();
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
/*this.recperpage = 15; // Cambiar al # reg a mirar.
this.lrecord = new ArrayList<>();
this.beanalias = "CATALOGDETAIL";*/
this.beanalias = "REPORTE";
this.lsafeprofile = ProfileController.find();
this.tsafeUserDetailUsuario = new TsafeUserDetail();
this.tsafeUserDetailUsuario = (TsafeUserDetail) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
@Override
protected void querydatabase() {
}
/**
* Ejecuta un reporte de usuarios.
*/
public void reportuser() {
//String path = "security/reports/user";
String path = "security/reports/usuarios";
HashMap<String, Object> parameters = new HashMap<>();
parameters.put("pathLogoIzquierda", "repo:/maia/1/image/comandoconjunto");
parameters.put("pathLogoDerecha", "repo:/maia/1/image/selloarmas");
//String format = "pdf";
String format = "xls";
String filename = "usuarios";
try {
this.reportController.executeXls(path, parameters, format, filename, this.getLoginController());
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
}
}
/**
* Ejecuta un reporte de usuarios.
*/
public void reportuserperprofile() {
String path = "security/reports/userperprofile";
//String path = "security/reports/user";
HashMap<String, Object> parameters = new HashMap<>();
parameters.put("pathLogoIzquierda", "repo:/maia/1/image/comandoconjunto");
parameters.put("pathLogoDerecha", "repo:/maia/1/image/selloarmas");
//parameters.put("cmoneda", "USD");
//String format = "pdf";
String format = "xls";
String filename = "usuariosporperfil";
try {
this.reportController.executeXls(path, parameters, format, filename, this.getLoginController());
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
}
}
/**
* Ejecuta un reporte de usuarios.
*/
public void reporttransactionperprofile() {
String path = "security/reports/transactionsperprofile";
HashMap<String, Object> parameters = new HashMap<>();
//parameters.put("cmoneda", "USD");
String format = "pdf";
String filename = "transaccionesporperfil";
try {
this.reportController.execute(path, parameters, format, filename, this.getLoginController());
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
}
}
/**
* Entrega el valor de: reportController
* @return ReportController
*/
public ReportController getReportController() {
return this.reportController;
}
/**
* Fija el valor de: reportController
* @param reportController Valor a fijar en el atributo.
*/
public void setReportController(ReportController reportController) {
this.reportController = reportController;
}
public List<TsafeProfile> getLsafeprofile() {
return lsafeprofile;
}
public void setLsafeprofile(List<TsafeProfile> lsafeprofile) {
this.lsafeprofile = lsafeprofile;
}
public LoginController getLogincontroller() {
return logincontroller;
}
public void setLogincontroller(LoginController logincontroller) {
this.logincontroller = logincontroller;
}
}

View File

@ -0,0 +1,184 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{userPerfilAssiggnationController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:filters,:formTable:data-content,:formTable:data-content-profile"
saveProcess=":formTable:data-content, :formTable:data-content-profile"
saveUpdate=":formTable"
focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="3" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpkuser" value="#{msg_customer.lbl_personcode}:" />
<p:inputText id="fpkuser" value="#{userPerfilAssiggnationController.userdetail.mfilters['pk.personcode']}" style="width: 160px;" onkeyup="Maia.forceupper(event, this);" onchange="jsUser()" disabled="true"/>
<p:spacer/>
<p:outputLabel for="fname" value="#{msg_customer.lbl_person}:" />
<p:inputText id="fname" value="#{userPerfilAssiggnationController.userdetail.mfilelds['personname']}" style="width: 400px;" disabled="true" />
<p:commandButton icon="ui-icon-link" actionListener="#{userPerfilAssiggnationController.userdetail.openPersonLov()}" process="@this" styleClass="m-lov-button">
<p:ajax event="dialogReturn" listener="#{userPerfilAssiggnationController.onReturnPersonLov}" update="filters,data-content,data-content-profile" />
</p:commandButton>
</p:panelGrid>
<p:remoteCommand name="jsUser" actionListener="#{userPerfilAssiggnationController.query()}" update="filters,data-content" process="@this, filters"/>
<h:panelGrid columns="2" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{userPerfilAssiggnationController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:filters :formTable:data-content :formTable:data-content-profile"
saveProcess=":formTable:data-content"
saveUpdate=":formTable"
showNextBtn="false" showPreviousBtn="false" showCreateBtn="false" />
</h:panelGrid>
<h:panelGrid id="data-content" columns="6" >
<p:outputLabel for="fpkuserc" value="#{msg_customer.lbl_usercode}:" />
<pe:keyFilter mask="int" for="fpkuser"/>
<p:inputText id="fpkuserc" value="#{userPerfilAssiggnationController.userdetail.record.pk.usercode}" maxlength="20" style="width:300px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel value="" />
<p:outputLabel value="" />
<p:message for="fpkuserc"/>
<p:outputLabel for="flanguage" value="#{msg_customer.lbl_language}:" />
<pe:keyFilter />
<p:selectOneMenu id="flanguage" value="#{userPerfilAssiggnationController.userdetail.record.languagecode}"
style="width:300px" panelStyle="width:300px"
required="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{userPerfilAssiggnationController.lLanguage}" var="vcha"
itemLabel="#{vcha.description}" itemValue="#{vcha.pk}" />
</p:selectOneMenu>
<p:outputLabel value="" />
<p:outputLabel value="" />
<p:message for="flanguage" />
<p:outputLabel for="fnick" value="#{msg_customer.lbl_nickname}:" />
<pe:keyFilter mask="alpha" for="fnick"/>
<p:inputText id="fnick" value="#{userPerfilAssiggnationController.userdetail.record.nickname}" maxlength="30" style="width:300px;" required="true" onkeyup="Maia.forceupper(event, this);"/>
<p:message for="fnick" />
<p:outputLabel value="" />
<p:message for="fnick"/>
<p:outputLabel for="channel" value="#{msg_customer.lbl_channel}:" />
<pe:keyFilter />
<p:selectOneMenu id="channel" value="#{userPerfilAssiggnationController.userdetail.record.channelcode}"
style="width:300px" panelStyle="width:300px"
required="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{userPerfilAssiggnationController.lChannel}" var="vcha"
itemLabel="#{vcha.description}" itemValue="#{vcha.pk}" />
</p:selectOneMenu>
<p:outputLabel value="" />
<p:outputLabel value="" />
<p:message for="channel" />
<p:outputLabel for="branch" value="#{msg_customer.lbl_branch}:" />
<pe:keyFilter />
<p:selectOneMenu id="branch" value="#{userPerfilAssiggnationController.userdetail.record.branchcode}"
style="width:300px" panelStyle="width:300px"
required="true">
<f:selectItem itemLabel="" itemValue="" />
<p:ajax listener="#{userPerfilAssiggnationController.loadOffice()}" update="office" event="change"/>
<f:selectItems value="#{userPerfilAssiggnationController.lBranch}" var="vbra"
itemLabel="#{vbra.description}" itemValue="#{vbra.pk.branchcode}" />
</p:selectOneMenu>
<p:outputLabel value="" />
<p:outputLabel value="" />
<p:message for="branch" />
<p:outputLabel for="office" value="#{msg_customer.lbl_office}:" />
<pe:keyFilter />
<p:selectOneMenu id="office" value="#{userPerfilAssiggnationController.userdetail.record.officecode}"
style="width:300px" panelStyle="width:300px"
required="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{userPerfilAssiggnationController.lOffice}" var="vof"
itemLabel="#{vof.description}" itemValue="#{vof.pk.officecode}" />
</p:selectOneMenu>
<p:outputLabel value="" />
<p:outputLabel value="" />
<p:message for="office" />
<p:outputLabel for="area" value="#{msg_customer.lbl_area}:" />
<pe:keyFilter />
<p:selectOneMenu id="area" value="#{userPerfilAssiggnationController.userdetail.record.areacode}"
style="width:300px" panelStyle="width:300px"
required="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{userPerfilAssiggnationController.lArea}" var="varea"
itemLabel="#{varea.descripction}" itemValue="#{varea.pk.areacode}" />
</p:selectOneMenu>
<p:outputLabel value="" />
<p:outputLabel value="" />
<p:message for="area" />
<p:outputLabel for="bpmuser"
value="#{msg_customer.lbl_BPMuser}:" />
<pe:keyFilter />
<p:selectOneMenu id="bpmuser"
value="#{userPerfilAssiggnationController.userdetail.record.isuserbpm}"
effect="fade" style="width:80px">
<f:selectItem itemLabel="NO" itemValue="N" />
<f:selectItem itemLabel="SI" itemValue="Y" />
</p:selectOneMenu>
<p:outputLabel value="" />
<p:outputLabel value=""/>
<p:message for="bpmuser" />
<p:outputLabel for="bterminal"
value="#{msg_customer.lbl_branchterminal}:" />
<pe:keyFilter />
<p:selectOneMenu id="bterminal"
value="#{userPerfilAssiggnationController.userdetail.record.branchfromterminal}"
effect="fade" style="width:80px">
<f:selectItem itemLabel="NO" itemValue="N" />
<f:selectItem itemLabel="SI" itemValue="Y" />
</p:selectOneMenu>
<p:outputLabel value="" />
<p:outputLabel value=""/>
<p:message for="bterminal" />
</h:panelGrid>
<p:panelGrid id="data-content-profile" columns="1" styleClass="m-data-content">
<p:commandButton id="btncreate" value="#{msg_general.btn_create}" actionListener="#{userPerfilAssiggnationController.openProfileLov()}" process="@this, data-content" >
<p:ajax event="dialogReturn" listener="#{userPerfilAssiggnationController.onReturnProfileLov}" update="profilecode" oncomplete="Maia.focus(':formTable:btncreate');" />
</p:commandButton>
<f:facet name="header">
<h:outputText value="#{msg_customer.htbl_profile}" />
</f:facet>
<p:dataTable id="profilecode" var="row" value="#{userPerfilAssiggnationController.userProfile.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_general.lbl_code}" resizable="true" style="width:150px" sortBy="#{row.pk.profilecode}">
<h:outputText value="#{row.pk.profilecode}" />
</p:column>
<p:column headerText="#{msg_general.lbl_description}" resizable="true" sortBy="#{row.ingressuser}">
<h:outputText value="#{row.modifiedData['profiledesc']}" />
</p:column>
<p:column>
<p:commandButton value="#{msg_general.btn_delete}" update=":formTable:profilecode" styleClass="m-action-button" icon="ui-icon-trash" action="#{userPerfilAssiggnationController.userProfile.remove()}" process="@this, profilecode">
<f:setPropertyActionListener target="#{userPerfilAssiggnationController.userProfile.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,65 @@
<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents"
template="/WEB-INF/templates/template.xhtml">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{notifyController}"
queryProcess=""
queryUpdate=""
saveProcess=":formTable:data-content"
saveUpdate=":formTable:data-content"
focusContainer=":formTable:data-content" />
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{notifyController}"
queryProcess=""
queryUpdate=""
saveProcess=":formTable:data-content"
saveUpdate=":formTable:data-content"
showCreateBtn="false" showPreviousBtn="false" showNextBtn="false" showQueryBtn="false"
dialogWidgetVar="dialog" />
</h:panelGrid>
<h:panelGrid id="data-content" columns="3" >
<p:outputLabel for="processcode" value="#{msg_bpm.lbl_process}:" />
<p:inputText id="processcode" value="#{notifyController.record.processcode}" required="true" maxlength="30" style="width:250px;" onkeyup="Maia.forceupper(event, this);"/>
<p:message for="processcode" />
<p:outputLabel for="notifyto" value="#{msg_bpm.lbl_notifyto}:" />
<p:selectOneMenu id="notifyto" value="#{notifyController.record.notifytocatalog}" style="width:250px" required="true">
<f:selectItem itemLabel="" itemValue="#{null}" />
<f:selectItems value="#{notifyController.lcatalog}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.catalog}" />
</p:selectOneMenu>
<p:message for="notifyto" />
<p:outputLabel for="notifytask" value="#{msg_bpm.lbl_task}:" />
<p:inputTextarea id="notifytask" value="#{notifyController.record.notifytask}" rows="2" cols="60" required="true" maxlength="300" onkeyup="Maia.forceupper(event, this);"/>
<p:message for="notifytask" />
<p:outputLabel for="comments" value="#{msg_bpm.lbl_observations}:" />
<p:inputTextarea id="comments" value="#{notifyController.record.comments}" rows="2" cols="60" required="true" maxlength="300" onkeyup="Maia.forceupper(event, this);"/>
<p:message for="comments" />
<p:outputLabel for="resolution" value="#{msg_bpm.lbl_resolution}:" />
<p:inputText id="resolution" value="#{notifyController.record.resolution}" style="width:160px;" onkeyup="Maia.forceupper(event, this);" maxlength="60"/>
<p:message for="resolution" />
<p:outputLabel for="registerdate" value="#{msg_bpm.lbl_registerdate}:" />
<p:inputText id="registerdate" value="#{notifyController.record.registerdate}" disabled="true" style="width:160px;"/>
<p:message for="registerdate" />
<p:outputLabel for="userwhoreg" value="#{msg_bpm.lbl_user}:" />
<p:inputText id="userwhoreg" value="#{notifyController.record.userwhoreg}" disabled="true" style="width:160px;" />
<p:message for="userwhoreg" />
</h:panelGrid>
</h:form>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mule-configuration xmlns="http://www.mulesoft.com/tooling/messageflow" name="centralwebservices-1">
<flow SubFlow="false" name="centralwebservices-1Flow1" type="http://www.mulesoft.org/schema/mule/core/flow" entity-id="2f3400d2-9cfd-4c79-a8a5-a36fd2650db0">
<properties>
<property name="initialState"/>
<property name="processingStrategy2"/>
<property name="processingStrategy"/>
<property name="bussinessEventsLabel"/>
<property name="tracking:enable-default-events"/>
<property name="auxiliary;index" value="1"/>
</properties>
<lane hadOnlyOneElement="false" index="0" isChoiceOtherwiseLane="false" entity-id="compartment-lane#1">
<graphicalData x="0" y="0" width="0" height="0"/>
<endpoint direction="Inbound" name="HTTP" type="http://www.mulesoft.org/schema/mule/http/endpoint" entity-id="HTTP#1">
<graphicalData x="0" y="0" width="0" height="0"/>
<properties>
<property name="port"/>
<property name="host"/>
<property name="businessEventsLabel"/>
<property name="followRedirects"/>
<property name="org.mule.tooling.ui.modules.core.widgets.meta.ModeAttribute" value="http://www.mulesoft.org/schema/mule/http/endpoint"/>
<property name="keepAlive"/>
<property name="contentType"/>
<property name="disableTransportTransformer"/>
<property name="password"/>
<property name="exchange-pattern" value="request-response"/>
<property name="tracking:enable-default-events"/>
<property name="ref"/>
<property name="transformer-refs"/>
<property name="httpLabel"/>
<property name="address" value="http://172.17.26.182:8085/armasSerieProxy"/>
<property name="path"/>
<property name="encoding"/>
<property name="responseTransformer-refs"/>
<property name="method"/>
<property name="user"/>
<property name="auxiliary;index" value="2"/>
<property name="responseTimeout"/>
<property name="mimeType"/>
<property name="connector-ref"/>
</properties>
</endpoint>
<pattern name="Proxy servicio armas" type="http://www.mulesoft.org/schema/mule/cxf/soapComponent" entity-id="CXF#1">
<graphicalData x="0" y="0" width="0" height="0"/>
<properties>
<property name="port"/>
<property name="wsdlLocation" value="http://172.17.26.183:8080/frontend/ArmaServiceImpl?wsdl"/>
<property name="serviceClass"/>
<property name="org.mule.tooling.ui.modules.core.widgets.meta.ModeAttribute" value="http://www.mulesoft.org/schema/mule/cxf/proxy-service"/>
<property name="payload" value="body"/>
<property name="configuration-ref"/>
<property name="namespace" value="http://impl.webservices.frontend.fp.com/"/>
<property name="validationEnabled"/>
<property name="bindingId"/>
<property name="onException"/>
<property name="service" value="ArmaServiceImplService"/>
<property name="mtomEnabled"/>
<property name="soapVersion"/>
<property name="enableMuleSoapHeaders"/>
<property name="auxiliary;index" value="3"/>
</properties>
</pattern>
<pattern name="Proxy cliente servicio armas" type="http://www.mulesoft.org/schema/mule/cxf/soapComponent" entity-id="CXF#2">
<graphicalData x="0" y="0" width="0" height="0"/>
<properties>
<property name="wsdlLocation"/>
<property name="port"/>
<property name="serviceClass"/>
<property name="operation"/>
<property name="org.mule.tooling.ui.modules.core.widgets.meta.ModeAttribute" value="http://www.mulesoft.org/schema/mule/cxf/proxy-client"/>
<property name="mtomEnabled"/>
<property name="payload" value="body"/>
<property name="soapVersion"/>
<property name="enableMuleSoapHeaders"/>
<property name="configuration-ref"/>
<property name="auxiliary;index" value="4"/>
<property name="decoupledEndpoint"/>
</properties>
</pattern>
<endpoint direction="Outbound" name="HTTP" type="http://www.mulesoft.org/schema/mule/http/endpoint" entity-id="HTTP#2">
<graphicalData x="0" y="0" width="0" height="0"/>
<properties>
<property name="port"/>
<property name="host"/>
<property name="businessEventsLabel"/>
<property name="followRedirects"/>
<property name="org.mule.tooling.ui.modules.core.widgets.meta.ModeAttribute" value="http://www.mulesoft.org/schema/mule/http/endpoint"/>
<property name="keepAlive"/>
<property name="contentType"/>
<property name="disableTransportTransformer"/>
<property name="password"/>
<property name="exchange-pattern" value="request-response"/>
<property name="tracking:enable-default-events"/>
<property name="ref"/>
<property name="transformer-refs"/>
<property name="httpLabel"/>
<property name="address" value="http://172.17.26.183:8080/frontend/ArmaServiceImpl"/>
<property name="path"/>
<property name="encoding"/>
<property name="responseTransformer-refs"/>
<property name="method" value="POST"/>
<property name="user"/>
<property name="auxiliary;index" value="5"/>
<property name="responseTimeout"/>
<property name="mimeType"/>
<property name="connector-ref"/>
</properties>
</endpoint>
</lane>
</flow>
</mule-configuration>

View File

@ -0,0 +1,55 @@
package com.fp.frontend.webservices.impl;
import java.util.Date;
import javax.jws.WebService;
import com.fp.common.logger.APPLogger;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.frontend.helper.CallerHelper;
import com.fp.frontend.webservices.InventarioService;
@WebService(endpointInterface="com.fp.frontend.webservices.InventarioService")
public class InventarioServiceImpl implements InventarioService {
@Override
public String guardaDatosLectura(String tagslectura, Date fechalectura, String locacionlectura, String idportal, String tipooperacion) {
String respuesta = "0";
try {
System.out.println("INGRESO PORTAL ........");
CallerHelper callerHelper = new CallerHelper();
Request request = callerHelper.getRequest();
request.setCompany(1);
request.setTransactionModule("30");
request.setTransactionCode(9996);
request.setTransactionVersion(1);
request.put("TAGSLECTURA", tagslectura);
if(tipooperacion.equals("HHD")){
request.put("FECHALECTURA", new Date());
}else{
request.put("FECHALECTURA", fechalectura);
}
request.put("LOCACIONLECTURA", locacionlectura);
request.put("IDPORTAL", idportal);
request.put("TIPOOPERACION", tipooperacion);
Response response = callerHelper.executeSave(request);
if(response.getResponseCode().compareTo(Response.RESPONSE_OK) == 0){
respuesta = (String) response.get("RESPONSESTATUS");
} else{
respuesta = "2";
}
} catch (Throwable e) {
System.out.println("error:.........."+e);
respuesta = "1";
APPLogger.getLogger().error(e.getMessage(), e);
}
return respuesta;
}
public static void main(String[] args) {
InventarioServiceImpl guarda= new InventarioServiceImpl();
System.out.println(guarda.guardaDatosLectura("E2003098851500251190A810", new Date(), "GUAYAS", "0001", "PTL"));
}
}

View File

@ -0,0 +1,72 @@
package com.fp.armas.rules.query.webservices;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Query;
import org.joda.time.DateTime;
import com.fp.armas.rules.query.webservices.util.ColaImpresionUtil;
import com.fp.common.logger.APPLogger;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.parmas.dto.ws.ColaImpresionDto;
import com.fp.persistence.parmas.inte.TarmColadeImpresion;
/**
* Consulta los datos de impresi&oacute;n del proceso
* @author dcruz
*
*/
public class ConsultaImpresionProceso extends QueryRule {
private static final long serialVersionUID = -7675701723545274414L;
public static final String QUERY_COLA_SOLICITUD = "SELECT o.* FROM TarmColadeImpresion o WHERE o.estadoimpresion='PIMPR' and o.cdocumento "
+ "IN ((SELECT i.cdocumento FROM TarmDocumentoHabilitante i WHERE i.csolicitud IN (SELECT c.CSOLICITUD FROM TarmSolicitud c "
+ "WHERE c.estado IN ('APB','FIN') and c.numerosolicitud=:numerosolicitud)) UNION (SELECT SD.cdocumento FROM tarmsolicituddocumento SD WHERE sd.csolicitud "
+ "IN (SELECT c.CSOLICITUD FROM TarmSolicitud c WHERE c.estado IN ('APB','FIN') and c.numerosolicitud=:numerosolicitud)))";
@SuppressWarnings("unchecked")
@Override
public QueryRequest process(QueryRequest pRequest) throws Exception {
// TODO Auto-generated method stub
List<ColaImpresionDto> lcolaImpresion = null;
try {
String codigosolicitud = (String) pRequest.get("CODIGOSOLICITUD");
System.out.println("codigosolicitud.."+codigosolicitud);
System.out.println(QUERY_COLA_SOLICITUD);
Query query = PersistenceHelper.getEntityManager().createNativeQuery(QUERY_COLA_SOLICITUD);
query.setParameter("numerosolicitud", codigosolicitud);
List<TarmColadeImpresion> ltarmColadeImpresions = new ArrayList<TarmColadeImpresion>();
List<Object[]> ltarmColadeImpresionsTMP = query.getResultList();
for(Object[]tmp:ltarmColadeImpresionsTMP){
TarmColadeImpresion colaImpresionObj = new TarmColadeImpresion();
colaImpresionObj.setPk(tmp[3].toString());
colaImpresionObj.setEstadoimpresion(tmp[1].toString());
colaImpresionObj.setFechaimpresion((Timestamp) tmp[4]);
colaImpresionObj.setEstadoimpresioncode(tmp[2].toString());
colaImpresionObj.setCdocumento(((BigDecimal) tmp[0]).longValue());
colaImpresionObj.setFecharegistro(new Date(((Timestamp) tmp[5]).getTime()));
if (tmp[6] != null)
colaImpresionObj.setCodigotarjeta(tmp[6].toString());
ltarmColadeImpresions.add(colaImpresionObj);
}
lcolaImpresion = ColaImpresionUtil.getInstancia().completaColaImpresion(ltarmColadeImpresions);
pRequest.getResponse().put("COLAIMPRESION", lcolaImpresion);
pRequest.getResponse().put("COLAIMPRESION", lcolaImpresion);
} catch (Throwable e) {
APPLogger.getLogger().error(e.getMessage(), e);
}
return pRequest;
}
}

View File

@ -0,0 +1,210 @@
package com.fp.base.persistence.util.db;
import java.util.Map;
import com.fp.core.exception.CoreException;
import com.fp.persistence.commondb.HqlStatement;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.cache.CacheManager;
import com.fp.persistence.pgeneral.gene.TgeneCreditType;
import com.fp.persistence.pgeneral.gene.TgeneCurrency;
import com.fp.persistence.pgeneral.gene.TgeneFrequency;
import com.fp.persistence.pgeneral.installment.TgeneInstallmentType;
import com.fp.persistence.pgeneral.safe.TsafeUser;
import com.fp.persistence.pgeneral.trans.TgeneTransactionItem;
/**
* Clase que se encarga de manejo de sentencias SQL o HQL con la base de datos, Existe ciertas tablas con informacion
* estatica, las cuales se cargan a memoria. <br>
* Otras tablas se define para que se cargue a cache la informacion de ciertos regitros que esten marcados con
* ManageCache.
*
* @author Jorge Vaca
* @version 2.1
*/
public class DataHelper {
/** Almacena una instancia de DataHelper. */
private static DataHelper cache;
/**
* Entrega una instancia de DataHelper.
*
* @return DataHelper
*/
public static DataHelper getInstance() {
if (DataHelper.cache != null) {
return DataHelper.cache;
}
synchronized (DataHelper.class) {
if (DataHelper.cache == null) {
DataHelper.cache = new DataHelper();
}
}
return DataHelper.cache;
}
private static final String VMODULECODE = "modulecode";
/** Sentencia que devuelve un registro de TgeneCreditType. */
private static final String HQL_CREDIT_TYPE = "from TgeneCreditType t " + " where t.pk = :credittypecode ";
/**
* Metodo que entrega la definicion de TgeneCreditType.
*
* @param pCreditType Codigo de tipo de credito a obtener datos.
* @return TgeneCreditType
* @throws Exception
*/
public TgeneCreditType getTgeneCreditType(String pCreditType) throws Exception {
TgeneCreditType tgeneCreditType = null;
CacheManager cm = CacheManager.getInstance();
tgeneCreditType = (TgeneCreditType) cm.getData("TgeneCreditType", pCreditType);
if (tgeneCreditType == null) {
HqlStatement hql = new HqlStatement();
hql.setSentence(DataHelper.HQL_CREDIT_TYPE);
hql.setString("credittypecode", pCreditType);
tgeneCreditType = (TgeneCreditType) hql.getObject();
Map<String, Object> m = cm.getMapDefinition("TgeneCreditType");
m.put(pCreditType, tgeneCreditType);
cm.putData("TgeneCreditType", m);
}
return tgeneCreditType;
}
/** Sentencia que devuelve un registro de TgeneInstallmentType. */
private static final String HQL_INSTALLMENT_TYPE = "from TgeneInstallmentType t " + " where t.pk.installmenttype = :installmenttype "
+ " and t.pk.modulecode = :modulecode ";
/**
* Metodo que entrega la definicion de TgeneInstallmentType
*
* @param TgeneInstallmentType Codigo de tipo de tabla de amortizacion.
* @return TgeneInstallmentType
* @throws Exception
*/
public TgeneInstallmentType getTgeneInstallmentType(String pInstallmentType, String pModule) throws Exception {
String key = pInstallmentType + pModule;
TgeneInstallmentType tgeneInstallmentType = null;
CacheManager cm = CacheManager.getInstance();
tgeneInstallmentType = (TgeneInstallmentType) cm.getData("TgeneInstallmentType", key);
if (tgeneInstallmentType == null) {
HqlStatement hql = new HqlStatement();
hql.setSentence(DataHelper.HQL_INSTALLMENT_TYPE);
hql.setString("installmenttype", pInstallmentType);
hql.setString(DataHelper.VMODULECODE, pModule);
hql.setReadonly(true);
tgeneInstallmentType = (TgeneInstallmentType) hql.getObject();
if (tgeneInstallmentType == null) {
throw new CoreException("CORE-0022", "TIPO TABLA DE AMORTIZACION NO DEFINIDA EN TGENEINSTALLMENTTYPE :{0}", pInstallmentType);
}
Map<String, Object> m = cm.getMapDefinition("TgeneInstallmentType");
m.put(key, tgeneInstallmentType);
cm.putData("TgeneInstallmentType", m);
}
return tgeneInstallmentType;
}
/** Sentencia que devuelve un registro de TgeneFrequency. */
private static final String HQL_FREQUENCY = "from TgeneFrequency t " + " where t.pk = :frequencycode ";
/**
* Metodo que entrega la definicion de TgeneFrequency
*
* @param pFrequencyCode Codigo de frecuenia a obtener su definicion.
* @return TgeneFrequency
* @throws Exception
*/
public TgeneFrequency getTgeneFrecuency(Integer pFrequencyCode) throws Exception {
TgeneFrequency tgeneFrequency = null;
String key = "" + pFrequencyCode;
CacheManager cm = CacheManager.getInstance();
tgeneFrequency = (TgeneFrequency) cm.getData("TgeneFrequency", key);
if (tgeneFrequency == null) {
HqlStatement hql = new HqlStatement();
hql.setSentence(DataHelper.HQL_FREQUENCY);
hql.setInteger("frequencycode", pFrequencyCode);
hql.setReadonly(true);
tgeneFrequency = (TgeneFrequency) hql.getObject();
if (tgeneFrequency == null) {
throw new CoreException("CORE-0015", "FRECUENCIA NO DEFINIDA EN TGENEFREQUENCY FRQCODE:{0}", pFrequencyCode);
}
Map<String, Object> m = cm.getMapDefinition("TgeneFrequency");
m.put(key, tgeneFrequency);
cm.putData("TgeneFrequency", m);
}
return tgeneFrequency;
}
/**
* Entrega un objeto con los datos de TsafeUser. Que contiene datos de un usuario.
*
* @param pUserCode Codigo de usuario a obtener un registro.
* @return TsafeUser
* @throws CoreException
* @throws Exception
*/
public TsafeUser getTsafeUser(String pUserCode) throws CoreException, Exception {
TsafeUser tsafeUser = TsafeUser.find(PersistenceHelper.getEntityManager(), pUserCode);
if (tsafeUser == null) {
throw new CoreException("CORE-0032", "USUARIO {0} NO DEFINIDO EN TSAFEUSER", pUserCode);
}
if (tsafeUser.getInternalcode() == null) {
throw new CoreException("CORE-0033", "CODIGO USUARIO INTERNO NO DEFINIDO EN TSAFEUSER USERCODE: {0}", pUserCode);
}
return tsafeUser;
}
/**
* Entrega un registro de tgenecurrency.
*
* @param pCurrency Codigo de moneda a obtener un registro de la base de datos.
* @return TgeneCurrency
* @throws Exception
*/
public TgeneCurrency getTgeneCurrency(String pCurrency) throws Exception {
TgeneCurrency tgeneCurrency = null;
CacheManager cm = CacheManager.getInstance();
tgeneCurrency = (TgeneCurrency) cm.getData("TgeneCurrency", pCurrency);
if (tgeneCurrency == null) {
tgeneCurrency = TgeneCurrency.find(PersistenceHelper.getEntityManager(), pCurrency);
if (tgeneCurrency == null) {
throw new CoreException("CORE-0017", "MONEDA {0} NO DEFINIDA EN TGENECURRENCY ", pCurrency);
}
Map<String, Object> m = cm.getMapDefinition("TgeneCurrency");
m.put(pCurrency, tgeneCurrency);
cm.putData("TgeneCurrency", m);
}
return tgeneCurrency;
}
/**
* Sentecia que devuelve el rubro de una transaccion
*/
private static final String HQL_TRANSACTION_ITEMCODE = "from TgeneTransactionItem tt " + " where tt.pk.transactionmodule = :transactionmodule"
+ " and tt.pk.transactioncode = :transactioncode" + " and tt.pk.transactionversion = :transactionversion"
+ " and tt.pk.itemcode = :itemcode";
/**
* Metodo que retorna el rubro de una transaccion
*
* @param transactionmodule Modulo de la transaccion
* @param transactioncode Codigo de la transaccion
* @param transactionversion Version de la transaccion
* @param itemcode Rubro de la transaccion
* @return
* @throws Exception
*/
public TgeneTransactionItem getTgeneTransactionItem(String transactionmodule, Integer transactioncode, Integer transactionversion,
Integer itemcode) throws Exception {
TgeneTransactionItem tgeneTransactionItem = null;
HqlStatement hql = new HqlStatement(DataHelper.HQL_TRANSACTION_ITEMCODE);
hql.setString("transactionmodule", transactionmodule);
hql.setInteger("transactioncode", transactioncode);
hql.setInteger("transactionversion", transactionversion);
hql.setInteger("itemcode", itemcode);
tgeneTransactionItem = (TgeneTransactionItem) hql.getObject();
return tgeneTransactionItem;
}
}

View File

@ -0,0 +1,111 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents"
template="/WEB-INF/templates/template.xhtml">
<ui:define name="content">
<h:form id="formTable">
<style>
.ui-growl-title {font-weight:bold;padding:0 0 7px 0;display:block;font-size: 200%;}
.ui-growl-message p {font-size: 200%}
</style>
<p:growl id="msjRecuerdeSeleccionArmas" showDetail="true" sticky="true" />
<maia:pageEvents controller="#{certificadosArmasController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:filters, :formTable:dt-armas"
saveProcess=""
saveUpdate=""
focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="1" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<h:panelGrid columns="2" >
<p:outputLabel for="fpkdocumento" value="#{msg_customer.lbl_person}:" style="display:block;width:160px;" />
<h:panelGroup>
<p:inputText id="fpkdocumento" value="#{certificadosArmasController.numeroDocumento}" style="width: 250px;" disabled="true" />
<p:commandButton icon="ui-icon-link" actionListener="#{certificadosArmasController.openPersonLov()}"
process="@this" styleClass="m-lov-button" oncomplete="Maia.focus('formTable\\:idQuery');">
<p:ajax event="dialogReturn" listener="#{certificadosArmasController.onReturnPersonLov}" update=":formTable:filters :formTable:dt-armas :formTable:msjRecuerdeSeleccionArmas" />
</p:commandButton>
</h:panelGroup>
<p:outputLabel for="fnombre" value="#{msg_armas.lbl_nombrerazonsocial}:" />
<p:inputText id="fnombre" value="#{certificadosArmasController.razonSocial}" disabled="true" maxlength="60" style="width: 400px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel value="#{msg_armas.lbl_seleccionararma}:" style="display:block;"/>
<p:commandButton icon="ui-icon-link" styleClass="m-lov-button"
actionListener="#{certificadosArmasController.openLovArma}" immediate="true" process="@this" >
<p:ajax event="dialogReturn" listener="#{certificadosArmasController.onReturnArma}"
process="@this" update=":formTable:data-content" immediate="true"/>
</p:commandButton>
</h:panelGrid>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{certificadosArmasController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:filters, :formTable:dt-armas"
createUpdate=":txtTituloArmas :formProcess:pEdit :formProcess:pnlControlesArma"
showCreateBtn = "false"
showSaveBtn = "false" showNextBtn="false" showPreviousBtn="false" showQueryBtn="false"/>
<p:commandButton id="btnImprimir" actionListener="#{certificadosArmasController.generarReporte()}" icon="ui-icon-print"
ajax="false" process="@this data-content" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_armas.htbl_detallematerial}" />
</f:facet>
<p:dataTable id="dt-armas" var="row" value="#{certificadosArmasController.lrecord}" rowIndexVar="rowIndex" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_armas.lbl_codigoarma}" resizable="true">
<h:outputText value="#{row.codigoarma}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_noDocumento}" resizable="true">
<h:outputText value="#{row.modifiedData['noDocumento']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_nombrerazonsocial}" resizable="true">
<h:outputText value="#{row.modifiedData['propietario']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_clase}" resizable="true">
<h:outputText value="#{row.modifiedData['clase']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_tipo}" resizable="true">
<h:outputText value="#{row.modifiedData['tipoarmaexplosivo']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_marca}" resizable="true">
<h:outputText value="#{row.modifiedData['marca']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_calibre}" resizable="true">
<h:outputText value="#{row.modifiedData['calibre']}" />
</p:column>
<p:column headerText="#{msg_armas['lbl_serielote']}" resizable="true">
<h:outputText value="#{row.lote}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_estado}" resizable="true">
<h:outputText value="#{row.modifiedData['estado']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_fechaEmision}" resizable="true">
<h:outputText value="#{row.modifiedData['fechaemision']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_fechadeexpiracion}" resizable="true">
<h:outputText value="#{row.modifiedData['fechaexpiracion']}" />
</p:column>
<p:column styleClass="m-action-column">
<p:selectBooleanCheckbox value="#{row.modifiedData['seleccionada']}">
</p:selectBooleanCheckbox>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,273 @@
<ui:composition xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{evaluacionController}"
queryProcess=":formTable:datosEvaluacion"
queryUpdate=":formTable:dt-table" saveProcess=""
saveUpdate=":formTable:data-content"
focusContainer=":formTable:m-data-content" />
<p:panelGrid styleClass="m-filters" columns="1" style="width:1200px">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}"/>
</f:facet>
<h:panelGrid id="datosEvaluacion" columns="5">
<p:outputLabel for="ftest" value="#{msg_armas.lbl_test}:" />
<h:panelGrid column="2">
<p:inputText id="ftest" maxlength="30" disabled="true"
value="#{evaluacionController.tipoEvaluacion.description}" style="width: 260px;" onkeyup="Maia.forceupper(event, this);" />
<p:message for="ftest" />
</h:panelGrid>
<p style="with:0px"></p>
<p:outputLabel for="ffecha" value="#{msg_armas.lbl_fechadeevaluacion}:" />
<h:panelGrid column="2" >
<p:inputText id="ffecha" value="#{importacionController.fechaactual}" maxlength="20"
disabled="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);">
<f:convertDateTime pattern="dd-MM-yyyy"/>
</p:inputText>
</h:panelGrid>
<p:outputLabel for="fndocumento" value="#{msg_armas.lbl_noDocumento}:"/>
<h:panelGrid column="2">
<p:inputText id="fndocumento" maxlength="30" disabled="true"
value="#{evaluacionController.personafiltroSNAP.identification}"
style="width: 260px;" onkeyup="Maia.forceupper(event, this);" />
<p:message for="fndocumento" />
</h:panelGrid>
<h:panelGroup></h:panelGroup>
<p:outputLabel for="ffechanombrerazonsocial" value="#{msg_armas.lbl_nombrerazonsocial}:" />
<h:panelGrid column="2">
<p:inputText id="ffechanombrerazonsocial" maxlength="30" value="#{evaluacionController.personafiltroSNAP.name}"
disabled="true" style="width: 300px;" />
</h:panelGrid>
</h:panelGrid>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{evaluacionController}"
queryProcess=":formTable:datosEvaluacion"
queryUpdate=":formTable:data-content"
saveUpdate=":formTable:data-content"
showCreateBtn="false"
showQueryBtn="false"
showSaveBtn="false"
dialogWidgetVar="dialog" />
<p:commandButton id="createControl" value="#{msg_general.btn_create}" update=":formCarga" icon="ui-icon-plus" oncomplete="if(args.validationFailed){return false;} PF('dialog').show()" >
<f:setPropertyActionListener target="#{evaluacionController.newRow}" value="#{true}" />
<f:setPropertyActionListener target="#{evaluacionController.showRow}" value="#{false}" />
</p:commandButton>
<p:commandButton id="saveControl" value="#{msg_general.btn_save}" icon="ui-icon-disk" update=":formTable:data-content" action="#{evaluacionController.save()}" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1"
styleClass="m-data-content" style="width:1200px">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_detallevaluacion}" />
</f:facet>
<p:dataTable id="dt-table" var="row"
value="#{evaluacionController.lrecord}"
rows="200" style="min-width: 800px; width: auto;"
rowKey="#{row.rowkey}" selectionMode="single">
<p:column headerText="#{msg_armas.lbl_No}" resizable="true"
style="width:60px" >
<h:outputText value="#{row.personcode}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_noDocumento}" resizable="true">
<h:outputText value="#{row.modifiedData['identificacion']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_nombrerazonsocial}" resizable="true">
<h:outputText value="#{row.modifiedData['nombre']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_tipoPersona}" resizable="true">
<h:outputText value="#{row.modifiedData['tipopersonadesc']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_evaluacion}" resizable="true">
<h:outputText value="#{row.modifiedData['tipoevaluaciondesc']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_fecharegistrotest}" resizable="true">
<h:outputText value="#{row.fecha}" >
<f:convertDateTime pattern="dd-MM-yyyy"/>
</h:outputText>
</p:column>
<p:column headerText="Resultado"
resizable="true">
<h:outputText value="#{row.resultado}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_estadoevaluacion}" resizable="true">
<h:outputText value="#{row.modifiedData['estadovig']}" />
</p:column>
<p:column resizable="true">
<p:commandButton value="#{msg_general.btn_delete}" process="@this" update=":formTable:data-content" disabled="#{row.modifiedData['eliminar']}" styleClass="m-action-button" icon="ui-icon-trash" action="#{evaluacionController.remove()}">
<f:setPropertyActionListener target="#{evaluacionController.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialog" resizable="false"
closeOnEscape="true" modal="true" appendTo="@(body)"
showEffect="explode" hideEffect="explode" styleClass="m-dialog" width="650">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_test}" />
</f:facet>
<h:form id="formCarga">
<h:panelGroup layout="block" style="height:450px !important; width:620px !important">
<p:messages id="messages" autoUpdate="true" globalOnly="true" />
<h:panelGrid columns="1" id="detallePersona" >
<p:panelGrid columns="1" style="width:600px">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_datosevaluado}" />
</f:facet>
<h:panelGrid columns="4">
<p:outputLabel for="fidentificacion" value="#{msg_armas.lbl_noDocumento}: *" style="width:150px;display:block" />
<p:inputText id="fidentificacion" value="#{evaluacionController.personafiltro.identification}" maxlength="30" disabled="true" style="width: 270px;" onkeyup="Maia.forceupper(event, this);"/>
</h:panelGrid>
<h:panelGrid columns="2">
<p:outputLabel for="fnombre" value="#{msg_armas.lbl_nombrerazonsocial}: *" style="width:150px;display:block" />
<p:inputText id="fnombre" value="#{evaluacionController.personafiltro.name}" maxlength="50" disabled="true" style="width: 300px;" onkeyup="Maia.forceupper(event, this);"/>
<p:outputLabel for="ftipo" value="#{msg_armas.lbl_tipoPersona}: *" style="width:135px;display:block" />
<p:inputText id="ftipo" value="#{evaluacionController.lTipoPersona.description}" disabled="true" style="width: 300px;"/>
<p:outputLabel for="esGuardia" value="Guardia:" style="width:150px;display:block"/>
<p:selectBooleanCheckbox id="esGuardia" value="#{evaluacionController.isGuardia}">
<p:ajax event="change" update="detallePersona" process="@this "/>
</p:selectBooleanCheckbox>
</h:panelGrid>
</p:panelGrid >
<p:panelGrid columns="1" style="width:600px" id="pnlDatosEmpSeg" rendered="#{evaluacionController.isGuardia}">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_datosempresaseg}" />
</f:facet>
<h:panelGrid columns="4">
<p:outputLabel for="fidentificacionempresa" value="#{msg_armas.lbl_noDocumento}: *" style="width:150px;display:block" />
<p:inputText id="fidentificacionempresa" value="#{evaluacionController.empresa.identification}" maxlength="30" disabled="true" style="width: 270px;" onkeyup="Maia.forceupper(event, this);"/>
<p:commandButton id="cargaremoresa" icon="ui-icon-link" actionListener="#{evaluacionController.openPersonLov()}" process="@this">
<p:ajax event="dialogReturn" listener="#{evaluacionController.onRetrunPersonLovEmpresa}" update=":formCarga:detallePersona"/>
</p:commandButton>
</h:panelGrid>
<h:panelGrid columns="2">
<p:outputLabel for="fnombreempresa" value="#{msg_armas.lbl_compania}:*" style="width:150px;display:block" />
<p:inputText id="fnombreempresa" value="#{evaluacionController.empresa.name}" maxlength="50" disabled="true" style="width: 300px;" onkeyup="Maia.forceupper(event, this);"/>
</h:panelGrid>
</p:panelGrid>
</h:panelGrid>
<p:panelGrid columns="1" style="width:600px">
<f:facet name="header">
<h:outputText value="#{msg_armas.hfld_datosgenerales}" />
</f:facet>
<h:panelGrid id="pEditCarga" columns="2" bodyrows="1">
<!-- <h:panelGrid columns="2" bodyrows="1"> -->
<p:outputLabel for="ffecha" value="#{msg_armas.lbl_fechadeevaluacion}:" style="width:164px;display:block" />
<h:panelGrid columns="4">
<p:calendar id="ffecha" value="#{evaluacionController.fecha}" maxlength="30" pattern="dd-MM-yyyy" disabled="false" required="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);">
<p:ajax event="dateSelect" update="ffecha" listener="#{evaluacionController.validarfecha(evaluacionController.fecha)}" process="@this"/>
</p:calendar>
<p:outputLabel value="#{msg_armas.lbl_resultado}:" required="true"/>
<p:selectBooleanCheckbox value="#{evaluacionController.aprobado}"/>
<p:outputLabel value="#{msg_armas.lbl_aprobado}" required="true"/>
</h:panelGrid>
<p:outputLabel value="#{msg_armas.lbl_informeevaluacion}: *" />
<h:panelGrid>
<h:outputText value="#{msg_armas['msg_tamano_archivo_requisitos_pdf']}" style="color:blue;font-weight: bold;"/>
<p:fileUpload
fileUploadListener="#{evaluacionController.upload}"
multiple="false"
update=":formTable:data-content :formTable:controls :formTable:datosEvaluacion txtnombrefile"
sizeLimit="#{msg_armas.lbl_archivodosmegas}" allowTypes="/(\.|\/)(pdf)$/"
uploadLabel="#{msg_armas.lbl_subir}" cancelLabel="#{msg_armas.lbl_cancelar}" label="#{msg_armas.lbl_seleccionar}"
required="true"
invalidFileMessage="#{msg_armas.msg_error_tipoarchivoinvalido}"/>
<h:outputText id="txtnombrefile" value="#{evaluacionController.nombreArchivo != null ? 'Realizada':'Pendiente'}" />
</h:panelGrid>
<h:panelGrid id="blank" rendered="#{evaluacionController.subio}"/>
<p:outputLabel id="msgsubio" value="Archivo Cargado" rendered="#{evaluacionController.subio}"/>
<p:outputLabel for="centromedico" value="#{msg_armas.lbl_centromedico}:"/>
<h:panelGrid columns="1">
<p:selectOneMenu id="centromedico" var="p" value="#{evaluacionController.centro}" required="true" style="width:340px" >
<f:selectItem itemLabel="" itemValue="#{null}" />
<p:ajax listener="#{evaluacionController.cargarDeposito()}" event="change" update=":formCarga:valordeposito :formCarga:papeleta :formCarga:ffechadep" process="@this centromedico"/>
<f:selectItems value="#{evaluacionController.lcentro}" var="id" itemLabel="#{id.description}" itemValue="#{id.pk.catalog}" />
</p:selectOneMenu>
</h:panelGrid>
<p:outputLabel for="ffechadep" value="#{msg_armas.lbl_fechaDeDeposito}:" style="width:136px;display:block" />
<h:panelGrid columns="3">
<p:calendar id="ffechadep" value="#{evaluacionController.fechadeposito}" maxlength="30" pattern="dd-MM-yyyy"
disabled="#{evaluacionController.centroMedico}" required="true" style="width: 125px;" onkeyup="Maia.forceupper(event, this);">
<p:ajax event="dateSelect" update="ffecha" listener="#{evaluacionController.validarfecha(evaluacionController.fechadeposito)}" process="@this"/>
</p:calendar>
<p:outputLabel for="papeleta" value="#{msg_armas.lbl_numeroDeDeposito}"/>
<p:inputText id="papeleta" value="#{evaluacionController.record.nopapeleta}" required="true" disabled="#{evaluacionController.centroMedico}"/>
</h:panelGrid>
<p:outputLabel for="valordeposito" value="#{msg_armas.lbl_valorDeDeposito}" />
<h:panelGrid columns="3">
<p:inputText id="valordeposito" value="#{evaluacionController.centromed.legalcode}" disabled="true"/>
<p:outputLabel for="est" value="#{msg_armas.lbl_test}:" style="width:50px;display:block" />
<p:inputText id="est" value="#{msg_armas.lbl_psicologico}" disabled="true"/>
</h:panelGrid>
<!-- </h:panelGrid> -->
<!-- <h:panelGroup></h:panelGroup> -->
<p:outputLabel for="tipodocumento" value="#{msg_armas.lbl_tipodocumentoPsicologo}:" style="width:136px;display:block;"/>
<h:panelGrid columns="2">
<p:selectOneMenu id="tipodocumento" value="#{evaluacionController.record.tipdocpsicologo}"
var="p" style="width:215px" panelStyle="width:230px" required="true"
rendered="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{evaluacionController.tipoDocumentoLst}" var="vmod"
itemLabel="#{vmod.description}" itemValue="#{vmod.pk.catalog}" />
<p:ajax event="change" process="@this" listener="#{evaluacionController.onChangeTipoDocumento}" update="psico, numerodocumento"/>
</p:selectOneMenu>
<p:message for="tipodocumento" />
</h:panelGrid>
<p:outputLabel for="numerodocumento" value="#{msg_armas.lbl_noDocumentoPsicologo}:" style="width:136px;display:block;"/>
<h:panelGrid columns="3">
<p:inputText id="numerodocumento" value="#{evaluacionController.record.numdocpsicologo}" maxlength="15"
style="width: 230px;" onkeyup="Maia.forceupper(event, this);" required="true" >
</p:inputText>
<p:commandButton value="#{msg_armas.lbl_verificar}" process="@this, numerodocumento, tipodocumento"
action="#{evaluacionController.validarPsicologoResponsable}" update="psico"/>
<p:message for="numerodocumento" />
</h:panelGrid>
<p:outputLabel for="psico" value="#{msg_armas.lbl_psicologo}:" style="width:136px;display:block;"/>
<h:panelGrid columns="2" >
<p:inputText id="psico" value="#{evaluacionController.record.psicologoresponsable}" onkeyup="Maia.forceupper(event, this);" style="width:350px" required="true" maxlength="60" disabled="#{!evaluacionController.isPasaporte}"/>
</h:panelGrid>
<p:outputLabel value="#{msg_armas.lbl_observacion}:" style="width:160px;display:block;"/>
<h:panelGrid columns="2" >
<p:inputTextarea value="#{evaluacionController.record.observacion}" onkeyup="Maia.forceupper(event, this);" autoResize="false" maxlength="250" style="width:350px" />
</h:panelGrid>
</h:panelGrid>
</p:panelGrid>
<h:panelGrid columns="2">
<p:commandButton value="#{msg_general.btn_update}" validateClient="true" process="@this, :formCarga" update=":formCarga :formTable:data-content"
action="#{evaluacionController.actualizar()}"
icon="ui-icon-disk" oncomplete="if(args.validationFailed){return false;} PF('dialog').hide()" />
<p:commandButton value="#{msg_general.btn_cancell}" oncomplete="PF('dialog').hide()" icon="ui-icon-trash" action="#{evaluacionController.limpiar()}" process="@this" />
</h:panelGrid>
</h:panelGroup>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,85 @@
<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{importeArmasControlle}"
queryProcess=""
queryUpdate=""
saveProcess=""
saveUpdate=""
focusContainer=":formTable:filters" />
<h:panelGrid columns="1" id="controls" styleClass="m-controls" >
<maia:pageControls controller="#{importeArmasController}"
saveUpdate=":formTable:controls" saveProcess=":formTable:controls"
dialogWidgetVar="dialog" showNextBtn="false" showPreviousBtn="false"
showQueryBtn="false" showCreateBtn="false" showSaveBtn="true"/>
<h:panelGrid id="pEditCarga" columns="2" bodyrows="1">
<p:fileUpload fileUploadListener="#{importeArmasController.cargarArchivo}" multiple="false"
allowTypes="/(\.|\/)(xlsx)$/"
uploadLabel="#{msg_armas.lbl_cargararchivo}" cancelLabel="#{msg_armas.lbl_cancelar}"
label="#{msg_armas.lbl_seleccionar}" invalidFileMessage="#{msg_armas.msg_error_tipoarchivoinvalido}"
update=":formTable:controls"
onstart="PF('statusDialog').show()" oncomplete="PF('statusDialog').hide()"/>
</h:panelGrid>
<h:panelGrid id="pnlDatos" columns="3" bodyrows="1">
<p:outputLabel for="numeroRecibo" value="#{msg_armas.lbl_numero_recibo}:" style="width: 150px"/>
<p:inputText id="numeroRecibo" value="#{importeArmasController.numeroRecibo}" required="true" style="width: 150px"/>
<p:message for="numeroRecibo" />
<h:outputText value="#{msg_armas.lbl_organismo_control}:" style="width: 150px"/>
<h:inputText value="#{importeArmasController.centroControl.modifiedData['desinstitucion']}" disabled="true" style="width:300px;background-color:f2f0ef"/>
<h:outputText value="" />
<h:outputText value="#{msg_armas.lbl_centro_control}:" style="width: 150px"/>
<h:inputText value="#{importeArmasController.centroControlNombreLogeado}" disabled="true" style="width:300px;background-color:f2f0ef"/>
<h:outputText value="" />
<h:outputText value="#{msg_armas.lbl_numero_armas_procesadas}:" style="width: 150px"/>
<h:inputText value="#{importeArmasController.numArmasProcesadas}" disabled="true" style="width: 50px;background-color:f2f0ef"/>
<h:outputText value="" />
<h:outputText value="#{msg_armas.lbl_numero_armas_error}:" style="width: 150px"/>
<h:inputText value="#{importeArmasController.numArmasError}" disabled="true" style="width: 50px;background-color:f2f0ef"/>
<h:outputText value="" />
<h:outputText value="#{msg_armas.lbl_numero_armas_correctas}:" style="width: 150px"/>
<h:inputText value="#{importeArmasController.numCorrectas}" disabled="true" style="width: 50px;background-color:f2f0ef"/>
<h:outputText value="" />
</h:panelGrid>
<h:panelGrid columns="1" style="border:2px"
rendered="#{importeArmasController.listaErrores != null and importeArmasController.listaErrores.size()!=0}">
<p:commandButton id="DescargarLog" value="Log De Errores" ajax="false" immediate="true"
action="#{importeArmasController.descargarArchivo()}" process="@this" update=":formTable" rendered="#{importeArmasController.listaErrores != null}">
</p:commandButton>
<!-- p:dataTable value="#{importeArmasController.listaErrores}" var="item"
rendered="#{importeArmasController.listaErrores != null}"
paginator="true" rows="300" paginatorPosition="top">
<p:column >
<p:outputLabel value="#{item}"></p:outputLabel>
</p:column>
</p:dataTable> -->
<!-- h:outputText value="#{importeArmasController.mensajeError}" /> -->
</h:panelGrid>
</h:panelGrid>
</h:form>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,638 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 5.6.1.final using JasperReports Library version 5.6.1 -->
<!-- 2014-10-29T11:51:07 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="monedas" pageWidth="790" pageHeight="842" columnWidth="750" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="80331279-9be4-4003-ad3d-d3b8bfdf2084">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="oracle"/>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<template><![CDATA[$P{pathstyle}]]></template>
<parameter name="pathimage" class="java.lang.String" isForPrompting="false">
<parameterDescription><![CDATA[]]></parameterDescription>
<defaultValueExpression><![CDATA["repo:/maia/1/image/logo"]]></defaultValueExpression>
</parameter>
<parameter name="pathstyle" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["repo:/maia/1/style/style"]]></defaultValueExpression>
</parameter>
<parameter name="workingdate" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["2014-09-20"]]></defaultValueExpression>
</parameter>
<parameter name="company" class="java.lang.Integer" isForPrompting="false">
<parameterDescription><![CDATA[compania de trabajo]]></parameterDescription>
<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
</parameter>
<parameter name="pathLogoIzquierda" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/image/comandoconjunto"]]></defaultValueExpression>
</parameter>
<parameter name="pathLogoDerecha" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/image/selloarmas"]]></defaultValueExpression>
</parameter>
<parameter name="codigoOrden" class="java.lang.String"/>
<parameter name="numeroOrdenTrabajo" class="java.lang.String"/>
<parameter name="gradoNombreFuncionario" class="java.lang.String"/>
<parameter name="centroControl" class="java.lang.String"/>
<parameter name="documentoReferencia" class="java.lang.String"/>
<parameter name="fecha" class="java.lang.String"/>
<parameter name="comisionActividad" class="java.lang.String">
<parameterDescription><![CDATA[]]></parameterDescription>
</parameter>
<parameter name="empresaSolicita" class="java.lang.String"/>
<parameter name="tiempoEstimado" class="java.lang.String"/>
<parameter name="fechaInicio" class="java.lang.String"/>
<parameter name="fechaFin" class="java.lang.String"/>
<parameter name="lugar" class="java.lang.String"/>
<parameter name="ruta" class="java.lang.String"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/modules/armas/subreports/"]]></defaultValueExpression>
</parameter>
<parameter name="personcode" class="java.lang.Integer"/>
<parameter name="usuario" class="java.lang.String"/>
<parameter name="fechaHora" class="java.lang.String"/>
<parameter name="nombreCentro" class="java.lang.String"/>
<queryString language="SQL">
<![CDATA[select grado ||' '||nombrecustodio||' '||apellidoscustidio as nombre, cedulacustodio, observaciones
from tarmordentrabajocustodios
where cordentrabajo=$P{codigoOrden}]]>
</queryString>
<field name="NOMBRE" class="java.lang.String"/>
<field name="CEDULACUSTODIO" class="java.lang.Integer"/>
<field name="OBSERVACIONES" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="251" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement style="title" x="93" y="32" width="557" height="20" uuid="a5555ed3-8bce-44fd-afbb-28084239a1a1"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[COMANDO CONJUNTO DE LAS FUERZAS ARMADAS]]></text>
</staticText>
<staticText>
<reportElement key="" style="title1" x="93" y="55" width="557" height="20" uuid="98c268e9-4cb8-4184-9c02-537b79b6957c"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[DEPARTAMENTO DE CONTROL DE ARMAS]]></text>
</staticText>
<image>
<reportElement x="1" y="16" width="70" height="70" uuid="5c1c706c-0485-4d8f-be4c-9ad18ad76225">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{pathLogoIzquierda}]]></imageExpression>
</image>
<image>
<reportElement x="667" y="0" width="80" height="80" uuid="560083e4-2ae5-4b08-9886-6b1c828f2fe1">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{pathLogoDerecha}]]></imageExpression>
</image>
<staticText>
<reportElement key="" style="title2" x="166" y="104" width="259" height="16" uuid="26ce0d1a-434c-492b-b37e-b044e895661b">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<text><![CDATA[ORDEN DE TRABAJO No:]]></text>
</staticText>
<textField>
<reportElement style="title2" x="433" y="103" width="123" height="16" uuid="f4d441de-56ac-4ab5-9651-c6f43e22e160">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{numeroOrdenTrabajo}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="title2" x="93" y="78" width="557" height="20" uuid="d7c2db13-cfdb-4dd8-ac4e-4320073788bb">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{nombreCentro}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal" x="568" y="220" width="178" height="16" uuid="534ffa16-af35-4f83-a9a7-5773f910db95">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2" leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Justified" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{ruta}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal" x="180" y="163" width="70" height="30" uuid="05986ff6-9da1-48e7-b189-7aefb278433b">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{fecha}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="title2" x="250" y="143" width="250" height="20" uuid="f6b7799c-02d6-48c9-8740-06fd30fbbbb9">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[COMISIÓN/ACTIVIDAD]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="0" y="204" width="130" height="16" uuid="b3d1d172-d30f-412a-9a52-cca1bb08ad6e">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[TIEMPO ESTIMADO]]></text>
</staticText>
<textField>
<reportElement style="normal" x="0" y="163" width="180" height="30" uuid="50818574-8ca7-434a-b168-83322c7ef364">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{documentoReferencia}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="title2" x="0" y="143" width="180" height="20" uuid="1dd469b0-dc52-425c-a5c3-c8bba5f7cb74">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[DOCUMENTO REFERENCIA]]></text>
</staticText>
<textField>
<reportElement style="normal" x="500" y="163" width="246" height="30" uuid="9f6930da-3706-4084-be30-5e760cebdb20">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2" leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Justified" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{empresaSolicita}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal" x="210" y="220" width="134" height="16" uuid="ba4698d1-99ff-441e-92f0-00352f85258d">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{fechaFin}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal" x="344" y="220" width="224" height="16" uuid="0e50e818-2f3f-4d49-bc62-c74647ad4750">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2" leftPadding="2" bottomPadding="0" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Justified" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{lugar}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal" x="250" y="163" width="250" height="30" uuid="992daae4-a8ec-40e9-80d8-44ac17fe3aa0">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2" leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Justified" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{comisionActividad}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal" x="130" y="220" width="80" height="16" uuid="77fccce2-0dcf-4348-8f3a-4605538c5376">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{fechaInicio}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="title2" x="568" y="204" width="178" height="16" uuid="f4c1e194-68e0-4cae-8200-09889f7425aa">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[RUTA]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="500" y="143" width="246" height="20" uuid="309b50ac-2ca8-486f-b723-6edc687af2bb">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[EMPRESA SOLICITA]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="180" y="143" width="70" height="20" uuid="2981d281-949b-4cda-9b16-5ec7bc78524e">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[FECHA]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="344" y="204" width="224" height="16" uuid="3f6383d6-ac87-44c7-b3a0-866f2888970d">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LUGAR Y DIRECCIÓN DE LA COMISIÓN]]></text>
</staticText>
<textField>
<reportElement style="normal" x="0" y="220" width="130" height="16" uuid="22458dbf-0d58-4f03-aeb8-7614e2d23ed8">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{tiempoEstimado}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="title2" x="210" y="204" width="134" height="16" uuid="fdd6fad2-eda6-411c-8d12-ce674e121484">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[FECHA FINALIZACIÓN]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="130" y="204" width="80" height="16" uuid="b8233c9b-3490-44b3-a7db-8ac3c225a318">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[FECHA INICIO]]></text>
</staticText>
</band>
</title>
<columnHeader>
<band height="16" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement key="" style="title2" x="0" y="0" width="258" height="16" uuid="197fe2b7-8341-484f-a501-da4df9c148c3">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[GRADO Y NOMBRE PERSONAL PARTICIPANTE]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="258" y="0" width="100" height="16" uuid="e216dd8e-5c84-4282-8535-a27dd6f991b0">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[CÉDULA]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="358" y="0" width="388" height="16" uuid="897b7e60-2e85-42f2-9e6d-745cc8e44924">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[OBSERVACIONES]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="13" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="normal" stretchType="RelativeToTallestObject" x="258" y="0" width="100" height="13" uuid="0b746cf5-9b9f-408a-95f2-9f6f27235cf3">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<box leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{CEDULACUSTODIO}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="normal" stretchType="RelativeToBandHeight" x="0" y="0" width="258" height="13" uuid="8723fec0-693b-41a1-8036-4ab7b59734fc">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Justified" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{NOMBRE}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="normal" stretchType="RelativeToBandHeight" x="358" y="0" width="388" height="13" uuid="01155e11-5d80-4479-96f8-9810754ea07a">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<box leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Justified" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{OBSERVACIONES}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</band>
</columnFooter>
<pageFooter>
<band height="36" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement key="" style="title2" x="443" y="20" width="105" height="16" uuid="08a98d88-de6f-43b5-83f2-69ab61710262">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<text><![CDATA[Fecha emisión/hora:]]></text>
</staticText>
<textField>
<reportElement style="normal" x="45" y="20" width="375" height="16" uuid="e3b4f705-852a-4956-a60c-b997cc137ff8">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2" leftPadding="2" rightPadding="2">
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Justified" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{usuario}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="normal" x="548" y="20" width="119" height="16" uuid="5e32721c-9a6f-4076-b0cc-e63a08f6d26d">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box topPadding="2" leftPadding="2" rightPadding="2">
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Justified" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$P{fechaHora}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="title2" x="1" y="20" width="44" height="16" uuid="22fbaa9b-2fe4-4010-b171-d242a10b1379">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<text><![CDATA[Usuario:]]></text>
</staticText>
<textField isStretchWithOverflow="true" evaluationTime="Report">
<reportElement style="normal" x="731" y="20" width="15" height="16" forecolor="#000000" uuid="ba497021-5e8c-4699-815a-bdf6ea77a1ab">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="title2" x="681" y="20" width="25" height="16" uuid="65a94dee-6d47-42b3-92e6-a13b0dc759f6">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<text><![CDATA[Pág.]]></text>
</staticText>
<textField isStretchWithOverflow="true" evaluationTime="Page">
<reportElement style="normal" x="706" y="20" width="15" height="16" forecolor="#000000" uuid="b569394e-1fe3-45d6-8401-5fcafa658605">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<staticText>
<reportElement key="" style="title2" x="721" y="20" width="10" height="16" uuid="03ee9630-9ca3-4101-96b7-640513c9018f">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<text><![CDATA[ - ]]></text>
</staticText>
</band>
</pageFooter>
<summary>
<band height="164">
<subreport>
<reportElement x="0" y="13" width="745" height="100" uuid="c7d99b64-63fa-4261-9e5b-8f85b2c2b4d4">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<subreportParameter name="personcode">
<subreportParameterExpression><![CDATA[$P{personcode}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "firmaUsuario"]]></subreportExpression>
</subreport>
<textField isStretchWithOverflow="true">
<reportElement style="normal" x="2" y="121" width="560" height="16" forecolor="#000000" uuid="699bc8f2-3ba6-4480-b172-380f3deea1a8">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$P{gradoNombreFuncionario}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement style="normal" x="2" y="139" width="560" height="16" forecolor="#000000" uuid="5ec1daa9-2004-4796-90d3-e7c04c300823">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$P{centroControl}]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>

View File

@ -0,0 +1,124 @@
package com.fp.persistence.pgeneral.gene;
import javax.persistence.Column;
import java.io.Serializable;
import com.fp.dto.hb.HibernateId;
import java.lang.reflect.Field;
import javax.persistence.Embeddable;
import javax.persistence.Transient;
/**Clase que hace referencia a la Clave Primaria de TGENEREVOKESOLICITUDE*/
@Embeddable
public class TgeneRevokeSolicitudeKey extends com.fp.dto.AbstractDataTransport implements Serializable,Cloneable,HibernateId{
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
@Column(name="SOLICITUDNUMBER", nullable=false,updatable=false)
/**
* Numero unico de solicitud
*/
private String solicitudnumber;
@Column(name="SOLICITUDSEQUENCE", nullable=false,updatable=false)
/**
* Secuencia interna de solicitud
*/
private Integer solicitudsequence;
/**Contructor por defecto*/
public TgeneRevokeSolicitudeKey(){}
/**Contructor de TgeneRevokeSolicitudeKey
@param pSolicitudnumber Numero unico de solicitud
@param pSolicitudsequence Secuencia interna de solicitud
*/
public TgeneRevokeSolicitudeKey(String pSolicitudnumber,Integer pSolicitudsequence){
solicitudnumber=pSolicitudnumber;
solicitudsequence=pSolicitudsequence;
}
/**Obtiene el valor de solicitudnumber
@return valor de solicitudnumber*/
public String getSolicitudnumber(){
return solicitudnumber;
}
/**Fija el valor de solicitudnumber
@param pSolicitudnumber nuevo Valor de solicitudnumber*/
public void setSolicitudnumber(String pSolicitudnumber){
solicitudnumber=pSolicitudnumber;
}
/**Obtiene el valor de solicitudsequence
@return valor de solicitudsequence*/
public Integer getSolicitudsequence(){
return solicitudsequence;
}
/**Fija el valor de solicitudsequence
@param pSolicitudsequence nuevo Valor de solicitudsequence*/
public void setSolicitudsequence(Integer pSolicitudsequence){
solicitudsequence=pSolicitudsequence;
}
/**Implementacion de la comparacion de TgeneRevokeSolicitudeKey
@param o Objeto de comparacion
*/
public boolean equals(Object o){
if (o == null)return false;
if (! (o instanceof TgeneRevokeSolicitudeKey))return false;
TgeneRevokeSolicitudeKey that = (TgeneRevokeSolicitudeKey) o;
if (this.getSolicitudnumber() == null || that.getSolicitudnumber() == null){
return false;
}
if (! this.getSolicitudnumber().equals(that.getSolicitudnumber())){
return false;
}
if (this.getSolicitudsequence() == null || that.getSolicitudsequence() == null){
return false;
}
if (! this.getSolicitudsequence().equals(that.getSolicitudsequence())){
return false;
}
return true;
}
/**Implementacion del metodo hashCode bajo el patron de Bloch
@return hashCode de la instancia TgeneRevokeSolicitudeKey
*/
public int hashCode(){
if (this.hashValue == 0){
int result = 17;
result = result * 37 + (this.getSolicitudnumber() == null ? 0 : this.getSolicitudnumber().hashCode());
result = result * 37 + (this.getSolicitudsequence() == null ? 0 : this.getSolicitudsequence().hashCode());
this.hashValue = result;
}
return this.hashValue;
}
public Object cloneMe() throws CloneNotSupportedException {
return this.clone();
}
/**Implementacion toString
*/
public String toString() {
Field[]fs=this.getClass().getDeclaredFields();
String data="";
for(Field f:fs){
try{
String name=f.getName();
if(f.getType().getName().compareTo("java.util.Set")==0)continue;
if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
data+="pk."+name+"="+f.get(this)+";";
}catch(Exception e){
continue;
}
}
if(data.compareTo("")==0){
data=super.toString();
}
return data;
}
}

View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 5.6.1.final using JasperReports Library version 5.6.1 -->
<!-- 2015-05-18T12:19:16 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="userprofilesubreport" language="groovy" pageWidth="545" pageHeight="802" columnWidth="545" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="027b9f69-a8b1-4a8b-b2f5-9a40a3d73b01">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<template><![CDATA[$P{pathstyle}]]></template>
<parameter name="profilecode" class="java.lang.String"/>
<parameter name="pathstyle" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/style/style"]]></defaultValueExpression>
</parameter>
<parameter name="company" class="java.lang.Integer" isForPrompting="false">
<defaultValueExpression><![CDATA[1]]></defaultValueExpression>
</parameter>
<queryString language="SQL">
<![CDATA[select TSUP.PROFILECODE,
TSUP.USERCODE,
(select TCPD.NAME
from TCUSTPERSONDETAIL TCPD
where TCPD.PERSONCODE =
(select TSUDA.PERSONCODE
from TSAFEUSERDETAIL TSUDA
where TSUDA.USERCODE = TSUP.USERCODE
and TSUDA.DATETO = TSUP.DATETO
and TSUDA.COMPANYCODE = 1)
and TCPD.DATETO = TSUP.DATETO) NAME,
(select min(TSUP.DATEFROM)
from TSAFEUSERPROFILE TSUP
where TSUP.USERCODE = TSUP.USERCODE
and TSUP.PROFILECODE = TSUP.PROFILECODE) FINGRESO,
TSUP.INGRESSUSER,
(select TCPD.NAME
from TCUSTPERSONDETAIL TCPD
where TCPD.PERSONCODE =
(select TSUDA.PERSONCODE
from TSAFEUSERDETAIL TSUDA
where TSUDA.USERCODE = TSUP.INGRESSUSER
and TSUDA.DATETO = TSUP.DATETO
and TSUDA.COMPANYCODE = 1)
and TCPD.DATETO = TSUP.DATETO) NUSERINGRESO
from TSAFEUSERPROFILE TSUP
where TSUP.DATETO = to_date('29991231','yyyymmdd') and TSUP.PROFILECODE = $P{profilecode}
order by 3]]>
</queryString>
<field name="PROFILECODE" class="java.lang.String"/>
<field name="USERCODE" class="java.lang.String"/>
<field name="NAME" class="java.lang.String"/>
<field name="FINGRESO" class="java.sql.Timestamp"/>
<field name="INGRESSUSER" class="java.lang.String"/>
<field name="NUSERINGRESO" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="13">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement style="headercolumn" x="0" y="0" width="100" height="13" uuid="0c705348-601d-468a-8b39-30a29729b6be">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<text><![CDATA[Usuario]]></text>
</staticText>
<staticText>
<reportElement style="headercolumn" x="100" y="0" width="230" height="13" uuid="63692647-8cc7-4b2c-b67b-bdb7739fad60">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<text><![CDATA[Nombre Usuario]]></text>
</staticText>
<staticText>
<reportElement style="headercolumn" x="330" y="0" width="115" height="13" uuid="3e31aa4d-c2b4-487a-8d3d-79ee0a3225c5">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[Fecha ingreso]]></text>
</staticText>
<staticText>
<reportElement style="headercolumn" x="445" y="0" width="100" height="13" uuid="1aa582b9-b964-45d4-b01b-b39cf64c720e">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<text><![CDATA[Usuario Ingreso]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="13" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField isBlankWhenNull="true">
<reportElement style="detail" x="0" y="0" width="100" height="13" uuid="1ea51b98-218d-4d0f-952b-0eed3ce55e75">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{USERCODE}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement style="detail" x="100" y="0" width="230" height="13" uuid="d4bfba8f-8973-45af-bdf2-4796f259fde9">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression>
</textField>
<textField pattern="yyyy-MM-dd HH:mm:ss" isBlankWhenNull="true">
<reportElement style="detail" x="330" y="0" width="115" height="13" uuid="0a955d23-debf-4faa-bb63-30182695424d">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{FINGRESO}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement style="detail" x="445" y="0" width="100" height="13" uuid="9bd90bbe-9960-46e5-87df-bf25ea0288c5">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{INGRESSUSER}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

View File

@ -0,0 +1,958 @@
package com.fp.dto;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import com.fp.common.helper.BeanManager;
import com.fp.dto.fin.FinancialRequest;
import com.fp.dto.hb.HibernateBean;
import com.fp.dto.query.DtoQuery;
import com.fp.dto.save.DtoSave;
import com.fp.dto.save.SaveBean;
/**
* Requet general utilizado en el procesamiento de transacciones, ejemplo consultas, mantenimiento, reportes financiero.
*
* @author Jorge Vaca .
* @version 2.1
*/
public class Request extends AbstractData {
private static final long serialVersionUID = 1L;
/** Objeto que almacena la respuesta de una consulta. */
private Response response;
/** Codigo de usuario que ejecuta una transaccion. */
protected String user;
/** Idioma preferido del usuario. */
/** Codigo interno de usuario que ejecuta una transaccion. */
protected Integer internalUserCode;
/**
* language
*/
protected String language;
/** Perfil del Usuario. */
protected String profile;
/** Codigo del modulo al que pertenece la transaccion. */
protected String transactionModule;
/** Codigo de transaccion a ejecutar. */
protected Integer transactionCode;
/** Version de la transaccion a ejecutar. */
protected Integer transactionVersion;
/** Codigo de terminal asociado al ip de la maquina desde la cual se ejecuta una transaccion. */
protected String terminalCode;
/** Nombre de la transaccion*/
protected String tname;
/** Identificador de la transaccion. */
protected String journalId;
/** Codigo de canal desde el cual se ejecuta una transaccion. */
protected String channelCode;
/** Codigo de compania. */
protected Integer company;
/** Codigo de sucursal origen de la transaccion. */
protected Integer branchCode;
/** Codigo de oficina origen de la transaccion. */
protected Integer officeCode;
/** Codigo de area origen de la transaccion. */
protected Integer areaCode;
/** Codigo de usuario que ejecuta una transaccion. */
protected String authorizedUser;
/** Numero de cuenta a enviar al log de transacion. */
protected String logaccount;
/** Numero de solicitud a enviar al log de transacion. */
protected String logsolicitude;
/** Codigo de persona a enviar al log de transacion. */
protected Integer logperson;
/** Centro de control donde pertenece la persona para enviar al log de transacion. */
protected String centrocontrol;
/** Unidad de control donde pertenece la persona para enviar al log de transacion. */
protected String unidad;
/**
* Subject a presentar en la agenda del usuario.
*/
protected String subject;
/** Codigo del modulo original al que pertenece la transaccion. */
private String originalTransactionModule;
/** Codigo de transaccion original a ejecutar. */
private Integer originalTransactionCode;
/** Version de la transaccion original a ejecutar. */
private Integer originalTransactionVersion;
/** Secuencia interna de la transaccion por numero de mensaje. */
private Integer jounalSequence;
/** Indica que la transaccion que se esta ejecutando es el linea. */
private boolean onLine = true;
/** Navegador utilizado **/
private String browser;
/** Sitema operativo utilizado **/
private String operativesystem;
/** Cabecera de la transaccion que se esta ejecutando. */
public Map<String, HibernateBean> mbeans = new HashMap<String, HibernateBean>();
/**
* Entrega el valor de subject
*
* @return Valor de subject
*/
public String getSubject() {
return this.subject;
}
/**
* Fija un nuevo valor en subject
*
* @param subject nuevo valor para subject
*/
public void setSubject(String subject) {
this.subject = subject;
}
/**
* Metodo que copia los valoes del requestq que llega como parametro.
*
* @param pRequest Datos del request a copiar.
* @throws Exception
*/
public void copy(Request pRequest) throws Exception {
this.copyFields(Request.class.getDeclaredFields(), pRequest);
}
/**
* Metodo que copia los valoes del requestq que llega como parametro.
*
* @param pRequest Datos del request a copiar.
* @throws Exception
*/
public void copy(GeneralRequest pGeneralRequest) throws Exception {
this.copyFields(Request.class.getDeclaredFields(), pGeneralRequest);
// copia los datos del request del que estan el map al request general utilizado en el financiero.
Set<String> s = super.keySet();
for (String key : s) {
pGeneralRequest.put(key, super.get(key));
}
}
/**
* Metodo que fina el valor en request actual los datos del request que llegan como parametro.
*
* @param pFields Arreglo de campos que formn parte del request.
* @param pRequest Datos del request original a copiar.
* @throws Exception
*/
private void copyFields(Field[] pFields, GeneralRequest pGeneralRequest) throws Exception {
for (Field f : pFields) {
try {
Object value = f.get(this);
BeanManager.setBeanAttributeValue(pGeneralRequest, f.getName(), value);
} catch (Exception e) {
continue;
}
}
}
/**
* Metodo que fina el valor en request actual los datos del request que llegan como parametro.
*
* @param pFields Arreglo de campos que formn parte del request.
* @param pRequest Datos del request original a copiar.
* @throws Exception
*/
private void copyFields(Field[] pFields, Request pRequest) throws Exception {
for (Field f : pFields) {
try {
f.set(pRequest, f.get(this));
} catch (Exception e) {
continue;
}
}
}
/**
* Metodo que copia los valoes del requestq que llega como parametro.
*
* @param pRequest Datos del request a copiar.
* @throws Exception
*/
public void copyMapValues(Request pRequest) throws Exception {
Set<String> s = this.keySet();
for (String key : s) {
pRequest.put(key, this.get(key));
}
}
/**
* Metodo que copia los valoes del requestq que llega como parametro.
*
* @param pRequest Datos del request a copiar.
* @throws Exception
*/
public void copyMapValuesWithOutSaveBean(Request pRequest) throws Exception {
Set<String> s = this.keySet();
for (String key : s) {
if(this.get(key) == null || this.get(key) instanceof SaveBean){
continue;
}
pRequest.put(key, this.get(key));
}
}
/**
* Metodo que completa datos del Request en un financial request.
*
* @param pFinancialRequest Objeto a ser completado con los datos del Request.
* @throws Exception
*/
protected void completeFinancialRequest(FinancialRequest pFinancialRequest) throws Exception {
this.copy(pFinancialRequest);
}
/**
* Metodo que crea y entraga un FinancialRequest dado un SaveRequest.
*
* @return FinancialRequest
* @throws Exception
*/
public FinancialRequest toFinancialRequest() throws Exception {
FinancialRequest financialRequest = new FinancialRequest();
this.copy(financialRequest);
return financialRequest;
}
/**
* Entrega el valor de: user
*
* @return String
*/
public String getUser() {
return this.user;
}
/**
* Fija el valor de: user
*
* @param user
*/
public void setUser(String user) {
this.user = user;
}
/**
* Entrega el valor de: internalUserCode
*
* @return Integer
*/
public Integer getInternalUserCode() {
return this.internalUserCode;
}
/**
* Fija el valor de internalUserCode
*
* @param internalUserCode value to set
*/
public void setInternalUserCode(Integer internalUserCode) {
this.internalUserCode = internalUserCode;
}
/**
* Entrega el valor de: language
*
* @return String
*/
public String getLanguage() {
return this.language;
}
/**
* Fija el valor de: language
*
* @param language
*/
public void setLanguage(String language) {
this.language = language;
}
/**
* Entrega el valor de: profile
*
* @return String
*/
public String getProfile() {
return this.profile;
}
/**
* Fija el valor de: profile
*
* @param profile
*/
public void setProfile(String profile) {
this.profile = profile;
}
/**
* Entrega el valor de: transactionModule
*
* @return String
*/
public String getTransactionModule() {
return this.transactionModule;
}
/**
* Fija el valor de: transactionModule
*
* @param transactionModule
*/
public void setTransactionModule(String transactionModule) {
this.transactionModule = transactionModule;
}
/**
* Entrega el valor de: transactionCode
*
* @return Integer
*/
public Integer getTransactionCode() {
return this.transactionCode;
}
/**
* Fija el valor de: transactionCode
*
* @param transactionCode
*/
public void setTransactionCode(Integer transactionCode) {
this.transactionCode = transactionCode;
}
/**
* Entrega el valor de: transactionVersion
*
* @return Integer
*/
public Integer getTransactionVersion() {
return this.transactionVersion;
}
/**
* Fija el valor de: transactionVersion
*
* @param transactionVersion
*/
public void setTransactionVersion(Integer transactionVersion) {
this.transactionVersion = transactionVersion;
}
/**
* Entrega el valor de: terminalCode
*
* @return String
*/
public String getTerminalCode() {
return this.terminalCode;
}
/**
* Fija el valor de: terminalCode
*
* @param terminalCode
*/
public void setTerminalCode(String terminalCode) {
this.terminalCode = terminalCode;
}
/**
* Entrega el valor de: journalId
*
* @return String
*/
public String getJournalId() {
return this.journalId;
}
/**
* Fija el valor de: journalId
*
* @param journalId
*/
public void setJournalId(String journalId) {
this.journalId = journalId;
}
/**
* Entrega el valor de: channelCode
*
* @return String
*/
public String getChannelCode() {
return this.channelCode;
}
/**
* Fija el valor de: channelCode
*
* @param channelCode
*/
public void setChannelCode(String channelCode) {
this.channelCode = channelCode;
}
/**
* Entrega el valor de: company
*
* @return Integer
*/
public Integer getCompany() {
return this.company;
}
/**
* Fija el valor de company
*
* @param company value to set
*/
public void setCompany(Integer company) {
this.company = company;
}
/**
* Entrega el valor de: branchCode
*
* @return Integer
*/
public Integer getBranchCode() {
return this.branchCode;
}
/**
* Fija el valor de: branchCode
*
* @param branchCode
*/
public void setBranchCode(Integer branchCode) {
this.branchCode = branchCode;
}
/**
* Entrega el valor de: officeCode
*
* @return Integer
*/
public Integer getOfficeCode() {
return this.officeCode;
}
/**
* Fija el valor de: officeCode
*
* @param officeCode
*/
public void setOfficeCode(Integer officeCode) {
this.officeCode = officeCode;
}
/**
* Entrega el valor de: areaCode
*
* @return Integer
*/
public Integer getAreaCode() {
return this.areaCode;
}
/**
* Fija el valor de: areaCode
*
* @param areaCode
*/
public void setAreaCode(Integer areaCode) {
this.areaCode = areaCode;
}
/**
* Entrega el valor de: authorizedUser
*
* @return String
*/
public String getAuthorizedUser() {
return this.authorizedUser;
}
/**
* Fija el valor de: authorizedUser
*
* @param authorizedUser
*/
public void setAuthorizedUser(String authorizedUser) {
this.authorizedUser = authorizedUser;
}
/**
* Entrega el valor convertido a Bigdecimal de un objeto del map.
*
* @param key Key de la entrada del map.
* @return BigDecimal
*/
public BigDecimal getBigDecimal(Object key) {
if (this.get(key) instanceof Integer) {
return new BigDecimal((Integer) this.get(key));
}
if (this.get(key) instanceof Long) {
return new BigDecimal((Long) this.get(key));
}
if (this.get(key) == null) {
return BigDecimal.ZERO;
}
return (BigDecimal) this.get(key);
}
/**
* Entrega el valor convertido a Bigdecimal de un objeto del map.
*
* @param key Key de la entrada del map.
* @return BigDecimal
*/
public Date getDate(Object key) throws ParseException {
String value = this.getString(key);
SimpleDateFormat formatt = new SimpleDateFormat("yyyy-MM-dd");
return new Date(formatt.parse(value).getTime());
}
/**
* Entrega el valor convertido a String de un objeto del map.
*
* @param key Key de la entrada del map.
* @return String
*/
public String getString(Object key) {
Object val = this.get(key);
if (val == null) {
throw new RuntimeException("NO SE PUDO DETERMINAR EL VALOR DE " + key);
}
return "" + val;
}
/**
* Entrega el valor convertido a String de un objeto del map.
*
* @param key Key de la entrada del map.
* @return String
*/
public String findString(Object key) {
Object val = this.find(key);
if (val == null) {
throw new RuntimeException("NO SE PUDO DETERMINAR EL VALOR DE " + key);
}
return "" + val;
}
/**
* Entrega el valor de un objeto, busca en el request si no lo encuentra busca en el response.
*
* @param key Key de la entrada del map.
* @return String
*/
public Object find(Object key) {
Object val = this.get(key);
if ((val == null) && (this.response != null)) {
val = this.response.get(key);
}
return val;
}
/**
* Entrega el valor convertido a long de un objeto del map.
*
* @param key Key de la entrada del map.
* @return Long
*/
public Long getLong(Object key) {
return Long.valueOf(this.getString(key));
}
/**
* Entrega el valor convertido a integer de un objeto del map.
*
* @param key Key de la entrada del map.
* @return Integer
*/
public Integer getInteger(Object key) {
return Integer.valueOf(this.getString(key));
}
/**
* Entrega el valor de: logaccount.
*
* @return String
*/
public String getLogaccount() {
return this.logaccount;
}
/**
* Fija el valor de: logaccount.
*
* @param logaccount
*/
public void setLogaccount(String logaccount) {
this.logaccount = logaccount;
}
/**
* Entrega el valor de: logsolicitude.
*
* @return String
*/
public String getLogsolicitude() {
return this.logsolicitude;
}
/**
* Fija el valor de: logsolicitude.
*
* @param logsolicitude
*/
public void setLogsolicitude(String logsolicitude) {
this.logsolicitude = logsolicitude;
}
/**
* Entrega el valor de: logpPerson.
*
* @return Integer
*/
public Integer getLogperson() {
return this.logperson;
}
/**
* Fija el valor de: logsolicitude.
*
* @param logsolicitude
*/
public void setLogperson(Integer logperson) {
this.logperson = logperson;
}
/**
* Entrega el valor de: centrocontrol.
*
* @return String
*/
public String getCentrocontrol() {
return centrocontrol;
}
/**
* Fija el valor de: centrocontrol.
*
* @param centrocontrol
*/
public void setCentrocontrol(String centrocontrol) {
this.centrocontrol = centrocontrol;
}
/**
* Entrega el valor de: unidad.
*
* @return String
*/
public String getUnidad() {
return unidad;
}
/**
* Fija el valor de: unidad.
*
* @param unidad
*/
public void setUnidad(String unidad) {
this.unidad = unidad;
}
protected Map<String, Object> ruleParameters = new HashMap<String, Object>();
/**
* Entrega el valor de ruleParameters
*
* @return Valor de ruleParameters
*/
public Map<String, Object> getRuleParameters() {
return this.ruleParameters;
}
/**
* Entrega el valor de: originalTransactionModule
*
* @return String
*/
public String getOriginalTransactionModule() {
return this.originalTransactionModule;
}
/**
* Fija el valor de: originalTransactionModule
*
* @param originalTransactionModule
*/
public void setOriginalTransactionModule(String originalTransactionModule) {
this.originalTransactionModule = originalTransactionModule;
}
/**
* Entrega el valor de: originalTransactionCode
*
* @return Integer
*/
public Integer getOriginalTransactionCode() {
return this.originalTransactionCode;
}
/**
* Fija el valor de: originalTransactionCode
*
* @param originalTransactionCode
*/
public void setOriginalTransactionCode(Integer originalTransactionCode) {
this.originalTransactionCode = originalTransactionCode;
}
/**
* Entrega el valor de: originalTransactionVersion
*
* @return Integer
*/
public Integer getOriginalTransactionVersion() {
return this.originalTransactionVersion;
}
/**
* Fija el valor de: originalTransactionVersion
*
* @param originalTransactionVersion
*/
public void setOriginalTransactionVersion(Integer originalTransactionVersion) {
this.originalTransactionVersion = originalTransactionVersion;
}
/**
* Entrega el valor de: jounalSequence
*
* @return Integer
*/
public Integer getJounalSequence() {
return this.jounalSequence;
}
/**
* Fija el valor de jounalSequence
*
* @param jounalSequence value to set
*/
public void setJounalSequence(Integer jounalSequence) {
this.jounalSequence = jounalSequence;
}
/**
* Entrega el valor de: onLine
*
* @return boolean
*/
public boolean isOnLine() {
return this.onLine;
}
/**
* Fija el valor de: onLine
*
* @param onLine
*/
public void setOnLine(boolean onLine) {
this.onLine = onLine;
}
/**
* Fija un nuevo valor en ruleParameters
*
* @param pRuleParameters nuevo valor para ruleParameters
*/
public void setRuleParameters(Map<String, Object> pRuleParameters) {
this.ruleParameters = pRuleParameters;
}
public void addRuleParameter(String pName, Object pValue) {
this.ruleParameters.put(pName, pValue);
}
public void cleanRuleParameters() {
this.ruleParameters = new HashMap<String, Object>();
}
public void addRuleParameter(String pNameValue) {
String[] val = pNameValue.split(",");
this.ruleParameters.put(val[0], val[1]);
}
public String getRuleParameterString(String pKey) {
return "" + this.ruleParameters.get(pKey);
}
public boolean getRuleParameterIsYes(String pKey) {
return "Y".compareTo(this.getRuleParameterString(pKey)) == 0;
}
public BigDecimal getRuleParameterBigDecimal(String pKey) {
return new BigDecimal(this.getRuleParameterString(pKey));
}
public Integer getRuleParameterInteger(String pKey) {
return Integer.valueOf(this.getRuleParameterString(pKey));
}
/**
* Entrega el valor de: QueryRequest.java
*
* @return Response
*/
public Response getResponse() {
return this.response;
}
/**
* Fija el valor de: response
*
* @param response Valor a almacenar
*/
public void setResponse(Response response) {
this.response = response;
}
/**
* Filja map con tablas a consultar.
*
* @param mquerytables
* @throws Exception
*/
public void setQueryTables(HashMap<String, DtoQuery> mquerytables) throws Exception {
this.put("MQUERY", mquerytables);
}
/**
* Entrega un map con la metadata de tablas a consultar.
*
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
public HashMap<String, DtoQuery> getQueryTables() throws Exception {
return (HashMap<String, DtoQuery>) this.get("MQUERY");
}
/**
* Filja map con tablas a dar mantenimiento.
*
* @param msavetables
* @throws Exception
*/
public void setSaveTables(HashMap<String, DtoSave> msavetables) throws Exception {
this.put("MSAVE", msavetables);
}
/**
* Entrega un map con la metadata de tablas a dar mantenimiento.
*
* @return HashMap<String, DtoSave>
* @throws Exception
*/
@SuppressWarnings("unchecked")
public HashMap<String, DtoSave> getSaveTables() throws Exception {
return (HashMap<String, DtoSave>) this.get("MSAVE");
}
/**
* Entrega la descripcion del navegador
*
* @return browser
*/
public String getBrowser() {
return browser;
}
/**
* Fija la descripcion del navegador
*
* @param browser
*/
public void setBrowser(String browser) {
this.browser = browser;
}
/**
* Entrega la descripcion del sistema operativo
*
* @return operativesystem
*/
public String getOperativesystem() {
return operativesystem;
}
/**
* Fija la descripcion del sistema operativo
*
* @param operativesystem
*/
public void setOperativesystem(String operativesystem) {
this.operativesystem = operativesystem;
}
/**
* Entrega el nombre de la transaccion
* @return tname
*/
public String getTname() {
return tname;
}
/**
* Fija el nombre de la transaccion
* @param tname
*/
public void setTname(String tname) {
this.tname = tname;
}
}

View File

@ -0,0 +1,139 @@
package com.fp.viaticos.rules.query.informe;
import java.util.ArrayList;
import java.util.List;
import com.fp.bpm.query.QueryJsf;
import com.fp.dto.Response;
import com.fp.dto.query.DtoQuery;
import com.fp.dto.query.Filter;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.helper.FormatDates;
import com.fp.persistence.pviaticos.solicitud.ViaSolicitud;
import com.fp.persistence.pviaticos.solicitud.ViaSolicitudIntegrantes;
import com.fp.persistence.pviaticos.solicitud.ViaSolicitudKey;
import com.fp.persistence.pviaticos.solicitud.ViaSolicitudTransporte;
import com.fp.viaticos.rules.consulta.solicitud.ConsultaSolicitud;
import com.fp.viaticos.rules.enums.EnumCodigos;
public class Informe extends QueryRule{
/**
* Clase que clona los objetos de la solicitud para el informe
*/
private static final long serialVersionUID = 1L;
/**
* Metodo sobreescrito para gestionar la respuesta de la consulta
*/
@SuppressWarnings("unchecked")
@Override
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
String codSolicitud = (String)pQueryRequest.get("csolicitud");
ViaSolicitud informe = ViaSolicitud.find(PersistenceHelper.getEntityManager(), new ViaSolicitudKey(codSolicitud, EnumCodigos.INFORME.getCodigo()));
if(informe!=null){
return pQueryRequest;
}
this.fijaFiltrosSolicitud(pQueryRequest);
Response response = pQueryRequest.getResponse();
QueryJsf query = new QueryJsf();
query.execute(pQueryRequest);
Object object=response.get("SOLICITUD");
List<Object> objectIntegrantes=(List<Object>)response.get("SOLICITUDINTEGRANTES");
List<Object> objectTransporte=(List<Object>)response.get("SOLICITUDTRANSPORTE");
if(object == null){
return pQueryRequest;
}
ViaSolicitud solicitud = (ViaSolicitud) object;
solicitud = (ViaSolicitud)solicitud.cloneMe();
solicitud.setIsnew(true);
ConsultaSolicitud data = new ConsultaSolicitud();
solicitud.setFec_creacion(FormatDates.getInstance().getDataBaseDate());
data.completeInfoSolicitud(solicitud);
response.put("SOLICITUD", solicitud);
response.put("SOLICITUDINTEGRANTES", this.cloneIntegrantes(objectIntegrantes));
response.put("SOLICITUDTRANSPORTE", this.cloneTransporte(objectTransporte));
response.put("CLONE", "Y");
return pQueryRequest;
}
/**
* M&eacute;todo para cambio de filtros
*/
public void fijaFiltrosSolicitud(QueryRequest pQueryRequest) throws Exception{
DtoQuery dtoQuery = (DtoQuery)pQueryRequest.getQueryTables().get("SOLICITUD");
DtoQuery dtoQueryInt = (DtoQuery)pQueryRequest.getQueryTables().get("SOLICITUDINTEGRANTES");
DtoQuery dtoQueryTra = (DtoQuery)pQueryRequest.getQueryTables().get("SOLICITUDTRANSPORTE");
List<Filter> filtros = dtoQuery.getLfilter();
List<Filter> filtrosInt = dtoQueryInt.getLfilter();
List<Filter> filtrosTra = dtoQueryTra.getLfilter();
for(Filter filtro: filtros){
if(filtro.getField().equals("pk.cod_tipo")){
filtro.setValue(EnumCodigos.SOLICITUD.getCodigo());
break;
}
}
for(Filter filtro: filtrosInt){
if(filtro.getField().equals("pk.cod_tipo")){
filtro.setValue(EnumCodigos.SOLICITUD.getCodigo());
break;
}
}
for(Filter filtro: filtrosTra){
if(filtro.getField().equals("pk.cod_tipo")){
filtro.setValue(EnumCodigos.SOLICITUD.getCodigo());
break;
}
}
}
/**
* Método para clonar la lista de objetos ViaSolicitudIntegrantes
* @param object
*/
private List<ViaSolicitudIntegrantes> cloneIntegrantes(List<Object> objects) throws Exception {
List<ViaSolicitudIntegrantes> listIntegrantes = new ArrayList<ViaSolicitudIntegrantes>();
ViaSolicitudIntegrantes integrante;
for(Object objeto:objects)
{
integrante = (ViaSolicitudIntegrantes)objeto;
ViaSolicitudIntegrantes inte = (ViaSolicitudIntegrantes)integrante.cloneMe();
listIntegrantes.add(inte);
}
ConsultaSolicitud data = new ConsultaSolicitud();
data.completeInfoIntegrantes(objects);
return listIntegrantes;
}
/**
* Método para clonar la lista de objetos ViaSolicitudTransporte
* @param object
*/
private List<ViaSolicitudTransporte> cloneTransporte(List<Object> objects) throws Exception {
List<ViaSolicitudTransporte> listTransporte = new ArrayList<ViaSolicitudTransporte>();
ViaSolicitudTransporte transporte;
for(Object objeto:objects)
{
transporte = (ViaSolicitudTransporte)objeto;
ViaSolicitudTransporte trans = (ViaSolicitudTransporte)transporte.cloneMe();
trans.getPk().setCod_secuencia(null);
listTransporte.add(trans);
}
return listTransporte;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,279 @@
<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{sancionarController}"
queryUpdate=""
focusContainer=":formTable:filters"
saveProcess=""
saveUpdate="" />
<p:panelGrid id="sancion" styleClass="m-filters" columns="1" style="width:100%">
<f:facet name="header">
<h:outputText value="SANCIONES" />
</f:facet>
<h:panelGrid columns="1">
<p:dataTable id="dt-table-perm" paginator="true" paginatorPosition="top" rows="10"
paginatorTemplate=" {PreviousPageLink} {NextPageLink}" var="row"
value="#{sancionarController.larmas}"
rowIndexVar="rowIndex" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_armas.lbl_codigo}" resizable="true" >
<h:outputText value="#{row.codigoarma}" resizable="true"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_serie}" resizable="true">
<h:outputText value="#{row.lote}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_longitud}" resizable="true" >
<h:outputText value="#{row.modifiedData['longitud']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_clase}" resizable="true" >
<h:outputText value="#{row.modifiedData['clase']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_tipo}" resizable="true" >
<h:outputText value="#{row.modifiedData['tipoarmaexplosivo']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_calibre}" resizable="true" >
<h:outputText value="#{row.modifiedData['calibre']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_estado}" resizable="true" >
<h:outputText value="#{row.modifiedData['estado']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_color}" resizable="true" >
<h:outputText value="#{row.modifiedData['color']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_marca}" resizable="true">
<h:outputText value="#{row.modifiedData['marca']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_cantidad}" resizable="true" >
<h:outputText value="#{row.cantidad}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_peso}" resizable="true" >
<h:outputText value="#{row.peso}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_unidadcantidad}" resizable="true" >
<h:outputText value="#{row.modifiedData['unidadmedidapeso']}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_sancion}" resizable="true">
<p:commandButton actionListener="#{sancionarController.sancionarPermiso(row)}" update=":sancionPermiso, :sancionPermiso:sancion, :sancionPermiso:pnl1"
oncomplete="if(args.validationFailed){return false;} PF('dialogSancionPermiso').show()"
disabled="#{row.modifiedData['sancionada']}"
icon="ui-icon-print">
</p:commandButton>
</p:column>
</p:dataTable>
</h:panelGrid>
</p:panelGrid>
<h:panelGrid columns="2">
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<p:commandButton id="idComplete" value="#{msg_armas.btn_enviar}" icon="ui-icon-circle-check" disabled="#{!sancionarController.isEnableEnviar}"
process="@this" action="#{sancionarController.completarTarea()}" oncomplete="Maia.loadPageUtil();" />
</h:panelGrid>
</h:panelGrid>
</h:form>
<p:dialog widgetVar="dialogSancionPermiso" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog" style="height:500px !important; overflow:auto" height="500px">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_sancionpermiso}" />
</f:facet>
<h:form id="sancionPermiso">
<p:panelGrid id="filters" columns="1" style="width:900px">
<f:facet name="header">
<h:outputText value="#{msg_armas.fct_datosDelDecomiso}" />
</f:facet>
<h:panelGrid columns="1" >
<h:panelGrid columns="5" >
<p:outputLabel for="numeroRecibo" value="#{msg_armas.lbl_numerorecibo}:" style="display:block;width:160px;"/>
<p:inputText id="numeroRecibo" disabled="true" value="#{sancionarController.decomiso.numerorecibo}" style="width: 220px;" />
<p:spacer width="10"/>
<p:outputLabel for="fechaDeDecomiso" value="#{msg_armas.lbl_fechaDeDecomiso}:" style="display:block;width:140px;"/>
<p:inputText id="fechaDeDecomiso" disabled="true" value="#{sancionarController.decomiso.fechadecomiso}" style="width: 220px;" >
<f:convertDateTime pattern="dd-MM-yyyy"/>
</p:inputText>
<p:outputLabel for="cedulaRucPasaporte" value="#{msg_armas.lbl_cedulaRucPasaporte}:" />
<p:inputText id="cedulaRucPasaporte" disabled="true" value="#{sancionarController.decomiso.numerodocumento}" style="width: 220px;" />
<p:spacer width="10"/>
<p:outputLabel for="fechaDeRegistro" value="#{msg_armas.lbl_fechaDeRegistro}:" />
<p:inputText id="fechaDeRegistro" disabled="true" value="#{sancionarController.decomiso.fecharegistro}" style="width: 220px;" >
<f:convertDateTime pattern="dd-MM-yyyy"/>
</p:inputText>
</h:panelGrid>
<h:panelGrid columns="2" >
<p:outputLabel for="nombrerazonsocial" value="#{msg_armas.lbl_nombrerazonsocial}:" style="display:block;width:160px;"/>
<p:inputText id="nombrerazonsocial" disabled="true" value="#{sancionarController.decomiso.nombrerazonsocial}" style="width: 670px;" />
</h:panelGrid>
<h:panelGrid columns="5" >
<p:outputLabel for="provincia" value="#{msg_armas.lbl_provincia}:" style="display:block;width:160px;"/>
<p:inputText id="provincia" disabled="true" value="#{sancionarController.provincia}" style="width: 220px;" />
<p:spacer width="10"/>
<p:outputLabel for="canton" value="#{msg_armas.lbl_canton}:" style="display:block;width:140px;"/>
<p:inputText id="canton" disabled="true" value="#{sancionarController.canton}" style="width: 220px;" />
<p:outputLabel for="ciudad" value="#{msg_armas.lbl_ciudad}:" />
<p:inputText id="ciudad" disabled="true" value="#{sancionarController.ciudad}" style="width: 220px;" />
<p:spacer width="10"/>
<p:outputLabel for="parroquia" value="#{msg_armas.lbl_parroquia}:" />
<p:inputText id="parroquia" disabled="true" value="#{sancionarController.parroquia}" style="width: 220px;" />
</h:panelGrid>
<h:panelGrid columns="2" >
<p:outputLabel for="direccion" value="#{msg_armas.lbl_direccion}:" style="display:block;width:160px;"/>
<p:inputText id="direccion" disabled="true" value="#{sancionarController.decomiso.direccion}" style="width: 670px;" />
</h:panelGrid>
<h:panelGrid columns="5" >
<p:outputLabel for="decomisadopor" value="#{msg_armas.lbl_decomisadopor}:" style="display:block;width:160px;"/>
<p:inputText id="decomisadopor" disabled="true" value="#{sancionarController.decomiso.funcionario}" style="width: 220px;" />
<p:spacer width="10"/>
<p:outputLabel for="nocedula" value="#{msg_armas.lbl_nocedula}:" style="display:block;width:140px;"/>
<p:inputText id="nocedula" disabled="true" value="#{sancionarController.decomiso.cedulafuncionario}" style="width: 220px;" />
<p:outputLabel for="grado" value="#{msg_armas.lbl_grado}:" />
<p:inputText id="grado" disabled="true" value="#{sancionarController.gradoCatalogDatail.description}" style="width: 220px;" />
<p:spacer width="10"/>
<p:outputLabel for="unidad" value="#{msg_armas.lbl_unidad}:" />
<p:inputText id="unidad" disabled="true" value="#{sancionarController.unidadCatalogDatail.description}" style="width: 270px;" />
</h:panelGrid>
</h:panelGrid>
</p:panelGrid>
<p:panelGrid id="filters2" columns="1" style="width:900px">
<f:facet name="header">
<h:outputText value="#{msg_armas.fct_datosDelArmaSancion}" />
</f:facet>
<h:panelGrid id="sancion" columns="1" style="width:900px">
<h:panelGrid columns="1">
<h:panelGrid columns="1" id="pnl1">
<h:panelGrid columns="4" id="pnl2">
<p:outputLabel for="clase" value="#{msg_armas.lbl_clase}:" style="display:block;width:140px;"/>
<p:inputText id="clase" disabled="true" value="#{sancionarController.armaactual.modifiedData['clase']}" style="width:240px"/>
<p:outputLabel for="fechaInicio" value="#{msg_armas.lbl_fechasancion}:" style="display:block;width:160px;"/>
<p:inputText id="fechaInicio" disabled="true" value="#{sancionarController.sancionDecomisoController.record.fechainicio}" style="width:240px"/>
</h:panelGrid>
<h:panelGrid columns="4" id="pnl3">
<p:outputLabel for="faut1" value="#{msg_armas.lbl_dochabilitante}" style="display:block;width:140px;"/>
<p:selectOneMenu id="faut1" value="#{sancionarController.cdocumentohabilitanteaut}" style="width:230px" rendered="#{!empty sancionarController.autorizacion}">
<f:selectItem itemLabel="NO. DOC" itemValue="#{null}"/>
<p:ajax listener="#{sancionarController.changetype()}" event="change" process="@this faut1" update="sancion"/>
<f:selectItems value="#{sancionarController.autorizacion}" var="vmod" itemLabel="#{vmod.numerodocumento}" itemValue="#{vmod.pk}" />
</p:selectOneMenu>
<p:inputText disabled="true" value="#{sancionarController.documentoHabilitanteController.record.numerodocumento}" style="width:240px" rendered="#{empty sancionarController.autorizacion}"/>
<p:outputLabel for="fechadocumento" value="#{msg_armas.lbl_fechadochabilitante}:" style="display:block;width:160px;"/>
<p:inputText id="fechadocumento" disabled="true" value="#{sancionarController.documentoHabilitanteController.record.fechaemision}" style="width:240px"/>
</h:panelGrid>
<h:panelGrid columns="4" id="pnl4">
<p:outputLabel for="tiptramite" value="#{msg_armas.lbl_tramite}:" style="display:block;width:140px;"/>
<p:inputText id="tiptramite" disabled="true" value="#{sancionarController.tramite.modifiedData['tipoautorizacion']}" style="width:240px"/>
<p:outputLabel for="categoria" value="#{msg_armas.lbl_categoria}:" style="display:block;width:160px;"/>
<p:inputText id="categoria" disabled="true" value="#{sancionarController.tramite.modifiedData['categoria']}" style="width:240px"/>
</h:panelGrid>
<h:panelGrid columns="4" id="pnl5">
<p:outputLabel for="usoactividad" value="#{msg_armas.lbl_usoactividad}:" style="display:block;width:140px;"/>
<p:inputText id="usoactividad" disabled="true" value="#{sancionarController.tramite.modifiedData['usoactividad']}" style="width:240px"/>
<p:outputLabel for="estado" value="#{msg_armas.lbl_estado}:" style="display:block;width:160px;"/>
<p:inputText id="estado" value="#{sancionarController.documentoHabilitanteController.record.modifiedData['estadodocumento']}" disabled="true" style="width:280px;"/>
</h:panelGrid>
<h:panelGrid columns="3" id="pnl6">
<p:outputLabel for="tipsan" value="#{msg_armas.lbl_falta}:" style="display:block;width:140px;"/>
<p:inputTextarea id="tipsan" value="#{sancionarController.sancion.modifiedData['nfalta']}" scrollHeight="50" style="width: 620px;" disabled="true"/>
<p:commandButton id="cargar" icon="ui-icon-link" actionListener="#{sancionarController.openSancionarLov()}" process="@this" disabled="#{!sancionarController.isExistDocHabilitante}" >
<p:ajax event="dialogReturn" listener="#{sancionarController.onReturnSancionLov}" update=":sancionPermiso:pnl6 :sancionPermiso:sancion"/>
</p:commandButton>
</h:panelGrid>
<h:panelGrid columns="2" id="pnl7">
<p:outputLabel for="nfalta" value="#{msg_armas.lbl_sancion}:" style="display:block;width:140px;"/>
<p:inputText id="nfalta" disabled="true" value="#{sancionarController.sancion.modifiedData['nsancion']}" style="width: 440px;" />
</h:panelGrid>
<h:panelGrid columns="5" id="pnl8">
<p:outputLabel for="tfalta" value="#{msg_armas.lbl_tipoDeFalta}:" style="display:block;width:140px;"/>
<p:inputText id="tfalta" disabled="true" value="#{sancionarController.sancion.modifiedData['ntipoFalta']}" style="width: 240px;" />
<p:outputLabel for="tiem" value="#{msg_armas.lbl_tiempo}:" style="display:block;width:160px;"/>
<p:inputText id="tiem" disabled="true" value="#{sancionarController.sancion.modifiedData['ntiempo']}" style="width: 200px;" />
<p:outputLabel value="#{msg_armas.lbl_dias}"/>
</h:panelGrid>
</h:panelGrid>
<h:panelGrid columns="2">
<p:panelGrid columns="1" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_armas.lbl_recomendaciones}" />
</f:facet>
<p:dataTable id="dt-table" paginator="true" paginatorPosition="top" rows="10"
paginatorTemplate=" {PreviousPageLink} {NextPageLink}" var="row"
value="#{sancionarController.sancionRecomendacionController.lrecord}"
rowIndexVar="rowIndex" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_armas.lbl_recomendacion}" resizable="true" style="width: 400px" >
<h:outputText value="#{row.recomendacion}" resizable="true"/>
</p:column>
<p:column headerText="#{msg_general.lbl_usuario}" resizable="true" >
<h:outputText value="#{row.modifiedData['usuario']}" />
</p:column>
</p:dataTable>
</p:panelGrid>
<p:commandButton id="btn" value="#{msg_general.btn_create}" icon="ui-icon-plus" action="#{sancionarController.createRecomendacion}"
oncomplete="PF('dialogCarga').show()" update=":formCarga:pnlDatos :formTable" process="@this,btn" />
</h:panelGrid>
</h:panelGrid>
</h:panelGrid >
</p:panelGrid>
<h:panelGrid columns="5">
<p:commandButton id="actualizar" value="#{msg_general.btn_save}" oncomplete="if(args.validationFailed){return false;} else {PF('dialogSancionPermiso').hide()}"
action="#{sancionarController.actualizarSancion}" icon="ui-icon-disk" process="@this, :sancionPermiso:sancion" update=":formTable:dt-table-perm :formTable:controls" >
<p:confirm header="Confirmation" message="#{msg_armas.lbl_confirmacionguardarsancion}" icon="ui-icon-alert" />
</p:commandButton>
<p:commandButton value="#{msg_general.btn_cancell}" oncomplete="PF('dialogSancionPermiso').hide()" icon="ui-icon-trash" />
<p:confirmDialog global="true" showEffect="fade" hideEffect="explode">
<p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
<p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
</p:confirmDialog>
</h:panelGrid>
<br/><br/><br/>
</h:form>
</p:dialog>
<p:dialog widgetVar="dialogCarga" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog" >
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_createoredit}" />
</f:facet>
<h:form id="formCarga">
<h:panelGrid columns="2" id="pnlDatos">
<p:outputLabel value="#{msg_general.lbl_usuario}:" for="fusr" />
<p:inputText id="fusr" disabled="true" value="#{sancionarController.sancionRecomendacionController.record.modifiedData['usuario']}" style="width: 220px;" />
<p:outputLabel value="#{msg_armas.lbl_recomendacion}:" for="frec"/>
<h:panelGrid columns="2">
<p:inputTextarea id="frec" autoResize="false" required="true"
value="#{sancionarController.sancionRecomendacionController.record.recomendacion}"
maxlength="50" style="width: 220px;resize: none" />
<p:message for="frec"/>
</h:panelGrid>
<p:commandButton id="actualizar" value="Actualizar" oncomplete="if(args.validationFailed){return false;} else {PF('dialogCarga').hide()}"
update=":sancionPermiso:sancion :formCarga:pnlDatos" action="#{sancionarController.actualizarRecomendacion()}" icon="ui-icon-disk" process="@this, pnlDatos" />
<p:commandButton value="#{msg_general.btn_cancell}" oncomplete="PF('dialogCarga').hide()" icon="ui-icon-trash" process="@this " />
</h:panelGrid>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,264 @@
package com.fp.person.rules.query;
import com.fp.bpm.query.Query;
import com.fp.dto.Response;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.helper.FormatDates;
import com.fp.persistence.pcustomer.company.TcustFamiliarlLink;
import com.fp.persistence.pcustomer.company.TcustLegalLink;
import com.fp.persistence.pcustomer.gene.TcustPersonAddress;
import com.fp.persistence.pcustomer.gene.TcustPersonAddressKey;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pcustomer.people.TcustPeopleJob;
import com.fp.persistence.pcustomer.people.TcustPeopleOtherAssets;
import com.fp.persistence.pcustomer.people.TcustPeopleTradereferences;
import com.fp.persistence.pcustomer.people.TcustPeopleVehicle;
import com.fp.persistence.pgeneral.gene.TgeneAccountRelationship;
import com.fp.persistence.pgeneral.gene.TgeneCompany;
import com.fp.persistence.pgeneral.gene.TgeneSolicitudeRelationship;
import com.fp.person.db.DataHelper;
import java.util.List;
/**
* Clase que se encarga de completar el nombre de una persona.
*
* @author Wilson Sigcho
* @version 2.1
*/
public class PersonName extends QueryRule {
private String name = "name";
private String expiratedesignation = "expiratedesignation";
/**
* Metodo que agrega el nombre de una persona, cuando una consulta es requerida.
*
* @param pQueryRequest Objeto que posee la consulta requerida.
* @return pQueryRequest
* @throws Exception
*/
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
Response response = pQueryRequest.getResponse();
Query qry = new Query();
qry.process(pQueryRequest);
List<Object> legallink = (List<Object>) response.get("TCUSTLEGALLINK");
List<Object> familiarlink = (List<Object>) response.get("TCUSTFAMILIARLLINK");
List<Object> genecompany = (List<Object>) response.get("TGENECOMPANYLOV");
List<Object> jobs = (List<Object>) response.get("TCUSTPEOPLEJOB");
List<Object> vehicles = (List<Object>) response.get("TCUSTPEOPLEVEHICLE");
List<Object> otherassets = (List<Object>) response.get("TCUSTPEOPLEOTHERASSETS");
List<Object> tradereferences = (List<Object>) response.get("TCUSTPEOPLETRADEREFERENCES");
List<Object> relationship = (List<Object>) response.get("TGENESOLICITUDERELATIONSHIP");
List<Object> accountrelationship = (List<Object>) response.get("TGENEACCOUNTRELATIONSHIP");
this.completeLegalLink(legallink);
this.completeFamiliarlLink(familiarlink);
this.completeGeneCompany(genecompany);
this.completeJob(jobs);
this.completeVehicles(vehicles);
this.completeOtherAssets(otherassets);
this.completeTradeReferences(tradereferences);
this.completeSolicitudeRealtionShip(relationship);
this.completeAccountRelationShip(accountrelationship);
return pQueryRequest;
}
/**
* Metodo que se encraga de completar el nombre de una persona, en la tabla TcustLegalLink.
*
* @param lDetail Objeto que posee una lista de los registros consultados en la tabla TcustLegalLink.
* @throws Exception
*/
private void completeLegalLink(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TcustLegalLink tcustLegalLink = (TcustLegalLink) obj;
if (tcustLegalLink.getPk().getLinkpersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tcustLegalLink.getPk().getLinkpersoncode());
tcustLegalLink.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tcustLegalLink.addAddtionalInfo(name, null);
}
}
}
/**
* Metodo que se encraga de completar el nombre de una persona, en la tabla TcustFamiliarlLink.
*
* @param lDetail Objeto que posee una lista de los registros consultados en la tabla TcustFamiliarlLink.
* @throws Exception
*/
private void completeFamiliarlLink(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TcustFamiliarlLink tcustFamiliarlLink = (TcustFamiliarlLink) obj;
if (tcustFamiliarlLink.getPk().getLinkpersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tcustFamiliarlLink.getPk().getLinkpersoncode());
tcustFamiliarlLink.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tcustFamiliarlLink.addAddtionalInfo(name, null);
}
}
}
/**
* Metodo que se encraga de completar el nombre de una persona, en la tabla TgeneCompany.
*
* @param lDetail Objeto que posee una lista de los registros consultados en la tabla TgeneCompany.
* @throws Exception
*/
private void completeGeneCompany(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TgeneCompany tgeneCompany = (TgeneCompany) obj;
if (tgeneCompany.getPersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tgeneCompany.getPersoncode());
tgeneCompany.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tgeneCompany.addAddtionalInfo(name, null);
}
}
}
/**
* Metodo que se encarga de completar el nombre del deunio de la empresa
*
* @param lDetail
* @throws Exception
*/
private void completeJob(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TcustPeopleJob tcustPeopleJob = (TcustPeopleJob) obj;
if (tcustPeopleJob != null) {
if (tcustPeopleJob.getPk().getPersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tcustPeopleJob.getPk().getPersoncode());
tcustPeopleJob.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tcustPeopleJob.addAddtionalInfo(name, null);
}
if (tcustPeopleJob.getPk().getPersoncode() != null && tcustPeopleJob.getAddress() != null) {
TcustPersonAddressKey tcustPersonAddressKey = new TcustPersonAddressKey(tcustPeopleJob.getPk().getPersoncode(), tcustPeopleJob.getAddress(), FormatDates.getDefaultExpiryTimestamp());
TcustPersonAddress tcustPersonAddress = TcustPersonAddress.find(PersistenceHelper.getEntityManager(), tcustPersonAddressKey);
tcustPeopleJob.addAddtionalInfo("addressaux", DirectionFull.getFullAddress(tcustPersonAddress));
} else {
tcustPeopleJob.addAddtionalInfo("addressaux", null);
}
}
}
}
/**
* Metodo que se encarga de completar el nombre del beneficiario de la prenda del vehiculo
*
* @param lDetail
* @throws Exception
*/
private void completeVehicles(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TcustPeopleVehicle tcustPeopleVehicle = (TcustPeopleVehicle) obj;
if (tcustPeopleVehicle.getPledgedpersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tcustPeopleVehicle.getPledgedpersoncode());
tcustPeopleVehicle.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tcustPeopleVehicle.addAddtionalInfo(name, null);
}
}
}
/**
* Metodo que se encarga de completar el nombre del beneficiario de la prenda del vehiculo
*
* @param lDetail
* @throws Exception
*/
private void completeOtherAssets(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TcustPeopleOtherAssets tcustPeopleOtherAssets = (TcustPeopleOtherAssets) obj;
if (tcustPeopleOtherAssets.getMortgagepersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tcustPeopleOtherAssets.getMortgagepersoncode());
tcustPeopleOtherAssets.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tcustPeopleOtherAssets.addAddtionalInfo(name, null);
}
}
}
/**
* Metodo que se encarga de completar el nombre del vendedor en referencias comerciales
*
* @param lDetail
* @throws Exception
*/
private void completeTradeReferences(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TcustPeopleTradereferences tcustPeopleTradereferences = (TcustPeopleTradereferences) obj;
if (tcustPeopleTradereferences.getTradepersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tcustPeopleTradereferences.getTradepersoncode());
tcustPeopleTradereferences.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tcustPeopleTradereferences.addAddtionalInfo(name, null);
}
}
}
/**
* Metodo que completa el nombre de la tabla tgenesolicituderelationship
*
* @param lDetail
* @throws Exception
*/
private void completeSolicitudeRealtionShip(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TgeneSolicitudeRelationship tgeneSolicitudeRelationship = (TgeneSolicitudeRelationship) obj;
if (tgeneSolicitudeRelationship.getPk().getPersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tgeneSolicitudeRelationship.getPk().getPersoncode());
tgeneSolicitudeRelationship.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tgeneSolicitudeRelationship.addAddtionalInfo(name, null);
}
}
}
/**
* Metodo que completa el nombre de la tabla tgeneaccountrelationship
*
* @param lDetail
* @throws Exception
*/
private void completeAccountRelationShip(List<Object> lDetail) throws Exception {
if (lDetail == null) {
return;
}
for (Object obj : lDetail) {
TgeneAccountRelationship tgeneAccountRelationship = (TgeneAccountRelationship) obj;
if (tgeneAccountRelationship.getPk().getPersoncode() != null) {
TcustPersonDetail tcustPersonDetail = DataHelper.getInstance().getTcustPersonDetail(tgeneAccountRelationship.getPk().getPersoncode());
tgeneAccountRelationship.addAddtionalInfo(name, tcustPersonDetail.getName());
} else {
tgeneAccountRelationship.addAddtionalInfo(name, null);
}
}
}
}

View File

@ -0,0 +1,797 @@
package com.fp.frontend.controller.armas.parametros;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
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.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.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
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.query.Filter;
import com.fp.dto.save.DtoSave;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.armas.funcionalidad.RegistroArmController;
import com.fp.frontend.controller.armas.solicitud.DecomisoArmaController;
import com.fp.frontend.controller.armas.solicitud.DecomisoController;
import com.fp.frontend.controller.pcustomer.PersonDetailController;
import com.fp.frontend.controller.pgeneral.gene.CantonController;
import com.fp.frontend.controller.pgeneral.gene.CatalogDetailController;
import com.fp.frontend.controller.pgeneral.gene.ParametersController;
import com.fp.frontend.controller.pgeneral.gene.ProvinceController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.parmas.fun.TarmRegistroArmas;
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.parmas.soli.TarmDecomiso;
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.TgeneParameters;
import com.fp.persistence.pgeneral.gene.TgeneProvince;
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
@SuppressWarnings("serial")
@ManagedBean
@ViewScoped
public class ImporteArmasController extends AbstractController<TarmArmas> {
/* CATALOGOS */
/* TIPO ARMA EXPLOSIVO */
private List<TgeneCatalogDetail> listLongitudes;
private List<TgeneCatalogDetail> listCalibres;
private List<TgeneCatalogDetail> listClases;
private List<TgeneCatalogDetail> listTipoArmaExplosivos;
/* ADICONAL */
private List<TgeneCatalogDetail> listMarcas;
private List<TgeneCatalogDetail> listTipoFabricacion;
/**
* Variable para a;adir las armas que se van a Guardar
*/
private List<TarmArmas> listArmas;
/**
* registro del Arma Due;o de las armas
*/
private TarmRegistroArmas registroArma;
/**
* Cabecera del decomiso
*/
private TarmDecomiso tarmDecomiso;
/**
* Variable para listar los errores al cargar el excel
*/
private List<String> listaErrores;
/**
* Mensaje de error
*/
private String mensajeError;
/**
* numero de armas procesadas
*/
private Integer numArmasProcesadas;
/**
* numero de armas con error
*/
private Integer numArmasError;
/**
* numero de armas con error
*/
private Integer numCorrectas;
/**
* Centro de control Policoa Judicia 2/PN07
*/
private TarmCentroControl centroControl;
/**
* Detalle del usuario
*/
private TcustPersonDetail usuario;
/**
* Nombre del centro de control logeado
*/
private String centroControlNombreLogeado;
/**
* Numero de registro
*/
private String numeroRecibo;
/*Constante centro control*/
private String nombreInstitucion;
private String institucion;
/*Cedula del propietario*/
private String cedulaPropietario;
/*motivo incautacion*/
private String motivocatalogo;
/*cantidad de armas*/
private Integer cantidad=1;
@ManagedProperty(value = "#{registroArmController}")
private RegistroArmController registroArmasController;
/**
* Controlador que maneja el decomiso TarmDecomiso
*/
@ManagedProperty(value = "#{decomisoController}")
private DecomisoController decomisoController;
/**
* Controlador que maneja TarmDecomisoArma
*/
@ManagedProperty(value = "#{decomisoArmaController}")
private DecomisoArmaController decomisoArmaController;
public ImporteArmasController() throws Exception {
super(TarmArmas.class);
}
/**
* 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.
*/
private void init() {
try {
this.recperpage = 15; // Cambiar al # reg a mirar.
this.lrecord = new ArrayList<>();
this.record = new TarmArmas();
this.beanalias = "ARMASIMPORTE";
listArmas = new ArrayList<TarmArmas>();
registroArma = new TarmRegistroArmas();
cargaParametros();
cargaCatalogos();
cargaRegistroArma();
cargaUsuarioLogeado();
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
public void cargaParametros(){
nombreInstitucion=codigos("CODIGO.NOM.INSTIT.IMPORTE");//"PJ01"
institucion=codigos("CODIGO.INSTITUCION.IMPORTE");//2
/*Cedula del propietario*/
cedulaPropietario=codigos("CEDULA.PROPIETARIO.IMPORTE");//"999999999";
/*motivo incautacion*/
motivocatalogo=codigos("MOTIVO.IMPORTE");//"9";
}
/**
* M&eacute;todo para obtener los codigos
*/
private String codigos(String parametro){
TgeneParameters tgeneParameters= ParametersController.find(parametro, "1");
return tgeneParameters.getTextvalue();
}
public void cargaCatalogos() {
/* TIPOARMAEXPLOSIVO */
listLongitudes = CatalogDetailController.find("LONGITUD");
listCalibres = CatalogDetailController.find("CALIBRE");
listClases = CatalogDetailController.find("CLASE");
listTipoArmaExplosivos = CatalogDetailController.find("TIPOARMAEXPLOSIVO");
/* CATALOGO AD */
listMarcas = CatalogDetailController.find("MARCA");
listTipoFabricacion = CatalogDetailController.find("TIPOFABRICACION");
//listColor = CatalogDetailController.find("COLOR");
}
public void cargaUsuarioLogeado(){
TsafeUserDetail tsafeUserDetail=(TsafeUserDetail)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
usuario=PersonDetailController.find(tsafeUserDetail.getPk().getPersoncode().toString());
centroControlNombreLogeado = tsafeUserDetail.getModifiedData().get("centrocontrol").toString();
}
public void cargaRegistroArma() {
TcustPersonDetail tcustPersonDetail = PersonDetailController.findByIdentification(cedulaPropietario);
registroArma.setPersoncode(tcustPersonDetail.getPk().getPersoncode());
registroArma.setFcreacion(new java.sql.Date(new Date().getTime()));
registroArma.setTiporegistro("INCA");
registroArma.setTiporegistrocodigo("TIPOREGISTRO");
registroArma.setPaisorigen("");
registroArma.setIsnew(true);
List<TarmCentroControl>listCentroControls= CentroControlArmasController.findxOrganismoUnidad(institucion,nombreInstitucion);
if(listCentroControls!=null && listCentroControls.size()==1){
centroControl=listCentroControls.get(0);
}else{
centroControl=null;
mensajeError="NO TIENE REGISTRADO UN CENTRO DE CONTROL O TIENE REGISTRADO MAS DE UNO CON EL MISMO NOMBRE DE INSTITUCI\u00d3N Y NOMBRE INSTITUCI\u00d3N";
}
}
/*
* (non-Javadoc)
*
* @see com.fp.frontend.controller.AbstractController#querydatabase()
*/
@SuppressWarnings("unchecked")
@Override
public void querydatabase() {
try {
DtoQuery dto = super.getDtoQuery(true);
Filter filtrofecha = new Filter();
filtrofecha
.setSql("t.fecharegistro=(select max(ta.fecharegistro) from TarmArmas ta where t.codigoarma=ta.codigoarma and t.cregistro=ta.cregistro) and t.estado !='DEST' and t.estado !='CDP'");
dto.addFiltro(filtrofecha);
dto.setOrderby("pk");
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(this.beanalias, dto); // permite adicionar mas de una tabla.
Request request = this.callerhelper.getRequest();
request.setQueryTables(mtables);
request.put("queryalias", "ARMASCOMPLETE");
Response resp = this.callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
this.lrecord = new ArrayList<TarmArmas>();
MessageHelper.setMessageError(resp);
} else {
this.lrecord = (List<TarmArmas>) resp.get(this.beanalias);
if (!lrecord.isEmpty()) {
record = lrecord.get(0);
}
super.postQuery(this.lrecord);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@Override
public void save() {
try {
if(centroControl==null){
MessageHelper.setMessageError("NO TIENE CENTRO DE CONTROL REVISE EL CENTRO DE CONTROL");
return;
}
if(listArmas==null || listArmas.size()==0 || listArmas.isEmpty()){
MessageHelper.setMessageError("NO EXISTEN ARMAS CARGADAS ");
return;
}
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
Request request = this.callerhelper.getRequest();
// regstroArma
registroArmasController.clearAll();
registroArmasController.setRecord(registroArma);
registroArmasController.update();
DtoSave dtosaveregistroarma = registroArmasController.getDtoSave(true);
dtosaveregistroarma.setPosition(1);
msave.put(registroArmasController.getBeanalias(),dtosaveregistroarma);
// cargar Armas
this.clearAll();
cargarArmas();
DtoSave dtosave = super.getDtoSave(true);
dtosave.setPosition(2);
msave.put(this.beanalias, dtosave);
//carga tarmdecomiso
decomisoController.clearAll();
tarmDecomiso= new TarmDecomiso();
tarmDecomiso.setIsnew(true);
tarmDecomiso.setTipoprocesocode("TIPOREGISTRO");
tarmDecomiso.setTipoproceso("INCA");
tarmDecomiso.setCcentrocontrol(centroControl.getPk());
tarmDecomiso.setNumerorecibo(numeroRecibo);//numero de oficio
tarmDecomiso.setFecharegistro(new java.sql.Date(new Date().getTime()));
//tarmDecomiso.setOrganismocontrol(centroControlNombreLogeado);
tarmDecomiso.setOrganismocontrol(centroControl.getModifiedData().get("desinstitucion").toString());
tarmDecomiso.setPersoncoderegistra(usuario.getPk().getPersoncode());
//tarmDecomiso.setNumerotransaccion(pNumerotransaccion);
decomisoController.setRecord(tarmDecomiso);
decomisoController.update();
DtoSave dtoDecomiso = decomisoController.getDtoSave(true);
dtoDecomiso.setPosition(3);
msave.put("IMPORTEDECOMISO",dtoDecomiso);
//Tarmdecomisoarma
decomisoArmaController.clearAll();
DtoSave dtoDecomisoArma = decomisoArmaController.getDtoSave(true);
dtoDecomisoArma.setPosition(4);
msave.put(decomisoArmaController.getBeanalias(),dtoDecomisoArma);
request.setSaveTables(msave);
//request.getModifiedData().put("REGISTRO", this.registroArma);
Response resp = this.callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
this.postCommit(resp);
mensajeError=null;
MessageHelper.setMessageInfo(resp);
listArmas.clear();
} else {
MessageHelper.setMessageError(resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@Override
public void postCommit(Response response) throws Exception {
super.postCommitGeneric(response, beanalias);
}
public void cargarArmas() throws Exception {
for (TarmArmas item : listArmas) {
item.setEstadoDecomiso(numeroRecibo);
this.record = item;
record.setIsnew(true);
super.update();
}
}
/**
* Metodo que carga y valida el contenido de un archivo excel con
* informaci&oacute;n de armas
*
* @param event
*/
public void cargarArchivo(FileUploadEvent event) {
listArmas = new ArrayList<TarmArmas>();
listaErrores = new ArrayList<String>();
int cont = 0;
Map<String,String>mapaSerie=new HashMap<String,String>();
try {
UploadedFile selectedFile = event.getFile();
InputStream archivo = selectedFile.getInputstream();
XSSFWorkbook libro = new XSSFWorkbook(archivo);
XSSFSheet hoja = libro.getSheetAt(0);
// Iterando sobre las filas
Iterator<Row> rowIterator = hoja.iterator();
// Cargando el contenido de las celdas a una lista de objetos
while (rowIterator.hasNext()) {
Row row = rowIterator.next();
if(cont!=0){
System.out.println("NUMERO REGISTROS........."+cont);
Cell orden = row.getCell(0);
Cell longuitud = row.getCell(14);
Cell calibre = row.getCell(5);
Cell clase = row.getCell(1);//material
Cell tipoArmaExplosivo = row.getCell(2);// modelo: REVOLVER CARTUCHERA CARTUCHERANO CARABINA SUB-AMETRALLADORA*revisar
Cell marca = row.getCell(3);
Cell tipoFabricacion = row.getCell(7);
Cell serie = row.getCell(4);
Cell fechaRecepcion = row.getCell(9);
Cell motivo = row.getCell(10);
Cell descripcionProvincia= row.getCell(12);
Cell descripcionCanton= row.getCell(13);
Cell observaciones= row.getCell(15);
if (!this.celdaVacia(orden)
&& !this.celdaVacia(longuitud)
&& !this.celdaVacia(calibre)
&& !this.celdaVacia(clase)
&& !this.celdaVacia(tipoArmaExplosivo)
&& !this.celdaVacia(marca)
&& !this.celdaVacia(tipoFabricacion)
&& !this.celdaVacia(serie)
&& !this.celdaVacia(fechaRecepcion)
&& !this.celdaVacia(motivo)
&& !this.celdaVacia(descripcionProvincia)
&& !this.celdaVacia(descripcionCanton)
&& !this.celdaVacia(observaciones)) {
TarmArmas arma = armarlistaArmasExcel(longuitud,calibre,clase,tipoArmaExplosivo,marca,tipoFabricacion, cont, serie,descripcionProvincia,descripcionCanton);
if (arma != null) {
arma.getModifiedData().put("motivo", motivo.toString().trim());
arma.getModifiedData().put("observaciondecomiso", observaciones.toString().trim());
arma.getModifiedData().put("cantidad",cantidad);
arma.getModifiedData().put("motivocatalogocode","MOTIVODECOMISO");
arma.getModifiedData().put("motivocatalogo",motivocatalogo);//entrega voluntaria
//dd/MM/yyyy
try {
//validar si la serie es repetida
String serieAux=null;
if(mapaSerie==null || mapaSerie.size()==0){
serieAux=serie.toString().trim();
mapaSerie.put(serieAux,serieAux);
}else{
serieAux=mapaSerie.get(serie.toString());
if(serieAux==null || serieAux.isEmpty()){
serieAux=serie.toString().trim();
mapaSerie.put(serieAux,serieAux);
}else{
serieAux=null;
listaErrores.add("SERIE DUPLICADA" + serie.toString()+ " DEL REGISTRO: "+cont);
}
}
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy"); //formatter.parse("7-OCT-016");
Date date = formatter.parse(fechaRecepcion.toString().trim());
Calendar cal= Calendar.getInstance();
cal.setTime(date);
String anio=cal.get(Calendar.YEAR)+"";
if(anio!=null && anio.trim().length()==4 && cal.get(Calendar.YEAR)>1900){
arma.getModifiedData().put("fechaRecepcion",date);
arma.getModifiedData().put("fechaDecomiso",date);
//ANIADE EL ARMA
if(serieAux!=null && !serieAux.isEmpty()){
listArmas.add(arma);
}
}else{
listaErrores.add("PROBLEMA CON LA FECHA DE RECEPCI\u00d3N " + fechaRecepcion.toString()+ ", EL A\u00d1O: "+anio+" NO CORRESPONDE AL FORMATO, EL FORMATO ES dd-MMM-yyyy EJ:(04-OCT-2017), DEL REGISTRO: "+cont);
}
} catch (Exception e) {
listaErrores.add("PROBLEMA CON LA FECHA DE RECEPCI\u00d3N " + fechaRecepcion.toString()+ ", EL FORMATO ES dd-MMM-yyyy EJ:(04-OCT-2017), DEL REGISTRO: "+cont);
}
}
} else {
listaErrores.add("EL REGISTRO TIENE CAMPOS EN BLANCO, REGISTRO: " + cont);
}
cont++;
}else{
cont++;
}
}
} catch (Exception e) {
MessageHelper.setMessageError(e);
} finally {
numArmasProcesadas=cont-1;
if (!listaErrores.isEmpty()) {
MessageHelper.setMessageError("ERRORES ENCONTRADOS DENTRO DEL ARCHIVO EXCEL: ");
mensajeError="ERROR EN LA CARGA DE ARMAS";
// for (String itemError : listaErrores) {
// mensajeError=mensajeError+" <BR/> "+itemError;
// }
numCorrectas=listArmas.size();
listArmas.clear();
}else{
numCorrectas=listArmas.size();
}
numArmasError =listaErrores.size();
}
}
private TarmArmas armarlistaArmasExcel(Cell longuitud, Cell calibre,Cell clase, Cell tipoArmaExplosivo, Cell marca,
Cell tipoFabricacion, int cont, Cell serie,Cell descripcionProvincia,Cell descripcionCanton) {
TarmArmas armaRegistro = null;
TarmTipoArmaExplosivo tarmTipoArmaExplosivo = null;
String longuitudCodigo = validarCatalogo(listLongitudes, longuitud.toString().trim());
if(longuitudCodigo==null || longuitudCodigo.isEmpty()){
listaErrores.add("LA DESCRIPCI\u00d3N DE LA LONGUITUD: "+longuitud.toString()+" NO EXISTE EN EL CAT\u00c1LOGO, DEL REGISTRO: "+ cont);
}
String calibreCodigo = validarCatalogo(listCalibres, calibre.toString().trim());
if(calibreCodigo==null || calibreCodigo.isEmpty()){
listaErrores.add("LA DESCRIPCI\u00d3N DEL CALIBRE: "+calibre.toString()+" NO EXISTE EN EL CAT\u00c1LOGO, DEL REGISTRO: "+ cont);
}
String claseCodigo = validarCatalogo(listClases, clase.toString().trim());
if(claseCodigo==null || claseCodigo.isEmpty()){
listaErrores.add("LA DESCRIPCI\u00d3N DE LA CLASE: "+clase.toString()+" NO EXISTE EN EL CAT\u00c1LOGO, DEL REGISTRO: "+ cont);
}
String tipoArmaExplosivoCodigo = validarCatalogo(listTipoArmaExplosivos, tipoArmaExplosivo.toString().trim());
if(tipoArmaExplosivoCodigo==null || tipoArmaExplosivoCodigo.isEmpty()){
listaErrores.add("LA DESCRIPCI\u00d3N DEL TIPO ARMA EXPLOSIVO: "+tipoArmaExplosivo.toString()+" NO EXISTE EN EL CAT\u00c1LOGO, DEL REGISTRO: "+ cont);
}
String unidadMedidaPesoCodigo = "UNIDAD";
String marcaCodigo = validarCatalogo(listMarcas, marca.toString().trim());// MARCA
if (marcaCodigo == null) {
listaErrores.add("LA MARCA DEL ARMA: "+marca.toString()+" NO EXISTE EN EL CAT\u00c1LOGO, DEL REGISTRO: "+ cont);
}
String tipoFabricacionCodigo = validarCatalogo(listTipoFabricacion, tipoFabricacion.toString().trim());// TIPOFABRICACION
if (tipoFabricacionCodigo == null) {
listaErrores.add("EL TIPO DE FABRICACI\u00d3N: "+tipoFabricacion.toString()+" NO EXISTE EN EL CAT\u00c1LOGO, DEL REGISTRO: "+ cont);
}
/*Ubicacion Provincia canton*/
TgeneProvince province=null;
TgeneCanton canton=null;
List<TgeneProvince>listProvincias=ProvinceController.findxDescripcion("EC", null, descripcionProvincia.toString().trim());
if(listProvincias!=null ){
if(listProvincias.size()==1){
province=listProvincias.get(0);
List<TgeneCanton> listCantons= CantonController.find("EC", province.getPk().getProvincecode());
if(listCantons!=null && listCantons.size()!=0){
for (TgeneCanton item : listCantons) {
if(item.getDescription().trim().equals(descripcionCanton.toString().trim())){
canton=item;
}
}
if(canton==null){
listaErrores.add(" NO EXISTEN CANTONES ASOCIADOS CON LA PROVINCIA: "+descripcionProvincia.toString()+", DEL REGISTRO: "+ cont);
}
}else{
listaErrores.add(" NO EXISTEN CANTONES ASOCIADOS CON LA PROVINCIA: "+descripcionProvincia.toString()+", DEL REGISTRO: "+ cont);
}
}else{
listaErrores.add(" EXISTE MAS DE UNA PROVINCIA: "+descripcionProvincia.toString()+" CON ESTA DESCRIPCI\u00d3N, DEL REGISTRO: "+ cont);
}
}else{
listaErrores.add(" NO EXISTE LA PROVINCIA: "+descripcionProvincia.toString()+" EN EL CAT\u00c1LOGO, DEL REGISTRO: "+ cont);
}
if (marcaCodigo == null || tipoFabricacionCodigo == null || province==null || canton==null) {
return null;
}
/*System.out.println("longuitudCodigo.."+longuitudCodigo);
System.out.println("calibreCodigo.."+calibreCodigo);
System.out.println("claseCodigo.."+claseCodigo);
System.out.println("tipoArmaExplosivoCodigo.."+tipoArmaExplosivoCodigo);
System.out.println("unidadMedidaPesoCodigo.."+unidadMedidaPesoCodigo);
*/
if (longuitudCodigo != null && calibreCodigo != null && claseCodigo != null && tipoArmaExplosivoCodigo != null) {
tarmTipoArmaExplosivo = ImporteTipoArmaExplosivoController.findpk(longuitudCodigo, calibreCodigo, claseCodigo,tipoArmaExplosivoCodigo, unidadMedidaPesoCodigo);
if (tarmTipoArmaExplosivo != null) {
armaRegistro = new TarmArmas();
armaRegistro.setMarca(marcaCodigo);
armaRegistro.setMarcacodigo("MARCA");
armaRegistro.setTipofabricacion(tipoFabricacionCodigo);
armaRegistro.setTipofabricacioncodigo("TIPOFABRICACION");
//armaRegistro.setColor(colorCodigo);
armaRegistro.setColorcodigo("COLOR");
armaRegistro.setUnidadmedidacantidad("UNIDAD");
armaRegistro.setUnidadmedidacantidadcodigo("UNIDADMEDIDA");
armaRegistro.setEstado("INC");
armaRegistro.setEstadocodigo("ESTADOARMA");
armaRegistro.setCountrycode("EC");
armaRegistro.setProvincecode(province.getPk().getProvincecode());
armaRegistro.setCantoncode(canton.getPk().getCantoncode());
//armaRegistro.setParroquiacode("");
// armaRegistro.setCregistro();
armaRegistro.setCitycode("");
armaRegistro.setLote(serie.toString().trim());
armaRegistro.setCantidad(cantidad);
// armaRegistro.setSeriecanon();
// armaRegistro.setDireccion();
armaRegistro.setFecharegistro(new java.sql.Date(new Date().getTime()));
armaRegistro.setCtipoarmaexplosivo(tarmTipoArmaExplosivo.getPk());
armaRegistro.setEstadoDecomiso("INC");
} else {
listaErrores.add("LA COMBINACION DEL ARMA NO EXISTE EN EL REGISTRO: " + cont+ " ");
}
}
// else {
// listaErrores.add("EL REGISTRO " + cont + " LA COMBINACION DEL ARMA NO EXISTE");
// }
return armaRegistro;
}
public String validarCatalogo(List<TgeneCatalogDetail> listCatalogo,String descripcion) {
String codigo = null;
for (TgeneCatalogDetail item : listCatalogo) {
if (item.getDescription().equals(descripcion)) {
codigo = item.getPk().getCatalog();
break;
}
}
return codigo;
}
/**
* Metodo que indica cuando una celda esta vacia
* @param celda
* @return
*/
private Boolean celdaVacia(Cell celda) {
Boolean vacia = false;
if (celda == null || celda.getCellType() == Cell.CELL_TYPE_BLANK||
(celda.getCellType() == Cell.CELL_TYPE_STRING && celda.getStringCellValue().isEmpty())) {
vacia = true;
}
return vacia;
}
@SuppressWarnings("finally")
private File generarArchivoError(Long key) {
if (listaErrores.isEmpty()) {
return null;
}
PrintWriter escribir = null;
File archivo = null;
try {
archivo = File.createTempFile("errorlog" + key, ".txt");
escribir = new PrintWriter(archivo);
for (String err : listaErrores) {
escribir.print(err + "\r\n");
}
limpiar();
} catch (IOException e) {
e.printStackTrace();
} finally {
escribir.flush();
escribir.close();
return archivo;
}
}
/**
* Llama a la construccion del metodo para recargar
*/
public void descargarArchivo() {
if(listaErrores!=null && listaErrores.size()>0){
Long key = new Date().getTime();
File archivoTemporal = generarArchivoError(key);
if (archivoTemporal == null)
return;
try {
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.addHeader("Content-disposition","attachment; filename=errorlog" + key + ".txt");
OutputStream out = response.getOutputStream();
InputStream inputStream = new FileInputStream(archivoTemporal.getAbsolutePath());
int read = 0;
byte[] bytes = new byte[1024];
while ((read = inputStream.read(bytes)) != -1) {
out.write(bytes, 0, read);
}
inputStream.close();
out.flush();
FacesContext.getCurrentInstance().responseComplete();
} catch (Exception e) {
}
}else{
MessageHelper.setMessageError("NO TIENE ERRORES");
}
}
/**
* Limpia las los valores en las listas
*/
public void limpiar() {
try {
create();
while (lrecord.iterator().hasNext()) {
record = lrecord.get(0);
remove();
}
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
public String getCodigoCiudad() {
return codigoCiudad;
}
public void setCodigoCiudad(String codigoCiudad) {
this.codigoCiudad = codigoCiudad;
}
String codigoCiudad;
public void codigoCiudad() {
}
public void addPersoncodeFilter(String personcode) {
super.addFilter("pk.personcode", personcode);
}
public List<String> getListaErrores() {
return listaErrores;
}
public void setListaErrores(List<String> listaErrores) {
this.listaErrores = listaErrores;
}
public RegistroArmController getRegistroArmasController() {
return registroArmasController;
}
public void setRegistroArmasController(
RegistroArmController registroArmasController) {
this.registroArmasController = registroArmasController;
}
public String getMensajeError() {
return mensajeError;
}
public void setMensajeError(String mensajeError) {
this.mensajeError = mensajeError;
}
public Integer getNumArmasProcesadas() {
return numArmasProcesadas;
}
public void setNumArmasProcesadas(Integer numArmasProcesadas) {
this.numArmasProcesadas = numArmasProcesadas;
}
public Integer getNumArmasError() {
return numArmasError;
}
public void setNumArmasError(Integer numArmasError) {
this.numArmasError = numArmasError;
}
public String getNumeroRecibo() {
return numeroRecibo;
}
public void setNumeroRecibo(String numeroRecibo) {
this.numeroRecibo = numeroRecibo;
}
public TarmCentroControl getCentroControl() {
return centroControl;
}
public void setCentroControl(TarmCentroControl centroControl) {
this.centroControl = centroControl;
}
public String getCentroControlNombreLogeado() {
return centroControlNombreLogeado;
}
public void setCentroControlNombreLogeado(String centroControlNombreLogeado) {
this.centroControlNombreLogeado = centroControlNombreLogeado;
}
public DecomisoController getDecomisoController() {
return decomisoController;
}
public void setDecomisoController(DecomisoController decomisoController) {
this.decomisoController = decomisoController;
}
public DecomisoArmaController getDecomisoArmaController() {
return decomisoArmaController;
}
public void setDecomisoArmaController(
DecomisoArmaController decomisoArmaController) {
this.decomisoArmaController = decomisoArmaController;
}
public Integer getNumCorrectas() {
return numCorrectas;
}
public void setNumCorrectas(Integer numCorrectas) {
this.numCorrectas = numCorrectas;
}
public TarmDecomiso getTarmDecomiso() {
return tarmDecomiso;
}
public void setTarmDecomiso(TarmDecomiso tarmDecomiso) {
this.tarmDecomiso = tarmDecomiso;
}
}

View File

@ -0,0 +1,92 @@
<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<h:form id="formPersonPhone">
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_phones}" />
</f:facet>
<p:dataTable id="phones" var="row" value="#{tramiteArmasController.telefono.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_general.lbl_phonetype}" resizable="true" sortBy="#{row.phonetypecatalog}">
<h:outputText value="#{row.modifiedData['phonetype']}" />
</p:column>
<p:column headerText="#{msg_general.lbl_numaddress}" resizable="true" sortBy="#{row.addressnumber}">
<h:outputText value="#{row.addressnumber}" />
</p:column>
<p:column headerTextb="#{msg_general.lbl_area}" resizable="true" sortBy="#{row.areacode}">
<h:outputText value="#{row.areacode}" />
</p:column>
<p:column headerText="#{msg_general.lbl_numphone}" resizable="true" sortBy="#{row.phonenumber}">
<h:outputText value="#{row.phonenumber}" />
</p:column>
<p:column headerText="#{msg_general.lbl_numextension}" resizable="true" sortBy="#{row.extension}">
<h:outputText value="#{row.extension}" />
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_edit}" update=":#{p:component('pEditPhone')}" oncomplete="dialogPhone.show()" styleClass="m-action-button" icon="ui-icon-pencil" process="@this, phones">
<f:setPropertyActionListener target="#{tramiteArmasController.telefono.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialogPhone" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_createoredit}" />
</f:facet>
<h:form id="formPhone">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
<h:panelGrid id="pEditPhone" columns="4" bodyrows="1" >
<p:outputLabel for="phonetypecatalog" value="#{msg_general.lbl_phonetype}:" />
<pe:keyFilter/>
<p:selectOneMenu id="phonetypecatalog" value="#{tramiteArmasController.telefono.record.phonetypecatalog}" var="p" style="width:135px" panelStyle="width:135px" disabled="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{tramiteArmasController.telefono.lphonetype}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.catalog}" />
</p:selectOneMenu>
<p:message for="phonetypecatalog" />
<p:outputLabel for="addressnumber" value="#{msg_general.lbl_address}:" />
<pe:keyFilter/>
<p:selectOneMenu id="addressnumber" value="#{tramiteArmasController.telefono.record.addressnumber}" var="p" rendered="#{!tramiteArmasController.telefono.showRow}" disabled="true">
<f:selectItem itemLabel="" itemValue="#{null}" />
<f:selectItems value="#{peopleFastController.address.lrecord}" var="id"
itemLabel="#{id.address} #{id.streetnumber} #{id.department} #{id.street} #{id.urbanization} #{id.remark}" itemValue="#{id.pk.addressnumber.toString()}" />
</p:selectOneMenu>
<p:message for="addressnumber" />
<p:outputLabel for="areacode" value="#{msg_general.lbl_area}:" />
<pe:keyFilter for="areacode" mask="int"/>
<p:inputText id="areacode" value="#{tramiteArmasController.telefono.record.areacode}"
maxlength="4" style="width:60px;" disabled="true"/>
<p:message for="areacode" />
<p:outputLabel for="phonenumber" value="#{msg_general.lbl_numphone}:" />
<pe:keyFilter for="phonenumber" mask="int"/>
<p:inputText id="phonenumber"
value="#{tramiteArmasController.telefono.record.phonenumber}"
maxlength="12" disabled="true"
style="width:120px;" />
<p:message for="phonenumber" />
<p:outputLabel for="extension" value="#{msg_general.lbl_numextension}:" />
<pe:keyFilter for="extension" mask="int"/>
<p:inputText id="extension" value="#{tramiteArmasController.telefono.record.extension}"
maxlength="6" style="width:60px;" disabled="true"/>
<p:message for="extension" />
</h:panelGrid>
<h:panelGrid columns="2" >
<p:commandButton value="#{msg_general.btn_cancell}" oncomplete="dialogPhone.hide()" icon="ui-icon-trash" process="@this" />
</h:panelGrid>
</h:form>
</p:dialog>
</ui:composition>

View File

@ -0,0 +1,96 @@
package ec.gob.bsg.accesobsgservice;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
import com.fp.webservices.snap.recursos.MsgSnap;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.6b21
* Generated source version: 2.2
*
*/
@WebServiceClient(name = "AccesoBSGService", targetNamespace = "http://bsg.gob.ec/AccesoBSGService", wsdlLocation = "https://bsg.gob.ec/sw/STI/BSGSW08_Acceder_BSG?wsdl")
public class AccesoBSGService
extends Service
{
private final static URL ACCESOBSGSERVICE_WSDL_LOCATION;
private final static WebServiceException ACCESOBSGSERVICE_EXCEPTION;
private final static QName ACCESOBSGSERVICE_QNAME = new QName("http://bsg.gob.ec/AccesoBSGService", "AccesoBSGService");
static {
URL url = null;
WebServiceException e = null;
try {
url = new URL(MsgSnap.getString("url_permiso_client"));
} catch (MalformedURLException ex) {
e = new WebServiceException(ex);
}
ACCESOBSGSERVICE_WSDL_LOCATION = url;
ACCESOBSGSERVICE_EXCEPTION = e;
}
public AccesoBSGService() {
super(__getWsdlLocation(), ACCESOBSGSERVICE_QNAME);
}
public AccesoBSGService(WebServiceFeature... features) {
super(__getWsdlLocation(), ACCESOBSGSERVICE_QNAME, features);
}
public AccesoBSGService(URL wsdlLocation) {
super(wsdlLocation, ACCESOBSGSERVICE_QNAME);
}
public AccesoBSGService(URL wsdlLocation, WebServiceFeature... features) {
super(wsdlLocation, ACCESOBSGSERVICE_QNAME, features);
}
public AccesoBSGService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public AccesoBSGService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns BSG04AccederBSG
*/
@WebEndpoint(name = "BSG04_Acceder_BSGPort")
public BSG04AccederBSG getBSG04AccederBSGPort() {
return super.getPort(new QName("http://bsg.gob.ec/AccesoBSGService", "BSG04_Acceder_BSGPort"), BSG04AccederBSG.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns BSG04AccederBSG
*/
@WebEndpoint(name = "BSG04_Acceder_BSGPort")
public BSG04AccederBSG getBSG04AccederBSGPort(WebServiceFeature... features) {
return super.getPort(new QName("http://bsg.gob.ec/AccesoBSGService", "BSG04_Acceder_BSGPort"), BSG04AccederBSG.class, features);
}
private static URL __getWsdlLocation() {
if (ACCESOBSGSERVICE_EXCEPTION!= null) {
throw ACCESOBSGSERVICE_EXCEPTION;
}
return ACCESOBSGSERVICE_WSDL_LOCATION;
}
}

View File

@ -0,0 +1,60 @@
package com.fp.persistence.parmas.dto.ws;
import java.io.Serializable;
public class ImagenDto implements Serializable {
private static final long serialVersionUID = 1L;
/**
* C&oacute;digo de la imagen
*/
private Integer codigoImagen;
/**
* Content type de la imagen
*/
private String tipoContenido;
/**
* La imagen en bytes
*/
private byte[] imagen;
/**
* La extensi&oacute;n de la imagen
*/
private String extension;
/**
* Size de la imagen
*/
private Integer tamanioImagen;
public Integer getCodigoImagen() {
return codigoImagen;
}
public void setCodigoImagen(Integer codigoImagen) {
this.codigoImagen = codigoImagen;
}
public String getTipoContenido() {
return tipoContenido;
}
public void setTipoContenido(String tipoContenido) {
this.tipoContenido = tipoContenido;
}
public byte[] getImagen() {
return imagen;
}
public void setImagen(byte[] imagen) {
this.imagen = imagen;
}
public String getExtension() {
return extension;
}
public void setExtension(String extension) {
this.extension = extension;
}
public Integer getTamanioImagen() {
return tamanioImagen;
}
public void setTamanioImagen(Integer tamanioImagen) {
this.tamanioImagen = tamanioImagen;
}
}

View File

@ -0,0 +1,464 @@
package com.fp.frontend.controller.armas.eval;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import org.primefaces.context.RequestContext;
import com.fp.dto.AbstractDataTransport;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.dto.save.DtoSave;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.armas.parametros.PreguntasParaEvaluacionesController;
import com.fp.frontend.controller.pgeneral.gene.CatalogDetailController;
import com.fp.frontend.controller.pgeneral.gene.ParametersController;
import com.fp.frontend.enums.EnumLovOption;
import com.fp.frontend.helper.MessageHelper;
import com.fp.frontend.utility.MsgControlArmas;
import com.fp.persistence.parmas.eval.TarmPreguntas;
import com.fp.persistence.parmas.eval.TarmRespuestas;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetail;
import com.fp.persistence.pgeneral.gene.TgeneParameters;
/**
* Clase controladora del lov asociado con la evaluacion.
*
* @author Andres Cevallos.
* @version 2.1
*/
@ManagedBean
@ViewScoped
public class ConocimientoLovController extends AbstractController<AbstractDataTransport> {
private static final long serialVersionUID = 1L;
/**
* Instancia de la clase TarmPreguntas
*/
private TarmPreguntas pregunta;
/**
* Boleano que comprueba si la pregunta fue respondida correctamente
*/
private Boolean isCorrecta;
/**
* Lista de Preguntas
*/
private List<TarmPreguntas> lpreguntas;
/**
* Lista de Respuestas
*/
private List<TarmRespuestas> lrespuestas;
/**
* Instancia de TcustpersonDetail, corresponde a la persona a ser
* evaluada
*/
private static TcustPersonDetail personevaluada;
/**
* Instancia de una Evaluacion, maneja una pregunta y sus respectivasrespuestas
* que son mostradas en pantalla
*/
private Evaluacion currentEvaluacion;
/**
* Lista del objetos Evaluacion
*/
private List<Evaluacion> leva;
/**
* Tipo de Evaluacion
*/
private static String tipoeval;
/**
* Contador que Lleva el numero de pregunta en el que se encuentra
*/
private int numeropregunta;
/**
* Maneja la ultima pregunta
*/
private boolean finalizar;
/**
* Fecha Actual del Sistema
*/
private Date fecha;
/**
* Objeto que sera retornado conteniendo todas las preguntas.
*/
EvaluacionCompleta evaluacionCompleta;
/**
* Tipo de persona referenciada en el catalogo
*/
private TgeneCatalogDetail tipopersona;
/**
* Tipo de evaluacion referenciado en el catalogo
*/
private TgeneCatalogDetail tipoevaluacion;
/**
* Numero de preguntas que tendra la evaluacion
*/
int npreguntas=4;
private Boolean errorrend=false;
private String error;
public ConocimientoLovController() throws Exception {
super(AbstractDataTransport.class);
}
@PostConstruct
private void postconstruct() {
this.init();
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
this.recperpage = 15; // Cambiar al # reg a mirar.
this.lrecord = new ArrayList<>();
lpreguntas = new ArrayList<TarmPreguntas>();
this.beanalias = "EVALUACIONLOV";
tipoevaluacion = new TgeneCatalogDetail();
TgeneParameters parametro= ParametersController.find("NUMEROPREGUNTAS", "1");
try{
npreguntas=parametro.getNumbervalue().intValue();
tipoevaluacion=CatalogDetailController.findxCodigoCodcatalogo(tipoeval, "TIPOEVALUACION");
setTipopersona(CatalogDetailController.findxCodigoCodcatalogo(personevaluada.getPersontypecatalog(), personevaluada.getPersontypecatalogcode()));
lpreguntas.addAll( PreguntasParaEvaluacionesController.findxPregunta(tipopersona.getPk().getCatalog(),"CONOCIMIENTO"));
}
catch(Exception e){
MessageHelper.setMessageError("PROBLEMAS DE PARAMETRIZACION. CONSULTE AL EVALUADOR");
error="PROBLEMAS DE PARAMETRIZACION. CONSULTE AL EVALUADOR";
errorrend=true;
System.out.println("Error");
return;
}
numeropregunta=0;
finalizar=false;
fecha=Calendar.getInstance().getTime();
evaluacionCompleta=new EvaluacionCompleta();
evaluacionCompleta.inicializa();
construirEvaluacion();
currentEvaluacion=leva.get(numeropregunta);
comprobarpreguntafinal();
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
/**
* Construye la evaluacion en base a las preguntas que se tengan catalogadas
*/
public void construirEvaluacion(){
leva = new ArrayList<Evaluacion>();
int i=0;
while(i<npreguntas){
int numAleatorio = (int) (Math.random()*(lpreguntas.size()-1));
//RespuestasController.
Evaluacion eva = new Evaluacion();
eva.setPregunta(lpreguntas.get((numAleatorio)));
eva.setRespuesta(RespuestasController.findxPregunta(eva.getPregunta().getPk().toString()));
lpreguntas.remove(numAleatorio);
if(eva.getRespuesta()!=null){
leva.add(eva);
i++;
}
if(lpreguntas.isEmpty())
break;
}
}
/**
* Verifica si se ha respondido una pregunta y llama a la vista la
* siguiente pregunta
*/
public void siguiente(){
if(currentEvaluacion.getCodigorespuesta()==null || currentEvaluacion.getCodigorespuesta()==0)
{
MessageHelper.setMessageWarn(MsgControlArmas.getProperty("msg_ingreseresp"));
return;
}
evaluacionCompleta.getLevaluacion().add(currentEvaluacion);
currentEvaluacion=leva.get(numeropregunta);
comprobarpreguntafinal();
}
/**
* Verifica que se encuentre en la ultima pregunta
*/
public void comprobarpreguntafinal(){
numeropregunta++;
if(numeropregunta==leva.size()){
finalizar=true;
}
}
/* (non-Javadoc)
* @see com.fp.frontend.controller.AbstractController#querydatabase()
*/
@Override
protected void querydatabase() {
try {
}
catch (Throwable e) {
MessageHelper.setMessageError(e);
}
finally{
return;
}
}
public static String getTipoeval() {
return tipoeval;
}
/**
*Regresa el Objeto de Evaluacion a la pantalla principal
*/
public void setEvaluacion() {
if(currentEvaluacion.getCodigorespuesta()==null || currentEvaluacion.getCodigorespuesta()==0)
{
MessageHelper.setMessageWarn(MsgControlArmas.getProperty("msg_ingreseresp"));
return;
}
evaluacionCompleta.getLevaluacion().add(currentEvaluacion);
// se utiliza en la pagina del lov.
RequestContext.getCurrentInstance().closeDialog(evaluacionCompleta);
}
public static void setTipoeval(String tipoeval) {
ConocimientoLovController.tipoeval = tipoeval;
}
/**
* Abre el Lov donde se realiza la evaluacion
* @param params
* @param persona
* @param catalogo
*/
public static void openLov(Map<String, List<String>> params, TcustPersonDetail persona,String catalogo) {
personevaluada=persona;
tipoeval=catalogo;
Map<String, Object> options = new HashMap<String, Object>();
options.put(EnumLovOption.MODAL.getLabel(), true);
options.put(EnumLovOption.HEIGHT.getLabel(), 350);
options.put(EnumLovOption.WIDTH.getLabel(), 900);
options.put(EnumLovOption.RESIZABLE.getLabel(), false);
options.put("closable", false);
RequestContext.getCurrentInstance().openDialog("/pages/armas/lov/conocimientoLov.xhtml", options, params);
}
/**
* Crea una instancia y marca el registro como nuevo.
*
* @throws Exception
*/
@Override
public void create() throws Exception {
super.create();
isCorrecta = false;
// record.setCpregunta(pregunta.getPk());
}
/**
* Actualiza la lista de registros a grabar
*
* @throws Exception
*/
public void update() throws Exception {
//if(record.getEscorrecta()==null){
// record.setEscorrecta("N");
// }
//super.update();
}
/* (non-Javadoc)
* @see com.fp.frontend.controller.AbstractController#save()
*/
@Override
public void save() {
try {
DtoSave dtosave = super.getDtoSave();
dtosave.setReturnpk(true); // Para que el core devuelva el pk de los
// registros nuevos.
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
Request request = callerhelper.getRequest();
msave.put(beanalias, dtosave); // adicionar metadata de
// mantenimiento para cada tabla.
request.setSaveTables(msave);
Response resp = callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
this.postCommit(resp);
MessageHelper.setMessageInfo(resp);
} else {
MessageHelper.setMessageError(resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public TarmPreguntas getPregunta() {
return pregunta;
}
public void setPregunta(TarmPreguntas pregunta) {
this.pregunta = pregunta;
}
public Boolean getIsCorrecta() {
return isCorrecta;
}
public void setIsCorrecta(Boolean isCorrecta) {
this.isCorrecta = isCorrecta;
}
public void onChangeEsCorrecta() {
/* if (isCorrecta) {
record.setEscorrecta("Y");
} else {
record.setEscorrecta("N");
}*/
}
public List<TarmPreguntas> getLpreguntas() {
return lpreguntas;
}
public void setLpreguntas(List<TarmPreguntas> lpreguntas) {
this.lpreguntas = lpreguntas;
}
public List<TarmRespuestas> getLrespuestas() {
return lrespuestas;
}
public void setLrespuestas(List<TarmRespuestas> lrespuestas) {
this.lrespuestas = lrespuestas;
}
public List<Evaluacion> getLeva() {
return leva;
}
public void setLeva(List<Evaluacion> leva) {
this.leva = leva;
}
public TcustPersonDetail getPersonevaluada() {
return personevaluada;
}
public void setPersonevaluada(TcustPersonDetail personevaluada) {
this.personevaluada = personevaluada;
}
public TgeneCatalogDetail getTipopersona() {
return tipopersona;
}
public void setTipopersona(TgeneCatalogDetail tipopersona) {
this.tipopersona = tipopersona;
}
public TgeneCatalogDetail getTipoevaluacion() {
return tipoevaluacion;
}
public void setTipoevaluacion(TgeneCatalogDetail tipoevaluacion) {
this.tipoevaluacion = tipoevaluacion;
}
public Evaluacion getCurrentEvaluacion() {
return currentEvaluacion;
}
public void setCurrentEvaluacion(Evaluacion currentEvaluacion) {
this.currentEvaluacion = currentEvaluacion;
}
public boolean isFinalizar() {
return finalizar;
}
public void setFinalizar(boolean finalizar) {
this.finalizar = finalizar;
}
public int getNumeropregunta() {
return numeropregunta;
}
public void setNumeropregunta(int numeropregunta) {
this.numeropregunta = numeropregunta;
}
public Date getFecha() {
return fecha;
}
public void setFecha(Date fecha) {
this.fecha = fecha;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public Boolean getErrorrend() {
return errorrend;
}
public void setErrorrend(Boolean errorrend) {
this.errorrend = errorrend;
}
}

View File

@ -0,0 +1,22 @@
<ui:component xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:comp="http://java.sun.com/jsf/composite" >
<comp:interface shortDescription="Componente para subir documentos a Alfresco">
<comp:attribute name="controllerAlfresco" shortDescription="Controlador de alfresco que esta dentro del controlador principal" />
<comp:attribute name="xPathLocation" shortDescription="Ruta de la carpeta en formato xPath" />
<comp:attribute name="idAlfrescoPopup" shortDescription="Identificador del componente popup de alfresco" />
<comp:attribute name="label" shortDescription="Etiqueta a mostrar para descargar" />
</comp:interface>
<comp:implementation>
<div id="#{cc.clientId}">
<p:commandButton actionListener="#{cc.attrs.controllerAlfresco.prepareDocumentList}" label="#{cc.attrs.label}"
styleClass="m-action-button" icon="ui-icon-arrowthick-1-s"
oncomplete="popupAlfrescoFolder.show()" update=":#{cc.attrs.idAlfrescoPopup}:formPanelAlfrescoFolder">
<f:attribute name="xPathLocation" value="#{cc.attrs.xPathLocation}" />
</p:commandButton>
</div>
</comp:implementation>
</ui:component>

View File

@ -0,0 +1,224 @@
package com.fp.dto;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.beanutils.BeanMap;
import com.fp.common.helper.BeanManager;
import com.fp.dto.hb.HibernateId;
public class Response extends HashMap<String, Object> implements Serializable {
/** Version de la clase. */
private static final long serialVersionUID = 1L;
/** Constante que define el codigo de respuesta ok. */
public static final String RESPONSE_OK = "0";
/** Codigo de respuesta. */
private String responseCode;
/** Mensaje de usuario asociado al codigo de respuesta. */
private String responseUserMessage;
/** Mensaje tecnico asociado al codigo de respuesta. */
private String responseTechnicalMessage;
/** Stack trace, del error ocasionada en al ejecucion de una operacion. */
private String responseStack;
/**
* Variable para identificar si un mensaje es o no de aplicacion
*/
private boolean isAplicationMessage;
/**
* Metodo que rerna si el mensaje es de la aplicacion
*
* @return
*/
public boolean isIsAplicationMessage() {
return isAplicationMessage;
}
/**
* Metodo que fija si el mensaje es de la aplicacion o no
*
* @param isAplicationMessage
*/
public void setIsAplicationMessage(boolean isAplicationMessage) {
this.isAplicationMessage = isAplicationMessage;
this.put("isAplicationMessage", isAplicationMessage);
}
/**
* Entrega el valor de: responseTechnicalMessage
*
* @return String
*/
public String getResponseTechnicalMessage() {
return responseTechnicalMessage;
}
/**
* Fija el valor de: responseTechnicalMessage
*
* @param responseTechnicalMessage
*/
public void setResponseTechnicalMessage(String responseTechnicalMessage) {
this.responseTechnicalMessage = responseTechnicalMessage;
this.put("responseTechnicalMessage", responseTechnicalMessage);
}
/**
* Entrega el valor de: responseStack
*
* @return String
*/
public String getResponseStack() {
return responseStack;
}
/**
* Fija el valor de: responseStack
*
* @param responseStack
*/
public void setResponseStack(String responseStack) {
this.responseStack = responseStack;
this.put("responseStack", responseStack);
}
/**
* Entrega el valor de: responseCode
*
* @return String
*/
public String getResponseCode() {
return responseCode;
}
/**
* Entrega el valor de: responseUserMessage
*
* @return String
*/
public String getResponseUserMessage() {
return responseUserMessage;
}
public Response(String responseCode, String responseUserMessage) {
this.responseCode = responseCode;
this.responseUserMessage = responseUserMessage;
this.put("messageCode", responseCode);
this.put("message", responseUserMessage);
this.put("isAplicationMessage", true);
}
/**
* Fija el valor de: responseCode
*
* @param responseCode
*/
public void setResponseCode(String responseCode) {
this.responseCode = responseCode;
this.put("messageCode", responseCode);
}
/**
* Fija el valor de: responseUserMessage
*
* @param responseUserMessage
*/
public void setResponseUserMessage(String responseUserMessage) {
this.responseUserMessage = responseUserMessage;
this.put("message", responseUserMessage);
}
public void changeAbstractBeanToMap() throws Exception {
Set<String> s = super.keySet();
for (String key : s) {
Object obj;
obj = super.get(key);
if (obj instanceof AbstractDataTransport) {
Map<String, Object> mresp = this.beanToMap((AbstractDataTransport) obj);
super.put(key, mresp);
}
if (obj instanceof List) {
this.changeBeanListToMap(key, obj);
continue;
}
}
}
@SuppressWarnings("unchecked")
private void changeBeanListToMap(String key, Object data) throws Exception {
List<Object> ldata;
try {
ldata = (List<Object>) data;
} catch (Exception e) {
return;
}
List<Map<String, Object>> lresp = new ArrayList<Map<String, Object>>();
for (Object obj : ldata) {
if (obj instanceof AbstractDataTransport) {
Map<String, Object> mresp = this.beanToMap((AbstractDataTransport) obj);
lresp.add(mresp);
}
}
if (!lresp.isEmpty()) {
super.put(key, lresp);
}
}
@SuppressWarnings("unchecked")
private Map<String, Object> beanToMap(AbstractDataTransport bean) throws Exception {
Map<String, Object> mresp = new HashMap<String, Object>();
Field[] fs = bean.getClass().getDeclaredFields();
for (Field field : fs) {
try {
String name = field.getName();
if (name.compareTo("serialVersionUID") == 0 || name.compareTo("__id") == 0) {
continue;
}
Object val = null;
try {
val = BeanManager.getBeanAttributeValue(bean, name);
} catch (Exception e1) {
continue;
}
if (val instanceof HibernateId) {
BeanMap bm = new BeanMap(val);
Set<java.util.Map.Entry<String, Object>> ent = bm.entrySet();
for (java.util.Map.Entry<String, Object> e : ent) {
String key = e.getKey();
if (key.compareTo("class") == 0 || key.compareTo("transportBeanClass") == 0 || key.compareTo("empty") == 0
|| key.compareTo("modifiedData") == 0) {
continue;
}
mresp.put(name + "_" + key, e.getValue());
}
continue;
}
mresp.put(name, val);
} catch (Exception e) {
continue;
}
}
// completa datos adicionales.
Set<String> s = bean.modifiedData.keySet();
for (String key : s) {
mresp.put(key, bean.modifiedData.get(key));
}
return mresp;
}
}

View File

@ -0,0 +1,99 @@
package com.fp.general.security.rules;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import com.fp.dto.rules.TransactionRule;
import com.fp.dto.save.SaveRequest;
import com.fp.general.exception.GeneralException;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.pgeneral.safe.TsafeUser;
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
import com.fp.sessionbeans.helper.Sequence;
/**
* Clase que se encuentra del manejo
* @author scastillo
*/
public class CreateInternalCodeUser extends TransactionRule {
private static final long serialVersionUID = 1L;
/**
* Metodo que se encarga de completar el codigo interno eln la creacion de usuarios
* @param pSaveRequest
* @return
* @throws Exception
*/
public SaveRequest normalProcess(SaveRequest pSaveRequest) throws Exception {
// Si la pantalla es diferente de tx 1 120 , se procede a validar creacion de usuarios
if(!pSaveRequest.get("PANTALLA").toString().equalsIgnoreCase("USUARIOSPERFIL_MOD1_TX120")){
if( !pSaveRequest.isJsf()){
TsafeUser tsafeUser = (TsafeUser) pSaveRequest.getSaveBeanModifiedObject("TSAFEUSER");
this.validateuser(tsafeUser.getPk().trim(), tsafeUser.getCompanycode());
tsafeUser.setInternalcode(getInternalCode());
}else{
this.proessjsf(pSaveRequest);
}
}
return pSaveRequest;
}
private void proessjsf(SaveRequest pSaveRequest) throws Exception {
TsafeUserDetail ud = (TsafeUserDetail) pSaveRequest.getSaveBeanModifiedObject("USERDETAIL");
if(ud == null){
return;
}
this.validateuser(ud.getPk().getUsercode(), ud.getCompanycode());
TsafeUser tsu = new TsafeUser(ud.getPk().getUsercode());
tsu.setPersoncode(ud.getPk().getPersoncode());
tsu.setCompanycode(ud.getCompanycode());
tsu.setInternalcode(getInternalCode());
pSaveRequest.putSaveBean("TSAFEUSER", tsu, 1);
}
private void validateuser(String usercode, Integer company) throws Exception {
String code = this.findUser(usercode, company);
if(code!=null){
throw new GeneralException("GENE-0042", "CÓDIGO DE USUARIO YA EXISTE: {0}", code);
}
}
/**
* Metodo que se ejecuta en modo reverso
* @param pSaveRequest
* @return
* @throws Exception
*/
public SaveRequest reverseProcess(SaveRequest pSaveRequest) throws Exception {
return pSaveRequest;
}
/**
* Metodo que obtiene el numero correspondiente para el codigo interno del usuario
* @return
* @throws Exception
*/
private Integer getInternalCode() throws Exception {
Sequence sequence = new Sequence();
return Integer.valueOf(sequence.getNextValue("INTERNALCODE").toString());
}
private static String JPQL_USER ="select t.pk from TsafeUser t where t.pk = :usercode " +
" and t.companycode = :company";
private String findUser(String usercode,Integer company) throws Exception{
String code;
Query qry = PersistenceHelper.getEntityManager().createQuery(JPQL_USER);
qry.setParameter("usercode", usercode);
qry.setParameter("company", company);
try {
code = (String)qry.getSingleResult();
} catch (NoResultException e) {
return code =null;
}
return code;
}
}

View File

@ -0,0 +1,102 @@
<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents"
template="/WEB-INF/templates/template.xhtml">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{servicesController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:services"
focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="4" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpk" value="#{msg_general.lbl_code}:" />
<p:inputText id="fpk" value="#{servicesController.mfilters['pk']}" maxlength="30" style="width: 100px;" onkeydown="Maia.forceupper(event, this);" />
<p:outputLabel for="fdesc" value="#{msg_general.lbl_description}:" />
<p:inputText id="fdesc" value="#{servicesController.mfilters['classname']}" maxlength="150" style="width: 350px;" />
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{servicesController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:services"
createUpdate=":formService:pEdit"
dialogWidgetVar="dialog" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_catalog}" />
</f:facet>
<p:dataTable id="services" var="row" value="#{servicesController.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_general.lbl_code}" resizable="true" style="width:150px" sortBy="#{row.pk}">
<h:outputText value="#{row.pk}" />
</p:column>
<p:column headerText="#{msg_general.lbl_classname}" resizable="true" sortBy="#{row.classname}">
<h:outputText value="#{row.classname}" />
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_edit}" update=":formService:pEdit" oncomplete="PF('dialog').show()" styleClass="m-action-button" icon="ui-icon-pencil" process="@this, services"
action="#{servicesController.checkEdit()}">
<f:setPropertyActionListener target="#{servicesController.record}" value="#{row}" />
<f:setPropertyActionListener target="#{servicesController.showRow}" value="#{false}" />
<f:setPropertyActionListener target="#{servicesController.newRow}" value="#{false}" />
</p:commandButton>
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_delete}" process="@this, services" update=":formTable:services" styleClass="m-action-button" icon="ui-icon-trash" action="#{servicesController.remove()}">
<f:setPropertyActionListener target="#{servicesController.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialog" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)"
showEffect="explode" hideEffect="explode" styleClass="m-dialog">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_createoredit}" />
</f:facet>
<h:form id="formService">
<p:messages id="messages" globalOnly="true"/>
<h:panelGrid id="pEdit" columns="3" >
<p:outputLabel for="codigo" value="#{msg_general.lbl_code}:" />
<h:outputText rendered="#{!servicesController.newRow}" value="#{servicesController.record.pk}"/>
<p:inputText id="codigo" rendered="#{servicesController.newRow}" value="#{servicesController.record.pk}" required="true" maxlength="30"
onkeyup="Maia.forceupper(event, this);" style="width:160px;" />
<p:message for="codigo" />
<p:outputLabel for="descripcion" value="#{msg_general.lbl_description}:" />
<p:inputText id="descripcion" value="#{servicesController.record.description}" required="true" maxlength="60"
onkeyup="Maia.forceupper(event, this);" style="width:400px;" />
<p:message for="descripcion" />
<p:outputLabel for="classname" value="#{msg_general.lbl_classname}:" />
<p:inputText id="classname" value="#{servicesController.record.classname}" required="true" maxlength="150" style="width:480px;" />
<p:message for="classname" />
<p:outputLabel for="automatic" value="#{msg_general.lbl_automatic}:" />
<p:selectBooleanCheckbox id="automatic" value="#{servicesController.check}">
<p:ajax listener="#{servicesController.changeCheck()}"/>
</p:selectBooleanCheckbox>
<p:message for="automatic" />
</h:panelGrid>
<h:panelGrid columns="2" styleClass="m-dialog-controls">
<maia:dialogControls controller="#{servicesController}"
process=":formService:pEdit"
update=":formService:pEdit :formTable:services"
dialogWidgetVar="dialog" />
</h:panelGrid>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,784 @@
package com.fp.frontend.controller.armas.solicitud;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
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 javax.faces.event.AjaxBehaviorEvent;
import org.primefaces.component.selectbooleancheckbox.SelectBooleanCheckbox;
import org.primefaces.event.SelectEvent;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.dto.query.DtoQuery;
import com.fp.dto.query.Filter;
import com.fp.dto.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.ParametersController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.frontend.utility.MsgControlArmas;
import com.fp.frontend.utility.Utilidades;
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.soli.TarmArmas;
import com.fp.persistence.parmas.soli.TarmCabRepDestruirArmas;
import com.fp.persistence.parmas.soli.TarmDecomiso;
import com.fp.persistence.parmas.soli.TarmDecomisoArma;
import com.fp.persistence.parmas.soli.TarmDetRepDestruirArmas;
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.safe.TsafeUserDetail;
/**
* Clase controladora de la generaci&oacute;n de reporte de armas a destruirse
*
* @author Christian Pazmino.
* @version 2.1
*/
@SuppressWarnings("serial")
@ManagedBean
@ViewScoped
public class ReporteDestruccionDeArmasController extends AbstractController<TarmDecomisoArma> {
/**
* Fecha de corte a la que se generara el reporte
* */
private Date fechaCorte;
/**
* Formato de reporte que se va a generar
* */
private String format = "pdf";
/**
* Usuario actual loogueado en el sistema
* */
private TsafeUserDetail userDetail;
/**
* Variable de tipo entero que lee de la tabla par&aacute;metros el n&uacute;mero de d&iacute;as en decomiso previo a la destrucci&oacute;n del arma
* */
private Integer diasParaDestruirArma;
/**
* Catalogcode de la tabla Cat&aacute;logos que funciona como bandera para indicar si un arma ya se encuentra en alg&uacute;n reporte previo.
* */
private final String CATALOGCODEADESTRUIRSE = "ADESTRUIRSE";
/**
* Ruta base del reporte generado en el Alfresco
* */
private String xPathLocation;
/**
* Ubicacion completa del reporte generado en el Alfresco
* */
private String xPath;
/**
* Nombre del reporte generado en el Alfresco
* */
private String nombreReporte;
/**
* Codigo de cabecera del reporte generado en base de datos
* */
private String creporte;
/**
* Bandera de tipo booleano para indicar si se genero o no el reporte
* */
private Boolean seGeneroReporte;
/**
* Bandera de tipo booleano para indicar si se ha grabado el reporte generado
* */
private Boolean isEnableGrabar;
/**
* Bandera de tipo booleano para indicar que se debe deshabilitar el boton iniciar flujo
* */
private Boolean isEnableEnviar;
/**
* Variable del tipo TgeneCatalogDetail(Esta en reporte de armas a destruirse)
*/
private TgeneCatalogDetail aDestruirseCatalog;
/**
* Clase controladora de reportes
*/
@ManagedProperty(value = "#{reportController}")
private ReportController reportController;
/**
* Clase controladora de cabecera de reporte de armas a destruir
*/
@ManagedProperty(value = "#{cabRepDestruirArmasController}")
private CabRepDestruirArmasController cabRepDestruirArmasController;
/**
* Clase controladora de detalle de reporte de armas a destruir
*/
@ManagedProperty(value = "#{detRepDestruirArmasController}")
private DetRepDestruirArmasController detRepDestruirArmasController;
/**
* Clase controladora de funcionalidad del Alfresco
*/
@ManagedProperty(value="#{alfrescoController}")
private AlfrescoController alfrescoController;
/**
* codigo de la provincia del usuario logeado
*/
private String cprovincia;
public ReporteDestruccionDeArmasController() throws Exception {
super(TarmDecomisoArma.class);
// TODO Auto-generated constructor stub
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
super.startQuery();
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
userDetail=(TsafeUserDetail)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
diasParaDestruirArma = ParametersController.find("DIASENBODEGA.DESTRUIRARMAS", "1").getNumbervalue().intValue();
aDestruirseCatalog = CatalogDetailController.findxCodigoCodcatalogo("1", CATALOGCODEADESTRUIRSE);
recperpage = 10000; // Cambiar al # reg a mirar.
lrecord = new ArrayList<TarmDecomisoArma>();
beanalias = "RPRTEDESTRUCCIONDEARMAS";
seGeneroReporte = Boolean.FALSE;
isEnableGrabar = Boolean.TRUE;
isEnableEnviar = Boolean.FALSE;
TarmCentroControl centroControl=Utilidades.obtenerCentroControl();
cprovincia=centroControl.getProvincecode();
querydatabase();
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
/**
* Obtiene el centro de control segun usurio logeado.
* @throws Exception
*
*/
/**
* Metodo que se debe ejecutar cuando es una transaccion de tipo verificar armas
* @throws Exception
*/
// private void provinciaUsuario() throws Exception {
// PersonAddressController personAddressController = new PersonAddressController();
// TcustPersonAddress tcustPersonAddres= personAddressController.findPrincipal(userDetail.getPk().getPersoncode().toString());
// cprovincia=tcustPersonAddres.getProvincecode();
// }
/**
* Crea una instancia y marca el registro como nuevo.
*
* @throws Exception
*/
@Override
public void create() throws Exception {
super.create();
}
/**
* Seleccionado todos los registros de la tabla
*/
public void seleccionarTodos(AjaxBehaviorEvent event) {
try {
Boolean valorColocar = Boolean.FALSE;
if(Boolean.valueOf(event.getComponent().getAttributes().get("value") != null ? event.getComponent().getAttributes().get("value").toString() : "false")){
valorColocar = Boolean.TRUE;
}
for (TarmDecomisoArma decomisoArmaObj : lrecord) {
decomisoArmaObj.getModifiedData().put("isSelect", valorColocar);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@SuppressWarnings("unchecked")
@Override
protected void querydatabase() {
try {
if(fechaCorte!=null){
Calendar fechaActualCldr = Calendar.getInstance();
Calendar fechaCorteCldr = Calendar.getInstance();
fechaCorteCldr.setTime(fechaCorte);
if(fechaActualCldr.compareTo(fechaCorteCldr)>=0){
DtoQuery dto = super.getDtoQuery(true);
dto.setOrderby("t.fdecomiso");
Calendar fechaReferenciaReporteCldr = Calendar.getInstance();
fechaReferenciaReporteCldr.setTime(fechaCorte);
fechaReferenciaReporteCldr.add(Calendar.DAY_OF_MONTH, -diasParaDestruirArma);
StringBuilder fechaReferenciaSB = new StringBuilder();
fechaReferenciaSB = fechaReferenciaSB.append((fechaReferenciaReporteCldr.get(Calendar.DAY_OF_MONTH)) <= 9 ? "0" + (fechaReferenciaReporteCldr.get(Calendar.DAY_OF_MONTH)) : (fechaReferenciaReporteCldr.get(Calendar.DAY_OF_MONTH)));
fechaReferenciaSB = fechaReferenciaSB.append("-").append((fechaReferenciaReporteCldr.get(Calendar.MONTH)+1) <= 9 ? "0" + (fechaReferenciaReporteCldr.get(Calendar.MONTH) + 1) : (fechaReferenciaReporteCldr.get(Calendar.MONTH)+1));
fechaReferenciaSB = fechaReferenciaSB.append("-").append(fechaReferenciaReporteCldr.get(Calendar.YEAR));
Filter fechaFiltro= new Filter();
fechaFiltro.setSql("(t.estado='DEC' or t.estado='INC' or t.estado='ABA' or t.estado='ENTR') and t.adestruirse is null and t.adestruirsecode is null and t.fdecomiso < " + "TO_DATE('" + fechaReferenciaSB.toString() + "','dd-mm-yyyy') and not exists(select 1 from TarmArmas ta where ta.estado = 'SUSP' and t.carma = (select max(tax.pk) from TarmArmas tax where ta.pk = tax.pk))");
dto.addFiltro(fechaFiltro);
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
Request request = callerhelper.getRequest();
request.setQueryTables(mtables);
Response resp = callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
lrecord = new ArrayList<TarmDecomisoArma>();
MessageHelper.setMessageError(resp);
} else {
lrecord = (List<TarmDecomisoArma>) resp.get(beanalias);
for(TarmDecomisoArma decomisoArma:lrecord){
if(decomisoArma.getCdecomiso()!=null){
decomisoArma.getModifiedData().put("isSelect",Boolean.FALSE);
TarmArmas arma = ArmasController.findByPK(decomisoArma.getCarma());
TarmTipoArmaExplosivo tipoArmaExplosivo = TiposArmasExplosivosController.findarma(arma.getCtipoarmaexplosivo());
decomisoArma.getModifiedData().put("ntipo", arma.getModifiedData().get("tipo"));
decomisoArma.getModifiedData().put("nclase", arma.getModifiedData().get("clase"));
if(tipoArmaExplosivo.getLongitud()!=null){
decomisoArma.getModifiedData().put("nlongitud", CatalogDetailController.findxCodigoCodcatalogo(tipoArmaExplosivo.getLongitud(), tipoArmaExplosivo.getLongitudcodigo())!=null?CatalogDetailController.findxCodigoCodcatalogo(tipoArmaExplosivo.getLongitud(), tipoArmaExplosivo.getLongitudcodigo()).getDescription():"");
}
else{
decomisoArma.getModifiedData().put("nlongitud", "");
}
if(tipoArmaExplosivo.getCalibre()!=null){
decomisoArma.getModifiedData().put("ncalibre", CatalogDetailController.findxCodigoCodcatalogo(tipoArmaExplosivo.getCalibre(), tipoArmaExplosivo.getCalibrecodigo())!=null?CatalogDetailController.findxCodigoCodcatalogo(tipoArmaExplosivo.getCalibre(), tipoArmaExplosivo.getCalibrecodigo()).getDescription():"");
}
else{
decomisoArma.getModifiedData().put("ncalibre", "");
}
decomisoArma.getModifiedData().put("nmarca", CatalogDetailController.findxCodigoCodcatalogo( arma.getMarca(), arma.getMarcacodigo())!=null?CatalogDetailController.findxCodigoCodcatalogo( arma.getMarca(), arma.getMarcacodigo()).getDescription():"");
decomisoArma.getModifiedData().put("nserie", arma.getLote());
decomisoArma.getModifiedData().put("nunidad", CatalogDetailController.findxCodigoCodcatalogo(decomisoArma.getUnidadmedida(), decomisoArma.getUnidadmedidacode())!=null?CatalogDetailController.findxCodigoCodcatalogo(decomisoArma.getUnidadmedida(), decomisoArma.getUnidadmedidacode()).getDescription():"");
TarmRegistroArmas registroArma = RegistroArmController.findByCodigo(arma.getCregistro().toString());
if(registroArma!=null && registroArma.getPersoncode()!=null){
Integer personCodePropietario = registroArma.getPersoncode();
decomisoArma.getModifiedData().put("npropietario", PersonDetailController.find(personCodePropietario.toString()).getName());
}
else{
decomisoArma.getModifiedData().put("npropietario", "");
}
TarmDecomiso decomiso = DecomisoController.findByCodigo(decomisoArma.getCdecomiso().toString());
if(decomiso!=null && decomiso.getNumerodocumento()!=null){
decomisoArma.getModifiedData().put("nrecibo", decomiso.getNumerorecibo());
}
else{
decomisoArma.getModifiedData().put("nrecibo", "");
}
}
else{
lrecord.remove(decomisoArma);
}
}
super.postQuery(lrecord);
}
}
else{
lrecord = new ArrayList<TarmDecomisoArma>();
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_fechaCorteMayorAFechaActual"));
}
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
/**
* Metodo para reconsultar en base a una nueva fecha de corte seleccionada
*/
public void cambioFechaDeCorte(SelectEvent event){
querydatabase();
}
@Override
public void postCommit(Response response) throws Exception {
super.postCommitGeneric(response, beanalias);
cabRepDestruirArmasController.postCommit(response);
detRepDestruirArmasController.postCommit(response);
}
/**
* Genera un reporte de armas a destruir
*
*/
public void generateReport() {
if(fechaCorte!=null){
if(existeArmasSeleccionadas()){
Calendar fechaActualCldr = Calendar.getInstance();
Calendar fechaCorteCldr = Calendar.getInstance();
fechaCorteCldr.setTime(fechaCorte);
if(fechaActualCldr.compareTo(fechaCorteCldr)>=0){
String path = "armas/reports/bajaDestruccion";
String filename="ArmasADestruirse";
// 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");
// Datos del supervisor militar
String CISupervisorMilitar = ParametersController.find("IDSUPERMILITDPTOARMSPICH", "1").getTextvalue();
TcustPersonDetail supervisorMilitarObj = PersonDetailController.findxidentification(CISupervisorMilitar, "CED");
String gradoSupMilitar = supervisorMilitarObj.getMilitarygrade()==null?"": supervisorMilitarObj.getMilitarygrade() + " - ";
parameters.put("nombreSupMilitar", gradoSupMilitar + supervisorMilitarObj.getName()==null?"":supervisorMilitarObj.getName());
parameters.put("personCodeSupMilitar", supervisorMilitarObj.getPk().getPersoncode()==null?"1001":supervisorMilitarObj.getPk().getPersoncode());
// Datos del coordinador militar
String CICoordinadorMilitar = ParametersController.find("IDCOORDMILITDPTOARMSPICH", "1").getTextvalue();
TcustPersonDetail coordinadorMilitarObj = PersonDetailController.findxidentification(CICoordinadorMilitar, "CED");
String gradoCoordMilitar = coordinadorMilitarObj.getMilitarygrade()==null?"":coordinadorMilitarObj.getMilitarygrade() + " - ";
parameters.put("nombreCoordMilitar", gradoCoordMilitar + coordinadorMilitarObj.getName()==null?"":coordinadorMilitarObj.getName());
parameters.put("personCodeCoordMilitar", coordinadorMilitarObj.getPk().getPersoncode()==null?"1001":coordinadorMilitarObj.getPk().getPersoncode());
try {
//Usuario logueado en la aplicacion
String nombreUsuario;
if(userDetail.getPk().getPersoncode()!=null){
nombreUsuario = PersonDetailController.find(userDetail.getPk().getPersoncode().toString()).getName();
}
else{
nombreUsuario = "";
}
parameters.put("usuario", nombreUsuario);
//Fecha de corte
StringBuilder fechaCorteSB= new StringBuilder();
fechaCorteSB = fechaCorteSB.append((fechaCorteCldr.get(Calendar.DAY_OF_MONTH)) <= 9 ? "0" + (fechaCorteCldr.get(Calendar.DAY_OF_MONTH)) : (fechaCorteCldr.get(Calendar.DAY_OF_MONTH)));
fechaCorteSB = fechaCorteSB.append("-").append((fechaCorteCldr.get(Calendar.MONTH)+1) <= 9 ? "0" + (fechaCorteCldr.get(Calendar.MONTH) + 1) : (fechaCorteCldr.get(Calendar.MONTH)+1));
fechaCorteSB = fechaCorteSB.append("-").append(fechaCorteCldr.get(Calendar.YEAR));
parameters.put("fechaCorte", fechaCorteSB.toString());
parameters.put("codArmasDecomisadasLst", actualizarArmasSeleccionadas());
//Fecha actual
StringBuilder fechaActualSB = new StringBuilder();
fechaActualSB = fechaActualSB.append((fechaActualCldr.get(Calendar.DAY_OF_MONTH)) <= 9 ? "0" + (fechaActualCldr.get(Calendar.DAY_OF_MONTH)) : (fechaActualCldr.get(Calendar.DAY_OF_MONTH)));
fechaActualSB = fechaActualSB.append("-").append((fechaActualCldr.get(Calendar.MONTH)+1) <= 9 ? "0" + (fechaActualCldr.get(Calendar.MONTH) + 1) : (fechaActualCldr.get(Calendar.MONTH)+1));
fechaActualSB = fechaActualSB.append("-").append(fechaActualCldr.get(Calendar.YEAR));
fechaActualSB = fechaActualSB.append(" ").append(fechaActualCldr.get(Calendar.HOUR_OF_DAY));
fechaActualSB = fechaActualSB.append(":").append((fechaActualCldr.get(Calendar.MINUTE)) <= 9 ? "0" + (fechaActualCldr.get(Calendar.MINUTE)) : (fechaActualCldr.get(Calendar.MINUTE)));
parameters.put("lugarFecha", fechaActualSB.toString());
//Fecha de referencia
Calendar fechaReferenciaReporteCldr = Calendar.getInstance();
fechaReferenciaReporteCldr.setTime(fechaCorte);
fechaReferenciaReporteCldr.add(Calendar.DAY_OF_MONTH, -diasParaDestruirArma);
StringBuilder fechaReferenciaSB = new StringBuilder();
fechaReferenciaSB = fechaReferenciaSB.append((fechaReferenciaReporteCldr.get(Calendar.DAY_OF_MONTH)) <= 9 ? "0" + (fechaReferenciaReporteCldr.get(Calendar.DAY_OF_MONTH)) : (fechaReferenciaReporteCldr.get(Calendar.DAY_OF_MONTH)));
fechaReferenciaSB = fechaReferenciaSB.append("-").append((fechaReferenciaReporteCldr.get(Calendar.MONTH)+1) <= 9 ? "0" + (fechaReferenciaReporteCldr.get(Calendar.MONTH) + 1) : (fechaReferenciaReporteCldr.get(Calendar.MONTH)+1));
fechaReferenciaSB = fechaReferenciaSB.append("-").append(fechaReferenciaReporteCldr.get(Calendar.YEAR));
parameters.put("fechaReferenciaReporte", fechaReferenciaSB.toString());
// Verifico si el reporte fue enviado en el flujo y debe subirse al Alfresco
// if(isDenied){
InputStream file =this.reportController.jaspertoInputstream(path, parameters, format, filename, this.getLoginController());
alfrescoController.uploadFile(file, nombreReporte, this.xPathLocation);
seGeneroReporte = Boolean.TRUE;
// }else{
// this.reportController.execute(path, parameters, format, filename, this.getLoginController());
// }
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
}
}
else{
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_fechaCorteMayorAFechaActual"));
}
}else{
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_seleccioneAlmenosUnArma"));
}
}
}
/**
* Retorna la ruta de documento base en donde se almacenar&aacute; el reporte
*
* @return
*/
public String getRutaDocumentoRepBase() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
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();
}
public String getxPath() {
return xPath;
}
public void setxPath(String xPath) {
this.xPath = xPath;
}
/**
* M&eacute;todo para el inicio de flujo. Guardar el reporte creado para su posterior aprobacion en otras instancias del flujo
*/
@Override
public void save(){
try {
if(lrecord!=null && lrecord.size()>0){
if(validaSiExisteArmasSeleccionadas()){
TarmCabRepDestruirArmas cabeceraReporteObj = new TarmCabRepDestruirArmas();
cabeceraReporteObj.setFreporte((java.sql.Date)fechaCorte);
xPathLocation= getRutaDocumentoRepBase() + "/cm:BAJA";
cabeceraReporteObj.setXpath(xPathLocation);
cabeceraReporteObj.setIsnew(Boolean.TRUE);
//Guarda la ruta donde se almacenara el reporte
cabRepDestruirArmasController.update(cabeceraReporteObj);
Boolean existArmasEnReporte = Boolean.FALSE;
for(TarmDecomisoArma decomisoArmaObj:lrecord){
if(decomisoArmaObj.getAdestruirse()==null){
if(decomisoArmaObj.getModifiedData().get("isSelect")==null || decomisoArmaObj.getModifiedData().get("isSelect").equals(Boolean.FALSE)){
continue;
}
TarmDetRepDestruirArmas detalleReporteObj = new TarmDetRepDestruirArmas();
detalleReporteObj.setIsnew(Boolean.TRUE);
if(decomisoArmaObj.getCdecomiso()!=null){
detalleReporteObj.setCdecomisoarma(decomisoArmaObj.getPk());
}
if(decomisoArmaObj.getModifiedData().get("nclase")!=null){
detalleReporteObj.setClase(decomisoArmaObj.getModifiedData().get("nclase").toString());
}
if(decomisoArmaObj.getModifiedData().get("ntipo")!=null){
detalleReporteObj.setTipo(decomisoArmaObj.getModifiedData().get("ntipo").toString());
}
if(decomisoArmaObj.getModifiedData().get("ncalibre")!=null){
detalleReporteObj.setCalibre(decomisoArmaObj.getModifiedData().get("ncalibre").toString());
}
if(decomisoArmaObj.getModifiedData().get("nmarca")!=null){
detalleReporteObj.setMarca(decomisoArmaObj.getModifiedData().get("nmarca").toString());
}
if(decomisoArmaObj.getModifiedData().get("nserie")!=null){
detalleReporteObj.setSerie(decomisoArmaObj.getModifiedData().get("nserie").toString());
}
if(decomisoArmaObj.getCantidad()!=null){
detalleReporteObj.setCantidad(decomisoArmaObj.getCantidad().toString());
}
if(decomisoArmaObj.getModifiedData().get("nunidad")!=null){
detalleReporteObj.setUnidad(decomisoArmaObj.getModifiedData().get("nunidad").toString());
}
if(decomisoArmaObj.getFdecomiso()!=null){
java.sql.Date date =new java.sql.Date(decomisoArmaObj.getFdecomiso().getTime());
detalleReporteObj.setFdecomiso(date);
}
if(decomisoArmaObj.getModifiedData().get("npropietario")!=null){
detalleReporteObj.setPropietario(decomisoArmaObj.getModifiedData().get("npropietario").toString());
}
if(decomisoArmaObj.getModifiedData().get("nrecibo")!=null){
detalleReporteObj.setNrecibo(decomisoArmaObj.getModifiedData().get("nrecibo").toString());
}
if(!existArmasEnReporte){
existArmasEnReporte = Boolean.TRUE;
}
// Marca que indica que el arma decomisada ya se encuentra dentro de un reporte de armas a destruir
decomisoArmaObj.setAdestruirse(aDestruirseCatalog.getPk().getCatalog());
decomisoArmaObj.setAdestruirsecode(aDestruirseCatalog.getPk().getCatalogcode());
record = decomisoArmaObj;
super.update();
detRepDestruirArmasController.update(detalleReporteObj);
}
}
if(existArmasEnReporte){
Request request = this.callerhelper.getRequest();
DtoSave dtosave = super.getDtoSave();
dtosave.setPosition(1);
DtoSave dtoSaveCabecera = cabRepDestruirArmasController.getDtoSave();
dtoSaveCabecera.setIsForm(Boolean.TRUE);
dtoSaveCabecera.setReturnpk(Boolean.TRUE);
dtoSaveCabecera.setPosition(2);
DtoSave dtoSaveDetalle = detRepDestruirArmasController.getDtoSave();
dtoSaveDetalle.setReturnpk(Boolean.TRUE);
dtoSaveDetalle.setPosition(3);
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
msave.put(this.beanalias, dtosave); // adicionar metadata de mantenimiento para cada tabla.
msave.put(cabRepDestruirArmasController.getBeanalias(),dtoSaveCabecera);
msave.put(detRepDestruirArmasController.getBeanalias(),dtoSaveDetalle);
request.setSaveTables(msave);
Response resp = this.callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
this.postCommit(resp);
this.cabRepDestruirArmasController.postCommit(resp);
this.detRepDestruirArmasController.postCommit(resp);
isEnableGrabar = Boolean.FALSE;
isEnableEnviar = Boolean.TRUE;
MessageHelper.setMessageInfo(resp);
this.nombreReporte = resp.get("nombreReporte").toString();
this.creporte = resp.get("creporte").toString();
this.xPath = resp.get("xpath").toString();
} else {
MessageHelper.setMessageError(resp);
}
}
else{
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_seleccioneAlmenosUnArma"));
}
}
else{
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_seleccioneAlmenosUnArma"));
}
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
/**
* Metodo usado para validar si existen armas seleccionadas por el usuario
*/
public Boolean validaSiExisteArmasSeleccionadas() {
Boolean bandera = Boolean.FALSE;
if(lrecord!=null && lrecord.size()>0){
for(TarmDecomisoArma decomisoArmaObj:lrecord){
if(decomisoArmaObj.getModifiedData().get("isSelect")!=null && decomisoArmaObj.getModifiedData().get("isSelect").equals(Boolean.TRUE)){
bandera = Boolean.TRUE;
}
}
}
return bandera;
}
/**
* Metodo que inicia el flujo de baja y destruccion de armas
*/
public void iniciarFlujo() {
try {
if(seGeneroReporte){
Request request = this.callerhelper.getRequest();
super.cleanRequest(request);
request.modifiedData().put("isnew", "Y");
request.modifiedData().put("xpath", this.xPath);
request.modifiedData().put("creporte", this.creporte);
request.modifiedData().put("cprovincia", cprovincia);
request.setLogsolicitude(this.creporte);
Response resp = this.callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
MessageHelper.setMessageInfo(resp);
isEnableEnviar = Boolean.FALSE;
// RequestContext.getCurrentInstance().execute("Maia.refreshusertasks()");
} else {
MessageHelper.setMessageError(resp);
}
}
else{
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_generarReporteRequerido"));
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public Date getFechaCorte() {
return fechaCorte;
}
public void setFechaCorte(Date fechaCorte) {
this.fechaCorte = fechaCorte;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public ReportController getReportController() {
return reportController;
}
public void setReportController(ReportController reportController) {
this.reportController = reportController;
}
public TsafeUserDetail getUserDetail() {
return userDetail;
}
public void setUserDetail(TsafeUserDetail userDetail) {
this.userDetail = userDetail;
}
public Integer getDiasParaDestruirArma() {
return diasParaDestruirArma;
}
public void setDiasParaDestruirArma(Integer diasParaDestruirArma) {
this.diasParaDestruirArma = diasParaDestruirArma;
}
public CabRepDestruirArmasController getCabRepDestruirArmasController() {
return cabRepDestruirArmasController;
}
public void setCabRepDestruirArmasController(
CabRepDestruirArmasController cabRepDestruirArmasController) {
this.cabRepDestruirArmasController = cabRepDestruirArmasController;
}
public DetRepDestruirArmasController getDetRepDestruirArmasController() {
return detRepDestruirArmasController;
}
public void setDetRepDestruirArmasController(
DetRepDestruirArmasController detRepDestruirArmasController) {
this.detRepDestruirArmasController = detRepDestruirArmasController;
}
public TgeneCatalogDetail getaDestruirseCatalog() {
return aDestruirseCatalog;
}
public void setaDestruirseCatalog(TgeneCatalogDetail aDestruirseCatalog) {
this.aDestruirseCatalog = aDestruirseCatalog;
}
public String getxPathLocation() {
return xPathLocation;
}
public void setxPathLocation(String xPathLocation) {
this.xPathLocation = xPathLocation;
}
public String getNombreReporte() {
return nombreReporte;
}
public void setNombreReporte(String nombreReporte) {
this.nombreReporte = nombreReporte;
}
public AlfrescoController getAlfrescoController() {
return alfrescoController;
}
public void setAlfrescoController(AlfrescoController alfrescoController) {
this.alfrescoController = alfrescoController;
}
public String getCreporte() {
return creporte;
}
public void setCreporte(String creporte) {
this.creporte = creporte;
}
public Boolean getSeGeneroReporte() {
return seGeneroReporte;
}
public void setSeGeneroReporte(Boolean seGeneroReporte) {
this.seGeneroReporte = seGeneroReporte;
}
public Boolean getIsEnableGrabar() {
return isEnableGrabar;
}
public void setIsEnableGrabar(Boolean isEnableGrabar) {
this.isEnableGrabar = isEnableGrabar;
}
public Boolean getIsEnableEnviar() {
return isEnableEnviar;
}
public void setIsEnableEnviar(Boolean isEnableEnviar) {
this.isEnableEnviar = isEnableEnviar;
}
/**
* Metodo encargado de marcar un registro de la tabla como seleccionado
*/
public void seleccionarArma(AjaxBehaviorEvent event){
try {
SelectBooleanCheckbox booleanCheckbox = (SelectBooleanCheckbox) event.getComponent();
record = (TarmDecomisoArma) booleanCheckbox.getAttributes().get("armaDecomisadaObj");
boolean checked = (Boolean) booleanCheckbox.getValue();
if (checked) {
record.getModifiedData().put("isSelect",Boolean.TRUE);
}else{
record.getModifiedData().put("isSelect",Boolean.FALSE);
this.getMfilelds().put("seleccionarTodos", Boolean.FALSE);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* Metodo encargado de obtener todas las claves primarias de los elementos seleccionados en la tabla
*/
public Collection<String> actualizarArmasSeleccionadas (){
List<String>armasSeleccionadasLst = new ArrayList<>();
for(TarmDecomisoArma decomisoArmaObj:lrecord){
if(decomisoArmaObj.getModifiedData().get("isSelect").equals(Boolean.TRUE)){
armasSeleccionadasLst.add(decomisoArmaObj.getPk());
}
}
return armasSeleccionadasLst;
}
/**
* Metodo encargado de verificar si existe al menos un registro seleccionado en la tabla
*/
public Boolean existeArmasSeleccionadas(){
Boolean flag = Boolean.FALSE;
for(TarmDecomisoArma decomisoArmaObj:lrecord){
if(decomisoArmaObj.getModifiedData().get("isSelect").equals(Boolean.TRUE)){
flag = Boolean.TRUE;
break;
}
}
return flag;
}
}

View File

@ -0,0 +1,56 @@
package com.fp.armas.rules.save.armas;
import java.sql.Date;
import java.util.List;
import com.fp.dto.rules.TransactionRule;
import com.fp.dto.save.SaveRequest;
import com.fp.persistence.parmas.fun.TarmRegistroArmas;
import com.fp.persistence.parmas.soli.TarmArmas;
import com.fp.sessionbeans.helper.Sequence;
public class ImporteArmaExcel extends TransactionRule {
private static final long serialVersionUID = -7465655492847129136L;
/**
* Armas a Registrar
*/
@Override
public SaveRequest normalProcess(SaveRequest pSaveRequest) throws Exception {
//lista de armas
List<Object> listArmas = pSaveRequest.getSaveBeanModifiedRecords("ARMASIMPORTEEXCEL");
//cabecera del arma
TarmRegistroArmas registroArmas = (TarmRegistroArmas) pSaveRequest.getSaveBeanModifiedObject("TREGISTROARMAS");
registroArmas.setPk(getCodigoRegistro());
registroArmas.setFcreacion(new Date(System.currentTimeMillis()));
for (Object object : listArmas) {
TarmArmas armaNueva = (TarmArmas)object;
armaNueva.setPk(getCodigoArma());
armaNueva.setFecharegistro(new Date(new java.util.Date().getTime()));
armaNueva.setCregistro(registroArmas.getPk());
armaNueva.setCodigoarma(armaNueva.getPk());
}
return pSaveRequest;
}
@Override
public SaveRequest reverseProcess(SaveRequest pRequest) throws Exception {
return pRequest;
}
private Long getCodigoRegistro() throws Exception{
Sequence sequence = new Sequence();
Long cregistro = sequence.getNextValue("CREGISTRO").longValue();
return cregistro;
}
private String getCodigoArma() throws Exception{
Sequence sequence = new Sequence();
String carma = sequence.getNextValue("CARMA").toString();
return carma;
}
}

View File

@ -0,0 +1,372 @@
package com.fp.frontend.controller.armas.funcionalidad;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.event.SelectEvent;
import com.fp.dto.AbstractDataTransport;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.ReportController;
import com.fp.frontend.controller.armas.parametros.CentroControlArmasController;
import com.fp.frontend.controller.armas.parametros.TarmCentroControlJurController;
import com.fp.frontend.controller.pcustomer.PersonAddressController;
import com.fp.frontend.controller.pcustomer.PersonDetailController;
import com.fp.frontend.controller.pcustomer.lov.PersonLovController;
import com.fp.frontend.controller.pgeneral.gene.CatalogDetailController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.frontend.utility.MsgControlArmas;
import com.fp.persistence.parmas.param.TarmCentroControl;
import com.fp.persistence.parmas.param.TarmCentroControlJur;
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.safe.TsafeUserDetail;
/**
* @author Andres Cevallos
* Clase Controladora la cual genera el reporte de armas
*/
@ManagedBean
@ViewScoped
public class ReporteArmasController extends AbstractController<AbstractDataTransport> {
public ReporteArmasController() throws Exception {
super(AbstractDataTransport.class);
// TODO Auto-generated constructor stub
}
private static final long serialVersionUID = 1L;
public Date fecha;
private TcustPersonDetail customerperson;
private List<TgeneCatalogDetail> lestados;
@ManagedProperty(value = "#{reportController}")
private ReportController reportController;
private TsafeUserDetail userDetail;
private String institucionCentroControl="";
private TarmCentroControl centroControl = new TarmCentroControl();
private Date fechainicial;
private Date fechafinal;
private String filtro="";
private String estado;
private String serieLote;
public String getInstitucionCentroControl() {
return institucionCentroControl;
}
public void setInstitucionCentroControl(String institucionCentroControl) {
this.institucionCentroControl = institucionCentroControl;
}
public TsafeUserDetail getUserDetail() {
return userDetail;
}
public void setUserDetail(TsafeUserDetail userDetail) {
this.userDetail = userDetail;
}
public ReportController getReportController() {
return reportController;
}
public void setReportController(ReportController reportController) {
this.reportController = reportController;
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
this.lrecord = new ArrayList<>();
this.beanalias = "REPORTE";
lestados = CatalogDetailController.find("ESTADOARMA");
userDetail=(TsafeUserDetail)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
estado="";
obtenerCentroControl();
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
/**
* Metodo que se debe ejecutar cuando es una transaccion de tipo verificar armas
* @throws Exception
*/
private void obtenerCentroControl() throws Exception {
TsafeUserDetail tsafeUserDetail = (TsafeUserDetail) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
PersonAddressController personAddressController = new PersonAddressController();
TcustPersonAddress tcustPersonAddres=personAddressController.findPrincipal(tsafeUserDetail.getPk().getPersoncode().toString());
TarmCentroControlJur centroControlJur= TarmCentroControlJurController.findxProvincia(tcustPersonAddres.getProvincecode());
centroControl= CentroControlArmasController.findPorCodigo(centroControlJur.getCcentrocontrol());
institucionCentroControl = CatalogDetailController.findxCodigoCodcatalogo( centroControl.getNombreinstitucion(), centroControl.getNombreinstitucioncodigo()).getDescription();
}
@Override
protected void querydatabase() {
}
/**
* Abre el Lov de Persona
*/
public void openPersonLov() {
Map<String, List<String>> params = new HashMap<>();
PersonLovController.openLov(params);
}
/**
* Carga los datos que se devuelven en el Lov de personas
* @param event
* @throws Exception
*/
public void onReturnPersonLov(SelectEvent event) throws Exception {
setCustomerperson( (TcustPersonDetail) event.getObject());
}
/**
* Graba los registros en la base de datos
*/
@Override
public void save() {
}
public void generarReporte(){
if(fechainicial.getTime()>fechafinal.getTime()){
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_fechafinal"));
return;
}
String gradoUsuario ="";
filtro=" ";
String path = "armas/reports/reporteArmas";
if(customerperson!=null){
filtro=" and tarma.cregistro in "
+ " (select regarma.cregistro from tarmregistroarmas regarma where regarma.personcode='"+customerperson.getPk().getPersoncode()+"')";
}
if(estado!=null && !estado.equals("")){
if(estado.equals("APTA")){
filtro+=" and tarma.carma in (select carma from tarmarmapruebas p "
+ " where p.carmaprueba=(select max(prue.carmaprueba)"
+ " from tarmarmapruebas prue where prue.apruebaevaluacion='Y' and prue.carma in(select codar.carma from tarmarmas codar"
+ " where codar.codigoarma =(select ar.codigoarma from tarmarmas ar where carma=tarma.carma) ))) ";
//"and pru.apruebaevaluacion='Y'";
}
else{
filtro+=" and tarma.estado='"+estado+"' ";
}
}
//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");
// parameters.put("fechaCorte", (new SimpleDateFormat("dd-MM-yyyy")).format(fechaCorte).toString());
// parameters.put("gradoUsuario",gradoUsuario);
try {
//Usuario logueado en la aplicacion
String nombreUsuario;
if(userDetail.getPk().getPersoncode()!=null){
nombreUsuario = PersonDetailController.find(userDetail.getPk().getPersoncode().toString()).getName();
parameters.put("personcode", userDetail.getPk().getPersoncode());
}
else{
nombreUsuario = "";
}
//filtro = "where tarma.personcode='1138'";
parameters.put("filtro", filtro);
SimpleDateFormat fechatxt=new SimpleDateFormat("yyyy-MM-dd");
parameters.put("fechainicial", fechatxt.format(fechainicial));
parameters.put("fechafinal", fechatxt.format(fechafinal));
parameters.put("usuario", nombreUsuario);
parameters.put("unidadmilitar", institucionCentroControl);
// parameters.put("tecnicoAlmacenamiento",MsgControlArmas.getProperty("tecnicoAlmacenamiento")+" "+institucionCentroControl);
// parameters.put("jefe",MsgControlArmas.getProperty("jefe")+" "+institucionCentroControl);
String format="xlsx";
String filename= MsgControlArmas.getProperty("lbl_nombreexcel");
//Fecha actual
Calendar fechaActualCldr = Calendar.getInstance();
StringBuilder fechaActualSB = new StringBuilder();
fechaActualSB = fechaActualSB.append((fechaActualCldr.get(Calendar.DAY_OF_MONTH)) <= 9 ? "0" + (fechaActualCldr.get(Calendar.DAY_OF_MONTH)) : (fechaActualCldr.get(Calendar.DAY_OF_MONTH)));
fechaActualSB = fechaActualSB.append("-").append((fechaActualCldr.get(Calendar.MONTH)+1) <= 9 ? "0" + (fechaActualCldr.get(Calendar.MONTH) + 1) : (fechaActualCldr.get(Calendar.MONTH)+1));
fechaActualSB = fechaActualSB.append("-").append(fechaActualCldr.get(Calendar.YEAR));
fechaActualSB = fechaActualSB.append(" ").append(fechaActualCldr.get(Calendar.HOUR_OF_DAY));
fechaActualSB = fechaActualSB.append(":").append((fechaActualCldr.get(Calendar.MINUTE)) <= 9 ? "0" + (fechaActualCldr.get(Calendar.MINUTE)) : (fechaActualCldr.get(Calendar.MINUTE)));
parameters.put("lugarfecha", fechaActualSB.toString());
// parameters.put("transaccion",numeroTransaccionEnvioConvertido);
parameters.put("codigoQR", "PRUEBAARMAS"+fechaActualSB.toString());
// format = CatalogDetailController.findxCodigoCodcatalogo(tipoReporte, "TIPOREPORTE").getLegalcode();
this.reportController.executeXls(path, parameters, format, filename, this.getLoginController());
// this.reportController.execute(path, parameters, null, filename, this.getLoginController());
// xpathflujo = generarXpath();
// alfrescoController.uploadFile(file,numeroTransaccionEnvioConvertido+".pdf",xpathflujo);
// iniciarFlujo(xpathflujo+"/cm:"+numeroTransaccionEnvioConvertido+ ".pdf");//="cm:Decomiso/cm:A-2014/cm:M-10/cm:ENV-000000319/cm:ENV-000000319.pdf"
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
}
}
public void generarReporteHistorico(){
if(fechainicial.getTime()>fechafinal.getTime()){
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_fechafinal"));
return;
}
String gradoUsuario ="";
String path = "armas/reports/reporteHistoricoArmas.jrxml";
filtro="";
if(serieLote!=null && serieLote.trim().length()>0){
filtro=" and tarma.lote='"+serieLote+"' ";
}
//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");
try {
//Usuario logueado en la aplicacion
String nombreUsuario;
if(userDetail.getPk().getPersoncode()!=null){
nombreUsuario = PersonDetailController.find(userDetail.getPk().getPersoncode().toString()).getName();
parameters.put("personcode", userDetail.getPk().getPersoncode());
}
else{
nombreUsuario = "";
}
//filtro = "where tarma.personcode='1138'";
parameters.put("filtro", filtro);
SimpleDateFormat fechatxt=new SimpleDateFormat("dd/MM/yyyy");
parameters.put("fechainicial", fechatxt.format(fechainicial));
parameters.put("fechafinal", fechatxt.format(fechafinal));
parameters.put("usuario", nombreUsuario);
parameters.put("unidadmilitar", institucionCentroControl);
String format="xlsx";
String filename= MsgControlArmas.getProperty("lbl_nombreexcelhistorico");
//Fecha actual
Calendar fechaActualCldr = Calendar.getInstance();
StringBuilder fechaActualSB = new StringBuilder();
fechaActualSB = fechaActualSB.append((fechaActualCldr.get(Calendar.DAY_OF_MONTH)) <= 9 ? "0" + (fechaActualCldr.get(Calendar.DAY_OF_MONTH)) : (fechaActualCldr.get(Calendar.DAY_OF_MONTH)));
fechaActualSB = fechaActualSB.append("-").append((fechaActualCldr.get(Calendar.MONTH)+1) <= 9 ? "0" + (fechaActualCldr.get(Calendar.MONTH) + 1) : (fechaActualCldr.get(Calendar.MONTH)+1));
fechaActualSB = fechaActualSB.append("-").append(fechaActualCldr.get(Calendar.YEAR));
fechaActualSB = fechaActualSB.append(" ").append(fechaActualCldr.get(Calendar.HOUR_OF_DAY));
fechaActualSB = fechaActualSB.append(":").append((fechaActualCldr.get(Calendar.MINUTE)) <= 9 ? "0" + (fechaActualCldr.get(Calendar.MINUTE)) : (fechaActualCldr.get(Calendar.MINUTE)));
parameters.put("lugarfecha", fechaActualSB.toString());
this.reportController.executeXls(path, parameters, format, filename, this.getLoginController());
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
}
}
/* (non-Javadoc)
* @see com.fp.frontend.controller.AbstractController#postCommit(com.fp.dto.Response)
*/
public Date getFecha() {
return fecha;
}
public void setFecha(Date fecha) {
this.fecha = fecha;
}
public TcustPersonDetail getCustomerperson() {
return customerperson;
}
public void setCustomerperson(TcustPersonDetail customerperson) {
this.customerperson = customerperson;
}
public List<TgeneCatalogDetail> getLestados() {
return lestados;
}
public void setLestados(List<TgeneCatalogDetail> lestados) {
this.lestados = lestados;
}
public Date getFechainicial() {
return fechainicial;
}
public void setFechainicial(Date fechainicial) {
this.fechainicial = fechainicial;
}
public Date getFechafinal() {
return fechafinal;
}
public void setFechafinal(Date fechafinal) {
this.fechafinal = fechafinal;
}
public String getEstado() {
return estado;
}
public void setEstado(String estado) {
this.estado = estado;
}
public String getSerieLote() {
return serieLote;
}
public void setSerieLote(String serieLote) {
this.serieLote = serieLote;
}
}

View File

@ -0,0 +1,486 @@
package com.fp.frontend.controller.armas.funcionalidad;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.event.SelectEvent;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.dto.query.DtoQuery;
import com.fp.dto.query.Filter;
import com.fp.dto.query.SubQuery;
import com.fp.dto.save.DtoSave;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.armas.parametros.VentaTotalPersonaController;
import com.fp.frontend.controller.pcustomer.PersonDetailController;
import com.fp.frontend.controller.pcustomer.lov.PersonLovController;
import com.fp.frontend.controller.pgeneral.gene.CatalogDetailController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.frontend.utility.MsgControlArmas;
import com.fp.persistence.parmas.fun.TarmMovimientoArmas;
import com.fp.persistence.parmas.soli.TarmArmas;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetail;
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
/**
* @author Andres Cevallos
* Clase Controladora la cual maneja la venta de armas
*/
@ManagedBean
@ViewScoped
public class VentaController extends AbstractController<TarmArmas> {
public VentaController() throws Exception {
super(TarmArmas.class);
}
private static final long serialVersionUID = 1L;
@ManagedProperty(value = "#{movimientoController}")
private MovimientoController movimientoController;
@ManagedProperty(value = "#{registroArmController}")
private RegistroArmController registroArmController;
@ManagedProperty(value = "#{ventaTotalPersonaController}")
private VentaTotalPersonaController ventaTotalPersonaController;
private String loteFilter;
/**
* Lisat de personas
*/
private List<TcustPersonDetail> lperson;
private TarmMovimientoArmas movimientoArma;
/**
* Persona Cliente a la cual se le vende un arma
*/
private TcustPersonDetail compradorArma;
/**
* Cantidad de producto en venta
*/
private Integer cantidad;
/**
* Peso del producto en venta
*/
private BigDecimal peso;
/**
* Referencia de los Movimientos en el catalogo
*/
private List<TgeneCatalogDetail> lmovimientos;
/**
* Lista referenciada al catalogo
*/
private List<TgeneCatalogDetail> lcatalog;
/**
* Referencia del cliente en el catalogo
*/
private TgeneCatalogDetail cdetalle;
/**
* Detalle de la persona que vende el arma
*/
private TcustPersonDetail persondetail;
/**
* Fecha actual del sistema
*/
private Date fecha;
@PostConstruct
private void postconstruct() {
this.init();
querydatabase();
}
private void init() {
try {
peso=null;
cantidad=null;
this.lrecord = new ArrayList<>();
this.beanalias = "VENTAARMAS";
// tipomovimiento=false;
TsafeUserDetail tsafeUserDetail=(TsafeUserDetail)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
this.persondetail=PersonDetailController.find(tsafeUserDetail.getPk().getPersoncode().toString());
lmovimientos = CatalogDetailController.find("TIPOREGISTRO","MOV");//catalogo de movimientos
cdetalle = CatalogDetailController.findxCodigoCodcatalogo(getPersondetail().getIdentificationcatalog(),getPersondetail().getIdentificationcatalogcode());
fecha = new Date();
lcatalog=CatalogDetailController.find("IDENTIFICATION");
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
@SuppressWarnings("unchecked")
@Override
public void querydatabase() {
try {
DtoQuery dto = super.getDtoQuery(true);
SubQuery subqueryMarca= new SubQuery("TgeneCatalogDetail","description","marca","i.pk.catalog=t.marca and i.pk.catalogcode=t.marcacodigo");
dto.addSubQuery(subqueryMarca);
SubQuery subqueryColor= new SubQuery("TgeneCatalogDetail","description","color","i.pk.catalog=t.color and i.pk.catalogcode=t.colorcodigo");
dto.addSubQuery(subqueryColor);
SubQuery subqueryEstado= new SubQuery("TgeneCatalogDetail","description","estado","i.pk.catalog=t.estado and i.pk.catalogcode=t.estadocodigo");
dto.addSubQuery(subqueryEstado);
SubQuery subqueryLonguitud= new SubQuery("TgeneCatalogDetail","description","longitud","i.pk.catalog=(select o.longitud from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo) and "
+ " i.pk.catalogcode=(select o.longitudcodigo from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo)");
dto.addSubQuery(subqueryLonguitud);
SubQuery subqueryClase= new SubQuery("TgeneCatalogDetail","description","clase","i.pk.catalog=(select o.clase from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo) and "
+ " i.pk.catalogcode=(select o.clasecodigo from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo)");
dto.addSubQuery(subqueryClase);
SubQuery subqueryTipoArma= new SubQuery("TgeneCatalogDetail","description","tipoarmaexplosivo","i.pk.catalog=(select o.tipoarmaexplosivo from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo) and "
+ " i.pk.catalogcode=(select o.tipoarmaexplosivocodigo from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo)");
dto.addSubQuery(subqueryTipoArma);
SubQuery subqueryCalibre= new SubQuery("TgeneCatalogDetail","description","calibre","i.pk.catalog=(select o.calibre from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo) and "
+ " i.pk.catalogcode=(select o.calibrecodigo from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo)");
dto.addSubQuery(subqueryCalibre);
SubQuery subqueryUnidad= new SubQuery("TgeneCatalogDetail","description","unidadmedidapeso","i.pk.catalog=(select o.unidadmedidapeso from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo) and "
+ " i.pk.catalogcode=(select o.unidadmedidapesocodigo from TarmTipoArmaExplosivo o where o.pk=t.ctipoarmaexplosivo)");
dto.addSubQuery(subqueryUnidad);
dto.setOrderby("lote, ctipoarmaexplosivo,cregistro");
Filter filtro=new Filter();
String filtrofecha= "t.fecharegistro=(select max(ta.fecharegistro) from TarmArmas ta where t.codigoarma=ta.codigoarma and t.cregistro=ta.cregistro) "
+ " and t.estado in("+MsgControlArmas.getProperty("codigo_estado_arma_busqueda_venta")+") "//'REG','REN','APTA','DEV','ECO','COLE'
+ " and cregistro in (select reg.pk from TarmRegistroArmas reg where reg.personcode ='"+persondetail.getPk().getPersoncode()+"' )"
+ " and (t.peso>0 or t.cantidad>0)";
if(loteFilter!=null && !loteFilter.isEmpty()){
filtrofecha+=" and UPPER(t.lote) like '"+loteFilter+"'";
}
filtro.setSql(filtrofecha);
dto.addFiltro(filtro);
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(this.beanalias, dto); // permite adicionar mas de una tabla.
Request request = this.callerhelper.getRequest();
request.setQueryTables(mtables);
// request.put("queryalias", "ARMASCOMPLETE");
Response resp = this.callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
this.lrecord = new ArrayList<TarmArmas>();
MessageHelper.setMessageError(resp);
} else {
this.lrecord = (List<TarmArmas>) resp.get(this.beanalias);
super.postQuery(this.lrecord);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
/**
* Cambia el valor del movimiento de Venta a Materia Prima
*/
public void changeType(){
compradorArma=new TcustPersonDetail();
}
/**
* Valida que la fecha de venta no seaa superior a la fecha del sistema
* @param fech
*/
public void validarfecha(Date fech){
if(fech.getTime()>(new Date()).getTime()){
fecha=new Date();
}
}
/**
* Actualiza la informacion en el lrecord
*/
@Override
public void update(){
try {
//ACTUALIZA ELRESTO DE DATOS DE LA TABLA DE MOVIMIENTO
this.movimientoArma.setPersoncodevendedor(persondetail.getPk().getPersoncode());
this.movimientoArma.getModifiedData().put("personaVemdedor", persondetail);
if(movimientoArma.getTipomovimiento().equals("VENT")){
if(compradorArma!=null && compradorArma.getPk()!=null){
this.movimientoArma.setPersoncodecomprador(compradorArma.getPk().getPersoncode());
this.movimientoArma.getModifiedData().put("personaComprador", compradorArma);
}
else{
MessageHelper.setMessageWarn("DEBE INGRESAR UN CLIENTE");
return;
}
}else{
this.movimientoArma.getModifiedData().put("personaComprador", persondetail);
this.movimientoArma.setPersoncodecomprador(persondetail.getPk().getPersoncode());//es el mismo si el tipo movimientoArma.getTipomovimiento() es diferente de nenta
}
save();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Valida que la cantidad que se desea vender no sea superior a la cantidad maxima que se tiene
* @param cantidad
*/
public void validarCantidadMexima(Integer cantidad){
this.peso=null;
if(cantidad==null || cantidad==0 || cantidad<0|| cantidad.compareTo(record.getCantidad())>0){
this.cantidad=record.getCantidad();
}
}
/**
* Valida que la cantidad que se desea vender no sea superior a la cantidad maxima que se tiene
* @param peso
*/
public void validarPesoMexima(BigDecimal peso){
this.cantidad=null;
if(peso==null || peso.compareTo(new BigDecimal(0))==0|| peso.compareTo(new BigDecimal(0))<0|| peso.compareTo(record.getPeso())>0){
this.peso=getRecord().getPeso();
}
}
/**
* Crea un registro de arma
* @param arm
*/
public void create(TarmArmas arm){
try {
cantidad=arm.getCantidad();
peso=arm.getPeso();
//crea un movimiento para la tabla TarmMovimientoArmas
movimientoArma= new TarmMovimientoArmas();
//crea a la persona compradora
compradorArma=new TcustPersonDetail();
// tipomovimiento=false;
} catch (Exception e) {
e.printStackTrace();
}
}
public TgeneCatalogDetail getCdetalle() {
return cdetalle;
}
public void setCdetalle(TgeneCatalogDetail cdetalle) {
this.cdetalle = cdetalle;
}
/**
* Abre el Lov de Persona
*/
public void openPersonLov() {
Map<String, List<String>> params = new HashMap<>();
PersonLovController.openLov(params);
}
/**
* Carga los datos que se devuelven en el Lov de personas
* @param event
* @throws Exception
*/
public void onReturnPersonLov(SelectEvent event) throws Exception {
compradorArma= (TcustPersonDetail) event.getObject();
}
/**
* Graba los registros en la base de datos
*/
@Override
public void save() {
try {
//actualiza el movimiento
this.movimientoArma.setCarma(record.getPk());
this.movimientoArma.setTipomovimientocodigo("TIPOMOVIMIENTO");
this.movimientoArma.setFecha(new java.sql.Timestamp(fecha.getTime()) );
this.movimientoController.create();
this.movimientoController.setRecord(movimientoArma);
this.movimientoController.getRecord().setIsnew(true);
this.movimientoController.update();
//actualiza el arma
//this.record.setPk(null);
if(cantidad!=null){
this.record.setValorAux(cantidad);
}
if(peso!=null){
this.record.setPesoAux(peso);
}
super.update();
Request request = this.callerhelper.getRequest();
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
DtoSave dtosaveRegistro = this.registroArmController.getDtoSave(true);
dtosaveRegistro.setPosition(1);
msave.put(registroArmController.getBeanalias(), dtosaveRegistro);
DtoSave dtosaveMovimiento = this.movimientoController.getDtoSave(true);
dtosaveMovimiento.setPosition(2);
msave.put(movimientoController.getBeanalias(), dtosaveMovimiento);//1
DtoSave dtosaveTotalPersona = this.ventaTotalPersonaController.getDtoSave(true);
dtosaveTotalPersona.setPosition(3);
msave.put(ventaTotalPersonaController.getBeanalias(), dtosaveTotalPersona);
DtoSave dtosaveArma = this.getDtoSave(true);
dtosaveArma.setPosition(4);
msave.put(this.getBeanalias(), dtosaveArma);//2
request.setSaveTables(msave);
Response resp = this.callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
this.ventaTotalPersonaController.postCommit(resp);
this.movimientoController.postCommit(resp);
this.registroArmController.postCommit(resp);
this.postCommit(resp);
MessageHelper.setMessageInfo(resp);
} else {
MessageHelper.setMessageError(resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
querydatabase();
}
/* (non-Javadoc)
* @see com.fp.frontend.controller.AbstractController#postCommit(com.fp.dto.Response)
*/
@Override
public void postCommit(Response response) throws Exception {
super.postCommit(response);
}
public TcustPersonDetail getPersondetail() {
return persondetail;
}
public void setPersondetail(TcustPersonDetail persondetail) {
this.persondetail = persondetail;
}
public List<TgeneCatalogDetail> getLcatalog() {
return lcatalog;
}
public void setLcatalog(List<TgeneCatalogDetail> lcatalog) {
this.lcatalog = lcatalog;
}
public TcustPersonDetail getCompradorArma() {
return compradorArma;
}
public void setCompradorArma(TcustPersonDetail compradorArma) {
this.compradorArma = compradorArma;
}
public RegistroArmController getRegistroArmController() {
return registroArmController;
}
public void setRegistroArmController(RegistroArmController registroArmController) {
this.registroArmController = registroArmController;
}
public Integer getCantidad() {
return cantidad;
}
public void setCantidad(Integer cantidad) {
this.cantidad = cantidad;
}
public BigDecimal getPeso() {
return peso;
}
public void setPeso(BigDecimal peso) {
this.peso = peso;
}
public Date getFecha() {
return fecha;
}
public void setFecha(Date fecha) {
this.fecha = fecha;
}
public List<TgeneCatalogDetail> getLmovimientos() {
return lmovimientos;
}
public void setLmovimientos(List<TgeneCatalogDetail> lmovimientos) {
this.lmovimientos = new ArrayList<TgeneCatalogDetail>();
for(TgeneCatalogDetail mov:lmovimientos){
//No se incluye el tipo de registro TRASLADO (TRASL)
if(!mov.getPk().getCatalog().equalsIgnoreCase("TRASL")){
this.lmovimientos.add(mov);
}
}
}
public List<TcustPersonDetail> getLperson() {
return lperson;
}
public void setLperson(List<TcustPersonDetail> lperson) {
this.lperson = lperson;
}
public TarmMovimientoArmas getMovimientoArma() {
return movimientoArma;
}
public void setMovimientoArma(TarmMovimientoArmas movimientoArma) {
this.movimientoArma = movimientoArma;
}
public MovimientoController getMovimientoController() {
return movimientoController;
}
public void setMovimientoController(MovimientoController movimientoController) {
this.movimientoController = movimientoController;
}
public VentaTotalPersonaController getVentaTotalPersonaController() {
return ventaTotalPersonaController;
}
public void setVentaTotalPersonaController(
VentaTotalPersonaController ventaTotalPersonaController) {
this.ventaTotalPersonaController = ventaTotalPersonaController;
}
public String getLoteFilter() {
return loteFilter;
}
public void setLoteFilter(String loteFilter) {
this.loteFilter = loteFilter;
}
}

View File

@ -0,0 +1,136 @@
package com.fp.general.security.rules;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fp.common.helper.Constant;
import com.fp.common.logger.APPLogger;
import com.fp.dto.Response;
import com.fp.dto.query.QueryRequest;
import com.fp.general.db.DataHelper;
import com.fp.general.exception.GeneralException;
import com.fp.general.helper.MenuHelper;
import com.fp.persistence.pgeneral.menu.TgeneMenuLevel;
import com.fp.persistence.pgeneral.menu.TgeneMenuLevelDesc;
import com.fp.persistence.pgeneral.menu.TgeneMenuProfile;
import com.fp.persistence.pgeneral.menu.TgeneMenuSubLevel;
import com.fp.persistence.pgeneral.menu.TgeneMenuSubLevelDesc;
/**
* Clase que se encarga de armar y entregar el menu, asociado a un perfil.
*
* @author Jorge Vaca
* @version 2.1
*/
public class Menu extends MenuHelper {
/** Map que contiene los datos del menu. */
private final Map<String, Object> rootmenu = new HashMap<String, Object>();
/*
* (non-Javadoc)
*
* @see com.fp.dto.rules.QueryRule#process(com.fp.dto.query.QueryRequest)
*/
@Override
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
Response response = pQueryRequest.getResponse();
String profile = pQueryRequest.getProfile();
String language = pQueryRequest.getLanguage();
TgeneMenuProfile menuprofile = DataHelper.getInstance().getTgeneMenuProfile(profile);
if (menuprofile != null) {
List<TgeneMenuLevel> lMenuLevel = DataHelper.getInstance().getTgeneMenuLevel(menuprofile.getMenucode());
List<Map<String, Object>> lLevels = new ArrayList<Map<String, Object>>();
for (TgeneMenuLevel obj : lMenuLevel) {
this.completeLevel(obj, lLevels, language);
}
rootmenu.put("items", lLevels);
rootmenu.put("label", "t");
response.put("rootmenu", rootmenu);
} else {
throw new GeneralException("GENE-0017", "EL PERFIL {0} NO TIENE ASOCIADO UN MENU", profile);
}
return pQueryRequest;
}
/**
* Metodo que completa datos del grupo de menu.
*
* @param pTgeneMenuGroup Definicion de grupo de menu.
* @param pGroup Grupo de menu a completar datos.
* @param languagecode Codigo de lenguage.
* @return boolean
* @throws Exception
*/
private boolean completeLevel(TgeneMenuLevel pTgeneMenuLevel, List<Map<String, Object>> lLevels, String languagecode) throws Exception {
TgeneMenuLevelDesc tgeneMenuLevelDesc = DataHelper.getInstance().getTgeneMenuLevelDesc(pTgeneMenuLevel.getPk().getMenucode(),
pTgeneMenuLevel.getPk().getLevelcode(), languagecode);
if (tgeneMenuLevelDesc != null) {
String labelMenu = tgeneMenuLevelDesc.getDescription();
if (labelMenu == null) {
labelMenu = "ETIQUETA DE MENU NO DEFINIDA";
}
Map<String, Object> mlevel = new HashMap<String, Object>();
mlevel.put("t", Constant.capitalize(labelMenu));
mlevel.put("sl", Constant.ifYes(pTgeneMenuLevel.getHavesublevel()) == true ? "Y" : "N");
List<Object> lData = super.completTransactionByLevel(tgeneMenuLevelDesc, languagecode);
if (Constant.ifYes(pTgeneMenuLevel.getHavesublevel())) {
this.fillSubLevel(pTgeneMenuLevel, lData, languagecode);
}
mlevel.put("items", lData);
lLevels.add(mlevel);
}
return true;
}
/**
* Metodo que se encarga de construir ya dicionar el segundo nivel del menu.
*
* @param pTgeneMenuLevel Datos del segundo nivel del menu.
* @param lData Lista que contiene los datos del primer nivel del menu, al cual se adiciona los datos del segundo
* nivel del menu.
* @param languagecode Codigo de lenguaje del usuario.
* @throws Exception
*/
private void fillSubLevel(TgeneMenuLevel pTgeneMenuLevel, List<Object> lData, String languagecode) throws Exception {
List<TgeneMenuSubLevel> lSubLevel = DataHelper.getInstance().getTgeneMenuSuLevels(pTgeneMenuLevel.getPk().getMenucode(),
pTgeneMenuLevel.getPk().getLevelcode());
if (lSubLevel == null) {
return;
}
for (TgeneMenuSubLevel obj : lSubLevel) {
Map<String, Object> mLevel = new HashMap<String, Object>();
this.completeSubLevel(obj, mLevel, languagecode);
if (!mLevel.isEmpty()) {
lData.add(mLevel);
} else {
APPLogger.getLogger().debug(
"\nETIQUETA DE SUBNIVEL NO DEFINIDA\n\tmenucode=" + obj.getPk().getMenucode() + ";\n\tlevelcode="
+ obj.getPk().getLevelcode() + ";\n\tsublevelcode=" + obj.getPk().getSublevel() + ";\n\tlanguage=" + languagecode);
}
}
}
/**
* Metodo que completa datos del segundo nivel del menu.
*
* @param pMenuSubLevel Datos del segundo nivel del menu.
* @param mLevel Map que contiene informacion de todas las opciones del segundo nivel del menu.
* @param languagecode Codigo de lenguaje del usuario.
* @throws Exception
*/
private void completeSubLevel(TgeneMenuSubLevel pMenuSubLevel, Map<String, Object> mLevel, String languagecode) throws Exception {
TgeneMenuSubLevelDesc subleveldesc = DataHelper.getInstance().getTgeneMenuSubLevelDesc(pMenuSubLevel.getPk().getMenucode(),
pMenuSubLevel.getPk().getLevelcode(), pMenuSubLevel.getPk().getSublevel(), languagecode);
if (subleveldesc != null) {
String labelMenu = subleveldesc.getDescription();
if (labelMenu == null) {
labelMenu = "ETIQUETA DE MENU NO DEFINIDA";
}
mLevel.put("t", Constant.capitalize(labelMenu));
super.completTransactionBySubLevel(subleveldesc, mLevel, languagecode);
}
}
}

View File

@ -0,0 +1,242 @@
package com.fp.persistence.pgeneral.result;
import java.io.Serializable;
import java.lang.reflect.Field;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;
import com.fp.dto.hb.HibernateBean;
import com.fp.general.exception.GeneralException;
/** Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENERESULTS */
@Entity(name = "TgeneResults")
@Table(name = "TGENERESULTS")
public class TgeneResults extends com.fp.dto.AbstractDataTransport implements Serializable, HibernateBean, Cloneable {
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
/**
* Clave primaria de la Entidad TgeneResults
*/
@EmbeddedId
private TgeneResultsKey pk;
@Version
@Column(name = "RECORDVERSION", nullable = true)
/**
* Codigo que valida caducidad de registro
*/
private Integer recordversion;
@Column(name = "DESCRIPTION", nullable = false)
/**
* Mensaje a presentar
*/
private String description;
/** Contructor por defecto */
public TgeneResults() {
}
/**
* Contructor de TgeneResults
*
* @param pPk Clave Primaria del entity
* @param pDescription Mensaje a presentar
*/
public TgeneResults(TgeneResultsKey pPk, String pDescription) {
this();
this.pk = pPk;
this.description = pDescription;
}
/**
* Metodo que entrega datos de la tabla dada la clave primaria.
*
* @param pEntityManager referencia de la session a obtener datos del bean.
* @param pKey Caleve primaria del bean.
* @return TgeneResults
*/
public static TgeneResults find(EntityManager pEntityManager, TgeneResultsKey pKey) throws Exception {
TgeneResults obj = pEntityManager.find(TgeneResults.class, pKey);
return obj;
}
/**
* Entrega la Clave primaria de TgeneResults
*
* @return El objeto que referencia a la Clave primaria de TgeneResults
*/
public TgeneResultsKey getPk() {
return this.pk;
}
/**
* Fija un nuevo valor a la Clave primaria de TgeneResults
*
* @param pPk El objeto que referencia a la nueva Clave primaria de TgeneResults
*/
public void setPk(TgeneResultsKey pPk) {
this.pk = pPk;
}
/**
* Obtiene el valor de recordversion
*
* @return valor de recordversion
*/
public Integer getRecordversion() {
return this.recordversion;
}
/**
* Fija el valor de recordversion
*
* @param pRecordversion nuevo Valor de recordversion
*/
public void setRecordversion(Integer pRecordversion) {
this.recordversion = pRecordversion;
}
/**
* Obtiene el valor de description
*
* @return valor de description
*/
public String getDescription() {
return this.description;
}
/**
* Fija el valor de description
*
* @param pDescription nuevo Valor de description
*/
public void setDescription(String pDescription) {
this.description = pDescription;
}
@Override
public boolean equals(Object rhs) {
if (rhs == null) {
return false;
}
if (!(rhs instanceof TgeneResults)) {
return false;
}
TgeneResults that = (TgeneResults) rhs;
if ((this.getPk() == null) || (that.getPk() == null)) {
return false;
}
return (this.getPk().equals(that.getPk()));
}
/**
* Implementacion del metodo hashCode de la la entidad TgeneResults
*
* @return el hashCode la instancia
*/
@Override
public int hashCode() {
if (this.hashValue == 0) {
int result = 17;
if (this.getPk() == null) {
result = super.hashCode();
} else {
result = this.getPk().hashCode();
}
this.hashValue = result;
}
return this.hashValue;
}
/** Implementacion toString */
@Override
public String toString() {
Field[] fs = this.getClass().getDeclaredFields();
String data = "";
for (Field f : fs) {
try {
String name = f.getName();
if (f.getType().getName().compareTo("java.util.Set") == 0) {
continue;
}
if ((name.compareTo("hashValue") == 0) || (name.compareTo("serialVersionUID") == 0)) {
continue;
}
data += name + "=" + f.get(this) + ";";
} catch (Exception e) {
continue;
}
}
if (data.compareTo("") == 0) {
data = super.toString();
}
return data;
}
/** Implementacion de la creacion de un bean en blanco TgeneResults */
@Override
public Object createInstance() {
TgeneResults instance = new TgeneResults();
instance.setPk(new TgeneResultsKey());
return instance;
}
/**
* Clona la entidad TgeneResults
*
* @see com.fp.dto.hb.HibernateBean#cloneMe()
*/
@Override
public Object cloneMe() throws CloneNotSupportedException {
TgeneResults p = (TgeneResults) this.clone();
p.setPk((TgeneResultsKey) this.pk.cloneMe());
return p;
}
// Metodos manuales.
/**
* Sentencia que entrega el texto asociado a un codigo de error e idioma.
*/
private static final String JPQL = "from TgeneResults t where t.pk.resultcode = :resultcode and t.pk.languagecode = :languagecode";
/**
* Entrega la descripcion de un codigo de error.
*
* @param entityManager Referencia a una session de base de datos.
* @param resultcode Codigo de resultado a buscar la descripcion.
* @param languagecode Codigo de lenguaje a buscar la descripcion.
* @return TgeneResults
* @throws Exception
*/
public static TgeneResults find(EntityManager entityManager, String resultcode, String languagecode) throws Exception {
Query qry = entityManager.createQuery(JPQL);
qry.setParameter("resultcode", resultcode);
qry.setParameter("languagecode", languagecode);
try {
return (TgeneResults) qry.getSingleResult();
} catch (NoResultException e) {
throw new GeneralException("GENE-0044", "DESCRIPCIÓN DEL MENSAJE APLICATIVO: {0} IDIOMA: {1} NO DEFINIDO EN TGENERESULTS", resultcode,
languagecode);
}
}
}

View File

@ -0,0 +1,441 @@
package com.fp.frontend.controller.armas.funcionalidad;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
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 javax.servlet.http.HttpServletResponse;
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.query.SubQuery;
import com.fp.dto.save.DtoSave;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.alfresco.AlfrescoController;
import com.fp.frontend.controller.armas.parametros.CashManagementHistoryController;
import com.fp.frontend.controller.armas.solicitud.SolicitudArmasController;
import com.fp.frontend.controller.armas.solicitud.SolicitudTramiteController;
import com.fp.frontend.controller.pcustomer.lov.PersonLovController;
import com.fp.frontend.controller.pgeneral.date.TgeneNotAccountingDayController;
import com.fp.frontend.controller.pgeneral.gene.ParametersController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.frontend.utility.Utilidades;
import com.fp.persistence.parmas.fun.TarmCashManagementHistory;
import com.fp.persistence.parmas.soli.CashManagementDTO;
import com.fp.persistence.parmas.soli.TarmSolicitud;
import com.fp.persistence.parmas.soli.TarmSolicitudTramite;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pgeneral.gene.TgeneParameters;
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
/**
* @author Christian Pazmino
* Cash management
*/
@ManagedBean
@ViewScoped
public class ReporteCashManagmentController extends AbstractController<AbstractDataTransport> {
public ReporteCashManagmentController() throws Exception {
super(AbstractDataTransport.class);
// TODO Auto-generated constructor stub
}
private static final long serialVersionUID = 1L;
// Fecha inicial
private Date fechainicial;
// Fecha final
private Date fechafinal;
// Fecha inicial con mascara
private String fechaInicialStr;
// Fecha final con mascara
private String fechaFinalStr;
// Lista con informacion de los tramites habilitados para realizar los depositos en la cuenta
private List<CashManagementDTO> cashManagementList = new ArrayList<CashManagementDTO>();
// Fecha del ultimo reporte generado
private String fechaUltReporte;
// Autor del ultimo reporte generado
private String autorUltReporte;
// Path del reporte en el alfresco
private String xpathReporte;
// Controlador de Solicitud Tramite
@ManagedProperty(value="#{solicitudTramiteController}")
private SolicitudTramiteController solicitudTramiteController;
// Controlador del alfresco
@ManagedProperty(value = "#{alfrescoController}")
private AlfrescoController alfrescoController;
// Nombre identificador del archivo cash management generado
private String nombreArchivo;
private File archivo;
/**
* Controlador que maneja los datos de generacion ultima vez del reporte
*/
@ManagedProperty(value = "#{cashManagementHistoryController}")
private CashManagementHistoryController cashManagementHistoryController;
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
TarmCashManagementHistory ultimoReporteObj = CashManagementHistoryController.findUltimoReporteGenerado();
if(ultimoReporteObj!=null){
SimpleDateFormat sdfUltimaFecha = new SimpleDateFormat("dd/MM/yyyy HH:mm");
fechaUltReporte = sdfUltimaFecha.format(ultimoReporteObj.getDatefrom());
autorUltReporte = ultimoReporteObj.getModifiedData().get("personname")!=null? ultimoReporteObj.getModifiedData().get("personname").toString():null;
}
this.beanalias = "CASHMANAGEMENT";
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
int diasLaborablesPermitidos = Integer.parseInt(ParametersController.find("DIASDEPOSITO", "1").getNumbervalue().toString());
// La fecha inicial se calcula en funcion del numero de dias laborables permitidos para el deposito
fechainicial = TgeneNotAccountingDayController.diasLaborablesPreviosAUnaFecha(new Date(), diasLaborablesPermitidos);
// La fecha final es la fecha actual
Calendar fechaFinalCldr = Calendar.getInstance();
System.out.println("Fecha final "+fechaFinalCldr.getTime());
fechaFinalStr = sdf.format(fechaFinalCldr.getTime());
System.out.println("Fecha inicial "+fechainicial);
fechaInicialStr = sdf.format(fechainicial);
querydatabase();
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
@Override
protected void querydatabase() {
try{
System.out.println("Ejecuta querydatabase cash managment...");
Request request = this.callerhelper.getRequest();
DtoQuery dto = super.getDtoQuery(true);
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(this.beanalias, dto); // permite adicionar mas de una tabla.
request.setQueryTables(mtables);
request.put("queryalias", "CASHMANAGEMENT");
request.put("querytype", "P");
request.put("fechaInicialStr", fechaInicialStr);
request.put("fechaFinalStr", fechaFinalStr);
Response resp = this.callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
this.lrecord = new ArrayList<AbstractDataTransport>();
MessageHelper.setMessageError(resp);
} else {
this.lrecord = (List<AbstractDataTransport>) resp.get(this.beanalias);
List<Object[]> lCashManagement = (List<Object[]>)resp.get("CASHMANAGEMENTLIST");
construirListaCashDTO(lCashManagement);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public void construirListaCashDTO(List<Object[]> lCashManagement){
for(Object[]cashObj:lCashManagement){
CashManagementDTO cashManagementDTO = new CashManagementDTO();
// Codigo orientacion
cashManagementDTO.setCodigoServicio(cashObj[0]!=null?cashObj[0].toString():null);
// Contra partida
cashObj[1]=Integer.parseInt(cashObj[1].toString().substring(4, cashObj[1].toString().length()));
cashManagementDTO.setContrato(cashObj[1]!=null?cashObj[1].toString():null);
// Moneda
cashManagementDTO.setMoneda(cashObj[2]!=null?cashObj[2].toString():null);
// Valor
String valorDosDecimalesStr = null;
if(cashObj[3]!=null){
BigDecimal valorDosDecimales = ((BigDecimal)cashObj[3]).setScale(2);
// valorDosDecimales.setScale(2, BigDecimal.ROUND_HALF_UP);
valorDosDecimalesStr = valorDosDecimales.toString().replace(".", "");
}
cashManagementDTO.setValorapagar(valorDosDecimalesStr);
// Forma de cobro, forma de pago
cashManagementDTO.setFormaCobro(cashObj[4]!=null?cashObj[4].toString():null);
// Tipo de cuenta
cashManagementDTO.setTipoCuenta(cashObj[5]!=null?cashObj[5].toString():null);
// NUmero de cuenta
cashManagementDTO.setNumeroCuenta(cashObj[6]!=null?cashObj[6].toString():null);
// Referencia
cashManagementDTO.setReferencia(cashObj[7]!=null?Utilidades.reemplazaAcentosCaractEspeciales(cashObj[7].toString()):null);
// Tipo ID cliente
cashManagementDTO.setTipoIDCliente(cashObj[8]!=null?cashObj[8].toString():null);
// Nombre del cliente
cashManagementDTO.setNumeroIDCliente(cashObj[9]!=null?cashObj[9].toString():null);
// Si el nombre del cliente es mayor a 41 caracteres
if(cashObj[10]!=null && cashObj[10].toString().length()>41){
cashObj[10]=cashObj[10].toString().substring(0, 41);
}
// Nombre del cliente
cashManagementDTO.setNombreCliente(cashObj[10]!=null?Utilidades.reemplazaAcentosCaractEspeciales(cashObj[10].toString()):null);
// Base Imponible
cashManagementDTO.setBaseImponible(cashObj[11]!=null?cashObj[11].toString():null);
// Csolicitud
cashManagementDTO.setCsolicitud(cashObj[12]!=null?cashObj[12].toString():null);
cashManagementList.add(cashManagementDTO);
}
}
/**
* Graba los registros en la base de datos
*/
@Override
public void save() {
}
/**
* Obtiene el reporte de cash management
*/
public void generarReporte(String filename) {
try {
if(cashManagementList.isEmpty()){
MessageHelper.setMessageInfo("NO EXISTEN DATOS PARA GENERAR EL REPORTE...");
// return null;
}
archivo = File.createTempFile(filename,".txt");
// File archivo = File.createTempFile("cashmanagement"+fechaFinalStr,".txt");
PrintWriter escribir = new PrintWriter(archivo);
for(CashManagementDTO cashManagementDTO : cashManagementList){
escribir.print(cashManagementDTO.getCodigoServicio()!=null?cashManagementDTO.getCodigoServicio() +"\t":"\t");
escribir.print(cashManagementDTO.getContrato()!=null?cashManagementDTO.getContrato()+"\t":"\t");
escribir.print(cashManagementDTO.getMoneda()!=null?cashManagementDTO.getMoneda()+"\t":"\t");
escribir.print(cashManagementDTO.getValorapagar()!=null?cashManagementDTO.getValorapagar()+"\t":"\t");
escribir.print(cashManagementDTO.getFormaCobro()!=null?cashManagementDTO.getFormaCobro()+"\t":"\t");
escribir.print(cashManagementDTO.getTipoCuenta()!=null?cashManagementDTO.getTipoCuenta()+"\t":"\t");
escribir.print(cashManagementDTO.getNumeroCuenta()!=null?cashManagementDTO.getNumeroCuenta()+"\t":"\t");
escribir.print(cashManagementDTO.getReferencia()!=null?cashManagementDTO.getReferencia()+"\t":"\t");
escribir.print(cashManagementDTO.getTipoIDCliente()!=null?cashManagementDTO.getTipoIDCliente()+"\t":"\t");
escribir.print(cashManagementDTO.getNumeroIDCliente()!=null?cashManagementDTO.getNumeroIDCliente()+"\t":"\t");
escribir.print(cashManagementDTO.getNombreCliente()!=null?cashManagementDTO.getNombreCliente()+"\r\n":"\r\n");
TarmSolicitudTramite solicitudTramiteObj = SolicitudTramiteController.findByCSolicitud(cashManagementDTO.getCsolicitud());
solicitudTramiteObj.setIncashreport("S");
solicitudTramiteController.updateSimple(solicitudTramiteObj);
// escribir.println(cashManagementDTO.getBaseImponible());
}
solicitudTramiteController.save();
escribir.flush();
escribir.close();
// return archivo;
} catch (Exception ex) {
MessageHelper.setMessageError(ex);
// return null;
}
}
/**
* Llama a la construccion del metodo para recargar
*/
public void descargarArchivo(){
// File archivoTemporal=generarReporte();
try {
obtenerSecuencialSolicitud();
this.xpathReporte = this.getRutaDocumento();
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdfFechaParaNombre = new SimpleDateFormat("ddMMyyyyHHmm");
String fechaParaNombre = sdfFechaParaNombre.format(calendar.getTime());
String filename="COMACO"+fechaParaNombre+this.nombreArchivo;
generarReporte(filename);
filename=filename+".txt";
// if(archivoTemporal==null){
if(archivo==null){
return;
}
InputStream inputStream = new FileInputStream(archivo); //(archivoTemporal);
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.addHeader("Content-disposition", "attachment; filename="+filename);
OutputStream out = response.getOutputStream();
int read = 0;
byte[] bytes = new byte[1024];
while ((read = inputStream.read(bytes)) != -1) {
out.write(bytes, 0, read);
}
out.flush();
FacesContext.getCurrentInstance().responseComplete();
generarReporte(filename);
InputStream inputStream2 = new FileInputStream(archivo);
// if(!this.alfrescoController.uploadFile(inputStream, filename, this.xpathReporte)){
if(!this.alfrescoController.uploadFile(inputStream2, filename, this.xpathReporte)){
throw new Exception("ERROR AL CARGAR EL REPORTE");
}
inputStream.close();
inputStream2.close();
// Guardar datos ultima generacion del archivo
TarmCashManagementHistory actualCashManagementHistory = new TarmCashManagementHistory();
actualCashManagementHistory.setDatefrom(new Timestamp(calendar.getTimeInMillis()));
actualCashManagementHistory.setDateto(Utilidades.getFechaExpiracion());
actualCashManagementHistory.setIsnew(true);
actualCashManagementHistory.setNombrearchivo(filename);
actualCashManagementHistory.setPathreporte(this.xpathReporte + "/cm:" + filename);
actualCashManagementHistory.setPk(nombreArchivo);
TsafeUserDetail tsafeUserDetail=(TsafeUserDetail)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
actualCashManagementHistory.setUsercode(tsafeUserDetail.getPk().getUsercode());
cashManagementHistoryController.update(actualCashManagementHistory);
List<TarmCashManagementHistory> ultimoCashManagementHistoryList = CashManagementHistoryController.findReportesGeneradosVigentes();
if(ultimoCashManagementHistoryList!=null){
for(TarmCashManagementHistory ultimoCashManagementHistory:ultimoCashManagementHistoryList){
ultimoCashManagementHistory.setDateto(new Timestamp(calendar.getTimeInMillis()));
ultimoCashManagementHistory.setIsnew(Boolean.FALSE);
cashManagementHistoryController.update(ultimoCashManagementHistory);
}
}
cashManagementHistoryController.save();
} catch (Exception e) {
// TODO: handle exception
} catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* Arma la petici&oacute;n al core para solicitar un n&uacute;mero de secuencial para la solicitud antes de guardarla
* @throws Throwable
*/
private void obtenerSecuencialSolicitud() throws Throwable{
Request request = callerhelper.getRequest();
DtoQuery dtoQuery = super.getDtoQuery(true);
HashMap<String, DtoQuery> mapQuery = new HashMap<String, DtoQuery>();
mapQuery.put(beanalias, dtoQuery);
request.put("querytype", "T");
request.setQueryTables(mapQuery);
Response response = callerhelper.executeQuery(request);
if (response.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
MessageHelper.setMessageError(response);
}else{
nombreArchivo = response.get("CASHHISTORICOSEQUENCE").toString();
}
}
/**
* Metodo para armar la ruta del documento
* @return
*/
public String getRutaDocumento() {
Calendar calendar = Calendar.getInstance();
StringBuilder ruta = new StringBuilder("cm:CashManagement");
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)));
return ruta.toString();
}
public Date getFechainicial() {
return fechainicial;
}
public void setFechainicial(Date fechainicial) {
this.fechainicial = fechainicial;
}
public Date getFechafinal() {
return fechafinal;
}
public void setFechafinal(Date fechafinal) {
this.fechafinal = fechafinal;
}
public String getFechaInicialStr() {
return fechaInicialStr;
}
public void setFechaInicialStr(String fechaInicialStr) {
this.fechaInicialStr = fechaInicialStr;
}
public String getFechaFinalStr() {
return fechaFinalStr;
}
public void setFechaFinalStr(String fechaFinalStr) {
this.fechaFinalStr = fechaFinalStr;
}
public String getFechaUltReporte() {
return fechaUltReporte;
}
public void setFechaUltReporte(String fechaUltReporte) {
this.fechaUltReporte = fechaUltReporte;
}
public String getAutorUltReporte() {
return autorUltReporte;
}
public void setAutorUltReporte(String autorUltReporte) {
this.autorUltReporte = autorUltReporte;
}
public CashManagementHistoryController getCashManagementHistoryController() {
return cashManagementHistoryController;
}
public void setCashManagementHistoryController(
CashManagementHistoryController cashManagementHistoryController) {
this.cashManagementHistoryController = cashManagementHistoryController;
}
public String getXpathReporte() {
return xpathReporte;
}
public void setXpathReporte(String xpathReporte) {
this.xpathReporte = xpathReporte;
}
public AlfrescoController getAlfrescoController() {
return alfrescoController;
}
public void setAlfrescoController(AlfrescoController alfrescoController) {
this.alfrescoController = alfrescoController;
}
public String getNombreArchivo() {
return nombreArchivo;
}
public void setNombreArchivo(String nombreArchivo) {
this.nombreArchivo = nombreArchivo;
}
public SolicitudTramiteController getSolicitudTramiteController() {
return solicitudTramiteController;
}
public void setSolicitudTramiteController(
SolicitudTramiteController solicitudTramiteController) {
this.solicitudTramiteController = solicitudTramiteController;
}
}

View File

@ -0,0 +1,188 @@
package com.fp.bpm.query;
import java.util.List;
import java.util.Map;
import com.fp.common.exception.CommonException;
import com.fp.common.exception.SavePointException;
import com.fp.common.logger.APPLogger;
import com.fp.dto.query.QueryBean;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.dto.rules.TransactionRule;
import com.fp.persistence.commondb.db.DataHelper;
import com.fp.persistence.commondb.exception.CommondbException;
import com.fp.persistence.pgeneral.gene.TgeneQueryProcess;
import com.fp.persistence.pgeneral.gene.TgeneTransactionQuery;
/**
* Motor de consultas, el proceso se ejecuta de acuerodo a querytype.<br>
*
* @author Jorge Vaca
* @version 2.1
*/
public class QueryProcessor {
/** Objeto con beans utilizados en el proceso de consulta. */
private QueryRequest queryRequest;
/**
* Metodo que se encarga de ejecutar consultas contra la base de datos, adicionalmente ejecuta consultas especiales
* si estas estarian parametrizadas. Proceso tipo de consulta.<br>
* "P" Ejecuta consulta por reglas asociadas a un codigo de consulta. "T" Ejecuta consulta por reglas asociadas a la
* transaccion. "N" Ejecuta consultas genericas.
*
* @param pQueryRequest Objeto con beans utilizados en el proceso de consulta.
* @param pResponse Objeto en el cual se alamcena la respuesta de una transaccion.
* @return boolean
* @throws CommondbException
* @throws Exception
*/
public boolean process(QueryRequest pQueryRequest) throws CommondbException, Exception {
Thread.currentThread().setName(pQueryRequest.getJournalId());
this.queryRequest = pQueryRequest;
String queryType = (String) pQueryRequest.get("querytype");
if ((queryType == null) || (queryType.compareTo("N") == 0)) {
if(!pQueryRequest.isJsf()){
Query qry = new Query();
qry.process(pQueryRequest);
}else{
QueryJsf qry = new QueryJsf();
qry.execute(pQueryRequest);
}
}
// Ejecuta consultas especiales para una transaccion.
if ((queryType != null) && (queryType.compareTo("T") == 0)) {
this.processByTransaction();
}
// Ejecuta consultas especiales para un codigo de query.
if ((queryType == null) || (queryType.compareTo("P") == 0)) {
// Si es null entra el contro esta en el metodo interno
this.processQueryByAlias();
}
return true;
}
/**
* Metodo que se encarga de ejecutar comandos especiales de consulta por queryalias.
*
* @param pQueryRequest Objeto con beans utilizados en el proceso de consulta.
* @param pResponse Objeto que contiene los datos de respuesta de la consulta.
* @throws Exception
*/
public void processQueryByAlias() throws Exception {
Map<String, QueryBean> bean = this.queryRequest.getBeans();
for (String k : bean.keySet()) {
QueryBean qbean = bean.get(k);
if (qbean.getQueryalias() != null) {
this.processByQueryCode(qbean.getQueryalias());
}
}
String queryalias = (String) this.queryRequest.get("queryalias");
if (queryalias != null) {
this.processByQueryCode(queryalias);
}
}
/**
* Fija un nuevo valor en queryRequest
*
* @param pQueryRequest nuevo valor para queryRequest
*/
public void setQueryRequest(QueryRequest pQueryRequest) {
this.queryRequest = pQueryRequest;
}
/**
* Metodo que se encarga de ejecutar procesos especiales de consulta por codigo de consulta.
*
* @param pQueryRequest Objeto con beans utilizados en el proceso de consulta.
* @param pQueryCode Codigo de consulta.
* @throws Exception
*/
private void processByQueryCode(String pQueryCode) throws Exception {
List<TgeneQueryProcess> lprocess = DataHelper.getInstance().getTgeneQueryProcess(pQueryCode);
if (lprocess == null) {
return;
}
for (TgeneQueryProcess obj : lprocess) {
this.processByCode(obj.getProcesscode(), pQueryCode);
}
}
/**
*
* @param pResponse Objeto con beans utilizados en el proceso de consulta.
* @param pProcess Codigo de proceso a ejecutar.
* @param pQueryCode Codigo de consulta.
* @throws Exception
*/
private void processByCode(String pProcess, String pQueryCode) throws Exception {
QueryRule rule = null;
try {
rule = (QueryRule) Class.forName(pProcess).newInstance();
} catch (ClassNotFoundException e) {
throw new CommonException("COMMON-0012", "CLASE {0} A EJECUTAR NO EXISTE CODE: {0}", e, pQueryCode);
} catch (ClassCastException e) {
throw new CommonException("COMMON-0013", "PROCESO {0} A EJECUTAR CODE: {1} NO IMPLEMENTA QUERYRULE", e, pProcess, pQueryCode);
}
APPLogger.getLogger().info("INICIO ==> " + rule);
rule.process(this.queryRequest);
APPLogger.getLogger().info("FIN ==> " + rule);
}
/**
* Metodo que ejecuta procesos especiales de consulta por transaccion.
*
* @param pQueryRequest Objeto con beans utilizados en el proceso de consulta.
* @throws Exception
*/
private void processByTransaction() throws Exception {
if ((this.queryRequest.getTransactionModule() == null) || (this.queryRequest.getTransactionCode() == null)) {
return;
}
List<TgeneTransactionQuery> lquery = DataHelper.getInstance().getTgeneTransactionQuery(this.queryRequest.getTransactionModule(),
this.queryRequest.getTransactionCode(), this.queryRequest.getTransactionVersion());
if (lquery == null) {
return;
}
for (TgeneTransactionQuery obj : lquery) {
try {
this.processByTransactionRule(obj);
} catch (SavePointException e) {
// Detiene la ejecucion de componentes de negocio y graba la transaccion.
break;
}
}
}
/**
* Metodo encargado de ejecutar cada una de las reglas definidas en la transaccion.
*
* @param pSaveRequest Objeto con beans utilizados en el proceso de una transaccion.
* @param pProcess Objeto que contiene la regla a ejecutar.
* @throws Exception
*/
private void processByTransactionRule(TgeneTransactionQuery pQuery) throws Exception {
QueryRule rule = null;
try {
rule = (QueryRule) Class.forName(pQuery.getProcesscode()).newInstance();
} catch (ClassNotFoundException e) {
throw new CommonException("COMMON-0014", "CLASE {0} A EJECUTAR NO EXISTE MODULE: {1} TRANS: {2} VERSION {3}", e,
pQuery.getProcesscode(), this.queryRequest.getTransactionModule(), this.queryRequest.getTransactionCode(),
this.queryRequest.getTransactionVersion());
} catch (ClassCastException e) {
throw new CommonException("COMMON-0015", "PROCESO {0} A EJECUTAR MODULE: {1} TRANS: {2} VERSION {3} NO IMPLEMENTA {4}", e,
pQuery.getProcesscode(), this.queryRequest.getTransactionModule(), this.queryRequest.getTransactionCode(),
this.queryRequest.getTransactionVersion(), TransactionRule.class.getName());
}
rule.setFlow(pQuery.getProcessname());
rule.setRule(pQuery.getRulename());
APPLogger.getLogger().info("INICIO ==> " + rule);
rule.process(this.queryRequest);
APPLogger.getLogger().info("FIN ==> " + rule);
}
}

View File

@ -0,0 +1,14 @@
package com.fp.bpmlib.ejb.local;
import java.util.Map;
import javax.ejb.Local;
import javax.persistence.EntityManagerFactory;
@Local
public interface LogMailBeanLocal {
public EntityManagerFactory getEmf();
public void logMail(Map<String, Object> mapMail) throws Exception;
}

View File

@ -0,0 +1,143 @@
package com.fp.frontend.controller.armas.parametros;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.dto.query.DtoQuery;
import com.fp.dto.save.DtoSave;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.pgeneral.gene.CatalogDetailController;
import com.fp.frontend.controller.pgeneral.gene.CountryController;
import com.fp.frontend.controller.pgeneral.gene.ProvinceController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.parmas.fun.TarmDetalleImportacion;
import com.fp.persistence.parmas.soli.TarmArmas;
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.TgeneProvince;
/**
* Clase controladora del bean Tdireccion.
*
* @author Andres Cevallos.
* @version 2.1
*/
@SuppressWarnings("serial")
@ManagedBean
@ViewScoped
public class ImportacionArmasDetalleController extends AbstractController<TarmDetalleImportacion> {
public ImportacionArmasDetalleController() throws Exception {
super(TarmDetalleImportacion.class);
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
super.startQuery();
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza
* el controlador.
*/
private void init() {
try {
this.recperpage = 15; // Cambiar al # reg a mirar.
this.lrecord = new ArrayList<>();
this.beanalias = "TARMASDETALLE";
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
@Override
public void save() {
try {
DtoSave dtosave = super.getDtoSave();
dtosave.setReturnpk(true); // Para que el core devuelva el pk de los
// registros nuevos.
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
Request request = this.callerhelper.getRequest();
msave.put(this.beanalias, dtosave); // adicionar metadata de
// mantenimiento para cada
// tabla.
request.setSaveTables(msave);
Response resp = this.callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
this.postCommit(resp);
MessageHelper.setMessageInfo(resp);
} else {
MessageHelper.setMessageError(resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public void executeProvincia() {
}
@Override
public void postCommit(Response response) throws Exception {
super.postCommitGeneric(response, this.beanalias);
}
@SuppressWarnings("unchecked")
@Override
protected void querydatabase() {
try {
Request request = this.callerhelper.getRequest();
DtoQuery dto = super.getDtoQuery(true);
dto.setOrderby("t.pk"); // En en string van todos los campos de orden ("t.pk, t.nombre, t.cpais").
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<TarmDetalleImportacion>();
MessageHelper.setMessageError(resp);
} else {
this.lrecord = (List<TarmDetalleImportacion>) resp.get(this.beanalias);
super.postQuery(this.lrecord);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
}

View File

@ -0,0 +1,63 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<title>LOV: #{msg_general.lvh_profiles}</title>
<h:body>
<h:form id="formTable">
<maia:pageEvents controller="#{profileLovController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:tprofile"
focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="9" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpk" value="#{msg_general.lbl_code}:" />
<p:inputText id="fpk" value="#{profileLovController.mfilters['pk']}" maxlength="20" style="width: 60px;" />
<p:outputLabel for="fdesc" value="#{msg_general.lbl_description}:" />
<p:inputText id="fdesc" value="#{profileLovController.mfilters['description']}" maxlength="60" style="width: 340px;" />
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<p:commandButton value="#{msg_general.btn_query}" update="data-content" icon="ui-icon-search" action="#{profileLovController.query()}" process="@this, filters"/>
<p:commandButton value="#{msg_general.btn_previous}" update="data-content" icon="ui-icon-seek-prev" action="#{profileLovController.previous()}" />
<p:commandButton value="#{msg_general.btn_next}" update="data-content" icon="ui-icon-seek-next" action="#{profileLovController.next()}" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_profiles}" />
</f:facet>
<p:dataTable id="tprofile" var="row" value="#{profileLovController.lrecord}" rows="200" style="min-width: 300px; width: auto;" rowKey="#{row.rowkey()}"
selectionMode="single" selection="#{profileLovController.record}" >
<p:ajax event="rowSelect" listener="#{profileLovController.setProfile()}" />
<p:column headerText="#{msg_general.lbl_code}" resizable="true" sortBy="#{row.pk}">
<h:outputText value="#{row.pk}" />
</p:column>
<p:column headerText="#{msg_general.lbl_description}" resizable="true" sortBy="#{row.description}">
<h:outputText value="#{row.description}" />
</p:column>
<p:column >
<p:commandButton icon="ui-icon-copy" actionListener="#{profileLovController.setProfile(row)}" />
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</h:body>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,235 @@
package com.fp.armas.rules.query.webservices.util;
import java.util.List;
import javax.persistence.Query;
import com.fp.common.helper.Constant;
import com.fp.common.logger.APPLogger;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.exception.CommondbException;
import com.fp.persistence.commondb.helper.FormatDates;
import com.fp.persistence.parmas.dto.ws.ImagenDto;
import com.fp.persistence.parmas.dto.ws.PersonaDto;
import com.fp.persistence.pcustomer.company.TcustCompany;
import com.fp.persistence.pcustomer.company.TcustCompanyKey;
import com.fp.persistence.pcustomer.gene.TcustPersonAddress;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pcustomer.people.TcustPeople;
import com.fp.persistence.pcustomer.people.TcustPeopleKey;
import com.fp.persistence.pgeneral.image.TgeneFilesDetail;
import com.fp.persistence.pgeneral.image.TgeneFilesDetailKey;
/**
* Clase utilitaria que colocar&aacute; los datos de la persona
* @author dcruz
*
*/
public class PersonaUtil {
/**
* Consulta propia de la persona
*/
private static final String QUERY_PERSONA = "SELECT o FROM TcustPersonDetail o WHERE o.pk.personcode=:personcode AND o.pk.dateto=:dateto";
private static final String QUERY_DIRECCION_PRINCIPAL="SELECT o FROM TcustPersonAddress o WHERE o.pk.personcode=:personcode AND o.pk.dateto=:dateto AND o.principal=:principal";
private static final String QUERY_PROVINCIA = "SELECT o.description FROM TgeneProvince o WHERE o.pk.countrycode=:countrycode AND o.pk.provincecode=:provincecode";
private static final String QUERY_CANTON = "SELECT o.description FROM TgeneCanton o WHERE o.pk.countrycode=:countrycode AND o.pk.provincecode=:provincecode AND o.pk.cantoncode=:cantoncode";
private static final String QUERY_PARROQUIA = "SELECT o.description FROM TgeneParroquia o WHERE o.pk.countrycode=:countrycode AND o.pk.provincecode=:provincecode AND o.pk.cantoncode=:cantoncode AND o.pk.parroquiacode=:parroquiacode";
private static final String QUERY_TELEFONO = "SELECT o.phonenumber FROM TcustPersonPhone o WHERE o.pk.personcode=:personcode AND o.addressnumber=:addressnumber";
private static PersonaUtil INSTANCIA = new PersonaUtil();
private PersonaUtil(){}
public static PersonaUtil getInstancia() {
return INSTANCIA;
}
/**
* Obtiene todos los datos de la persona a enviar en a trav&eacute;s del web service
* @param personCode
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
public PersonaDto obtenerPersonaPorId(Integer personcode, String usercode) throws Exception{
PersonaDto persona = null;
if(personcode == null){
return persona;
}
TcustPersonDetail tcustPersonDetail = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_PERSONA);
query.setParameter("personcode", personcode);
query.setParameter("dateto", FormatDates.getDefaultExpiryTimestamp());
List<TcustPersonDetail> lpersonDetail = query.getResultList();
if(lpersonDetail != null && !lpersonDetail.isEmpty()){
persona = new PersonaDto();
tcustPersonDetail = lpersonDetail.get(0);
persona.setCodigoPersona(tcustPersonDetail.getPk().getPersoncode());
persona.setCodigoUsuario(usercode);
persona.setTipoIdentificacion(tcustPersonDetail.getIdentificationcatalog());
persona.setIdentificacion(tcustPersonDetail.getIdentification());
persona.setNombre(tcustPersonDetail.getName());
persona.setRepresentanteLegal(tcustPersonDetail.getLegalrepresent());
//Obtenemos la direccion principal de la persona
TcustPersonAddress tcustPersonAddress = obtieneDireccionPrincipal(personcode);
persona.setDireccion(tcustPersonAddress.getAddress());
persona.setProvincia(obtenerProvincia(tcustPersonAddress.getProvincecode()));
persona.setCanton(obtenerCanton(tcustPersonAddress.getProvincecode(), tcustPersonAddress.getCantoncode()));
persona.setParroquia(obtenerParroquia(tcustPersonAddress.getProvincecode(), tcustPersonAddress.getCantoncode(), tcustPersonAddress.getParroquiacode()));
persona.setTelefono(obtenerNumeroTelefono(tcustPersonAddress.getPk().getPersoncode(), tcustPersonAddress.getPk().getAddressnumber()));
if(tcustPersonDetail.getMilitarygrade() != null && tcustPersonDetail.getMilitarygradecode() != null){
persona.setGrado(CatalogoUtil.getInstancia().getLegalCode(tcustPersonDetail.getMilitarygrade(), tcustPersonDetail.getMilitarygradecode()));
}
}
return persona;
}
/**
* Obtiene la direcci&oacute;n principal de la persona
* @param personcode
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
public TcustPersonAddress obtieneDireccionPrincipal(Integer personcode) throws Exception {
TcustPersonAddress tcustPersonAddress = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_DIRECCION_PRINCIPAL);
query.setParameter("personcode", personcode);
query.setParameter("dateto", FormatDates.getDefaultExpiryTimestamp());
query.setParameter("principal", Constant.STR_Y);
List<TcustPersonAddress> ltcustPersonAddresses = query.getResultList();
if(ltcustPersonAddresses != null && !ltcustPersonAddresses.isEmpty()){
tcustPersonAddress = ltcustPersonAddresses.iterator().next();
}
return tcustPersonAddress;
}
/**
* Obtiene la descripci&oacute;n de la provincia
* @param provincecode
* @return
*/
@SuppressWarnings("unchecked")
public String obtenerProvincia(String provincecode) {
String provincia = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_PROVINCIA);
query.setParameter("countrycode", "EC");
query.setParameter("provincecode", provincecode);
List<String> lprovincias = query.getResultList();
if(lprovincias != null && !lprovincias.isEmpty()){
provincia = lprovincias.iterator().next();
}
return provincia;
}
/**
* Obtiene la descripci&oacute;n del cant&oacute;n
* @param provincecode
* @param cantoncode
* @return
*/
@SuppressWarnings("unchecked")
public String obtenerCanton(String provincecode, String cantoncode) {
String canton = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_CANTON);
query.setParameter("countrycode", "EC");
query.setParameter("provincecode", provincecode);
query.setParameter("cantoncode", cantoncode);
List<String> lcanton = query.getResultList();
if(lcanton != null && !lcanton.isEmpty()){
canton = lcanton.iterator().next();
}
return canton;
}
/**
* Obtiene la descrici&oacute;n de la parroquia
* @param provincecode
* @param cantoncode
* @param parroquiacode
* @return
*/
@SuppressWarnings("unchecked")
public String obtenerParroquia(String provincecode, String cantoncode, String parroquiacode) {
String parroquia = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_PARROQUIA);
query.setParameter("countrycode", "EC");
query.setParameter("provincecode", provincecode);
query.setParameter("cantoncode", cantoncode);
query.setParameter("parroquiacode", parroquiacode);
List<String> lparroquia = query.getResultList();
if(lparroquia != null && !lparroquia.isEmpty()){
parroquia = lparroquia.iterator().next();
}
return parroquia;
}
/**
* Obtiene el tel&eacute;fono segun la direcci&oacute;n asociada
* @param personcode
* @param addressnumber
* @return
*/
@SuppressWarnings("unchecked")
public String obtenerNumeroTelefono(Integer personcode, Integer addressnumber) {
String telefono = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_TELEFONO);
query.setParameter("personcode", personcode);
query.setParameter("addressnumber", addressnumber);
List<String> ltelefono = query.getResultList();
if(ltelefono != null && !ltelefono.isEmpty()){
telefono = ltelefono.iterator().next();
}
return telefono;
}
/**
* Retorna la localizaci&oacute;n de donde se encuentra la persona
* @param personcode
* @return
*/
public String obtenerLocacionPersona(Integer personcode) {
StringBuffer sb = new StringBuffer();
try {
TcustPersonAddress tcustPersonAddress = obtieneDireccionPrincipal(personcode);
sb.append(tcustPersonAddress.getProvincecode()).append(",").append(obtenerProvincia(tcustPersonAddress.getProvincecode())).append("/");
sb.append(tcustPersonAddress.getCantoncode()).append(",").append(obtenerCanton(tcustPersonAddress.getProvincecode(), tcustPersonAddress.getCantoncode())).append("/");
sb.append(tcustPersonAddress.getParroquiacode()).append(",").append(obtenerParroquia(tcustPersonAddress.getProvincecode(), tcustPersonAddress.getCantoncode(), tcustPersonAddress.getParroquiacode()));
} catch (CommondbException e) {
} catch (Exception e) {
}
return sb.toString();
}
/**
* Retorna la foto o el logo de la persona si es que esta existe
* @param personcode
* @return
*/
public ImagenDto obtenerImagen(Integer personcode) {
System.out.println("ImagenDto obtenerImagen......-----------"+personcode);
ImagenDto imagenDto = null;
TgeneFilesDetail tgeneFilesDetail = null;
try {
TcustCompany tcustCompany = TcustCompany.find(PersistenceHelper.getEntityManager(), new TcustCompanyKey(personcode, FormatDates.getDefaultExpiryTimestamp()));
if(tcustCompany != null){
tgeneFilesDetail = TgeneFilesDetail.find(PersistenceHelper.getEntityManager(), new TgeneFilesDetailKey(tcustCompany.getLogo(), FormatDates.getDefaultExpiryTimestamp()));
} else{
TcustPeople tcustPeople = TcustPeople.find(PersistenceHelper.getEntityManager(), new TcustPeopleKey(personcode, FormatDates.getDefaultExpiryTimestamp()));
if(tcustPeople != null){
tgeneFilesDetail = TgeneFilesDetail.find(PersistenceHelper.getEntityManager(), new TgeneFilesDetailKey(tcustPeople.getPhotocode(), FormatDates.getDefaultExpiryTimestamp()));
}
}
if(tgeneFilesDetail != null){
imagenDto = new ImagenDto();
imagenDto.setCodigoImagen(tgeneFilesDetail.getPk().getCode());
imagenDto.setExtension(tgeneFilesDetail.getExtension());
imagenDto.setImagen(tgeneFilesDetail.getImage());
imagenDto.setTamanioImagen(tgeneFilesDetail.getImagesize());
imagenDto.setTipoContenido(tgeneFilesDetail.getContenttype());
}
} catch (Throwable e) {
APPLogger.getLogger().error(e.getMessage(), e);
}
return imagenDto;
}
}

View File

@ -0,0 +1,227 @@
package com.fp.persistence.pgeneral.score;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.fp.dto.hb.HibernateBean;
/** Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENESCOREHEADER */
@Entity(name = "TgeneScoreHeader")
@Table(name = "TGENESCOREHEADER")
public class TgeneScoreHeader extends com.fp.dto.AbstractDataTransport implements Serializable, HibernateBean, Cloneable {
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
/**
* Clave primaria de la Entidad TgeneScoreHeader
*/
@EmbeddedId
private TgeneScoreHeaderKey pk;
@Column(name = "FILECODE", nullable = true)
/**
* Codigo de imagen
*/
private Integer filecode;
@Column(name = "TABULATED", nullable = true)
/**
* Y Indica que la calificacion esta contabilizada y enviada a la super
*/
private String tabulated;
/** Contructor por defecto */
public TgeneScoreHeader() {
}
/**
* Contructor de TgeneScoreHeader
*
* @param pPk Clave Primaria del entity
*/
public TgeneScoreHeader(TgeneScoreHeaderKey pPk) {
this();
this.pk = pPk;
}
/**
* Metodo que entrega datos de la tabla dada la clave primaria.
*
* @param pEntityManager referencia de la session a obtener datos del bean.
* @param pKey Caleve primaria del bean.
* @return TgeneScoreHeader
*/
public static TgeneScoreHeader find(EntityManager pEntityManager, TgeneScoreHeaderKey pKey) throws Exception {
TgeneScoreHeader obj = pEntityManager.find(TgeneScoreHeader.class, pKey);
return obj;
}
/**
* Entrega la Clave primaria de TgeneScoreHeader
*
* @return El objeto que referencia a la Clave primaria de TgeneScoreHeader
*/
public TgeneScoreHeaderKey getPk() {
return this.pk;
}
/**
* Fija un nuevo valor a la Clave primaria de TgeneScoreHeader
*
* @param pPk El objeto que referencia a la nueva Clave primaria de TgeneScoreHeader
*/
public void setPk(TgeneScoreHeaderKey pPk) {
this.pk = pPk;
}
/**
* Obtiene el valor de filecode
*
* @return valor de filecode
*/
public Integer getFilecode() {
return this.filecode;
}
/**
* Fija el valor de filecode
*
* @param pFilecode nuevo Valor de filecode
*/
public void setFilecode(Integer pFilecode) {
this.filecode = pFilecode;
}
/**
* Obtiene el valor de tabulated
*
* @return valor de tabulated
*/
public String getTabulated() {
return this.tabulated;
}
/**
* Fija el valor de tabulated
*
* @param pTabulated nuevo Valor de tabulated
*/
public void setTabulated(String pTabulated) {
this.tabulated = pTabulated;
}
@Override
public boolean equals(Object rhs) {
if (rhs == null) {
return false;
}
if (!(rhs instanceof TgeneScoreHeader)) {
return false;
}
TgeneScoreHeader that = (TgeneScoreHeader) rhs;
if ((this.getPk() == null) || (that.getPk() == null)) {
return false;
}
return this.getPk().equals(that.getPk());
}
/**
* Implementacion del metodo hashCode de la la entidad TgeneScoreHeader
*
* @return el hashCode la instancia
*/
@Override
public int hashCode() {
if (this.hashValue == 0) {
int result = 17;
if (this.getPk() == null) {
result = super.hashCode();
} else {
result = this.getPk().hashCode();
}
this.hashValue = result;
}
return this.hashValue;
}
/** Implementacion toString */
@Override
public String toString() {
Field[] fs = this.getClass().getDeclaredFields();
String data = "";
for (Field f : fs) {
try {
String name = f.getName();
if (f.getType().getName().compareTo("java.util.Set") == 0) {
continue;
}
if ((name.compareTo("hashValue") == 0) || (name.compareTo("serialVersionUID") == 0)) {
continue;
}
data += name + "=" + f.get(this) + ";";
} catch (Exception e) {
continue;
}
}
if (data.compareTo("") == 0) {
data = super.toString();
}
return data;
}
/** Implementacion de la creacion de un bean en blanco TgeneScoreHeader */
@Override
public Object createInstance() {
TgeneScoreHeader instance = new TgeneScoreHeader();
instance.setPk(new TgeneScoreHeaderKey());
return instance;
}
/**
* Clona la entidad TgeneScoreHeader
*
* @see com.fp.dto.hb.HibernateBean#cloneMe()
*/
@Override
public Object cloneMe() throws CloneNotSupportedException {
TgeneScoreHeader p = (TgeneScoreHeader) this.clone();
p.setPk((TgeneScoreHeaderKey) this.pk.cloneMe());
return p;
}
/* METODOS MANUALES */
private static final String JPQL_BY_COMPANY = "from TgeneScoreHeader tga " + "where tga.pk.companycode = :companycode";
/**
* Permite consultar si existe un periodo de calificacion abierto
*
* @param companycode Codigo de empresa
* @return lista de objetos de tipo
* @throws Exception
*/
@SuppressWarnings("unchecked")
public static List<TgeneScoreHeader> findByCompany(EntityManager entityManager, Integer companycode) throws Exception {
Query qry = entityManager.createQuery(TgeneScoreHeader.JPQL_BY_COMPANY);
qry.setParameter("companycode", companycode);
return qry.getResultList();
}
}

View File

@ -0,0 +1,178 @@
package com.fp.persistence.pgeneral.trans;
import javax.persistence.Column;
import java.io.Serializable;
import com.fp.dto.hb.HibernateId;
import java.lang.reflect.Field;
import javax.persistence.Embeddable;
import javax.persistence.Transient;
/**Clase que hace referencia a la Clave Primaria de TGENETRANSACTIONITEMDETAIL*/
@Embeddable
public class TgeneTransactionItemDetailKey extends com.fp.dto.AbstractDataTransport implements Serializable,Cloneable,HibernateId{
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
@Column(name="TRANSACTIONMODULE", nullable=false,updatable=false)
/**
* Modulo al que pertence la transaccion
*/
private String transactionmodule;
@Column(name="TRANSACTIONCODE", nullable=false,updatable=false)
/**
* Codigo de transaccion dentro del modulo
*/
private Integer transactioncode;
@Column(name="TRANSACTIONVERSION", nullable=false,updatable=false)
/**
* Version de transaccion
*/
private Integer transactionversion;
@Column(name="ITEMCODE", nullable=false,updatable=false)
/**
* Sequencia de items dentro de la transaccion
*/
private Integer itemcode;
/**Contructor por defecto*/
public TgeneTransactionItemDetailKey(){}
/**Contructor de TgeneTransactionItemDetailKey
@param pTransactionmodule Modulo al que pertence la transaccion
@param pTransactioncode Codigo de transaccion dentro del modulo
@param pTransactionversion Version de transaccion
@param pItemcode Sequencia de items dentro de la transaccion
*/
public TgeneTransactionItemDetailKey(String pTransactionmodule,Integer pTransactioncode,Integer pTransactionversion,Integer pItemcode){
transactionmodule=pTransactionmodule;
transactioncode=pTransactioncode;
transactionversion=pTransactionversion;
itemcode=pItemcode;
}
/**Obtiene el valor de transactionmodule
@return valor de transactionmodule*/
public String getTransactionmodule(){
return transactionmodule;
}
/**Fija el valor de transactionmodule
@param pTransactionmodule nuevo Valor de transactionmodule*/
public void setTransactionmodule(String pTransactionmodule){
transactionmodule=pTransactionmodule;
}
/**Obtiene el valor de transactioncode
@return valor de transactioncode*/
public Integer getTransactioncode(){
return transactioncode;
}
/**Fija el valor de transactioncode
@param pTransactioncode nuevo Valor de transactioncode*/
public void setTransactioncode(Integer pTransactioncode){
transactioncode=pTransactioncode;
}
/**Obtiene el valor de transactionversion
@return valor de transactionversion*/
public Integer getTransactionversion(){
return transactionversion;
}
/**Fija el valor de transactionversion
@param pTransactionversion nuevo Valor de transactionversion*/
public void setTransactionversion(Integer pTransactionversion){
transactionversion=pTransactionversion;
}
/**Obtiene el valor de itemcode
@return valor de itemcode*/
public Integer getItemcode(){
return itemcode;
}
/**Fija el valor de itemcode
@param pItemcode nuevo Valor de itemcode*/
public void setItemcode(Integer pItemcode){
itemcode=pItemcode;
}
/**Implementacion de la comparacion de TgeneTransactionItemDetailKey
@param o Objeto de comparacion
*/
public boolean equals(Object o){
if (o == null)return false;
if (! (o instanceof TgeneTransactionItemDetailKey))return false;
TgeneTransactionItemDetailKey that = (TgeneTransactionItemDetailKey) o;
if (this.getTransactionmodule() == null || that.getTransactionmodule() == null){
return false;
}
if (! this.getTransactionmodule().equals(that.getTransactionmodule())){
return false;
}
if (this.getTransactioncode() == null || that.getTransactioncode() == null){
return false;
}
if (! this.getTransactioncode().equals(that.getTransactioncode())){
return false;
}
if (this.getTransactionversion() == null || that.getTransactionversion() == null){
return false;
}
if (! this.getTransactionversion().equals(that.getTransactionversion())){
return false;
}
if (this.getItemcode() == null || that.getItemcode() == null){
return false;
}
if (! this.getItemcode().equals(that.getItemcode())){
return false;
}
return true;
}
/**Implementacion del metodo hashCode bajo el patron de Bloch
@return hashCode de la instancia TgeneTransactionItemDetailKey
*/
public int hashCode(){
if (this.hashValue == 0){
int result = 17;
result = result * 37 + (this.getTransactionmodule() == null ? 0 : this.getTransactionmodule().hashCode());
result = result * 37 + (this.getTransactioncode() == null ? 0 : this.getTransactioncode().hashCode());
result = result * 37 + (this.getTransactionversion() == null ? 0 : this.getTransactionversion().hashCode());
result = result * 37 + (this.getItemcode() == null ? 0 : this.getItemcode().hashCode());
this.hashValue = result;
}
return this.hashValue;
}
public Object cloneMe() throws CloneNotSupportedException {
return this.clone();
}
/**Implementacion toString
*/
public String toString() {
Field[]fs=this.getClass().getDeclaredFields();
String data="";
for(Field f:fs){
try{
String name=f.getName();
if(f.getType().getName().compareTo("java.util.Set")==0)continue;
if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
data+="pk."+name+"="+f.get(this)+";";
}catch(Exception e){
continue;
}
}
if(data.compareTo("")==0){
data=super.toString();
}
return data;
}
}

View File

@ -0,0 +1,168 @@
package com.fp.persistence.pgeneral.menu;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.io.Serializable;
import javax.persistence.Table;
import com.fp.dto.hb.HibernateBean;
import com.fp.persistence.commondb.exception.CommondbException;
import java.lang.reflect.Field;
import java.util.List;
import javax.persistence.Transient;
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENEMENULEVELTRAN*/
@Entity(name="TgeneMenuLevelTran")
@Table(name="TGENEMENULEVELTRAN")
public class TgeneMenuLevelTran extends com.fp.dto.AbstractDataTransport implements Serializable,HibernateBean,Cloneable{
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
/**
* Clave primaria de la Entidad TgeneMenuLevelTran
*/
@EmbeddedId
private TgeneMenuLevelTranKey pk;
@Column(name="PRESENTATIONORDER", nullable=true)
/**
* Orden de presentacion de las transacciones dentro de la agrupacion que forma parte delprimer nivel del menu.
*/
private Integer presentationorder;
/**Contructor por defecto*/
public TgeneMenuLevelTran(){
}
/**Contructor de TgeneMenuLevelTran
@param pPk Clave Primaria del entity
*/
public TgeneMenuLevelTran(TgeneMenuLevelTranKey pPk){
this();
pk=pPk;
}
/**
* Metodo que entrega datos de la tabla dada la clave primaria.
* @param pEntityManager referencia de la session a obtener datos del bean.
* @param pKey Caleve primaria del bean.
* @return TgeneMenuLevelTran
*/
public static TgeneMenuLevelTran find(EntityManager pEntityManager,TgeneMenuLevelTranKey pKey) throws Exception{
TgeneMenuLevelTran obj = pEntityManager.find(TgeneMenuLevelTran.class,pKey);
return obj;
}
/**Entrega la Clave primaria de TgeneMenuLevelTran
@return El objeto que referencia a la Clave primaria de TgeneMenuLevelTran
*/
public TgeneMenuLevelTranKey getPk(){
return pk;
}
/**Fija un nuevo valor a la Clave primaria de TgeneMenuLevelTran
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneMenuLevelTran
*/
public void setPk(TgeneMenuLevelTranKey pPk){
pk=pPk;
}
/**Obtiene el valor de presentationorder
@return valor de presentationorder*/
public Integer getPresentationorder(){
return presentationorder;
}
/**Fija el valor de presentationorder
@param pPresentationorder nuevo Valor de presentationorder*/
public void setPresentationorder(Integer pPresentationorder){
presentationorder=pPresentationorder;
}
public boolean equals(Object rhs){
if (rhs == null)return false;
if (! (rhs instanceof TgeneMenuLevelTran))return false;
TgeneMenuLevelTran that = (TgeneMenuLevelTran) rhs;
if (this.getPk() == null || that.getPk() == null)
return false;
return (this.getPk().equals(that.getPk()));
}
/**Implementación del metodo hashCode de la la entidad TgeneMenuLevelTran
@return el hashCode la instancia
*/
public int hashCode() {
if (this.hashValue == 0){
int result = 17;
if (this.getPk() == null){
result = super.hashCode();
}else{
result = this.getPk().hashCode();
}
this.hashValue = result;
}
return this.hashValue;
}
/**Implementación toString
*/
public String toString() {
Field[]fs=this.getClass().getDeclaredFields();
String data="";
for(Field f:fs){
try{
String name=f.getName();
if(f.getType().getName().compareTo("java.util.Set")==0)continue;
if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
data+=name+"="+f.get(this)+";";
}catch(Exception e){
continue;
}
}
if(data.compareTo("")==0){
data=super.toString();
}
return data;
}
/**Implementación de la creación de un bean en blanco TgeneMenuLevelTran
*/
public Object createInstance(){
TgeneMenuLevelTran instance=new TgeneMenuLevelTran();
instance.setPk(new TgeneMenuLevelTranKey());
return instance;
}
/**Clona la entidad TgeneMenuLevelTran
@see com.fp.dto.hb.HibernateBean#cloneMe()
*/
public Object cloneMe() throws CloneNotSupportedException{
TgeneMenuLevelTran p=(TgeneMenuLevelTran)this.clone();
p.setPk((TgeneMenuLevelTranKey)this.pk.cloneMe());
return p;
}
//METODOS MANUALES
/** Sentencia que devuelve un registro de TgeneMenuGroup. */
private static final String JPQL_MENUGRP_TRAN = "from TgeneMenuLevelTran tmgt " + " where tmgt.pk.menucode = :menucode"
+ " and tmgt.pk.groupcode = :groupcode" + " order by tmgt.pk.transactionmodule,tmgt.pk.transactioncode ";
/**
* Metodo que entrega transacciones asociadas al codigo de menu y codigo de nivel.
*
* @param pMenucode Codigo de menu.
* @param pLevel Codigo de Nivel.
* @return List<TgeneMenuLevelTran>
* @throws Exception
*/
@SuppressWarnings(com.fp.common.helper.Constant.VUNCHECKED)
public static List<TgeneMenuLevelTran> findByCodeMenuNivel(EntityManager pEntityManager, Integer pMenucode, Integer pLevel) throws Exception {
List<TgeneMenuLevelTran> lmenu = null;
Query qry = pEntityManager.createQuery(TgeneMenuLevelTran.JPQL_MENUGRP_TRAN);
qry.setParameter("menucode", pMenucode);
qry.setParameter("groupcode", pLevel);
lmenu = qry.getResultList();
return lmenu;
}
}

View File

@ -0,0 +1,53 @@
package com.fp.bpmlib.query.solicitud;
import java.util.List;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.persistence.commondb.PersistenceHelper;
public class EstadoSolicitudQuery extends QueryRule{
/**
*
*/
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
@Override
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
try {
System.out.println("*********consulta*************************************");
String codigosolicitud = (String) pQueryRequest.get("codigosolicitudbpm");
System.out.println("CODIGO DE CONSULTA : "+codigosolicitud);
if(codigosolicitud.contains("SOL")){
codigosolicitud=codigosolicitud.replace("SOL", "");
}
if(codigosolicitud.contains("TRA")){
codigosolicitud=codigosolicitud.replace("TRA", "");
}
StringBuilder sql = new StringBuilder("select DISTINCT ta.ACTIVITYNAME,ta.USERCODE,ta.GROUPCODE,tk.STATUS,ta.CREATED,ta.STARTED,ta.COMPLETED "
+ " from jbpm6.VARIABLEINSTANCELOG d, TBPMACTIVITIES ta, jbpm6.TASK tk "
+ " where d.processInstanceId = ta.internalcode and tk.id (+) = ta.TASKID ");
if(codigosolicitud.contains("SOL") || codigosolicitud.contains("TRA")){
sql.append(" and (d.value like '%SOL"+codigosolicitud+"%' or d.value like '%TRA"+codigosolicitud+"%') ");//SOL-0000491173
}else{
sql.append(" and d.value like '%"+codigosolicitud+"%' ");
}
sql.append( " order by ta.CREATED ");
System.out.println("SQL_ESTADOS_SOLICITUDBPM: "+sql);
List<Object[]> listaVariables=PersistenceHelper.getEntityManager().
createNativeQuery(sql.toString()).getResultList();
System.out.println("consulta*************************************"+listaVariables);
pQueryRequest.getResponse().put("LISTASESTADOSOLICITUDBPM", listaVariables);
} catch (Exception e) {
e.printStackTrace();
}
return pQueryRequest;
}
}

View File

@ -0,0 +1,137 @@
package com.fp.common.soap;
import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.StringWriter;
import java.net.URL;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPMessage;
import org.apache.log4j.Logger;
import org.apache.xml.serializer.ToXMLStream;
import org.w3c.dom.Node;
import com.fp.common.files.StreamHelper;
import com.fp.common.properties.PropertiesHandler;
public final class WSClient {
private static final Logger LOG = Logger.getLogger(WSClient.class);
/** Instancia singleton de SOAPClient */
private static WSClient instance = null;
/**
* Obtiene la instancia singleton de SOAPClient
*
* @return singleton
*/
public static WSClient getInstance() {
synchronized (WSClient.class) {
if (WSClient.instance == null) {
WSClient.instance = new WSClient();
}
}
return WSClient.instance;
}
/**
* Contructor sin parametros
*/
private WSClient() {
}
/**
* Envia una peticion SOAP en base a los parametros definido en el PropertiesHandler
*
* @param pEndpintURL
* @param pSoapRequest
* @param ph
* @return data resultado de la peticion
* @throws Exception
*/
public String soapSend(String pEndpintURL, String pSoapRequest, PropertiesHandler ph) throws Exception {
try {
WSClient.LOG.debug("ENDPOINT " + pEndpintURL);
String file = ph.getStringValue("ws.ofac.path") + "/FL" + Double.valueOf(Math.random() * 100000).intValue()
+ ".txt";
FileOutputStream fout = new FileOutputStream(file);
try {
fout.write(pSoapRequest.getBytes());
} finally {
fout.close();
}
String command = ph.getStringValue("ws.ofac.command") + " " + pEndpintURL + " " + file;
/*
* Descomentar para pruebas en Windows String command =File.separator
* +"Fitbank"+File.separator+"soap"+File.separator+"run.bat" + " " + EndpintURL + " " + file;
*/
Process p = Runtime.getRuntime().exec(command);
String data = StreamHelper.readStream(p.getInputStream());
WSClient.LOG.debug("Respuesta |" + data + "|");
return data;
} catch (Exception e) {
WSClient.LOG.error(e, e);
throw e;
}
}
public SOAPMessage prepareMessage(String pSoapRequest) throws Exception {
return this.prepareMessage(pSoapRequest, "ISO-8859-1");
}
/**
* Prepara el mensaje SOAP a ser enviado
*
* @param pSoapRequest
* @return
* @throws Exception
*/
public SOAPMessage prepareMessage(String pSoapRequest, String pEncoding) throws Exception {
MessageFactory msgFactory = MessageFactory.newInstance();
WSClient.LOG.debug("MessageFactory |" + msgFactory.getClass().getName() + "|");
return msgFactory.createMessage(null, new ByteArrayInputStream(
// ("<?xml version='1.0' encoding='ISO-8859-1'?>" + pSoapRequest).getBytes()));
("<?xml version='1.0' encoding='" + pEncoding + "'?>" + pSoapRequest).getBytes()));
}
/**
* Envia una peticion SOAP para pruebas mediante una nueva conexion
*
* @param pEndpintURL
* @param pSoapRequest
* @return resp
* @throws Exception
*/
public String soapSendReal(String pEndpintURL, String pSoapRequest) throws Exception {
WSClient.LOG.debug("EndPoint |" + pEndpintURL + "| Peticion |" + pSoapRequest + "|");
// MessageFactory msgFactory = new MessageFactoryImpl();
SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
SOAPMessage reqMsg = this.prepareMessage(pSoapRequest);
URL epURL = new URL(pEndpintURL);
SOAPMessage resMsg = con.call(reqMsg, epURL);
String resp = WSClient.nodeToString(resMsg.getSOAPBody().getOwnerDocument());
WSClient.LOG.debug(" Respuesta |" + resp + "|");
return resp;
}
public static String nodeToString(Node pNode) throws Exception {
String data = "";
ToXMLStream dser = (ToXMLStream) (new ToXMLStream()).asDOMSerializer();
StringWriter sw = new StringWriter();
dser.setWriter(sw);
dser.serialize(pNode);
String element = sw.toString();
data = element.substring(element.indexOf(">") + 1);
return data;
}
}

View File

@ -0,0 +1,569 @@
package com.fp.general.security.rules;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fp.base.persistence.util.helper.GeneralDescriptions;
import com.fp.bpm.query.Query;
import com.fp.common.helper.CalculationBase;
import com.fp.dto.data.SaveData;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.general.db.DataHelper;
import com.fp.general.exception.GeneralException;
import com.fp.persistence.commondb.NestedSave;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.helper.APPDates;
import com.fp.persistence.commondb.helper.FormatDates;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pgeneral.date.TgeneAccountingDateBranch;
import com.fp.persistence.pgeneral.gene.TgeneArea;
import com.fp.persistence.pgeneral.gene.TgeneAreaKey;
import com.fp.persistence.pgeneral.gene.TgeneBranch;
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetail;
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetailKey;
import com.fp.persistence.pgeneral.gene.TgeneChannels;
import com.fp.persistence.pgeneral.gene.TgeneCity;
import com.fp.persistence.pgeneral.gene.TgeneCityKey;
import com.fp.persistence.pgeneral.gene.TgeneCompany;
import com.fp.persistence.pgeneral.gene.TgeneCountry;
import com.fp.persistence.pgeneral.gene.TgeneLabel;
import com.fp.persistence.pgeneral.gene.TgeneOffice;
import com.fp.persistence.pgeneral.gene.TgeneOfficeKey;
import com.fp.persistence.pgeneral.gene.TgeneProvince;
import com.fp.persistence.pgeneral.gene.TgeneProvinceKey;
import com.fp.persistence.pgeneral.safe.TsafeJavaScript;
import com.fp.persistence.pgeneral.safe.TsafePassword;
import com.fp.persistence.pgeneral.safe.TsafePasswordKey;
import com.fp.persistence.pgeneral.safe.TsafeProfile;
import com.fp.persistence.pgeneral.safe.TsafeTerminal;
import com.fp.persistence.pgeneral.safe.TsafeTerminalKey;
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
import com.fp.persistence.pgeneral.safe.TsafeUserProfile;
import com.fp.persistence.pgeneral.safe.TsafeUserSession;
import com.fp.persistence.pgeneral.safe.TsafeUserSessionKey;
import com.fp.persistence.pgeneral.safe.TsafeUserSessionLog;
import com.fp.persistence.pgeneral.safe.TsafeUserSessionLogKey;
import com.fp.sessionbeans.helper.Sequence;
/**
* Clase que se encargara del ingreso a la aplicacion
*
* @author scastillo
* @version 2.1
*/
public class UserLogonCas extends QueryRule {
private static final long serialVersionUID = 1L;
private static SimpleDateFormat simpleDateFormatCreateTime = new SimpleDateFormat("HH:mm:ss");
private TsafePassword tsafePassword;
private boolean isjsf;
/**
* Metodo que ejecuta el proceso
*
* @param pQueryRequest
* @throws Exception
*/
@Override
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
this.isjsf = pQueryRequest.isJsf();
TsafeUserDetail userdetail = this.getTsafeUserDetail(pQueryRequest);
String terminal = (String) pQueryRequest.get("ip");
String host = (String) pQueryRequest.get("host");
String jsessionid = (String) pQueryRequest.get("jsessionid");
String usercode = (String) pQueryRequest.get("login");
if (userdetail == null) {
this.writeLog(pQueryRequest, usercode, terminal, jsessionid, host, "GENE-0011", "USUARIO NO EXISTE");
throw new GeneralException("GENE-0011", "USUARIO NO EXISTE");
}
if (userdetail.getUserstatuscatalog().compareTo("ACT") != 0) {
TgeneCatalogDetailKey tgeneCatalogDetailKey = new TgeneCatalogDetailKey(userdetail.getUserstatuscatalog(),
userdetail.getUserstatuscatalogcode());
TgeneCatalogDetail tgeneCatalogDetail = TgeneCatalogDetail.find(PersistenceHelper.getEntityManager(), tgeneCatalogDetailKey);
this.writeLog(pQueryRequest, userdetail, "GENE-0010", "EL USUARIO " + userdetail.getPk().getUsercode() + " SE ENCUENTRA "
+ tgeneCatalogDetail.getDescription());
throw new GeneralException("GENE-0010", "EL USUARIO {0} SE ENCUENTRA {1}", userdetail.getPk().getUsercode(),
tgeneCatalogDetail.getDescription());
}
TsafeTerminal tsafeTerminal = null;
// userdetail.getTerminalcode()
if ((userdetail.getBranchfromterminal() != null) && (userdetail.getBranchfromterminal().compareTo("Y") == 0)
&& (userdetail.getTerminalcode() != null)) {
TsafeTerminalKey tsafeTerminalKey = new TsafeTerminalKey(userdetail.getTerminalcode(), userdetail.getCompanycode());
TsafeTerminal tsafeTerminalAux = TsafeTerminal.find(PersistenceHelper.getEntityManager(), tsafeTerminalKey);
if (tsafeTerminalAux == null) {
this.writeLog(pQueryRequest, userdetail, "CORE-0002", "TERMINAL " + terminal + " NO DEFINIDO EN TSAFETERMINAL");
throw new GeneralException("CORE-0002", "TERMINAL {0} NO DEFINIDO EN TSAFETERMINAL", terminal);
} else {
tsafeTerminal = tsafeTerminalAux;
terminal = tsafeTerminalAux.getIpaddress();
}
}
if (tsafeTerminal == null) {
tsafeTerminal = TsafeTerminal.find(PersistenceHelper.getEntityManager(), userdetail.getCompanycode(), terminal);
}
if ((userdetail.getBranchfromterminal() != null) && (userdetail.getBranchfromterminal().compareTo("Y") == 0)) {
if (tsafeTerminal == null) {
this.writeLog(pQueryRequest, userdetail, "CORE-0002", "TERMINAL " + terminal + " NO DEFINIDO EN TSAFETERMINAL");
throw new GeneralException("CORE-0002", "TERMINAL {0} NO DEFINIDO EN TSAFETERMINAL", terminal);
} else if ((tsafeTerminal != null) && (userdetail.getTerminalcode() != null)) {
TsafeTerminalKey tsafeTerminalKey = new TsafeTerminalKey(userdetail.getTerminalcode(), userdetail.getCompanycode());
TsafeTerminal tsafeTerminalaux = TsafeTerminal.find(PersistenceHelper.getEntityManager(), tsafeTerminalKey);
if ((tsafeTerminalaux != null) && (tsafeTerminalaux.getIpaddress() != null)
&& (tsafeTerminalaux.getIpaddress().compareTo(terminal) != 0)) {
this.writeLog(pQueryRequest, userdetail, "CORE-0056", "LA IP " + terminal + " NO SE ENCUENTRA AUTORIZADA PARA EL USUARIO "
+ userdetail.getPk().getUsercode());
throw new GeneralException("CORE-0056", "LA IP {0} NO SE ENCUENTRA AUTORIZADA PARA EL USUARIO {1}", terminal, userdetail.getPk()
.getUsercode());
}
}
if (userdetail.getBranchcode().compareTo(tsafeTerminal.getBranchcode()) != 0) {
throw new GeneralException("CORE-0064", "EL TERMINAL {0} ASOCIADO AL USUARIO SE ENCUENTRA EN OTRA SUCURSAL {1}");
}
if (userdetail.getOfficecode().compareTo(tsafeTerminal.getOfficecode()) != 0) {
throw new GeneralException("CORE-0065", "EL TERMINAL {0} ASOCIADO AL USUARIO SE ENCUENTRA EN OTRA OFICINA {1}");
}
if (userdetail.getAreacode().compareTo(tsafeTerminal.getAreacode()) != 0) {
throw new GeneralException("CORE-0066", "EL TERMINAL {0} ASOCIADO AL USUARIO SE ENCUENTRA EN OTRA ÁREA {1}");
}
}
if ((tsafeTerminal != null) && (tsafeTerminal.getSliptprinter() != null)) {
userdetail.addAddtionalInfo("spn", tsafeTerminal.getSliptprinter());
} else {
userdetail.addAddtionalInfo("spn", null);
}
TsafePasswordKey key = new TsafePasswordKey(pQueryRequest.getCompany(), userdetail.getChannelcode());
this.tsafePassword = TsafePassword.find(PersistenceHelper.getEntityManager(), key);
this.completeLocation(userdetail);
this.completeAreaName(userdetail);
this.completeCompanyName(userdetail);
this.completeChannelName(userdetail);
this.completeBranchName(userdetail, pQueryRequest, terminal);
this.completeOfficeName(userdetail);
this.completeProfile(userdetail);
this.completeDates(userdetail);
if (!pQueryRequest.isJsf()) {
this.completeJavaScript(userdetail);
this.completeInternazionalization(userdetail);
}
//datos de usuario de la sbs
TcustPersonDetail tcp = TcustPersonDetail.find(PersistenceHelper.getEntityManager(), userdetail.getPk().getPersoncode());
userdetail.addAddtionalInfo("sbsemployee", tcp.getSbsemployee());
userdetail.addAddtionalInfo("sbsusercode", tcp.getSbsusercode());
// this.createSession(userdetail, pQueryRequest, terminal, jsessionid, host);
return pQueryRequest;
}
private TsafeUserDetail getTsafeUserDetail(QueryRequest pQueryRequest) throws Exception {
TsafeUserDetail userdetail = null;
if (!pQueryRequest.isJsf()) {
Query qry = new Query();
PersistenceHelper.getEntityManager().clear();
qry.process(pQueryRequest);
userdetail = (TsafeUserDetail) pQueryRequest.getResponse().get("TSAFEUSERDETAIL");
} else {
userdetail = TsafeUserDetail.find(PersistenceHelper.getEntityManager(), pQueryRequest.get("login").toString());
pQueryRequest.getResponse().put("TSAFEUSERDETAIL", userdetail);
}
return userdetail;
}
/**
* Metodo que agrega el nombre de la sucursal y la ip del cleinte en el detail
*
* @param pUserdetail
* @param pQueryRequest
* @param terminal
* @throws Exception
*/
private void completeBranchName(TsafeUserDetail pUserdetail, QueryRequest pQueryRequest, String terminal) throws Exception {
TgeneBranch branch = DataHelper.getInstance().getTgeneBranch(pUserdetail.getBranchcode(), pUserdetail.getCompanycode());
pUserdetail.addAddtionalInfo("bn", branch.getDescription());
pUserdetail.addAddtionalInfo("ip", terminal);
}
/**
* Metodo que agrega la descripción del area del usuario
*
* @param pUserdetail
* @throws Exception
*/
private void completeAreaName(TsafeUserDetail pUserdetail) throws Exception {
TgeneAreaKey tgeneAreaKey = new TgeneAreaKey(pUserdetail.getCompanycode(), pUserdetail.getAreacode());
TgeneArea tgeneArea = (TgeneArea) PersistenceHelper.getSession().get(TgeneArea.class, tgeneAreaKey);
pUserdetail.addAddtionalInfo("an", tgeneArea.getDescripction());
}
/**
* Metodo que agrega el nombre de la compania
*
* @param pUserdetail
* @throws Exception
*/
private void completeCompanyName(TsafeUserDetail pUserdetail) throws Exception {
TgeneCompany tgeneCompany = (TgeneCompany) PersistenceHelper.getSession().get(TgeneCompany.class, pUserdetail.getCompanycode());
pUserdetail.addAddtionalInfo("cn", GeneralDescriptions.getPersonname(tgeneCompany.getPersoncode()));
}
/**
* Metodo que agrega la descripcion del canal del usuario
*
* @param pUserdetail
* @throws Exception
*/
private void completeChannelName(TsafeUserDetail pUserdetail) throws Exception {
TgeneChannels tgeneChannels = (TgeneChannels) PersistenceHelper.getSession().get(TgeneChannels.class, pUserdetail.getChannelcode());
pUserdetail.addAddtionalInfo("chn", tgeneChannels.getDescription());
}
/**
* Metodo que agrega la oficina en el detail
*
* @param pUserdetail
* @throws Exception
*/
private void completeOfficeName(TsafeUserDetail pUserdetail) throws Exception {
TgeneOfficeKey tgeneOfficeKey = new TgeneOfficeKey(pUserdetail.getOfficecode(), pUserdetail.getBranchcode(), pUserdetail.getCompanycode());
TgeneOffice office = TgeneOffice.find(PersistenceHelper.getEntityManager(), tgeneOfficeKey);
pUserdetail.addAddtionalInfo("on", office.getDescription());
}
/**
* Metodo que completa la fecha contable y de trabajao
*
* @param pUserdetail
* @throws Exception
*/
private void completeDates(TsafeUserDetail pUserdetail) throws Exception {
TgeneAccountingDateBranch tgeneAccountingDateBranch = com.fp.persistence.commondb.db.DataHelper.getInstance().getTgeneAccountingDateBranch(
pUserdetail.getCompanycode(), 0);
String hour = UserLogonCas.simpleDateFormatCreateTime.format(FormatDates.getInstance().getDataBaseTimestamp());
pUserdetail.addAddtionalInfo("wt", hour);
if (tgeneAccountingDateBranch == null) {
pUserdetail.addAddtionalInfo("ad", null);
pUserdetail.addAddtionalInfo("wd", null);
} else {
pUserdetail.addAddtionalInfo("ad", tgeneAccountingDateBranch.getAccountingdate());
pUserdetail.addAddtionalInfo("wd", tgeneAccountingDateBranch.getWorkingdate());
}
}
/**
* Metodo para completar datos de ubicacion del usuario
*
* @param pUserdetail
* @throws Exception
*/
private void completeLocation(TsafeUserDetail pUserdetail) throws Exception {
if ((pUserdetail.getBranchcode() != null) && (pUserdetail.getCompanycode() != null) && (pUserdetail.getOfficecode() != null)) {
TgeneOfficeKey tgeneOfficeKey = new TgeneOfficeKey(pUserdetail.getOfficecode(), pUserdetail.getBranchcode(), pUserdetail.getCompanycode());
TgeneOffice tgeneOffice = TgeneOffice.find(PersistenceHelper.getEntityManager(), tgeneOfficeKey);
pUserdetail.addAddtionalInfo("address", tgeneOffice.getAddress());
pUserdetail.addAddtionalInfo("citycode", tgeneOffice.getCitycode());
if (tgeneOffice.getCountrycode() != null) {
TgeneCountry tgeneCountry = TgeneCountry.find(PersistenceHelper.getEntityManager(), tgeneOffice.getCountrycode());
pUserdetail.addAddtionalInfo("countrycode", tgeneCountry.getPk());
pUserdetail.addAddtionalInfo("countryname", tgeneCountry.getDescription());
} else {
pUserdetail.addAddtionalInfo("countrycode", null);
pUserdetail.addAddtionalInfo("countryname", null);
}
if ((tgeneOffice.getCountrycode() != null) && (tgeneOffice.getProvincecode() != null)) {
TgeneProvinceKey tgeneProvinceKey = new TgeneProvinceKey(tgeneOffice.getCountrycode(), tgeneOffice.getProvincecode());
TgeneProvince tgeneProvince = TgeneProvince.find(PersistenceHelper.getEntityManager(), tgeneProvinceKey);
pUserdetail.addAddtionalInfo("provincecode", tgeneProvince.getPk().getProvincecode());
pUserdetail.addAddtionalInfo("provincename", tgeneProvince.getDescription());
} else {
pUserdetail.addAddtionalInfo("provincecode", null);
pUserdetail.addAddtionalInfo("provincename", null);
}
if ((tgeneOffice.getCountrycode() != null) && (tgeneOffice.getProvincecode() != null) && (tgeneOffice.getCantoncode() != null)
&& (tgeneOffice.getCitycode() != null)) {
TgeneCityKey tgeneCityKey = new TgeneCityKey(tgeneOffice.getCountrycode(), tgeneOffice.getProvincecode(),
tgeneOffice.getCantoncode(), tgeneOffice.getCitycode());
TgeneCity tgeneCity = TgeneCity.find(PersistenceHelper.getEntityManager(), tgeneCityKey);
pUserdetail.addAddtionalInfo("cityname", tgeneCity.getDescription());
} else {
pUserdetail.addAddtionalInfo("cityname", null);
}
pUserdetail.addAddtionalInfo("username", GeneralDescriptions.getUsername(pUserdetail.getPk().getUsercode()));
} else {
pUserdetail.addAddtionalInfo("address", null);
pUserdetail.addAddtionalInfo("citycode", null);
pUserdetail.addAddtionalInfo("cityname", null);
pUserdetail.addAddtionalInfo("countrycode", null);
pUserdetail.addAddtionalInfo("countryname", null);
pUserdetail.addAddtionalInfo("provincecode", null);
pUserdetail.addAddtionalInfo("provincename", null);
pUserdetail.addAddtionalInfo("username", null);
}
}
/**
* Metodo que completa el perfile del usuario
*
* @param pUserdetail
* @throws Exception
*/
private void completeProfile(TsafeUserDetail pUserdetail) throws Exception {
List<TsafeUserProfile> profile = DataHelper.getInstance().getTsafeUserProfile(pUserdetail.getPk().getUsercode());
if (this.isjsf) {
pUserdetail.addAddtionalInfo("lprofile", profile);
for (TsafeUserProfile tsafeUserProfile : profile) {
TsafeProfile tsafeProfile = TsafeProfile.find(PersistenceHelper.getEntityManager(), tsafeUserProfile.getPk().getProfilecode());
tsafeUserProfile.addAddtionalInfo("nprofile", tsafeProfile.getDescription());
}
return;
}
String profileData = "";
String profileDataDesc = "";
for (int i = 0; i < profile.size(); i++) {
if (i > 0) {
profileData += ".";
profileDataDesc += ".";
}
profileData += profile.get(i).getPk().getProfilecode();
TsafeProfile tsafeProfile = TsafeProfile.find(PersistenceHelper.getEntityManager(), profile.get(i).getPk().getProfilecode());
profileDataDesc += tsafeProfile.getDescription();
}
pUserdetail.addAddtionalInfo("profile", profileData);
pUserdetail.addAddtionalInfo("profiledesc", profileDataDesc);
}
/**
* Metodo que verifica si el password ingresado es correcto
*
* @param pUserdetail
* @param pQueryRequest
* @throws Exception
*/
private boolean validatePassword(TsafeUserDetail pUserdetail, QueryRequest pQueryRequest, String terminal, String jsessionid, String host)
throws Exception {
String passwd = (String) pQueryRequest.get("itemValue");
// Valida que el password no este expirado
this.validateExpiration(pUserdetail, pQueryRequest);
if (passwd.compareTo(pUserdetail.getPassword()) != 0) {
boolean maxintentos = this.increaseTryNumber(pUserdetail, pQueryRequest, terminal, jsessionid, host);
if (maxintentos) {
return false;
}
this.writeLog(pQueryRequest, pUserdetail, "GENE-0003", "USUARIO O PASSWORD INCORRECTO");
pQueryRequest.getResponse().setResponseCode("GENE-0003");
pQueryRequest.getResponse().setResponseUserMessage("USUARIO O PASSWORD INCORRECTO");
return false;
}
return true;
}
/**
* Metodo que verifica si el password ingresado es correcto
*
* @param pUserdetail
* @param pQueryRequest
* @throws Exception
*/
private void validateExpiration(TsafeUserDetail pUserdetail, QueryRequest pQueryRequest) throws Exception {
// Valida que el password no este expirado
if ((this.tsafePassword.getValiditydays() != null) && (this.tsafePassword.getValiditydays() > 0)) {
APPDates appd = new APPDates(pUserdetail.getDatefrom().toString().substring(0, 10), CalculationBase.B365365);
TgeneAccountingDateBranch db = com.fp.persistence.commondb.db.DataHelper.getInstance().getTgeneAccountingDateBranch(
pQueryRequest.getCompany(), 0);
APPDates appd1 = new APPDates(db.getWorkingdate(), CalculationBase.B365365);
if (appd1.compareTo(appd) >= 0) {
Integer days = appd1.substract(appd);
if (days.compareTo(this.tsafePassword.getValiditydays()) > 0) {
throw new GeneralException("GENE-0023", "CONTRASEÑA EXPIRADA");
}
days = days + this.tsafePassword.getMessagedays();
if (days.compareTo(this.tsafePassword.getValiditydays()) >= 0) {
days = days - this.tsafePassword.getMessagedays();
days = this.tsafePassword.getValiditydays() - days;
pUserdetail.addAddtionalInfo("dpwd", days);
}
}
}
}
/**
* Metodo que completa la internacionalizacion dentro de la aplicacion
*
* @param pUserdetail
* @throws Exception
*/
private void completeInternazionalization(TsafeUserDetail pUserdetail) throws Exception {
List<TgeneLabel> lTgeneLabel = TgeneLabel.getTgeneLabel(PersistenceHelper.getEntityManager(), pUserdetail.getLanguagecode(),
pUserdetail.getChannelcode());
Map<String, String> map = new HashMap<String, String>();
for (int i = 0; i < lTgeneLabel.size(); i++) {
TgeneLabel tgeneLabel = lTgeneLabel.get(i);
map.put(tgeneLabel.getPk().getLabel(), tgeneLabel.getDescription());
}
pUserdetail.put("i18n", map);
}
/**
* Metodo que completa los javascript
*
* @param pUserdetail
* @throws Exception
*/
private void completeJavaScript(TsafeUserDetail pUserdetail) throws Exception {
List<String> tsafeJavaScript = TsafeJavaScript.find(PersistenceHelper.getEntityManager(), pUserdetail.getCompanycode(),
pUserdetail.getChannelcode());
pUserdetail.put("js", tsafeJavaScript);
}
/**
* Metodo que crea la sesion cuando no existe una
*
* @param pUserdetail
* @param pQueryRequest
* @param terminal
* @param jsessionid
* @param host
* @throws Exception
*/
private void createSession(TsafeUserDetail pUserdetail, QueryRequest pQueryRequest, String terminal, String jsessionid, String host)
throws Exception {
TsafeUserSessionKey tsafeUserSessionKey = new TsafeUserSessionKey(pUserdetail.getPk().getUsercode(), FormatDates.getDefaultExpiryTimestamp());
TsafeUserSession tsafeUserSession = TsafeUserSession.find(PersistenceHelper.getEntityManager(), tsafeUserSessionKey);
PersistenceHelper.detatch(tsafeUserSession);
if (tsafeUserSession == null) {
tsafeUserSession = new TsafeUserSession();
tsafeUserSession.setDatefrom(FormatDates.getInstance().getDataBaseTimestamp());
tsafeUserSession.setPk(tsafeUserSessionKey);
tsafeUserSession.setTrynumber(1);
tsafeUserSession.setSessionid(jsessionid);
tsafeUserSession.setTerminalcode(terminal);
tsafeUserSession.setWebserverip(host);
this.saveObject(tsafeUserSession);
} else {
if (tsafeUserSession.getTerminalcode().compareTo(terminal) == 0) {
tsafeUserSession.setDatefrom(FormatDates.getInstance().getDataBaseTimestamp());
this.saveObject(tsafeUserSession);
} else {
this.writeLog(pQueryRequest, pUserdetail, "GENE-0009", "EL USUARIO " + pUserdetail.getPk().getUsercode()
+ " SE ENCUENTRA TRABAJANDO EN EL TERMINAL " + tsafeUserSession.getTerminalcode());
throw new GeneralException("GENE-0009", "EL USUARIO {0} SE ENCUENTRA TRABAJANDO EN EL TERMINAL {1}", pUserdetail.getPk()
.getUsercode(), tsafeUserSession.getTerminalcode());
}
}
}
/**
* Metodo que incrementa el numero de intentos
*
* @param pUserdetail
* @param pQueryRequest
* @param terminal
* @param jsessionid
* @param host
* @return
* @throws Exception
*/
private boolean increaseTryNumber(TsafeUserDetail pUserdetail, QueryRequest pQueryRequest, String terminal, String jsessionid, String host)
throws Exception {
TsafeUserSessionKey tsafeUserSessionKey = new TsafeUserSessionKey(pUserdetail.getPk().getUsercode(), FormatDates.getDefaultExpiryTimestamp());
TsafeUserSession tsafeUserSession = TsafeUserSession.find(PersistenceHelper.getEntityManager(), tsafeUserSessionKey);
if (tsafeUserSession != null) {
TsafeUserSession tsafeUserSessionAux = (TsafeUserSession) tsafeUserSession.cloneMe();
tsafeUserSessionAux.getPk().setDateto(FormatDates.getInstance().getDataBaseTimestamp());
this.saveObject(tsafeUserSessionAux);
tsafeUserSession.setTrynumber(tsafeUserSession.getTrynumber() + 1);
this.saveObject(tsafeUserSession);
if ((this.tsafePassword.getIntentnumber() != null) && (tsafeUserSession.getTrynumber() >= this.tsafePassword.getIntentnumber())) {
pUserdetail.setUserstatuscatalog("BLQ");
this.saveObject(pUserdetail);
pQueryRequest.getResponse().setResponseCode("GENE-0007");
pQueryRequest.getResponse().setResponseUserMessage(
MessageFormat.format("EL USUARIO {0} HA SIDO BLOQUEADO POR INGRESO DE CLAVE ERRONEA", pUserdetail.getPk().getUsercode()));
return true;
}
} else {
this.createSession(pUserdetail, pQueryRequest, terminal, jsessionid, host);
}
return false;
}
/**
* Método que guarda los datos en la tabla
*
* @param object
* @throws Exception
*/
private void saveObject(Object object) throws Exception {
PersistenceHelper.getEntityManager().merge(object);
}
/**
*
* @param pQueryRequest
* @param usercode
* @param terminal
* @param jsessionid
* @param host
* @param errorCode
* @param messageError
* @throws Exception
*/
private void writeLog(QueryRequest pQueryRequest, String usercode, String terminal, String jsessionid, String host, String errorCode,
String messageError) throws Exception {
TgeneAccountingDateBranch tgeneAccountingDateBranch = com.fp.persistence.commondb.db.DataHelper.getInstance().getTgeneAccountingDateBranch(
pQueryRequest.getCompany(), 0);
TsafeUserSessionLogKey tsafeUserSessionLogKey = new TsafeUserSessionLogKey(tgeneAccountingDateBranch.getAccountingdate(),
this.getSequenceLoginLog(), pQueryRequest.getCompany());
TsafeUserSessionLog tsafeUserSessionLog = new TsafeUserSessionLog(tsafeUserSessionLogKey, usercode, terminal, jsessionid, host, FormatDates
.getInstance().getDataBaseTimestamp(PersistenceHelper.getEntityManager()), errorCode, messageError);
NestedSave nestedSave = new NestedSave(pQueryRequest.getCompany(), tsafeUserSessionLog);
nestedSave.start();
}
/**
*
* @param pQueryRequest
* @param tsafeUserDetail
* @param errorCode
* @param messageError
* @throws Exception
*/
private void writeLog(QueryRequest pQueryRequest, TsafeUserDetail tsafeUserDetail, String errorCode, String messageError) throws Exception {
TgeneAccountingDateBranch tgeneAccountingDateBranch = com.fp.persistence.commondb.db.DataHelper.getInstance().getTgeneAccountingDateBranch(
pQueryRequest.getCompany(), 0);
String terminal = (String) pQueryRequest.get("ip");
String host = (String) pQueryRequest.get("host");
String jsessionid = (String) pQueryRequest.get("jsessionid");
TsafeUserSessionLogKey tsafeUserSessionLogKey = new TsafeUserSessionLogKey(tgeneAccountingDateBranch.getAccountingdate(),
this.getSequenceLoginLog(), pQueryRequest.getCompany());
TsafeUserSessionLog tsafeUserSessionLog = new TsafeUserSessionLog(tsafeUserSessionLogKey, tsafeUserDetail.getPk().getUsercode(), terminal,
jsessionid, host, FormatDates.getInstance().getDataBaseTimestamp(PersistenceHelper.getEntityManager()), errorCode, messageError);
tsafeUserSessionLog.setBranchcode(tsafeUserDetail.getBranchcode());
tsafeUserSessionLog.setOfficecode(tsafeUserDetail.getOfficecode());
NestedSave nestedSave = new NestedSave(pQueryRequest.getCompany(), tsafeUserSessionLog);
nestedSave.start();
}
/**
* Metodo que entrega la secuencia para gurdar los logs
*
* @return
* @throws Exception
*/
private Integer getSequenceLoginLog() throws Exception {
Sequence sequence = new Sequence();
Integer loginsequnce = Integer.valueOf(sequence.getNextValue("LOGINLOG").toString());
SaveData.getMap().put("LOGINLOG", loginsequnce.toString());
return loginsequnce;
}
}

View File

@ -0,0 +1,158 @@
package com.fp.frontend.servlet;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import com.fp.frontend.controller.alfresco.AlfrescoController;
/**
* Servlet que se encarga de abrir la ayuda
*
* @author WPA
*/
@WebServlet(name = "HelpServlet", urlPatterns = {"/HelpServlet"})
public class HelpServlet extends HttpServlet {
private static final long serialVersionUID = 6934418044442466664L;
private boolean shuttingDown = false;
//Access methods for shuttingDown
protected synchronized void setShuttingDown(boolean flag) {
shuttingDown = flag;
}
protected synchronized boolean isShuttingDown() {
return shuttingDown;
}
/**
* Processes requests for both HTTP
* <code>GET</code> and
* <code>POST</code> methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
OutputStream outputStream = response.getOutputStream();
response.setContentType("text/html");
try {
response.setHeader("Pragma", "no-cache");
String module = request.getParameter("cmodule");
String transaction = request.getParameter("ctransaction");
// String version = request.getParameter("version");
String path = request.getParameter("path");
String name = "cm:help_"+module+"_"+transaction+".pdf";
InputStream inputStream = AlfrescoController.getDocument(name, path);
response.setContentType("application/pdf");
if (inputStream != null) {
IOUtils.copy(inputStream, outputStream);
IOUtils.closeQuietly(inputStream);
IOUtils.closeQuietly(outputStream);
outputStream.flush();
} else {
PrintWriter printWriter = new PrintWriter(outputStream);
printWriter.println("<html>");
printWriter.println("<head>");
printWriter.println("<title>Ayuda</title>");
printWriter.println("</head>");
printWriter.println("<body>");
printWriter.println("<h1>Archivo " + name + ".pdf no disponible en el sistema</h1>");
printWriter.println("</body>");
printWriter.println("</html>");
printWriter.write("<script type=\"text/javascript\">");
printWriter.write("window.opener.mensajeAyuda('" + name + "');window.close();");
printWriter.write("</script>");
printWriter.close();
}
} catch (Throwable ex) {
String mensaje = getStackTrace(ex);
if (mensaje == null) {
mensaje = "";
}
PrintWriter printWriter = new PrintWriter(outputStream);
printWriter.println("<html>");
printWriter.println("<head>");
printWriter.println("<title>Ayuda</title>");
printWriter.println("</head>");
printWriter.println("<body>");
printWriter.println("<h1>" + ex.getMessage() + "</h1>");
printWriter.println("<pre style=\"width:100%;height:85%;overflow:auto;\">" + StringEscapeUtils.escapeHtml(mensaje) + "</pre>");
printWriter.println("</body>");
printWriter.println("</html>");
printWriter.close();
} finally {
outputStream.close();
}
}
/**
* Handles the HTTP
* <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP
* <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}
/**
* M&eacute;todo que devuelve la excepcion como tal
*
* @param ex
* @return
*/
public String getStackTrace(Throwable ex) {
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
if (ex.getCause() != null) {
ex.getCause().printStackTrace(pw);
} else {
ex.printStackTrace(pw);
}
String data = sw.toString();
pw.close();
return data;
} catch (Exception e) {
return null;
}
}
}

View File

@ -0,0 +1,62 @@
package ec.gov.sri.wsconsultacontribuyente;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Clase Java para obtenerDatosResponse complex type.
*
* <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
*
* <pre>
* &lt;complexType name="obtenerDatosResponse">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="return" type="{http://sri.gov.ec/wsConsultaContribuyente}contribuyenteOnLine" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "obtenerDatosResponse", propOrder = {
"_return"
})
public class ObtenerDatosResponse {
@XmlElement(name = "return")
protected ContribuyenteOnLine _return;
/**
* Obtiene el valor de la propiedad return.
*
* @return
* possible object is
* {@link ContribuyenteOnLine }
*
*/
public ContribuyenteOnLine getReturn() {
return _return;
}
/**
* Define el valor de la propiedad return.
*
* @param value
* allowed object is
* {@link ContribuyenteOnLine }
*
*/
public void setReturn(ContribuyenteOnLine value) {
this._return = value;
}
}

View File

@ -0,0 +1,268 @@
package com.fp.persistence.pgeneral.auth;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.fp.dto.hb.HibernateBean;
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENEEXCEPTIONS*/
@Entity(name="TgeneExceptions")
@Table(name="TGENEEXCEPTIONS")
public class TgeneExceptions extends com.fp.dto.AbstractDataTransport implements Serializable,HibernateBean,Cloneable{
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
/**
* Clave primaria de la Entidad TgeneExceptions
*/
@EmbeddedId
private TgeneExceptionsKey pk;
@Column(name="PROFILECODE", nullable=true)
/**
* Codigo de perfil de usuario
*/
private String profilecode;
@Column(name="CONDITION", nullable=true)
/**
* Condicion a evaluar
*/
private String condition;
@Column(name="STRINGVALUE", nullable=true)
/**
* Valor a compar con el dato del campo
*/
private String stringvalue;
@Column(name="NUMERICVALUE", nullable=true)
/**
* Valor a compar con el dato del campo
*/
private BigDecimal numericvalue;
@Column(name="TITLE", nullable=true)
/**
* Titulo de la condicion a generar, ejemplo MONTO > 100
*/
private String title;
@Column(name="COMMAND", nullable=true)
/**
* Clase que genera una condicion especial, ejemplo nacionalidad = ECUATORIANA
*/
private String command;
/**Contructor por defecto*/
public TgeneExceptions(){
}
/**Contructor de TgeneExceptions
@param pPk Clave Primaria del entity
*/
public TgeneExceptions(TgeneExceptionsKey pPk){
this();
pk=pPk;
}
/**
* Metodo que entrega datos de la tabla dada la clave primaria.
* @param pEntityManager referencia de la session a obtener datos del bean.
* @param pKey Caleve primaria del bean.
* @return TgeneExceptions
*/
public static TgeneExceptions find(EntityManager pEntityManager,TgeneExceptionsKey pKey) throws Exception{
TgeneExceptions obj = pEntityManager.find(TgeneExceptions.class,pKey);
return obj;
}
/**Entrega la Clave primaria de TgeneExceptions
@return El objeto que referencia a la Clave primaria de TgeneExceptions
*/
public TgeneExceptionsKey getPk(){
return pk;
}
/**Fija un nuevo valor a la Clave primaria de TgeneExceptions
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneExceptions
*/
public void setPk(TgeneExceptionsKey pPk){
pk=pPk;
}
/**Obtiene el valor de profilecode
@return valor de profilecode*/
public String getProfilecode(){
return profilecode;
}
/**Fija el valor de profilecode
@param pProfilecode nuevo Valor de profilecode*/
public void setProfilecode(String pProfilecode){
profilecode=pProfilecode;
}
/**Obtiene el valor de condition
@return valor de condition*/
public String getCondition(){
return condition;
}
/**Fija el valor de condition
@param pCondition nuevo Valor de condition*/
public void setCondition(String pCondition){
condition=pCondition;
}
/**Obtiene el valor de stringvalue
@return valor de stringvalue*/
public String getStringvalue(){
return stringvalue;
}
/**Fija el valor de stringvalue
@param pStringvalue nuevo Valor de stringvalue*/
public void setStringvalue(String pStringvalue){
stringvalue=pStringvalue;
}
/**Obtiene el valor de numericvalue
@return valor de numericvalue*/
public BigDecimal getNumericvalue(){
return numericvalue;
}
/**Fija el valor de numericvalue
@param pNumericvalue nuevo Valor de numericvalue*/
public void setNumericvalue(BigDecimal pNumericvalue){
numericvalue=pNumericvalue;
}
/**Obtiene el valor de title
@return valor de title*/
public String getTitle(){
return title;
}
/**Fija el valor de title
@param pTitle nuevo Valor de title*/
public void setTitle(String pTitle){
title=pTitle;
}
/**Obtiene el valor de command
@return valor de command*/
public String getCommand(){
return command;
}
/**Fija el valor de command
@param pCommand nuevo Valor de command*/
public void setCommand(String pCommand){
command=pCommand;
}
public boolean equals(Object rhs){
if (rhs == null)return false;
if (! (rhs instanceof TgeneExceptions))return false;
TgeneExceptions that = (TgeneExceptions) rhs;
if (this.getPk() == null || that.getPk() == null)
return false;
return (this.getPk().equals(that.getPk()));
}
/**Implementación del metodo hashCode de la la entidad TgeneExceptions
@return el hashCode la instancia
*/
public int hashCode() {
if (this.hashValue == 0){
int result = 17;
if (this.getPk() == null){
result = super.hashCode();
}else{
result = this.getPk().hashCode();
}
this.hashValue = result;
}
return this.hashValue;
}
/**Implementación toString
*/
public String toString() {
Field[]fs=this.getClass().getDeclaredFields();
String data="";
for(Field f:fs){
try{
String name=f.getName();
if(f.getType().getName().compareTo("java.util.Set")==0)continue;
if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
data+=name+"="+f.get(this)+";";
}catch(Exception e){
continue;
}
}
if(data.compareTo("")==0){
data=super.toString();
}
return data;
}
/**Implementación de la creación de un bean en blanco TgeneExceptions
*/
public Object createInstance(){
TgeneExceptions instance=new TgeneExceptions();
instance.setPk(new TgeneExceptionsKey());
return instance;
}
/**Clona la entidad TgeneExceptions
@see com.fp.dto.hb.HibernateBean#cloneMe()
*/
public Object cloneMe() throws CloneNotSupportedException{
TgeneExceptions p=(TgeneExceptions)this.clone();
p.setPk((TgeneExceptionsKey)this.pk.cloneMe());
return p;
}
//Metodos manuales.
/**Sentencia que devuelve la definicion de excepciones que requieren autorizacion, por subproducto moneda.*/
private static final String HQL_EXCEPTIONS =
"from TgeneExceptions texception " +
" where texception.pk.modulecode = :modulecode "+
" and texception.pk.productcode = :productcode "+
" and texception.pk.subproductcode = :subproductcode "+
" and texception.pk.currencycode = :currencycode "+
" order by texception.pk.exceptionorder ";
/**
* Entrega una lista de excepciones de solicitud definidas por subproducto moneda, con la cual
* se generan excepciones a autorizar en una solicitud.
* @param pModuleCode Codigo de modulo.
* @param pProductCode Codigo de product.
* @param pSubproductCode Codigo de subproducto.
* @param pCurrencyCode Codigo de moneda.
* @return List<TgeneExceptions>
* @throws Exception
*/
@SuppressWarnings("unchecked")
public static List<TgeneExceptions> find(EntityManager pEntityManager,String pModuleCode,String pProductCode,
String pSubproductCode,String pCurrencyCode) throws Exception {
List<TgeneExceptions> lObjects = null;
Query qry = pEntityManager.createQuery(HQL_EXCEPTIONS);
qry.setParameter("modulecode", pModuleCode);
qry.setParameter("productcode", pProductCode);
qry.setParameter("subproductcode", pSubproductCode);
qry.setParameter("currencycode", pCurrencyCode);
lObjects = qry.getResultList();
return lObjects;
}
}

View File

@ -0,0 +1,42 @@
package com.fp.frontend.webservices.impl;
import java.util.Date;
import javax.jws.WebService;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.frontend.helper.CallerHelper;
import com.fp.frontend.webservices.DocumentosService;
@WebService(endpointInterface="com.fp.frontend.webservices.DocumentosService")
public class DocumentosServiceImpl implements DocumentosService {
@Override
public String guardaDatosDocumentos(byte[] foto, String codigoproceso, String codigotarjeta,
Date fechaimpresion) {
String respuesta = "0";
System.out.println("codigoproceso.."+codigoproceso+ " codigotarjeta.."+codigotarjeta+" fechaimpresion.."+fechaimpresion);
try {
CallerHelper callerHelper = new CallerHelper();
Request request = callerHelper.getRequest();
request.setCompany(1);
request.setTransactionModule("30");
request.setTransactionCode(9997);
request.setTransactionVersion(1);
request.put("FOTO", foto);
request.put("CODIGOSOLICITUD", codigoproceso);
request.put("CODIGOTARJETA", codigotarjeta);
request.put("FECHAIMPRESION", fechaimpresion);
System.out.println("codigoproceso.."+codigoproceso+ " codigotarjeta.."+codigotarjeta+" fechaimpresion.."+fechaimpresion);
Response response = callerHelper.executeSave(request);
if(response.getResponseCode().compareTo(Response.RESPONSE_OK) == 0){
respuesta = (String) response.get("RESPONSESTATUS");
}
} catch (Throwable e) {
respuesta = "2";
}
return respuesta;
}
}

View File

@ -0,0 +1,451 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.fp</groupId>
<artifactId>frontend</artifactId>
<version>2.1</version>
<packaging>war</packaging>
<name>Frontend primefaces</name>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<!-- solo para jboss provide-->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ejb-client-bom</artifactId>
<version>7.1.3.Final</version>
<type>pom</type>
<!-- solo para jboss provide-->
<scope>provided</scope>
</dependency>
<!-- Dependencias Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.0.1.Final</version>
<!-- solo para jboss provide-->
<scope>provided</scope>
</dependency>
<!-- Fin dependencias Hibernate -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.4</version>
<!-- solo para jboss provide-->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.4</version>
<!-- solo para jboss provide-->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<!-- solo para jboss provide-->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<!-- solo para jboss provide-->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.0.8</version>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>redmond </artifactId>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.2.3</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- DEPENDENCIAS DEL CORE ********** -->
<dependency>
<groupId>com.fp.base.dto</groupId>
<artifactId>dto</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base</groupId>
<artifactId>facadeclient</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base.bpm</groupId>
<artifactId>simple</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base.persistence</groupId>
<artifactId>pgeneral</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base.persistence</groupId>
<artifactId>pcustomer</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base.persistence</groupId>
<artifactId>pbpm</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base.persistence</groupId>
<artifactId>parmas</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base.persistence</groupId>
<artifactId>parmas</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.general</groupId>
<artifactId>general-mail</artifactId>
<version>2.1</version>
</dependency>
<!-- firmas -->
<dependency>
<groupId>com.fp.base.core</groupId>
<artifactId>firmas</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base.persistence</groupId>
<artifactId>pfirmas</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.fp.base.core</groupId>
<artifactId>alfresco-client</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<!-- FIN DEPENDENCIAS DEL CORE ****** -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-ejb-client-bom</artifactId>
<type>pom</type>
</dependency>
<!-- Dependencias Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<!-- Fin dependencias Hibernate -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
</dependency>
<!-- Dependencias JSF -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!-- Fin Dependencias JSF -->
<!-- Dependencias PRIMEFACES-->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>redmond</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
</dependency>
<!--DEPENDENCIAS JASPERSERVER-->
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.6.0</version>
<scope>provided</scope>
</dependency>
<!-- se crea manualmente en el reporsitorio se toma de iReport-5.6.0\ireport\modules-->
<dependency>
<groupId>com.jaspersoft.ireport</groupId>
<artifactId>jaspersoft.ireport</artifactId>
<version>5.6.0</version>
<scope>provided</scope>
</dependency>
<!-- se crea manualmente en el reporsitorio se toma de iReport-5.6.0\ireport\modules-->
<dependency>
<groupId>com.jaspersoft.ireport.jasperserver</groupId>
<artifactId>jaspersoft.ireport.jasperserver</artifactId>
<version>5.6.0</version>
<scope>provided</scope>
</dependency>
<!-- se crea manualmente en el reporsitorio se toma del war de jasperserver WEB-INF/lib-->
<dependency>
<groupId>com.jaspersoft.jasperserver</groupId>
<artifactId>jasperserver-common-ws</artifactId>
<version>5.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codeartisans.thirdparties.swing</groupId>
<artifactId>org-openide-util</artifactId>
<version>8.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
<scope>provided</scope>
</dependency>
<!--dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
<version>1.3</version>
</dependency-->
<dependency>
<groupId>axis</groupId>
<artifactId>axis-wsdl4j</artifactId>
<version>1.5.1</version>
<scope>provided</scope>
</dependency>
<!--FIN DEPENDENCIAS JASPERSERVER-->
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
</dependency>
<!-- Dependencias Pentaho embbebing -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.3.1</version>
</dependency>
<!-- FIn dependencias Pentaho embbebing -->
<!--Dependencias Alfresco-->
<!-- <dependency>
<groupId>ec.gob.sbs.alfresco</groupId>
<artifactId>alfresco-api-client</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency> -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3</version>
</dependency>
<!-- DEPENDENCIAS POI -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.10-FINAL</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.10-FINAL</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.10-FINAL</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.10-FINAL</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<fork>true</fork>
<encoding>${project.build.sourceEncoding}</encoding>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
<finalName>maia</finalName>
</build>
<repositories>
<repository>
<id>maven2-repository.jboss.com</id>
<name>Jboss Repository for Maven</name>
<url>http://repository.jboss.com/maven2</url>
</repository>
<repository>
<id>prime-repo</id>
<name>Prime Technology Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
</project>

View File

@ -0,0 +1,211 @@
package com.fp.persistence.parmas.param;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Column;
import javax.persistence.EntityManager;
import java.io.Serializable;
import javax.persistence.Table;
import com.fp.dto.hb.HibernateBean;
import com.fp.dto.hb.Log;
import javax.persistence.Version;
import java.lang.reflect.Field;
import javax.persistence.Transient;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TARMREQUISITO*/
@Entity(name="TarmRequisito")
@Table(name="TARMREQUISITO")
public class TarmRequisito extends com.fp.dto.AbstractDataTransport implements Serializable,HibernateBean,Cloneable, Log {
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
/**
* Clave primaria de la Entidad TarmRequisito
*/
@Id
@Column(name="CREQUISITO" ,nullable=false, updatable=false)
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SequenceKey", parameters = {
@Parameter(name = "name", value = "CREQUISITO"),//campo secuencial de la tabla
@Parameter(name = "type", value = "java.lang.String"),// tipo de dato
@Parameter(name = "fill", value = "0"),
@Parameter(name = "length", value = "6")})
@GeneratedValue(generator = "seq_id")
private String pk;
@Column(name="NOMBRE", nullable=false)
/**
* Descripcion del requisito
*/
private String nombre;
@Version
@Column(name="RECORDVERSION", nullable=true)
/**
* Manejo de optimistic locking del registro
*/
private Integer recordversion;
@Column(name="DESCRIPCIONCORTA", nullable=true)
/**
* Descripcion corta del requisito
*/
private String descripcioncorta;
@Column(name="ACTIVE", nullable=true)
/**
* Activo
*/
private String active;
/**Contructor por defecto*/
public TarmRequisito(){
}
/**Contructor de TarmRequisito
@param pPk Clave Primaria del entity
@param pNombre Descripcion del requisito
*/
public TarmRequisito(String pPk,String pNombre){
this();
pk=pPk;
nombre=pNombre;
}
/**
* Metodo que entrega datos de la tabla dada la clave primaria.
* @param pEntityManager referencia de la session a obtener datos del bean.
* @param pKey Caleve primaria del bean.
* @return TarmRequisito
*/
public static TarmRequisito find(EntityManager pEntityManager,Object pKey) throws Exception{
TarmRequisito obj = pEntityManager.find(TarmRequisito.class,pKey);
return obj;
}
/**Entrega la Clave primaria de TarmRequisito
@return El objeto que referencia a la Clave primaria de TarmRequisito
*/
public String getPk(){
return pk;
}
/**Fija un nuevo valor a la Clave primaria de TarmRequisito
@param pPk El objeto que referencia a la nueva Clave primaria de TarmRequisito
*/
public void setPk(String pPk){
pk=pPk;
}
/**Obtiene el valor de nombre
@return valor de nombre*/
public String getNombre(){
return nombre;
}
/**Fija el valor de nombre
@param pNombre nuevo Valor de nombre*/
public void setNombre(String pNombre){
nombre=pNombre;
}
/**Obtiene el valor de recordversion
@return valor de recordversion*/
public Integer getRecordversion(){
return recordversion;
}
/**Fija el valor de recordversion
@param pRecordversion nuevo Valor de recordversion*/
public void setRecordversion(Integer pRecordversion){
recordversion=pRecordversion;
}
public boolean equals(Object rhs){
if (rhs == null)return false;
if (! (rhs instanceof TarmRequisito))return false;
TarmRequisito that = (TarmRequisito) rhs;
if (this.getPk() == null || that.getPk() == null)
return false;
return (this.getPk().equals(that.getPk()));
}
/**Implementacion del metodo hashCode de la la entidad TarmRequisito
@return el hashCode la instancia
*/
public int hashCode() {
if (this.hashValue == 0){
int result = 17;
if (this.getPk() == null){
result = super.hashCode();
}else{
result = this.getPk().hashCode();
}
this.hashValue = result;
}
return this.hashValue;
}
/**Implementacion toString
*/
public String toString() {
Field[]fs=this.getClass().getDeclaredFields();
String data="";
for(Field f:fs){
try{
String name=f.getName();
if(f.getType().getName().compareTo("java.util.Set")==0)continue;
if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
data+=name+"="+f.get(this)+";";
}catch(Exception e){
continue;
}
}
if(data.compareTo("")==0){
data=super.toString();
}
return data;
}
/**Implementacion de la creacion de un bean en blanco TarmRequisito
*/
public Object createInstance(){
TarmRequisito instance=new TarmRequisito();
return instance;
}
/**Clona la entidad TarmRequisito
@see com.fp.dto.hb.HibernateBean#cloneMe()
*/
public Object cloneMe() throws CloneNotSupportedException{
TarmRequisito p=(TarmRequisito)this.clone();
return p;
}
/**Obtiene el valor de descripcioncorta
@return valor de descripcioncorta*/
public String getDescripcioncorta() {
return descripcioncorta;
}
/**Fija el valor de descripcioncorta
@param pRecordversion nuevo Valor de descripcioncorta*/
public void setDescripcioncorta(String descripcioncorta) {
this.descripcioncorta = descripcioncorta;
}
public String getActive() {
return active;
}
public void setActive(String active) {
this.active = active;
}
}

View File

@ -0,0 +1,44 @@
package com.fp.general.rules.query;
import java.util.List;
import com.fp.base.persistence.util.helper.GeneralDescriptions;
import com.fp.bpm.query.Query;
import com.fp.dto.Response;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.persistence.pgeneral.menu.TgeneMenuLevelTran;
/**
* Clase que completa el nombre de la transaccion en niveles
*
* @author scastillo
*/
public class CompleteTransactionLevel extends QueryRule {
/**
* Metodo que completa el nombre de la transaccion
*
* @param pQueryRequest
* @return
* @throws Exception
*/
@Override
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
Response response = pQueryRequest.getResponse();
Query qry = new Query();
qry.process(pQueryRequest);
List<Object> lobjects = (List<Object>) response.get("TGENEMENULEVELTRAN");
for (Object obj : lobjects) {
TgeneMenuLevelTran tgeneMenuLevelTran = (TgeneMenuLevelTran) obj;
if ((tgeneMenuLevelTran.getPk().getTransactionmodule() != null) && (tgeneMenuLevelTran.getPk().getTransactioncode() != null)
&& (tgeneMenuLevelTran.getPk().getTransactionversion() != null)) {
tgeneMenuLevelTran.addAddtionalInfo("name", GeneralDescriptions.getTransactiondesc(tgeneMenuLevelTran.getPk().getTransactionmodule(),
tgeneMenuLevelTran.getPk().getTransactioncode(), tgeneMenuLevelTran.getPk().getTransactionversion()));
} else {
tgeneMenuLevelTran.addAddtionalInfo("name", null);
}
}
return pQueryRequest;
}
}

View File

@ -0,0 +1,94 @@
package com.fp.general.scheduler;
import java.util.List;
import org.quartz.CronTrigger;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import com.fp.general.exception.GeneralException;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.data.ThreadFacade;
import com.fp.persistence.pgeneral.schedule.TgeneScheduleEvent;
import com.fp.persistence.pgeneral.schedule.TgeneScheduleParameters;
/**
* Clase que se encarga de ejecutar tareas calendarizadas, que se parametrizan en TgeneSchdeleEven.
* @author Jorge Vaca
* @version 2.1
*/
public class MiaScheduler {
private MiaScheduler cahce;
private Scheduler scheduler;
public void init() {
try {
SchedulerFactory sfact = new StdSchedulerFactory();
scheduler = sfact.getScheduler();
scheduler.start();
//Obtine lista de eventos a procesar.
List<TgeneScheduleEvent> ldata = TgeneScheduleEvent.find(PersistenceHelper.getEntityManager());
if(ldata == null || ldata.isEmpty()){
return;
}
TgeneScheduleParameters params = TgeneScheduleParameters.find(PersistenceHelper.getEntityManager(),
ThreadFacade.getSessionData().getCompany());
if(params == null){
throw new GeneralException("GENE-0034", "PARAMETROS PARA EJECUTAR TAREAS CALENDARIZADAS NO DEFINIDOS EN TGENSCHEDULEPARAMETERS", ThreadFacade.getSessionData().getCompany());
}
//Calendariza tareas por evento.
for (TgeneScheduleEvent obj : ldata) {
//Va dentro del for para crear un nuevo JobDataMap de parametros por cada ejecucion.
JobDataMap jdm = this.fillMap(params);
this.processByEvent(obj,jdm);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Metodo que define tareas calendarizadas, de acuerdo a la definicion del evento.
* @param event Objeto que contien caracteristicas de ejecucion de un evento.
* @param jdm Map con parametros que se asocian a la tarea calendarizada.
* @throws Exception
*/
private void processByEvent(TgeneScheduleEvent event,JobDataMap jdm) throws Exception {
jdm.put("evento", event.getPk());
//crea un jobdetail
JobDetail jd = new JobDetail(event.getPk(),event.getPk(), SchedulerJob.class);
jd.setJobDataMap(jdm);
//crea el cron segundos minutos horas diames mes diasemana
//CronTrigger ct = new CronTrigger(event.getPk(),event.getPk(), "0 05 15 ? * 2-6");
String cron = ""+event.getExesecond()+" "+event.getExeminute()+" "+event.getExehour()+" ? * "+event.getBeginweekday()+"-"+event.getEndweekday();
CronTrigger ct = new CronTrigger(event.getPk(),event.getPk(), cron);
scheduler.scheduleJob(jd, ct);
}
/**
* Crea un map con los datos de parametros de ejecucion de una tarea automatica.
* @param params Parametros de ejecucion de tareas automaticas.
* @return JobDataMap
* @throws Exception
*/
private JobDataMap fillMap(TgeneScheduleParameters params) throws Exception {
JobDataMap jdm = new JobDataMap();
jdm.put("cia", params.getPk());
jdm.put("suc", params.getBranchcode());
jdm.put("ofi", params.getOfficecode());
jdm.put("area", params.getAreacode());
jdm.put("ter", params.getTerminalcode());
jdm.put("can", params.getChannelcode());
jdm.put("usu", params.getUsercode());
return jdm;
}
public void detenerJob() throws Exception{
scheduler.shutdown();
}
}

View File

@ -0,0 +1,5 @@
#Thu Apr 30 15:37:39 COT 2015
redeployment.enabled=true
encoding=UTF-8
config.resources=centralwebservicessnap-ruc.xml,centralwebservicessnap-ced.xml,centralwebservices-lectura2.xml,centralwebservices-lectura.xml,centralwebservices-documentos.xml,centralwebservices-consultalogin1.xml,centralwebservices-consultalogin.xml,centralwebservices-colaimpresion.xml,centralwebservices-armas.xml,centralwebservices-datosnap.xml
domain=default

View File

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>bpm</artifactId>
<groupId>com.fp.base</groupId>
<version>2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.fp.base.bpm</groupId>
<artifactId>flows</artifactId>
<name>fp Platform - Flujos</name>
<version>2.1</version>
<dependencies>
</dependencies>
</project>

View File

@ -0,0 +1,82 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents"
template="/WEB-INF/templates/template.xhtml">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{activateUserController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:filters, :formTable:data-content, :formTable:data-profile"
saveProcess=":formTable:data-content"
focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="3" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpkuser" value="#{msg_customer.lbl_usercode}:" />
<p:inputText id="fpkuser" value="#{activateUserController.mfilters['pk.usercode']}" style="width: 160px;" onkeyup="Maia.forceupper(event, this);" />
<p:spacer/>
<p:outputLabel for="fname" value="#{msg_customer.lbl_person}:" />
<p:inputText id="fname" value="#{activateUserController.userdetail.mfilelds['personname']}" style="width: 400px;" disabled="true" />
<p:commandButton icon="ui-icon-link" actionListener="#{activateUserController.openPersonLov()}" process="@this" styleClass="m-lov-button">
<p:ajax event="dialogReturn" listener="#{activateUserController.onReturnPersonLov}" update="filters, data-content, data-profile" />
</p:commandButton>
</p:panelGrid>
<p:remoteCommand name="jsUser" actionListener="#{activateUserController.query()}" update="filters,data-content" process="@this, filters"/>
<h:panelGrid columns="2" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{activateUserController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:filters :formTable:data-content :formTable:data-profile"
saveProcess=":formTable:data-content" saveUpdate=":formTable:data-content"
showCreateBtn="false" showNextBtn="false" showPreviousBtn="false" />
</h:panelGrid>
<h:panelGrid id="data-content" columns="2" >
<p:outputLabel for="usercode" value="#{msg_general.lbl_code}:" />
<p:inputText id="usercode" value="#{activateUserController.userdetail.record.pk.usercode}" style="width:200px;" disabled="true" />
<p:outputLabel for="lenguaje" value="#{msg_general.lbl_language}:" />
<p:inputText id="lenguaje" value="#{activateUserController.userdetail.record.languagecode}" style="width:30px;" disabled="true" />
<p:outputLabel for="nickname" value="#{msg_customer.lbl_nickname}:" />
<p:inputText id="nickname" value="#{activateUserController.userdetail.record.nickname}" style="width:200px;" disabled="true" />
<p:outputLabel value="#{msg_general.lbl_channel}:" />
<p:inputText id="channelname" value="#{activateUserController.userdetail.record.modifiedData['chanelname']}" style="width:200px;" disabled="true" />
<p:outputLabel value="#{msg_general.lbl_area}:" />
<p:inputText id="areaname" value="#{activateUserController.userdetail.record.modifiedData['areaname']}" style="width:200px;" disabled="true" />
<p:outputLabel value="#{msg_general.lbl_state}:" />
<p:inputText id="state" value="#{activateUserController.userdetail.record.modifiedData['statusdesc']}" style="width:200px;" disabled="true" />
<p:spacer height="10px;"/>
<p:spacer/>
</h:panelGrid>
<p:panelGrid id="data-profile" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_profile}" />
</f:facet>
<p:dataTable id="profiles" var="row" value="#{activateUserController.userprofile.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_general.lbl_code}" resizable="true" style="width:40px" sortBy="#{row.pk.profilecode}">
<h:outputText value="#{row.pk.profilecode}" />
</p:column>
<p:column headerText="#{msg_general.lbl_description}" resizable="true" sortBy="#{row.modifiedData['profiledesc']}">
<h:outputText value="#{row.modifiedData['profiledesc']}"/>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,178 @@
package com.fp.persistence.pbpm.gene;
import javax.persistence.Column;
import java.io.Serializable;
import com.fp.dto.hb.HibernateId;
import java.lang.reflect.Field;
import javax.persistence.Embeddable;
import javax.persistence.Transient;
/**Clase que hace referencia a la Clave Primaria de TBPMFIELDTRANSACTIONORIGIN*/
@Embeddable
public class TbpmFieldTransactionOriginKey extends com.fp.dto.AbstractDataTransport implements Serializable,Cloneable,HibernateId{
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
@Column(name="TRANSACTIONMODULE", nullable=false,updatable=false)
/**
* Modulo al que pertence la transaccion
*/
private String transactionmodule;
@Column(name="TRANSACTIONCODE", nullable=false,updatable=false)
/**
* Codigo de transaccion dentro del modulo
*/
private Integer transactioncode;
@Column(name="TRANSACTIONVERSION", nullable=false,updatable=false)
/**
* Version de transaccion
*/
private Integer transactionversion;
@Column(name="FIELDNAME", nullable=false,updatable=false)
/**
* Numero de mensaje asociado al a instacioa del flujo.
*/
private String fieldname;
/**Contructor por defecto*/
public TbpmFieldTransactionOriginKey(){}
/**Contructor de TbpmFieldTransactionOriginKey
@param pTransactionmodule Modulo al que pertence la transaccion
@param pTransactioncode Codigo de transaccion dentro del modulo
@param pTransactionversion Version de transaccion
@param pFieldname Numero de mensaje asociado al a instacioa del flujo.
*/
public TbpmFieldTransactionOriginKey(String pTransactionmodule,Integer pTransactioncode,Integer pTransactionversion,String pFieldname){
transactionmodule=pTransactionmodule;
transactioncode=pTransactioncode;
transactionversion=pTransactionversion;
fieldname=pFieldname;
}
/**Obtiene el valor de transactionmodule
@return valor de transactionmodule*/
public String getTransactionmodule(){
return transactionmodule;
}
/**Fija el valor de transactionmodule
@param pTransactionmodule nuevo Valor de transactionmodule*/
public void setTransactionmodule(String pTransactionmodule){
transactionmodule=pTransactionmodule;
}
/**Obtiene el valor de transactioncode
@return valor de transactioncode*/
public Integer getTransactioncode(){
return transactioncode;
}
/**Fija el valor de transactioncode
@param pTransactioncode nuevo Valor de transactioncode*/
public void setTransactioncode(Integer pTransactioncode){
transactioncode=pTransactioncode;
}
/**Obtiene el valor de transactionversion
@return valor de transactionversion*/
public Integer getTransactionversion(){
return transactionversion;
}
/**Fija el valor de transactionversion
@param pTransactionversion nuevo Valor de transactionversion*/
public void setTransactionversion(Integer pTransactionversion){
transactionversion=pTransactionversion;
}
/**Obtiene el valor de fieldname
@return valor de fieldname*/
public String getFieldname(){
return fieldname;
}
/**Fija el valor de fieldname
@param pFieldname nuevo Valor de fieldname*/
public void setFieldname(String pFieldname){
fieldname=pFieldname;
}
/**Implementación de la comparación de TbpmFieldTransactionOriginKey
@param o Objeto de comparación
*/
public boolean equals(Object o){
if (o == null)return false;
if (! (o instanceof TbpmFieldTransactionOriginKey))return false;
TbpmFieldTransactionOriginKey that = (TbpmFieldTransactionOriginKey) o;
if (this.getTransactionmodule() == null || that.getTransactionmodule() == null){
return false;
}
if (! this.getTransactionmodule().equals(that.getTransactionmodule())){
return false;
}
if (this.getTransactioncode() == null || that.getTransactioncode() == null){
return false;
}
if (! this.getTransactioncode().equals(that.getTransactioncode())){
return false;
}
if (this.getTransactionversion() == null || that.getTransactionversion() == null){
return false;
}
if (! this.getTransactionversion().equals(that.getTransactionversion())){
return false;
}
if (this.getFieldname() == null || that.getFieldname() == null){
return false;
}
if (! this.getFieldname().equals(that.getFieldname())){
return false;
}
return true;
}
/**Implementación del método hashCode bajo el patrón de Bloch
@return hashCode de la instancia TbpmFieldTransactionOriginKey
*/
public int hashCode(){
if (this.hashValue == 0){
int result = 17;
result = result * 37 + (this.getTransactionmodule() == null ? 0 : this.getTransactionmodule().hashCode());
result = result * 37 + (this.getTransactioncode() == null ? 0 : this.getTransactioncode().hashCode());
result = result * 37 + (this.getTransactionversion() == null ? 0 : this.getTransactionversion().hashCode());
result = result * 37 + (this.getFieldname() == null ? 0 : this.getFieldname().hashCode());
this.hashValue = result;
}
return this.hashValue;
}
public Object cloneMe() throws CloneNotSupportedException {
return this.clone();
}
/**Implementación toString
*/
public String toString() {
Field[]fs=this.getClass().getDeclaredFields();
String data="";
for(Field f:fs){
try{
String name=f.getName();
if(f.getType().getName().compareTo("java.util.Set")==0)continue;
if(name.compareTo("hashValue")==0||name.compareTo("serialVersionUID")==0)continue;
data+="pk."+name+"="+f.get(this)+";";
}catch(Exception e){
continue;
}
}
if(data.compareTo("")==0){
data=super.toString();
}
return data;
}
}

View File

@ -0,0 +1,561 @@
package com.fp.frontend.controller.bpm;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import org.primefaces.component.accordionpanel.AccordionPanel;
import org.primefaces.event.TabChangeEvent;
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.query.SubQuery;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.pbpm.gene.TbpmGroupsUsers;
import com.fp.persistence.pgeneral.log.TgeneTransactionLog;
/**
* Clase que muestra
*
* @author amerchan
* @version 2.1
*/
@ManagedBean
@SessionScoped
public class InboxController extends AbstractController<TgeneTransactionLog> {
private static final long serialVersionUID = 1L;
private List<TbpmGroupsUsers> lBpmGroups;
private List<Map<String, Object>> lTransactionsByGroup;
private List<Map<String, Object>> lTransactions;
private String beanGroupsName;
private String codBpmGroupSelected;
private String bpmDataStatus;
private String bpmDataComment;
private String filterTaskName;
private int tabDiaryId;
private int accordionTaskTabId;
private int accordionGroupTabId;
private List<String> ltaskidinprocess = new ArrayList<>();
public InboxController() throws Exception {
super(TgeneTransactionLog.class);
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
super.startQuery();
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
beanGroupsName = "BPMGROUPS";
this.listGroups();
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
@Override
protected void querydatabase() {
}
@SuppressWarnings("unchecked")
protected void listGroups() {
try {
Request request = callerhelper.getRequest();
Map<String, String> mGroupsFilter = new HashMap<String, String>();
mGroupsFilter.put("pk.usercode", super.getLoginController().getRequest().getUser());
mGroupsFilter.put("pk.companycode", super.getLoginController().getRequest().getCompany().toString());
DtoQuery dto = new DtoQuery(TbpmGroupsUsers.class.getName(), page, 100, true, mGroupsFilter);
SubQuery subquery = new SubQuery("TbpmGroups", "description", "groupName",
"i.pk.groupcode = t.pk.groupcode and i.pk.companycode=t.pk.companycode");
dto.addSubQuery(subquery);
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(beanGroupsName, dto); // permite adicionar mas de una tabla.
request.setQueryTables(mtables);
Response resp = callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
lBpmGroups = new ArrayList<TbpmGroupsUsers>();
MessageHelper.setMessageError(resp);
} else {
lBpmGroups = (List<TbpmGroupsUsers>) resp.get(beanGroupsName);
if ((lBpmGroups != null) && !lBpmGroups.isEmpty()) {
codBpmGroupSelected = lBpmGroups.get(0).getPk().getGroupcode();
}
super.postQuery((List<AbstractDataTransport>) resp.get(beanGroupsName));
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@SuppressWarnings("unchecked")
public void queryTransactionsByGroup() {
try {
ltaskidinprocess = new ArrayList<>();
this.initBpmData();
Request request = callerhelper.getRequest();
request.put("queryalias", "INBOX_TRN_GROUP");
request.put("querytype", "P");
request.put("groupId", codBpmGroupSelected);
Response resp = callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
lTransactionsByGroup = new ArrayList<Map<String, Object>>();
MessageHelper.setMessageError(resp);
} else {
lTransactionsByGroup = (List<Map<String, Object>>) resp.get("transactions");
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
if ((lTransactionsByGroup != null) && !lTransactionsByGroup.isEmpty()) {
this.fillTransactions(lTransactionsByGroup, true);
}
}
@SuppressWarnings("unchecked")
public void queryTransactions() {
try {
ltaskidinprocess = new ArrayList<>();
this.initBpmData();
Request request = callerhelper.getRequest();
request.put("queryalias", "INBOX_TRN");
request.put("querytype", "P");
Response resp = callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
lTransactions = new ArrayList<Map<String, Object>>();
MessageHelper.setMessageError(resp);
} else {
lTransactions = (List<Map<String, Object>>) resp.get("transactions");
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
if ((lTransactions != null) && !lTransactions.isEmpty()) {
// no hacer la consulta entrega el detalle de la tarea.
// this.fillTransactions(this.lTransactions, false);
}
}
private void fillTransactions(List<Map<String, Object>> lTransactions, boolean isGroup) {
for (Map<String, Object> map : lTransactions) {
String tModule = (String) map.get("m");
Integer tCode = (Integer) map.get("t");
Integer tVersion = (Integer) map.get("v");
this.fillTasks(map, tModule, tCode, tVersion, isGroup);
}
}
@SuppressWarnings("unchecked")
private void fillTasks(Map<String, Object> map, String tModule, Integer tCode, Integer tVersion, boolean isGroup) {
try {
Request request = callerhelper.getNewRequest(tModule, tCode, tVersion);
String filtertasks = filterTaskName;
if (isGroup) {
request.put("queryalias", "INBOX_TASK_TRN_GROUP");
request.put("querytype", "P");
request.put("groupId", codBpmGroupSelected);
} else {
request.put("queryalias", "INBOX_TASK_TRN");
}
if ((filtertasks == null) || filtertasks.isEmpty()) {
filtertasks = "%";
}
request.put("cri", filtertasks);
Response resp = callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
MessageHelper.setMessageError(resp);
} else {
List<Map<String, Object>> lTasks = (List<Map<String, Object>>) resp.get("tasks");
map.put("tasks", lTasks);
for (Map<String, Object> mapTask : lTasks) {
this.fillTaskDetail(mapTask);
}
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@SuppressWarnings("unchecked")
private void fillTaskDetail(Map<String, Object> mapTask) {
try {
Request request = callerhelper.getNewRequest(null, null, null);
request.put("queryalias", "INBOX_TASK_DETAIL");
request.put("querytype", "P");
request.put("TID", mapTask.get("tid"));
Response resp = callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
MessageHelper.setMessageError(resp);
} else {
Map<String, Object> param = (Map<String, Object>) resp.get("param");
param.put("TID", mapTask.get("tid"));
param.put("KIND", resp.get("k"));
mapTask.put("taskDetail", resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public void initBpmData() throws Exception {
lTransactionsByGroup = new ArrayList<Map<String, Object>>();
lTransactions = new ArrayList<Map<String, Object>>();
bpmDataStatus = "";
bpmDataComment = "";
filterTaskName = "";
String tabDiaryId = super.getRequestParameter("tabDiary");
try {
this.tabDiaryId = Integer.parseInt(tabDiaryId);
} catch (Exception e) {
}
}
public void enableBpmData() {
try {
String kind = super.getRequestParameter("kind");
String status = super.getRequestParameter("s");
if (kind == null) {
return;
}
if (status.compareTo("Reserved") == 0) {
this.initTask();
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public void initTask() throws Throwable {
String tid = super.getRequestParameter("tid");
if (ltaskidinprocess.contains(tid)) {
return;
}
Request request = callerhelper.getNewRequest("2", 2001, 1);
request.modifiedData().put("TID", tid);
Response resp = callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
ltaskidinprocess.add(tid);
this.postCommit(resp);
MessageHelper.setMessageInfo(resp);
} else {
MessageHelper.setMessageError(resp);
}
}
public void assignTask() {
try {
String taskId = super.getRequestParameter("tid");
Request request = callerhelper.getNewRequest("2", 2000, 1);
request.modifiedData().put("TID", taskId);
Response resp = callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
this.postCommit(resp);
MessageHelper.setMessageInfo(resp);
} else {
MessageHelper.setMessageError(resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public void filterTasks() {
try {
String tModule = super.getRequestParameter("tModule");
Integer tCode = Integer.parseInt(super.getRequestParameter("tCode"));
Integer tVersion = Integer.parseInt(super.getRequestParameter("tVersion"));
filterTaskName = super.getRequestParameter("filterTaskName");
Map<String, Object> map = this.getTransactionMap(lTransactions, tModule, tCode, tVersion);
this.fillTasks(map, tModule, tCode, tVersion, false);
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public void filterTasksGroups() {
try {
String tModule = super.getRequestParameter("tModule");
Integer tCode = Integer.parseInt(super.getRequestParameter("tCode"));
Integer tVersion = Integer.parseInt(super.getRequestParameter("tVersion"));
filterTaskName = super.getRequestParameter("filterTaskName");
Map<String, Object> map = this.getTransactionMap(lTransactionsByGroup, tModule, tCode, tVersion);
this.fillTasks(map, tModule, tCode, tVersion, true);
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
private Map<String, Object> getTransactionMap(List<Map<String, Object>> lTransactions, String tModule, Integer tCode, Integer tVersion) {
for (Map<String, Object> map : lTransactions) {
String module = (String) map.get("m");
Integer transaction = (Integer) map.get("t");
Integer version = (Integer) map.get("v");
if ((tModule.compareTo(module) == 0) && (tCode.compareTo(transaction) == 0) && (tVersion.compareTo(version) == 0)) {
return map;
}
}
return null;
}
public void onAccordionTasksTabChange(TabChangeEvent event) {
// System.out.println(((AccordionPanel)event.getSource()).getPage());
accordionTaskTabId = Integer.parseInt(((AccordionPanel) event.getSource()).getActiveIndex());
}
public void onAccordionGroupsTabChange(TabChangeEvent event) {
// event.getTab().getId()
accordionGroupTabId = Integer.parseInt(((AccordionPanel) event.getSource()).getActiveIndex());
}
/**
* Entrega el valor de: beanGroupsName
*
* @return String
*/
public String getBeanGroupsName() {
return beanGroupsName;
}
/**
* Fija el valor de: beanGroupsName
*
* @param beanGroupsName Valor a fijar en el atributo
*/
public void setBeanGroupsName(String beanGroupsName) {
this.beanGroupsName = beanGroupsName;
}
/**
* Entrega el valor de: lBpmGroups
*
* @return List<TbpmGroupsUsers>
*/
public List<TbpmGroupsUsers> getlBpmGroups() {
return lBpmGroups;
}
/**
* Fija el valor de: lBpmGroups
*
* @param lBpmGroups Valor a fijar en el atributo
*/
public void setlBpmGroups(List<TbpmGroupsUsers> lBpmGroups) {
this.lBpmGroups = lBpmGroups;
}
/**
* Entrega el valor de: lTransactionsByGroup
*
* @return List<Map<String,Object>>
*/
public List<Map<String, Object>> getlTransactionsByGroup() {
return lTransactionsByGroup;
}
/**
* Fija el valor de: lTransactionsByGroup
*
* @param lTransactionsByGroup Valor a fijar en el atributo
*/
public void setlTransactionsByGroup(List<Map<String, Object>> lTransactionsByGroup) {
this.lTransactionsByGroup = lTransactionsByGroup;
}
/**
* Entrega el valor de: lTransactions
*
* @return List<Map<String,Object>>
*/
public List<Map<String, Object>> getlTransactions() {
return lTransactions;
}
/**
* Fija el valor de: lTransactions
*
* @param lTransactions Valor a fijar en el atributo
*/
public void setlTransactions(List<Map<String, Object>> lTransactions) {
this.lTransactions = lTransactions;
}
/**
* Entrega el valor de: bpmDataStatus
*
* @return String
*/
@Override
public String getBpmDataStatus() {
return bpmDataStatus;
}
/**
* Fija el valor de: bpmDataStatus
*
* @param bpmDataStatus Valor a fijar en el atributo
*/
@Override
public void setBpmDataStatus(String bpmDataStatus) {
this.bpmDataStatus = bpmDataStatus;
}
/**
* Entrega el valor de: bpmDataComment
*
* @return String
*/
@Override
public String getBpmDataComment() {
return bpmDataComment;
}
/**
* Fija el valor de: bpmDataComment
*
* @param bpmDataComment Valor a fijar en el atributo
*/
@Override
public void setBpmDataComment(String bpmDataComment) {
this.bpmDataComment = bpmDataComment;
}
/**
* Entrega el valor de: taskFilter
*
* @return String
*/
public String getFilterTaskName() {
return filterTaskName;
}
/**
* Fija el valor de: taskFilter
*
* @param taskFilter Valor a fijar en el atributo
*/
public void setFilterTaskName(String taskFilter) {
filterTaskName = taskFilter;
}
/**
* Entrega el valor de: tabDiaryId
*
* @return int
*/
public int getTabDiaryId() {
return tabDiaryId;
}
/**
* Fija el valor de: tabDiaryId
*
* @param tabDiaryId Valor a fijar en el atributo
*/
public void setTabDiaryId(int tabDiaryId) {
this.tabDiaryId = tabDiaryId;
}
/**
* Entrega el valor de: accordionTaskTabId
*
* @return int
*/
public int getAccordionTaskTabId() {
return accordionTaskTabId;
}
/**
* Fija el valor de: accordionTaskTabId
*
* @param accordionTaskTabId Valor a fijar en el atributo
*/
public void setAccordionTaskTabId(int accordionTaskTabId) {
this.accordionTaskTabId = accordionTaskTabId;
}
/**
* Entrega el valor de: accordionGroupTabId
*
* @return int
*/
public int getAccordionGroupTabId() {
return accordionGroupTabId;
}
/**
* Fija el valor de: accordionGroupTabId
*
* @param accordionGroupTabId Valor a fijar en el atributo
*/
public void setAccordionGroupTabId(int accordionGroupTabId) {
this.accordionGroupTabId = accordionGroupTabId;
}
/**
* Entrega el valor de: codBpmGroupSelected
*
* @return String
*/
public String getCodBpmGroupSelected() {
return codBpmGroupSelected;
}
/**
* Fija el valor de: codBpmGroupSelected
*
* @param codBpmGroupSelected Valor a fijar en el atributo
*/
public void setCodBpmGroupSelected(String codBpmGroupSelected) {
this.codBpmGroupSelected = codBpmGroupSelected;
}
public void logout() {
FacesContext fc = FacesContext.getCurrentInstance();
if(fc!=null){
fc.getExternalContext().invalidateSession();
}
}
}

View File

@ -0,0 +1,48 @@
package com.fp.viaticos.task;
import java.util.HashMap;
import java.util.Map;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.pviaticos.hra.EmpleadoJpql;
import com.fp.persistence.pviaticos.solicitud.ViaSolicitud;
import com.fp.persistence.pviaticos.solicitud.ViaSolicitudKey;
import com.fp.simple.action.TaskAction;
/**
* Clase que se encarga de fijar el codigo de supervisor de area, del empleado que realiza una liquidacion de viaticos,
* en el request campo userId, para asignar una tarea.
*
* @version 2.1
*/
public class AsignarSupervisiorInforme extends TaskAction {
/*
* (non-Javadoc)
*
* @see com.fp.simple.action.TaskAction#assignOwner(com.fp.simple.flow.DataMap)
*/
@SuppressWarnings("unchecked")
@Override
public void assignOwner(Object pParam) throws Exception {
HashMap<String, Object> m = (HashMap<String, Object>) pParam;
Map<String, Object> mrequest = (Map<String, Object>) m.get("request");
if (mrequest.get("csolicitud") == null) {
return;
}
String solicitud = (String) mrequest.get("csolicitud");
ViaSolicitud vsol = ViaSolicitud.find(PersistenceHelper.getEntityManager(), new ViaSolicitudKey(solicitud, "I"));
String codigoRespUnidad = vsol.getCod_responsable();
EmpleadoJpql e = new EmpleadoJpql();
if (codigoRespUnidad == null) {
codigoRespUnidad = e.find(vsol.getCod_empleado()).getCodigoResponsableUnidad();
}
// El userID va en mayusculas asi esta definido en las tablas de jbpm y maia.
m.put("userId", e.find(codigoRespUnidad).getUsuarioweb().toUpperCase());
m.put("action", "A");
}
}

View File

@ -0,0 +1,74 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<title>#{msg_armas.lbl_planificacioninsoeccion}</title>
<h:form id="formTable">
<maia:pageEvents controller="#{planificacionTramiteLovController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:tcatalog"
focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="9" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpk" value="#{msg_armas.lbl_mes}:" />
<p:inputText id="fpk" value="#{planificacionTramiteLovController.mfilters['mes']}" maxlength="20" style="width: 160px;" />
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<p:commandButton value="#{msg_general.btn_query}" update="data-content" icon="ui-icon-search" action="#{planificacionTramiteLovController.query()}" process="@this, filters"/>
<p:commandButton value="#{msg_general.btn_previous}" update="data-content" icon="ui-icon-seek-prev" action="#{planificacionTramiteLovController.previous()}" />
<p:commandButton value="#{msg_general.btn_next}" update="data-content" icon="ui-icon-seek-next" action="#{planificacionTramiteLovController.next()}" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_catalogo}" />
</f:facet>
<p:dataTable id="tcatalog" var="row" value="#{planificacionTramiteLovController.lrecord}" rows="200" style="min-width: 300px; width: auto;" rowKey="#{row.rowkey()}"
selectionMode="single" selection="#{planificacionTramiteLovController.record}" >
<p:ajax event="rowSelect" listener="#{planificacionTramiteLovController.setcatalog()}" />
<p:column headerText="#{msg_armas.lbl_codigoplanificacion}" resizable="true" >
<h:outputText value="#{row.modifiedData['codigoplanificacion']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_codigo}" resizable="true" >
<h:outputText value="#{row.pk}"/>
</p:column>
<p:column headerText="Mes" resizable="true" >
<h:outputText value="#{row.mes}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_nombrerazonsocial}" resizable="true" >
<h:outputText value="#{row.modifiedData['name']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_noDocumento}" resizable="true" >
<h:outputText value="#{row.modifiedData['identification']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_tramite}" resizable="true" >
<h:outputText value="#{row.modifiedData['tramite']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_categoria}" resizable="true" >
<h:outputText value="#{row.modifiedData['categoria']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_usoactividad}" resizable="true" >
<h:outputText value="#{row.modifiedData['usoactividad']}"/>
</p:column>
<p:column >
<p:commandButton icon="ui-icon-copy" actionListener="#{planificacionTramiteLovController.setcatalog(row)}" />
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
#remote.connection.default.host=192.168.1.105
remote.connection.default.port=4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
#para el servidor remoto que esta en linux
#remote.connection.default.username=jvaca
#remote.connection.default.password=Gato1971
#revisar si finciona en linux
#remote.connection.one.host=${host.ip:172.20.10.2
#remote.connection.one.port=${host.port:4447}
#remote.connection.one.username=${username:flip}
#remote.connection.one.password=${password:flip01}
#remote.connection.one.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
#remote.connection.one.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
#remote.connection.one.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=${host.auth:JBOSS-LOCAL-USER}

View File

@ -0,0 +1,4 @@
/**
* Provee las clases para Reportes
*/
package com.fp.bpmlib.report;

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

View File

@ -0,0 +1,60 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions" template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<title>LOV: #{msg_general.lvh_usuario}</title>
<h:body>
<h:form id="formTable">
<maia:pageEvents controller="#{userLovController}" queryProcess=":formTable:filters"
queryUpdate=":formTable:user" focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="9" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpku" value="#{msg_security.user}:" />
<p:inputText id="fpku" value="#{userLovController.mfilters['pk.usercode']}" maxlength="20"
style="width: 160px;" onkeyup="Maia.forceupper(event, this);" />
<p:outputLabel for="fnameuser" value="#{msg_general.lbl_name}:" />
<p:inputText id="fnameuser" value="#{userLovController.userName}" maxlength="100" style="width: 300px;"
onkeyup="Maia.forceupper(event, this);" />
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<p:commandButton value="#{msg_general.btn_query}" update="user" icon="ui-icon-search"
action="#{userLovController.query()}" process="@this, filters" />
<p:commandButton value="#{msg_general.btn_previous}" update="user" icon="ui-icon-seek-prev"
action="#{userLovController.previous()}" />
<p:commandButton value="#{msg_general.btn_next}" update="user" icon="ui-icon-seek-next"
action="#{userLovController.next()}" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_usuario}" />
</f:facet>
<p:dataTable id="user" var="row" value="#{userLovController.lrecord}" rows="200"
style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single"
selection="#{userLovController.record}">
<p:ajax event="rowSelect" listener="#{userLovController.setuser()}" />
<p:column headerText="#{msg_general.lbl_usuario}" resizable="true" style="width:70px"
sortBy="#{row.pk.usercode}">
<h:outputText value="#{row.pk.usercode}" />
</p:column>
<p:column headerText="#{msg_general.lbl_name}" resizable="true">
<h:outputText value="#{row.modifiedData['personname']}" />
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</h:body>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,52 @@
package com.fp.general.rules.query.code;
import java.sql.Timestamp;
import com.fp.dto.Response;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.helper.FormatDates;
import com.fp.persistence.pgeneral.image.TgeneFilesDetail;
import com.fp.persistence.pgeneral.image.TgeneFilesDetailKey;
/**
* Clase que devuelve en bytes un archivo
*
* @author scastillo
*/
public class DataBaseFile extends QueryRule {
/**
* Metodo que devuelve en forma de bytes un archivo
*
* @param pQueryRequest
* @return
* @throws Exception
*/
@Override
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
Response response = pQueryRequest.getResponse();
Integer code = (Integer) pQueryRequest.get("code");
Timestamp dateto = null;
if (pQueryRequest.get("dateto") != null) {
dateto = Timestamp.valueOf((String) pQueryRequest.get("dateto"));
} else {
dateto = FormatDates.getDefaultExpiryTimestamp();
}
TgeneFilesDetailKey tgeneFilesDetailKey = new TgeneFilesDetailKey(code, dateto);
TgeneFilesDetail tgeneFilesDetail = (TgeneFilesDetail) PersistenceHelper.getSession().get(TgeneFilesDetail.class, tgeneFilesDetailKey);
if (tgeneFilesDetail != null) {
response.put("file", tgeneFilesDetail.getImage());
response.put("extension", tgeneFilesDetail.getExtension());
response.put("contentType", tgeneFilesDetail.getContenttype());
response.put("name", tgeneFilesDetail.getName());
} else {
response.put("file", null);
response.put("extension", null);
response.put("contentType", null);
response.put("name", null);
}
return pQueryRequest;
}
}

View File

@ -0,0 +1,63 @@
/*
*
*/
package com.fp.bpmlib;
import com.fp.common.helper.Constant;
import com.fp.common.logger.APPLogger;
import com.fp.dto.save.SaveRequest;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.helper.FormatDates;
import com.fp.persistence.pbpm.gene.TbpmProcessInstance;
/**
* Class RegisterFlow encargada de.
*
* @author jvaca
* @version 2.1
*/
public class RegisterFlow {
/** El valor de process. */
private Flujo flujo;
/** El valor de request. */
private SaveRequest request;
/**
* Crea una nueva instancia de register flow.
*
* @param pProcess the process
* @param pRequest the request
* @param pCompany the company
* @throws Exception la exception
*/
public RegisterFlow(Flujo flujo, SaveRequest pRequest) throws Exception {
this.flujo = flujo;
this.request = pRequest;
}
/**
* Register flow.
*
* @throws Exception la exception
*/
public void registerFlow() throws Exception {
APPLogger.getLogger().info("registro Instancia de Flujo");
TbpmProcessInstance pi = new TbpmProcessInstance(this.request.getJournalId(), this.flujo.getKiesession().getId(), FormatDates.getInstance()
.getDataBaseDate());
pi.setProcessid(this.flujo.getProcessInstance().getId());
pi.setFinalized(Constant.STR_N);
PersistenceHelper.persist(pi);
APPLogger.getLogger().info("Graba Instancia de Flujo " + pi.getProcessid());
}
}

View File

@ -0,0 +1,129 @@
<ui:composition xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<p:layout id="layoutGeneral" style="min-width:100%;height:100%;">
<p:layoutUnit id="layoutInformacion" position="west"
collapsible="true" style="width:100%;height:100%">
<h:form id="formTable">
<maia:pageEvents
controller="#{visualizacionSitiosAlmacenamientoController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:datosAlmacenamiento :formTable:datosAlmacenamiento"
focusContainer=":formTable:filters"
saveUpdate=":formTable:datosAlmacenamiento" />
<p:panelGrid id="filters" columns="1"
style="min-width:100%;">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<h:panelGrid columns="9">
<p:outputLabel for="fpkmod" value="#{msg_general.lbl_code}:" rendered="false"/>
<p:inputText id="fpkmod"
value="#{visualizacionSitiosAlmacenamientoController.mfilters['pk.provincecode']}"
style="width: 100px;" disabled="true" rendered="false"/>
<p:outputLabel for="fname" value="#{msg_general.lbl_province}:" />
<p:inputText id="fname"
value="#{visualizacionSitiosAlmacenamientoController.mfilelds['description']}"
style="width: 300px;" disabled="true" />
<p:commandButton id="lovProvincia" icon="ui-icon-link"
actionListener="#{visualizacionSitiosAlmacenamientoController.openProvinciaLov()}"
process="@this" styleClass="m-lov-button">
<p:ajax event="dialogReturn"
listener="#{visualizacionSitiosAlmacenamientoController.onReturnProvinceLov}"
update="filters,data-content" />
</p:commandButton>
</h:panelGrid>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls
controller="#{visualizacionSitiosAlmacenamientoController}"
queryProcess=":formTable:filters, :formTable:generaMap"
queryUpdate=":formTable:filters :formTable:datosAlmacenamiento"
showCreateBtn="false"
showSaveBtn="false"
/>
<p:commandButton id="generaMap" icon="ui-icon-tag"
value="#{msg_general.lbl_generarmapa}"
action="#{visualizacionSitiosAlmacenamientoController.generarMapa()}"
process="@this" update=":gmap"
>
</p:commandButton>
<p:commandButton id="limpiar" icon="ui-icon-clipboard"
value="#{msg_general.lbl_limpiar}"
action="#{visualizacionSitiosAlmacenamientoController.limpiar()}"
update=":formTable:datosAlmacenamiento, :formTable:filters, :gmap"
>
</p:commandButton>
</h:panelGrid>
<p:panelGrid id="data-content" columns="1"
styleClass="m-data-content" style="min-width:100%;">
<f:facet name="header">
<h:outputText value="#{msg_armas.htbl_sitiosalmacenamiento}" />
</f:facet>
<p:dataTable id="datosAlmacenamiento" var="row"
value="#{visualizacionSitiosAlmacenamientoController.lrecord}"
rows="10" style="width: 600px;" rowKey="#{row.rowkey()}"
selectionMode="single" rowIndexVar="rowIndex">
<p:column headerText="#{msg_general.lbl_number}" width="5%">
<p:outputLabel value="#{visualizacionSitiosAlmacenamientoController.incrementarRowkey(row)}"></p:outputLabel>
</p:column>
<p:column headerText="#{msg_general.lbl_numdocsitios}" width="10%">
<h:outputText value="#{row.pk}" />
</p:column>
<p:column headerText="#{msg_general.lbl_razonsocial}" width="50px">
<h:outputText value="#{row.modifiedData['nombre']}"/>
</p:column>
<p:column headerText="#{msg_general.lbl_province}">
<h:outputText value="#{row.modifiedData['desprovincia']}"/>
</p:column>
<p:column headerText="#{msg_general.lbl_canton}">
<h:outputText value="#{row.modifiedData['descanton']}"/>
</p:column>
<p:column headerText="#{msg_general.lbl_parroquia}">
<h:outputText value="#{row.modifiedData['desparroquia']}"/>
</p:column>
<p:column headerText="#{msg_armas.lbl_latitud}" width="10%">
<h:outputText value="#{row.latitud}" />
</p:column>
<p:column headerText="#{msg_armas.lbl_longitud}" width="10%">
<h:outputText value="#{row.longitud}" />
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</p:layoutUnit>
<p:layoutUnit id="layoutMapa" position="center"
style="width:100%;height:100%">
<h:form id="gmap">
<p:growl id="growl" showDetail="true" />
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript"></script>
<p:gmap center="-1.7929665,-78.1368874" zoom="7" type="SATELITE"
style="width:100%;height:100%"
model="#{visualizacionSitiosAlmacenamientoController.simpleModel}">
<p:ajax event="markerDrag" listener="#{visualizacionSitiosAlmacenamientoController.onMarkerDrag()}" update="growl" />
</p:gmap>
</h:form>
</p:layoutUnit>
</p:layout>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 5.6.1.final using JasperReports Library version 5.6.1 -->
<!-- 2014-09-30T14:40:39 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="custodiosSubreports" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="787c8b57-b3c4-4aa5-8a0f-30aad8af4cc1">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<template><![CDATA[$P{pathstyle}]]></template>
<parameter name="pathstyle" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["repo:/maia/1/style/style"]]></defaultValueExpression>
</parameter>
<parameter name="codigoOrden" class="java.lang.String"/>
<queryString language="SQL">
<![CDATA[select grado ||' '||nombrecustodio||' '||apellidoscustidio as nombre, cedulacustodio, observaciones
from tarmordentrabajocustodios
where cordentrabajo=$P{codigoOrden}]]>
</queryString>
<field name="NOMBRE" class="java.lang.String"/>
<field name="CEDULACUSTODIO" class="java.lang.String"/>
<field name="OBSERVACIONES" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="16">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement key="" style="title2" x="2" y="0" width="200" height="16" uuid="c9e1d3a6-4b6c-4764-b65e-899278aaa657">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[GRADO Y NOMBRE PERSONAL PARTICIPANTE]]></text>
</staticText>
<staticText>
<reportElement key="" x="202" y="0" width="100" height="16" uuid="225c3fd3-69a6-4842-8229-6623e71bc8b6">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[CÉDULA]]></text>
</staticText>
<staticText>
<reportElement key="" x="302" y="0" width="250" height="16" uuid="497887b3-f7ce-4faa-b0e4-3aaabe489b79">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[OBSERVACIONES]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="13" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField isStretchWithOverflow="true">
<reportElement style="detail" stretchType="RelativeToBandHeight" x="2" y="0" width="200" height="13" forecolor="#000000" uuid="01312077-dff1-4102-ad7b-d366c24ce9a5">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{NOMBRE}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="detail" stretchType="RelativeToTallestObject" x="202" y="0" width="100" height="13" forecolor="#000000" uuid="846cab4a-8ae9-4efb-9775-37b9a6127e04">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<box leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{CEDULACUSTODIO}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="detail" stretchType="RelativeToBandHeight" x="302" y="0" width="250" height="13" forecolor="#000000" uuid="6aa3e8cf-c65a-4663-8910-df090a23233e">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<box leftPadding="2" rightPadding="2">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{OBSERVACIONES}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

View File

@ -0,0 +1,116 @@
package com.fp.frontend.controller.armas.parametros;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import org.primefaces.context.RequestContext;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.dto.query.DtoQuery;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.enums.EnumLovOption;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.pgeneral.gene.TgeneCatalog;
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetail;
/**
* Clase controladora del lov asociado al bean TgeneCatalog.
*
* @author Jorge Vaca.
* @version 2.1
*/
@ManagedBean
@ViewScoped
public class LongitudLovController extends AbstractController<TgeneCatalogDetail> {
private static final long serialVersionUID = 1L;
public LongitudLovController() throws Exception {
super(TgeneCatalogDetail.class);
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
super.startQuery();
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
this.recperpage = 15; // Cambiar al # reg a mirar.
this.lrecord = new ArrayList<>();
this.beanalias = "LONGITUDLOV";
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
@SuppressWarnings("unchecked")
@Override
protected void querydatabase() {
try {
this.getMfilters().put("pk.catalogcode", "LONGITUD");
Request request = this.callerhelper.getRequest();
DtoQuery dto = super.getDtoQuery(true);
dto.setOrderby("t.description");
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<TgeneCatalogDetail>();
MessageHelper.setMessageError(resp);
} else {
this.lrecord = (List<TgeneCatalogDetail>) resp.get(this.beanalias);
super.postQuery(this.lrecord);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
/**
* Metodo sobrecargado ejecutado al cerrar el dialogo actual
*/
public void setcatalog() {
// se utiliza en la pagina del lov.
RequestContext.getCurrentInstance().closeDialog(this.record);
}
/**
* Metodo sobrecargado ejecutado al cerrar el dialogo actual
*/
public void setcatalog(TgeneCatalogDetail tgeneCatalogDetail) {
// se utiliza en la pagina del lov.
RequestContext.getCurrentInstance().closeDialog(tgeneCatalogDetail);
}
public static void openLov(Map<String, List<String>> params) {
Map<String, Object> options = new HashMap<String, Object>();
options.put(EnumLovOption.MODAL.getLabel(), true);
options.put(EnumLovOption.HEIGHT.getLabel(), 450);
options.put(EnumLovOption.WIDTH.getLabel(), 700);
options.put(EnumLovOption.RESIZABLE.getLabel(), false);
RequestContext.getCurrentInstance().openDialog("/pages/armas/lov/longitudLov.xhtml", options, params);
}
}

View File

@ -0,0 +1,468 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.0.0.final using JasperReports Library version 6.0.0 -->
<!-- 2021-09-06T09:52:25 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="reporteArmas" printOrder="Horizontal" pageWidth="1400" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="1360" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isIgnorePagination="true" uuid="80331279-9be4-4003-ad3d-d3b8bfdf2084">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<template><![CDATA[$P{pathstyle}]]></template>
<parameter name="pathstyle" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["repo:/maia/1/style/style"]]></defaultValueExpression>
</parameter>
<parameter name="pathLogoIzquierda" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/image/comandoconjunto"]]></defaultValueExpression>
</parameter>
<parameter name="pathLogoDerecha" class="java.lang.String">
<defaultValueExpression><![CDATA["repo:/maia/1/image/selloarmas"]]></defaultValueExpression>
</parameter>
<parameter name="filtro" class="java.lang.String"/>
<parameter name="usuario" class="java.lang.String"/>
<parameter name="fechainicial" class="java.lang.String"/>
<parameter name="fechafinal" class="java.lang.String"/>
<parameter name="unidadmilitar" class="java.lang.String"/>
<parameter name="lugarfecha" class="java.lang.String"/>
<parameter name="codigoQR" class="java.lang.String"/>
<queryString language="SQL">
<![CDATA[select
tarma.lote as serie,
tarma.carma as carma,
tarma.codigoarma as codigoarma,
TO_CHAR (tarma.fecharegistro, 'YYYY-MM-DD') as fecharegistro,
(select prov.description
from tgenecountry prov
where prov.COUNTRYCODE=(select ra.paisorigen
from tarmregistroarmas ra
where ra.cregistro=tarma.cregistro)) as pais,
(select pd.name from tcustpersondetail pd
where pd.personcode= (select ra.personcode from tarmregistroarmas ra where ra.cregistro=tarma.cregistro) and
TO_CHAR (pd.dateto, 'YYYY/MM/DD')='2999/12/31' ) as nombre ,
(select t.description from tgenecatalogdetail t
where t.catalog= (select tp.clase from tarmtipoarmaexplosivo tp where tp.ctipoarmaexplosivo=tarma.ctipoarmaexplosivo) and
t.catalogcode=(select tp.CLASECODIGO from tarmtipoarmaexplosivo tp where tp.ctipoarmaexplosivo=tarma.ctipoarmaexplosivo)) as clase,
(select t.description from tgenecatalogdetail t
where t.catalog= (select tp.TIPOARMAEXPLOSIVO from tarmtipoarmaexplosivo tp where tp.ctipoarmaexplosivo=tarma.ctipoarmaexplosivo) and
t.catalogcode=(select tp.TIPOARMAEXPLOSIVOCODIGO from tarmtipoarmaexplosivo tp where tp.ctipoarmaexplosivo=tarma.ctipoarmaexplosivo)) as tipo,
(select t.description from tgenecatalogdetail t
where t.catalog= (select tp.CALIBRE from tarmtipoarmaexplosivo tp where tp.ctipoarmaexplosivo=tarma.ctipoarmaexplosivo) and
t.catalogcode=(select tp.CALIBRECODIGO from tarmtipoarmaexplosivo tp where tp.ctipoarmaexplosivo=tarma.ctipoarmaexplosivo) ) as calibre,
(select t.description from tgenecatalogdetail t where t.catalog=tarma.marca and t.catalogcode=tarma.marcacodigo ) as marca,
(select t.description from tgenecatalogdetail t where t.catalog=tarma.estado and t.catalogcode=tarma.estadocodigo ) as estado,
(select pd.identification from tcustpersondetail pd
where pd.personcode= (select ra.personcode from tarmregistroarmas ra where ra.cregistro=tarma.cregistro) and
TO_CHAR (pd.dateto, 'YYYY/MM/DD')='2999/12/31' ) as identification,
(select t.description from tgenecatalogdetail t
where t.catalog= (select tp.nombreinstitucion from tarmcentrocontrol tp
where tp.ccentrocontrol=(select doch.ccentrocontrol
from tarmdocumentohabilitante doch
where doch.cdocumento=(select max(dochb.cdocumento)
from tarmdocumentohabilitante dochb
where dochb.estado='APR' and dochb.codigoarma=tarma.codigoarma))) and
t.catalogcode=(select tp.nombreinstitucioncodigo from tarmcentrocontrol tp
where tp.ccentrocontrol=(select doch.ccentrocontrol
from tarmdocumentohabilitante doch
where doch.cdocumento=(select max(dochb.cdocumento)
from tarmdocumentohabilitante dochb
where dochb.estado='APR' and dochb.codigoarma=tarma.codigoarma))) ) as centro,
(case (select apruebaevaluacion from tarmarmapruebas p
where p.carmaprueba=(select max(prue.carmaprueba)
from tarmarmapruebas prue
where prue.carma in(select codar.carma
from tarmarmas codar
where codar.codigoarma =(select ar.codigoarma
from tarmarmas ar where carma=tarma.carma) )))
when 'Y' then 'APTA'
when 'N' then 'NO APTA'
else 'NA' end) as apta
from tarmarmas tarma
where
tarma.carma= $P{filtro}
ORDER BY tarma.estado asc]]>
</queryString>
<field name="SERIE" class="java.lang.String"/>
<field name="ESTADO" class="java.lang.String"/>
<field name="CARMA" class="java.lang.String"/>
<field name="CODIGOARMA" class="java.lang.String"/>
<field name="FECHAREGISTRO" class="java.lang.String"/>
<field name="TIPO" class="java.lang.String"/>
<field name="NOMBRE" class="java.lang.String"/>
<field name="CALIBRE" class="java.lang.String"/>
<field name="APTA" class="java.lang.String"/>
<field name="MARCA" class="java.lang.String"/>
<field name="IDENTIFICATION" class="java.lang.String"/>
<field name="CENTRO" class="java.lang.String"/>
<field name="CLASE" class="java.lang.String"/>
<field name="PAIS" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="130" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement key="" style="title1" x="385" y="30" width="399" height="20" forecolor="#000000" uuid="a5555ed3-8bce-44fd-afbb-28084239a1a1">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Center"/>
<text><![CDATA[COMANDO CONJUNTO DE LAS FUERZAS ARMADAS]]></text>
</staticText>
<staticText>
<reportElement key="" style="title1" x="385" y="50" width="399" height="20" forecolor="#000000" uuid="98c268e9-4cb8-4184-9c02-537b79b6957c">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Center"/>
<text><![CDATA[DEPARTAMENTO DE CONTROL DE ARMAS]]></text>
</staticText>
<image>
<reportElement x="285" y="30" width="100" height="59" uuid="5c1c706c-0485-4d8f-be4c-9ad18ad76225">
<property name="local_mesure_unitwidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<imageExpression><![CDATA[$P{pathLogoIzquierda}]]></imageExpression>
</image>
<staticText>
<reportElement key="" style="title2" x="385" y="89" width="399" height="41" forecolor="#000000" uuid="69253d11-5c03-4784-b9e5-03354def4161">
<property name="local_mesure_unitx" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="px"/>
</reportElement>
<textElement textAlignment="Center"/>
<text><![CDATA[Certificado creación del arma]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="20" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</band>
</pageHeader>
<columnHeader>
<band height="25" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="1131" y="0" width="101" height="25" uuid="0c2fe402-99df-42f0-b8fc-c0035e37a97f">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[ESTADO]]></text>
</staticText>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="490" y="0" width="82" height="25" uuid="fb42f3df-ffe5-40b3-9e35-8b649f014568">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[FECHA DE REGISTRO]]></text>
</staticText>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="671" y="0" width="113" height="25" uuid="b0060cce-b1af-400b-a306-82b84330d0d9">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[TIPO DE ARMA]]></text>
</staticText>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="285" y="0" width="100" height="25" uuid="82ab01d8-7adf-432e-80c0-875980851c7f">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[NOMBRE/RAZÓN SOCIAL]]></text>
</staticText>
<staticText>
<reportElement key="" style="title2" x="784" y="0" width="100" height="25" uuid="d5bc0273-94d2-4bee-a9c7-c943ce9de025">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[MARCA]]></text>
</staticText>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="884" y="0" width="57" height="25" uuid="cff51697-13fb-483e-afdd-65fe3211d15c">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[CALIBRE]]></text>
</staticText>
<staticText>
<reportElement style="title2" x="185" y="0" width="100" height="25" uuid="b5033f12-8a85-4162-b16b-5511f7ed0c34">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[NO. DOCUMENTO]]></text>
</staticText>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="941" y="0" width="100" height="25" uuid="285ca903-f9fb-4b38-8f46-8a4c30760512"/>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[SERIE]]></text>
</staticText>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="385" y="0" width="105" height="25" uuid="3be9820e-b16c-40ae-8cbd-aaaf2944b05c"/>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[CÓDIGO DEL ARMA]]></text>
</staticText>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="572" y="0" width="99" height="25" uuid="5590569f-fbb8-4189-9104-917199292b38">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[CLASE]]></text>
</staticText>
<staticText>
<reportElement style="title2" stretchType="RelativeToTallestObject" x="1041" y="0" width="90" height="25" uuid="99675834-81ae-4851-a53c-437e62d10529">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<text><![CDATA[PAÍS DE FABRICACIÓN]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="28" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" positionType="Float" x="1131" y="0" width="101" height="28" uuid="943979ab-fe95-402a-a751-1250e63f6a4f">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{ESTADO}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" positionType="Float" x="490" y="0" width="82" height="28" uuid="31ca52ac-492d-4c96-bb67-e67ac2481750">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{FECHAREGISTRO}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" positionType="Float" x="671" y="0" width="113" height="28" uuid="669f43ae-695f-4493-8f70-e968b03e0332">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{TIPO}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" positionType="Float" x="285" y="0" width="100" height="28" uuid="e170dce4-a4e7-4671-aaf6-b46530720151">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{NOMBRE}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" positionType="Float" x="884" y="0" width="57" height="28" uuid="90fb9497-6f26-4d8b-8dc5-133fe5619b0a">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{CALIBRE}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" x="941" y="0" width="100" height="28" uuid="22494ef0-f771-479c-a411-670665c1fca1">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{SERIE}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" x="784" y="0" width="100" height="28" uuid="94e2dfbf-f3ae-4fe0-90c4-80f92d4b0169">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{MARCA}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" x="185" y="0" width="100" height="28" uuid="e54d3cf1-9ae3-44cd-9a5e-bd5dff524834">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{IDENTIFICATION}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" x="385" y="0" width="105" height="28" uuid="b2e83a32-10bd-4e66-9964-50b5db052f98">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{CODIGOARMA}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" positionType="Float" x="572" y="0" width="99" height="28" uuid="26754b88-3a0f-4903-9bb9-bdeb2c564ba1">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{CLASE}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="" style="normal" positionType="Float" x="1041" y="0" width="90" height="28" uuid="49a509f4-432e-4d01-9c3e-c082518b0ef7">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textFieldExpression><![CDATA[$F{PAIS}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="89" splitType="Stretch">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement style="title3" x="703" y="11" width="81" height="28" forecolor="#000000" uuid="abbf86b2-7bd4-40b8-898c-c685d9638c9d">
<property name="local_mesure_unity" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[Usuario:]]></text>
</staticText>
<textField>
<reportElement key="" style="normal" x="784" y="11" width="283" height="28" uuid="5d3776aa-0217-4094-accb-259cecd4ffa3">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$P{usuario}]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="title3" x="185" y="11" width="100" height="28" forecolor="#000000" uuid="028f83df-9f0c-4b78-899c-88b12e410ebe">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Left"/>
<text><![CDATA[Fecha/Hora creación:]]></text>
</staticText>
<textField>
<reportElement style="normal" x="285" y="11" width="100" height="28" uuid="8d155d7b-b373-40a7-a771-9c060be0b5d9">
<property name="local_mesure_unitheight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textFieldExpression><![CDATA[$P{lugarfecha}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>

View File

@ -0,0 +1,540 @@
package com.fp.persistence.pviaticos.hra;
import java.io.Serializable;
import com.fp.dto.hb.HibernateBean;
/**
* Clase de transporte de la informacion de un empleado de la sbs, la informacion la obtiene de la vista
* HRA.VWDATOSEMPLEADOS.
*
* @author Jorge Vaca.
* @version 2.1
*/
public class Empleado extends com.fp.dto.AbstractDataTransport implements Serializable, HibernateBean, Cloneable {
private static final long serialVersionUID = 1L;
/**
* Codigo de empleado.
*/
private String codigo;
/**
* Nombre + apellido del empleado.
*/
private String nombre;
/**
* Numero de cedula del empleado.
*/
private String cedula;
/**
* Codigo de puesto del empleado.
*/
private String cargo;
/**
* Nombre de puesto del empleado.
*/
private String nombreCargo;
/**
* Entrega la dirección email asociada al empleado.
*/
private String email;
/**
* Nombre del banco en el cual tiene una cuenta el empleado.
*/
private String banco;
/**
* Tipo de cuenta bancaria del empleado.
*/
private String tipoCuenta;
/**
* Numero de cuenta que mantiene el empleado de la sbs en el banco.
*/
private String cuenta;
/**
* Codigo de area a la que pertenece el empleado.
*/
private String codigoArea;
/**
* Nombre de area a la que pertenece el empleado.
*/
private String nombreArea;
/**
* Codigo de empleado asociado al jefe del empleado.
*/
private String codigoJefe;
/**
* Nombre del jefe del empleado.
*/
private String nombreJefe;
/**
* Codigo del responsable de la unidad asociado al empleado.
*/
private String codigoResponsableUnidad;
/**
* Nombre del responsable de la unidad a la que pertecene el empleado.
*/
private String nombreResponsableUnidad;
/**
* Nombre de cargo del jefe.
*/
private String nombreCargoJefe;
/**
* Nombre de cargo responsable de la unidad.
*/
private String nombreCargoResponsableUnidad;
/**
* Codiogo de usuario web del servidor publico.
*/
private String usuarioweb;
/**
* Codiogo de usuario web del servidor publico.
*/
private String codigoLocalidad;
/**
* Estado del servidor
*/
private String estado;
/**
* Atributo localidad
*/
private String localidad;
/**
* Constructor Empleado
* @param obj
* @return
* @throws Exception
*/
public static Empleado cerar(Object[] obj) throws Exception {
Empleado e = new Empleado();
e.setCodigo((String) obj[0]);
e.setNombre((String) obj[1]);
e.setCedula((String) obj[2]);
e.setCargo((String) obj[3]);
e.setNombreCargo((String) obj[4]);
e.setEmail((String) obj[5]);
e.setBanco((String) obj[6]);
e.setTipoCuenta((String) obj[7]);
e.setCuenta((String) obj[8]);
e.setCodigoArea((String) obj[9]);
e.setNombreArea((String) obj[10]);
e.setCodigoJefe((String) obj[11]);
e.setCodigoResponsableUnidad((String) obj[12]);
e.setNombreJefe((String) obj[13]);
e.setNombreResponsableUnidad((String) obj[14]);
e.setNombreCargoJefe((String) obj[15]);
e.setNombreCargoResponsableUnidad((String) obj[16]);
e.setUsuarioweb((String) obj[17]);
e.setCodigoLocalidad((String) obj[18]);
e.setEstado((String) obj[19]);
e.setLocalidad((String) obj[20]);
return e;
}
/**
* Entrega el valor de: codigo
*
* @return String
*/
public String getCodigo() {
return codigo;
}
/**
* Fija el valor de: codigo
*
* @param codigo Valor del parametro a fijar en el atributo
*/
public void setCodigo(String codigo) {
this.codigo = codigo;
}
/**
* Entrega el valor de: nombre
*
* @return String
*/
public String getNombre() {
return nombre;
}
/**
* Fija el valor de: nombre
*
* @param nombre Valor del parametro a fijar en el atributo
*/
public void setNombre(String nombre) {
this.nombre = nombre;
}
/**
* Entrega el valor de: cedula
*
* @return String
*/
public String getCedula() {
return cedula;
}
/**
* Fija el valor de: cedula
*
* @param cedula Valor del parametro a fijar en el atributo
*/
public void setCedula(String cedula) {
this.cedula = cedula;
}
/**
* Entrega el valor de: cargo
*
* @return String
*/
public String getCargo() {
return cargo;
}
/**
* Fija el valor de: cargo
*
* @param cargo Valor del parametro a fijar en el atributo
*/
public void setCargo(String cargo) {
this.cargo = cargo;
}
/**
* Entrega el valor de: nombreCargo
*
* @return String
*/
public String getNombreCargo() {
return nombreCargo;
}
/**
* Fija el valor de: nombreCargo
*
* @param nombreCargo Valor del parametro a fijar en el atributo
*/
public void setNombreCargo(String nombreCargo) {
this.nombreCargo = nombreCargo;
}
/**
* Entrega el valor de: email
*
* @return String
*/
public String getEmail() {
return email;
}
/**
* Fija el valor de: email
*
* @param email Valor del parametro a fijar en el atributo
*/
public void setEmail(String email) {
this.email = email;
}
/**
* Entrega el valor de: banco
*
* @return String
*/
public String getBanco() {
return banco;
}
/**
* Fija el valor de: banco
*
* @param banco Valor del parametro a fijar en el atributo
*/
public void setBanco(String banco) {
this.banco = banco;
}
/**
* Entrega el valor de: tipoCuenta
*
* @return String
*/
public String getTipoCuenta() {
return tipoCuenta;
}
/**
* Fija el valor de: tipoCuenta
*
* @param tipoCuenta Valor del parametro a fijar en el atributo
*/
public void setTipoCuenta(String tipoCuenta) {
this.tipoCuenta = tipoCuenta;
}
/**
* Entrega el valor de: cuenta
*
* @return String
*/
public String getCuenta() {
return cuenta;
}
/**
* Fija el valor de: cuenta
*
* @param cuenta Valor del parametro a fijar en el atributo
*/
public void setCuenta(String cuenta) {
this.cuenta = cuenta;
}
/**
* Entrega el valor de: codigoArea
*
* @return String
*/
public String getCodigoArea() {
return codigoArea;
}
/**
* Fija el valor de: codigoArea
*
* @param codigoArea Valor del parametro a fijar en el atributo
*/
public void setCodigoArea(String codigoArea) {
this.codigoArea = codigoArea;
}
/**
* Entrega el valor de: nombreArea
*
* @return String
*/
public String getNombreArea() {
return nombreArea;
}
/**
* Fija el valor de: nombreArea
*
* @param nombreArea Valor del parametro a fijar en el atributo
*/
public void setNombreArea(String nombreArea) {
this.nombreArea = nombreArea;
}
/**
* Entrega el valor de: codigoJefe
*
* @return String
*/
public String getCodigoJefe() {
return codigoJefe;
}
/**
* Fija el valor de: codigoJefe
*
* @param codigoJefe Valor del parametro a fijar en el atributo
*/
public void setCodigoJefe(String codigoJefe) {
this.codigoJefe = codigoJefe;
}
/**
* Entrega el valor de: nombreJefe
*
* @return String
*/
public String getNombreJefe() {
return nombreJefe;
}
/**
* Fija el valor de: nombreJefe
*
* @param nombreJefe Valor del parametro a fijar en el atributo
*/
public void setNombreJefe(String nombreJefe) {
this.nombreJefe = nombreJefe;
}
/**
* Entrega el valor de: codigoResponsableUnidad
*
* @return String
*/
public String getCodigoResponsableUnidad() {
return codigoResponsableUnidad;
}
/**
* Fija el valor de: codigoResponsableUnidad
*
* @param codigoResponsableUnidad Valor del parametro a fijar en el atributo
*/
public void setCodigoResponsableUnidad(String codigoResponsableUnidad) {
this.codigoResponsableUnidad = codigoResponsableUnidad;
}
/**
* Entrega el valor de: nombreResponsableUnidad
*
* @return String
*/
public String getNombreResponsableUnidad() {
return nombreResponsableUnidad;
}
/**
* Fija el valor de: nombreResponsableUnidad
*
* @param nombreResponsableUnidad Valor del parametro a fijar en el atributo
*/
public void setNombreResponsableUnidad(String nombreResponsableUnidad) {
this.nombreResponsableUnidad = nombreResponsableUnidad;
}
/**
* Entrega el valor de: nombreCargoJefe
*
* @return String
*/
public String getNombreCargoJefe() {
return nombreCargoJefe;
}
/**
* Fija el valor de: nombreCargoJefe
*
* @param nombreCargoJefe Valor del parametro a fijar en el atributo
*/
public void setNombreCargoJefe(String nombreCargoJefe) {
this.nombreCargoJefe = nombreCargoJefe;
}
/**
* Entrega el valor de: nombreCargoResponsableUnidad
*
* @return String
*/
public String getNombreCargoResponsableUnidad() {
return nombreCargoResponsableUnidad;
}
/**
* Fija el valor de: nombreCargoResponsableUnidad
*
* @param nombreCargoResponsableUnidad Valor del parametro a fijar en el atributo
*/
public void setNombreCargoResponsableUnidad(String nombreCargoResponsableUnidad) {
this.nombreCargoResponsableUnidad = nombreCargoResponsableUnidad;
}
/**
* Entrega el valor de: usuarioweb
*
* @return String
*/
public String getUsuarioweb() {
return usuarioweb;
}
/**
* Fija el valor de: usuarioweb
*
* @param usuarioweb
*/
public void setUsuarioweb(String usuarioweb) {
this.usuarioweb = usuarioweb;
}
/**
* Entrega el valor de: codigoLocalidad
*
* @return String
*/
public String getCodigoLocalidad() {
return codigoLocalidad;
}
/**
* Fija el valor de: codigoLocalidad
*
* @param codigoLocalidad
*/
public void setCodigoLocalidad(String codigoLocalidad) {
this.codigoLocalidad = codigoLocalidad;
}
/**
* Crea una instancia de Empleado.
*/
@Override
public Object createInstance() throws Exception {
Empleado instance = new Empleado();
return instance;
}
/**
* Clona y entrega una instancia de empleado.
*/
@Override
public Object cloneMe() throws CloneNotSupportedException {
Empleado p = (Empleado) this.clone();
return p;
}
/**
* Entrega el valor del estado del empleado
* @return estado
*/
public String getEstado() {
return estado;
}
/**
* Fija el valor del estado del empleado
* @param estado
*/
public void setEstado(String estado) {
this.estado = estado;
}
/**
* Entrega el nombre localidad
* @return localidad
*/
public String getLocalidad() {
return localidad;
}
/**
* Fija el nombre localidad
* @fija localidad
*/
public void setLocalidad(String localidad) {
this.localidad = localidad;
}
}

View File

@ -0,0 +1,54 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions" template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<title>LOV: #{msg_general.lvh_table}</title>
<h:form id="formTable">
<maia:pageEvents controller="#{entityLovController}" queryProcess=":formTable:filters"
queryUpdate=":formTable:tentity" focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="9" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpk" value="#{msg_general.lbl_code}:" />
<p:inputText id="fpk" value="#{entityLovController.mfilters['pk.tname']}" maxlength="30"
style="width: 200px;" onkeyup="Maia.forceupper(event, this);">
</p:inputText>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<p:commandButton value="#{msg_general.btn_query}" update="data-content" icon="ui-icon-search"
action="#{entityLovController.query()}" process="@this, filters" />
<p:commandButton value="#{msg_general.btn_previous}" update="data-content" icon="ui-icon-seek-prev"
action="#{entityLovController.previous()}" />
<p:commandButton value="#{msg_general.btn_next}" update="data-content" icon="ui-icon-seek-next"
action="#{entityLovController.next()}" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_table}" />
</f:facet>
<p:dataTable id="tentity" var="row" value="#{entityLovController.lrecord}" rows="200"
style="min-width: 300px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single"
selection="#{entityLovController.record}">
<p:ajax event="rowSelect" listener="#{entityLovController.setentity()}" />
<p:column headerText="#{msg_general.lbl_code}" resizable="true" sortBy="#{row.pk.tname}"
style="width:70px; height:25px">
<h:outputText value="#{row.pk.tname}" />
</p:column>
<p:column rendered="false">
<p:commandButton icon="ui-icon-copy" actionListener="#{entityLovController.setentity(row)}" />
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,146 @@
package com.fp.frontend.controller.pgeneral.gene;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import org.primefaces.event.SelectEvent;
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.pgeneral.lov.CatalogLovController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.pgeneral.gene.TgeneCatalog;
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetailTest;
/**
* Clase controladora del bean TgeneCatalogDetailTest.
*
* @author Jorge Vaca.
* @version 2.1
*/
@ManagedBean
@ViewScoped
public class CatalogDetailBpmController extends AbstractController<TgeneCatalogDetailTest> {
/**
*
*/
private static final long serialVersionUID = 1L;
public CatalogDetailBpmController() throws Exception {
super(TgeneCatalogDetailTest.class);
}
@PostConstruct
private void postconstruct() {
this.init();
// Inicializa autoconsulta
super.startQuery();
}
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
this.recperpage = 15; // Cambiar al # reg a mirar.
this.lrecord = new ArrayList<>();
this.beanalias = "CATALOGDETAIL";
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
/**
* Crea una instancia de TgeneTransactionProcess y marca el registro como nuevo.
*
* @throws Exception
*/
@Override
public void create() throws Exception {
if (super.getMfilters().get("pk.catalogcode") == null) {
MessageHelper.setMessageError("msg_catalogrequird");
return;
}
super.create();
this.record.getPk().setCatalogcode(super.getMfilters().get("pk.catalogcode"));
}
@SuppressWarnings("unchecked")
@Override
protected void querydatabase() {
try {
DtoQuery dto = super.getDtoQuery(true);
dto.setOrderby("t.pk.catalog");
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(this.beanalias, dto); // permite adicionar mas de una tabla.
Request request = this.callerhelper.getRequest();
request.setQueryTables(mtables);
Response resp = this.callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
this.lrecord = new ArrayList<TgeneCatalogDetailTest>();
MessageHelper.setMessageError(resp);
} else {
this.lrecord = (List<TgeneCatalogDetailTest>) resp.get(this.beanalias);
super.postQuery(this.lrecord);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@Override
public void save() {
try {
DtoSave dtosave = super.getDtoSave();
dtosave.setReturnpk(true); // Para que el core devuelva el pk de los registros nuevos.
HashMap<String, DtoSave> msave = new HashMap<String, DtoSave>();
Request request = this.callerhelper.getRequest();
msave.put(this.beanalias, dtosave); // adicionar metadata de mantenimiento para cada tabla.
request.setSaveTables(msave);
Response resp = this.callerhelper.executeSave(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) == 0) {
this.postCommit(resp);
MessageHelper.setMessageInfo(resp);
} else {
MessageHelper.setMessageError(resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public void openCatalogLov() {
Map<String, List<String>> params = new HashMap<>();
CatalogLovController.openLov(params);
}
public void onReturnCatalogLov(SelectEvent event) throws Exception {
TgeneCatalog t = (TgeneCatalog) event.getObject();
super.addFilter("pk.catalogcode", t.getPk());
super.addField("catalogname", t.getDescription());
this.query();
}
}

View File

@ -0,0 +1,235 @@
package com.fp.armas.rules.query.webservices.util;
import java.util.List;
import javax.persistence.Query;
import com.fp.common.helper.Constant;
import com.fp.common.logger.APPLogger;
import com.fp.persistence.commondb.PersistenceHelper;
import com.fp.persistence.commondb.exception.CommondbException;
import com.fp.persistence.commondb.helper.FormatDates;
import com.fp.persistence.parmas.dto.ws.ImagenDto;
import com.fp.persistence.parmas.dto.ws.PersonaDto;
import com.fp.persistence.pcustomer.company.TcustCompany;
import com.fp.persistence.pcustomer.company.TcustCompanyKey;
import com.fp.persistence.pcustomer.gene.TcustPersonAddress;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pcustomer.people.TcustPeople;
import com.fp.persistence.pcustomer.people.TcustPeopleKey;
import com.fp.persistence.pgeneral.image.TgeneFilesDetail;
import com.fp.persistence.pgeneral.image.TgeneFilesDetailKey;
/**
* Clase utilitaria que colocar&aacute; los datos de la persona
* @author dcruz
*
*/
public class PersonaUtil {
/**
* Consulta propia de la persona
*/
private static final String QUERY_PERSONA = "SELECT o FROM TcustPersonDetail o WHERE o.pk.personcode=:personcode AND o.pk.dateto=:dateto";
private static final String QUERY_DIRECCION_PRINCIPAL="SELECT o FROM TcustPersonAddress o WHERE o.pk.personcode=:personcode AND o.pk.dateto=:dateto AND o.principal=:principal";
private static final String QUERY_PROVINCIA = "SELECT o.description FROM TgeneProvince o WHERE o.pk.countrycode=:countrycode AND o.pk.provincecode=:provincecode";
private static final String QUERY_CANTON = "SELECT o.description FROM TgeneCanton o WHERE o.pk.countrycode=:countrycode AND o.pk.provincecode=:provincecode AND o.pk.cantoncode=:cantoncode";
private static final String QUERY_PARROQUIA = "SELECT o.description FROM TgeneParroquia o WHERE o.pk.countrycode=:countrycode AND o.pk.provincecode=:provincecode AND o.pk.cantoncode=:cantoncode AND o.pk.parroquiacode=:parroquiacode";
private static final String QUERY_TELEFONO = "SELECT o.phonenumber FROM TcustPersonPhone o WHERE o.pk.personcode=:personcode AND o.addressnumber=:addressnumber";
private static PersonaUtil INSTANCIA = new PersonaUtil();
private PersonaUtil(){}
public static PersonaUtil getInstancia() {
return INSTANCIA;
}
/**
* Obtiene todos los datos de la persona a enviar en a trav&eacute;s del web service
* @param personCode
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
public PersonaDto obtenerPersonaPorId(Integer personcode, String usercode) throws Exception{
PersonaDto persona = null;
if(personcode == null){
return persona;
}
TcustPersonDetail tcustPersonDetail = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_PERSONA);
query.setParameter("personcode", personcode);
query.setParameter("dateto", FormatDates.getDefaultExpiryTimestamp());
List<TcustPersonDetail> lpersonDetail = query.getResultList();
if(lpersonDetail != null && !lpersonDetail.isEmpty()){
persona = new PersonaDto();
tcustPersonDetail = lpersonDetail.get(0);
persona.setCodigoPersona(tcustPersonDetail.getPk().getPersoncode());
persona.setCodigoUsuario(usercode);
persona.setTipoIdentificacion(tcustPersonDetail.getIdentificationcatalog());
persona.setIdentificacion(tcustPersonDetail.getIdentification());
persona.setNombre(tcustPersonDetail.getName());
persona.setRepresentanteLegal(tcustPersonDetail.getLegalrepresent());
//Obtenemos la direccion principal de la persona
TcustPersonAddress tcustPersonAddress = obtieneDireccionPrincipal(personcode);
persona.setDireccion(tcustPersonAddress.getAddress());
persona.setProvincia(obtenerProvincia(tcustPersonAddress.getProvincecode()));
persona.setCanton(obtenerCanton(tcustPersonAddress.getProvincecode(), tcustPersonAddress.getCantoncode()));
persona.setParroquia(obtenerParroquia(tcustPersonAddress.getProvincecode(), tcustPersonAddress.getCantoncode(), tcustPersonAddress.getParroquiacode()));
persona.setTelefono(obtenerNumeroTelefono(tcustPersonAddress.getPk().getPersoncode(), tcustPersonAddress.getPk().getAddressnumber()));
if(tcustPersonDetail.getMilitarygrade() != null && tcustPersonDetail.getMilitarygradecode() != null){
persona.setGrado(CatalogoUtil.getInstancia().getLegalCode(tcustPersonDetail.getMilitarygrade(), tcustPersonDetail.getMilitarygradecode()));
}
}
return persona;
}
/**
* Obtiene la direcci&oacute;n principal de la persona
* @param personcode
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
public TcustPersonAddress obtieneDireccionPrincipal(Integer personcode) throws Exception {
TcustPersonAddress tcustPersonAddress = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_DIRECCION_PRINCIPAL);
query.setParameter("personcode", personcode);
query.setParameter("dateto", FormatDates.getDefaultExpiryTimestamp());
query.setParameter("principal", Constant.STR_Y);
List<TcustPersonAddress> ltcustPersonAddresses = query.getResultList();
if(ltcustPersonAddresses != null && !ltcustPersonAddresses.isEmpty()){
tcustPersonAddress = ltcustPersonAddresses.iterator().next();
}
return tcustPersonAddress;
}
/**
* Obtiene la descripci&oacute;n de la provincia
* @param provincecode
* @return
*/
@SuppressWarnings("unchecked")
public String obtenerProvincia(String provincecode) {
String provincia = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_PROVINCIA);
query.setParameter("countrycode", "EC");
query.setParameter("provincecode", provincecode);
List<String> lprovincias = query.getResultList();
if(lprovincias != null && !lprovincias.isEmpty()){
provincia = lprovincias.iterator().next();
}
return provincia;
}
/**
* Obtiene la descripci&oacute;n del cant&oacute;n
* @param provincecode
* @param cantoncode
* @return
*/
@SuppressWarnings("unchecked")
public String obtenerCanton(String provincecode, String cantoncode) {
String canton = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_CANTON);
query.setParameter("countrycode", "EC");
query.setParameter("provincecode", provincecode);
query.setParameter("cantoncode", cantoncode);
List<String> lcanton = query.getResultList();
if(lcanton != null && !lcanton.isEmpty()){
canton = lcanton.iterator().next();
}
return canton;
}
/**
* Obtiene la descrici&oacute;n de la parroquia
* @param provincecode
* @param cantoncode
* @param parroquiacode
* @return
*/
@SuppressWarnings("unchecked")
public String obtenerParroquia(String provincecode, String cantoncode, String parroquiacode) {
String parroquia = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_PARROQUIA);
query.setParameter("countrycode", "EC");
query.setParameter("provincecode", provincecode);
query.setParameter("cantoncode", cantoncode);
query.setParameter("parroquiacode", parroquiacode);
List<String> lparroquia = query.getResultList();
if(lparroquia != null && !lparroquia.isEmpty()){
parroquia = lparroquia.iterator().next();
}
return parroquia;
}
/**
* Obtiene el tel&eacute;fono segun la direcci&oacute;n asociada
* @param personcode
* @param addressnumber
* @return
*/
@SuppressWarnings("unchecked")
public String obtenerNumeroTelefono(Integer personcode, Integer addressnumber) {
String telefono = null;
Query query = PersistenceHelper.getEntityManager().createQuery(QUERY_TELEFONO);
query.setParameter("personcode", personcode);
query.setParameter("addressnumber", addressnumber);
List<String> ltelefono = query.getResultList();
if(ltelefono != null && !ltelefono.isEmpty()){
telefono = ltelefono.iterator().next();
}
return telefono;
}
/**
* Retorna la localizaci&oacute;n de donde se encuentra la persona
* @param personcode
* @return
*/
public String obtenerLocacionPersona(Integer personcode) {
StringBuffer sb = new StringBuffer();
try {
TcustPersonAddress tcustPersonAddress = obtieneDireccionPrincipal(personcode);
sb.append(tcustPersonAddress.getProvincecode()).append(",").append(obtenerProvincia(tcustPersonAddress.getProvincecode())).append("/");
sb.append(tcustPersonAddress.getCantoncode()).append(",").append(obtenerCanton(tcustPersonAddress.getProvincecode(), tcustPersonAddress.getCantoncode())).append("/");
sb.append(tcustPersonAddress.getParroquiacode()).append(",").append(obtenerParroquia(tcustPersonAddress.getProvincecode(), tcustPersonAddress.getCantoncode(), tcustPersonAddress.getParroquiacode()));
} catch (CommondbException e) {
} catch (Exception e) {
}
return sb.toString();
}
/**
* Retorna la foto o el logo de la persona si es que esta existe
* @param personcode
* @return
*/
public ImagenDto obtenerImagen(Integer personcode) {
System.out.println("ImagenDto obtenerImagen......-----------"+personcode);
ImagenDto imagenDto = null;
TgeneFilesDetail tgeneFilesDetail = null;
try {
TcustPeople tcustPeople = TcustPeople.find(PersistenceHelper.getEntityManager(), new TcustPeopleKey(personcode, FormatDates.getDefaultExpiryTimestamp()));
if(tcustPeople != null){
tgeneFilesDetail = TgeneFilesDetail.find(PersistenceHelper.getEntityManager(), new TgeneFilesDetailKey(tcustPeople.getPhotocode(), FormatDates.getDefaultExpiryTimestamp()));
} else{
TcustCompany tcustCompany = TcustCompany.find(PersistenceHelper.getEntityManager(), new TcustCompanyKey(personcode, FormatDates.getDefaultExpiryTimestamp()));
if(tcustCompany != null){
tgeneFilesDetail = TgeneFilesDetail.find(PersistenceHelper.getEntityManager(), new TgeneFilesDetailKey(tcustCompany.getLogo(), FormatDates.getDefaultExpiryTimestamp()));
}
}
if(tgeneFilesDetail != null){
imagenDto = new ImagenDto();
imagenDto.setCodigoImagen(tgeneFilesDetail.getPk().getCode());
imagenDto.setExtension(tgeneFilesDetail.getExtension());
imagenDto.setImagen(tgeneFilesDetail.getImage());
imagenDto.setTamanioImagen(tgeneFilesDetail.getImagesize());
imagenDto.setTipoContenido(tgeneFilesDetail.getContenttype());
}
} catch (Throwable e) {
APPLogger.getLogger().error(e.getMessage(), e);
}
return imagenDto;
}
}

View File

@ -0,0 +1,183 @@
package com.fp.frontend.controller.pcustomer.lov;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import org.primefaces.context.RequestContext;
import com.fp.dto.Request;
import com.fp.dto.Response;
import com.fp.dto.query.DtoQuery;
import com.fp.dto.query.Filter;
import com.fp.frontend.controller.AbstractController;
import com.fp.frontend.controller.pgeneral.gene.ParametersController;
import com.fp.frontend.enums.EnumLovOption;
import com.fp.frontend.helper.CallerHelper;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pgeneral.gene.TgeneParameters;
/**
* Clase controladora del lov asociado al bean TsafeUserDetail.
*
* @author Jorge Vaca.
* @version 2.1
*/
@ManagedBean
@ViewScoped
public class JuridicalPersonLovController extends AbstractController<TcustPersonDetail> {
private static final long serialVersionUID = 1L;
public JuridicalPersonLovController() throws Exception {
super(TcustPersonDetail.class);
}
@PostConstruct
private void postconstruct() throws Exception {
this.init();
// Inicializa autoconsulta
super.startQuery();
}
/**
* codigo del telefono fijo
*/
private String codigoTelefonoFijo;
/**
* Incializa el controlador, cuando se esta utilizando una pagina que utliza el controlador.
*/
private void init() {
try {
this.recperpage = 15; // Cambiar al # reg a mirar.
this.lrecord = new ArrayList<>();
this.beanalias = "PERSONLOV";
codigoTelefonoFijo=codigos("CODIGO.PHONE.FIJO");
String juridica = CallerHelper.getLovParameter("isJuridical");
if(juridica!=null){
this.getMfilters().put("identificationcatalog", juridica);
this.getMfilters().put("pk.dateto", "2999-12-31");
}
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
}
public void querydatabaseFiltro(String documento) {
try {
DtoQuery dto = super.getDtoQuery(true);
dto.setOrderby("t.name");
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
Filter sql= new Filter();
sql.setSql("t.identificationcatalog='PAS' or t.identificationcatalog='RUC'");
dto.addFiltro(sql);
//super.addFilter("identificationcatalog", documento);
Request request = this.callerhelper.getRequest();
request.setQueryTables(mtables);
Response resp = this.callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
lrecord = new ArrayList<TcustPersonDetail>();
MessageHelper.setMessageError(resp);
} else {
lrecord = (List<TcustPersonDetail>) resp.get(beanalias);
if(!lrecord.isEmpty()){
record=lrecord.get(0);
}
super.postQuery(lrecord);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
@SuppressWarnings("unchecked")
@Override
protected void querydatabase() {
try {
DtoQuery dto = super.getDtoQuery(true);
dto.setOrderby("t.name");
this.getMfilters().put("pk.dateto", "2999-12-31");
addFilterDateto();
HashMap<String, DtoQuery> mtables = new HashMap<String, DtoQuery>();
mtables.put(beanalias, dto); // permite adicionar mas de una tabla.
Request request = this.callerhelper.getRequest();
request.setQueryTables(mtables);
Response resp = this.callerhelper.executeQuery(request);
if (resp.getResponseCode().compareTo(Response.RESPONSE_OK) != 0) {
lrecord = new ArrayList<TcustPersonDetail>();
MessageHelper.setMessageError(resp);
} else {
lrecord = (List<TcustPersonDetail>) resp.get(beanalias);
if(!lrecord.isEmpty()){
record=lrecord.get(0);
}
super.postQuery(lrecord);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
public void setperson() {
// se utiliza en la pagina del lov.
RequestContext.getCurrentInstance().closeDialog(this.record);
}
public void setPerson(TcustPersonDetail person) {
// se utiliza en la pagina del lov.
RequestContext.getCurrentInstance().closeDialog(person);
}
/**
* Entrega los datos vigentes de una persona dado el codigo de persona.
* @param personcode
* @return
* @throws Exception
*/
public static TcustPersonDetail find(String personcode) throws Exception{
PersonLovController p = new PersonLovController();
p.addFilter("pk.personcode", personcode);
p.querydatabase();
List<TcustPersonDetail> l = p.getLrecord();
if(!l.isEmpty()){
return l.get(0);
}
return null;
}
public static void openLov(Map<String, List<String>> params) {
Map<String, Object> options = new HashMap<String, Object>();
// hint: ver EnumLovOption para las opciones del modal
options.put(EnumLovOption.MODAL.getLabel(), true);
options.put(EnumLovOption.HEIGHT.getLabel(), 450);
options.put(EnumLovOption.WIDTH.getLabel(), 700);
options.put(EnumLovOption.RESIZABLE.getLabel(), true);
// lovpersona es el nombre de la pagina
RequestContext.getCurrentInstance().openDialog("/pages/customer/lov/juridicalLov.xhtml", options, params);
}
/**
* Metodo para obtener los codigos
*/
public String codigos(String parametro){
TgeneParameters tgeneParameters= ParametersController.find(parametro, "1");
return tgeneParameters.getTextvalue();
}
}

View File

@ -0,0 +1,174 @@
<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{rulesController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:group"
saveProcess=":formTable:group, :formTable:filters"
saveUpdate=":formTable:group, :formTable:filters"
focusContainer="formTable\\:filters" />
<p:panelGrid id="filters" columns="4" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpk" value="#{msg_bpm.lbl_code}:" />
<p:inputText id="fpk" value="#{rulesController.mfilters['pk.rulecode']}" maxlength="30" style="width: 160px;" />
<p:outputLabel for="fdesc" value="#{msg_bpm.lbl_description}:" />
<p:inputText id="fdesc" value="#{rulesController.mfilters['description']}" maxlength="60" style="width: 480px;" onkeyup="Maia.forceupper(event, this);"/>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{rulesController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:group"
createUpdate=":formGroup:pEdit"
dialogWidgetVar="dialog" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_bpm.htbl_flowsRules}" />
</f:facet>
<p:dataTable id="group" var="row" value="#{rulesController.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_bpm.lbl_code}" resizable="true" style="width:150px" sortBy="#{row.pk.rulecode}">
<h:outputText value="#{row.pk.rulecode}" />
</p:column>
<p:column headerText="#{msg_bpm.lbl_package}" resizable="true" style="width:150px" sortBy="#{row.packagename}">
<h:outputText value="#{row.packagename}" />
</p:column>
<p:column headerText="#{msg_bpm.lbl_description}" resizable="true" sortBy="#{row.description}">
<h:outputText value="#{row.description}" />
</p:column>
<p:column headerText="#{msg_bpm.lbl_path}" resizable="true" sortBy="#{row.path}">
<h:outputText value="#{row.path}" />
</p:column>
<p:column headerText="#{msg_bpm.lbl_active}" resizable="true" sortBy="#{row.active}" style="text-align: center">
<p:selectBooleanCheckbox value="#{(row.active.equals('Y'))?true:false}" disabled="true"/>
</p:column>
<p:column>
<p:commandButton value="#{msg_bpm.btn_reload}" update=":formTable:group" action="#{rulesController.refresh()}" process="@this, group" oncomplete="Maia.focus('formTable\\:idSave');">
<f:setPropertyActionListener target="#{rulesController.record}" value="#{row}" />
</p:commandButton>
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_bpm.btn_edit}" update=":formGroup:pEdit" oncomplete="PF('dialog').show();Maia.focus('formTable\\:idSave');" styleClass="m-action-button" icon="ui-icon-pencil" process="@this, group">
<f:setPropertyActionListener target="#{rulesController.record}" value="#{row}" />
<f:setPropertyActionListener target="#{rulesController.newRow}" value="#{false}" />
</p:commandButton>
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_bpm.btn_delete}" update=":formTable:group" styleClass="m-action-button" icon="ui-icon-trash" action="#{rulesController.remove()}" process="@this, group" oncomplete="Maia.focus('formTable\\:idSave');">
<f:setPropertyActionListener target="#{rulesController.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialog" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog" focus=":formGroup:rulecode">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_createoredit}" />
</f:facet>
<h:form id="formGroup">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
<h:panelGrid id="pEdit" columns="3" bodyrows="1" >
<p:outputLabel for="rulecode" value="#{msg_bpm.lbl_code}" />
<h:outputText rendered="#{!rulesController.newRow}" value="#{rulesController.record.pk.rulecode}"/>
<p:inputText id="rulecode"
rendered="#{rulesController.newRow}"
value="#{rulesController.record.pk.rulecode}"
required="true" maxlength="30"
style="width:200px;" />
<p:message for="rulecode" />
<p:outputLabel for="package" value="#{msg_bpm.lbl_package}" />
<p:inputText id="package"
value="#{rulesController.record.packagename}"
required="true" maxlength="120"
style="width:200px;" />
<p:message for="package" />
<p:outputLabel for="descripcion" value="#{msg_bpm.lbl_description}:" />
<p:inputText id="descripcion"
value="#{rulesController.record.description}"
required="true" maxlength="250"
onkeyup="Maia.forceupper(event, this);" style="width:400px;" />
<p:message for="descripcion" />
<p:outputLabel for="messagecode" value="#{msg_bpm.lbl_message}:" />
<h:panelGrid columns="4">
<p:inputText id="messagecode" value="#{rulesController.record.messagecode}" disabled="true" style="width:30px;" />
<p:inputText id="messagedesc"
value="#{rulesController.record.modifiedData['messagedesc']}"
disabled="true" maxlength="250"
onkeyup="Maia.forceupper(event, this);" style="width:250px;" />
<p:commandButton icon="ui-icon-link" actionListener="#{rulesController.openMessagesLov()}" process="@this" styleClass="m-lov-button">
<p:ajax event="dialogReturn" listener="#{rulesController.onReturnMessagesLov}" update="messagecode, messagedesc" />
</p:commandButton>
<p:commandButton icon="ui-icon-trash" actionListener="#{rulesController.removemessage()}" process="@this" styleClass="m-lov-button" update="messagecode, messagedesc">
</p:commandButton>
</h:panelGrid>
<p:message for="messagecode" />
<p:outputLabel for="parametertype" value="#{msg_bpm.lbl_type}:" />
<p:inputText id="parametertype"
value="#{rulesController.record.parametertype}"
required="true" maxlength="120"
style="width:250px;" />
<p:message for="parametertype" />
<p:outputLabel for="active" value="#{msg_bpm.lbl_active}:" />
<p:selectOneMenu id="active" value="#{rulesController.record.active}" var="p"
style="width:60px" panelStyle="width:60px" required="true">
<f:selectItems value="#{rulesController.lyesnot}" var="id"
itemLabel="#{id[1]}" itemValue="#{id[0]}" />
</p:selectOneMenu>
<p:message for="active" />
<p:outputLabel for="refresh" value="#{msg_bpm.lbl_asociation}:" />
<p:selectOneMenu id="refresh" value="#{rulesController.record.refresh}" var="p"
style="width:60px" panelStyle="width:60px" required="true">
<f:selectItems value="#{rulesController.lyesnot}" var="id"
itemLabel="#{id[1]}" itemValue="#{id[0]}" />
</p:selectOneMenu>
<p:message for="refresh" />
<p:outputLabel for="path" value="#{msg_bpm.lbl_path}:" />
<p:inputText id="path"
value="#{rulesController.record.path}"
required="true" maxlength="120"
style="width:250px;" />
<p:message for="path" />
<p:outputLabel for="filetype" value="#{msg_bpm.lbl_filetype}:" />
<p:selectOneMenu id="filetype" value="#{rulesController.record.filetype}" var="p"
style="width:100px" panelStyle="width:100px" required="true" >
<f:selectItem itemLabel="" itemValue="#{null}" />
<p:ajax listener="#{rulesController.changeFile()}" event="change"/>
<f:selectItems value="#{rulesController.lfiletype}" var="id"
itemLabel="#{id[1]}" itemValue="#{id[0]}" />
</p:selectOneMenu>
<p:message for="filetype" />
</h:panelGrid>
<h:panelGrid columns="2" styleClass="m-dialog-controls">
<maia:dialogControls controller="#{rulesController}"
process=":formGroup:pEdit"
update=":formGroup:pEdit :formTable:group"
dialogWidgetVar="dialog" />
</h:panelGrid>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>

View File

@ -0,0 +1,74 @@
/*
*
*/
package com.fp.bpmlib.query;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.Query;
import com.fp.dto.Response;
import com.fp.dto.query.QueryBean;
import com.fp.dto.query.QueryRequest;
import com.fp.dto.rules.QueryRule;
import com.fp.persistence.commondb.GeneralQuery;
import com.fp.persistence.commondb.PersistenceHelper;
// TODO: Auto-generated Javadoc
/**
* Clase que se encarga de presentar en el lov las transacciones que contiene la tabla TgeneTransactionLog.
*
* @author jarias
*/
public class TransactionsLog extends QueryRule {
/** Constante serialVersionUID. */
private static final long serialVersionUID = 1L;
/**
* Metodo que presenta la lista de transacciones en vuelo.
*
* @param qr the qr
* @return query request
* @throws Exception la exception
*/
@Override
public QueryRequest process(QueryRequest qr) throws Exception {
Response response = qr.getResponse();
QueryBean qb = (QueryBean) qr.get("TGENETRANSACTION");
StringBuilder jpql = new StringBuilder(400);
jpql.append("select t.pk.transactionmodule,t.pk.transactioncode,t.pk.transactionversion,t.name "
+ "from TgeneTransaction t where exists ( select 1 "
+ "from TgeneTransactionLog r where exists(select 1 from TbpmProcessInstance o "
+ "where o.pk = r.pk and coalesce(o.finalized, 'N')='N') and t.pk.transactionmodule=r.transactionmodule "
+ "and t.pk.transactioncode=r.transactioncode and t.pk.transactionversion=r.transactionversion ) ");
Map<String, Object> criteria = new HashMap<String, Object>();
GeneralQuery.addParameters(qb, jpql, criteria);
Query qry = PersistenceHelper.getEntityManager().createQuery(jpql.toString());
GeneralQuery.setParameters(qb, criteria, qry);
List<?> ltransaction = qry.getResultList();
List<Map<String, Object>> detailgrid = new ArrayList<Map<String, Object>>();
for (int i = 0; i < ltransaction.size(); i++) {
Map<String, Object> detail = new HashMap<String, Object>();
Object[] datos = (Object[]) ltransaction.get(i);
detail.put("pk_transactionmodule", datos[0]);
detail.put("pk_transactioncode", datos[1]);
detail.put("pk_transactionversion", datos[2]);
detail.put("name", datos[3]);
detailgrid.add(detail);
}
if (ltransaction.isEmpty()) {
Map<String, Object> detail = new HashMap<String, Object>();
detail.put("pk_transactionmodule", "");
detail.put("pk_transactioncode", "");
detail.put("pk_transactionversion", "");
detail.put("name", "");
detailgrid.add(detail);
}
response.put("TGENETRANSACTION", detailgrid);
return qr;
}
}

Some files were not shown because too many files have changed in this diff Show More