Browse Source

REPORT-83316 && REPORT-83320 && REPORT-83488 && REPORT-83493 数据脱敏一期迭代bug

【问题原因】根据review意见,抽出方法
【改动思路】根据review意见,抽出方法
【review建议】
feature/x
Yvan-欧阳帆 2 years ago
parent
commit
4c0a748946
  1. 15
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java

15
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<TableDataDesensitizationItem> 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中的规则替换为最新规则防止平台规则被临时修改
*/

Loading…
Cancel
Save