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