mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-882 Sort results
This commit is contained in:
@ -25,6 +25,7 @@ package com.kingsrook.qqq.backend.core.processes.implementations.sharing;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -144,7 +145,7 @@ public class GetSharedRecordsProcess implements BackendStep, MetaDataProducerInt
|
|||||||
boolean foundAudienceType = false;
|
boolean foundAudienceType = false;
|
||||||
for(ShareableAudienceType audienceType : shareableTableMetaData.getAudienceTypes().values())
|
for(ShareableAudienceType audienceType : shareableTableMetaData.getAudienceTypes().values())
|
||||||
{
|
{
|
||||||
Serializable audienceId = record.getValueString(audienceType.getFieldName());
|
Serializable audienceId = record.getValue(audienceType.getFieldName());
|
||||||
if(audienceId != null)
|
if(audienceId != null)
|
||||||
{
|
{
|
||||||
outputRecord.setValue("audienceType", audienceType.getName());
|
outputRecord.setValue("audienceType", audienceType.getName());
|
||||||
@ -228,6 +229,11 @@ public class GetSharedRecordsProcess implements BackendStep, MetaDataProducerInt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////
|
||||||
|
// sort results by labels //
|
||||||
|
////////////////////////////
|
||||||
|
resultList.sort(Comparator.comparing(r -> r.getValueString("audienceLabel")));
|
||||||
|
|
||||||
runBackendStepOutput.addValue("resultList", resultList);
|
runBackendStepOutput.addValue("resultList", resultList);
|
||||||
}
|
}
|
||||||
catch(QException qe)
|
catch(QException qe)
|
||||||
|
Reference in New Issue
Block a user