Skip to content

Commit

Permalink
fix: Get AD_QueueType only active record.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Sep 20, 2024
1 parent 7ef0791 commit 1752102
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions base/src/org/spin/queue/model/MADQueueType.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ public static MADQueueType getByQueueType(Properties ctx, String queueType, Stri
if (definition != null && definition.get_ID() > 0 )
return definition;

definition = new Query(ctx, Table_Name , COLUMNNAME_QueueType + "=? AND AD_Client_ID IN(0, ?)", trxName)
.setParameters(queueType, clientId)
.setOrderBy(COLUMNNAME_AD_Client_ID + " DESC")
.first();
definition = new Query(ctx, Table_Name , COLUMNNAME_QueueType + "=? AND AD_Client_ID IN(0, ?)", trxName)
.setParameters(queueType, clientId)
.setOnlyActiveRecords(true)
.setOrderBy(COLUMNNAME_AD_Client_ID + " DESC")
.first()
;

if (definition != null && definition.get_ID() > 0) {
queueTypeCacheValues.put(key, definition);
Expand All @@ -120,9 +122,11 @@ public static List<MADQueueType> getAll(Properties ctx, boolean resetCache, Stri
List<MADQueueType> definitionList;
if (resetCache || queueTypeCacheIds.size() > 0 ) {
definitionList = new Query(Env.getCtx(), Table_Name, null , trxName)
.setClient_ID()
.setOrderBy(COLUMNNAME_Name)
.list();
.setClient_ID()
.setOnlyActiveRecords(true)
.setOrderBy(COLUMNNAME_Value)
.list()
;
definitionList.stream().forEach(definition -> {
int clientId = Env.getAD_Client_ID(ctx);
String key = clientId + "#" + definition.getValue();
Expand Down

0 comments on commit 1752102

Please sign in to comment.