Correccion fecha abs

This commit is contained in:
cruales 2022-12-21 11:09:56 -05:00
parent f1c8d617e4
commit 2c0aae0c7c
117 changed files with 203 additions and 80 deletions

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:24 ECT 2022
#Wed Dec 21 09:05:10 ECT 2022
version=2.1
groupId=com.fp.base.bpm
artifactId=bpmlib

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:19 ECT 2022
#Wed Dec 21 09:05:04 ECT 2022
version=2.1
groupId=com.fp.base.bpm
artifactId=simple

View File

@ -49,7 +49,7 @@ public class VerificarArmaQuery extends QueryRule {
//Filtro por estados, fecha, enBodega
bufferFiltro.append("select t.* from tarmdecomisoarma t join tarmdecomiso td on t.cdecomiso = td.cdecomiso join tarmarmas ta on t.carma = ta.carma "
+ "where t.fdecomiso <= TO_DATE('"+fechacorte+"','yyyy-mm-dd') and abs(TO_DATE('"+fechacorte+"','yyyy-mm-dd') - t.fdecomiso)>= "+codigoDiasDecomiso);
+ "where t.fdecomiso <= TO_DATE('"+fechacorte+"','yyyy-mm-dd') and abs(TO_DATE('"+fechacorte+"','yyyy-mm-dd') - to_date(to_char(t.fdecomiso,'yyyy-mm-dd'),'yyyy-mm-dd'))>= "+codigoDiasDecomiso);
bufferFiltro.append(" and (t.estado='"+codigoDecomiso+"' or t.estado='"+codigoIncautacion+"' or t.estado='"+codigoEntVol+"' or t.estado='"+codigoAbandono+"' or t.estado='"+codigoReclamo+"') and t.enbodega= 'Y'");

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:44 ECT 2022
#Wed Dec 21 09:05:31 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=armas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:38 ECT 2022
#Wed Dec 21 09:05:24 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=general

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:40 ECT 2022
#Wed Dec 21 09:05:26 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=log

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:35 ECT 2022
#Wed Dec 21 09:05:21 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=person

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:39 ECT 2022
#Wed Dec 21 09:05:25 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=report

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:42 ECT 2022
#Wed Dec 21 09:05:28 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=viaticos

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:32 ECT 2022
#Wed Dec 21 09:05:18 ECT 2022
version=2.1
groupId=com.fp.base.core
artifactId=alfresco-client

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:20 ECT 2022
#Wed Dec 21 09:05:06 ECT 2022
version=2.1
groupId=com.fp.base.core
artifactId=bpm

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:31 ECT 2022
#Wed Dec 21 09:05:17 ECT 2022
version=2.1
groupId=com.fp.base.core
artifactId=firmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:06 ECT 2022
#Wed Dec 21 09:04:49 ECT 2022
version=2.1
groupId=com.fp.base.dto
artifactId=common

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:04 ECT 2022
#Wed Dec 21 09:04:47 ECT 2022
version=2.1
groupId=com.fp.base.dto
artifactId=dto

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:46 ECT 2022
#Wed Dec 21 09:05:33 ECT 2022
version=2.1
groupId=com.fp.base
artifactId=facade

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:45 ECT 2022
#Wed Dec 21 09:05:32 ECT 2022
version=2.1
groupId=com.fp.base
artifactId=facadeclient

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:14 ECT 2022
#Wed Dec 21 09:04:59 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=commondb

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:30 ECT 2022
#Wed Dec 21 09:05:16 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=parmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:07 ECT 2022
#Wed Dec 21 09:04:51 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pbpm

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:17 ECT 2022
#Wed Dec 21 09:05:02 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pcustomer

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:27 ECT 2022
#Wed Dec 21 09:05:13 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pfirmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:12 ECT 2022
#Wed Dec 21 09:04:57 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pgeneral

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:25 ECT 2022
#Wed Dec 21 09:05:11 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=plog

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:26 ECT 2022
#Wed Dec 21 09:05:13 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pviaticos

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:18 ECT 2022
#Wed Dec 21 09:05:03 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=util

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:33 ECT 2022
#Wed Dec 21 09:05:19 ECT 2022
version=2.1
groupId=com.fp.base
artifactId=sessionbeans

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:47 ECT 2022
#Wed Dec 21 09:05:33 ECT 2022
version=2.1
groupId=com.fp.clients.maia
artifactId=maiaear

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Wed Dec 14 14:28:47 ECT 2022
#Wed Dec 21 09:05:33 ECT 2022
version=2.1
groupId=com.fp.clients.maia
artifactId=environment-eap6

View File

