Correccion de problemas con subida de deposito, agregamos url alfresco y jasper test
This commit is contained in:
parent
096735ceeb
commit
38f93e0bf4
|
|
@ -39,7 +39,7 @@ public class EstadoSolicitudQuery extends QueryRule{
|
|||
sql.append(" and d.value like '%"+codigosolicitud+"%' ");
|
||||
}
|
||||
|
||||
sql.append( " order by ta.CREATED ");
|
||||
sql.append(" order by ta.CREATED ");
|
||||
|
||||
System.out.println("SQL_ESTADOS_SOLICITUDBPM: "+sql);
|
||||
List<Object[]> listaVariables=PersistenceHelper.getEntityManager().
|
||||
|
|
|
|||
|
|
@ -46,25 +46,25 @@ public class TaskCleaner {
|
|||
* @throws Exception la exception
|
||||
*/
|
||||
private void deleteTask(long pTask) throws Exception {
|
||||
Query q = this.em.createNativeQuery("delete from PeopleAssignments_PotOwners where task_id= :tid");
|
||||
Query q = this.em.createNativeQuery("delete from jbpm6.PeopleAssignments_PotOwners where task_id= :tid");
|
||||
q.setParameter(TaskCleaner.TID, pTask);
|
||||
q.executeUpdate();
|
||||
q = this.em.createNativeQuery("delete from I18NText where Task_Names_Id= :tid or Task_Subjects_Id= :tid or Task_Descriptions_Id= :tid ");
|
||||
q = this.em.createNativeQuery("delete from jbpm6.I18NText where Task_Names_Id= :tid or Task_Subjects_Id= :tid or Task_Descriptions_Id= :tid ");
|
||||
q.setParameter(TaskCleaner.TID, pTask);
|
||||
q.executeUpdate();
|
||||
q = this.em.createNativeQuery("delete from task_comment where TaskData_Comments_Id= :tid");
|
||||
q = this.em.createNativeQuery("delete from jbpm6.task_comment where TaskData_Comments_Id= :tid");
|
||||
q.setParameter(TaskCleaner.TID, pTask);
|
||||
q.executeUpdate();
|
||||
q = this.em.createNativeQuery("delete from PeopleAssignments_BAs where task_id= :tid");
|
||||
q = this.em.createNativeQuery("delete from jbpm6.PeopleAssignments_BAs where task_id= :tid");
|
||||
q.setParameter(TaskCleaner.TID, pTask);
|
||||
q.executeUpdate();
|
||||
q = this.em.createNativeQuery("delete from Content where id in (select DOCUMENTCONTENTID from Task where id=:tid)");
|
||||
q = this.em.createNativeQuery("delete from jbpm6.Content where id in (select DOCUMENTCONTENTID from jbpm6.Task where id=:tid)");
|
||||
q.setParameter(TaskCleaner.TID, pTask);
|
||||
q.executeUpdate();
|
||||
q = this.em.createNativeQuery("delete from Content where id in (select outputcontentid from Task where id=:tid)");
|
||||
q = this.em.createNativeQuery("delete from jbpm6.Content where id in (select outputcontentid from jbpm6.Task where id=:tid)");
|
||||
q.setParameter(TaskCleaner.TID, pTask);
|
||||
q.executeUpdate();
|
||||
q = this.em.createNativeQuery("delete from Task where id = :tid ");
|
||||
q = this.em.createNativeQuery("delete from jbpm6.Task where id = :tid ");
|
||||
q.setParameter(TaskCleaner.TID, pTask);
|
||||
q.executeUpdate();
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ public class TaskCleaner {
|
|||
public void deleteTasks() throws Exception {
|
||||
try {
|
||||
Query q = this.em
|
||||
.createNativeQuery("select id from Task t where not exists( select 1 from processinstanceinfo p where p.instanceid = t.processinstanceid)");
|
||||
.createNativeQuery("select id from jbpm6.Task t where not exists( select 1 from jbpm6.processinstanceinfo p where p.instanceid = t.processinstanceid)");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<BigDecimal> l = q.getResultList();
|
||||
for (BigDecimal id : l) {
|
||||
|
|
@ -88,7 +88,7 @@ public class TaskCleaner {
|
|||
APPLogger.getLogger().error(e);
|
||||
} finally {
|
||||
if (em.isOpen()) {
|
||||
// em.close();
|
||||
//em.close();
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:48 ECT 2022
|
||||
#Wed Nov 30 16:44:14 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.bpm
|
||||
artifactId=bpmlib
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:42 ECT 2022
|
||||
#Wed Nov 30 16:44:09 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.bpm
|
||||
artifactId=simple
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -324,7 +324,7 @@ public class ScheduleXMLSolicitud {
|
|||
return TgeneParameters.find(entityManager, new TgeneParametersKey(code, 1));
|
||||
}
|
||||
|
||||
@Schedule( hour = "*",second = "0", minute = "1,10,20,30,40,50", persistent = false)
|
||||
@Schedule( dayOfWeek = "4", hour = "10",second = "0", minute = "1", persistent = false)
|
||||
public void generarXMLs() {
|
||||
try {
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class DocumentoHabilitanteDatos extends TransactionRule {
|
|||
List<TarmSolicitud> ltarmSolicitud = query.getResultList();
|
||||
if ( ltarmSolicitud != null && !ltarmSolicitud.isEmpty() ) {
|
||||
TarmSolicitud tarmSolicitud = ltarmSolicitud.iterator().next();
|
||||
Query queryDoc = PersistenceHelper.createQuery("SELECT o FROM TarmDocumentoHabilitante o WHERE o.csolicitud=:csolicitud ");
|
||||
Query queryDoc = PersistenceHelper.createQuery("SELECT o FROM TarmDocumentoHabilitante o WHERE o.csolicitud=:csolicitud");
|
||||
queryDoc.setParameter("csolicitud", tarmSolicitud.getPk());
|
||||
List<TarmDocumentoHabilitante> documentoHabilitantes = queryDoc.getResultList();
|
||||
if(documentoHabilitantes != null && !documentoHabilitantes.isEmpty()){
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:10 ECT 2022
|
||||
#Wed Nov 30 16:44:34 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.business
|
||||
artifactId=armas
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:04 ECT 2022
|
||||
#Wed Nov 30 16:44:28 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.business
|
||||
artifactId=general
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:06 ECT 2022
|
||||
#Wed Nov 30 16:44:30 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.business
|
||||
artifactId=log
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:01 ECT 2022
|
||||
#Wed Nov 30 16:44:25 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.business
|
||||
artifactId=person
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:05 ECT 2022
|
||||
#Wed Nov 30 16:44:29 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.business
|
||||
artifactId=report
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:07 ECT 2022
|
||||
#Wed Nov 30 16:44:31 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.business
|
||||
artifactId=viaticos
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,7 +1,8 @@
|
|||
#Configuracion APP
|
||||
api.user=jasperadmin
|
||||
api.password=jasperadmin
|
||||
api.uri.base=http://172.17.26.75:8081/alfresco/service
|
||||
api.user=admin
|
||||
api.password=admin
|
||||
#api.uri.base=http://172.17.26.184:8080/alfresco/service
|
||||
api.url.base=http://172.17.26.91:8082/alfresco/service
|
||||
api.uri.delete.general=/slingshot/doclib/action/file/node/
|
||||
#Directorio base para las consultas
|
||||
api.doclocation.base=/app:company_home/st:sites/cm:{0}/cm:documentLibrary
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,7 +1,8 @@
|
|||
#Configuracion APP
|
||||
api.user=jasperadmin
|
||||
api.password=jasperadmin
|
||||
api.uri.base=http://172.17.26.75:8081/alfresco/service
|
||||
api.user=admin
|
||||
api.password=admin
|
||||
#api.uri.base=http://172.17.26.184:8080/alfresco/service
|
||||
api.url.base=http://172.17.26.91:8082/alfresco/service
|
||||
api.uri.delete.general=/slingshot/doclib/action/file/node/
|
||||
#Directorio base para las consultas
|
||||
api.doclocation.base=/app:company_home/st:sites/cm:{0}/cm:documentLibrary
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:57 ECT 2022
|
||||
#Wed Nov 30 16:44:23 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.core
|
||||
artifactId=alfresco-client
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:44 ECT 2022
|
||||
#Wed Nov 30 16:44:11 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.core
|
||||
artifactId=bpm
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:56 ECT 2022
|
||||
#Wed Nov 30 16:44:21 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.core
|
||||
artifactId=firmas
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:29 ECT 2022
|
||||
#Wed Nov 30 16:43:57 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.dto
|
||||
artifactId=common
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:27 ECT 2022
|
||||
#Wed Nov 30 16:43:54 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.dto
|
||||
artifactId=dto
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:12 ECT 2022
|
||||
#Wed Nov 30 16:44:36 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base
|
||||
artifactId=facade
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:11 ECT 2022
|
||||
#Wed Nov 30 16:44:35 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base
|
||||
artifactId=facadeclient
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:38 ECT 2022
|
||||
#Wed Nov 30 16:44:05 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=commondb
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:54 ECT 2022
|
||||
#Wed Nov 30 16:44:20 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=parmas
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:31 ECT 2022
|
||||
#Wed Nov 30 16:43:58 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=pbpm
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:40 ECT 2022
|
||||
#Wed Nov 30 16:44:07 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=pcustomer
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:51 ECT 2022
|
||||
#Wed Nov 30 16:44:17 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=pfirmas
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:36 ECT 2022
|
||||
#Wed Nov 30 16:44:03 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=pgeneral
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:49 ECT 2022
|
||||
#Wed Nov 30 16:44:15 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=plog
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:50 ECT 2022
|
||||
#Wed Nov 30 16:44:17 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=pviaticos
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:41 ECT 2022
|
||||
#Wed Nov 30 16:44:08 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base.persistence
|
||||
artifactId=util
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:32:58 ECT 2022
|
||||
#Wed Nov 30 16:44:24 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.base
|
||||
artifactId=sessionbeans
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:12 ECT 2022
|
||||
#Wed Nov 30 16:44:36 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.clients.maia
|
||||
artifactId=maiaear
|
||||
|
|
|
|||
|
|
@ -64,16 +64,9 @@
|
|||
<property name="hibernate.default_schema" value="jbpm6"/>
|
||||
<property name="hibernate.show_sql" value="true"/>
|
||||
<property name="hibernate.format_sql" value="true"/>
|
||||
<property name="hibernate.max_fetch_depth" value="3" />
|
||||
<property name="hibernate.connection.autocommit" value="false"/>
|
||||
<property name="hibernate.max_fetch_depth" value="3" />
|
||||
<!-- TRANSACTION FOR JBOSS -->
|
||||
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
|
||||
<property name="hibernate.id.new_generator_mappings" value="false" />
|
||||
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
|
||||
|
|
|
|||
|
|
@ -64,16 +64,9 @@
|
|||
<property name="hibernate.default_schema" value="jbpm6"/>
|
||||
<property name="hibernate.show_sql" value="true"/>
|
||||
<property name="hibernate.format_sql" value="true"/>
|
||||
<property name="hibernate.max_fetch_depth" value="3" />
|
||||
<property name="hibernate.connection.autocommit" value="false"/>
|
||||
<property name="hibernate.max_fetch_depth" value="3" />
|
||||
<!-- TRANSACTION FOR JBOSS -->
|
||||
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
|
||||
<property name="hibernate.id.new_generator_mappings" value="false" />
|
||||
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven
|
||||
#Fri Nov 25 15:33:12 ECT 2022
|
||||
#Wed Nov 30 16:44:36 ECT 2022
|
||||
version=2.1
|
||||
groupId=com.fp.clients.maia
|
||||
artifactId=environment-eap6
|
||||
|
|
|
|||
|
|
@ -159,7 +159,6 @@ public class CargarDepositoController extends AbstractController<TarmSolicitudTr
|
|||
if (record != null && record.getPk().getCsolicitud() != null) {
|
||||
csolicitud = record.getPk().getCsolicitud();
|
||||
// csolicitud=csolicitud.replace("TRA","SOL");
|
||||
|
||||
try {
|
||||
if (record != null) {
|
||||
solicitud = SolicitudArmasController.findByCSolicitud(csolicitud);
|
||||
|
|
@ -180,8 +179,8 @@ public class CargarDepositoController extends AbstractController<TarmSolicitudTr
|
|||
} else {
|
||||
MessageHelper.setMessageError(MsgControlArmas.getProperty("msg_error_tramiteSinDatosAsociados"));
|
||||
}
|
||||
|
||||
Date fechaLimiteDate = TgeneNotAccountingDayController.diasLaborablesPreviosAUnaFecha(new Date(), diasLaborablesPermitidos);
|
||||
|
||||
Calendar fechaLimite = Calendar.getInstance();
|
||||
fechaLimite.setTime(fechaLimiteDate);
|
||||
fechaLimite.set(Calendar.HOUR_OF_DAY, 0);
|
||||
|
|
@ -236,7 +235,8 @@ public class CargarDepositoController extends AbstractController<TarmSolicitudTr
|
|||
this.recperpage = 500;
|
||||
this.beanalias = "CARGARDEPOSITO";
|
||||
isDenied = true;
|
||||
diasLaborablesPermitidos = Integer.parseInt(ParametersController.find("DIASDEPOSITO", "1").getNumbervalue().toString());
|
||||
diasLaborablesPermitidos = ParametersController.find("DIASDEPOSITO", "1").getNumbervalue().intValue();
|
||||
|
||||
isTrueNComprobante = Boolean.TRUE;
|
||||
isOnlyMsj = false;
|
||||
isEnableGrabar = Boolean.TRUE;
|
||||
|
|
|
|||
|
|
@ -1204,7 +1204,33 @@ public class DocumentoHabilitanteController extends
|
|||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Metodo que busca los documentos habilitantes por persona cercano a fecha de expiracion
|
||||
* @param personCode
|
||||
* @param numeroDias
|
||||
* @return
|
||||
*/
|
||||
public static List<TarmDocumentoHabilitante> findByPersonCercaCaducarse(String personCode, String numeroDias){
|
||||
try {
|
||||
DocumentoHabilitanteController cc = new DocumentoHabilitanteController();
|
||||
cc.init();
|
||||
cc.recperpage = 5000;
|
||||
cc.addFilter("personcode", personCode);
|
||||
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.querybasesimle();
|
||||
if (cc.lrecord != null) {
|
||||
return cc.lrecord;
|
||||
}
|
||||
return null;
|
||||
} catch (Throwable e) {
|
||||
MessageHelper.setMessageError(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Metodo que busca los documentos habilitantes por persona para registro de
|
||||
* importaciones
|
||||
|
|
@ -1221,7 +1247,7 @@ public class DocumentoHabilitanteController extends
|
|||
cc.addFilter("estado", "APR");
|
||||
// FILTROS: tipoautorizacion='1' --> 1 AUTORIZACION
|
||||
// FILTROS: tra.categoria='8' --> 8 IMPORTADOR
|
||||
cc.getMfilelds().put("fechafiltro", "t.fechaexpiracion >=to_date(now(),'dd/MM/yyyy') and"
|
||||
cc.getMfilelds().put("fechafiltro", "t.fechaexpiracion >= now() and"
|
||||
+ " ctramite in (select tra.pk from TarmTramite tra where tra.categoria='8' and tipoautorizacion='1')");
|
||||
|
||||
cc.querybasesimle();
|
||||
|
|
@ -1310,6 +1336,30 @@ public class DocumentoHabilitanteController extends
|
|||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* BUSCAR DOCUMENTOS POR ESTADO Y HABILES
|
||||
*/
|
||||
public static List<TarmDocumentoHabilitante> findByCsolicitud(String csolicitud, String estado) {
|
||||
try {
|
||||
DocumentoHabilitanteController cc = new DocumentoHabilitanteController();
|
||||
cc.init();
|
||||
cc.recperpage = 5000;
|
||||
cc.addFilter("csolicitud", csolicitud);
|
||||
if(estado!= null && !estado.trim().equals("")){
|
||||
cc.addFilter("estado", estado);
|
||||
}
|
||||
cc.getMfilelds().put("fechafiltro","t.fechaexpiracion >= now() and t.pathSuspencion is null and t.carma is not null");
|
||||
// cc.querydocumhabsusp();
|
||||
if (cc.lrecord != null) {
|
||||
return cc.lrecord;
|
||||
}
|
||||
return null;
|
||||
} catch (Throwable e) {
|
||||
MessageHelper.setMessageError(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<TarmDocumentoHabilitante> findByPersonCode(Integer personcode) {
|
||||
try {
|
||||
DocumentoHabilitanteController cc = new DocumentoHabilitanteController();
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@ import com.fp.dto.Response;
|
|||
import com.fp.dto.query.DtoQuery;
|
||||
import com.fp.frontend.controller.alfresco.AlfrescoController;
|
||||
import com.fp.frontend.controller.armas.parametros.CentroControlArmasController;
|
||||
import com.fp.frontend.controller.armas.solicitud.DocumentoHabilitanteController;
|
||||
import com.fp.frontend.controller.armas.solicitud.SolicitudController;
|
||||
import com.fp.frontend.controller.armas.solicitud.TarmTramiteController;
|
||||
import com.fp.frontend.controller.armas.solicitud.TramiteArmasController;
|
||||
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.controller.pgeneral.gene.TerminosCondicionesController;
|
||||
|
|
@ -13,7 +18,11 @@ import com.fp.frontend.helper.MessageHelper;
|
|||
import com.fp.frontend.utility.EnumParametros;
|
||||
import com.fp.persistence.commondb.exception.CommondbException;
|
||||
import com.fp.persistence.parmas.param.TarmCentroControl;
|
||||
import com.fp.persistence.parmas.param.TarmTramite;
|
||||
import com.fp.persistence.parmas.soli.TarmDocumentoHabilitante;
|
||||
import com.fp.persistence.parmas.soli.TarmSolicitud;
|
||||
import com.fp.persistence.parmas.soli.TarmTerminos;
|
||||
import com.fp.persistence.pcustomer.gene.TcustPersonDetail;
|
||||
import com.fp.persistence.pgeneral.gene.TgeneCatalogDetail;
|
||||
import com.fp.persistence.pgeneral.gene.TgeneParameters;
|
||||
import com.fp.persistence.pgeneral.safe.TsafeUserDetail;
|
||||
|
|
@ -266,6 +275,8 @@ public class LoginController {
|
|||
try {
|
||||
if (this.profilecode != null) {
|
||||
this.request.setProfile(this.profilecode);
|
||||
//generarAlertaArmas();
|
||||
alertarPermisosCaducarse();
|
||||
}
|
||||
CallerHelper ch = new CallerHelper();
|
||||
Response resp = ch.menu(this.request);
|
||||
|
|
@ -280,7 +291,64 @@ public class LoginController {
|
|||
MessageHelper.setMessageError(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* GENERA ALERTA DE MAXIMO DE ARMAS
|
||||
* unicamente en el perfil de CLIENTE
|
||||
*/
|
||||
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());
|
||||
if(lstSolicitudes != null && !lstSolicitudes.isEmpty()){
|
||||
for (TarmSolicitud sol : lstSolicitudes) {
|
||||
validarArmas(sol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* VALIDA ARMAS POR SOLICITUD
|
||||
* que no posea mas armas que las que el tipo de tramite lo tiene permitido
|
||||
*/
|
||||
private void validarArmas(TarmSolicitud solicitud){
|
||||
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;
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* PERMISOS PROXIMOS A CADUCARSE
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCompanies() {
|
||||
try {
|
||||
CallerHelper ch = new CallerHelper();
|
||||
|
|
|
|||
|
|
@ -138,6 +138,17 @@ public class MessageHelper {
|
|||
public static void setMessageWarn(Response response) {
|
||||
MessageHelper.setMessage(response, FacesMessage.SEVERITY_WARN);
|
||||
}
|
||||
|
||||
public static void setMessageWarn(String message){
|
||||
try {
|
||||
FacesMessage fm = new FacesMessage();
|
||||
fm.setSummary(message);
|
||||
fm.setSeverity(FacesMessage.SEVERITY_WARN);
|
||||
FacesContext.getCurrentInstance().addMessage(null, fm);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manejo de mensaje de error cuando en el core una transaccion no finaliza
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#http\://172.17.26.185\:8084/jasperserver/services/repository
|
||||
#produccion
|
||||
jasperserver.repository=http\://172.17.26.75\:8081/jasperserver/services/repository
|
||||
jasperserver.reportScheduler=http\://172.17.26.182\:8081/jasperserver/services/ReportScheduler
|
||||
jasperserver.reportScheduler=http\://172.17.26.75\:8081/jasperserver/services/ReportScheduler
|
||||
#desarrollo
|
||||
#jasperserver.repository=http\://172.17.26.185\:8084/jasperserver/services/repository
|
||||
#jasperserver.reportScheduler=http\://172.17.26.185\:8084/jasperserver/services/ReportScheduler
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue