问题
In field in a table I have a comma separated list of order IDs that I am splitting like this:
<#list alerts.AD_ID_LIST1?split(r'\s*,\s*', 'r') as idString>
What I need to do now is cross-reference each ID with another table to see if it exists in that table and that the ORDER_STATUS field does not have a value of deleted.
Then I need to output the new list of IDs with the missing and deleted order IDs removed so that I can loop through them based on their index. Can anyone give me an idea how to do this ? I was thinking a Macro or a function would be a good way to go but I'm not sure the best approach.
This is the code that executes afterward:
<#if idString_index % 2 == 0 && idString_has_next == false>
<!-- INCLUDE SINGLE CODE -->
<#elseif idString_index % 2 == 0 && idString_has_next == true>
<!-- Include LEFT SIDE CODE -->
<#else>
<!-- INCLUDE RIGHT SIDE CODE -->
</#if>
来源:https://stackoverflow.com/questions/46051640/freemarker-removing-values-from-list-when-they-are-missing-from-another-table