@ -1127,7 +1127,9 @@ public class DocumentoHabilitanteController extends
return null;
}
}
/**
* BUSCAR PERMISOS A PUNTO DE CADUCARSE
*/
public static List<TarmDocumentoHabilitante> findpersoncode(String personcode, String categoria) {
try {
DocumentoHabilitanteController cc = new DocumentoHabilitanteController();
@ -1204,6 +1206,7 @@ public class DocumentoHabilitanteController extends
return null;
}
}
/**
* Metodo que busca los documentos habilitantes por persona cercano a fecha de expiracion
* @param personCode
@ -1219,8 +1222,7 @@ public class DocumentoHabilitanteController extends
cc.addFilter("estado", "APR");
// FILTROS: tipoautorizacion='1' --> 1 AUTORIZACION
// FILTROS: tra.categoria='8' --> 8 IMPORTADOR
cc.getMfilelds().put("fechafiltro",String.format("extract(day from (t.fechaexpiracion - now())) <= %s and extract(day from (t.fechaexpiracion - now()))>=0", numeroDias) );
cc.getMfilelds().put("fechafiltro",String.format("t.fechaexpiracion is not null AND ((t.fechaexpiracion -current_date) between 0 and %s) and t.pathSuspencion is null", numeroDias));
cc.querybasesimle();
if (cc.lrecord != null) {
return cc.lrecord;
@ -1360,6 +1362,7 @@ public class DocumentoHabilitanteController extends
}
}
public static List<TarmDocumentoHabilitante> findByPersonCode(Integer personcode) {
try {
DocumentoHabilitanteController cc = new DocumentoHabilitanteController();

View File

@ -19,9 +19,17 @@ 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.controller.armas.solicitud.DocumentoHabilitanteController;
import com.fp.frontend.controller.pcustomer.PersonDetailController;
import com.fp.frontend.controller.pgeneral.gene.ParametersController;
import com.fp.frontend.helper.MessageHelper;
import com.fp.persistence.parmas.soli.TarmDocumentoHabilitante;
import com.fp.persistence.pbpm.gene.TbpmGroupsUsers;
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
import com.fp.persistence.pgeneral.gene.TgeneParameters;
import com.fp.persistence.pgeneral.log.TgeneTransactionLog;
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
import org.primefaces.context.RequestContext;
/**
* Clase que muestra
@ -78,6 +86,8 @@ public class InboxController extends AbstractController<TgeneTransactionLog> {
try {
beanGroupsName = "BPMGROUPS";
this.listGroups();
alertarPermisosCaducarse(); //alerta para permisos prontos a caducarse
} catch (Exception e) {
MessageHelper.setMessageError(e);
}
@ -558,5 +568,52 @@ public class InboxController extends AbstractController<TgeneTransactionLog> {
fc.getExternalContext().invalidateSession();
}
}
/**
================== METODOS DE ALERTAS ==================
*/
/**
* PERMISOS PROXIMOS A CADUCARSE
*/
private void alertarPermisosCaducarse(){
TcustPersonDetail personaSesion = buscarPersonaSesion();
if(personaSesion != null){
TgeneParameters param = ParametersController.find("DIASPREVIOSCADUCAR", "1");
int numeroDias = param != null ? param.getNumbervalue().intValue() : 5;
List<TarmDocumentoHabilitante>lstDocs = DocumentoHabilitanteController.findByPersonCercaCaducarse(personaSesion.getPk().getPersoncode().toString(),numeroDias+"");
if(lstDocs != null && !lstDocs.isEmpty()){
for (TarmDocumentoHabilitante doc : lstDocs) {
String mensaje = param != null ?
String.format(param.getTextvalue(), doc.getNumerodocumento(),doc.getFechacambioexpiracion()) :
String.format("Su permiso asociado a %s esta a punto de caducar en la fecha %s", doc.getNumerodocumento(),doc.getFechaexpiracion());
System.out.println("Mensaje: "+mensaje);
MessageHelper.setMessageInfo(mensaje);
RequestContext.getCurrentInstance().execute("PF('advicesDialog').show()");
}
}
}
}
/**
* OBTENER PERSONA DE USUARIO LOGEADO
*/
private TcustPersonDetail buscarPersonaSesion(){
TcustPersonDetail person = null;
try {
TsafeUserDetail tsafeUserDetail = (TsafeUserDetail) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
person = PersonDetailController.find(tsafeUserDetail.getPk().getPersoncode().toString());
} catch (Exception e) {
MessageHelper.setMessageError(String.format("Verifique que el usuario este asociado a una persona: %s", e.getMessage()));
}
return person;
}
}

View File

@ -123,5 +123,6 @@ public class TerminosCondicionesController extends AbstractController<TarmTermin
return null;
}
}
}

View File

@ -121,7 +121,7 @@ public class TransactionProcessController extends AbstractController<TgeneTransa
// subqueries 1
SubQuery subquery1 = new SubQuery("TgeneMessageTemplates", "description", "messagedesc",
"i.pk = t.flowmessagecode");
"i.pk = cast(t.flowmessagecode as int)");
dto.addSubQuery(subquery1);
// subqueries 2

View File

@ -29,9 +29,12 @@ import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
import com.fp.persistence.pgeneral.safe.TsafeUserProfile;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.faces.application.NavigationHandler;
@ -59,7 +62,8 @@ public class LoginController {
private String profilecode;
private String rutaTerminos;
private StreamedContent content;
private boolean alertaInicio = Boolean.FALSE;
@PostConstruct
private void postconstruct() {
this.request = new Request();
@ -86,6 +90,7 @@ public class LoginController {
Response resp = ch.login(this.request, user, pass);
TarmTerminos terminos = TerminosCondicionesController.findxIdentificacion(user);
if ((resp.getResponseCode().compareTo("0") == 0) && (terminos == null)) {
System.out.println("terminos");
try {
this.rutaTerminos = ParametersController.find("CODIGO.TERMINOS.COND", "1").getTextvalue();
@ -227,6 +232,7 @@ public class LoginController {
this.changepassword = userdetail.getChangepassword();
this.lprofile = ((List) userdetail.get("lprofile"));
this.request.setProfile(((TsafeUserProfile) this.lprofile.get(0)).getPk().getProfilecode());
}
private void obtenerCentroControl(TsafeUserDetail userdetail) {
@ -270,11 +276,12 @@ public class LoginController {
public void changeprofile()
throws Exception {
try {
if (this.profilecode != null) {
this.request.setProfile(this.profilecode);
//generarAlertaArmas();
alertarPermisosCaducarse();
}
CallerHelper ch = new CallerHelper();
Response resp = ch.menu(this.request);
if (resp.getResponseCode().compareTo("0") == 0) {
@ -284,10 +291,14 @@ public class LoginController {
} else {
MessageHelper.setMessageError(resp);
}
} catch (Throwable e) {
MessageHelper.setMessageError(e);
}
}
/**
* GENERA ALERTA DE MAXIMO DE ARMAS
* unicamente en el perfil de CLIENTE
@ -295,9 +306,7 @@ public class LoginController {
private void generarAlertaArmas(){
if(profilecode != null && profilecode.equals("24")){
TsafeUserDetail tsafeUserDetail = (TsafeUserDetail) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
TcustPersonDetail persona = PersonDetailController.find(tsafeUserDetail.getPk().getPersoncode().toString());
List <TarmSolicitud> lstSolicitudes = SolicitudController.findSolicitudxPersona(tsafeUserDetail.getPk().getPersoncode().toString());
List <TarmSolicitud> lstSolicitudes = SolicitudController.findSolicitudxPersona(buscarPersonaSesion().getPk().getPersoncode().toString());
if(lstSolicitudes != null && !lstSolicitudes.isEmpty()){
for (TarmSolicitud sol : lstSolicitudes) {
validarArmas(sol);
@ -314,8 +323,16 @@ public class LoginController {
TarmTramite tramite = TarmTramiteController.findSimple(solicitud.getCtramite().toString());
int maxArmas = tramite.getNumeromaxarmas() != null ? tramite.getNumeromaxarmas().intValue() : 0;
List<TarmDocumentoHabilitante>lstDocs = DocumentoHabilitanteController.findByCsolicitud(solicitud.getPk(),"APR");
int narmas = lstDocs != null ? lstDocs.size() : 0;
int narmas = 0;
if(lstDocs != null && !lstDocs.isEmpty()){
String[] armas = new String[lstDocs.size()];
for (int i = 0; i < lstDocs.size(); i++) {
armas[i]=lstDocs.get(i).getCarma();
}
narmas = eliminarDuplicados(armas).size();
}
if(tramite.getNumeromaxarmas() != null && narmas > maxArmas){
MessageHelper.setMessageWarn(String.format("La solicitud %s posee %s armas registradas, Máximas permitidas %s", solicitud.getNumerosolicitud(),narmas, maxArmas));
}
@ -323,29 +340,35 @@ public class LoginController {
}
/**
* PERMISOS PROXIMOS A CADUCARSE
* Eliminar elementos duplicados jdk7
*/
private void alertarPermisosCaducarse(){
if(profilecode != null && profilecode.equals("24")){
TsafeUserDetail tsafeUserDetail = (TsafeUserDetail) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
if(tsafeUserDetail != null){
TgeneParameters param = ParametersController.find("DIASPREVIOSCADUCAR", "1");
int numeroDias = param != null ? param.getNumbervalue().intValue() : 5;
List<TarmDocumentoHabilitante>lstDocs = DocumentoHabilitanteController.findByPersonCercaCaducarse(tsafeUserDetail.getPk().getPersoncode().toString(),numeroDias+"");
if(lstDocs != null && !lstDocs.isEmpty()){
for (TarmDocumentoHabilitante doc : lstDocs) {
String mensaje = param != null ?
String.format(param.getTextvalue(), doc.getPk().intValue(),doc.getFechacambioexpiracion()) :
String.format("Su permiso código %s esta a punto de caducar en la fecha %s", doc.getPk().intValue(),doc.getFechacambioexpiracion());
MessageHelper.setMessageWarn(mensaje);
}
}
}
}
public static List<String> eliminarDuplicados(String[] arreglo){
List<String> arregloLista = Arrays.asList(arreglo);
Set<String> hashSet = new HashSet<String>(arregloLista);
arregloLista.clear();
arregloLista.addAll(hashSet);
return arregloLista;
}
/**
* OBTENER PERSONA DE USUARIO LOGEADO
*/
private TcustPersonDetail buscarPersonaSesion(){
TcustPersonDetail person = null;
try {
TsafeUserDetail tsafeUserDetail = (TsafeUserDetail) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("TSAFEUSERDETAIL");
person = PersonDetailController.find(tsafeUserDetail.getPk().getPersoncode().toString());
} catch (Exception e) {
MessageHelper.setMessageError(String.format("Verifique que el usuario este asociado a una persona: %s", e.getMessage()));
}
return person;
}
private void fillCompanies() {
try {
CallerHelper ch = new CallerHelper();
@ -562,4 +585,15 @@ public class LoginController {
public void setContent(StreamedContent content) {
this.content = content;
}
public boolean isAlertaInicio() {
return alertaInicio;
}
public void setAlertaInicio(boolean alertaInicio) {
this.alertaInicio = alertaInicio;
}
}

View File

@ -14,6 +14,7 @@
$(document).ready(function() {
top.showTimer(#{request.session.maxInactiveInterval}*1000);
});
/** INTENTAMOS MOSTRAR LA ALERTA*/
</script>
@ -33,7 +34,7 @@
closable="false">
<p:graphicImage value="/resources/images/ajaxloadingbar.gif" />
</p:dialog>
<!--p:dialog autosized="true" widgetVar="popupTimeout" closable="false"
modal="true" draggable="false" closeOnEscape="false"
resizable="false" header="Sesi&#243;n expirada">

View File

@ -7,7 +7,8 @@
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">
template="/WEB-INF/templates/template.xhtml"
>
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{armasController}"

View File

@ -6,5 +6,8 @@
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml">
<ui:define name="content"></ui:define>
<ui:define name="content">
</ui:define>
</ui:composition>

View File

@ -309,7 +309,12 @@
<ui:include src="/pages/security/_changepasswordExpired.xhtml" />
</h:form>
</p:dialog>
<p:dialog closable="true" widgetVar="advicesDialog"
modal="true" draggable="true" closeOnEscape="true"
resizable="false" header="Aviso">
<p:messages id="messagesError" autoUpdate="true" globalOnly="true"/>
</p:dialog>
<p:dialog autosized="true" widgetVar="popupTimeout" closable="false"
modal="true" draggable="false" closeOnEscape="false"
resizable="false" header="Sesi&#243;n expirada">

View File

@ -36,17 +36,21 @@ var Maiaworkspace = {
if(k===13 || k === 1){
key = jmodule.val()+"-"+jtransaction.val()+"-1";
if(jmodule.val() && jtransaction.val()){
var transaction = this.menuTransactionMap[key];
if(transaction==null){
tranMsgDialog.show();
}else{
this.loadPage(this.menuTransactionMap[key]["url"], this.menuTransactionMap[key]["name"], null);
}
var transaction = this.menuTransactionMap[key];
if(transaction === null){
$("#tranMsgDialog").show();
}else{
this.loadPage(this.menuTransactionMap[key]["url"], this.menuTransactionMap[key]["name"], null);
}
$("#transactionMenuPanel").hide();
jmodule.val("");
jtransaction.val("");
}
}
return false;
},
loadPageFromTransactionKey: function(key, params){
@ -61,7 +65,7 @@ var Maiaworkspace = {
other.focus();
}
return false;
},
},
getContext: function(){
var dieccion = window.location.pathname.split("/");
return dieccion[1];

Binary file not shown.

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