Commit 21f17d10 by guojuxing

过滤默认规则,防止重复

parent d28a5223
......@@ -212,6 +212,11 @@ public class ConfigRuleEnterpriseApiServiceImpl implements ConfigRuleEnterpriseA
if (CollectionUtils.isEmpty(resultList)) {
resultList = new ArrayList<>(1);
}
//过滤默认规则,防止重复
resultList = resultList
.stream()
.filter(e -> !e.getEnterpriseRuleId().toString().equals(defaultRule.getEnterpriseRuleId().toString()))
.collect(Collectors.toList());
resultList.add(0, new RuleEnterpriseDTO().setEnterpriseRuleId(defaultRule.getEnterpriseRuleId())
.setRuleName(record.getRuleName()).setEnterpriseId(-1));
resultPage.setResult(resultList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment