arreglar reporte estadisticas tramite

This commit is contained in:
cruales 2023-02-01 10:46:05 -05:00
parent a2cc63287e
commit 3fcf909bf5
112 changed files with 182 additions and 89 deletions

View File

@ -80,7 +80,14 @@ public class TransactionList extends QueryRule {
htc.close();
}
}
/**
* METODO PARA OBTENER EL TIPO DE AUTORIZACION CON LOGSOLICITUDE
*/
/**
* Prepara la lista de Tareas.
*
@ -89,12 +96,17 @@ public class TransactionList extends QueryRule {
@SuppressWarnings("unchecked")
private void addTransactionList(String language) throws Exception {
List<Object[]> t = htc.getUnfinishedTasksByUser(request.getUser());
Task task = null;
TaskUtil tu = null;
TransactionDTO tr = null;
Integer count = null;
Map<String, Object> mtran = null;
for (Object[] obj : t) {
Task task = (Task) obj[0];
TaskUtil tu = new TaskUtil(task, htc);
task = (Task) obj[0];
tu = new TaskUtil(task, htc);
TransactionDTO tr = tu.getTransaction();
Integer count = trn.get(tr.toString());
tr= tu.getTransaction();
count = trn.get(tr.toString());
if (count == null) {
count = 1;
} else {
@ -102,7 +114,7 @@ public class TransactionList extends QueryRule {
}
trn.put(tr.toString(), count);
Map<String, Object> mtran = (Map<String, Object>) mtransaux.get(tr.toString());
mtran = (Map<String, Object>) mtransaux.get(tr.toString());
if (mtran == null) {
mtran = this.addTransactionData(tu);
mtransaux.put(tr.toString(), mtran);
@ -117,13 +129,20 @@ public class TransactionList extends QueryRule {
@SuppressWarnings({ "unchecked", "unused", "rawtypes" })
private void addTransactionList(String language, String codSolicitud) throws Exception {
List<Object[]> t = htc.getUnfinishedTasksByUser(request.getUser());
Task task ;
Content c;
TaskUtil tu;
TransactionDTO tr ;
String codS ;
Integer count;
Map<String, Object> mtran;
for (Object[] obj : t) {
Task task = (Task) obj[0];
Content c = (Content) obj[1];
TaskUtil tu = new TaskUtil(task, htc);
task = (Task) obj[0];
c = (Content) obj[1];
tu = new TaskUtil(task, htc);
((SaveRequest)(((Map)tu.getActualData().get("maia")).get("request"))).get("csolicitud");
TransactionDTO tr = tu.getTransaction();
tr = tu.getTransaction();
if(tu.getActualData().get("maia") instanceof Map<?, ?>)
{
if(((Map)tu.getActualData().get("maia")).get("request") != null)
@ -132,7 +151,7 @@ public class TransactionList extends QueryRule {
{
Object csolicitud = ((SaveRequest)(((Map)tu.getActualData().get("maia")).get("request"))).get("csolicitud");
if(csolicitud!=null){
String codS = csolicitud.toString();
codS = csolicitud.toString();
if(!codS.equals(codSolicitud))
{
continue;
@ -142,7 +161,7 @@ public class TransactionList extends QueryRule {
}
}
Integer count = trn.get(tr.toString());
count = trn.get(tr.toString());
if (count == null) {
count = 1;
} else {
@ -150,7 +169,7 @@ public class TransactionList extends QueryRule {
}
trn.put(tr.toString(), count);
Map<String, Object> mtran = (Map<String, Object>) mtransaux.get(tr.toString());
mtran = (Map<String, Object>) mtransaux.get(tr.toString());
if (mtran == null) {
mtran = this.addTransactionData(tu);
mtransaux.put(tr.toString(), mtran);
@ -161,6 +180,7 @@ public class TransactionList extends QueryRule {
TransactionTasks.addTask(mtran, tu, language);
}
}
private Map<String, Object> addTransactionData(TaskUtil tu) throws Exception {
Map<String, Object> rec = new HashMap<String, Object>();

View File

@ -89,5 +89,7 @@ public class TransactionTasks extends QueryRule {
TaskDetail.addTaskDetail(rec, taskUtil, language);
ltasks.add(rec);
}
}

View File

@ -41,10 +41,15 @@ public class AsignedTasks extends QueryRule {
try {
List<Object[]> t = htc.getAsignedTasks(pQueryRequest.getString("userCri"));
List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
Task task;
TaskUtil tu;
Map<String, Object> rec;
List<Map<String, Object>> data1;
for (Object[] obj : t) {
Task task = (Task) obj[0];
TaskUtil tu = new TaskUtil(task, htc);
Map<String, Object> rec = new HashMap<String, Object>();
task = (Task) obj[0];
tu = new TaskUtil(task, htc);
rec = new HashMap<String, Object>();
rec.put("tid", tu.getTid());
rec.put("workItem", task.getTaskData().getWorkItemId());
rec.put("detail", tu.getSubject());
@ -52,7 +57,7 @@ public class AsignedTasks extends QueryRule {
rec.put("nameasigned", GeneralDescriptions.getOfficername(task.getTaskData().getActualOwner().getId()));
rec.put("logsolicitude", tu.getRequest().get("logsolicitude"));
rec.put("rulename", task.getName());
List<Map<String, Object>> data1 = ProcessUtil.getInstance().transactionData(tu.getRequest().getJournalId(), pQueryRequest, false);
data1 = ProcessUtil.getInstance().transactionData(tu.getRequest().getJournalId(), pQueryRequest, false);
for (Map<String, Object> map : data1) {
rec.put((String) map.get("NAME"), map.get("VALUE"));
}

View File

@ -423,10 +423,13 @@ public class HumanTaskClient {
List<TaskSummary> list;
try {
list = taskService.getTasksOwnedByStatus(pUserCri, lestatus, "en-UK");
Object o[] = null;
Task task = null;
Content c = null;
for (TaskSummary obj : list) {
Object o[] = new Object[2];
Task task = this.getTaskById(obj.getId());
Content c = this.getContentById(task.getTaskData().getDocumentContentId());
o = new Object[2];
task = this.getTaskById(obj.getId());
c = this.getContentById(task.getTaskData().getDocumentContentId());
o[0] = task;
o[1] = c;
lresp.add(o);
@ -453,10 +456,13 @@ public class HumanTaskClient {
List<TaskSummary> list = new ArrayList<>();
try {
list = taskService.getTasksOwnedByStatus(pUserId, lestatus, "en-UK");
Object o[];
Task task;
Content c;
for (TaskSummary obj : list) {
Object o[] = new Object[2];
Task task = this.getTaskById(obj.getId());
Content c = this.getContentById(task.getTaskData().getDocumentContentId());
o = new Object[2];
task = this.getTaskById(obj.getId());
c = this.getContentById(task.getTaskData().getDocumentContentId());
o[0] = task;
o[1] = c;
lresp.add(o);
@ -509,8 +515,9 @@ public class HumanTaskClient {
* JPQL JPQL_TASK_NOT_COMPLETEBYGROUP
*/
private static final String TAREAS_GRUPO = "select t, potentialOwners.id from TaskImpl t, OrganizationalEntityImpl potentialOwners "
+ "where potentialOwners.id = :groupIds and potentialOwners in elements ( t.peopleAssignments.potentialOwners ) and t.archived = 0 "
+ "and t.taskData.actualOwner = null and t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended')";
+ "where potentialOwners.id = :groupIds and potentialOwners in elements ( t.peopleAssignments.potentialOwners) and t.archived = 0 "
+ "and t.taskData.actualOwner = null and t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') "
+ "order by t.id desc";
/**
* Obtiene el valor de unfinished tasks por Grupo.
@ -528,7 +535,6 @@ public class HumanTaskClient {
em = PersistenceManager.getInstance().getEntityManagerFactoryAuxiliar("org.jbpm.domain").createEntityManager();
Query qry = em.createQuery(HumanTaskClient.TAREAS_GRUPO);
//Query qry = em.createNativeQuery(TAREAS_GRUPO_NATIVO);
System.out.println("GROUPS IDS "+pGroupId);
qry.setParameter("groupIds", pGroupId);
ldatos = qry.getResultList();
} catch (Exception e) {

View File

@ -473,4 +473,7 @@ public class TaskUtil {
}
return mdata;
}
}

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:56 ECT 2023
#Wed Feb 01 10:42:16 ECT 2023
version=2.1
groupId=com.fp.base.bpm
artifactId=bpmlib

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:51 ECT 2023
#Wed Feb 01 10:42:11 ECT 2023
version=2.1
groupId=com.fp.base.bpm
artifactId=simple

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:17 ECT 2023
#Wed Feb 01 10:42:37 ECT 2023
version=2.1
groupId=com.fp.base.business
artifactId=armas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:10 ECT 2023
#Wed Feb 01 10:42:30 ECT 2023
version=2.1
groupId=com.fp.base.business
artifactId=general

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:12 ECT 2023
#Wed Feb 01 10:42:32 ECT 2023
version=2.1
groupId=com.fp.base.business
artifactId=log

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:07 ECT 2023
#Wed Feb 01 10:42:28 ECT 2023
version=2.1
groupId=com.fp.base.business
artifactId=person

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:11 ECT 2023
#Wed Feb 01 10:42:31 ECT 2023
version=2.1
groupId=com.fp.base.business
artifactId=report

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:14 ECT 2023
#Wed Feb 01 10:42:34 ECT 2023
version=2.1
groupId=com.fp.base.business
artifactId=viaticos

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:04 ECT 2023
#Wed Feb 01 10:42:25 ECT 2023
version=2.1
groupId=com.fp.base.core
artifactId=alfresco-client

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:52 ECT 2023
#Wed Feb 01 10:42:13 ECT 2023
version=2.1
groupId=com.fp.base.core
artifactId=bpm

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:03 ECT 2023
#Wed Feb 01 10:42:24 ECT 2023
version=2.1
groupId=com.fp.base.core
artifactId=firmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:38 ECT 2023
#Wed Feb 01 10:41:58 ECT 2023
version=2.1
groupId=com.fp.base.dto
artifactId=common

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:36 ECT 2023
#Wed Feb 01 10:41:56 ECT 2023
version=2.1
groupId=com.fp.base.dto
artifactId=dto

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:20 ECT 2023
#Wed Feb 01 10:42:39 ECT 2023
version=2.1
groupId=com.fp.base
artifactId=facade

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:18 ECT 2023
#Wed Feb 01 10:42:38 ECT 2023
version=2.1
groupId=com.fp.base
artifactId=facadeclient

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:46 ECT 2023
#Wed Feb 01 10:42:07 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=commondb

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:02 ECT 2023
#Wed Feb 01 10:42:22 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=parmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:40 ECT 2023
#Wed Feb 01 10:42:00 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=pbpm

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:49 ECT 2023
#Wed Feb 01 10:42:09 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=pcustomer

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:59 ECT 2023
#Wed Feb 01 10:42:20 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=pfirmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:45 ECT 2023
#Wed Feb 01 10:42:05 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=pgeneral

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:57 ECT 2023
#Wed Feb 01 10:42:17 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=plog

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:58 ECT 2023
#Wed Feb 01 10:42:19 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=pviaticos

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:40:50 ECT 2023
#Wed Feb 01 10:42:10 ECT 2023
version=2.1
groupId=com.fp.base.persistence
artifactId=util

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:05 ECT 2023
#Wed Feb 01 10:42:26 ECT 2023
version=2.1
groupId=com.fp.base
artifactId=sessionbeans

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:20 ECT 2023
#Wed Feb 01 10:42:39 ECT 2023
version=2.1
groupId=com.fp.clients.maia
artifactId=maiaear

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon Jan 30 15:41:20 ECT 2023
#Wed Feb 01 10:42:39 ECT 2023
version=2.1
groupId=com.fp.clients.maia
artifactId=environment-eap6

View File

@ -1412,6 +1412,7 @@ private String descategoria;
*/
public void onReturnCambioUsuario(SelectEvent event) {
nuevoPropietarioArma = (TcustPersonDetail) event.getObject();
}
/**
@ -1527,7 +1528,33 @@ private String descategoria;
return null;
}
}
/**
* Buscar armas por carma
* Usado para buscar armas provinientes de solicitudArmas
*
* @param carma
* @return
*/
public static List<TarmArmas> findxCarma(String carma) {
try {
ArmasController cc = new ArmasController();
cc.init();
cc.recperpage = 1000;
cc.addFilter("carma", carma);
cc.querydatabaseFechaMax();
if ((cc.lrecord != null) && !cc.lrecord.isEmpty()) {
return cc.lrecord;
}
return null;
} catch (Throwable e) {
MessageHelper.setMessageError(e);
return null;
}
}
/**
* Metodo para obtener el listado de las armas por la lote
*
@ -2329,8 +2356,9 @@ private String descategoria;
numeroDocumento = personaDetailSelecionada.getIdentification();
filtroPersona = " and t.cregistro in (select i.pk from TarmRegistroArmas i where i.personcode ="
+ personaDetailSelecionada.getPk().getPersoncode() + ")";
querydatabase();
obtenerArmas(personaDetailSelecionada);
}
/**
@ -2378,25 +2406,41 @@ private String descategoria;
}
/**
*ALERTA NUMERO DE ARMAS POR NUMERO DE SOLICITUD
* @param persona
*/
public void obtenerArmas(){
List<TarmSolicitud> lSolicitud = SolicitudController.findSolicitudxPersona(nuevoPropietarioArma.getPk().getPersoncode().toString());
TarmTramite tramite = null;
Integer numMaxArmas = null;
List<TarmSolicitudArmas> lstSolicitudArmas = null;
public void obtenerArmas(TcustPersonDetail persona){
List<TarmSolicitud> lSolicitud = SolicitudController.findSolicitudxPersona(persona.getPk().getPersoncode().toString() );
TarmTramite tramite;
TarmDocumentoHabilitante documentoHabilitante;
Integer numMaxArmas;
int numArmas;
List<TarmArmas> lArmasSolicitud ;
List<TarmSolicitudArmas> lstSolicitudArmas;
String alerta = "Número de armas en la solicitud %s de la persona %s, %s de %s permitidas";
for (TarmSolicitud tarmSolicitud : lSolicitud) {
tramite = TarmTramiteController.findSimple(tarmSolicitud.getCtramite().toString());
if(tramite.getNumeromaxarmas() != null){
numMaxArmas = tramite.getNumeromaxarmas().intValue();
lstSolicitudArmas = TarmSolicitudArmasController.findPorCSolicitud(longitud);
if(lstSolicitudArmas!= null && !lstSolicitudArmas.isEmpty()){
for (TarmSolicitudArmas lstSolicitudArma : lstSolicitudArmas) {
numArmas = 0;
documentoHabilitante = DocumentoHabilitanteController.findPorSolicitud(tarmSolicitud.getPk());
if(!tarmSolicitud.getEstado().startsWith("ANU") &&
(documentoHabilitante != null && documentoHabilitante.getEstado().equals("APR") && documentoHabilitante.getFechaexpiracion().after(fechaActual) )){
tramite = TarmTramiteController.findSimple(tarmSolicitud.getCtramite().toString());
if(tramite.getNumeromaxarmas() != null){
numMaxArmas = tramite.getNumeromaxarmas().intValue();
lstSolicitudArmas = TarmSolicitudArmasController.findPorCSolicitud(longitud);
if(lstSolicitudArmas!= null && !lstSolicitudArmas.isEmpty()){
for (TarmSolicitudArmas solicitudArma : lstSolicitudArmas) {
lArmasSolicitud = ArmasController.findxCarma(solicitudArma.getPk().getCarma());
if(lArmasSolicitud!=null && !lArmasSolicitud.isEmpty()){
numArmas += lArmasSolicitud.size();
}
}
if(numArmas >= numMaxArmas){
MessageHelper.setMessageWarn(String.format(alerta, tarmSolicitud.getNumerosolicitud(),persona.getName(),numArmas, numMaxArmas));
}
}
}
}
}
}

View File

@ -160,8 +160,16 @@ public class ReporteEstadisticasTramitesController extends AbstractController<Ab
parameters.put("unidadmilitar", institucionCentroControl);
parameters.put("lugarFecha", Utilidades.armarFormatoFechaConHora(fechaActualCldr));
parameters.put("usuario", nombreUsuario);
parameters.put("idCentroControl", "TODOS".equalsIgnoreCase(idCentroControl) ? null : idCentroControl);
parameters.put("idAutorizacion", "TODOS".equalsIgnoreCase(idAutorizacion) ? null : idAutorizacion);
if(!idCentroControl.equals("TODOS")){
//parameters.put("filtro1",String.format("and h.ccentrocontrol = '%s'", idCentroControl) );
parameters.put("idCentroControl", idCentroControl);
}
if(!idAutorizacion.equals("TODOS")){
//parameters.put("filtro2",String.format("and a.tipoautorizacion = '%s' ", idAutorizacion) );
parameters.put("idAutorizacion", idAutorizacion);
}
//parameters.put("idCentroControl", "TODOS".equalsIgnoreCase(idCentroControl) ? null : idCentroControl);
//parameters.put("idAutorizacion", "TODOS".equalsIgnoreCase(idAutorizacion) ? null : idAutorizacion);
parameters.put("fechaInicio", this.fechaInicio == null ? null : Utilidades.armarFormatoFechaSinHora(this.fechaInicio));
parameters.put("fechaFin", this.fechaFin == null ? null : Utilidades.armarFormatoFechaSinHora(this.fechaFin));

View File

@ -186,16 +186,18 @@ public class InboxController extends AbstractController<TgeneTransactionLog> {
} else {
//Manipular la respuesta de transacciones 'No conozco la base del jbpm'
List<Map<String, Object>> lstAux = (List<Map<String, Object>>) resp.get("transactions");
List<Map<String, Object>> lTasks = null;
List<Map<String, Object>> lTasks;
Map<String,Object> mapaPadre;
Map<String, Object> lTask;
for (int i = 0; i < lstAux.size(); i++) {
Map<String,Object> mapaPadre = lstAux.get(i);
mapaPadre = lstAux.get(i);
lTasks =(List<Map<String, Object>>) mapaPadre.get("tasks");
if(lTasks !=null){
for (int j = 0; j < lTasks.size(); j++) {
logSolicitude = lTasks.get(j).get("logsolicitude").toString();
tipoAutorizacion = verificarTipoAutorizacion(logSolicitude, solicitud, tramite, tipoAutorizacionAux);
Map<String, Object> lTask = (Map<String, Object>) lTasks.get(j);
lTask = (Map<String, Object>) lTasks.get(j);
lTask.put("tipoAutorizacion", tipoAutorizacion);
lTasks.set(j, lTask);
}
@ -240,10 +242,13 @@ public class InboxController extends AbstractController<TgeneTransactionLog> {
return tipoAutorizacion;
}
private void fillTransactions(List<Map<String, Object>> lTransactions, boolean isGroup) {
String tModule;
Integer tCode;
Integer tVersion;
for (Map<String, Object> map : lTransactions) {
String tModule = (String) map.get("m");
Integer tCode = (Integer) map.get("t");
Integer tVersion = (Integer) map.get("v");
tModule = (String) map.get("m");
tCode = (Integer) map.get("t");
tVersion = (Integer) map.get("v");
this.fillTasks(map, tModule, tCode, tVersion, isGroup);
}
}
@ -276,8 +281,8 @@ public class InboxController extends AbstractController<TgeneTransactionLog> {
/**
* BUSCANDO EL TIPO AUTORIZACION
*/
String logSolicitude = null;
String tipoAutorizacion = null;
String logSolicitude;
String tipoAutorizacion;
TarmSolicitud solicitud= null;
TarmTramite tramite = null;
String tipoAutorizacionAux = null;
@ -308,11 +313,7 @@ public class InboxController extends AbstractController<TgeneTransactionLog> {
MessageHelper.setMessageError(resp);
} else {
Map<String, Object> param = (Map<String, Object>) resp.get("param");
for (Map.Entry<String, Object> entry : mapTask.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
}
param.put("TID", mapTask.get("tid"));
param.put("KIND", resp.get("k"));
mapTask.put("taskDetail", resp);
@ -415,10 +416,14 @@ public class InboxController extends AbstractController<TgeneTransactionLog> {
}
private Map<String, Object> getTransactionMap(List<Map<String, Object>> lTransactions, String tModule, Integer tCode, Integer tVersion) {
String module = null;
Integer transaction = null;
Integer version = null;
for (Map<String, Object> map : lTransactions) {
String module = (String) map.get("m");
Integer transaction = (Integer) map.get("t");
Integer version = (Integer) map.get("v");
module = (String) map.get("m");
transaction = (Integer) map.get("t");
version = (Integer) map.get("v");
if ((tModule.compareTo(module) == 0) && (tCode.compareTo(transaction) == 0) && (tVersion.compareTo(version) == 0)) {
return map;

View File

@ -341,7 +341,7 @@ public class LoginController {
MessageHelper.setMessageInfo(String.format("Documento %s, perteneciente a %s expira el %s.",doc.getNumerodocumento(), personaPermiso.getName(), doc.getFechaexpiracion()));
}
//RequestContext.getCurrentInstance().execute("PF('advicesDialog').show()");
RequestContext.getCurrentInstance().execute("PF('advicesDialog').show()");
}
}
}

Binary file not shown.

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