From 4c0a7489464acf5352132b2758d8c2fc4a0a46de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Wed, 11 Jan 2023 11:25:37 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-83316=20&&=20REPORT-83320=20&&=20REPORT-?= =?UTF-8?q?83488=20&&=20REPORT-83493=20=E6=95=B0=E6=8D=AE=E8=84=B1?= =?UTF-8?q?=E6=95=8F=E4=B8=80=E6=9C=9F=E8=BF=AD=E4=BB=A3bug=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?review=E6=84=8F=E8=A7=81=EF=BC=8C=E6=8A=BD=E5=87=BA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91=E6=A0=B9=E6=8D=AEreview=E6=84=8F=E8=A7=81=EF=BC=8C?= =?UTF-8?q?=E6=8A=BD=E5=87=BA=E6=96=B9=E6=B3=95=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TableDataPreviewDesensitizeManager.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index 3d8fc8d02b..29e12bfaf4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -82,8 +82,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage dealWithLastedRules(desensitizationItems); // 对脱敏配置项集合做过滤和排序处理 List items = desensitizationItems.stream() - .filter(item -> item.getRule().isEnable() && - matchColumnIndex(item, model) >= 0) + .filter(item -> isAvaliableItem4Preview(item, model)) .sorted(Comparator.comparingInt(item -> matchColumnIndex(item, model))) .collect(Collectors.toList()); // 然后转换成Map @@ -95,6 +94,18 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage return new DesensitizedPreviewTableModel(model, desensitizationItemMap); } + /** + * 判断是否为有效的用于预览脱敏效果的DesensitizationItem + * + * @param item 脱敏配置项 + * @param model 数据集预览数据 + * @return + */ + private boolean isAvaliableItem4Preview(TableDataDesensitizationItem item, PreviewTableModel model) { + return item.getRule().isEnable() && + matchColumnIndex(item, model) >= 0; + } + /** * 在预览计算前,将Item中的规则替换为最新规则(防止平台规则被临时修改) */